|
ATLAS Offline Software
|
#include <EFTrackingSmearingAlg.h>
|
| EFTrackingSmearingAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~EFTrackingSmearingAlg () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | sysInitialize () |
| Initialization method invoked by the framework. More...
|
|
const ServiceHandle< ITHistSvc > & | histSvc () const |
| The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a pointer to the THistSvc . 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 |
|
|
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...
|
|
StatusCode | configAthHistogramming (const ServiceHandle< ITHistSvc > &histSvc, const std::string &prefix, const std::string &rootDir, const std::string &histNamePrefix, const std::string &histNamePostfix, const std::string &histTitlePrefix, const std::string &histTitlePostfix) |
| To be called by the derived classes to fill the internal configuration. More...
|
|
TH1 * | bookGetPointer (const TH1 &hist, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
TH1 * | bookGetPointer (TH1 *hist, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
TH1 * | bookGetPointer (TH1 &histRef, std::string tDir="", std::string stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
TTree * | bookGetPointer (const TTree &treeRef, std::string tDir="", std::string stream="") |
| Simplify the booking and registering (into THistSvc) of TTrees. More...
|
|
TGraph * | bookGetPointer (const TGraph &graphRef, std::string tDir="", std::string stream="") |
| Simplify the booking and registering (into THistSvc) of TGraphs. More...
|
|
TEfficiency * | bookGetPointer (const TEfficiency &eff, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
TEfficiency * | bookGetPointer (TEfficiency *eff, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
TEfficiency * | bookGetPointer (TEfficiency &effRef, std::string tDir="", std::string stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
StatusCode | book (const TH1 &hist, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
StatusCode | book (TH1 *hist, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
StatusCode | book (TH1 &histRef, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of histograms. More...
|
|
StatusCode | book (const TTree &treeRef, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TTrees. More...
|
|
StatusCode | book (const TGraph &graphRef, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TGraphs. More...
|
|
StatusCode | book (const TEfficiency &eff, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
StatusCode | book (TEfficiency *eff, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
StatusCode | book (TEfficiency &effRef, const std::string &tDir="", const std::string &stream="") |
| Simplify the booking and registering (into THistSvc) of TEfficiency. More...
|
|
TH1 * | hist (const std::string &histName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered histograms of any type. More...
|
|
TH2 * | hist2d (const std::string &histName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered 2-d histograms. More...
|
|
TH3 * | hist3d (const std::string &histName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered 3-d histograms. More...
|
|
TTree * | tree (const std::string &treeName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered TTrees. More...
|
|
TGraph * | graph (const std::string &graphName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered TGraphs. More...
|
|
TEfficiency * | efficiency (const std::string &effName, const std::string &tDir="", const std::string &stream="") |
| Simplify the retrieval of registered TEfficiency. More...
|
|
|
StatusCode | book_histograms () |
|
StatusCode | smearTruthParticles (const EventContext &ctx) |
|
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...
|
|
void | buildBookingString (std::string &bookingString, std::string &histName, std::string &tDir, std::string &stream, bool usePrefixPostfix=false) |
| Method to build individual booking string. More...
|
|
void | myReplace (std::string &str, const std::string &oldStr, const std::string &newStr) |
| Helper method to replace sub-string. More...
|
|
hash_t | hash (const std::string &histName) const |
| Method to calculate a 32-bit hash from a string. More...
|
|
|
SG::ReadHandleKey< xAOD::TrackParticleContainer > | m_inputTrackParticleKey |
|
SG::WriteHandleKey< xAOD::TrackParticleContainer > | m_outputTrackParticleKey |
|
SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_inputTruthParticleKey |
|
SG::WriteHandleKey< xAOD::TruthParticleContainer > | m_outputTruthParticleKey |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_d0DecoratorKey {this, "d0", "TruthParticles.d0", "Particle d0 decoration, set at initialisation"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_z0DecoratorKey {this, "z0", "TruthParticles.z0", "Particle z0 decoration, set at initialisation"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_ptDecoratorKey {this, "pt", "TruthParticles.pt", "Particle pt decoration, set at initialisation"} |
|
DoubleProperty | m_SigmaScaleFactor {this, "SmearingScaleFactor", 1, "Set the smearing SF value for the sigmas"} |
|
BooleanProperty | m_UseResolutionPtCutOff {this, "UseResolutionPtCutOff", false, "Apply ptCutoff on smearing"} |
|
DoubleProperty | m_SetResolutionPtCutOff {this, "SetResolutionPtCutOff", 0., "Set ptCutoff off for semaring"} |
|
DoubleProperty | m_inputTracksPtCut {this, "InputTracksPtCutGeV", 0.0, "Set input track pT cut"} |
|
DoubleProperty | m_outputTracksPtCut {this, "OutputTracksPtCutGeV", 1.0, "Set the output track pT cut"} |
|
DoubleProperty | m_smearedTrackEfficiency {this, "SmearedTrackEfficiency", 1.0, "Set track efficiency for smearing"} |
|
BooleanProperty | m_parameterizedTrackEfficiency {this, "ParameterizedTrackEfficiency", false, "Enable parameterized efficiency for smearing"} |
|
BooleanProperty | m_enableMonitoring {this, "EnableMonitoring", false, "Enable debugging monitoring of the algorithm"} |
|
BooleanProperty | m_smearTruthParticle {this, "SmearTruthParticle", false, "Enable smearing on truth particles, disabling the track smearing"} |
|
BooleanProperty | m_parameterizedTrackEfficiency_LRT {this, "ParameterizedTrackEfficiency_LRT", false, "Enable parameterized efficiency for LRT smearing"} |
|
DoubleProperty | m_smearedTrackEfficiency_d0high_LRT {this, "SmearedTrackEfficiency_d0high_LRT", 1.0, "Set high d0 value for smeared track efficiency LRT"} |
|
DoubleProperty | m_smearedTrackEfficiency_d0low_LRT {this, "SmearedTrackEfficiency_d0low_LRT", 1.0, "Set low d0 value for smeared track efficiency LRT"} |
|
BooleanProperty | m_EnableFakes {this,"IncludeDuplicatesAndFakes",false,"Enable fake track production"} |
|
BooleanProperty | m_FakeKillerEnable {this,"FakeKillerEnable",false, "disable inclusion of broad fakes"} |
|
BooleanProperty | m_IncludeFakesInResolutionCalculation |
|
BooleanProperty | m_UseCoinToss |
|
LongLongProperty | m_RandomSeed {this,"RandomSeed",0} |
|
void * | m_mySmearer |
|
ServiceHandle< ITHistSvc > | m_histSvc |
| Default constructor: AthHistogramAlgorithm();. More...
|
|
std::string | m_prefix |
| Name of the ROOT output stream (file) More...
|
|
std::string | m_rootDir |
| Name of the ROOT directory. More...
|
|
std::string | m_histNamePrefix |
| The prefix for the histogram THx name. More...
|
|
std::string | m_histNamePostfix |
| The postfix for the histogram THx name. More...
|
|
std::string | m_histTitlePrefix |
| The prefix for the histogram THx title. More...
|
|
std::string | m_histTitlePostfix |
| The postfix for the histogram THx title. More...
|
|
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 |
|
HistMap_t | m_histMap |
| The map of histogram names to their pointers. More...
|
|
EffMap_t | m_effMap |
| The map of histogram names to their pointers. More...
|
|
TreeMap_t | m_treeMap |
| The map of TTree names to their pointers. More...
|
|
GraphMap_t | m_graphMap |
| The map of TGraph names to their pointers. More...
|
|
std::string | m_streamName |
| Name of the ROOT output stream (file) More...
|
|
std::string | m_name |
| Instance name. More...
|
|
MsgStream | m_msg |
| Cached Message Stream. More...
|
|
Definition at line 19 of file EFTrackingSmearingAlg.h.
◆ EffMap_t
◆ GraphMap_t
◆ hash_t
◆ HistMap_t
◆ StoreGateSvc_t
◆ TreeMap_t
◆ EFTrackingSmearingAlg()
EFTrackingSmearingAlg::EFTrackingSmearingAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~EFTrackingSmearingAlg()
EFTrackingSmearingAlg::~EFTrackingSmearingAlg |
( |
| ) |
|
|
virtual |
◆ book() [1/8]
StatusCode AthHistogramming::book |
( |
const TEfficiency & |
eff, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 335 of file AthHistogramming.h.
338 TEfficiency* effClone =
dynamic_cast< TEfficiency*
>(
eff.Clone() );
340 m_msg << MSG::ERROR <<
"Couldn't create a TEfficiency clone" <<
endmsg;
341 return StatusCode::FAILURE;
◆ book() [2/8]
StatusCode AthHistogramming::book |
( |
const TGraph & |
graphRef, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TGraphs.
◆ book() [3/8]
StatusCode AthHistogramming::book |
( |
const TH1 & |
hist, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 303 of file AthHistogramming.h.
306 TH1* histClone =
dynamic_cast< TH1*
>(
hist.Clone() );
308 m_msg << MSG::ERROR <<
"Couldn't create a TH1 clone" <<
endmsg;
309 return StatusCode::FAILURE;
311 return this->
book( *histClone, tDir,
stream );
◆ book() [4/8]
StatusCode AthHistogramming::book |
( |
const TTree & |
treeRef, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TTrees.
Definition at line 403 of file AthHistogramming.h.
409 return StatusCode::SUCCESS;
413 return StatusCode::FAILURE;
◆ book() [5/8]
StatusCode AthHistogramming::book |
( |
TEfficiency & |
effRef, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 356 of file AthHistogramming.h.
361 m_msg << MSG::ERROR <<
"Couldn't book a TEfficiency" <<
endmsg;
362 return StatusCode::FAILURE;
364 return StatusCode::SUCCESS;
◆ book() [6/8]
StatusCode AthHistogramming::book |
( |
TEfficiency * |
eff, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 346 of file AthHistogramming.h.
349 m_msg << MSG::ERROR <<
"Got a zero pointer to a TEfficiency" <<
endmsg;
350 return StatusCode::FAILURE;
◆ book() [7/8]
StatusCode AthHistogramming::book |
( |
TH1 & |
histRef, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 324 of file AthHistogramming.h.
328 if ( !histPointer ) {
329 m_msg << MSG::ERROR <<
"Couldn't book a TH1" <<
endmsg;
330 return StatusCode::FAILURE;
332 return StatusCode::SUCCESS;
◆ book() [8/8]
StatusCode AthHistogramming::book |
( |
TH1 * |
hist, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 314 of file AthHistogramming.h.
317 m_msg << MSG::ERROR <<
"Got a zero pointer to a TH1" <<
endmsg;
318 return StatusCode::FAILURE;
◆ book_histograms()
StatusCode EFTrackingSmearingAlg::book_histograms |
( |
| ) |
|
|
private |
Definition at line 554 of file EFTrackingSmearingAlg.cxx.
556 double b_eta[3]={50,-5,5};
557 CHECK(
book(
new TH1F(
"track_input_eta",
"#eta of input tracks",b_eta[0],b_eta[1],b_eta[2])));
558 CHECK(
book(
new TH1F(
"track_input_theta",
"#Theta of input tracks",50,0.0,4.0)));
559 CHECK(
book(
new TH1F(
"track_input_pt" ,
"p_T of input tracks",50.0,-10.0,10.0)));
560 CHECK(
book(
new TH1F(
"track_input_phi",
"#phi of input tracks",50,-6.28,6.28)));
561 CHECK(
book(
new TH1F(
"track_input_z0" ,
"z_0 of input tracks",100,-50,50)));
562 CHECK(
book(
new TH1F(
"track_input_d0" ,
"d_0 of input tracks",50,-5,5)));
564 CHECK(
book(
new TH1F(
"track_input_sigma_theta",
"#sigma_{#Theta} of input tracks" ,50,0.0,0.001)));
565 CHECK(
book(
new TH1F(
"track_input_sigma_qOverP" ,
"#sigma_{q/P} of input tracks" ,50.0,0.0,0.0001)));
566 CHECK(
book(
new TH1F(
"track_input_sigma_phi" ,
"#sigma_{#phi} of input tracks" ,50,0.0,0.002)));
567 CHECK(
book(
new TH1F(
"track_input_sigma_z0" ,
"#sigma_{z_0} of input tracks" ,100,0.0,5)));
568 CHECK(
book(
new TH1F(
"track_input_sigma_d0" ,
"#sigma_{d_0} of input tracks" ,50,0.0,5)));
571 CHECK(
book(
new TH1F(
"n_input_tracks" ,
"Number of input tracks" ,maxtracks,0,maxtracks)));
572 CHECK(
book(
new TH1F(
"n_output_tracks" ,
"Number of output tracks" ,maxtracks,0,maxtracks)));
573 CHECK(
book(
new TH1F(
"n_output_narrow_tracks",
"Number of output tracks (narrow)" ,maxtracks,0,maxtracks)));
574 CHECK(
book(
new TH1F(
"n_output_broad_tracks" ,
"Number of output tracks (broad)" ,maxtracks,0,maxtracks)));
576 CHECK(
book(
new TH1F(
"track_output_eta",
"#eta of output tracks",50,-5,5)));
577 CHECK(
book(
new TH1F(
"track_output_theta",
"#Theta of output tracks",50,0.0,4.0)));
578 CHECK(
book(
new TH1F(
"track_output_pt" ,
"p_T of output tracks [GeV]",50,-10,10)));
579 CHECK(
book(
new TH1F(
"track_output_phi",
"#phi of output tracks",50,-6.28,6.28)));
580 CHECK(
book(
new TH1F(
"track_output_z0" ,
"z_0 of output tracks",100,-50,50)));
581 CHECK(
book(
new TH1F(
"track_output_d0" ,
"d_0 of output tracks",50,-5,5)));
583 CHECK(
book(
new TH1F(
"track_outputcoll_eta",
"#eta of output tracks collection",50,-5,5)));
584 CHECK(
book(
new TH1F(
"track_outputcoll_theta",
"#Theta of output tracks collection",50,0.0,4.0)));
585 CHECK(
book(
new TH1F(
"track_outputcoll_pt" ,
"p_T of output tracks collection [GeV]",50,-10,10)));
586 CHECK(
book(
new TH1F(
"track_outputcoll_phi",
"#phi of output tracks collection",50,-6.28,6.28)));
587 CHECK(
book(
new TH1F(
"track_outputcoll_z0" ,
"z_0 of output tracks collection",100,-50,50)));
588 CHECK(
book(
new TH1F(
"track_outputcoll_d0" ,
"d_0 of output tracks collection",50,-5,5)));
590 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_theta",
"#sigma_{#Theta} of output tracks collection" ,50,0.0,0.001)));
591 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_qOverP" ,
"#sigma_{q/P} of output tracks collection",50.0,0.0,0.0001)));
592 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_phi" ,
"#sigma_{#phi} of output tracks collection" ,50,0.0,0.002)));
593 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_z0" ,
"#sigma_{z_0} of output tracks collection" ,100,0.0,5)));
594 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_d0" ,
"#sigma_{d_0} of output tracks collection" ,50,0.0,5)));
596 CHECK(
book(
new TH1F(
"track_delta_sigma_theta",
"#sigma_{#Theta} of output tracks collection",100,-0.001,0.001)));
597 CHECK(
book(
new TH1F(
"track_delta_sigma_qOverP",
"#sigma_{q/P} of output tracks collection",100,-0.0001,0.0001)));
598 CHECK(
book(
new TH1F(
"track_delta_sigma_phi",
"#sigma_{#phi} of output tracks collection" ,100,-0.002,0.002)));
599 CHECK(
book(
new TH1F(
"track_delta_sigma_z0",
"#sigma_{z_0} of output tracks collection" ,100,-1.,1.)));
600 CHECK(
book(
new TH1F(
"track_delta_sigma_d0",
"#sigma_{d_0} of output tracks collection" ,100,-0.5,0.5)));
602 CHECK(
book(
new TH1F(
"track_delta_eta",
"tracks #Delta #eta",50,-1,1)));
603 CHECK(
book(
new TH1F(
"track_delta_pt",
"tracks #Delta #pt [GeV]",50,-2.,2.)));
604 CHECK(
book(
new TH1F(
"track_delta_crv" ,
"tracks #Delta crv",50,-1,1)));
605 CHECK(
book(
new TH1F(
"track_delta_phi",
"tracks #Delta #phi",50,-0.5,0.5)));
606 CHECK(
book(
new TH1F(
"track_delta_z0" ,
"tracks #Delta z_0 ",100,-10,10)));
607 CHECK(
book(
new TH1F(
"track_delta_d0" ,
"tracks #Delta d_0 ",50,-2,2)));
608 return StatusCode::SUCCESS;
◆ bookGetPointer() [1/8]
TEfficiency * AthHistogramming::bookGetPointer |
( |
const TEfficiency & |
eff, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 281 of file AthHistogramming.h.
284 TEfficiency* histClone =
dynamic_cast< TEfficiency*
>(
hist.Clone() );
286 m_msg << MSG::ERROR <<
"Couldn't create a TEfficiency clone in bookGetPointer" <<
endmsg;
◆ bookGetPointer() [2/8]
TGraph * AthHistogramming::bookGetPointer |
( |
const TGraph & |
graphRef, |
|
|
std::string |
tDir = "" , |
|
|
std::string |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the booking and registering (into THistSvc) of TGraphs.
Definition at line 427 of file AthHistogramming.cxx.
430 const TGraph* graphPointer = &graphRef;
435 m_msg << MSG::WARNING
436 <<
"We got an invalid TGraph pointer in the BookGetPointer(TGraph*) method of the class" <<
m_name
442 std::string graphName = graphPointer->GetName();
443 const std::string graphTitle = graphPointer->GetTitle();
446 const hash_t graphHash = this->
hash(graphName);
447 GraphMap_t::const_iterator
it =
m_graphMap.find( graphHash );
450 m_msg << MSG::WARNING
451 <<
"Detected a hash collision. The hash for the TGraph with name=" << graphName
452 <<
" already exists and points to a TGraph with name=" <<
it->second->GetName()
453 <<
" NOT going to book the new histogram and returning a NULL pointer!" <<
endmsg;
461 m_msg << MSG::WARNING
462 <<
"We couldn't clone the TGraph in the BookGetPointer(TGraph&) method of the class" <<
m_name
469 std::string bookingString(
"");
473 if ( !((
histSvc()->regGraph(bookingString, graphClone)).isSuccess()) )
475 m_msg << MSG::WARNING
476 <<
"Problem registering TGraph with name " << graphName
477 <<
", title " << graphTitle
483 m_graphMap.insert(
m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphClone ) );
◆ bookGetPointer() [3/8]
TH1 * AthHistogramming::bookGetPointer |
( |
const TH1 & |
hist, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 260 of file AthHistogramming.h.
263 TH1* histClone =
dynamic_cast< TH1*
>(
hist.Clone() );
265 m_msg << MSG::ERROR <<
"Couldn't create a TH1 clone in bookGetPointer" <<
endmsg;
◆ bookGetPointer() [4/8]
TTree * AthHistogramming::bookGetPointer |
( |
const TTree & |
treeRef, |
|
|
std::string |
tDir = "" , |
|
|
std::string |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the booking and registering (into THistSvc) of TTrees.
Definition at line 312 of file AthHistogramming.cxx.
315 const TTree* treePointer = &treeRef;
320 m_msg << MSG::WARNING
321 <<
"We got an invalid TTree pointer in the BookGetPointer(TTree*) method of the class" <<
m_name
327 std::string
treeName = treePointer->GetName();
328 const std::string treeTitle = treePointer->GetTitle();
332 TreeMap_t::const_iterator
it =
m_treeMap.find( treeHash );
335 m_msg << MSG::WARNING
336 <<
"Detected a hash collision. The hash for the TTree with name=" <<
treeName
337 <<
" already exists and points to a TTree with name=" <<
it->second->GetName()
338 <<
" NOT going to book the new histogram and returning a NULL pointer!" <<
endmsg;
343 TTree* treeClone =
dynamic_cast< TTree*
>( treePointer->Clone(
treeName.c_str()) );
346 m_msg << MSG::WARNING
347 <<
"We couldn't clone the TTree in the BookGetPointer(TTree&) method of the class" <<
m_name
351 treeClone->SetTitle (treeTitle.c_str());
354 std::string bookingString(
"");
358 if ( !((
histSvc()->regTree(bookingString, treeClone)).isSuccess()) )
360 m_msg << MSG::WARNING
361 <<
"Problem registering TTree with name " <<
treeName
362 <<
", title " << treeTitle
368 m_treeMap.insert(
m_treeMap.end(), std::pair< const hash_t, TTree* >( treeHash, treeClone ) );
◆ bookGetPointer() [5/8]
TEfficiency * AthHistogramming::bookGetPointer |
( |
TEfficiency & |
effRef, |
|
|
std::string |
tDir = "" , |
|
|
std::string |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 146 of file AthHistogramming.cxx.
149 std::string effName(effRef.GetName());
150 const std::string effTitle(effRef.GetTitle());
151 std::string bookingString(
"");
155 effRef.SetName(effName.c_str());
159 EffMap_t::const_iterator
it =
m_effMap.find( effHash );
162 m_msg << MSG::WARNING
163 <<
"Detected a hash collision. The hash for the TEfficiency with name=" << effName
164 <<
" already exists and points to a TEfficiency with name=" <<
it->second->GetName()
165 <<
" NOT going to book the new TEfficiency and returning a NULL pointer!" <<
endmsg;
175 if ( !((
histSvc()->regEfficiency(bookingString, &effRef)).isSuccess()) )
177 m_msg << MSG::WARNING
178 <<
"Problem registering TEfficiency with name " << effName
180 <<
", title " << effTitle
188 m_effMap.insert(
m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, &effRef ) );
◆ bookGetPointer() [6/8]
TEfficiency * AthHistogramming::bookGetPointer |
( |
TEfficiency * |
eff, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 293 of file AthHistogramming.h.
296 m_msg << MSG::ERROR <<
"Got a zero pointer to a TEfficiency in bookGetPointer" <<
endmsg;
◆ bookGetPointer() [7/8]
TH1 * AthHistogramming::bookGetPointer |
( |
TH1 & |
histRef, |
|
|
std::string |
tDir = "" , |
|
|
std::string |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 98 of file AthHistogramming.cxx.
101 std::string
histName(histRef.GetName());
102 const std::string histTitle(histRef.GetTitle());
103 std::string bookingString(
"");
111 HistMap_t::const_iterator
it =
m_histMap.find( histHash );
114 m_msg << MSG::WARNING
115 <<
"Detected a hash collision. The hash for the histogram with name=" <<
histName
116 <<
" already exists and points to a histogram with name=" <<
it->second->GetName()
117 <<
" NOT going to book the new histogram and returning a NULL pointer!" <<
endmsg;
127 if ( !((
histSvc()->regHist(bookingString, &histRef)).isSuccess()) )
129 m_msg << MSG::WARNING
130 <<
"Problem registering histogram with name " <<
histName
132 <<
", title " << histTitle
140 m_histMap.insert(
m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, &histRef ) );
◆ bookGetPointer() [8/8]
TH1 * AthHistogramming::bookGetPointer |
( |
TH1 * |
hist, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 272 of file AthHistogramming.h.
275 m_msg << MSG::ERROR <<
"Got a zero pointer to a TH1 in bookGetPointer" <<
endmsg;
◆ buildBookingString()
void AthHistogramming::buildBookingString |
( |
std::string & |
bookingString, |
|
|
std::string & |
histName, |
|
|
std::string & |
tDir, |
|
|
std::string & |
stream, |
|
|
bool |
usePrefixPostfix = false |
|
) |
| |
|
privateinherited |
Method to build individual booking string.
Definition at line 560 of file AthHistogramming.cxx.
569 if(
pos != std::string::npos){
576 if(usePrefixPostfix){
581 while(bookingString.find(
"//") != std::string::npos){
◆ configAthHistogramming()
StatusCode AthHistogramming::configAthHistogramming |
( |
const ServiceHandle< ITHistSvc > & |
histSvc, |
|
|
const std::string & |
prefix, |
|
|
const std::string & |
rootDir, |
|
|
const std::string & |
histNamePrefix, |
|
|
const std::string & |
histNamePostfix, |
|
|
const std::string & |
histTitlePrefix, |
|
|
const std::string & |
histTitlePostfix |
|
) |
| |
|
protectedinherited |
To be called by the derived classes to fill the internal configuration.
Definition at line 66 of file AthHistogramming.cxx.
79 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ efficiency()
TEfficiency * AthHistogramming::efficiency |
( |
const std::string & |
effName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the retrieval of registered TEfficiency.
Definition at line 250 of file AthHistogramming.cxx.
256 EffMap_t::const_iterator
it =
m_effMap.find( effHash );
261 std::string effNameCopy = effName;
262 std::string tDirCopy = tDir;
263 std::string streamCopy =
stream;
266 std::string bookingString(
"");
269 TEfficiency* effPointer(NULL);
270 if ( !((
histSvc()->getEfficiency(bookingString, effPointer)).isSuccess()) )
273 std::string bookingString(
"");
276 if ( !((
histSvc()->getEfficiency(bookingString, effPointer)).isSuccess()) )
278 m_msg << MSG::WARNING
279 <<
"Problem retrieving the TEfficiency with name (including pre- and post-fixes) "
281 <<
" or with name " << effNameCopy
282 <<
" in " <<
m_name <<
"... it doesn't exist, neither in the cached map nor in the THistSvc!"
283 <<
" Will return an NULL pointer... you have to handle it correctly!" <<
endmsg;
288 m_effMap.insert(
m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, effPointer ) );
293 m_effMap.insert(
m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, effPointer ) );
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode EFTrackingSmearingAlg::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 350 of file EFTrackingSmearingAlg.cxx.
353 auto ctx = getContext() ;
361 return StatusCode::FAILURE;
365 ATH_CHECK( outputTracks_handle.record( std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>() ) );
366 auto outputTracks = outputTracks_handle.ptr();
373 int n_input_tracks=0;
374 int n_output_tracks=0;
375 int n_output_broad_tracks=0;
376 int n_output_narrow_tracks=0;
381 xAOD::ParametersCovMatrix_t trkcov = trk->definingParametersCovMatrix();
382 auto trkcovvec = trk->definingParametersCovMatrixVec();
383 double theta=trk->theta();
387 <<
" curv=" << 1./trk->pt()
388 <<
" phi=" << trk->phi0()
389 <<
" eta=" << trk->eta()
390 <<
" d0=" << trk->d0()
391 <<
" z0=" << trk->z0()
392 <<
" pT=" << trk->pt()
404 hist(
"track_input_eta")->Fill(trk->eta());
405 hist(
"track_input_theta")->Fill(trk->theta());
406 hist(
"track_input_pt" )->Fill(
pt/1000.);
407 hist(
"track_input_phi")->Fill(trk->phi0());
408 hist(
"track_input_z0" )->Fill(trk->z0());
409 hist(
"track_input_d0" )->Fill(trk->d0());
419 auto trkcovvec = trk->definingParametersCovMatrixVec();
420 double qoverPt = trk->charge()*1000./
pt;
421 mySmearer->
AddTrack(trk->d0(),trk->z0(),qoverPt,trk->eta(),trk->phi0());
425 for (
const auto& otrack : mySmearer->
Tracks)
428 outputTracks->push_back(newtrk);
431 double sintheta=
std::sin(otrack.theta());
432 trkcov = trk->definingParametersCovMatrix();
433 auto newtrkcov = trkcov;
437 for (
int ii=0;ii<5;ii++)
for (
int jj=0;jj<5;jj++) {
468 (otrack.curv()*sintheta/1000.)
475 <<
" curv=" << 1./newtrk->
pt()
476 <<
" phi=" << newtrk->
phi()
477 <<
" eta=" << newtrk->
eta()
478 <<
" d0=" << newtrk->
d0()
479 <<
" z0=" << newtrk->
z0()
480 <<
" pT=" << newtrk->
pt()
483 <<
" sigma_d0=" << std::sqrt(std::abs(trkcov_out(
Trk::d0,
Trk::d0)))
484 <<
" sigma_z0=" << std::sqrt(std::abs(trkcov_out(
Trk::z0,
Trk::z0))) );
488 hist(
"track_output_eta")->Fill(otrack.eta());
489 hist(
"track_output_theta")->Fill(otrack.theta());
490 hist(
"track_output_pt" )->Fill(trk->charge()*otrack.pt() );
491 hist(
"track_output_phi")->Fill(otrack.phi());
492 hist(
"track_output_z0" )->Fill(otrack.z0() );
493 hist(
"track_output_d0" )->Fill(otrack.d0() );
495 hist(
"track_outputcoll_eta")->Fill(newtrk->
eta());
496 hist(
"track_outputcoll_theta")->Fill(newtrk->
theta());
498 hist(
"track_outputcoll_phi")->Fill(newtrk->
phi0());
499 hist(
"track_outputcoll_z0" )->Fill(newtrk->
z0());
500 hist(
"track_outputcoll_d0" )->Fill(newtrk->
d0());
502 hist(
"track_delta_eta")->Fill(newtrk->
eta() - trk->eta());
503 hist(
"track_delta_pt")->Fill((newtrk->
pt() - trk->pt())/1000.);
505 hist(
"track_delta_phi")->Fill(newtrk->
phi() - trk->phi0());
506 hist(
"track_delta_z0" )->Fill(newtrk->
z0() - trk->z0());
507 hist(
"track_delta_d0" )->Fill(newtrk->
d0() - trk->d0());
509 auto trkcov_original = trk->definingParametersCovMatrix();
540 ATH_MSG_DEBUG (
"End of loop track #"<<n_input_tracks<<
" ---> "<<
" "<< n_output_tracks
541 <<
" "<<n_output_narrow_tracks<<
" "<<n_output_broad_tracks);
543 hist(
"n_input_tracks")->Fill(n_input_tracks);
544 hist(
"n_output_tracks")->Fill(n_output_tracks);
545 hist(
"n_output_narrow_tracks")->Fill(n_output_narrow_tracks);
546 hist(
"n_output_broad_tracks")->Fill(n_output_broad_tracks);
548 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode EFTrackingSmearingAlg::finalize |
( |
| ) |
|
|
overridevirtual |
◆ graph()
TGraph * AthHistogramming::graph |
( |
const std::string & |
graphName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the retrieval of registered TGraphs.
Definition at line 492 of file AthHistogramming.cxx.
495 const hash_t graphHash = this->
hash(graphName);
498 GraphMap_t::const_iterator
it =
m_graphMap.find( graphHash );
503 std::string graphNameCopy = graphName;
504 std::string tDirCopy = tDir;
505 std::string streamCopy =
stream;
508 std::string bookingString(
"");
511 TGraph* graphPointer(NULL);
512 if ( !((
histSvc()->getGraph(bookingString, graphPointer)).isSuccess()) )
515 std::string bookingString(
"");
516 this->
buildBookingString( bookingString, graphNameCopy, tDirCopy, streamCopy,
false );
518 if ( !((
histSvc()->getGraph(bookingString, graphPointer)).isSuccess()) )
520 m_msg << MSG::WARNING
521 <<
"Problem retrieving the TGraph with name (including pre- and post-fixes) "
523 <<
" or with name " << graphNameCopy
524 <<
" in " <<
m_name <<
"... it doesn't exist, neither in the cached map nor in the THistSvc!"
525 <<
" Will return an NULL pointer... you have to handle it correctly!" <<
endmsg;
530 m_graphMap.insert(
m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphPointer ) );
535 m_graphMap.insert(
m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphPointer ) );
◆ hash()
◆ hist()
TH1 * AthHistogramming::hist |
( |
const std::string & |
histName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the retrieval of registered histograms of any type.
Definition at line 198 of file AthHistogramming.cxx.
204 HistMap_t::const_iterator
it =
m_histMap.find( histHash );
209 std::string histNameCopy =
histName;
210 std::string tDirCopy = tDir;
211 std::string streamCopy =
stream;
214 std::string bookingString(
"");
217 TH1* histPointer(NULL);
218 if ( !((
histSvc()->
getHist(bookingString, histPointer)).isSuccess()) )
221 std::string bookingString(
"");
224 if ( !((
histSvc()->
getHist(bookingString, histPointer)).isSuccess()) )
226 m_msg << MSG::WARNING
227 <<
"Problem retrieving the histogram with name (including pre- and post-fixes) "
229 <<
" or with name " << histNameCopy
230 <<
" in " <<
m_name <<
"... it doesn't exist, neither in the cached map nor in the THistSvc!"
231 <<
" Will return an NULL pointer... you have to handle it correctly!" <<
endmsg;
236 m_histMap.insert(
m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, histPointer ) );
241 m_histMap.insert(
m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, histPointer ) );
◆ hist2d()
TH2 * AthHistogramming::hist2d |
( |
const std::string & |
histName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the retrieval of registered 2-d histograms.
Definition at line 369 of file AthHistogramming.h.
376 <<
"Cannot get a 2-d histogram with name " <<
histName
377 <<
"... will probably seg-fault!" <<
endmsg;
381 return dynamic_cast<TH2*
>( th1Pointer );
◆ hist3d()
TH3 * AthHistogramming::hist3d |
( |
const std::string & |
histName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
inlineprotectedinherited |
Simplify the retrieval of registered 3-d histograms.
Definition at line 386 of file AthHistogramming.h.
393 <<
"Cannot get a 3-d histogram with name " <<
histName
394 <<
"... will probably seg-fault!" <<
endmsg;
398 return dynamic_cast<TH3*
>( th1Pointer );
◆ histSvc()
The standard THistSvc
(for writing histograms and TTrees and more to a root file) Returns (kind of) a pointer to the THistSvc
.
Definition at line 113 of file AthHistogramAlgorithm.h.
◆ initialize()
StatusCode EFTrackingSmearingAlg::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 101 of file EFTrackingSmearingAlg.cxx.
119 ATH_MSG_INFO(
"########## EFTrackingSmearingAlg Configurations are ########## ");
142 ATH_MSG_INFO(
"########## EFTrackingSmearingAlg Configurations: That's it. ########## ");
144 std::string smearerName;
183 CHECK(
book(
new TH1F(
"d0res_function_vs_eta",
"#eta of track (p_{T}=10GeV);#eta",100, 0.0,4.0)));
184 CHECK(
book(
new TH1F(
"z0res_function_vs_eta",
"#eta of track (p_{T}=10GeV);#eta",100, 0.0,4.0)));
185 CHECK(
book(
new TH1F(
"curvres_function_vs_eta",
"#eta of track (p_{T}=10GeV);#eta",100, 0.0,4.0)));
186 CHECK(
book(
new TH1F(
"d0res_function_vs_pt",
"p_{T} of track (#eta=1);p_{T} [GeV]",100, 1.0,200.0)));
187 CHECK(
book(
new TH1F(
"z0res_function_vs_pt",
"p_{T} of track (#eta=1);p_{T} [GeV]",100, 1.0,200.0)));
188 CHECK(
book(
new TH1F(
"curvres_function_vs_pt",
"p_{T} of track (#eta=1);p_{T} [GeV]",100, 1.0,200.0)));
189 CHECK(
book(
new TH1F(
"effLRT_function_vs_d0",
"d_{0} of track;d_{0} [mm]",100, 0.001,600.0)));
190 hist(
"d0res_function_vs_eta")->Add(d0res_eta);
191 hist(
"z0res_function_vs_eta")->Add(z0res_eta);
192 hist(
"curvres_function_vs_eta")->Add(curvres_eta);
193 hist(
"d0res_function_vs_pt")->Add(d0res_pt);
194 hist(
"z0res_function_vs_pt")->Add(z0res_pt);
195 hist(
"curvres_function_vs_pt")->Add(curvres_pt);
196 hist(
"effLRT_function_vs_d0")->Add(effLRT_d0);
200 return StatusCode::SUCCESS;
◆ inputHandles()
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]
◆ msg() [2/2]
◆ msgLvl()
◆ myReplace()
void AthHistogramming::myReplace |
( |
std::string & |
str, |
|
|
const std::string & |
oldStr, |
|
|
const std::string & |
newStr |
|
) |
| |
|
privateinherited |
Helper method to replace sub-string.
Definition at line 590 of file AthHistogramming.cxx.
595 while((
pos =
str.find(oldStr,
pos)) != std::string::npos)
597 str.replace(
pos, oldStr.length(), newStr);
598 pos += newStr.length();
◆ outputHandles()
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()
◆ renounceArray()
◆ smearTruthParticles()
StatusCode EFTrackingSmearingAlg::smearTruthParticles |
( |
const EventContext & |
ctx | ) |
|
|
private |
Definition at line 211 of file EFTrackingSmearingAlg.cxx.
215 if (not inputTruth) {
217 return StatusCode::FAILURE;
220 ATH_CHECK( outputTruth_handle.record( std::make_unique<xAOD::TruthParticleContainer>(), std::make_unique<xAOD::TruthParticleAuxContainer>() ) );
221 auto outputTruth = outputTruth_handle.ptr();
238 int n_input_tracks=0;
239 int n_output_tracks=0;
240 int n_output_broad_tracks=0;
241 int n_output_narrow_tracks=0;
242 ATH_MSG_DEBUG (
"Found "<<inputTruth->size()<<
" input truth particles");
243 for (
const auto*
part : *inputTruth )
251 if (
part->isNeutral())
continue;
252 if (
pt <=0.)
continue;
255 <<
" curv=" << 1./
part->pt()
256 <<
" phi=" <<
part->phi()
257 <<
" eta=" <<
part->eta()
258 <<
" d0=" << d0Acc(*
part)
259 <<
" z0=" << z0Acc(*
part)
260 <<
" pT=" <<
part->pt()
261 <<
" PDGID=" <<
part->pdgId()
262 <<
" status=" <<
part->status()
270 hist(
"track_input_eta")->Fill(
eta);
272 hist(
"track_input_pt" )->Fill(
pt/1000.);
273 hist(
"track_input_phi")->Fill(
phi);
274 hist(
"track_input_z0" )->Fill(
z0);
275 hist(
"track_input_d0" )->Fill(
d0);
277 double qoverPt =
part->charge()*1000./
pt;
282 for (
const auto& otrack : mySmearer->
Tracks)
285 outputTruth->push_back(newtrk);
287 auto newpt =
part->pt();
290 d0Decorator(*newtrk) = otrack.d0();
291 z0Decorator(*newtrk) = otrack.z0();
292 ptDecorator(*newtrk) = otrack.pt()*1000.;
295 newpt = ptAcc(*newtrk);
297 if (newpt==0.)
continue;
299 <<
" curv=" << 1./newpt
300 <<
" phi=" << newtrk->
phi()
301 <<
" eta=" << newtrk->
eta()
302 <<
" d0=" << d0Acc(*newtrk)
303 <<
" z0=" << z0Acc(*newtrk)
305 <<
" PDGID=" << newtrk->
pdgId()
306 <<
" status=" << newtrk->
status()
311 hist(
"track_output_eta")->Fill(otrack.eta());
312 hist(
"track_output_theta")->Fill(otrack.theta());
313 hist(
"track_output_pt" )->Fill(
part->charge()*otrack.pt() );
314 hist(
"track_output_phi")->Fill(otrack.phi());
315 hist(
"track_output_z0" )->Fill(otrack.z0() );
316 hist(
"track_output_d0" )->Fill(otrack.d0() );
318 hist(
"track_outputcoll_eta")->Fill(newtrk->
eta());
319 hist(
"track_outputcoll_theta")->Fill(thetaAcc(*newtrk));
320 hist(
"track_outputcoll_pt" )->Fill(
part->charge()* newpt/1000.);
321 hist(
"track_outputcoll_phi")->Fill(newtrk->
phi());
322 hist(
"track_outputcoll_z0" )->Fill(z0Acc(*newtrk));
323 hist(
"track_outputcoll_d0" )->Fill(d0Acc(*newtrk));
325 hist(
"track_delta_eta")->Fill(newtrk->
eta() -
part->eta());
326 hist(
"track_delta_pt") ->Fill((newpt -
part->pt())/1000.);
327 hist(
"track_delta_crv")->Fill(newtrk->
charge()*1000./newpt - ((
part->charge()*1000./
part->pt())));
328 hist(
"track_delta_phi")->Fill(newtrk->
phi() -
part->phi());
329 hist(
"track_delta_z0" )->Fill(z0Acc(*newtrk) - z0Acc(*
part));
330 hist(
"track_delta_d0" )->Fill(d0Acc(*newtrk) - d0Acc(*
part));
337 ATH_MSG_DEBUG (
"End of loop track #"<<n_input_tracks<<
" ---> "<<
" "<< n_output_tracks
338 <<
" "<<n_output_narrow_tracks<<
" "<<n_output_broad_tracks);
340 hist(
"n_input_tracks")->Fill(n_input_tracks);
341 hist(
"n_output_tracks")->Fill(n_output_tracks);
342 hist(
"n_output_narrow_tracks")->Fill(n_output_narrow_tracks);
343 hist(
"n_output_broad_tracks")->Fill(n_output_broad_tracks);
345 return StatusCode::SUCCESS;
◆ sysInitialize()
StatusCode AthHistogramAlgorithm::sysInitialize |
( |
| ) |
|
|
virtualinherited |
Initialization method invoked by the framework.
This method is responsible for any bookkeeping of initialization required by the framework itself. It will in turn invoke the initialize() method of the derived algorithm, and of any sub-algorithms which it creates.
Reimplemented from AthAlgorithm.
Reimplemented in AthAnalysisAlgorithm.
Definition at line 75 of file AthHistogramAlgorithm.cxx.
80 if ( Gaudi::StateMachine::INITIALIZED <= FSMState() )
return StatusCode::SUCCESS;
83 bindPropertiesTo( serviceLocator()->getOptsSvc() );
87 if ( !isEnabled( ) )
return StatusCode::SUCCESS;
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ tree()
TTree * AthHistogramming::tree |
( |
const std::string & |
treeName, |
|
|
const std::string & |
tDir = "" , |
|
|
const std::string & |
stream = "" |
|
) |
| |
|
protectedinherited |
Simplify the retrieval of registered TTrees.
Definition at line 378 of file AthHistogramming.cxx.
384 TreeMap_t::const_iterator
it =
m_treeMap.find( treeHash );
389 std::string treeNameCopy =
treeName;
390 std::string tDirCopy = tDir;
391 std::string streamCopy =
stream;
394 std::string bookingString(
"");
397 TTree* treePointer(NULL);
398 if ( !((
histSvc()->
getTree(bookingString, treePointer)).isSuccess()) )
400 m_msg << MSG::WARNING
401 <<
"Problem retrieving the TTree with name " << treeNameCopy
402 <<
" in " <<
m_name <<
"... it doesn't exist, neither in the cached map nor in the THistSvc!"
403 <<
" Will return an NULL pointer... you have to handle it correctly!" <<
endmsg;
408 m_treeMap.insert(
m_treeMap.end(), std::pair< const hash_t, TTree* >( treeHash, treePointer ) );
◆ updateVHKA()
◆ m_d0DecoratorKey
◆ m_detStore
◆ m_effMap
◆ m_EnableFakes
BooleanProperty EFTrackingSmearingAlg::m_EnableFakes {this,"IncludeDuplicatesAndFakes",false,"Enable fake track production"} |
|
private |
◆ m_enableMonitoring
BooleanProperty EFTrackingSmearingAlg::m_enableMonitoring {this, "EnableMonitoring", false, "Enable debugging monitoring of the algorithm"} |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_FakeKillerEnable
BooleanProperty EFTrackingSmearingAlg::m_FakeKillerEnable {this,"FakeKillerEnable",false, "disable inclusion of broad fakes"} |
|
private |
◆ m_graphMap
◆ m_histMap
◆ m_histNamePostfix
std::string AthHistogramAlgorithm::m_histNamePostfix |
|
privateinherited |
◆ m_histNamePrefix
std::string AthHistogramAlgorithm::m_histNamePrefix |
|
privateinherited |
◆ m_histSvc
◆ m_histTitlePostfix
std::string AthHistogramAlgorithm::m_histTitlePostfix |
|
privateinherited |
◆ m_histTitlePrefix
std::string AthHistogramAlgorithm::m_histTitlePrefix |
|
privateinherited |
◆ m_IncludeFakesInResolutionCalculation
BooleanProperty EFTrackingSmearingAlg::m_IncludeFakesInResolutionCalculation |
|
private |
Initial value:{this,"IncludeFakesInResolutionCalculation",false,
"modify calculation of covariance parameters to include weighted combination of core and broad RMS"}
Definition at line 66 of file EFTrackingSmearingAlg.h.
◆ m_inputTrackParticleKey
Initial value:{ this, "InputTrackParticleContainer", "InDetTrackParticles_tosmear",
"key for retrieval of input TrackParticles" }
Definition at line 30 of file EFTrackingSmearingAlg.h.
◆ m_inputTracksPtCut
DoubleProperty EFTrackingSmearingAlg::m_inputTracksPtCut {this, "InputTracksPtCutGeV", 0.0, "Set input track pT cut"} |
|
private |
◆ m_inputTruthParticleKey
Initial value:{this,"InputTruthParticleContainer","TruthParticles_tosmear",
"key for retrieval of input Truth particle"}
Definition at line 36 of file EFTrackingSmearingAlg.h.
◆ m_msg
MsgStream AthHistogramming::m_msg |
|
privateinherited |
◆ m_mySmearer
void* EFTrackingSmearingAlg::m_mySmearer |
|
private |
◆ m_name
std::string AthHistogramming::m_name |
|
privateinherited |
◆ m_outputTrackParticleKey
Initial value:{ this, "OutputTrackParticleContainer", "InDetTrackParticles_smeared",
"key for retrieval of output TrackParticles" }
Definition at line 33 of file EFTrackingSmearingAlg.h.
◆ m_outputTracksPtCut
DoubleProperty EFTrackingSmearingAlg::m_outputTracksPtCut {this, "OutputTracksPtCutGeV", 1.0, "Set the output track pT cut"} |
|
private |
◆ m_outputTruthParticleKey
Initial value:{this,"OutputTruthParticleContainer","TruthParticles_smeared",
"key for retrieval of output Truth particle"}
Definition at line 39 of file EFTrackingSmearingAlg.h.
◆ m_parameterizedTrackEfficiency
BooleanProperty EFTrackingSmearingAlg::m_parameterizedTrackEfficiency {this, "ParameterizedTrackEfficiency", false, "Enable parameterized efficiency for smearing"} |
|
private |
◆ m_parameterizedTrackEfficiency_LRT
BooleanProperty EFTrackingSmearingAlg::m_parameterizedTrackEfficiency_LRT {this, "ParameterizedTrackEfficiency_LRT", false, "Enable parameterized efficiency for LRT smearing"} |
|
private |
◆ m_prefix
std::string AthHistogramAlgorithm::m_prefix |
|
privateinherited |
◆ m_ptDecoratorKey
◆ m_RandomSeed
LongLongProperty EFTrackingSmearingAlg::m_RandomSeed {this,"RandomSeed",0} |
|
private |
◆ m_rootDir
std::string AthHistogramAlgorithm::m_rootDir |
|
privateinherited |
◆ m_SetResolutionPtCutOff
DoubleProperty EFTrackingSmearingAlg::m_SetResolutionPtCutOff {this, "SetResolutionPtCutOff", 0., "Set ptCutoff off for semaring"} |
|
private |
◆ m_SigmaScaleFactor
DoubleProperty EFTrackingSmearingAlg::m_SigmaScaleFactor {this, "SmearingScaleFactor", 1, "Set the smearing SF value for the sigmas"} |
|
private |
◆ m_smearedTrackEfficiency
DoubleProperty EFTrackingSmearingAlg::m_smearedTrackEfficiency {this, "SmearedTrackEfficiency", 1.0, "Set track efficiency for smearing"} |
|
private |
◆ m_smearedTrackEfficiency_d0high_LRT
DoubleProperty EFTrackingSmearingAlg::m_smearedTrackEfficiency_d0high_LRT {this, "SmearedTrackEfficiency_d0high_LRT", 1.0, "Set high d0 value for smeared track efficiency LRT"} |
|
private |
◆ m_smearedTrackEfficiency_d0low_LRT
DoubleProperty EFTrackingSmearingAlg::m_smearedTrackEfficiency_d0low_LRT {this, "SmearedTrackEfficiency_d0low_LRT", 1.0, "Set low d0 value for smeared track efficiency LRT"} |
|
private |
◆ m_smearTruthParticle
BooleanProperty EFTrackingSmearingAlg::m_smearTruthParticle {this, "SmearTruthParticle", false, "Enable smearing on truth particles, disabling the track smearing"} |
|
private |
◆ m_streamName
std::string AthHistogramming::m_streamName |
|
privateinherited |
◆ m_treeMap
◆ m_UseCoinToss
BooleanProperty EFTrackingSmearingAlg::m_UseCoinToss |
|
private |
Initial value:{this,"UseCoinToss",false,
"if True, fakes are generated with flat inefficiency, else use poissonian criteria"}
Definition at line 68 of file EFTrackingSmearingAlg.h.
◆ m_UseResolutionPtCutOff
BooleanProperty EFTrackingSmearingAlg::m_UseResolutionPtCutOff {this, "UseResolutionPtCutOff", false, "Apply ptCutoff on smearing"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_z0DecoratorKey
The documentation for this class was generated from the following files:
std::string m_rootDir
Name of the ROOT directory.
def retrieve(aClass, aKey=None)
StatusCode smearTruthParticles(const EventContext &ctx)
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
virtual double pt() const override final
The transverse momentum ( ) of the particle.
const TruthParticle_v1 * parent(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
DoubleProperty m_smearedTrackEfficiency_d0low_LRT
DoubleProperty m_outputTracksPtCut
BooleanProperty m_EnableFakes
void myReplace(std::string &str, const std::string &oldStr, const std::string &newStr)
Helper method to replace sub-string.
MsgStream m_msg
Cached Message Stream.
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
HistMap_t m_histMap
The map of histogram names to their pointers.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_z0DecoratorKey
Scalar phi() const
phi method
ServiceHandle< ITHistSvc > m_histSvc
Default constructor: AthHistogramAlgorithm();.
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
StatusCode book_histograms()
BooleanProperty m_IncludeFakesInResolutionCalculation
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
BooleanProperty m_smearTruthParticle
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_ptDecoratorKey
Scalar theta() const
theta method
std::string m_prefix
Name of the ROOT output stream (file)
float z0() const
Returns the parameter.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
void setDefiningParameters(float d0, float z0, float phi0, float theta, float qOverP)
Set the defining parameters.
bool msgLvl(const MSG::Level lvl) const
std::string m_histNamePrefix
The prefix for the histogram THx name.
std::string m_histTitlePrefix
The prefix for the histogram THx title.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputTruthParticleKey
const std::string & key() const
Return the StoreGate ID for the referenced object.
std::string m_histNamePostfix
The postfix for the histogram THx name.
std::vector< EFTrackingSmearing::FTS_Track > Tracks
std::string getTree(const std::string &file_name)
float d0() const
Returns the parameter.
virtual void setOwner(IDataHandleHolder *o)=0
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_d0DecoratorKey
TrackParticle_v1 TrackParticle
Reference the current persistent version:
BooleanProperty m_UseResolutionPtCutOff
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inputTrackParticleKey
virtual StatusCode sysInitialize() override
Override sysInitialize.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_inputTruthParticleKey
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
TruthParticle_v1 TruthParticle
Typedef to implementation.
#define CHECK(...)
Evaluate an expression and check for errors.
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_outputTrackParticleKey
GraphMap_t m_graphMap
The map of TGraph names to their pointers.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
std::string m_streamName
Name of the ROOT output stream (file)
StatusCode configAthHistogramming(const ServiceHandle< ITHistSvc > &histSvc, const std::string &prefix, const std::string &rootDir, const std::string &histNamePrefix, const std::string &histNamePostfix, const std::string &histTitlePrefix, const std::string &histTitlePostfix)
To be called by the derived classes to fill the internal configuration.
uint32_t hash_t
typedef for the internal hash
uint64_t crc64(const CRCTable &table, const char *data, size_t data_len)
Find the CRC-64 of a string,.
std::string m_histTitlePostfix
The postfix for the histogram THx title.
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
Helper fn to get raw data (vec<float>) from the covariance.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
float phi0() const
Returns the parameter, which has range to .
float qOverP() const
Returns the parameter.
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
BooleanProperty m_parameterizedTrackEfficiency
hash_t hash(const std::string &histName) const
Method to calculate a 32-bit hash from a string.
void SetInputTracksPtCut(double ptcut)
def getHist(name, makehist)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void setDefiningParametersCovMatrix(const ParametersCovMatrix_t &cov)
Set the defining parameters covariance matrix.
DoubleProperty m_inputTracksPtCut
std::uint64_t hash64(const void *data, std::size_t size)
Passthrough to XXH3_64bits.
DoubleProperty m_smearedTrackEfficiency
LongLongProperty m_RandomSeed
void setDefiningParametersCovMatrixVec(const std::vector< float > &cov)
DataObjIDColl m_extendedExtraObjects
BooleanProperty m_UseCoinToss
int status() const
Status code.
void AddTrack(double d0, double z0, double curv, double eta, double phi)
EffMap_t m_effMap
The map of histogram names to their pointers.
std::string m_histTitlePrefix
The prefix for the histogram THx title.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
std::string m_histNamePostfix
The postfix for the histogram THx name.
TreeMap_t m_treeMap
The map of TTree names to their pointers.
std::string m_histNamePrefix
The prefix for the histogram THx name.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::string m_histTitlePostfix
The postfix for the histogram THx title.
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
ServiceHandle< ITHistSvc > m_histSvc
Pointer to the THistSvc (event store by default)
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
DoubleProperty m_smearedTrackEfficiency_d0high_LRT
Class describing a TrackParticle.
BooleanProperty m_enableMonitoring
DoubleProperty m_SigmaScaleFactor
int pdgId() const
PDG ID code.
std::string m_name
Instance name.
BooleanProperty m_parameterizedTrackEfficiency_LRT
std::string m_rootDir
Name of the ROOT directory.
float theta() const
Returns the parameter, which has range 0 to .
BooleanProperty m_FakeKillerEnable
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
DoubleProperty m_SetResolutionPtCutOff
double charge() const
Physical charge.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
void buildBookingString(std::string &bookingString, std::string &histName, std::string &tDir, std::string &stream, bool usePrefixPostfix=false)
Method to build individual booking string.
TH1 * bookGetPointer(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.