ATLAS Offline Software
PadTriggerValidationTree.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace NSWL1{
8  //------------------------------------------------------------------------------
10  m_tree(nullptr),
11  m_nPadTriggers(0),
12  m_padTriggerBCID(nullptr),
13  m_padTriggerModuleIDinner(nullptr),
14  m_padTriggerModuleIDouter(nullptr),
15  m_padTriggerSelectedLayersInner(nullptr),
16  m_padTriggerSelectedLayersOuter(nullptr),
17  m_padTriggerSelectedBandsInner(nullptr),
18  m_padTriggerSelectedBandsOuter(nullptr),
19  m_padTriggerPadEtaIndicesInner(nullptr),
20  m_padTriggerPadPhiIndicesInner(nullptr),
21  m_padTriggerPadEtaIndicesOuter(nullptr),
22  m_padTriggerPadPhiIndicesOuter(nullptr),
23  m_padTriggerRCenterMinInner(nullptr),
24  m_padTriggerRCenterMaxInner(nullptr),
25  m_padTriggerRCenterMinOuter(nullptr),
26  m_padTriggerRCenterMaxOuter(nullptr),
27  m_padTriggerSectorID(nullptr),
28  m_padTriggerSectorType(nullptr),
29  m_padTriggerSideID(nullptr),
30  m_padTriggerBandID(nullptr),
31  m_padTriggerEta(nullptr),
32  m_padTriggerPhi(nullptr),
33  m_padTriggerEtaID(nullptr),
34  m_padTriggerPhiID(nullptr),
35  m_padTriggerMultipletID(nullptr),
36  m_padTriggerEtamin(nullptr),
37  m_padTriggerEtamax(nullptr),
38  m_padTriggerPhimin(nullptr),
39  m_padTriggerPhimax(nullptr),
40  m_padTriggerlocalminYInner(nullptr),
41  m_padTriggerlocalmaxYInner(nullptr),
42  m_padTriggerlocalminYOuter(nullptr),
43  m_padTriggerlocalmaxYOuter(nullptr),
44  m_padTriggerIndex(nullptr)
45  {
46  }
47  //------------------------------------------------------------------------------
49  {
50  bool success=false;
51  if(tree){
52  m_tree = tree;
53  m_nPadTriggers = 0;
54  m_padTriggerBCID = new std::vector<unsigned int>();
55 
56  m_padTriggerModuleIDinner = new std::vector<int>();
57  m_padTriggerModuleIDouter = new std::vector<int>();
58  m_padTriggerSelectedLayersInner = new std::vector<std::vector<int>>();
59  m_padTriggerSelectedLayersOuter = new std::vector<std::vector<int>>();
60  m_padTriggerSelectedBandsInner = new std::vector<std::vector<int>>();
61  m_padTriggerSelectedBandsOuter = new std::vector<std::vector<int>>();
62  m_padTriggerPadEtaIndicesInner = new std::vector<std::vector<int>>();
63  m_padTriggerPadPhiIndicesInner = new std::vector<std::vector<int>>();
64  m_padTriggerPadEtaIndicesOuter = new std::vector<std::vector<int>>();
65  m_padTriggerPadPhiIndicesOuter = new std::vector<std::vector<int>>();
66  m_padTriggerRCenterMinInner = new std::vector<std::vector<float>>();
67  m_padTriggerRCenterMaxInner =new std::vector<std::vector<float>>();
68  m_padTriggerRCenterMinOuter= new std::vector<std::vector<float>>();
69  m_padTriggerRCenterMaxOuter=new std::vector<std::vector<float>>();
70 
71  m_padTriggerSectorID = new std::vector<int>();
72  m_padTriggerSectorType = new std::vector<int>();
73  m_padTriggerSideID = new std::vector<int>();
74  m_padTriggerIndex = new std::vector<int>();
75  m_padTriggerBandID = new std::vector<unsigned int>();
76  m_padTriggerEta = new std::vector<float>();
77  m_padTriggerPhi = new std::vector<float>();
78  m_padTriggerEtaID = new std::vector<int>();
79  m_padTriggerPhiID = new std::vector<int>();
80  m_padTriggerMultipletID = new std::vector<int>();
81  m_padTriggerEtamin =new std::vector<float>();
82  m_padTriggerEtamax =new std::vector<float>();
83  m_padTriggerPhimin =new std::vector<float>();
84  m_padTriggerPhimax =new std::vector<float>();
85  m_padTriggerlocalminYInner =new std::vector<std::vector<float>>();
86  m_padTriggerlocalmaxYInner =new std::vector<std::vector<float>>();
87  m_padTriggerlocalminYOuter =new std::vector<std::vector<float>>();
88  m_padTriggerlocalmaxYOuter =new std::vector<std::vector<float>>();
89 
90 
91  m_tree->Branch("nPadTriggers", &m_nPadTriggers,"nPadTriggers/i");
92  m_tree->Branch("padTriggerBCID", &m_padTriggerBCID);
93  m_tree->Branch("padTriggerSectorID", &m_padTriggerSectorID);
94  m_tree->Branch("padTriggerModuleIDinner",&m_padTriggerModuleIDinner);
95  m_tree->Branch("padTriggerModuleIDouter",&m_padTriggerModuleIDouter);
96  m_tree->Branch("padTriggerSelectedLayersInner",&m_padTriggerSelectedLayersInner);
97  m_tree->Branch("padTriggerSelectedLayersOuter",&m_padTriggerSelectedLayersOuter);
98  m_tree->Branch("padTriggerSelectedBandsInner",&m_padTriggerSelectedBandsInner);
99  m_tree->Branch("padTriggerSelectedBandsOuter",&m_padTriggerSelectedBandsOuter);
100  m_tree->Branch("padTriggerPadEtaIndicesInner",&m_padTriggerPadEtaIndicesInner);
101  m_tree->Branch("padTriggerPadPhiIndicesInner",&m_padTriggerPadPhiIndicesInner);
102  m_tree->Branch("padTriggerPadEtaIndicesOuter",&m_padTriggerPadEtaIndicesOuter);
103  m_tree->Branch("padTriggerPadPhiIndicesOuter",&m_padTriggerPadPhiIndicesOuter);
104  m_tree->Branch("padTriggerRCenterMinInner",&m_padTriggerRCenterMinInner);
105  m_tree->Branch("padTriggerRCenterMaxInner",&m_padTriggerRCenterMaxInner);
106  m_tree->Branch("padTriggerRCenterMinOuter",&m_padTriggerRCenterMinOuter);
107  m_tree->Branch("padTriggerRCenterMaxOuter",&m_padTriggerRCenterMaxOuter);
108  m_tree->Branch("padTriggerSectorType", &m_padTriggerSectorType);
109  m_tree->Branch("padTriggerSideID", &m_padTriggerSideID);
110  m_tree->Branch("padTriggerIndex", &m_padTriggerIndex);
111  m_tree->Branch("padTriggerBandID", &m_padTriggerBandID);
112  m_tree->Branch("padTriggerEta", &m_padTriggerEta);
113  m_tree->Branch("padTriggerPhi", &m_padTriggerPhi);
114  m_tree->Branch("padTriggerEtaID", &m_padTriggerEtaID);
115  m_tree->Branch("padTriggerPhiID", &m_padTriggerPhiID);
116  m_tree->Branch("padTriggerMultipletID", &m_padTriggerMultipletID);
117 
118  m_tree->Branch("padTriggerEtamin", &m_padTriggerEtamin);
119  m_tree->Branch("padTriggerEtamax", &m_padTriggerEtamax);
120  m_tree->Branch("padTriggerPhimin", &m_padTriggerPhimin);
121  m_tree->Branch("padTriggerPhimax", &m_padTriggerPhimax);
122 
123  m_tree->Branch("padTriggerlocalminYInner", &m_padTriggerlocalminYInner);
124  m_tree->Branch("padTriggerlocalmaxYInner", &m_padTriggerlocalmaxYInner);
125  m_tree->Branch("padTriggerlocalminYOuter", &m_padTriggerlocalminYOuter);
126  m_tree->Branch("padTriggerlocalmaxYOuter", &m_padTriggerlocalmaxYOuter);
127  // m_tree->Branch("nPadHits", &m_nPadHits,"nPadHits/i");
128  // m_tree->Branch("padGlobalX", &m_padGlobalX);
129  // m_tree->Branch("padGlobalY", &m_padGlobalY);
130  // m_tree->Branch("padGlobalZ", &m_padGlobalZ);
131  // m_tree->Branch("padTruthHitGlobalX", &m_padTruthHitGlobalX);
132  // m_tree->Branch("padTruthHitGlobalY", &m_padTruthHitGlobalY);
133  // m_tree->Branch("padTruthHitGlobalZ", &m_padTruthHitGlobalZ);
134  // m_tree->Branch("padEtaIdFromOfflineId", &m_padEtaIdFromOfflineId);
135  // m_tree->Branch("padPhiIdFromOfflineId", &m_padPhiIdFromOfflineId);
136  // m_tree->Branch("padSectorIdFromOfflineId", &m_padSectorFromOfflineId);
137  // m_tree->Branch("padLayerFromOfflineId", &m_padLayerFromOfflineId);
138  // m_tree->Branch("offlineIdPadEtaIdConverted",&m_offlineIdPadEtaConverted);
139  // m_tree->Branch("offlineIdPadPhiIdConverted",&m_offlineIdPadPhiConverted);
140  // m_tree->Branch("padEtaIdFromOldSimu", &m_padEtaIdFromOldSimu);
141  // m_tree->Branch("padPhiIdFromOldSimu", &m_padPhiIdFromOldSimu);
142  success = true;
143  }
144  return success;
145  }
146  //------------------------------------------------------------------------------
148  {
149  if(m_tree){
150  m_nPadTriggers = 0;
151  m_padTriggerBCID->clear();
152  m_padTriggerModuleIDinner->clear();
153  m_padTriggerModuleIDouter->clear();
166  m_padTriggerSectorID ->clear();
167  m_padTriggerSectorType->clear();
168  m_padTriggerSideID->clear();
169  m_padTriggerIndex->clear();
170  m_padTriggerBandID->clear();
171  m_padTriggerEta->clear();
172  m_padTriggerPhi->clear();
173  m_padTriggerEtaID->clear();
174  m_padTriggerPhiID->clear();
175  m_padTriggerMultipletID->clear();
176  m_padTriggerEtamin->clear();
177  m_padTriggerEtamax->clear();
178  m_padTriggerPhimin->clear();
179  m_padTriggerPhimax->clear();
184  // m_nPadHits = 0;
185  // m_padGlobalX->clear();
186  // m_padGlobalY->clear();
187  // m_padGlobalZ->clear();
188  // m_padTruthHitGlobalX->clear();
189  // m_padTruthHitGlobalY->clear();
190  // m_padTruthHitGlobalZ->clear();
191  // m_padEtaIdFromOfflineId->clear();
192  // m_padPhiIdFromOfflineId->clear();
193  // m_padSectorFromOfflineId->clear();
194  // m_padLayerFromOfflineId->clear();
195  // m_offlineIdPadEtaConverted->clear();
196  // m_offlineIdPadPhiConverted->clear();
197  // m_padEtaIdFromOldSimu->clear();
198  // m_padPhiIdFromOldSimu->clear();
199  }
200  return true;
201  }
202  //------------------------------------------------------------------------------
205  return true;
206  }
207  //------------------------------------------------------------------------------
208  bool PadTriggerValidationTree::fill_pad_trigger_basics(const std::vector<std::unique_ptr<PadTrigger>> &triggers) const {
209  for(auto& trigger : triggers) {
210  m_padTriggerBCID->push_back(trigger->bctag());
211  m_padTriggerSectorID->push_back(trigger->sectorId());
212  m_padTriggerSectorType->push_back((trigger->isSmall()+1)%2);//1 for L 0 for S
213  m_padTriggerSideID->push_back(trigger->sideId());
214  m_padTriggerIndex->push_back(trigger->index());
215  m_padTriggerBandID->push_back(trigger->bandId());
216  m_padTriggerEta->push_back(trigger->eta());
217  m_padTriggerPhi->push_back(trigger->phi());
218  m_padTriggerEtaID->push_back(trigger->etaId());
219  m_padTriggerPhiID->push_back(trigger->phiId());
220  m_padTriggerMultipletID->push_back(trigger->multipletId());
221  m_padTriggerEtamin->push_back(trigger->etaMin());
222  m_padTriggerEtamax->push_back(trigger->etaMax());
223  m_padTriggerPhimin->push_back(trigger->phiMin());
224  m_padTriggerPhimax->push_back(trigger->phiMax());
225  m_padTriggerlocalminYInner->push_back(trigger->trglocalminYInner());
226  m_padTriggerlocalmaxYInner->push_back(trigger->trglocalmaxYInner());
227  m_padTriggerlocalminYOuter->push_back(trigger->trglocalminYOuter());
228  m_padTriggerlocalmaxYOuter->push_back(trigger->trglocalmaxYOuter());
229  m_padTriggerModuleIDinner->push_back(trigger->moduleIdInner());
230  m_padTriggerModuleIDouter->push_back(trigger->moduleIdOuter());
231  m_padTriggerSelectedLayersInner->push_back(trigger->trgSelectedLayersInner());
232  m_padTriggerSelectedLayersOuter->push_back(trigger->trgSelectedLayersOuter());
233  m_padTriggerSelectedBandsInner->push_back(trigger->trgSelectedBandsInner());
234  m_padTriggerSelectedBandsOuter->push_back(trigger->trgSelectedBandsOuter());
235  m_padTriggerPadEtaIndicesInner->push_back(trigger->trgPadEtaIndicesInner());
236  m_padTriggerPadEtaIndicesOuter->push_back(trigger->trgPadEtaIndicesOuter());
237  m_padTriggerPadPhiIndicesInner->push_back(trigger->trgPadPhiIndicesInner());
238  m_padTriggerPadPhiIndicesOuter->push_back(trigger->trgPadPhiIndicesOuter());
239  }
240  return true;
241  }
242 }
NSWL1::PadTriggerValidationTree::m_padTriggerlocalminYOuter
std::vector< std::vector< float > > * m_padTriggerlocalminYOuter
Definition: PadTriggerValidationTree.h:85
NSWL1::PadTriggerValidationTree::m_padTriggerSectorType
std::vector< int > * m_padTriggerSectorType
Definition: PadTriggerValidationTree.h:69
NSWL1::PadTriggerValidationTree::m_padTriggerSelectedBandsInner
std::vector< std::vector< int > > * m_padTriggerSelectedBandsInner
Definition: PadTriggerValidationTree.h:57
NSWL1::PadTriggerValidationTree::m_padTriggerlocalmaxYOuter
std::vector< std::vector< float > > * m_padTriggerlocalmaxYOuter
Definition: PadTriggerValidationTree.h:86
NSWL1::PadTriggerValidationTree::m_padTriggerPhimax
std::vector< float > * m_padTriggerPhimax
Definition: PadTriggerValidationTree.h:81
NSWL1::PadTriggerValidationTree::m_padTriggerModuleIDouter
std::vector< int > * m_padTriggerModuleIDouter
Definition: PadTriggerValidationTree.h:54
NSWL1::PadTriggerValidationTree::m_padTriggerEtamax
std::vector< float > * m_padTriggerEtamax
Definition: PadTriggerValidationTree.h:79
tree
TChain * tree
Definition: tile_monitor.h:30
NSWL1::PadTriggerValidationTree::m_padTriggerSelectedBandsOuter
std::vector< std::vector< int > > * m_padTriggerSelectedBandsOuter
Definition: PadTriggerValidationTree.h:58
NSWL1::PadTriggerValidationTree::fill_num_pad_triggers
bool fill_num_pad_triggers(size_t num) const
store the number of pad triggers per event
Definition: PadTriggerValidationTree.cxx:203
NSWL1::PadTriggerValidationTree::m_padTriggerSelectedLayersOuter
std::vector< std::vector< int > > * m_padTriggerSelectedLayersOuter
Definition: PadTriggerValidationTree.h:56
NSWL1::PadTriggerValidationTree::m_padTriggerSideID
std::vector< int > * m_padTriggerSideID
Side ID of the pad trigger.
Definition: PadTriggerValidationTree.h:70
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
PadTriggerValidationTree.h
NSWL1::PadTriggerValidationTree::reset_ntuple_variables
bool reset_ntuple_variables()
clear all vectors of internal containers
Definition: PadTriggerValidationTree.cxx:147
NSWL1::PadTriggerValidationTree::m_padTriggerPadPhiIndicesInner
std::vector< std::vector< int > > * m_padTriggerPadPhiIndicesInner
Definition: PadTriggerValidationTree.h:60
NSWL1::PadTriggerValidationTree::m_padTriggerEtamin
std::vector< float > * m_padTriggerEtamin
Definition: PadTriggerValidationTree.h:78
NSWL1::PadTriggerValidationTree::m_padTriggerPadEtaIndicesInner
std::vector< std::vector< int > > * m_padTriggerPadEtaIndicesInner
Definition: PadTriggerValidationTree.h:59
NSWL1::PadTriggerValidationTree::m_padTriggerRCenterMinOuter
std::vector< std::vector< float > > * m_padTriggerRCenterMinOuter
Definition: PadTriggerValidationTree.h:65
NSWL1::PadTriggerValidationTree::m_padTriggerPadPhiIndicesOuter
std::vector< std::vector< int > > * m_padTriggerPadPhiIndicesOuter
Definition: PadTriggerValidationTree.h:62
NSWL1::PadTriggerValidationTree::m_padTriggerIndex
std::vector< int > * m_padTriggerIndex
Definition: PadTriggerValidationTree.h:87
NSWL1::PadTriggerValidationTree::m_padTriggerRCenterMaxInner
std::vector< std::vector< float > > * m_padTriggerRCenterMaxInner
Definition: PadTriggerValidationTree.h:64
NSWL1::PadTriggerValidationTree::m_tree
TTree * m_tree
ntuple for analysis
Definition: PadTriggerValidationTree.h:50
NSWL1::PadTriggerValidationTree::m_padTriggerRCenterMaxOuter
std::vector< std::vector< float > > * m_padTriggerRCenterMaxOuter
Definition: PadTriggerValidationTree.h:66
NSWL1::PadTriggerValidationTree::m_padTriggerEta
std::vector< float > * m_padTriggerEta
Trigger halfpad eta.
Definition: PadTriggerValidationTree.h:72
NSWL1::PadTriggerValidationTree::m_padTriggerBCID
std::vector< unsigned int > * m_padTriggerBCID
BCID of the pad trigger.
Definition: PadTriggerValidationTree.h:52
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
NSWL1::PadTriggerValidationTree::m_padTriggerRCenterMinInner
std::vector< std::vector< float > > * m_padTriggerRCenterMinInner
Definition: PadTriggerValidationTree.h:63
NSWL1::PadTriggerValidationTree::m_padTriggerModuleIDinner
std::vector< int > * m_padTriggerModuleIDinner
Definition: PadTriggerValidationTree.h:53
NSWL1::PadTriggerValidationTree::fill_pad_trigger_basics
bool fill_pad_trigger_basics(const std::vector< std::unique_ptr< PadTrigger >> &triggers) const
store basic information about the pad triggers
Definition: PadTriggerValidationTree.cxx:208
NSWL1::PadTriggerValidationTree::m_nPadTriggers
int m_nPadTriggers
number of triggers per event
Definition: PadTriggerValidationTree.h:51
NSWL1::PadTriggerValidationTree::m_padTriggerSectorID
std::vector< int > * m_padTriggerSectorID
Sector ID of the pad trigger.
Definition: PadTriggerValidationTree.h:68
NSWL1::PadTriggerValidationTree::init_tree
bool init_tree(TTree *tree)
initialize the output containers and the tree
Definition: PadTriggerValidationTree.cxx:48
NSWL1::PadTriggerValidationTree::m_padTriggerPhi
std::vector< float > * m_padTriggerPhi
Trigger halfpad phi.
Definition: PadTriggerValidationTree.h:73
NSWL1::PadTriggerValidationTree::m_padTriggerBandID
std::vector< unsigned int > * m_padTriggerBandID
band ID used to determine which strips are read out
Definition: PadTriggerValidationTree.h:71
NSWL1::PadTriggerValidationTree::m_padTriggerSelectedLayersInner
std::vector< std::vector< int > > * m_padTriggerSelectedLayersInner
Definition: PadTriggerValidationTree.h:55
NSWL1::PadTriggerValidationTree::m_padTriggerEtaID
std::vector< int > * m_padTriggerEtaID
Trigger halfpad eta id.
Definition: PadTriggerValidationTree.h:74
NSWL1::PadTriggerValidationTree::m_padTriggerPadEtaIndicesOuter
std::vector< std::vector< int > > * m_padTriggerPadEtaIndicesOuter
Definition: PadTriggerValidationTree.h:61
NSWL1::PadTriggerValidationTree::m_padTriggerPhimin
std::vector< float > * m_padTriggerPhimin
Definition: PadTriggerValidationTree.h:80
NSWL1::PadTriggerValidationTree::m_padTriggerMultipletID
std::vector< int > * m_padTriggerMultipletID
Multiplet ID of the pad trigger.
Definition: PadTriggerValidationTree.h:76
NSWL1::PadTriggerValidationTree::m_padTriggerlocalmaxYInner
std::vector< std::vector< float > > * m_padTriggerlocalmaxYInner
Definition: PadTriggerValidationTree.h:84
NSWL1::PadTriggerValidationTree::m_padTriggerPhiID
std::vector< int > * m_padTriggerPhiID
Trigger halfpad phi id.
Definition: PadTriggerValidationTree.h:75
NSWL1::PadTriggerValidationTree::PadTriggerValidationTree
PadTriggerValidationTree()
Definition: PadTriggerValidationTree.cxx:9
NSWL1
A trigger trigger candidate for a stgc sector.
Definition: NSWL1Simulation.cxx:9
NSWL1::PadTriggerValidationTree::m_padTriggerlocalminYInner
std::vector< std::vector< float > > * m_padTriggerlocalminYInner
Definition: PadTriggerValidationTree.h:83