ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CSCHitAnalysis Class Reference

#include <CSCHitAnalysis.h>

Inheritance diagram for CSCHitAnalysis:
Collaboration diagram for CSCHitAnalysis:

Public Member Functions

 CSCHitAnalysis (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~CSCHitAnalysis ()
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

TH1 * m_h_hits_x
 Some variables. More...
 
TH1 * m_h_hits_y
 
TH1 * m_h_hits_z
 
TH1 * m_h_hits_r
 
TH2 * m_h_xy
 
TH2 * m_h_zr
 
TH1 * m_h_hits_eta
 
TH1 * m_h_hits_phi
 
TH1 * m_h_hits_sx
 
TH1 * m_h_hits_sy
 
TH1 * m_h_hits_sz
 
TH1 * m_h_hits_ex
 
TH1 * m_h_hits_ey
 
TH1 * m_h_hits_ez
 
TH1 * m_h_hits_time
 
TH1 * m_h_hits_edep
 
TH1 * m_h_hits_kine
 
std::vector< float > * m_hits_x
 
std::vector< float > * m_hits_y
 
std::vector< float > * m_hits_z
 
std::vector< float > * m_hits_r
 
std::vector< float > * m_hits_eta
 
std::vector< float > * m_hits_phi
 
std::vector< float > * m_hits_start_x
 
std::vector< float > * m_hits_start_y
 
std::vector< float > * m_hits_start_z
 
std::vector< float > * m_hits_end_x
 
std::vector< float > * m_hits_end_y
 
std::vector< float > * m_hits_end_z
 
std::vector< float > * m_hits_time
 
std::vector< float > * m_hits_edep
 
std::vector< float > * m_hits_kine
 
TTree * m_tree
 
std::string m_ntupleFileName
 
std::string m_path
 
ServiceHandle< ITHistSvc > m_thistSvc
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 24 of file CSCHitAnalysis.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CSCHitAnalysis()

CSCHitAnalysis::CSCHitAnalysis ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 25 of file CSCHitAnalysis.cxx.

26  : AthAlgorithm(name, pSvcLocator)
27  , m_h_hits_x(0)
28  , m_h_hits_y(0)
29  , m_h_hits_z(0)
30  , m_h_hits_r(0)
31  , m_h_xy(0)
32  , m_h_zr(0)
33  , m_h_hits_eta(0)
34  , m_h_hits_phi(0)
35  , m_h_hits_sx(0)
36  , m_h_hits_sy(0)
37  , m_h_hits_sz(0)
38  , m_h_hits_ex(0)
39  , m_h_hits_ey(0)
40  , m_h_hits_ez(0)
41  , m_h_hits_time(0)
42  , m_h_hits_edep(0)
43  , m_h_hits_kine(0)
44  , m_hits_x(0)
45  , m_hits_y(0)
46  , m_hits_z(0)
47  , m_hits_r(0)
48  , m_hits_eta(0)
49  , m_hits_phi(0)
50  , m_hits_start_x(0)
51  , m_hits_start_y(0)
52  , m_hits_start_z(0)
53  , m_hits_end_x(0)
54  , m_hits_end_y(0)
55  , m_hits_end_z(0)
56  , m_hits_time(0)
57  , m_hits_edep(0)
58  , m_hits_kine(0)
59 
60  , m_tree(0)
61  , m_ntupleFileName("/CSCHitAnalysis/")
62  , m_path("/CSCHitAnalysis/")
63  , m_thistSvc("THistSvc", name)
64 {
65  declareProperty("NtupleFileName", m_ntupleFileName);
66  declareProperty("HistPath", m_path);
67 }

◆ ~CSCHitAnalysis()

CSCHitAnalysis::~CSCHitAnalysis ( )
inline

Definition at line 29 of file CSCHitAnalysis.h.

29 {}

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode CSCHitAnalysis::execute ( )
virtual

Definition at line 175 of file CSCHitAnalysis.cxx.

175  {
176  ATH_MSG_DEBUG( "In CSCHitAnalysis::execute()" );
177 
178  m_hits_x->clear();
179  m_hits_y->clear();
180  m_hits_z->clear();
181  m_hits_r->clear();
182  m_hits_eta->clear();
183  m_hits_phi->clear();
184  m_hits_start_x->clear();
185  m_hits_start_y->clear();
186  m_hits_start_z->clear();
187  m_hits_end_x->clear();
188  m_hits_end_y->clear();
189  m_hits_end_z->clear();
190  m_hits_time->clear();
191  m_hits_edep->clear();
192  m_hits_kine->clear();
193 
194  const CSCSimHitCollection* csc_container;
195  if (evtStore()->retrieve(csc_container, "CSC_Hits") == StatusCode::SUCCESS) {
196  for (CSCSimHitCollection::const_iterator i_hit = csc_container->begin();
197  i_hit != csc_container->end(); ++i_hit) {
198  //CSCSimHitCollection::const_iterator i_hit;
199  //for(auto i_hit : *csc_container){
200  GeoCSCHit ghit(*i_hit);
201  if (!ghit) continue;
202 
203  Amg::Vector3D p = ghit.getGlobalPosition();
204  m_h_hits_x->Fill(p.x());
205  m_h_hits_y->Fill(p.y());
206  m_h_hits_z->Fill(p.z());
207  m_h_hits_r->Fill(p.perp());
208  m_h_xy->Fill(p.x(), p.y());
209  m_h_zr->Fill(p.z(), p.perp());
210  m_h_hits_eta->Fill(p.eta());
211  m_h_hits_phi->Fill(p.phi());
212  m_h_hits_sx->Fill((*i_hit).getHitStart().x());
213  m_h_hits_sy->Fill((*i_hit).getHitStart().y());
214  m_h_hits_sz->Fill((*i_hit).getHitStart().z());
215  m_h_hits_ex->Fill((*i_hit).getHitEnd().x());
216  m_h_hits_ey->Fill((*i_hit).getHitEnd().y());
217  m_h_hits_ez->Fill((*i_hit).getHitEnd().z());
218  m_h_hits_edep->Fill((*i_hit).energyDeposit());
219  m_h_hits_time->Fill((*i_hit).globalTime());
220  m_h_hits_kine->Fill((*i_hit).kineticEnergy());
221 
222  m_hits_x->push_back(p.x());
223  m_hits_y->push_back(p.y());
224  m_hits_z->push_back(p.z());
225  m_hits_r->push_back(p.perp());
226  m_hits_eta->push_back(p.eta());
227  m_hits_phi->push_back(p.phi());
228  m_hits_start_x->push_back((*i_hit).getHitStart().x());
229  m_hits_start_y->push_back((*i_hit).getHitStart().y());
230  m_hits_start_z->push_back((*i_hit).getHitStart().z());
231  m_hits_end_x->push_back((*i_hit).getHitEnd().x());
232  m_hits_end_y->push_back((*i_hit).getHitEnd().y());
233  m_hits_end_z->push_back((*i_hit).getHitEnd().z());
234  m_hits_edep->push_back((*i_hit).energyDeposit());
235  m_hits_time->push_back((*i_hit).globalTime());
236  m_hits_kine->push_back((*i_hit).kineticEnergy());
237  }
238  } // End while hits
239 
240  if (m_tree) m_tree->Fill();
241 
242  return StatusCode::SUCCESS;
243 
244 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ initialize()

StatusCode CSCHitAnalysis::initialize ( )
virtual

Histograms

now add branches and leaves to the tree

Definition at line 70 of file CSCHitAnalysis.cxx.

70  {
71  ATH_MSG_DEBUG( "Initializing CSCHitAnalysis" );
72 
73  // Grab the Ntuple and histogramming service for the tree
74  CHECK(m_thistSvc.retrieve());
75 
77  m_h_hits_x = new TH1D("h_csc_hits_x","hits_x", 100,-2000, 2000);
78  m_h_hits_x->StatOverflows();
79  CHECK(m_thistSvc->regHist(m_path + m_h_hits_x->GetName(), m_h_hits_x));
80 
81  m_h_hits_y = new TH1D("h_csc_hits_y", "hits_y", 100,-2000,2000);
82  m_h_hits_y->StatOverflows();
83  CHECK(m_thistSvc->regHist(m_path + m_h_hits_y->GetName(), m_h_hits_y));
84 
85  m_h_hits_z = new TH1D("h_csc_hits_z", "hits_z", 100,-10000,10000);
86  m_h_hits_z->StatOverflows();
87  CHECK(m_thistSvc->regHist(m_path + m_h_hits_z->GetName(), m_h_hits_z));
88 
89  m_h_hits_r = new TH1D("h_csc_hits_r", "hits_r", 100,500,2500);
90  m_h_hits_r->StatOverflows();
91  CHECK(m_thistSvc->regHist(m_path + m_h_hits_r->GetName(), m_h_hits_r));
92 
93  m_h_xy = new TH2D("h_csc_xy", "xy", 100,-2000.,2000.,100, -2000., 2000.);
94  m_h_xy->StatOverflows();
95  CHECK(m_thistSvc->regHist( m_path+m_h_xy->GetName(), m_h_xy));
96 
97  m_h_zr = new TH2D("h_csc_zr", "zr", 100,-10000.,10000.,100, 500., 2500.);
98  m_h_zr->StatOverflows();
99  CHECK(m_thistSvc->regHist( m_path+m_h_zr->GetName(), m_h_zr));
100 
101  m_h_hits_eta = new TH1D("h_csc_hits_eta", "hits_eta", 100,-3.0,3.0);
102  m_h_hits_eta->StatOverflows();
103  CHECK(m_thistSvc->regHist(m_path + m_h_hits_eta->GetName(), m_h_hits_eta));
104 
105  m_h_hits_phi = new TH1D("h_csc_hits_phi", "hits_phi", 100,-3.2,3.2);
106  m_h_hits_phi->StatOverflows();
107  CHECK(m_thistSvc->regHist(m_path + m_h_hits_phi->GetName(), m_h_hits_phi));
108 
109  m_h_hits_sx = new TH1D("h_csc_hits_sx","hits_sx", 100,-10, 10);
110  m_h_hits_sx->StatOverflows();
111  CHECK(m_thistSvc->regHist(m_path + m_h_hits_sx->GetName(), m_h_hits_sx));
112 
113  m_h_hits_sy = new TH1D("h_csc_hits_sy", "hits_sy", 100,-500,500);
114  m_h_hits_sy->StatOverflows();
115  CHECK(m_thistSvc->regHist(m_path + m_h_hits_sy->GetName(), m_h_hits_sy));
116 
117  m_h_hits_sz = new TH1D("h_csc_hits_sz", "hits_sz", 100,-1000,1000);
118  m_h_hits_sz->StatOverflows();
119  CHECK(m_thistSvc->regHist(m_path + m_h_hits_sz->GetName(), m_h_hits_sz));
120 
121  m_h_hits_ex = new TH1D("h_csc_hits_ex","hits_ex", 100,-10, 10);
122  m_h_hits_ex->StatOverflows();
123  CHECK(m_thistSvc->regHist(m_path + m_h_hits_ex->GetName(), m_h_hits_ex));
124 
125  m_h_hits_ey = new TH1D("h_csc_hits_ey", "hits_ey", 100,-500,500);
126  m_h_hits_ey->StatOverflows();
127  CHECK(m_thistSvc->regHist(m_path + m_h_hits_ey->GetName(), m_h_hits_ey));
128 
129  m_h_hits_ez = new TH1D("h_csc_hits_ez", "hits_ez", 100,-1000,1000);
130  m_h_hits_ez->StatOverflows();
131  CHECK(m_thistSvc->regHist(m_path + m_h_hits_ez->GetName(), m_h_hits_ez));
132 
133  m_h_hits_time = new TH1D("h_csc_hits_time","hits_time", 100,20, 40);
134  m_h_hits_time->StatOverflows();
135  CHECK(m_thistSvc->regHist(m_path + m_h_hits_time->GetName(), m_h_hits_time));
136 
137  m_h_hits_edep = new TH1D("h_csc_hits_edep", "hits_edep", 100,0,0.1);
138  m_h_hits_edep->StatOverflows();
139  CHECK(m_thistSvc->regHist(m_path + m_h_hits_edep->GetName(), m_h_hits_edep));
140 
141  m_h_hits_kine = new TH1D("h_csc_hits_kine", "hits_kine", 100,0,3000);
142  m_h_hits_kine->StatOverflows();
143  CHECK(m_thistSvc->regHist(m_path + m_h_hits_kine->GetName(), m_h_hits_kine));
144 
146  m_tree = new TTree("CSC", "CSC");
147  std::string fullNtupleName = "/" + m_ntupleFileName + "/";
148  CHECK(m_thistSvc->regTree(fullNtupleName, m_tree));
149 
150  if (m_tree){
151  m_tree->Branch("x", &m_hits_x);
152  m_tree->Branch("y", &m_hits_y);
153  m_tree->Branch("z", &m_hits_z);
154  m_tree->Branch("r", &m_hits_r);
155  m_tree->Branch("eta", &m_hits_eta);
156  m_tree->Branch("phi", &m_hits_phi);
157  m_tree->Branch("startX", &m_hits_start_x);
158  m_tree->Branch("startY", &m_hits_start_y);
159  m_tree->Branch("startZ", &m_hits_start_z);
160  m_tree->Branch("endX", &m_hits_end_x);
161  m_tree->Branch("endY", &m_hits_end_y);
162  m_tree->Branch("endZ", &m_hits_end_z);
163  m_tree->Branch("time", &m_hits_time);
164  m_tree->Branch("edep", &m_hits_edep);
165  m_tree->Branch("kine", &m_hits_kine);
166  }
167  else {
168  ATH_MSG_ERROR("No tree found!");
169  }
170 
171  return StatusCode::SUCCESS;
172 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_h_hits_edep

TH1* CSCHitAnalysis::m_h_hits_edep
private

Definition at line 52 of file CSCHitAnalysis.h.

◆ m_h_hits_eta

TH1* CSCHitAnalysis::m_h_hits_eta
private

Definition at line 43 of file CSCHitAnalysis.h.

◆ m_h_hits_ex

TH1* CSCHitAnalysis::m_h_hits_ex
private

Definition at line 48 of file CSCHitAnalysis.h.

◆ m_h_hits_ey

TH1* CSCHitAnalysis::m_h_hits_ey
private

Definition at line 49 of file CSCHitAnalysis.h.

◆ m_h_hits_ez

TH1* CSCHitAnalysis::m_h_hits_ez
private

Definition at line 50 of file CSCHitAnalysis.h.

◆ m_h_hits_kine

TH1* CSCHitAnalysis::m_h_hits_kine
private

Definition at line 53 of file CSCHitAnalysis.h.

◆ m_h_hits_phi

TH1* CSCHitAnalysis::m_h_hits_phi
private

Definition at line 44 of file CSCHitAnalysis.h.

◆ m_h_hits_r

TH1* CSCHitAnalysis::m_h_hits_r
private

Definition at line 40 of file CSCHitAnalysis.h.

◆ m_h_hits_sx

TH1* CSCHitAnalysis::m_h_hits_sx
private

Definition at line 45 of file CSCHitAnalysis.h.

◆ m_h_hits_sy

TH1* CSCHitAnalysis::m_h_hits_sy
private

Definition at line 46 of file CSCHitAnalysis.h.

◆ m_h_hits_sz

TH1* CSCHitAnalysis::m_h_hits_sz
private

Definition at line 47 of file CSCHitAnalysis.h.

◆ m_h_hits_time

TH1* CSCHitAnalysis::m_h_hits_time
private

Definition at line 51 of file CSCHitAnalysis.h.

◆ m_h_hits_x

TH1* CSCHitAnalysis::m_h_hits_x
private

Some variables.

Definition at line 37 of file CSCHitAnalysis.h.

◆ m_h_hits_y

TH1* CSCHitAnalysis::m_h_hits_y
private

Definition at line 38 of file CSCHitAnalysis.h.

◆ m_h_hits_z

TH1* CSCHitAnalysis::m_h_hits_z
private

Definition at line 39 of file CSCHitAnalysis.h.

◆ m_h_xy

TH2* CSCHitAnalysis::m_h_xy
private

Definition at line 41 of file CSCHitAnalysis.h.

◆ m_h_zr

TH2* CSCHitAnalysis::m_h_zr
private

Definition at line 42 of file CSCHitAnalysis.h.

◆ m_hits_edep

std::vector<float>* CSCHitAnalysis::m_hits_edep
private

Definition at line 68 of file CSCHitAnalysis.h.

◆ m_hits_end_x

std::vector<float>* CSCHitAnalysis::m_hits_end_x
private

Definition at line 64 of file CSCHitAnalysis.h.

◆ m_hits_end_y

std::vector<float>* CSCHitAnalysis::m_hits_end_y
private

Definition at line 65 of file CSCHitAnalysis.h.

◆ m_hits_end_z

std::vector<float>* CSCHitAnalysis::m_hits_end_z
private

Definition at line 66 of file CSCHitAnalysis.h.

◆ m_hits_eta

std::vector<float>* CSCHitAnalysis::m_hits_eta
private

Definition at line 59 of file CSCHitAnalysis.h.

◆ m_hits_kine

std::vector<float>* CSCHitAnalysis::m_hits_kine
private

Definition at line 69 of file CSCHitAnalysis.h.

◆ m_hits_phi

std::vector<float>* CSCHitAnalysis::m_hits_phi
private

Definition at line 60 of file CSCHitAnalysis.h.

◆ m_hits_r

std::vector<float>* CSCHitAnalysis::m_hits_r
private

Definition at line 58 of file CSCHitAnalysis.h.

◆ m_hits_start_x

std::vector<float>* CSCHitAnalysis::m_hits_start_x
private

Definition at line 61 of file CSCHitAnalysis.h.

◆ m_hits_start_y

std::vector<float>* CSCHitAnalysis::m_hits_start_y
private

Definition at line 62 of file CSCHitAnalysis.h.

◆ m_hits_start_z

std::vector<float>* CSCHitAnalysis::m_hits_start_z
private

Definition at line 63 of file CSCHitAnalysis.h.

◆ m_hits_time

std::vector<float>* CSCHitAnalysis::m_hits_time
private

Definition at line 67 of file CSCHitAnalysis.h.

◆ m_hits_x

std::vector<float>* CSCHitAnalysis::m_hits_x
private

Definition at line 55 of file CSCHitAnalysis.h.

◆ m_hits_y

std::vector<float>* CSCHitAnalysis::m_hits_y
private

Definition at line 56 of file CSCHitAnalysis.h.

◆ m_hits_z

std::vector<float>* CSCHitAnalysis::m_hits_z
private

Definition at line 57 of file CSCHitAnalysis.h.

◆ m_ntupleFileName

std::string CSCHitAnalysis::m_ntupleFileName
private

Definition at line 72 of file CSCHitAnalysis.h.

◆ m_path

std::string CSCHitAnalysis::m_path
private

Definition at line 73 of file CSCHitAnalysis.h.

◆ m_thistSvc

ServiceHandle<ITHistSvc> CSCHitAnalysis::m_thistSvc
private

Definition at line 74 of file CSCHitAnalysis.h.

◆ m_tree

TTree* CSCHitAnalysis::m_tree
private

Definition at line 71 of file CSCHitAnalysis.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CSCHitAnalysis::m_h_hits_r
TH1 * m_h_hits_r
Definition: CSCHitAnalysis.h:40
CSCHitAnalysis::m_hits_end_z
std::vector< float > * m_hits_end_z
Definition: CSCHitAnalysis.h:66
CSCHitAnalysis::m_h_hits_ex
TH1 * m_h_hits_ex
Definition: CSCHitAnalysis.h:48
GeoCSCHit
Definition: GeoMuonHits.h:129
CSCHitAnalysis::m_h_hits_sz
TH1 * m_h_hits_sz
Definition: CSCHitAnalysis.h:47
CSCHitAnalysis::m_hits_r
std::vector< float > * m_hits_r
Definition: CSCHitAnalysis.h:58
CSCHitAnalysis::m_hits_phi
std::vector< float > * m_hits_phi
Definition: CSCHitAnalysis.h:60
CSCHitAnalysis::m_h_hits_y
TH1 * m_h_hits_y
Definition: CSCHitAnalysis.h:38
CSCHitAnalysis::m_hits_kine
std::vector< float > * m_hits_kine
Definition: CSCHitAnalysis.h:69
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CSCHitAnalysis::m_h_xy
TH2 * m_h_xy
Definition: CSCHitAnalysis.h:41
CSCHitAnalysis::m_h_hits_x
TH1 * m_h_hits_x
Some variables.
Definition: CSCHitAnalysis.h:37
AtlasHitsVector
Definition: AtlasHitsVector.h:33
CSCHitAnalysis::m_hits_end_x
std::vector< float > * m_hits_end_x
Definition: CSCHitAnalysis.h:64
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
CSCHitAnalysis::m_ntupleFileName
std::string m_ntupleFileName
Definition: CSCHitAnalysis.h:72
CSCHitAnalysis::m_path
std::string m_path
Definition: CSCHitAnalysis.h:73
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AtlasHitsVector::begin
const_iterator begin() const
Definition: AtlasHitsVector.h:131
CSCHitAnalysis::m_hits_y
std::vector< float > * m_hits_y
Definition: CSCHitAnalysis.h:56
AtlasHitsVector::const_iterator
CONT::const_iterator const_iterator
Definition: AtlasHitsVector.h:43
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CSCHitAnalysis::m_h_hits_phi
TH1 * m_h_hits_phi
Definition: CSCHitAnalysis.h:44
CSCHitAnalysis::m_h_hits_time
TH1 * m_h_hits_time
Definition: CSCHitAnalysis.h:51
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
CSCHitAnalysis::m_h_hits_edep
TH1 * m_h_hits_edep
Definition: CSCHitAnalysis.h:52
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
CSCHitAnalysis::m_h_zr
TH2 * m_h_zr
Definition: CSCHitAnalysis.h:42
CSCHitAnalysis::m_hits_start_y
std::vector< float > * m_hits_start_y
Definition: CSCHitAnalysis.h:62
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CSCHitAnalysis::m_hits_end_y
std::vector< float > * m_hits_end_y
Definition: CSCHitAnalysis.h:65
CSCHitAnalysis::m_h_hits_kine
TH1 * m_h_hits_kine
Definition: CSCHitAnalysis.h:53
CSCHitAnalysis::m_h_hits_eta
TH1 * m_h_hits_eta
Definition: CSCHitAnalysis.h:43
CSCHitAnalysis::m_hits_edep
std::vector< float > * m_hits_edep
Definition: CSCHitAnalysis.h:68
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CSCHitAnalysis::m_h_hits_z
TH1 * m_h_hits_z
Definition: CSCHitAnalysis.h:39
CSCHitAnalysis::m_hits_start_z
std::vector< float > * m_hits_start_z
Definition: CSCHitAnalysis.h:63
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
CSCHitAnalysis::m_hits_z
std::vector< float > * m_hits_z
Definition: CSCHitAnalysis.h:57
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CSCHitAnalysis::m_h_hits_sy
TH1 * m_h_hits_sy
Definition: CSCHitAnalysis.h:46
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
CSCHitAnalysis::m_tree
TTree * m_tree
Definition: CSCHitAnalysis.h:71
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CSCHitAnalysis::m_h_hits_ey
TH1 * m_h_hits_ey
Definition: CSCHitAnalysis.h:49
CSCHitAnalysis::m_hits_start_x
std::vector< float > * m_hits_start_x
Definition: CSCHitAnalysis.h:61
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AtlasHitsVector::end
const_iterator end() const
Definition: AtlasHitsVector.h:134
CSCHitAnalysis::m_hits_time
std::vector< float > * m_hits_time
Definition: CSCHitAnalysis.h:67
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
CSCHitAnalysis::m_hits_x
std::vector< float > * m_hits_x
Definition: CSCHitAnalysis.h:55
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
CSCHitAnalysis::m_h_hits_ez
TH1 * m_h_hits_ez
Definition: CSCHitAnalysis.h:50
CSCHitAnalysis::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: CSCHitAnalysis.h:74
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
CSCHitAnalysis::m_h_hits_sx
TH1 * m_h_hits_sx
Definition: CSCHitAnalysis.h:45
fitman.k
k
Definition: fitman.py:528
CSCHitAnalysis::m_hits_eta
std::vector< float > * m_hits_eta
Definition: CSCHitAnalysis.h:59
ServiceHandle< ICondSvc >