134 LogDebug(
"PFSimParticleProducer")<<
"START event: "<<iEvent.
id().
event()
135 <<
" in run "<<iEvent.
id().
run()<<endl;
141 std::vector<unsigned> recTrackSimID;
147 typedef std::pair<double, unsigned> hitSimID;
148 typedef std::list< std::pair<double, unsigned> >::iterator
ITM;
149 std::vector< std::list <hitSimID> > caloHitsEBID(62000);
150 std::vector<double> caloHitsEBTotE(62000,0.0);
166 err<<
"could not find pcaloHit "<<
"famosSimHits:EcalHitsEB";
167 LogError(
"PFSimParticleProducer")<<err.str()<<endl;
177 edm::PCaloHitContainer::const_iterator it
178 = pcalohits.
product()->begin();
179 edm::PCaloHitContainer::const_iterator itend
195 if(it->energy() > 0.0) {
196 std::pair<double, unsigned> phitsimid
197 = make_pair(it->energy(),it->geantTrackId());
198 caloHitsEBID[
detid.hashedIndex()].push_back(phitsimid);
199 caloHitsEBTotE[
detid.hashedIndex()]
210 LogDebug(
"PFSimParticleProducer")<<
"getting PFRecTracks"<<endl;
214 LogError(
"PFSimParticleProducer")<<err
215 <<
" cannot get collection "
216 <<
"particleFlowBlock"<<
":"
230 auto_ptr< reco::PFSimParticleCollection >
239 LogError(
"PFSimParticleProducer")<<err.str()<<endl;
247 found = iEvent.
getByLabel(inputTagSim_,simVertices);
250 <<
"cannot find sim vertices: "<<inputTagSim_<<endl;
283 unsigned recTrackID = 99999;
284 vector<unsigned> recHitContrib;
285 vector<double> recHitContribFrac;
289 for(
unsigned lo=0; lo<recTrackSimID.size();
291 if(
i == recTrackSimID[lo] ) {
308 LogError(
"PFSimParticleProducer")<<err.str()<<endl;
318 = rhcHandle.
product()->begin();
322 for(;it_rh!=itend_rh;++it_rh)
331 ITM it_phit = caloHitsEBID[rhit_hi].begin();
332 ITM itend_phit = caloHitsEBID[rhit_hi].end();
333 for(;it_phit!=itend_phit;++it_phit)
335 if(
i == it_phit->second)
339 bool alreadyin =
false;
340 for(
unsigned ihit = 0; ihit < recHitContrib.size();
342 if(
detid.rawId() == recHitContrib[ihit])
346 double pcalofraction = 0.0;
347 if(caloHitsEBTotE[rhit_hi] != 0.0)
349 = (it_phit->first/caloHitsEBTotE[rhit_hi])*100.0;
352 recHitContrib.push_back(it_rh->id());
353 recHitContribFrac.push_back(pcalofraction);
384 originVtx.position().y(),
385 originVtx.position().z() );
397 particle.addPoint(pointOrig);
417 particle.addPoint(pointEnd);
421 particle.addPoint(dummy);
431 posLayer1, momLayer1);
433 particle.addPoint( layer1Pt );
439 particle.addPoint(dummy);
448 posLayer2, momLayer2);
450 particle.addPoint( layer2Pt );
456 particle.addPoint(dummy);
468 particle.addPoint( ecalPt );
474 particle.addPoint(dummy);
479 particle.addPoint(dummy);
490 posHCALin, momHCALin);
492 particle.addPoint( hcalPtin );
501 posHCALout, momHCALout);
503 particle.addPoint( hcalPtout );
512 posHOEntrance, momHOEntrance);
514 particle.addPoint( hoPtin );
522 particle.addPoint(dummy);
525 pOutputPFSimParticleCollection->push_back( particle );
528 iEvent.
put(pOutputPFSimParticleCollection);
533 <<
" in run "<<iEvent.
id().
run()<<endl;
bool processParticles_
process particles on/off
EventNumber_t event() const
bool noEndVertex() const
no end vertex
float charge() const
charge
void fill(const HepMC::GenEvent &hev, edm::EventID &Id, RandomEngineAndDistribution const *)
fill the FBaseSimEvent from the current HepMC::GenEvent
const RawParticle & hoEntrance() const
The particle at HCAL exir.
const FSimVertex & endVertex() const
end vertex
const RawParticle & hcalExit() const
The particle at HCAL exir.
double y() const
y of vertex
double z() const
z of vertex
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
std::vector< EcalRecHit >::const_iterator const_iterator
edm::InputTag inputTagEcalRecHitsEB_
std::vector< PFSimParticle > PFSimParticleCollection
collection of PFSimParticle objects
const std::vector< int > & daughters() const
Vector of daughter indices.
double x() const
x of vertex
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
int hashedIndex(int ieta, int iphi)
edm::InputTag inputTagSim_
module label for retrieving input simtrack and simvertex
edm::InputTag inputTagFamosSimHits_
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const math::XYZTLorentzVector & position() const
Temporary (until CMSSW moves to Mathcore) - No ! Actually very useful.
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
std::list< std::pair< double, unsigned > >::iterator ITM
const FSimVertex & vertex() const
Origin vertex.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool mctruthMatchingInfo_
true particle for particle flow
unsigned int nTracks() const
Number of tracks.
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
int type() const
particle type (HEP PDT convension)
edm::InputTag inputTagRecTracks_
int id() const
the index in FBaseSimEvent and other vectors
const RawParticle & layer2Entrance() const
The particle at Preshower Layer 2.
bool noMother() const
no mother particle
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
void getSimIDs(const TrackHandle &trackh, std::vector< unsigned > &recTrackSimID)
const FSimTrack & mother() const
mother
void print() const
print the FBaseSimEvent in an intelligible way
FSimTrack & track(int id) const
Return track with given Id.