CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
PFSimParticleProducer Class Reference

Producer for PFRecTracks and PFSimParticles. More...

#include <PFSimParticleProducer.h>

Inheritance diagram for PFSimParticleProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef edm::Handle< reco::PFRecTrackCollectionTrackHandle
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void getSimIDs (const TrackHandle &trackh, std::vector< unsigned > &recTrackSimID)
 
 PFSimParticleProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFSimParticleProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::InputTag inputTagEcalRecHitsEB_
 
edm::InputTag inputTagEcalRecHitsEE_
 
edm::InputTag inputTagFastSimProducer_
 
edm::InputTag inputTagRecTracks_
 
edm::InputTag inputTagSim_
 module label for retrieving input simtrack and simvertex More...
 
bool mctruthMatchingInfo_
 
FSimEventmySimEvent
 
edm::ParameterSet particleFilter_
 
bool processParticles_
 process particles on/off More...
 
edm::EDGetTokenT< EcalRecHitCollectiontokenEcalRecHitsEB_
 
edm::EDGetTokenT< EcalRecHitCollectiontokenEcalRecHitsEE_
 
edm::EDGetTokenT< edm::PCaloHitContainertokenFastSimProducer_
 
edm::EDGetTokenT< reco::PFRecTrackCollectiontokenRecTracks_
 
edm::EDGetTokenT< std::vector< SimTrack > > tokenSim_
 
edm::EDGetTokenT< std::vector< SimVertex > > tokenSimVertices_
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Producer for PFRecTracks and PFSimParticles.

Author
Colin Bernet
Date
April 2007

Definition at line 44 of file PFSimParticleProducer.h.

Member Typedef Documentation

Definition at line 53 of file PFSimParticleProducer.h.

Constructor & Destructor Documentation

PFSimParticleProducer::PFSimParticleProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 66 of file PFSimParticleProducer.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

67 {
68 
69 
71  iConfig.getUntrackedParameter<bool>("process_Particles",true);
72 
73 
74  inputTagSim_ = iConfig.getParameter<InputTag>("sim");
75  tokenSim_ = consumes<std::vector<SimTrack> >(inputTagSim_);
76  tokenSimVertices_ = consumes<std::vector<SimVertex> >(inputTagSim_);
77 
78  //retrieving collections for MC Truth Matching
79 
80  //modif-beg
81  inputTagFastSimProducer_ = iConfig.getUntrackedParameter<InputTag>("fastSimProducer");
82  tokenFastSimProducer_ = consumes<edm::PCaloHitContainer>(inputTagFastSimProducer_);
84  iConfig.getUntrackedParameter<bool>("MCTruthMatchingInfo",false);
85  //modif-end
86 
87  inputTagRecTracks_ = iConfig.getParameter<InputTag>("RecTracks");
88  tokenRecTracks_ = consumes<reco::PFRecTrackCollection>(inputTagRecTracks_);
89 
90  inputTagEcalRecHitsEB_ = iConfig.getParameter<InputTag>("ecalRecHitsEB");
91  tokenEcalRecHitsEB_ = consumes<EcalRecHitCollection>(inputTagEcalRecHitsEB_);
92  inputTagEcalRecHitsEE_ = iConfig.getParameter<InputTag>("ecalRecHitsEE");
94  = consumes<EcalRecHitCollection>(inputTagEcalRecHitsEE_);
95 
96  verbose_ =
97  iConfig.getUntrackedParameter<bool>("verbose",false);
98 
99 
100  // register products
101  produces<reco::PFSimParticleCollection>();
102 
104  ( "ParticleFilter" );
105 
106  mySimEvent = new FSimEvent( particleFilter_ );
107 }
bool processParticles_
process particles on/off
edm::InputTag inputTagEcalRecHitsEE_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< EcalRecHitCollection > tokenEcalRecHitsEE_
edm::ParameterSet particleFilter_
edm::InputTag inputTagEcalRecHitsEB_
edm::EDGetTokenT< reco::PFRecTrackCollection > tokenRecTracks_
edm::InputTag inputTagSim_
module label for retrieving input simtrack and simvertex
edm::EDGetTokenT< std::vector< SimTrack > > tokenSim_
edm::EDGetTokenT< edm::PCaloHitContainer > tokenFastSimProducer_
edm::EDGetTokenT< EcalRecHitCollection > tokenEcalRecHitsEB_
edm::EDGetTokenT< std::vector< SimVertex > > tokenSimVertices_
edm::InputTag inputTagFastSimProducer_
PFSimParticleProducer::~PFSimParticleProducer ( )
override

Definition at line 111 of file PFSimParticleProducer.cc.

112 {
113  delete mySimEvent;
114 }

Member Function Documentation

void PFSimParticleProducer::getSimIDs ( const TrackHandle trackh,
std::vector< unsigned > &  recTrackSimID 
)

Definition at line 485 of file PFSimParticleProducer.cc.

References mps_fire::i, edm::HandleBase::isValid(), FastTrackerRecHit::nSimTrackIds(), FastTrackerRecHit::simTrackId(), and reco::PFRecTrack::trackRef().

487 {
488 
489  if( trackh.isValid() ) {
490 
491  for(unsigned i=0;i<trackh->size(); i++) {
492 
493  reco::PFRecTrackRef ref( trackh,i );
494  const reco::PFRecTrack& PFT = *ref;
495  const reco::TrackRef& trackref = PFT.trackRef();
496 
497  trackingRecHit_iterator rhitbeg
498  = trackref->recHitsBegin();
499  trackingRecHit_iterator rhitend
500  = trackref->recHitsEnd();
501  for (trackingRecHit_iterator it = rhitbeg;
502  it != rhitend; it++){
503 
504  if( (*it)->isValid() ){
505 
506  const FastTrackerRecHit * rechit
507  = (const FastTrackerRecHit*) (*it);
508 
509  for(unsigned int st_index=0;st_index<rechit->nSimTrackIds();++st_index){
510  recTrackSimID.push_back(rechit->simTrackId(st_index));
511  }
512  break;
513  }
514  }//loop track rechit
515  }//loop recTracks
516  }//track handle valid
517 }
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
const reco::TrackRef & trackRef() const
Definition: PFRecTrack.h:54
virtual int32_t simTrackId(size_t i) const
virtual size_t nSimTrackIds() const
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
void PFSimParticleProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 116 of file PFSimParticleProducer.cc.

References reco::PFTrajectoryPoint::BeamPipeOrEndVertex, edm::SortedCollection< T, SORT >::begin(), FSimTrack::charge(), reco::PFTrajectoryPoint::ClosestApproach, FSimTrack::daughters(), reco::PFTrajectoryPoint::ECALEntrance, FSimTrack::ecalEntrance(), edm::SortedCollection< T, SORT >::end(), FSimTrack::endVertex(), edm::EventID::event(), Exception, runEdmFileComparison::found, edm::Event::getByToken(), edm::EventSetup::getData(), ecalpyutils::hashedIndex(), reco::PFTrajectoryPoint::HCALEntrance, FSimTrack::hcalEntrance(), reco::PFTrajectoryPoint::HCALExit, FSimTrack::hcalExit(), FSimTrack::hoEntrance(), reco::PFTrajectoryPoint::HOLayer, mps_fire::i, edm::EventBase::id(), FSimTrack::id(), edm::HandleBase::isValid(), FSimTrack::layer1Entrance(), FSimTrack::layer2Entrance(), LogDebug, FSimTrack::momentum(), FSimTrack::mother(), objects.autophobj::motherId, eostools::move(), FSimTrack::noEndVertex(), FSimTrack::noMother(), FSimTrack::onEcal(), FSimTrack::onHcal(), FSimTrack::onLayer1(), FSimTrack::onLayer2(), FSimVertex::position(), edm::Handle< T >::product(), reco::PFTrajectoryPoint::PS1, reco::PFTrajectoryPoint::PS2, edm::Event::put(), hiRegitInitialStep_cff::recTracks, edm::EventID::run(), tkConvValidator_cfi::simTracks, CoreSimTrack::type(), FSimTrack::vertex(), RawParticle::x(), RawParticle::y(), and RawParticle::z().

118 {
119  // init Particle data table (from Pythia)
121  // edm::ESHandle < DefaultConfig::ParticleDataTable > pdt;
122  iSetup.getData(pdt);
123  mySimEvent->initializePdt(&(*pdt));
124 
126  LogDebug("PFSimParticleProducer")<<"START event: "<<iEvent.id().event()
127  <<" in run "<<iEvent.id().run()<<endl;
128 
129  //MC Truth Matching only with Famos and UnFoldedMode option to true!!
130 
131  //vector to store the trackIDs of rectracks corresponding
132  //to the simulated particle.
133  std::vector<unsigned> recTrackSimID;
134 
135  //In order to know which simparticule contribute to
136  //a given Ecal RecHit energy, we need to access
137  //the PCAloHit from FastSim.
138 
139  typedef std::pair<double, unsigned> hitSimID;
140  typedef std::list< std::pair<double, unsigned> >::iterator ITM;
141  std::vector< std::list <hitSimID> > caloHitsEBID(62000);
142  std::vector<double> caloHitsEBTotE(62000,0.0);
143 
145 
146  //getting the PCAloHit
148  // bool found_phit
149  // = iEvent.getByLabel("fastSimProducer","EcalHitsEB",
150  // pcalohits);
151  //modif-beg
152  bool found_phit
153  = iEvent.getByToken(tokenFastSimProducer_,pcalohits);
154  //modif-end
155 
156  if(!found_phit) {
157  ostringstream err;
158  err<<"could not find pcaloHit "<<"fastSimProducer:EcalHitsEB";
159  LogError("PFSimParticleProducer")<<err.str()<<endl;
160 
161  throw cms::Exception( "MissingProduct", err.str());
162  }
163  else {
164  assert( pcalohits.isValid() );
165 
166  edm::PCaloHitContainer::const_iterator it
167  = pcalohits.product()->begin();
168  edm::PCaloHitContainer::const_iterator itend
169  = pcalohits.product()->end();
170 
171  //loop on the PCaloHit from FastSim Calorimetry
172  for(;it!=itend;++it)
173  {
174  EBDetId detid(it->id());
175 
176  if(it->energy() > 0.0) {
177  std::pair<double, unsigned> phitsimid
178  = make_pair(it->energy(),it->geantTrackId());
179  caloHitsEBID[detid.hashedIndex()].push_back(phitsimid);
180  caloHitsEBTotE[detid.hashedIndex()]
181  += it->energy(); //summing pcalhit energy
182  }//energy > 0
183 
184  }//loop PcaloHits
185  }//pcalohit handle access
186 
187  //Retrieving the PFRecTrack collection for
188  //Monte Carlo Truth Matching tool
190  try{
191  LogDebug("PFSimParticleProducer")<<"getting PFRecTracks"<<endl;
192  iEvent.getByToken(tokenRecTracks_, recTracks);
193 
194  } catch (cms::Exception& err) {
195  LogError("PFSimParticleProducer")<<err
196  <<" cannot get collection "
197  <<"particleFlowBlock"<<":"
198  <<""
199  <<endl;
200  }//pfrectrack handle access
201 
202  //getting the simID corresponding to
203  //each of the PFRecTracks
204  getSimIDs( recTracks, recTrackSimID );
205 
206  }//mctruthMatchingInfo_ //modif
207 
208  // deal with true particles
209  if( processParticles_) {
210 
211  auto pOutputPFSimParticleCollection = std::make_unique<reco::PFSimParticleCollection>();
212 
214  bool found = iEvent.getByToken(tokenSim_,simTracks);
215  if(!found) {
216 
217  ostringstream err;
218  err<<"cannot find sim tracks: "<<inputTagSim_;
219  LogError("PFSimParticleProducer")<<err.str()<<endl;
220 
221  throw cms::Exception( "MissingProduct", err.str());
222  }
223 
224 
225 
226  Handle<vector<SimVertex> > simVertices;
227  found = iEvent.getByToken(tokenSimVertices_,simVertices);
228  if(!found) {
229  LogError("PFSimParticleProducer")
230  <<"cannot find sim vertices: "<<inputTagSim_<<endl;
231  return;
232  }
233 
234  mySimEvent->fill( *simTracks, *simVertices );
235 
236  if(verbose_)
237  mySimEvent->print();
238 
239  for(unsigned i=0; i<mySimEvent->nTracks(); i++) {
240 
241  const FSimTrack& fst = mySimEvent->track(i);
242 
243  int motherId = -1;
244  if( ! fst.noMother() ) // a mother exist
245  motherId = fst.mother().id();
246 
247  //This is finding out the simID corresponding
248  //to the recTrack
249 
250  //GETTING THE TRACK ID
251  unsigned recTrackID = 99999;
252  vector<unsigned> recHitContrib; //modif
253  vector<double> recHitContribFrac; //modif
254 
255  if(mctruthMatchingInfo_){ //modif
256 
257  for(unsigned lo=0; lo<recTrackSimID.size();
258  lo++) {
259  if( i == recTrackSimID[lo] ) {
260 
261  recTrackID = lo;
262  }//match track
263  }//loop rectrack
264 
265  // get the ecalBarrel rechits for MC truth matching tool
267  bool found = iEvent.getByToken(tokenEcalRecHitsEB_,
268  rhcHandle);
269  if(!found) {
270  ostringstream err;
271  err<<"could not find rechits "<< inputTagEcalRecHitsEB_;
272  LogError("PFSimParticleProducer")<<err.str()<<endl;
273 
274  throw cms::Exception( "MissingProduct", err.str());
275  }
276  else {
277  assert( rhcHandle.isValid() );
278 
280  = rhcHandle.product()->begin();
282  = rhcHandle.product()->end();
283 
284  for(;it_rh!=itend_rh;++it_rh)
285  {
286  unsigned rhit_hi
287  = EBDetId(it_rh->id()).hashedIndex();
288  EBDetId detid(it_rh->id());
289 
290  ITM it_phit = caloHitsEBID[rhit_hi].begin();
291  ITM itend_phit = caloHitsEBID[rhit_hi].end();
292  for(;it_phit!=itend_phit;++it_phit)
293  {
294  if(i == it_phit->second)
295  {
296  //Alex (08/10/08) TO BE REMOVED, eliminating
297  //duplicated rechits
298  bool alreadyin = false;
299  for( unsigned ihit = 0; ihit < recHitContrib.size();
300  ++ihit )
301  if(detid.rawId() == recHitContrib[ihit])
302  alreadyin = true;
303 
304  if(!alreadyin){
305  double pcalofraction = 0.0;
306  if(caloHitsEBTotE[rhit_hi] != 0.0)
307  pcalofraction
308  = (it_phit->first/caloHitsEBTotE[rhit_hi])*100.0;
309 
310  //store info
311  recHitContrib.push_back(it_rh->id());
312  recHitContribFrac.push_back(pcalofraction);
313  }//selected rechits
314  }//matching
315  }//loop pcalohit
316 
317  }//loop rechits
318 
319  }//getting the rechits
320 
321  }//mctruthMatchingInfo_ //modif
322 
323  reco::PFSimParticle particle( fst.charge(),
324  fst.type(),
325  fst.id(),
326  motherId,
327  fst.daughters(),
328  recTrackID,
329  recHitContrib,
330  recHitContribFrac);
331 
332 
333  const FSimVertex& originVtx = fst.vertex();
334 
335  math::XYZPoint posOrig( originVtx.position().x(),
336  originVtx.position().y(),
337  originVtx.position().z() );
338 
339  math::XYZTLorentzVector momOrig( fst.momentum().px(),
340  fst.momentum().py(),
341  fst.momentum().pz(),
342  fst.momentum().e() );
344  pointOrig(-1,
346  posOrig, momOrig);
347 
348  // point 0 is origin vertex
349  particle.addPoint(pointOrig);
350 
351 
352  if( ! fst.noEndVertex() ) {
353  const FSimVertex& endVtx = fst.endVertex();
354 
355  math::XYZPoint posEnd( endVtx.position().x(),
356  endVtx.position().y(),
357  endVtx.position().z() );
358 
360 
362  pointEnd( -1,
364  posEnd, momEnd);
365 
366  particle.addPoint(pointEnd);
367  }
368  else { // add a dummy point
370  particle.addPoint(dummy);
371  }
372 
373 
374  if( fst.onLayer1() ) { // PS layer1
375  const RawParticle& rp = fst.layer1Entrance();
376 
377  math::XYZPoint posLayer1( rp.x(), rp.y(), rp.z() );
378  math::XYZTLorentzVector momLayer1( rp.px(), rp.py(), rp.pz(), rp.e() );
380  posLayer1, momLayer1);
381 
382  particle.addPoint( layer1Pt );
383 
384  // extrapolate to cluster depth
385  }
386  else { // add a dummy point
388  particle.addPoint(dummy);
389  }
390 
391  if( fst.onLayer2() ) { // PS layer2
392  const RawParticle& rp = fst.layer2Entrance();
393 
394  math::XYZPoint posLayer2( rp.x(), rp.y(), rp.z() );
395  math::XYZTLorentzVector momLayer2( rp.px(), rp.py(), rp.pz(), rp.e() );
397  posLayer2, momLayer2);
398 
399  particle.addPoint( layer2Pt );
400 
401  // extrapolate to cluster depth
402  }
403  else { // add a dummy point
405  particle.addPoint(dummy);
406  }
407 
408  if( fst.onEcal() ) {
409  const RawParticle& rp = fst.ecalEntrance();
410 
411  math::XYZPoint posECAL( rp.x(), rp.y(), rp.z() );
412  math::XYZTLorentzVector momECAL( rp.px(), rp.py(), rp.pz(), rp.e() );
413  reco::PFTrajectoryPoint ecalPt(-1,
415  posECAL, momECAL);
416 
417  particle.addPoint( ecalPt );
418 
419  // extrapolate to cluster depth
420  }
421  else { // add a dummy point
423  particle.addPoint(dummy);
424  }
425 
426  // add a dummy point for ECAL Shower max
428  particle.addPoint(dummy);
429 
430  if( fst.onHcal() ) {
431 
432  const RawParticle& rpin = fst.hcalEntrance();
433 
434  math::XYZPoint posHCALin( rpin.x(), rpin.y(), rpin.z() );
435  math::XYZTLorentzVector momHCALin( rpin.px(), rpin.py(), rpin.pz(),
436  rpin.e() );
437  reco::PFTrajectoryPoint hcalPtin(-1,
439  posHCALin, momHCALin);
440 
441  particle.addPoint( hcalPtin );
442 
443  const RawParticle& rpout = fst.hcalExit();
444 
445  math::XYZPoint posHCALout( rpout.x(), rpout.y(), rpout.z() );
446  math::XYZTLorentzVector momHCALout( rpout.px(), rpout.py(), rpout.pz(),
447  rpout.e() );
449  hcalPtout(-1, reco::PFTrajectoryPoint::HCALExit,
450  posHCALout, momHCALout);
451 
452  particle.addPoint( hcalPtout );
453 
454  const RawParticle& rpho = fst.hoEntrance();
455 
456  math::XYZPoint posHOEntrance( rpho.x(), rpho.y(), rpho.z() );
457  math::XYZTLorentzVector momHOEntrance( rpho.px(), rpho.py(), rpho.pz(),
458  rpho.e() );
461  posHOEntrance, momHOEntrance);
462 
463  particle.addPoint( hoPtin );
464 
465 
466 
467 
468  }
469  else { // add a dummy point
471  particle.addPoint(dummy);
472  }
473 
474  pOutputPFSimParticleCollection->push_back( particle );
475  }
476 
477  iEvent.put(std::move(pOutputPFSimParticleCollection));
478  }
479 
480 
481  LogDebug("PFSimParticleProducer")<<"STOP event: "<<iEvent.id().event()
482  <<" in run "<<iEvent.id().run()<<endl;
483 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
bool processParticles_
process particles on/off
EventNumber_t event() const
Definition: EventID.h:41
bool noEndVertex() const
no end vertex
float charge() const
charge
Definition: FSimTrack.h:51
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
const RawParticle & hoEntrance() const
The particle at HCAL exir.
Definition: FSimTrack.h:150
int onLayer2() const
Definition: FSimTrack.h:101
const FSimVertex & endVertex() const
end vertex
const RawParticle & hcalExit() const
The particle at HCAL exir.
Definition: FSimTrack.h:147
double y() const
y of vertex
Definition: RawParticle.h:271
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
double z() const
z of vertex
Definition: RawParticle.h:272
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
Definition: FSimTrack.h:204
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:14
const HepPDT::ParticleDataTable * theTable() const
Get the pointer to the particle data table.
Definition: FBaseSimEvent.h:57
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
Definition: FSimTrack.h:132
std::vector< EcalRecHit >::const_iterator const_iterator
edm::InputTag inputTagEcalRecHitsEB_
const std::vector< int > & daughters() const
Vector of daughter indices.
double x() const
x of vertex
Definition: RawParticle.h:270
edm::EDGetTokenT< reco::PFRecTrackCollection > tokenRecTracks_
void getData(T &iHolder) const
Definition: EventSetup.h:78
int onEcal() const
Definition: FSimTrack.h:106
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
edm::InputTag inputTagSim_
module label for retrieving input simtrack and simvertex
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
const math::XYZTLorentzVector & position() const
Temporary (until CMSSW moves to Mathcore) - No ! Actually very useful.
Definition: FSimVertex.h:49
edm::EDGetTokenT< std::vector< SimTrack > > tokenSim_
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
Definition: FSimTrack.h:138
bool isValid() const
Definition: HandleBase.h:74
true particle for particle flow
Definition: PFSimParticle.h:19
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:36
edm::EDGetTokenT< edm::PCaloHitContainer > tokenFastSimProducer_
const_iterator end() const
T const * product() const
Definition: Handle.h:81
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::EDGetTokenT< EcalRecHitCollection > tokenEcalRecHitsEB_
edm::EventID id() const
Definition: EventBase.h:60
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:25
void initializePdt(const HepPDT::ParticleDataTable *aPdt)
Initialize the particle data table.
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:91
const RawParticle & layer2Entrance() const
The particle at Preshower Layer 2.
Definition: FSimTrack.h:135
int onLayer1() const
Definition: FSimTrack.h:96
int onHcal() const
Definition: FSimTrack.h:111
bool noMother() const
no mother particle
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:141
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
const FSimVertex vertex() const
Origin vertex.
void getSimIDs(const TrackHandle &trackh, std::vector< unsigned > &recTrackSimID)
const FSimTrack & mother() const
mother
def move(src, dest)
Definition: eostools.py:510
const_iterator begin() const
edm::EDGetTokenT< std::vector< SimVertex > > tokenSimVertices_
void print() const
print the FBaseSimEvent in an intelligible way
FSimTrack & track(int id) const
Return track with given Id.

Member Data Documentation

edm::InputTag PFSimParticleProducer::inputTagEcalRecHitsEB_
private

Definition at line 74 of file PFSimParticleProducer.h.

edm::InputTag PFSimParticleProducer::inputTagEcalRecHitsEE_
private

Definition at line 76 of file PFSimParticleProducer.h.

edm::InputTag PFSimParticleProducer::inputTagFastSimProducer_
private

Definition at line 68 of file PFSimParticleProducer.h.

edm::InputTag PFSimParticleProducer::inputTagRecTracks_
private

Definition at line 72 of file PFSimParticleProducer.h.

edm::InputTag PFSimParticleProducer::inputTagSim_
private

module label for retrieving input simtrack and simvertex

Definition at line 61 of file PFSimParticleProducer.h.

bool PFSimParticleProducer::mctruthMatchingInfo_
private

Definition at line 67 of file PFSimParticleProducer.h.

FSimEvent* PFSimParticleProducer::mySimEvent
private

Definition at line 82 of file PFSimParticleProducer.h.

edm::ParameterSet PFSimParticleProducer::particleFilter_
private

Definition at line 81 of file PFSimParticleProducer.h.

bool PFSimParticleProducer::processParticles_
private

process particles on/off

Definition at line 87 of file PFSimParticleProducer.h.

edm::EDGetTokenT<EcalRecHitCollection> PFSimParticleProducer::tokenEcalRecHitsEB_
private

Definition at line 75 of file PFSimParticleProducer.h.

edm::EDGetTokenT<EcalRecHitCollection> PFSimParticleProducer::tokenEcalRecHitsEE_
private

Definition at line 77 of file PFSimParticleProducer.h.

edm::EDGetTokenT<edm::PCaloHitContainer> PFSimParticleProducer::tokenFastSimProducer_
private

Definition at line 69 of file PFSimParticleProducer.h.

edm::EDGetTokenT<reco::PFRecTrackCollection> PFSimParticleProducer::tokenRecTracks_
private

Definition at line 73 of file PFSimParticleProducer.h.

edm::EDGetTokenT<std::vector<SimTrack> > PFSimParticleProducer::tokenSim_
private

Definition at line 62 of file PFSimParticleProducer.h.

edm::EDGetTokenT<std::vector<SimVertex> > PFSimParticleProducer::tokenSimVertices_
private

Definition at line 63 of file PFSimParticleProducer.h.

bool PFSimParticleProducer::verbose_
private

verbose ?

Definition at line 90 of file PFSimParticleProducer.h.