ATLAS Offline Software
SCT_ClusterValidationNtupleWriter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SCT_ClusterValidationNtupleWriter.h
8 
9 #ifndef INDET_SCT_CLUSTERVALIDATIONNTUPLEWRITER_H
10 #define INDET_SCT_CLUSTERVALIDATIONNTUPLEWRITER_H
11 
12 // Gaudi includes
14 
15 #include "InDetPrepRawData/SCT_ClusterContainer.h" // typedef
25 
26 #include <set>
27 #include <string>
28 #include <vector>
29 
30 class SCT_ID;
31 class TTree;
32 
33 namespace InDet {
34 
45  public:
47  SCT_ClusterValidationNtupleWriter(const std::string& name, ISvcLocator* pSvcLocator);
50 
52  virtual StatusCode initialize() override;
54  virtual StatusCode execute() override;
56  virtual StatusCode finalize() override;
57 
58  private:
59 
60  const SCT_ID* m_sctid;
62  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo", "key for xAOD::EventInfo"};
63  SG::ReadHandleKey<SCT_ClusterContainer> m_jo_riocontainername{this, "SCT_ClusterContainer", "SCT_Clusters", "jobOption: name of container with RIOs"};
64  SG::ReadHandleKey<SCT_RDO_Container> m_dataObjectName{this, "SCT_RDOContainer", "SCT_RDOs", "Data object name: for the SCT this is SCT_RDOs"};
65  SG::ReadHandleKey<SpacePointContainer> m_spacePointContainerName{this, "SCT_SpacePointContainer", "SCT_SpacePoints", "SpacePoint container name: for the SCT this is SCT_SpacePoints"};
66  SG::ReadHandleKey<TrackCollection> m_inputTrackCollection{this, "SCT_InputTrackCollection", "CombinedInDetTracks", "TrackCollection name, needed for hits-on-tracks, default is CombinedInDetTracks"};
67 
68  // For P->T converter of SCT_Clusters
69  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
70 
71  ToolHandle<ISCT_ByteStreamErrorsTool> m_byteStreamErrTool{this, "ByteStreamErrTool", "SCT_ByteStreamErrorsTool", "Tool to retrieve SCT ByteStream Errors"};
72  ToolHandle<ISCT_CablingTool> m_cabling{this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"};
73  StringProperty m_ntupleFileName{this, "NtupleFileName", "/NTUPLES/FILE1"};
74  StringProperty m_ntupleDirName{this, "NtupleDirectoryName", "FitterValidation"};
75  StringProperty m_ntupleTreeName{this, "NtupleTreeName", "RIOs"};
76  BooleanProperty m_fillCluster{this, "FillCluster", false};
77  BooleanProperty m_fillRDO{this, "FillRDO", true};
78  BooleanProperty m_fillSpacePoint{this, "FillSpacePoint", false};
79  BooleanProperty m_fillBSErrs{this, "FillBSErrs", true};
80  BooleanProperty m_doHitsOnTracks{this, "DoHitsOnTracks", false};
81 
83  TTree* m_nt;
84 
85  // --- ntuple items. Pls describe here to allow copying to wiki+doxygen ---
91 
92  // ntuple items for SCT clusters
93  int m_nRIOs;
94  std::vector<float>* m_rioLoc1;
95  std::vector<float>* m_rioSurfaceX;
96  std::vector<float>* m_rioSurfaceY;
97  std::vector<float>* m_rioSurfaceZ;
98  std::vector<int>* m_SctBarrelEndcap;
99  std::vector<int>* m_SctLayerDisk;
100  std::vector<int>* m_SctEtaModule;
101  std::vector<int>* m_SctPhiModule;
102  std::vector<int>* m_SctSide;
103  std::vector<float>* m_SctDeltaPhi;
104  std::vector<float>* m_SctHitErr;
105 
106  //SpacePoints
107  int m_nSP;
108  std::vector<int>* m_sp_bec;
109  std::vector<int>* m_sp_layer;
110  std::vector<int>* m_sp_eta;
111  std::vector<int>* m_sp_phi;
112  std::vector<float>* m_sp_x;
113  std::vector<float>* m_sp_y;
114  std::vector<float>* m_sp_z;
115 
116  // RDO
117  int m_nRDOs;
118  std::vector<int>* m_sct_rdoGroupSize;
119  std::vector<int>* m_sct_rdoIsOnTrack;
120  std::vector<int>* m_sct_layer;
121  std::vector<int>* m_sct_eta;
122  std::vector<int>* m_sct_phi;
123  std::vector<int>* m_sct_side;
124  std::vector<int>* m_sct_barrelec;
125  std::vector<int>* m_sct_firstStrip;
126  std::vector<int>* m_sct_numHitsInWafer;
127  std::vector<int>* m_sct_waferHash;
128  std::vector<int>* m_sct_tbin;
129  std::vector<int>* m_sct_rodid;
130  std::vector<int>* m_sct_channel;
131 
132  /* ByteStream errors: these variables represent a bit set in the header or trailer for a
133  link (i.e. SCT module side) in the Bytestream, indicating that the ROD found
134  something wrong for that event for that link. In general, the ROD expects to
135  get from each link for each event: [link header] [zero or more hits] [link trailer].
136  These errors can either be a bit in the header or the trailer, or they can take the place
137  of a hit (for the ABCD or Raw) errors. */
139  std::vector<int>* m_scterr_bec;
140  std::vector<int>* m_scterr_layer;
141  std::vector<int>* m_scterr_eta;
142  std::vector<int>* m_scterr_phi;
143  std::vector<int>* m_scterr_side;
144  std::vector<int>* m_scterr_rodid;
145  std::vector<int>* m_scterr_channel;
146  std::vector<int>* m_scterr_type;
147 
148  };
149 
150 } // close of namespace
151 
152 #endif // INDET_SCT_CLUSTERVALIDATIONNTUPLEWRITER_H
InDet::SCT_ClusterValidationNtupleWriter::m_sp_z
std::vector< float > * m_sp_z
z position of SpacePoint in ATLAS coordinate system (mm)
Definition: SCT_ClusterValidationNtupleWriter.h:114
InDet::SCT_ClusterValidationNtupleWriter::m_sct_eta
std::vector< int > * m_sct_eta
eta of the SCT wafer
Definition: SCT_ClusterValidationNtupleWriter.h:121
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
InDet::SCT_ClusterValidationNtupleWriter::m_sct_phi
std::vector< int > * m_sct_phi
phi of the SCT wafer
Definition: SCT_ClusterValidationNtupleWriter.h:122
ISCT_ByteStreamErrorsTool.h
InDet::SCT_ClusterValidationNtupleWriter::m_sct_rdoGroupSize
std::vector< int > * m_sct_rdoGroupSize
RDO group size.
Definition: SCT_ClusterValidationNtupleWriter.h:118
InDet::SCT_ClusterValidationNtupleWriter::m_eventNumber
int m_eventNumber
event number for current PRD vector
Definition: SCT_ClusterValidationNtupleWriter.h:87
InDet::SCT_ClusterValidationNtupleWriter::m_cabling
ToolHandle< ISCT_CablingTool > m_cabling
Definition: SCT_ClusterValidationNtupleWriter.h:72
InDet::SCT_ClusterValidationNtupleWriter::execute
virtual StatusCode execute() override
standard Athena-Algorithm method
Definition: SCT_ClusterValidationNtupleWriter.cxx:243
InDet::SCT_ClusterValidationNtupleWriter::m_sct_side
std::vector< int > * m_sct_side
side of the SCT wafer (0 or 1) within the SCT module
Definition: SCT_ClusterValidationNtupleWriter.h:123
InDet::SCT_ClusterValidationNtupleWriter::m_scterr_rodid
std::vector< int > * m_scterr_rodid
online ID of ROD containing link
Definition: SCT_ClusterValidationNtupleWriter.h:144
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::SCT_ClusterValidationNtupleWriter::m_sp_bec
std::vector< int > * m_sp_bec
Barrel or endcap index (barrel: 0, endcap: +/-2) for SpacePoint.
Definition: SCT_ClusterValidationNtupleWriter.h:108
InDet::SCT_ClusterValidationNtupleWriter::m_sct_numHitsInWafer
std::vector< int > * m_sct_numHitsInWafer
number of hits in the SCT wafer
Definition: SCT_ClusterValidationNtupleWriter.h:126
InDet::SCT_ClusterValidationNtupleWriter::m_spacePointContainerName
SG::ReadHandleKey< SpacePointContainer > m_spacePointContainerName
Definition: SCT_ClusterValidationNtupleWriter.h:65
InDet::SCT_ClusterValidationNtupleWriter::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: SCT_ClusterValidationNtupleWriter.h:62
InDet::SCT_ClusterValidationNtupleWriter::~SCT_ClusterValidationNtupleWriter
~SCT_ClusterValidationNtupleWriter()=default
Default Destructor.
InDet::SCT_ClusterContainer
Trk::PrepRawDataContainer< SCT_ClusterCollection > SCT_ClusterContainer
Definition: SCT_ClusterContainer.h:27
InDet::SCT_ClusterValidationNtupleWriter::m_dataObjectName
SG::ReadHandleKey< SCT_RDO_Container > m_dataObjectName
Definition: SCT_ClusterValidationNtupleWriter.h:64
InDet::SCT_ClusterValidationNtupleWriter::m_sct_rdoIsOnTrack
std::vector< int > * m_sct_rdoIsOnTrack
RDO on track.
Definition: SCT_ClusterValidationNtupleWriter.h:119
SG::ReadHandleKey< xAOD::EventInfo >
InDet::SCT_ClusterValidationNtupleWriter::m_sct_rodid
std::vector< int > * m_sct_rodid
ROD ID of the RDO.
Definition: SCT_ClusterValidationNtupleWriter.h:129
InDet::SCT_ClusterValidationNtupleWriter::m_ntupleDirName
StringProperty m_ntupleDirName
jobOption: Ntuple directory name
Definition: SCT_ClusterValidationNtupleWriter.h:74
InDet::SCT_ClusterValidationNtupleWriter::m_nRIOs
int m_nRIOs
number of RIOs, i.e.
Definition: SCT_ClusterValidationNtupleWriter.h:93
InDet::SCT_ClusterValidationNtupleWriter::m_SctPhiModule
std::vector< int > * m_SctPhiModule
from IdHelper: module index in phi
Definition: SCT_ClusterValidationNtupleWriter.h:101
SpacePointContainer.h
InDet::SCT_ClusterValidationNtupleWriter::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: SCT_ClusterValidationNtupleWriter.h:69
InDet::SCT_ClusterValidationNtupleWriter::m_lumiBlock
int m_lumiBlock
event lumi block information
Definition: SCT_ClusterValidationNtupleWriter.h:88
AthAlgorithm.h
InDet::SCT_ClusterValidationNtupleWriter::m_timeStamp
int m_timeStamp
event time stamp
Definition: SCT_ClusterValidationNtupleWriter.h:89
InDet::SCT_ClusterValidationNtupleWriter::m_scterr_side
std::vector< int > * m_scterr_side
side of the SCT wafer (0 or 1) within the module
Definition: SCT_ClusterValidationNtupleWriter.h:143
SCT_RDO_Container.h
InDet::SCT_ClusterValidationNtupleWriter::m_SctHitErr
std::vector< float > * m_SctHitErr
please provide description!
Definition: SCT_ClusterValidationNtupleWriter.h:104
InDet::SCT_ClusterValidationNtupleWriter::m_doHitsOnTracks
BooleanProperty m_doHitsOnTracks
flag to book, access and fill RDO isOnTrack or not
Definition: SCT_ClusterValidationNtupleWriter.h:80
InDet::SCT_ClusterValidationNtupleWriter::m_SctLayerDisk
std::vector< int > * m_SctLayerDisk
from IdHelper: layer/disk index
Definition: SCT_ClusterValidationNtupleWriter.h:99
InDet::SCT_ClusterValidationNtupleWriter::m_rioSurfaceX
std::vector< float > * m_rioSurfaceX
global x coordinate of SCT wafer center UNIT:mm
Definition: SCT_ClusterValidationNtupleWriter.h:95
InDet::SCT_ClusterValidationNtupleWriter::m_fillRDO
BooleanProperty m_fillRDO
flag to book, access and fill RDO or not
Definition: SCT_ClusterValidationNtupleWriter.h:77
InDet::SCT_ClusterValidationNtupleWriter::m_scterr_layer
std::vector< int > * m_scterr_layer
layer (barrel) or disk (endcap) of wafer with the error
Definition: SCT_ClusterValidationNtupleWriter.h:140
InDet::SCT_ClusterValidationNtupleWriter::SCT_ClusterValidationNtupleWriter
SCT_ClusterValidationNtupleWriter(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: SCT_ClusterValidationNtupleWriter.cxx:32
InDet::SCT_ClusterValidationNtupleWriter::m_sct_channel
std::vector< int > * m_sct_channel
channel within ROD of the RDO
Definition: SCT_ClusterValidationNtupleWriter.h:130
InDet::SCT_ClusterValidationNtupleWriter::m_fillCluster
BooleanProperty m_fillCluster
flag to book, access and fill Cluster or not
Definition: SCT_ClusterValidationNtupleWriter.h:76
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::SCT_ClusterValidationNtupleWriter::m_runNumber
int m_runNumber
run number
Definition: SCT_ClusterValidationNtupleWriter.h:86
InDet::SCT_ClusterValidationNtupleWriter::m_scterr_channel
std::vector< int > * m_scterr_channel
online channel no.
Definition: SCT_ClusterValidationNtupleWriter.h:145
InDet::SCT_ClusterValidationNtupleWriter::m_rioLoc1
std::vector< float > * m_rioLoc1
local x coordinate of strip UNIT:mm
Definition: SCT_ClusterValidationNtupleWriter.h:94
InDet::SCT_ClusterValidationNtupleWriter::m_jo_riocontainername
SG::ReadHandleKey< SCT_ClusterContainer > m_jo_riocontainername
Definition: SCT_ClusterValidationNtupleWriter.h:63
TrackCollection.h
InDet::SCT_ClusterValidationNtupleWriter::m_sp_x
std::vector< float > * m_sp_x
x position of SpacePoint in ATLAS coordinate system (mm)
Definition: SCT_ClusterValidationNtupleWriter.h:112
InDet::SCT_ClusterValidationNtupleWriter::m_SctBarrelEndcap
std::vector< int > * m_SctBarrelEndcap
from IdHelper: pos/neg barrel (+/-1) and pos/neg endcap (+/-2) UNIT:1:bar, 2:ec
Definition: SCT_ClusterValidationNtupleWriter.h:98
InDet::SCT_ClusterValidationNtupleWriter::m_ntupleFileName
StringProperty m_ntupleFileName
jobOption: Ntuple file name
Definition: SCT_ClusterValidationNtupleWriter.h:73
InDet::SCT_ClusterValidationNtupleWriter::m_sct_firstStrip
std::vector< int > * m_sct_firstStrip
index (could be from 0 to 767) of the fired strip within the SCT wafer
Definition: SCT_ClusterValidationNtupleWriter.h:125
InDet::SCT_ClusterValidationNtupleWriter::m_sp_eta
std::vector< int > * m_sp_eta
eta index of the SCT-layer in which the SCT wafer is positioned for SpacePoint
Definition: SCT_ClusterValidationNtupleWriter.h:110
InDet::SCT_ClusterValidationNtupleWriter::m_SctSide
std::vector< int > * m_SctSide
from IdHelper: side index (0/1)
Definition: SCT_ClusterValidationNtupleWriter.h:102
InDet::SCT_ClusterValidationNtupleWriter::m_sct_waferHash
std::vector< int > * m_sct_waferHash
index (could be from 0 to 8175) of the fired SCT wafer
Definition: SCT_ClusterValidationNtupleWriter.h:127
InDet::SCT_ClusterValidationNtupleWriter::m_ntupleTreeName
StringProperty m_ntupleTreeName
jobOption: Ntuple tree name
Definition: SCT_ClusterValidationNtupleWriter.h:75
InDet::SCT_ClusterValidationNtupleWriter::m_SctEtaModule
std::vector< int > * m_SctEtaModule
from IdHelper: module index in eta
Definition: SCT_ClusterValidationNtupleWriter.h:100
InDet::SCT_ClusterValidationNtupleWriter::m_SctDeltaPhi
std::vector< float > * m_SctDeltaPhi
please provide description!
Definition: SCT_ClusterValidationNtupleWriter.h:103
InDet::SCT_ClusterValidationNtupleWriter::m_totalNumErrors
int m_totalNumErrors
total number of BS errors.
Definition: SCT_ClusterValidationNtupleWriter.h:138
InDet::SCT_ClusterValidationNtupleWriter::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: SCT_ClusterValidationNtupleWriter.cxx:89
AthAlgorithm
Definition: AthAlgorithm.h:47
ReadCondHandleKey.h
InDet::SCT_ClusterValidationNtupleWriter::m_nSP
int m_nSP
Definition: SCT_ClusterValidationNtupleWriter.h:107
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDet::SCT_ClusterValidationNtupleWriter::m_scterr_type
std::vector< int > * m_scterr_type
type of BS error (as defined in SCT_ByteStreamErrs enum in ISCT_ByteStreamErrorsSvc....
Definition: SCT_ClusterValidationNtupleWriter.h:146
SiDetectorElementCollection.h
EventInfo.h
InDet::SCT_ClusterValidationNtupleWriter::m_rioSurfaceZ
std::vector< float > * m_rioSurfaceZ
global x coordinate of SCT wafer center UNIT:mm
Definition: SCT_ClusterValidationNtupleWriter.h:97
InDet::SCT_ClusterValidationNtupleWriter::m_fillSpacePoint
BooleanProperty m_fillSpacePoint
flag to book, access and fill SpacePoints or not
Definition: SCT_ClusterValidationNtupleWriter.h:78
InDet::SCT_ClusterValidationNtupleWriter::m_sp_y
std::vector< float > * m_sp_y
y position of SpacePoint in ATLAS coordinate system (mm)
Definition: SCT_ClusterValidationNtupleWriter.h:113
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
InDet::SCT_ClusterValidationNtupleWriter::m_nRDOs
int m_nRDOs
Number of RDOs.
Definition: SCT_ClusterValidationNtupleWriter.h:117
InDet::SCT_ClusterValidationNtupleWriter::m_sct_tbin
std::vector< int > * m_sct_tbin
timebin of the RDO
Definition: SCT_ClusterValidationNtupleWriter.h:128
InDet::SCT_ClusterValidationNtupleWriter::m_sct_layer
std::vector< int > * m_sct_layer
index of the SCT-layer in which the SCT wafer is positioned
Definition: SCT_ClusterValidationNtupleWriter.h:120
InDet::SCT_ClusterValidationNtupleWriter::m_sct_barrelec
std::vector< int > * m_sct_barrelec
barrel/endcap index (barrel: 0, endcap: +/-2)
Definition: SCT_ClusterValidationNtupleWriter.h:124
SCT_ID
Definition: SCT_ID.h:68
InDet::SCT_ClusterValidationNtupleWriter::m_sctid
const SCT_ID * m_sctid
SCT ID helper.
Definition: SCT_ClusterValidationNtupleWriter.h:60
InDet::SCT_ClusterValidationNtupleWriter::m_sp_layer
std::vector< int > * m_sp_layer
index of the SCT-layer in which the SCT wafer is positioned for SpacePoint
Definition: SCT_ClusterValidationNtupleWriter.h:109
InDet::SCT_ClusterValidationNtupleWriter::m_scterr_eta
std::vector< int > * m_scterr_eta
eta of the SCT wafer
Definition: SCT_ClusterValidationNtupleWriter.h:141
SCT_ClusterContainer.h
InDet::SCT_ClusterValidationNtupleWriter::m_fillBSErrs
BooleanProperty m_fillBSErrs
flag to book, access and fill ByteStream errors or not
Definition: SCT_ClusterValidationNtupleWriter.h:79
ISCT_CablingTool.h
InDet::SCT_ClusterValidationNtupleWriter::m_bunchCrossing
int m_bunchCrossing
event bunch crossing ID
Definition: SCT_ClusterValidationNtupleWriter.h:90
InDet::SCT_ClusterValidationNtupleWriter::finalize
virtual StatusCode finalize() override
standard Athena-Algorithm method
Definition: SCT_ClusterValidationNtupleWriter.cxx:598
InDet::SCT_ClusterValidationNtupleWriter
Definition: SCT_ClusterValidationNtupleWriter.h:44
InDet::SCT_ClusterValidationNtupleWriter::m_rioSurfaceY
std::vector< float > * m_rioSurfaceY
global x coordinate of SCT wafer center UNIT:mm
Definition: SCT_ClusterValidationNtupleWriter.h:96
InDet::SCT_ClusterValidationNtupleWriter::m_byteStreamErrTool
ToolHandle< ISCT_ByteStreamErrorsTool > m_byteStreamErrTool
Definition: SCT_ClusterValidationNtupleWriter.h:71
InDet::SCT_ClusterValidationNtupleWriter::m_scterr_phi
std::vector< int > * m_scterr_phi
phi of the SCT wafer
Definition: SCT_ClusterValidationNtupleWriter.h:142
InDet::SCT_ClusterValidationNtupleWriter::m_riocontainer
const InDet::SCT_ClusterContainer * m_riocontainer
container of RIOs
Definition: SCT_ClusterValidationNtupleWriter.h:61
InDet::SCT_ClusterValidationNtupleWriter::m_nt
TTree * m_nt
pointer to the ntuple tree.
Definition: SCT_ClusterValidationNtupleWriter.h:83
InDet::SCT_ClusterValidationNtupleWriter::m_sp_phi
std::vector< int > * m_sp_phi
phi index of the SCT-layer in which the SCT wafer is positioned for SpacePoint
Definition: SCT_ClusterValidationNtupleWriter.h:111
InDet::SCT_ClusterValidationNtupleWriter::m_inputTrackCollection
SG::ReadHandleKey< TrackCollection > m_inputTrackCollection
Definition: SCT_ClusterValidationNtupleWriter.h:66
InDet::SCT_ClusterValidationNtupleWriter::m_scterr_bec
std::vector< int > * m_scterr_bec
barrel/endcap index (barrel: 0, endcap: +/-2)
Definition: SCT_ClusterValidationNtupleWriter.h:139