86 m_h_rdoID =
new TH1F(
"h_rdoID",
"rdoID", 100, 0, 10e17);
87 m_h_rdoWord =
new TH1F(
"h_rdoWord",
"rdoWord", 100, 0, 350);
88 m_h_barrelEndcap =
new TH1F(
"h_barrelEndcap",
"Barrel or Endcap", 100, -5, 5);
89 m_h_layerDisk =
new TH1F(
"h_layerDisk",
"Barrel layer or Endcap disk", 100, 0, 10);
90 m_h_phiModule =
new TH1F(
"h_phiModule",
"Phi module", 100, 0, 100);
91 m_h_etaModule =
new TH1F(
"h_etaModule",
"Eta module", 100, -50, 50);
92 m_h_phiIndex =
new TH1F(
"h_phiIndex",
"Phi index", 820, 0, 820);
93 m_h_etaIndex =
new TH1F(
"h_etaIndex",
"Eta index", 820, 0, 820);
94 m_h_ToT =
new TH1F(
"h_ToT",
"ToT", 100, 0, 100);
95 m_h_BCID =
new TH1F(
"h_BCID",
"BCID", 100, -1.5, 1.5);
96 m_h_LVL1A =
new TH1F(
"h_LVL1A",
"LVL1A", 100, -1.5, 1.5);
97 m_h_LVL1ID =
new TH1F(
"h_LVL1ID",
"LVL1ID", 100, -1.5, 1.5);
100 m_h_brlLayer =
new TH1F(
"h_brlLayer",
"Barrel layer", 100, 0, 10);
101 m_h_brlPhiMod =
new TH1F(
"h_brlPhiMod",
"Barrel phi module", 100, 0, 100);
102 m_h_brlEtaMod =
new TH1F(
"h_brlEtaMod",
"Barrel eta module", 100, -50, 50);
103 m_h_brlPhiIndex =
new TH1F(
"h_brlPhiIndex",
"Barrel phi index", 820, 0, 820);
104 m_h_brlEtaIndex =
new TH1F(
"h_brlEtaIndex",
"Barrel eta index", 820, 0, 820);
105 m_h_brlToT =
new TH1F(
"h_brlToT",
"Barrel ToT", 100, 0, 100);
106 m_h_brlBCID =
new TH1F(
"h_brlBCID",
"Barrel BCID", 100, -1.5, 1.5);
107 m_h_brlLVL1A =
new TH1F(
"h_brlLVL1A",
"Barrel LVL1A", 100, -1.5, 1.5);
108 m_h_brlLVL1ID =
new TH1F(
"h_brlLVL1ID",
"Barrel LVL1ID", 100, -1.5, 1.5);
111 m_h_ecDisk =
new TH1F(
"h_ecDisk",
"Endcap disk", 100, 0, 10);
112 m_h_ecPhiMod =
new TH1F(
"h_ecPhiMod",
"Endcap phi module", 100, 0, 100);
113 m_h_ecEtaMod =
new TH1F(
"h_ecEtaMod",
"Endcap eta module", 100, -50, 50);
114 m_h_ecPhiIndex =
new TH1F(
"h_ecPhiIndex",
"Endcap phi index", 820, 0, 820);
115 m_h_ecEtaIndex =
new TH1F(
"h_ecEtaIndex",
"Endcap eta index", 820, 0, 820);
116 m_h_ecToT =
new TH1F(
"h_ecToT",
"EndcapToT", 100, 0, 100);
117 m_h_ecBCID =
new TH1F(
"h_ecBCID",
"Endcap BCID", 100, -1.5, 1.5);
118 m_h_ecLVL1A =
new TH1F(
"h_ecLVL1A",
"Endcap LVL1A", 100, -1.5, 1.5);
119 m_h_ecLVL1ID =
new TH1F(
"h_ecLVL1ID",
"Endcap LVL1ID", 100, -1.5, 1.5);
123 m_h_sdoID =
new TH1F(
"h_sdoID",
"sdoID", 100, 0, 10e17);
124 m_h_sdoWord =
new TH1F(
"h_sdoWord",
"sdoWord", 100, 0, 350);
126 m_h_layerDisk_sdo =
new TH1F(
"h_layerDisk_sdo",
"Barrel layer or Endcap disk (SDO)", 100, 0, 10);
127 m_h_phiModule_sdo =
new TH1F(
"h_phiModule_sdo",
"Phi module (SDO)", 100, 0, 100);
128 m_h_etaModule_sdo =
new TH1F(
"h_etaModule_sdo",
"Eta module (SDO)", 100, -50, 50);
129 m_h_phiIndex_sdo =
new TH1F(
"h_phiIndex_sdo",
"Phi index (SDO)", 820, 0, 820);
130 m_h_etaIndex_sdo =
new TH1F(
"h_etaIndex_sdo",
"Eta index (SDO)", 820, 0, 820);
131 m_h_barcode =
new TH1F(
"h_barcode",
"Barcode (SDO)", 100, 0, 2.2e5);
132 m_h_eventIndex =
new TH1F(
"h_eventIndex",
"Event Index (SDO)", 100, 0, 2);
133 m_h_charge =
new TH1F(
"h_charge",
"Charge (SDO)", 100, 0, 1e7);
136 m_h_belowThresh_brl =
new TH1F(
"h_belowThresh_brl",
"Below threshold pixels - Barrel; # below threshold pixels; layer", 8, -0.5, 7.5);
137 m_h_disabled_brl =
new TH1F(
"h_disabled_brl",
"Disabled pixels - Barrel; # disabled pixels; layer", 8, -0.5, 7.5);
139 m_h_belowThresh_ec =
new TH1F(
"h_belowThresh_ec",
"Below threshold pixels - Endcap; # below threshold pixels; layer", 8, -0.5, 7.5);
140 m_h_disabled_ec =
new TH1F(
"h_disabled_ec",
"Disabled pixels - Endcap; # disabled pixels; layer", 8, -0.5, 7.5);
278 for (
unsigned int layer=0; layer<33; layer++) {
279 m_h_brlflatPhiIndex_perLayer.emplace_back(
new TH1F((
"h_brlflatPhiIndex_perLayer"+std::to_string(layer)).c_str(), (
"Phi index - Barrel Flat - Layer "+std::to_string(layer)).c_str(), 820, 0, 820));
283 m_h_brlflatEtaIndex_perLayer.emplace_back(
new TH1F((
"h_brlflatEtaIndex_perLayer"+std::to_string(layer)).c_str(), (
"Eta index - Barrel Flat - Layer "+std::to_string(layer)).c_str(), 820, 0, 820));
287 m_h_brlinclPhiIndex_perLayer.emplace_back(
new TH1F((
"h_brlinclPhiIndex_perLayer"+std::to_string(layer)).c_str(), (
"Phi index - Barrel Inclined - Layer "+std::to_string(layer)).c_str(), 820, 0, 820));
291 m_h_brlinclEtaIndex_perLayer.emplace_back(
new TH1F((
"h_brlinclEtaIndex_perLayer"+std::to_string(layer)).c_str(), (
"Eta index - Barrel Inclined - Layer "+std::to_string(layer)).c_str(), 820, 0, 820));
295 m_h_ecPhiIndex_perLayer.emplace_back(
new TH1F((
"h_ecPhiIndex_perLayer"+std::to_string(layer)).c_str(), (
"Phi index - Endcap - Layer "+std::to_string(layer)).c_str(), 820, 0, 820));
299 m_h_ecEtaIndex_perLayer.emplace_back(
new TH1F((
"h_ecEtaIndex_perLayer"+std::to_string(layer)).c_str(), (
"Eta index - Endcap - Layer "+std::to_string(layer)).c_str(), 820, 0, 820));
304 m_h_phiIndexInnermost =
new TH1F(
"h_PhiIndexInnermost",
"Phi index - Innermost Layer ", 820, 0, 820);
308 m_h_etaIndexInnermost =
new TH1F(
"h_EtaIndexInnermost",
"Eta index - Innermost Layer ", 820, 0, 820);
320 m_h_globalXY =
new TH2F(
"h_globalXY",
"h_globalXY; x [mm]; y [mm]",700,-350.,350,700,-350.,350);
322 m_h_globalZR =
new TH2F(
"h_globalZR",
"h_globalZR; z [mm]; r [mm]",6800,-3400.,3400,350,0.,350);
324 m_h_globalX =
new TH1F(
"h_globalX",
"h_globalX; x [mm]",700,-350.,350.);
326 m_h_globalY =
new TH1F(
"h_globalY",
"h_globalY; y [mm]",700,-350.,350.);
328 m_h_globalZ =
new TH1F(
"h_globalZ",
"h_globalZ; z [mm]",6800,-3400.,3400.);
332 std::string xy_name =
"h_ITk_xy";
333 auto xy = std::make_unique<TH2D>(xy_name.c_str(), xy_name.c_str(), 2200, -1100, 1100, 2200, -1100, 1100);
337 std::string zr_name =
"h_ITk_zr";
338 auto zr = std::make_unique<TH2D>(zr_name.c_str(), zr_name.c_str(), 6800, -3400, 3400, 1100, 0, 1100);
343 TString truthMatchBinLables[4] = {
"All RDOs",
"Truth Matched",
"HS Matched",
"Unmatched" };
344 for(
unsigned int ibin = 1; ibin < 5; ibin++) {
348 return StatusCode::SUCCESS;
395 const EventContext& ctx{Gaudi::Hive::currentContext()};
404 bool doTruthMatching =
true;
405 const HepMC::GenEvent* hardScatterEvent(
nullptr);
407 if (mcEventCollection->
size()==0){
408 ATH_MSG_WARNING(
"Failed to retrieve a nonzero sized truth event collection, disabling truthMatching");
409 doTruthMatching =
false;
411 if(doTruthMatching) hardScatterEvent = mcEventCollection->
at(0);
413 if(p_pixelRDO_cont) {
417 for ( ; rdoCont_itr != rdoCont_end; ++rdoCont_itr ) {
423 const int pixBrlEc(
m_pixelID->barrel_ec(rdoIDColl));
424 const int pixLayerDisk(
m_pixelID->layer_disk(rdoIDColl));
425 const int pixPhiMod(
m_pixelID->phi_module(rdoIDColl));
426 const int pixEtaMod(
m_pixelID->eta_module(rdoIDColl));
427 const int pixIsInnermost(0);
428 const int pixIsNextToInnermost(0);
435 for ( ; rdo_itr != rdo_end; ++rdo_itr ) {
438 bool findMatch =
false;
440 InDetSimDataCollection::const_iterator iter = (*simDataMapPixel).find((*rdo_itr)->identify());
442 if ( iter != (*simDataMapPixel).end() ) {
444 const std::vector< InDetSimData::Deposit >& deposits = sdo.
getdeposits();
445 std::vector< InDetSimData::Deposit >::const_iterator nextdeposit = deposits.begin();
446 std::vector< InDetSimData::Deposit >::const_iterator lastdeposit = deposits.end();
447 for( ; nextdeposit!=lastdeposit; ++nextdeposit) {
449 if(particleLink.
isValid() && !findMatch){
460 const Identifier rdoID((*rdo_itr)->identify());
461 const unsigned int rdoWord((*rdo_itr)->getWord());
462 const int pixPhiIx(
m_pixelID->phi_index(rdoID));
463 const int pixEtaIx(
m_pixelID->eta_index(rdoID));
464 const int pixToT((*rdo_itr)->getToT());
465 const int pixBCID((*rdo_itr)->getBCID());
466 const int pixLVL1A((*rdo_itr)->getLVL1A());
467 const int pixLVL1ID((*rdo_itr)->getLVL1ID());
492 const unsigned long long rdoID_int = rdoID.
get_compact();
503 m_ToT->push_back(pixToT);
504 m_BCID->push_back(pixBCID);
521 if (pixIsInnermost) {
524 }
else if (pixIsNextToInnermost) {
571 if(simDataMapPixel) {
573 InDetSimDataCollection::const_iterator sdo_itr(simDataMapPixel->begin());
574 const InDetSimDataCollection::const_iterator sdo_end(simDataMapPixel->end());
576 std::vector<int> barcode_vec;
577 std::vector<int> eventIndex_vec;
578 std::vector<float> charge_vec;
579 for ( ; sdo_itr != sdo_end; ++sdo_itr ) {
582 const unsigned long long sdoID_int = sdoID.
get_compact();
583 const int sdoWord(sdo.
word());
584 const int pixBrlEc_sdo(
m_pixelID->barrel_ec(sdoID));
585 const int pixLayerDisk_sdo(
m_pixelID->layer_disk(sdoID));
586 const int pixPhiMod_sdo(
m_pixelID->phi_module(sdoID));
587 const int pixEtaMod_sdo(
m_pixelID->eta_module(sdoID));
588 const int pixPhiIx_sdo(
m_pixelID->phi_index(sdoID));
589 const int pixEtaIx_sdo(
m_pixelID->eta_index(sdoID));
609 else if (abs(pixBrlEc_sdo)==2)
617 else if (abs(pixBrlEc_sdo)==2)
633 const std::vector<InDetSimData::Deposit>& deposits = sdo.
getdeposits();
634 std::vector<InDetSimData::Deposit>::const_iterator dep_itr(deposits.begin());
635 const std::vector<InDetSimData::Deposit>::const_iterator dep_end(deposits.end());
636 for ( ; dep_itr != dep_end; ++dep_itr ) {
640 const int charge((*dep_itr).second);
650 barcode_vec.push_back(bar);
651 eventIndex_vec.push_back(eventIx);
652 charge_vec.push_back(
charge);
658 eventIndex_vec.clear();
665 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
double charge(const T &p)
InDetRawDataCollection< PixelRDORawData > PixelRDO_Collection
InDetRawDataContainer< InDetRawDataCollection< PixelRDORawData > > PixelRDO_Container
Handle class for reading from StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
DataModel_detail::const_iterator< DataVector > const_iterator
const T * at(size_type n) const
Access an element, as an rvalue.
const_iterator end() const noexcept
const_iterator begin() const noexcept
size_type size() const noexcept
Returns the number of elements in the collection.
a link optimized in size for a GenParticle in a McEventCollection
bool isValid() const
Validity check.
HepMC::ConstGenParticlePtr cptr() const
Dereference.
index_type eventIndex() const
Return the event number of the referenced GenEvent.
SG::ReadHandleKey< InDetSimDataCollection > m_inputTruthKey
std::vector< TH1 * > m_h_ecEtaIndex_perLayer
std::vector< double > * m_globalZ
std::vector< unsigned long long > * m_sdoID
SG::ReadHandleKey< McEventCollection > m_inputMcEventCollectionKey
std::vector< int > * m_etaIndex
std::vector< int > * m_barrelEndcap_sdo
const InDetDD::PixelDetectorManager * m_pixelManager
std::vector< bool > * m_noise
std::vector< int > * m_phiIndex
std::vector< unsigned int > * m_rdoWord
std::vector< double > * m_localX
std::vector< double > * m_localZ
Gaudi::Property< std::string > m_histPath
std::vector< int > * m_LVL1A
TH1 * m_h_barrelEndcap_sdo
std::vector< int > * m_charge
virtual StatusCode execute() override final
std::vector< TH1 * > m_h_ecPhiIndex_perLayer
std::vector< int > * m_eventIndex
std::vector< double > * m_globalX
std::vector< int > * m_barrelEndcap
std::vector< int > * m_barcode
std::vector< int > * m_phiModule_sdo
std::vector< std::vector< int > > * m_barcode_vec
std::vector< std::vector< float > > * m_charge_vec
std::vector< TH1 * > m_h_brlinclEtaIndex_perLayer
LockedHandle< TH2 > m_h_globalXY_shared
std::vector< unsigned long long > * m_rdoID
TH1 * m_h_truthMatchedRDOs
std::vector< int > * m_layerDisk_sdo
const PixelID * m_pixelID
TH1 * m_h_phiIndexInnermost
std::vector< int > * m_sdoWord
TH1 * m_h_belowThresh_brl
std::vector< int > * m_ToT
LockedHandle< TH2 > m_h_globalZR_shared
std::vector< double > * m_localY
std::vector< int > * m_BCID
std::vector< std::vector< int > > * m_eventIndex_vec
Gaudi::Property< std::string > m_ntuplePath
std::vector< double > * m_globalY
std::vector< int > * m_phiModule
virtual StatusCode initialize() override final
Gaudi::Property< std::string > m_sharedHistPath
Gaudi::Property< bool > m_doPosition
std::vector< int > * m_layerDisk
std::vector< bool > * m_belowThresh
std::vector< TH1 * > m_h_brlflatEtaIndex_perLayer
std::vector< int > * m_phiIndex_sdo
std::vector< TH1 * > m_h_brlinclPhiIndex_perLayer
std::vector< int > * m_etaIndex_sdo
std::vector< int > * m_LVL1ID
std::vector< int > * m_isInnermost
TH1 * m_h_etaIndexInnermost
std::vector< int > * m_etaModule
std::vector< bool > * m_disabled
std::vector< bool > * m_badTOT
std::vector< int > * m_isNextToInnermost
TH1 * m_h_phiIndexNextToInnermost
Gaudi::Property< std::string > m_pixelIDName
Gaudi::Property< std::string > m_ntupleName
std::vector< TH1 * > m_h_brlflatPhiIndex_perLayer
TH1 * m_h_etaIndexNextToInnermost
Gaudi::Property< std::string > m_detectorName
SG::ReadHandleKey< PixelRDO_Container > m_inputKey
std::vector< int > * m_etaModule_sdo
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
value_type get_compact() const
Get the compact id.
Class to hold geometrical description of a silicon detector element.
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
double xDepth() const
position along depth direction:
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
virtual Identifier identify() const override final
const std::vector< Deposit > & getdeposits() const
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
static bool isBelowThreshold(const InDetSimData &sdo)
static bool hasBadTOT(const InDetSimData &sdo)
static bool isNoise(const InDetSimData &sdo)
static bool isDisabled(const InDetSimData &sdo)
Eigen::Matrix< double, 3, 1 > Vector3D
const GenParticle * ConstGenParticlePtr
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.