diff --git a/Generators/GenAnalysisTools/TruthHelper/TruthHelper/PileUpType.h b/Generators/GenAnalysisTools/TruthHelper/TruthHelper/PileUpType.h index a288cbb736c41071c5b41b46649457d2ca4b6100..0b1eaba22f03009cb28d5f21081f999967fca3b3 100644 --- a/Generators/GenAnalysisTools/TruthHelper/TruthHelper/PileUpType.h +++ b/Generators/GenAnalysisTools/TruthHelper/TruthHelper/PileUpType.h @@ -38,10 +38,7 @@ public: PileUpType(const McEventCollection * collection); - /** extract the Physics Signal McEvent Particles from the McEventCollection - A pair of iterators is returned on all the signal particles */ - HepMC::GenEvent::particle_const_iterator signal_particle_begin() const; - HepMC::GenEvent::particle_const_iterator signal_particle_end() const; + const HepMC::GenEvent * signal_mc_event() const; template<class Selector> diff --git a/Generators/GenAnalysisTools/TruthHelper/TruthHelper/PileUpType.icc b/Generators/GenAnalysisTools/TruthHelper/TruthHelper/PileUpType.icc index 81cacf9f621c019f451698d58c8ccbe192052562..6a8a944969b2ef308ac24374eedfb7a6afc3c936 100644 --- a/Generators/GenAnalysisTools/TruthHelper/TruthHelper/PileUpType.icc +++ b/Generators/GenAnalysisTools/TruthHelper/TruthHelper/PileUpType.icc @@ -10,11 +10,14 @@ template<class Selector> void PileUpType::signal_particles( std::vector<const HepMC::GenParticle*>& particleList, const Selector& select ) const { - HepMC::GenEvent::particle_const_iterator istart = this->signal_particle_begin(); - HepMC::GenEvent::particle_const_iterator iend = this->signal_particle_end(); + unsigned int colSize = m_particleList->size(); + if ( colSize > 0 ) { + HepMC::GenEvent::particle_const_iterator istart = this->m_particleList->at(0)->particles_begin(); + HepMC::GenEvent::particle_const_iterator iend = this->m_particleList->at(0)->particles_end(); for ( ; istart != iend; ++istart ) { if ( select(*istart) ) particleList.push_back ( *istart ); } + } } template<class Selector> diff --git a/Generators/GenAnalysisTools/TruthHelper/src/PileUpType.cxx b/Generators/GenAnalysisTools/TruthHelper/src/PileUpType.cxx index 99dac0f97f80f25a32703e74b413598cf571cadc..6dc641e4fbb142ffdc082feac1ab140af7cdbb9b 100644 --- a/Generators/GenAnalysisTools/TruthHelper/src/PileUpType.cxx +++ b/Generators/GenAnalysisTools/TruthHelper/src/PileUpType.cxx @@ -10,22 +10,6 @@ PileUpType::PileUpType(const McEventCollection * collection) { } -HepMC::GenEvent::particle_const_iterator PileUpType::signal_particle_begin() const { - HepMC::GenEvent::particle_const_iterator it; - unsigned int colSize = m_particleList->size(); - if ( colSize > 0 ) it = (m_particleList->at(0))->particles_begin(); - return it; -} - - -HepMC::GenEvent::particle_const_iterator PileUpType::signal_particle_end() const { - HepMC::GenEvent::particle_const_iterator it; - unsigned int colSize = m_particleList->size(); - if ( colSize > 0 ) it = (m_particleList->at(0))->particles_end(); - return it; -} - - const HepMC::GenEvent * PileUpType::signal_mc_event() const { if ( m_particleList->size() > 0 ) return m_particleList->at(0); else return NULL; diff --git a/Simulation/FastShower/FastCaloSim/src/FastShowerCellBuilderTool.cxx b/Simulation/FastShower/FastCaloSim/src/FastShowerCellBuilderTool.cxx index e8c880d889b718145c5bbd2d5209b55d7ab59cb9..f023ace6344c7998e38167f398d3392068723b3b 100755 --- a/Simulation/FastShower/FastCaloSim/src/FastShowerCellBuilderTool.cxx +++ b/Simulation/FastShower/FastCaloSim/src/FastShowerCellBuilderTool.cxx @@ -2352,10 +2352,6 @@ FastShowerCellBuilderTool::process (CaloCellContainer* theCellContainer, ATH_MSG_DEBUG("Start getting particles"); - // pileupType.signal_particles(particles, isStable); - //pileupType.signal_particles(particles, ifs); - //ZH 28.07.2014 Try using TruthUtils instead: - if (mcCollptr->size() >0) { HepMC::GenEvent::particle_const_iterator istart = mcCollptr->at(0)->particles_begin(); diff --git a/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtVarsTool.cxx b/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtVarsTool.cxx index 8d73828a981b3bc394a0e47e5dcee827cee8612f..f4037ede6145a065e48dd8bcbd77ba2f6c30762d 100644 --- a/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtVarsTool.cxx +++ b/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtVarsTool.cxx @@ -100,83 +100,6 @@ bool Trig::TrigNtVarsTool::CollectTD(TrigMonEvent& /*event*/) ATH_MSG_ERROR("This tool is depricated. It needs migrating if it is to function again." ); - // // - // // Collect trigger deciions - // // - // if(!m_config) { - // ATH_MSG_WARNING("Missing internal trigger configuration" ); - // return false; - // } - - // // - // // Get configured chains for this level - // // - // Trig::TrigDecisionTool &t = *m_trigDec; - // const std::vector<std::string> trig_list = t.getListOfTriggers(); - - // for(unsigned i = 0; i < m_config->size<TrigConfChain>(); ++i) { - // const TrigConfChain &chain = m_config->at<TrigConfChain>(i); - // const std::string &n = chain.getName(); - - // // - // // Match chain name against list of triggers - // // - // const unsigned ntrig = std::count(trig_list.begin(), trig_list.end(), chain.getName()); - // if(ntrig != 1) { - // ATH_MSG_WARNING("Incorrect count " << chain.getName() << ": " << ntrig ); - // } - - // // - // // Collect all decision bits - // // - // std::vector<TrigMonL1Item::Decision> lv1; - // std::vector<TrigMonChain::Decision> hlt; - - // if(chain.getLevelId() == 1) { - // if(t.isPassed(n, TrigDefs::Physics)) lv1.push_back(TrigMonL1Item::kL1AfterVeto); - // if(t.isPassedBits(n) & TrigDefs::L1_isPassedAfterVeto) lv1.push_back(TrigMonL1Item::kL1AfterVeto); - // if(t.isPassedBits(n) & TrigDefs::L1_isPassedAfterPrescale) lv1.push_back(TrigMonL1Item::kL1AfterPrescale); - // if(t.isPassedBits(n) & TrigDefs::L1_isPassedBeforePrescale) lv1.push_back(TrigMonL1Item::kL1BeforePrescale); - // } - // else if(chain.getLevelId() == 2) { - // if(t.isPassed(n, TrigDefs::Physics)) hlt.push_back(TrigMonChain::kPassed); - // if(t.isPassedBits(n) & TrigDefs::L2_passedRaw) hlt.push_back(TrigMonChain::kPassedRaw); - // if(t.isPassedBits(n) & TrigDefs::L2_prescaled) hlt.push_back(TrigMonChain::kPrescaled); - // if(t.isPassedBits(n) & TrigDefs::L2_passThrough) hlt.push_back(TrigMonChain::kPassedThrough); - // if(t.isPassedBits(n) & TrigDefs::L2_resurrected) hlt.push_back(TrigMonChain::kResurrected); - // } - // else if(chain.getLevelId() == 3) { - // if(t.isPassed(n, TrigDefs::Physics)) hlt.push_back(TrigMonChain::kPassed); - // if(t.isPassedBits(n) & TrigDefs::EF_passedRaw) hlt.push_back(TrigMonChain::kPassedRaw); - // if(t.isPassedBits(n) & TrigDefs::EF_prescaled) hlt.push_back(TrigMonChain::kPrescaled); - // if(t.isPassedBits(n) & TrigDefs::EF_passThrough) hlt.push_back(TrigMonChain::kPassedThrough); - // if(t.isPassedBits(n) & TrigDefs::EF_resurrected) hlt.push_back(TrigMonChain::kResurrected); - // } - - // // - // // Save triggers which have at least one trigger bit set - // // - // if(!lv1.empty()) { - // TrigMonL1Item trig; - // trig.setCtpId(chain.getCounter()); - - // for(unsigned j = 0; j < lv1.size(); ++j) { - // trig.addDecision(lv1.at(j)); - // } - - // event.add<TrigMonL1Item>(trig); - // } - - // if(!hlt.empty()) { - // TrigMonChain trig(chain.getLevelId(), chain.getCounter()); - - // for(unsigned j = 0; j < hlt.size(); ++j) { - // trig.addDecision(hlt.at(j)); - // } - - // event.add<TrigMonChain>(trig); - // } - // } return true; } @@ -187,103 +110,6 @@ bool Trig::TrigNtVarsTool::CollectMC(TrigMonEvent& /*event*/) ATH_MSG_ERROR("This tool is depricated. It needs migrating if it is to function again." ); - // // - // // Collect MC truth informartion - // // - - // if(!m_storeGate->contains<McEventCollection>(m_keyMCEvent)) { - // ATH_MSG_DEBUG("McEventCollection not found" ); - // return false; - // } - - // const McEventCollection* mcCollptr = 0; - // if(m_storeGate->retrieve(mcCollptr, m_keyMCEvent).isFailure()) { - // ATH_MSG_WARNING("Could not retrieve McEventCollection" ); - // return false; - // } - - // /** initialize a pileup type helper object */ - // PileUpType pileupType( mcCollptr ); - - // // signal - // const HepMC::GenEvent * signal = pileupType.signal_mc_event(); - // const HepMC::GenVertex* prodVtx = signal->signal_process_vertex(); - // if ( prodVtx ) { - // float xi = (prodVtx->position()).x(); - // float yi = (prodVtx->position()).y(); - // float zi = (prodVtx->position()).z(); - - // log() << MSG::DEBUG - // << "Signal vertex is " << xi << " " << yi << " " << zi - // << " process ID = " << signal->signal_process_id() - // << " McEvent index = " << signal->event_number() ); - // } - - // // in-time minbias - // McEventCollection::const_iterator ibeg_minb = pileupType.in_time_minimum_bias_event_begin(); - // McEventCollection::const_iterator iend_minb = pileupType.in_time_minimum_bias_event_end(); - // unsigned int icount_pileup = 0; - - // for (; ibeg_minb!=iend_minb; ++ibeg_minb ) { - // const HepMC::GenVertex* prodVtx = (*ibeg_minb)->signal_process_vertex(); - // if ( prodVtx ) { - // ++icount_pileup; - // float xi = (prodVtx->position()).x(); - // float yi = (prodVtx->position()).y(); - // float zi = (prodVtx->position()).z(); - - // log() << MSG::DEBUG - // << "Pileup vertex is " << xi << " " << yi << " " << zi - // << " process ID = " << (*ibeg_minb)->signal_process_id() - // << " McEvent index = " << (*ibeg_minb)->event_number() ); - // } - // } - - // // in-time minbias and signal - // McEventCollection::const_iterator ibeg_evt = pileupType.in_time_event_begin(); - // McEventCollection::const_iterator iend_evt = pileupType.in_time_event_end(); - // unsigned int icount_event = 0; - - // for (; ibeg_evt != iend_evt; ++ibeg_evt ) { - // const HepMC::GenVertex* prodVtx = (*ibeg_evt)->signal_process_vertex(); - // if ( prodVtx ) { - // ++icount_event; - // float xi = (prodVtx->position()).x(); - // float yi = (prodVtx->position()).y(); - // float zi = (prodVtx->position()).z(); - - // log() << MSG::DEBUG - // << "Pileup/signal vertex is " << xi << " " << yi << " " << zi - // << " process ID = " << (*ibeg_evt)->signal_process_id() - // << " McEvent index = " << (*ibeg_evt)->event_number() ); - // } - // } - - // // in-time minbias and signal - // HepMC::GenEvent::particle_const_iterator ibeg_sig = pileupType.signal_particle_begin(); - // HepMC::GenEvent::particle_const_iterator iend_sig = pileupType.signal_particle_end(); - // unsigned int icount_signal = 0; - - // for (; ibeg_sig != iend_sig; ++ibeg_sig ) { - // const HepMC::GenParticle* prodEvent = (*ibeg_sig); - // if ( prodEvent ) { - // ++icount_signal; - // } - // } - - // // retrieve the list of in-time generator stable particles - signal and in-time minimum bias - // // in-time meas particles in Bunch crossing = 0 - // TruthHelper::IsGenStable isStable; - // std::vector<const HepMC::GenParticle*> particleList; - // pileupType.in_time_particles( particleList, isStable ); - - // // Add data - // event.addVar(201, static_cast<float>(icount_signal)); - // event.addVar(202, static_cast<float>(icount_pileup)); - // event.addVar(203, static_cast<float>(icount_event)); - // event.addVar(204, static_cast<float>(particleList.size())); - - // ATH_MSG_DEBUG("Number of stable in-time pileup particles = " << particleList.size() ); return true; } @@ -294,83 +120,6 @@ bool Trig::TrigNtVarsTool::CollectPU(TrigMonEvent& /*event*/) ATH_MSG_ERROR("This tool is depricated. It needs migrating if it is to function again." ); - // - // Collect MC truth from PileupEventInfo - // - - // - // Counters for pileup events - // - // unsigned nevent = 0, nminbias = 0, ncavern = 0, nbeamgas = 0, nzerobias = 0; - // unsigned nevent_intime = 0, nsignal_intime = 0, nminbias_intime = 0; - // unsigned ncavern_intime = 0, nbeamgas_intime = 0; - - // const PileUpEventInfo* pevt = 0; - // if(m_storeGate->contains<PileUpEventInfo>(m_keyPileUp) && - // m_storeGate->retrieve(pevt, m_keyPileUp).isSuccess()) { - - // ATH_MSG_DEBUG("Found PileUpEventInfo with key: " << m_keyPileUp ); - - // PileUpEventInfo::SubEvent::const_iterator it = pevt->beginSubEvt(); - // PileUpEventInfo::SubEvent::const_iterator end = pevt->endSubEvt(); - - // for (; it != end; ++it) { - // const PileUpEventInfo::SubEvent &sube = *it; - // const EventInfo *sevt = sube.pSubEvt; - // if (sevt) { - // ATH_MSG_DEBUG("PileUp SubEvent Info:" - // << " Time=" << sube.time() - // << " Index=" << sube.index() - // << " UserType=" << sevt->event_type()->user_type() ); - - // if (sube.time() == 0) { - // nevent_intime++; - - // if (sube.type() == 0) ++nsignal_intime; - // else if(sube.type() == 1) ++nminbias_intime; - // else if(sube.type() == 2) ++ncavern_intime; - // else if(sube.type() == 3) ++nbeamgas_intime; - // } - - // ++nevent; - - // if ( sube.type()==1 ) ++nminbias; // MIN BIAS - // else if ( sube.type()==2 ) ++ncavern; // CAVERN BACKGROUND - // else if ( sube.type()==3 ) ++nbeamgas; // BEAM GAS / HALO - // else if ( sube.type()==4 ) ++nzerobias; // ZERO BIAS - // } - // else { - // ATH_MSG_DEBUG("Subevent is null ptr " ); - // } - // } - // } - // else { - // ATH_MSG_DEBUG("Failed to get PileUpEventInfo with key=" << m_keyPileUp ); - // return false; - // } - - // log() << MSG::DEBUG - // << "Number of minbias events = " << nminbias << endmsg - // << "Number of cavern events = " << ncavern << endmsg - // << "Number of intime events = " << nevent_intime << endmsg - // << "Number of intime signal = " << nsignal_intime << endmsg - // << "Number of intime minbias = " << nminbias_intime << endmsg - // << "Number of intime cavern = " << ncavern_intime << endmsg - // << "Number of intime beamgas = " << nbeamgas_intime ); - - // // Add event counts for all pileup events - // event.addVar(210, static_cast<float>(nevent)); // N of all pileup events - // event.addVar(211, static_cast<float>(nminbias)); // N of all minbias events - // event.addVar(212, static_cast<float>(ncavern)); // N of all cavern events - // event.addVar(213, static_cast<float>(nbeamgas)); // N of all beamgas events - // event.addVar(214, static_cast<float>(nzerobias)); // N of all zero bias events - - // // Add event counts for intime (BC=0) pileup events - // event.addVar(215, static_cast<float>(nevent_intime)); // N of all intime events - // event.addVar(216, static_cast<float>(nsignal_intime)); // N of intime signal events - // event.addVar(217, static_cast<float>(nminbias_intime)); // N of intime minbias events - // event.addVar(218, static_cast<float>(ncavern_intime)); // N of intime cavern events - // event.addVar(219, static_cast<float>(nbeamgas_intime)); // N of intime beamgas events return true; }