#include <StoreSecondary.h>
Public Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
StoreSecondary (const edm::ParameterSet &p) | |
virtual | ~StoreSecondary () |
Private Member Functions | |
const StoreSecondary & | operator= (const StoreSecondary &) |
StoreSecondary (const StoreSecondary &) | |
void | update (const BeginOfTrack *trk) |
This routine will be called when the appropriate signal arrives. | |
void | update (const BeginOfEvent *evt) |
This routine will be called when the appropriate signal arrives. | |
void | update (const G4Step *step) |
This routine will be called when the appropriate signal arrives. | |
Private Attributes | |
int | killAfter |
int | nHad |
std::vector< int > | nsecs |
std::vector< std::string > | procs |
std::vector < math::XYZTLorentzVector > | secondaries |
bool | storeIt |
TreatSecondary * | treatSecondary |
int | verbosity |
Definition at line 19 of file StoreSecondary.h.
StoreSecondary::StoreSecondary | ( | const edm::ParameterSet & | p | ) |
Definition at line 22 of file StoreSecondary.cc.
References edm::ParameterSet::getParameter(), and treatSecondary.
{ edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("StoreSecondary"); treatSecondary = new TreatSecondary (m_p); produces<std::vector<math::XYZTLorentzVector> >("SecondaryMomenta"); produces<std::vector<int> >("SecondaryParticles"); // produces<std::vector<std::string> >("SecondaryProcesses"); edm::LogInfo("CheckSecondary") << "Instantiate StoreSecondary to store " << "secondaries after 1st hadronic inelastic" << " interaction"; }
StoreSecondary::~StoreSecondary | ( | ) | [virtual] |
Definition at line 36 of file StoreSecondary.cc.
References treatSecondary.
{ delete treatSecondary; }
StoreSecondary::StoreSecondary | ( | const StoreSecondary & | ) | [private] |
const StoreSecondary& StoreSecondary::operator= | ( | const StoreSecondary & | ) | [private] |
void StoreSecondary::produce | ( | edm::Event & | e, |
const edm::EventSetup & | |||
) | [virtual] |
Implements SimProducer.
Definition at line 40 of file StoreSecondary.cc.
References i, edm::EventBase::id(), LogDebug, nsecs, procs, edm::Event::put(), and secondaries.
{ std::auto_ptr<std::vector<math::XYZTLorentzVector> > secMom(new std::vector<math::XYZTLorentzVector>); *secMom = secondaries; e.put(secMom, "SecondaryMomenta"); std::auto_ptr<std::vector<int> > secNumber(new std::vector<int>); *secNumber = nsecs; e.put(secNumber, "SecondaryParticles"); /* std::auto_ptr<std::vector<std::string> > secProc(new std::vector<std::string>); *secProc = procs; e.put(secProc, "SecondaryProcesses"); */ LogDebug("CheckSecondary") << "StoreSecondary:: Event " << e.id() << " with " << nsecs.size() << " hadronic collisions with " << "secondaries produced in each step"; for (unsigned int i= 0; i < nsecs.size(); i++) LogDebug("CheckSecondary") << " " << nsecs[i] << " from " << procs[i]; LogDebug("CheckSecondary") << " and " << secondaries.size() << " secondaries" << " produced in the first interactions:"; for (unsigned int i= 0; i < secondaries.size(); i++) LogDebug("CheckSecondary") << "Secondary " << i << " " << secondaries[i]; }
void StoreSecondary::update | ( | const BeginOfTrack * | ) | [private, virtual] |
This routine will be called when the appropriate signal arrives.
Implements Observer< const BeginOfTrack * >.
Definition at line 74 of file StoreSecondary.cc.
References TreatSecondary::initTrack(), nHad, nsecs, storeIt, and treatSecondary.
void StoreSecondary::update | ( | const BeginOfEvent * | ) | [private, virtual] |
This routine will be called when the appropriate signal arrives.
Implements Observer< const BeginOfEvent * >.
Definition at line 67 of file StoreSecondary.cc.
References nsecs, procs, and secondaries.
{ nsecs.clear(); procs.clear(); secondaries.clear(); }
void StoreSecondary::update | ( | const G4Step * | ) | [private, virtual] |
This routine will be called when the appropriate signal arrives.
Implements Observer< const G4Step * >.
Definition at line 83 of file StoreSecondary.cc.
References DeDxDiscriminatorTools::charge(), i, mergeVDriftHistosByStation::name, nHad, nsecs, procs, secondaries, storeIt, TreatSecondary::tracks(), testEve_cfg::tracks, and treatSecondary.
{ std::string name; int procID; bool hadrInt; double deltaE; std::vector<int> charge; std::vector<math::XYZTLorentzVector> tracks = treatSecondary->tracks(aStep, name, procID, hadrInt, deltaE, charge); if (hadrInt) { nHad++; if (storeIt) { int sec = (int)(tracks.size()); nsecs.push_back(sec); procs.push_back(name); if (nHad == 1) { for (int i=0; i<sec; i++) secondaries.push_back(tracks[i]); } } } }
int StoreSecondary::killAfter [private] |
Definition at line 40 of file StoreSecondary.h.
int StoreSecondary::nHad [private] |
Definition at line 41 of file StoreSecondary.h.
Referenced by update().
std::vector<int> StoreSecondary::nsecs [private] |
Definition at line 44 of file StoreSecondary.h.
std::vector<std::string> StoreSecondary::procs [private] |
Definition at line 45 of file StoreSecondary.h.
std::vector<math::XYZTLorentzVector> StoreSecondary::secondaries [private] |
Definition at line 43 of file StoreSecondary.h.
bool StoreSecondary::storeIt [private] |
Definition at line 42 of file StoreSecondary.h.
Referenced by update().
TreatSecondary* StoreSecondary::treatSecondary [private] |
Definition at line 46 of file StoreSecondary.h.
Referenced by StoreSecondary(), update(), and ~StoreSecondary().
int StoreSecondary::verbosity [private] |
Definition at line 40 of file StoreSecondary.h.