Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
20 , m_inputKey(
"PixelRDOs")
21 , m_inputTruthKey(
"PixelSDO_Map")
22 , m_inputMcEventCollectionKey(
"TruthEvent")
38 , m_barrelEndcap_sdo(0)
84 , m_h_TruthMatchedRDOs(nullptr)
87 , m_ntupleFileName(
"/ntuples/file1")
88 , m_ntupleDirName(
"/PixelRDOAnalysis/")
89 , m_ntupleTreeName(
"PixelRDOAna")
90 ,
m_path(
"/PixelRDOAnalysis/")
91 , m_thistSvc(
"THistSvc",
name)
171 m_h_layerDisk =
new TH1F(
"h_layerDisk",
"Barrel layer or Endcap disk", 100, 0, 3);
324 TString truthMatchBinLables[4] = {
"All RDOs",
"Truth Matched",
"HS Matched",
"Unmatched" };
325 for(
unsigned int ibin = 1; ibin < 5; ibin++) {
331 return StatusCode::SUCCESS;
373 bool doTruthMatching =
true;
374 const HepMC::GenEvent* hardScatterEvent(
nullptr);
376 if ((!mcEventCollection.
isValid())||mcEventCollection->
size()==0){
377 ATH_MSG_WARNING(
"Failed to retrieve a nonzero sized truth event collection, disabling truthMatching");
378 doTruthMatching =
false;
380 if(doTruthMatching) hardScatterEvent = mcEventCollection->
at(0);
382 if(p_pixelRDO_cont.
isValid()) {
386 for ( ; rdoCont_itr != rdoCont_end; ++rdoCont_itr ) {
390 for ( ; rdo_itr != rdo_end; ++rdo_itr ) {
393 bool findMatch =
false;
395 InDetSimDataCollection::const_iterator iter = (*simDataMapPixel).find((*rdo_itr)->identify());
397 if ( iter != (*simDataMapPixel).end() ) {
399 const std::vector< InDetSimData::Deposit >& deposits = sdo.
getdeposits();
400 std::vector< InDetSimData::Deposit >::const_iterator nextdeposit = deposits.begin();
401 std::vector< InDetSimData::Deposit >::const_iterator lastdeposit = deposits.end();
402 for( ; nextdeposit!=lastdeposit; ++nextdeposit) {
404 if(particleLink.
isValid() && !findMatch){
415 const Identifier rdoID((*rdo_itr)->identify());
417 const unsigned int rdoWord((*rdo_itr)->getWord());
423 const int pixToT((*rdo_itr)->getToT());
424 const int pixBCID((*rdo_itr)->getBCID());
425 const int pixLVL1A((*rdo_itr)->getLVL1A());
426 const int pixLVL1ID((*rdo_itr)->getLVL1ID());
428 const unsigned long long rdoID_int = rdoID.
get_compact();
437 m_ToT->push_back(pixToT);
438 m_BCID->push_back(pixBCID);
466 else if (abs(pixBrlEc) == 4) {
482 if(simDataMapPixel.
isValid()) {
484 InDetSimDataCollection::const_iterator sdo_itr(simDataMapPixel->begin());
485 const InDetSimDataCollection::const_iterator sdo_end(simDataMapPixel->end());
487 std::vector<int> barcode_vec;
488 std::vector<int> eventIndex_vec;
489 std::vector<float> charge_vec;
490 for ( ; sdo_itr != sdo_end; ++sdo_itr ) {
493 const unsigned long long sdoID_int = sdoID.
get_compact();
494 const int sdoWord(sdo.
word());
529 const std::vector<InDetSimData::Deposit>& deposits = sdo.
getdeposits();
530 std::vector<InDetSimData::Deposit>::const_iterator dep_itr(deposits.begin());
531 const std::vector<InDetSimData::Deposit>::const_iterator dep_end(deposits.end());
532 for ( ; dep_itr != dep_end; ++dep_itr ) {
536 const int charge((*dep_itr).second);
546 barcode_vec.push_back(
bar);
547 eventIndex_vec.push_back(eventIx);
548 charge_vec.push_back(
charge);
554 eventIndex_vec.clear();
563 return StatusCode::SUCCESS;
567 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
std::vector< unsigned long long > * m_rdoID
std::vector< bool > * m_noise
Const iterator class for DataVector/DataList.
int phi_index(const Identifier &id) const
const std::vector< Deposit > & getdeposits() const
std::vector< std::vector< int > > * m_barcode_vec
SG::ReadHandleKey< McEventCollection > m_inputMcEventCollectionKey
std::vector< unsigned int > * m_rdoWord
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::vector< int > * m_eventIndex
SG::ReadHandleKey< InDetSimDataCollection > m_inputTruthKey
std::vector< std::vector< int > > * m_eventIndex_vec
value_type get_compact() const
Get the compact id.
static bool isNoise(const InDetSimData &sdo)
std::vector< int > * m_etaModule_sdo
std::vector< unsigned long long > * m_sdoID
std::vector< int > * m_etaModule
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode execute() override final
static bool hasBadTOT(const InDetSimData &sdo)
HepMC::ConstGenParticlePtr cptr() const
Dereference.
a link optimized in size for a GenParticle in a McEventCollection
virtual StatusCode initialize() override final
std::vector< int > * m_phiModule_sdo
std::vector< int > * m_phiIndex
std::vector< bool > * m_badTOT
virtual StatusCode finalize() override final
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string m_ntupleDirName
std::string m_path
the path being used
std::vector< int > * m_barcode
static bool isBelowThreshold(const InDetSimData &sdo)
int eta_index(const Identifier &id) const
const_iterator end() const
return const_iterator for end of container
std::vector< int > * m_barrelEndcap
const_iterator begin() const
return const_iterator for first entry
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_ntupleFileName
bool isValid() const
Validity check.
std::vector< int > * m_etaIndex_sdo
std::vector< int > * m_ToT
std::vector< int > * m_LVL1ID
std::vector< int > * m_sdoWord
std::vector< std::vector< float > > * m_charge_vec
std::vector< int > * m_barrelEndcap_sdo
SG::ReadHandleKey< PixelRDO_Container > m_inputKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TH1 * m_h_barrelEndcap_sdo
int layer_disk(const Identifier &id) const
index_type eventIndex() const
Return the event number of the referenced GenEvent.
const GenParticle * ConstGenParticlePtr
int eta_module(const Identifier &id) const
std::vector< int > * m_BCID
double charge(const T &p)
std::vector< int > * m_etaIndex
PixelRDOAnalysis(const std::string &name, ISvcLocator *pSvcLocator)
std::string m_ntupleTreeName
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ServiceHandle< ITHistSvc > m_thistSvc
std::vector< int > * m_phiModule
std::vector< bool > * m_disabled
#define ATH_MSG_WARNING(x)
std::vector< int > * m_LVL1A
const PixelID * m_pixelID
static bool isDisabled(const InDetSimData &sdo)
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
const T * at(size_type n) const
Access an element, as an rvalue.
Handle class for reading from StoreGate.
TH1 * m_h_TruthMatchedRDOs
std::vector< int > * m_layerDisk_sdo
std::vector< int > * m_phiIndex_sdo
int phi_module(const Identifier &id) const
std::vector< int > * m_charge
std::vector< bool > * m_belowThresh
std::vector< int > * m_layerDisk
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.