6 #include "HepPDT/ParticleID.hh"
10 #define update(a, b) do { (a) = (a) | (b); } while(0)
13 hepMCLabel_( config.getUntrackedParameter<edm::InputTag>(
"hepMC") ),
14 beamSpotLabel_( config.getUntrackedParameter<edm::InputTag>(
"beamSpot") ),
162 const SimTrack * assocTrack = &(*tpr->g4Track_begin());
181 TSCPBuilderNoMaterial tscpBuilder;
192 double dxySim = -v.
x()*
sin(p.phi()) + v.
y()*
cos(p.phi());
195 double dzSim = v.
z() - (v.
x()*p.x() + v.
y()*p.y())*p.z()/p.perp2();
239 for (
unsigned int i = 0;
i < maxLayers;
i++)
244 for (
unsigned int j = 0;
j < layer.
hits.size();
j++)
270 flags_[
Light] = !
pid.hasCharm() && !
pid.hasBottom();
284 for (TrackHistory::GenParticleTrail::const_iterator iparticle = genParticleTrail.begin(); iparticle != genParticleTrail.end(); ++iparticle)
287 HepMC::GenVertex * productionVertex = (*iparticle)->production_vertex();
293 if (productionVertex)
296 if ( productionVertex->particles_in_size() == 1 )
299 pdgid =
std::abs((*productionVertex->particles_in_const_begin())->pdg_id());
304 if (particleID.isValid())
318 int daughterId =
abs((*iparticle)->pdg_id());
349 TrackHistory::SimParticleTrail::const_iterator iparticle = simParticleTrail.begin();
350 iparticle != simParticleTrail.end();
367 for (its = parentVertex->sourceTracks_begin(); its != parentVertex->sourceTracks_end(); ++its)
369 for (itd = parentVertex->daughterTracks_begin(); itd != parentVertex->daughterTracks_end(); ++itd)
380 if ( its != parentVertex->sourceTracks_end() )
387 if ((*iparticle)->numberOfHits())
continue;
390 #warning "This file has been modified just to get it to compile without any regard as to whether it still functions as intended"
391 #ifdef REMOVED_JUST_TO_GET_IT_TO_COMPILE__THIS_CODE_NEEDS_TO_BE_CHECKED
392 unsigned short process = (*iparticle)->pSimHit_begin()->processType();
394 unsigned short process = 0;
427 if (particleID.isValid())
446 int daughtId =
abs((*iparticle)->pdgId());
483 double const mm = 0.1;
485 double oldX = genpv.
x;
486 double oldY = genpv.
y;
487 double oldZ = genpv.
z;
491 TrackHistory::GenParticleTrail::reverse_iterator iparticle = genParticleTrail.rbegin();
492 iparticle != genParticleTrail.rend();
497 HepMC::GenVertex *
parent = (*iparticle)->production_vertex();
500 HepMC::ThreeVector
p = parent->point3d();
502 double distance2 =
pow(p.x() * mm - genpv.
x, 2) +
pow(p.y() * mm - genpv.
y, 2) +
pow(p.z() * mm - genpv.
z, 2);
503 double difference2 =
pow(p.x() * mm - oldX, 2) +
pow(p.y() * mm - oldY, 2) +
pow(p.z() * mm - oldZ, 2);
522 TrackHistory::SimParticleTrail::reverse_iterator iparticle = simParticleTrail.rbegin();
523 iparticle != simParticleTrail.rend();
530 double distance2 =
pow(p.x() - genpv.
x, 2) +
pow(p.y() - genpv.
y, 2) +
pow(p.z() - genpv.
z, 2);
531 double difference2 =
pow(p.x() - oldX, 2) +
pow(p.y() - oldY, 2) +
pow(p.z() - oldZ, 2);
547 else if ( counter == 1 )
556 return !p->end_vertex() && p->status() == 1;
564 return part->charge()!=0;
584 for ( HepMC::GenEvent::vertex_const_iterator ivertex =
event->vertices_begin(); ivertex !=
event->vertices_end(); ++ivertex )
586 bool hasParentVertex =
false;
590 HepMC::GenVertex::particle_iterator iparent = (*ivertex)->particles_begin(
HepMC::parents);
594 if ( (*iparent)->production_vertex() )
596 hasParentVertex =
true;
601 if (hasParentVertex)
continue;
604 HepMC::FourVector
pos = (*ivertex)->position();
606 double const mm = 0.1;
610 std::vector<GeneratedPrimaryVertex>::iterator ientry =
genpvs_.begin();
613 for (; ientry !=
genpvs_.end(); ++ientry)
615 double distance2 =
pow(pv.x - ientry->x, 2) +
pow(pv.y - ientry->y, 2) +
pow(pv.z - ientry->z, 2);
622 ientry =
genpvs_.insert(ientry,pv);
625 ientry->genVertex.push_back((*ivertex)->barcode());
629 HepMC::GenVertex::particle_iterator idecendants = (*ivertex)->particles_begin(HepMC::descendants);
630 idecendants != (*ivertex)->particles_end(HepMC::descendants);
635 if (
find(ientry->finalstateParticles.begin(), ientry->finalstateParticles.end(), (*idecendants)->barcode()) == ientry->finalstateParticles.end() )
637 ientry->finalstateParticles.push_back((*idecendants)->barcode());
638 HepMC::FourVector
m = (*idecendants)->momentum();
640 ientry->ptot.setPx(ientry->ptot.px() + m.px());
641 ientry->ptot.setPy(ientry->ptot.py() + m.py());
642 ientry->ptot.setPz(ientry->ptot.pz() + m.pz());
643 ientry->ptot.setE(ientry->ptot.e() + m.e());
644 ientry->ptsq += m.perp() * m.perp();
646 if ( m.perp() > 0.8 &&
std::abs(m.pseudoRapidity()) < 2.5 &&
isCharged(*idecendants) ) ientry->nGenTrk++;
unsigned int numberOfLayers() const
Return the number of layers with simulated and/or reconstructed hits.
T getUntrackedParameter(std::string const &, T const &) const
const edm::InputTag beamSpotLabel_
const edm::InputTag hepMCLabel_
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
int event() const
get the contents of the subdetector field (should be protected?)
const FreeTrajectoryState & theState() const
double dxyError() const
error on dxy
const TrackingParticleRef & simParticle() const
Return the initial tracking particle from the history.
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
edm::Handle< edm::HepMCProduct > mcInformation_
const TrackerTopology * tTopo_
unsigned int numberOfInnerLayers_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
unsigned int minTrackerSimHits_
std::vector< GeneratedPrimaryVertex > genpvs_
void processesAtSimulation()
Get information about conversion and other interactions.
void getData(T &iHolder) const
std::vector< const HepMC::GenParticle * > GenParticleTrail
GenParticle trail type.
math::XYZPointD Point
point in the space
void simulationInformation()
Get all the information related to the simulation details.
bool isNonnull() const
Checks for non-null.
void qualityInformation(reco::TrackBaseRef const &)
Classify all the tracks by their reconstruction quality.
void reconstructionInformation(reco::TrackBaseRef const &)
Classify all the tracks by their association and reconstruction information.
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
bool isCharged(const HepMC::GenParticle *)
edm::ESHandle< TransientTrackBuilder > transientTrackBuilder_
void evaluate(SimParticleTrail const &, reco::TrackBaseRef const &, const TrackerTopology *tTopo)
Compute information about the track reconstruction quality.
Auxiliary class holding simulated primary vertices.
int bunchCrossing() const
get the detector field from this detid
Cos< T >::type cos(const T &t)
math::XYZPoint Point
point in the space
void hadronFlavor()
Get hadron flavor of the initial hadron.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
const Layer & layer(unsigned int index) const
Return information about the given layer by index.
edm::Handle< reco::BeamSpot > beamSpot_
HepPDT::ParticleData ParticleData
GlobalVector momentum() const
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
GlobalPoint position() const
Get track history and classify it in function of their .
TrackClassifier(edm::ParameterSet const &)
Constructor by ParameterSet.
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
T const * product() const
bool isFinalstateParticle(const HepMC::GenParticle *)
SimParticleTrail const & simParticleTrail() const
Return all the simulated particle in the history.
void vertexInformation()
Get geometrical information about the vertices.
void processesAtGenerator()
Get all the information related to decay process.
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
void depth(int d)
Set the depth of the history.
edm::ESHandle< MagneticField > magneticField_
const math::XYZTLorentzVectorD & momentum() const
particle info...
Flags flags_
Flag containers.
int charge() const
track electric charge
const reco::TrackBaseRef & recoTrack() const
Return a reference to the reconstructed track.
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
double longLivedDecayLength_
void reset()
Reset the categories flags.
double vertexClusteringSqDistance_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
bool isNonnull() const
Checks for non-null.
edm::ESHandle< ParticleDataTable > particleDataTable_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Power< A, B >::type pow(const A &a, const B &b)
void genPrimaryVertices()
GenParticleTrail const & genParticleTrail() const
Return all generated particle in the history.
const HepMC::GenParticle * genParticle() const
Returns a pointer to most primitive status 1 or 2 particle.
Global3DVector GlobalVector
std::vector< TrackingParticleRef > SimParticleTrail
SimParticle trail type.