Commit 68d71a87 authored by Shaun Roe's avatar Shaun Roe Committed by Graeme Stewart
Browse files

fix checkreq warnings (SiSpacePointFormation-01-00-01)

parent 48972c1f
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/***************************************************************************
This class contains some element properties that are used in
SiSpacePointFormation
: ie the wafer widths and wafer neighbours. These are cached during
SiSpacePointFormation initialization for the sake of efficiency.
ATLAS Collaboration
***************************************************************************/
#ifndef SISPACEPOINTFORMATION_SIELEMENTPROPERTIES_H
#define SISPACEPOINTFORMATION_SIELEMENTPROPERTIES_H
#include <vector>
#include "Identifier/IdentifierHash.h"
#include "InDetReadoutGeometry/SiDetectorElement.h"
class SCT_ID;
namespace InDet {
class SiElementProperties
{
public:
SiElementProperties(const IdentifierHash& idHash,
const SCT_ID& idHelper,
const InDetDD::SiDetectorElement& element,
float epsilonWidth);
~SiElementProperties();
std::vector<IdentifierHash>* neighbours (void);
float halfWidth (void);
private:
std::vector<IdentifierHash> m_neighbours;
float m_halfWidth;
};
//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
//--------------------------------------------------------------------------
inline std::vector<IdentifierHash>*
SiElementProperties::neighbours()
{
return &m_neighbours;
}
//----------------------------------------------------------------------------
inline float
SiElementProperties::halfWidth()
{
return m_halfWidth;
}
//----------------------------------------------------------------------------
}
#endif // SISPACEPOINTFORMATION_SIELEMENTPROPERTIES_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/***************************************************************************
Stores properties that are needed in SiSpacePointFinder.
--------------------------------------------------------
ATLAS Collaboration
***************************************************************************/
// $Id: SiElementPropertiesTable.h,v 1.3 2009-01-07 17:50:36 markuse Exp $
#ifndef SISPACEPOINTFORMATION_SIELEMENTPROPERTIESTABLE_H
#define SISPACEPOINTFORMATION_SIELEMENTPROPERTIESTABLE_H
#include <vector>
#include "Identifier/IdentifierHash.h"
#include "InDetReadoutGeometry/SCT_DetectorManager.h"
#include "SiSpacePointFormation/SiElementProperties.h"
class SiDetectorElementCollection;
namespace InDet {
class SiElementPropertiesTable
{
public:
SiElementPropertiesTable(const SCT_ID& idHelper,
const InDetDD::SiDetectorElementCollection& elements,
float epsilonWidth);
~SiElementPropertiesTable();
std::vector<IdentifierHash>* neighbours(const IdentifierHash& waferID);
float halfWidth(IdentifierHash hashID);
private:
std::vector<SiElementProperties*> m_properties;
const InDetDD::SiDetectorElementCollection& m_elements;
float m_epsilonWidth; //tolerance for strip overlap limits.
int m_maxSCT;
InDetDD::SiDetectorElementCollection* m_elemnts;
std::vector<SiElementProperties*>::const_iterator m_propertiesBegin;
};
inline std::vector<IdentifierHash>*
SiElementPropertiesTable::neighbours(const IdentifierHash& waferID)
{
return (m_properties[(unsigned int)waferID])->neighbours();
}
inline float
SiElementPropertiesTable::halfWidth(IdentifierHash waferID)
{
return (m_properties[(unsigned int)waferID])->halfWidth();
}
}
#endif // SISPACEPOINTFORMATION_SIELEMENTPROPERTIESTABLE_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/***************************************************************************
This version of PointFinder uses SiCluster to find space points in
the pixel and SCT detectors. The algorithm retrieves all clusters from
StoreGate by type and uses the begin-end iterators to iterate over the
clusters. It does not (for efficiency reasons) use the IdentifiableContainer
iterator here. It then has to see whether the next cluster is a pixel or
SCT cluster. Pixel space points are obtained directly from the clusters.
To make SCT space points we also need the IdentifiableContainer for the
SCT clusters, since we need random access to find overlapping detectors on the
stereo layer. Space points are made by combining clusters from pairs of
overlapping detectors. The user can choose just to process the phi wafer and
its opposite on the stereo layer, or also to consider overlaps with the
four nearest neighbours of the opposite wafer.
The space points are wrtten to Storegate as SpacePointContainer for Pixels
and non-overlapping SCT space points and as SpacePointOverlapCollection for
the overlapping ones.
Job Options:
Process pixels: default true
Process SCTs: default true
Process overlaps: default true
SCT IdentifiableContainer name: default ""
SpacePointSet name: default ""
Fatal Errors:
neither pixels nor SCTs selected
SCTs selected and no name for SCT Identifiable Collection
No name for SpacePointSet
Failure to retrieve event
StoreGate failure.
Possible errors for which processing contnues:
No clusters found for event
***************************************************************************
Implementation of SCT_Neighbours has data members stored as a vector
ATLAS Collaboration
***************************************************************************/
#ifndef SiSpacePointFormation_SI_POINT_FINDER_H
#define SiSpacePointFormation_SI_POINT_FINDER_H
#include "AthenaBaseComps/AthAlgorithm.h"
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include "DataModel/DataVector.h"
#include "Identifier/Identifier.h"
#include "SiSpacePointTool/SiSpacePointMakerTool.h"
#include "InDetPrepRawData/PixelClusterCollection.h"
#include "InDetPrepRawData/SCT_ClusterCollection.h"
#include "TrkSpacePoint/SpacePoint.h"
#include <string>
#include "InDetPrepRawData/SiClusterContainer.h"
#include "InDetPrepRawData/PixelClusterContainer.h"
#include "InDetPrepRawData/SCT_ClusterContainer.h"
#include "GeoPrimitives/GeoPrimitives.h"
class Event;
class SpacePointCollection;
class SpacePointOverlapCollection;
class SpacePointContainer;
class SvcLocator;
class SCT_NeighboursTable;
class SCT_ID;
class PixelID;
class IBeamCondSvc;
namespace InDetDD {
class SCT_DetectorManager;
class PixelDetectorManager;
}
namespace InDet {
class SiElementPropertiesTable;
class SiTrackerSpacePointFinder:public AthAlgorithm {
public:
SiTrackerSpacePointFinder(const std::string& name,
ISvcLocator* pSvcLocator);
~SiTrackerSpacePointFinder();
StatusCode initialize();
StatusCode execute();
StatusCode finalize();
private:
// methods
void addSCT_SpacePoints
(const SCT_ClusterCollection* next,
SpacePointCollection* spacepointCollection);
void checkForSCT_Points
(const SCT_ClusterCollection* clusters1,
const IdentifierHash& id2, double minDiff, double maxDiff,
SpacePointCollection* spacepointCollection, bool overlapColl);
void checkForSCT_Points
(const SCT_ClusterCollection* clusters1,
const IdentifierHash& id2, double min1, double max1,
double min2, double max2);
std::string intString(int n);
// data members
std::string m_SCT_ClustersName;
std::string m_PixelsClustersName;
std::string m_spacePointsSCTName;
std::string m_spacePointsPixelName;
std::string m_spacePointsOverlapName;
const SCT_ClusterContainer* m_Sct_clcontainer;
const PixelClusterContainer* m_Pixel_clcontainer;
bool m_selectPixels;
bool m_selectSCTs;
bool m_overlap; // process all overlapping SCT pairs if true.
bool m_allClusters; // process all clusters without limits if true.
// The following are ranges within which clusters must lie to
// make a spacepoint. Opposite and eta neighbours
// clusters must lie within range of each other.
// Phi clusters must lie in region of each wafer separately.
float m_overlapLimitOpposite; // overlap limit for opposite-neighbours.
float m_overlapLimitPhi; // overlap limit for phi-neighbours.
float m_overlapLimitEtaMin; // low overlap limit for eta-neighbours.
float m_overlapLimitEtaMax; // high overlap limit for eta-neighbours.
float m_epsWidth; // safety margin for half-width.
bool m_overrideBS;
float m_xVertex;
float m_yVertex;
float m_zVertex;
Amg::Vector3D m_vertex;
ServiceHandle<IBeamCondSvc> m_iBeamCondSvc;
Event* m_event;
int m_numberOfEvents;
const InDetDD::SCT_DetectorManager* m_manager;
// const InDetDD::PixelDetectorManager* m_managerPixel; // unused
const SCT_ID* m_idHelper;
const PixelID* m_idHelperPixel;
SiElementPropertiesTable* m_properties;
SpacePointContainer* m_SpacePointContainer_SCT;
SpacePointContainer* m_SpacePointContainerPixel;
SpacePointOverlapCollection* m_spacepointoverlapCollection;
ToolHandle< SiSpacePointMakerTool > m_SiSpacePointMakerTool;
};
}
#endif // SiSpacePointFormation_SI_POINT_FINDER_H
package SiSpacePointFormation
manager Maria Jose Costa <Maria.Jose.Costa@cern.ch>
author Maria Jose Costa <Maria.Jose.Costa@cern.ch>
public
use AtlasPolicy AtlasPolicy-*
#use AtlasCLHEP AtlasCLHEP-* External
use GaudiInterface GaudiInterface-* External
use AthenaBaseComps AthenaBaseComps-* Control
use DataModel DataModel-* Control
use Identifier Identifier-* DetectorDescription
use InDetReadoutGeometry InDetReadoutGeometry-* InnerDetector/InDetDetDescr
use SiSpacePointTool SiSpacePointTool-* InnerDetector/InDetRecTools
use InDetPrepRawData InDetPrepRawData-* InnerDetector/InDetRecEvent
use TrkSpacePoint TrkSpacePoint-* Tracking/TrkEvent
use GeoPrimitives GeoPrimitives-* DetectorDescription
private
use AtlasDetDescr AtlasDetDescr-* DetectorDescription
use EventInfo EventInfo-* Event
use InDetBeamSpotService InDetBeamSpotService-* InnerDetector/InDetConditions
use InDetIdentifier InDetIdentifier-* InnerDetector/InDetDetDescr
#use TrkEventPrimitives TrkEventPrimitives-* Tracking/TrkEvent
public
# needed by trigger using some classes
apply_pattern dual_use_library files="*.cxx"
#library SiSpacePointFormation *.cxx components/*.cxx
#apply_pattern component_library
private
#macro cppdebugflags '$(cppdebugflags_s)'
#macro_remove componentshr_linkopts "-Wl,-s"
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
@mainpage SiSpacePointFormation Package
@author Maria.Jose.Costa@cern.ch (update of the original code from David
Candlin)
@section SiSpacePointFormationIntro Introduction
This package contains the algorithm to create Space Points for the Pixels and
SCT detectors. For the Pixels it is just a transformation of classes from
clusters to Space Points while for the SCT it combines the 1-dimensional
information of two SCT clusters into a Space Point.
This algorithm is used in the offline reconstruction.
@section SiSpacePointFormationOverview Algorithm Overview
The SiSpacePointFormation package contains the following algorithms:
- SiTrackerSpacePointFinder: It retrieves all the Pixels and SCT clusters
and creates the SpacePoints containers: one for Pixels and two for SCT
non-overlapping SpacePoints. The overlapping SCT SpacePoints are saved
in a different collection.
Non-overlapping means that a SpacePoint is created from 2 clusters of the
same module and overlapping when they are created from 2 clusters which
are in different but overlapping modules.
The algorithm uses the classes SiElementPropertiesTable and
SiElementProperties in order to access, for the SCT, the backside wafer
of a given module and the neighbour ones from other modules.
@section SiSpacePointFormationReq Requirements
@include requirements
*/
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/***************************************************************************
-------------------
ATLAS Collaboration
***************************************************************************/
#include "Identifier/Identifier.h"
#include "SiSpacePointFormation/SiElementProperties.h"
#include "InDetIdentifier/SCT_ID.h"
#include "InDetReadoutGeometry/SiDetectorElement.h"
namespace InDet{
SiElementProperties::SiElementProperties(const IdentifierHash& idHash,
const SCT_ID& idHelper,
const InDetDD::SiDetectorElement& element,
float epsilonWidth)
{
// construct vector of neighbours of this wafer.
Identifier compact;
IdContext idCntxt(idHelper.wafer_context());
int res = idHelper.get_id(idHash,compact, &idCntxt);
if (res) return; // cannot convert
//if (idHelper.side(compact)==0) return;
// if it is the stereo side do nothing
if (element.isStereo()) return;
IdentifierHash otherHash;
IdentifierHash neighbourHash;
res = idHelper.get_other_side(idHash, otherHash);
if (res==0) m_neighbours.push_back(otherHash);
res = idHelper.get_prev_in_phi(otherHash, neighbourHash);
if (res==0) m_neighbours.push_back(neighbourHash);
res = idHelper.get_next_in_phi(otherHash, neighbourHash);
if (res==0) m_neighbours.push_back(neighbourHash);
// These neighbours are only defined for barrel, and may fail
// because wafer is at one of the ends
if (idHelper.is_barrel(compact))
{
res = idHelper.get_prev_in_eta(otherHash, neighbourHash);
if (res ==0)
m_neighbours.push_back(neighbourHash);
res = idHelper.get_next_in_eta(otherHash, neighbourHash );
if (res ==0)
m_neighbours.push_back(neighbourHash);
}
// Find half width of wafer at centre
m_halfWidth = (element.design().minWidth()+element.design().maxWidth())/4
+ epsilonWidth; // add a bit for safety.
}
//-------------------------------------------------------------------------
SiElementProperties::~SiElementProperties()
{}
//----------------------------------------------------------------------------
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/***************************************************************************
-------------------
ATLAS Collaboration
***************************************************************************/
#include "InDetIdentifier/SCT_ID.h"
#include "InDetReadoutGeometry/SiDetectorDesign.h"
#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
#include "InDetReadoutGeometry/SiLocalPosition.h"
#include "SiSpacePointFormation/SiElementPropertiesTable.h"
namespace InDet{
SiElementPropertiesTable::SiElementPropertiesTable(const SCT_ID& idHelper,
const InDetDD::SiDetectorElementCollection& elements,
float epsilonWidth)
: m_elements (elements),
m_epsilonWidth (epsilonWidth)
{
m_maxSCT = idHelper.wafer_hash_max();
m_properties.reserve(m_maxSCT);
for (int i = 0; i < m_maxSCT; ++i)
{
IdentifierHash hash(i);
const InDetDD::SiDetectorElement* element = m_elements[hash];
if (element != 0)
{
SiElementProperties* props = new SiElementProperties(hash,
idHelper,
*element,
epsilonWidth);
m_properties[i] = props;
}
else
{
m_properties[i] = 0;
}
}
}
//--------------------------------------------------------------------------
SiElementPropertiesTable::~SiElementPropertiesTable()
{
for (int i=0; i < m_maxSCT; ++i)
{
delete m_properties[i];
}
}
//--------------------------------------------------------------------------
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/***************************************************************************
-------------------
ATLAS Collaboration
***************************************************************************/
//<<<<<< INCLUDES >>>>>>
#ifdef HAVE_NEW_IOSTREAMS
#include <iostream>
#include <fstream>
#else
#include <iostream.h>
#include <fstream.h>
#endif
#include <stdio.h>
#include "SiSpacePointFormation/SiTrackerSpacePointFinder.h"
#include "SiSpacePointFormation/SiElementPropertiesTable.h"
// For processing clusters
#include "InDetReadoutGeometry/SiLocalPosition.h"
#include "InDetReadoutGeometry/SiDetectorDesign.h"
#include "InDetReadoutGeometry/SiDetectorElement.h"
#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
// Space point Classes,
#include "TrkSpacePoint/SpacePoint.h"
#include "TrkSpacePoint/SpacePointCollection.h"
#include "TrkSpacePoint/SpacePointContainer.h"
#include "TrkSpacePoint/SpacePointOverlapCollection.h"
#include "TrkSpacePoint/SpacePointCLASS_DEF.h"
#include "InDetIdentifier/PixelID.h"
#include "InDetIdentifier/SCT_ID.h"
// general Atlas classes
#include "AtlasDetDescr/AtlasDetectorID.h"
#include "EventInfo/EventID.h"
#include "EventInfo/EventInfo.h"
#include "InDetBeamSpotService/IBeamCondSvc.h"
#include "GaudiKernel/PropertyMgr.h"
namespace InDet{
//------------------------------------------------------------------------
SiTrackerSpacePointFinder::SiTrackerSpacePointFinder(const std::string& name,
ISvcLocator* pSvcLocator)
: AthAlgorithm (name, pSvcLocator),
m_SCT_ClustersName ("SCT_Clusters"),
m_PixelsClustersName ("PixelClusters"),
m_spacePointsSCTName ("SCT_SpacePoints"),
m_spacePointsPixelName ("PixelSpacePoints"),
m_spacePointsOverlapName("OverlapSpacePoints"),
m_selectPixels (true),
m_selectSCTs( true),
m_overlap (true), // process overlaps of SCT wafers.
m_allClusters (false), // process all clusters without limits.
m_overlapLimitOpposite (2.8), // overlap limit for opposite-neighbour.
m_overlapLimitPhi (5.64), // overlap limit for phi-neighbours.
m_overlapLimitEtaMin (1.68), // low overlap limit for eta-neighbours.
m_overlapLimitEtaMax (3.0), // high overlap limit for eta-neighbours.
m_epsWidth (0.02), // safety margin for half-widths, in cm.
m_overrideBS (false),
m_xVertex (0.),
m_yVertex (0.),
m_zVertex (0.),
m_iBeamCondSvc ("BeamCondSvc",name),
m_event (0),
m_numberOfEvents (0),
m_idHelper (0),
m_idHelperPixel (0),
m_properties (0),
m_SpacePointContainer_SCT (0),
m_SpacePointContainerPixel (0),
m_spacepointoverlapCollection (0),
m_SiSpacePointMakerTool ("InDet::SiSpacePointMakerTool")
{