CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TrackerSeedValidator Class Reference

#include <TrackerSeedValidator.h>

Inheritance diagram for TrackerSeedValidator:
edm::EDAnalyzer MultiTrackValidatorBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 Method called once per event. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 Method called to book the DQM histograms. More...
 
void endRun (edm::Run const &, edm::EventSetup const &)
 Method called at the end of the event loop. More...
 
 TrackerSeedValidator (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~TrackerSeedValidator ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string builderName
 
CosmicTrackingParticleSelector cosmictpSelector
 
std::string dirName_
 
MTVHistoProducerAlgohistoProducerAlgo_
 
bool runStandalone
 
edm::ESHandle
< TransientTrackingRecHitBuilder
theTTRHBuilder
 
TrackingParticleSelector tpSelector
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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)
 
- Protected Member Functions inherited from MultiTrackValidatorBase
 MultiTrackValidatorBase (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC, bool isSeed=false)
 Constructor. More...
 
virtual ~MultiTrackValidatorBase ()
 Destructor. More...
 
- Protected Attributes inherited from MultiTrackValidatorBase
std::vector< std::string > associators
 
edm::EDGetTokenT< reco::BeamSpotbsSrc
 
bool ignoremissingtkcollection_
 
std::vector< edm::InputTaglabel
 
edm::EDGetTokenT< std::vector
< PileupSummaryInfo > > 
label_pileupinfo
 
edm::EDGetTokenT
< TrackingParticleCollection
label_tp_effic
 
edm::EDGetTokenT
< TrackingParticleCollection
label_tp_fake
 
edm::EDGetTokenT
< TrackingVertexCollection
label_tv
 
std::vector< edm::EDGetTokenT
< edm::View< reco::Track > > > 
labelToken
 
std::vector< edm::EDGetTokenT
< edm::View< TrajectorySeed > > > 
labelTokenSeed
 
edm::EDGetTokenT
< edm::ValueMap
< reco::DeDxData > > 
m_dEdx1Tag
 
edm::EDGetTokenT
< edm::ValueMap
< reco::DeDxData > > 
m_dEdx2Tag
 
std::string out
 
std::string parametersDefiner
 
std::string sim
 
bool skipHistoFit
 
edm::ESHandle< MagneticFieldtheMF
 

Detailed Description

Class that prodecs histrograms to validate Track Reconstruction performances

Author
cerati

Definition at line 18 of file TrackerSeedValidator.h.

Constructor & Destructor Documentation

TrackerSeedValidator::TrackerSeedValidator ( const edm::ParameterSet pset)

Constructor.

Definition at line 36 of file TrackerSeedValidator.cc.

References MultiTrackValidatorBase::associators, builderName, edm::EDConsumerBase::consumesCollector(), dirName_, reco::get(), edm::ParameterSet::getParameter(), histoProducerAlgo_, HLT_25ns14e33_v1_cff::InputTag, runStandalone, AlCaHLTBitMon_QueryRunRegistry::string, and tpSelector.

37  //theExtractor = IsoDepositExtractorFactory::get()->create( extractorName, extractorPSet, consumesCollector());
38 
39  ParameterSet psetForHistoProducerAlgo = pset.getParameter<ParameterSet>("histoProducerAlgoBlock");
40  string histoProducerAlgoName = psetForHistoProducerAlgo.getParameter<string>("ComponentName");
41  histoProducerAlgo_ = MTVHistoProducerAlgoFactory::get()->create(histoProducerAlgoName ,psetForHistoProducerAlgo, consumesCollector());
42 
43  dirName_ = pset.getParameter<std::string>("dirName");
44 
45  tpSelector = TrackingParticleSelector(pset.getParameter<double>("ptMinTP"),
46  pset.getParameter<double>("minRapidityTP"),
47  pset.getParameter<double>("maxRapidityTP"),
48  pset.getParameter<double>("tipTP"),
49  pset.getParameter<double>("lipTP"),
50  pset.getParameter<int>("minHitTP"),
51  pset.getParameter<bool>("signalOnlyTP"),
52  pset.getParameter<bool>("chargedOnlyTP"),
53  pset.getParameter<bool>("stableOnlyTP"),
54  pset.getParameter<std::vector<int> >("pdgIdTP"));
55 
56  runStandalone = pset.getParameter<bool>("runStandalone");
57 
58  builderName = pset.getParameter<std::string>("TTRHBuilder");
59 
60  for (auto const& associator: associators) {
61  consumes<reco::TrackToTrackingParticleAssociator>(edm::InputTag(associator));
62  }
63 
64 }
T getParameter(std::string const &) const
TrackingParticleSelector tpSelector
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MultiTrackValidatorBase(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC, bool isSeed=false)
Constructor.
std::vector< std::string > associators
MTVHistoProducerAlgo * histoProducerAlgo_
T get(const Candidate &c)
Definition: component.h:55
TrackerSeedValidator::~TrackerSeedValidator ( )
virtual

Destructor.

Definition at line 66 of file TrackerSeedValidator.cc.

References histoProducerAlgo_.

66 {delete histoProducerAlgo_;}
MTVHistoProducerAlgo * histoProducerAlgo_

Member Function Documentation

void TrackerSeedValidator::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
virtual

Method called once per event.

Implements edm::EDAnalyzer.

Definition at line 116 of file TrackerSeedValidator.cc.

References reco::TrackBase::appendHits(), MultiTrackValidatorBase::associators, asciidump::at, MultiTrackValidatorBase::bsSrc, EncodedEventId::bunchCrossing(), LocalTrajectoryParameters::charge(), funct::cos(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, alignCSCRings::e, edm::AssociationMap< Tag >::end(), EncodedEventId::event(), TrackingParticle::eventId(), MTVHistoProducerAlgo::fill_generic_recoTrack_histos(), MTVHistoProducerAlgo::fill_generic_simTrack_histos(), MTVHistoProducerAlgo::fill_recoAssociated_simTrack_histos(), MTVHistoProducerAlgo::fill_ResoAndPull_recoTrack_histos(), MTVHistoProducerAlgo::fill_simAssociated_recoTrack_histos(), MTVHistoProducerAlgo::fill_trackBased_histos(), edm::AssociationMap< Tag >::find(), plotBeamSpotDB::first, TrajectoryStateOnSurface::freeState(), PerigeeConversions::ftsToPerigeeError(), edm::EventSetup::get(), PileupSummaryInfo::getPU_NumInteractions(), histoProducerAlgo_, i, MultiTrackValidatorBase::label, MultiTrackValidatorBase::label_pileupinfo, MultiTrackValidatorBase::label_tp_effic, MultiTrackValidatorBase::label_tp_fake, MultiTrackValidatorBase::label_tv, MultiTrackValidatorBase::labelTokenSeed, LogTrace, PTrajectoryStateOnDet::parameters(), MultiTrackValidatorBase::parametersDefiner, reco::BeamSpot::position(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), TrajectorySeed::recHits(), fileCollector::seed, funct::sin(), findQualityFiles::size, mathSSE::sqrt(), TrajectorySeed::startingState(), MultiTrackValidatorBase::theMF, theTTRHBuilder, tpSelector, trajectoryStateTransform::transientState(), w, and cms::Exception::what().

116  {
117 
118  edm::LogInfo("TrackValidator") << "\n====================================================" << "\n"
119  << "Analyzing new event" << "\n"
120  << "====================================================\n" << "\n";
121 
122  std::vector<const reco::TrackToTrackingParticleAssociator*> associator;
124  for (auto const& associatorName: associators) {
125  event.getByLabel(associatorName,theAssociator);
126  associator.push_back( theAssociator.product() );
127  }
128 
129  edm::ESHandle<ParametersDefinerForTP> parametersDefinerTP;
130  setup.get<TrackAssociatorRecord>().get(parametersDefiner,parametersDefinerTP);
131 
132  edm::Handle<TrackingParticleCollection> TPCollectionHeff ;
133  event.getByToken(label_tp_effic,TPCollectionHeff);
134  const TrackingParticleCollection tPCeff = *(TPCollectionHeff.product());
135 
136  edm::Handle<TrackingParticleCollection> TPCollectionHfake ;
137  event.getByToken(label_tp_fake,TPCollectionHfake);
138  const TrackingParticleCollection tPCfake = *(TPCollectionHfake.product());
139 
140  if (tPCeff.size()==0) {edm::LogInfo("TrackValidator") << "TP Collection for efficiency studies has size = 0! Skipping Event." ; return;}
141  if (tPCfake.size()==0) {edm::LogInfo("TrackValidator") << "TP Collection for fake rate studies has size = 0! Skipping Event." ; return;}
142 
143  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
144  event.getByToken(bsSrc,recoBeamSpotHandle);
145  reco::BeamSpot bs = *recoBeamSpotHandle;
146 
148  event.getByToken(label_pileupinfo,puinfoH);
149  PileupSummaryInfo puinfo;
150 
151  for (unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){
152  if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){
153  puinfo=(*puinfoH)[puinfo_ite];
154  break;
155  }
156  }
157 
159  event.getByToken(label_tv,tvH);
160  TrackingVertexCollection tv = *tvH;
161 
162  int w=0;
163  for (unsigned int ww=0;ww<associators.size();ww++){
164  for (unsigned int www=0;www<label.size();www++){
165  edm::LogVerbatim("TrackValidator") << "Analyzing "
166  << label[www].process()<<":"
167  << label[www].label()<<":"
168  << label[www].instance()<<" with "
169  << associators[ww].c_str() <<"\n";
170  //
171  //get collections from the event
172  //
173  edm::Handle<edm::View<TrajectorySeed> > seedCollection;
174  event.getByToken(labelTokenSeed[www], seedCollection);
175  if (seedCollection->size()==0) {
176  edm::LogInfo("TrackValidator") << "SeedCollection size = 0!" ;
177  continue;
178  }
179 
180  //associate seeds
181  LogTrace("TrackValidator") << "Calling associateRecoToSim method" << "\n";
182  reco::RecoToSimCollectionSeed recSimColl=associator[ww]->associateRecoToSim(seedCollection,
183  TPCollectionHfake);
184  LogTrace("TrackValidator") << "Calling associateSimToReco method" << "\n";
185  reco::SimToRecoCollectionSeed simRecColl=associator[ww]->associateSimToReco(seedCollection,
186  TPCollectionHeff);
187 
188  //
189  //fill simulation histograms
190  //compute number of seeds per eta interval
191  //
192  edm::LogVerbatim("TrackValidator") << "\n# of TrackingParticles: " << tPCeff.size() << "\n";
193  int ats(0); //This counter counts the number of simTracks that are "associated" to recoTracks
194  int st(0); //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) )
195  unsigned sts(0); //This counter counts the number of simTracks surviving the bunchcrossing cut
196  unsigned asts(0); //This counter counts the number of simTracks that are "associated" to recoTracks surviving the bunchcrossing cut
197  for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
198  TrackingParticleRef tp(TPCollectionHeff, i);
199 
200  if (tp->charge()==0) continue;
201 
202  if(! tpSelector(*tp)) continue;
203 
204  TrackingParticle::Vector momentumTP = tp->momentum();
205  TrackingParticle::Point vertexTP = tp->vertex();
206  //Calcualte the impact parameters w.r.t. PCA
207  TrackingParticle::Vector momentum = parametersDefinerTP->momentum(event,setup,tp);
208  TrackingParticle::Point vertex = parametersDefinerTP->vertex(event,setup,tp);
209  double dxySim = (-vertex.x()*sin(momentum.phi())+vertex.y()*cos(momentum.phi()));
210  double dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/sqrt(momentum.perp2())
211  * momentum.z()/sqrt(momentum.perp2());
212 
213  st++;
214 
215  histoProducerAlgo_->fill_generic_simTrack_histos(w,momentumTP,vertexTP, tp->eventId().bunchCrossing());
216 
217  const TrajectorySeed* matchedSeedPointer=0;
218  std::vector<std::pair<edm::RefToBase<TrajectorySeed>, double> > rt;
219  if(simRecColl.find(tp) != simRecColl.end()){
220  rt = simRecColl[tp];
221  if (rt.size()!=0) {
222  ats++;
223  matchedSeedPointer = rt.begin()->first.get();
224  edm::LogVerbatim("TrackValidator") << "TrackingParticle #" << st
225  << " with pt=" << sqrt(tp->momentum().perp2())
226  << " associated with quality:" << rt.begin()->second <<"\n";
227  }
228  }else{
229  edm::LogVerbatim("TrackValidator") << "TrackingParticle #" << st
230  << " with pt=" << sqrt(tp->momentum().perp2())
231  << " NOT associated to any TrajectorySeed" << "\n";
232  }
233 
234  int nSimHits = tp->numberOfTrackerHits();
235 
236  //fixme convert seed into track
237  reco::Track* matchedTrackPointer = 0;
238  if (matchedSeedPointer) {
239  TSCBLBuilderNoMaterial tscblBuilder;
240  TransientTrackingRecHit::RecHitPointer recHit = theTTRHBuilder->build(&*(matchedSeedPointer->recHits().second-1));
241  TrajectoryStateOnSurface state = trajectoryStateTransform::transientState( matchedSeedPointer->startingState(), recHit->surface(), theMF.product());
242  TrajectoryStateClosestToBeamLine tsAtClosestApproachSeed = tscblBuilder(*state.freeState(),bs);//as in TrackProducerAlgorithm
243  if(!(tsAtClosestApproachSeed.isValid())){
244  edm::LogVerbatim("SeedValidator")<<"TrajectoryStateClosestToBeamLine not valid";
245  continue;
246  }
247  const reco::TrackBase::Point vSeed1(tsAtClosestApproachSeed.trackStateAtPCA().position().x(),
248  tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
249  tsAtClosestApproachSeed.trackStateAtPCA().position().z());
250  const reco::TrackBase::Vector pSeed(tsAtClosestApproachSeed.trackStateAtPCA().momentum().x(),
251  tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
252  tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
253  //GlobalPoint vSeed(vSeed1.x()-bs.x0(),vSeed1.y()-bs.y0(),vSeed1.z()-bs.z0());
254  PerigeeTrajectoryError seedPerigeeErrors = PerigeeConversions::ftsToPerigeeError(tsAtClosestApproachSeed.trackStateAtPCA());
255  matchedTrackPointer = new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
256  matchedTrackPointer->appendHits(matchedSeedPointer->recHits().first,matchedSeedPointer->recHits().second);
257  }
258 
259  double dR=0;//fixme: plots vs dR not implemented for now
260  histoProducerAlgo_->fill_recoAssociated_simTrack_histos(w,*tp,tp->momentum(),tp->vertex(),dxySim,dzSim,nSimHits,
261  matchedTrackPointer,puinfo.getPU_NumInteractions(),dR);
262 
263  sts++;
264  if (matchedTrackPointer) asts++;
265 
266  } // End for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
267 
268  //
269  //fill reconstructed seed histograms
270  //
271  edm::LogVerbatim("TrackValidator") << "\n# of TrajectorySeeds with "
272  << label[www].process()<<":"
273  << label[www].label()<<":"
274  << label[www].instance()
275  << ": " << seedCollection->size() << "\n";
276  int sat(0); //This counter counts the number of recoTracks that are associated to SimTracks from Signal only
277  int at(0); //This counter counts the number of recoTracks that are associated to SimTracks
278  int rT(0); //This counter counts the number of recoTracks in general
279 
280  TSCBLBuilderNoMaterial tscblBuilder;
281  for(TrajectorySeedCollection::size_type i=0; i<seedCollection->size(); ++i){
282  edm::RefToBase<TrajectorySeed> seed(seedCollection, i);
283  rT++;
284 
285  //get parameters and errors from the seed state
286  TransientTrackingRecHit::RecHitPointer recHit = theTTRHBuilder->build(&*(seed->recHits().second-1));
287  TrajectoryStateOnSurface state = trajectoryStateTransform::transientState( seed->startingState(), recHit->surface(), theMF.product());
288  TrajectoryStateClosestToBeamLine tsAtClosestApproachSeed = tscblBuilder(*state.freeState(),bs);//as in TrackProducerAlgorithm
289  if(!(tsAtClosestApproachSeed.isValid())){
290  edm::LogVerbatim("SeedValidator")<<"TrajectoryStateClosestToBeamLine not valid";
291  continue;
292  }
293  const reco::TrackBase::Point vSeed1(tsAtClosestApproachSeed.trackStateAtPCA().position().x(),
294  tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
295  tsAtClosestApproachSeed.trackStateAtPCA().position().z());
296  const reco::TrackBase::Vector pSeed(tsAtClosestApproachSeed.trackStateAtPCA().momentum().x(),
297  tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
298  tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
299  //GlobalPoint vSeed(vSeed1.x()-bs.x0(),vSeed1.y()-bs.y0(),vSeed1.z()-bs.z0());
300  PerigeeTrajectoryError seedPerigeeErrors = PerigeeConversions::ftsToPerigeeError(tsAtClosestApproachSeed.trackStateAtPCA());
301 
302  //fixme
303  reco::Track* trackFromSeed = new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
304  trackFromSeed->appendHits(seed->recHits().first,seed->recHits().second);
305 
306  bool isSigSimMatched(false);
307  bool isSimMatched(false);
308  bool isChargeMatched(true);
309  int numAssocSeeds = 0;
310  int nSimHits = 0;
311  double sharedFraction = 0.;
312  std::vector<std::pair<TrackingParticleRef, double> > tp;
313  if(recSimColl.find(seed) != recSimColl.end()) {
314  tp = recSimColl[seed];
315  if (tp.size()!=0) {
316 
317  nSimHits = tp[0].first->numberOfTrackerHits();
318  sharedFraction = tp[0].second;
319  isSimMatched = true;
320  if (tp[0].first->charge() != seed->startingState().parameters().charge()) isChargeMatched = false;
321  if(simRecColl.find(tp[0].first) != simRecColl.end()) numAssocSeeds = simRecColl[tp[0].first].size();
322  //std::cout << numAssocRecoTracks << std::endl;
323 
324  at++;
325 
326  for (unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
327  TrackingParticle trackpart = *(tp[tp_ite].first);
328  if ((trackpart.eventId().event() == 0) && (trackpart.eventId().bunchCrossing() == 0)){
329  isSigSimMatched = true;
330  sat++;
331  break;
332  }
333  }
334 
335 
336  edm::LogVerbatim("SeedValidator") << "TrajectorySeed #" << rT << " associated with quality:" << tp.begin()->second <<"\n";
337  }
338  } else {
339  edm::LogVerbatim("SeedValidator") << "TrajectorySeed #" << rT << " NOT associated to any TrackingParticle" << "\n";
340  }
341 
342  double dR = 0.;//fixme: plots vs dR not implemented for now
343  histoProducerAlgo_->fill_generic_recoTrack_histos(w,*trackFromSeed,bs.position(),isSimMatched,isSigSimMatched,
344  isChargeMatched, numAssocSeeds,
345  puinfo.getPU_NumInteractions(),
346  nSimHits, sharedFraction, dR);
347 
348  //Fill other histos
349  try{
350  if (tp.size()==0) continue;
351 
353 
354  TrackingParticleRef tpr = tp.begin()->first;
355 
356  //compute tracking particle parameters at point of closest approach to the beamline
357  TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event,setup,tpr);
358  TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event,setup,tpr);
359 
360  // LogTrace("SeedValidatorTEST") << "assocChi2=" << tp.begin()->second << "\n"
361  // << "" << "\n"
362  // << "ptREC=" << ptSeed << "\n"
363  // << "etaREC=" << etaSeed << "\n"
364  // << "qoverpREC=" << qoverpSeed << "\n"
365  // << "dxyREC=" << dxySeed << "\n"
366  // << "dzREC=" << dzSeed << "\n"
367  // << "thetaREC=" << thetaSeed << "\n"
368  // << "phiREC=" << phiSeed << "\n"
369  // << "" << "\n"
370  // << "qoverpError()=" << qoverpErrorSeed << "\n"
371  // << "dxyError()=" << dxyErrorSeed << "\n"
372  // << "dzError()=" << dzErrorSeed << "\n"
373  // << "thetaError()=" << lambdaErrorSeed << "\n"
374  // << "phiError()=" << phiErrorSeed << "\n"
375  // << "" << "\n"
376  // << "ptSIM=" << sqrt(assocTrack->momentum().perp2()) << "\n"
377  // << "etaSIM=" << assocTrack->momentum().Eta() << "\n"
378  // << "qoverpSIM=" << qoverpSim << "\n"
379  // << "dxySIM=" << dxySim << "\n"
380  // << "dzSIM=" << dzSim << "\n"
381  // << "thetaSIM=" << M_PI/2-lambdaSim << "\n"
382  // << "phiSIM=" << phiSim << "\n"
383  // << "" << "\n"
384  // << "contrib_Qoverp=" << contrib_Qoverp << "\n"
385  // << "contrib_dxy=" << contrib_dxy << "\n"
386  // << "contrib_dz=" << contrib_dz << "\n"
387  // << "contrib_theta=" << contrib_theta << "\n"
388  // << "contrib_phi=" << contrib_phi << "\n"
389  // << "" << "\n"
390  // <<"chi2PULL="<<contrib_Qoverp+contrib_dxy+contrib_dz+contrib_theta+contrib_phi<<"\n";
391 
392  histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos(w,momentumTP,vertexTP,tpr->charge(),
393  *trackFromSeed,bs.position());
394 
395 
396  } catch (cms::Exception e){
397  LogTrace("SeedValidator") << "exception found: " << e.what() << "\n";
398  }
399  }// End of for(TrajectorySeedCollection::size_type i=0; i<seedCollection->size(); ++i)
400 
402 
403  edm::LogVerbatim("SeedValidator") << "Total Simulated: " << st << "\n"
404  << "Total Associated (simToReco): " << ats << "\n"
405  << "Total Reconstructed: " << rT << "\n"
406  << "Total Associated (recoToSim): " << at << "\n"
407  << "Total Fakes: " << rT-at << "\n";
408  w++;
409  }
410  }
411 }
virtual char const * what() const
Definition: Exception.cc:141
int i
Definition: DBlmapReader.cc:9
int event() const
get the contents of the subdetector field (should be protected?)
const double w
Definition: UKUtility.cc:23
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > label_pileupinfo
std::vector< TrackingParticle > TrackingParticleCollection
const_iterator end() const
last iterator over the map (read only)
edm::EDGetTokenT< TrackingParticleCollection > label_tp_effic
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const_iterator find(const key_type &k) const
find element with specified reference key
virtual void fill_ResoAndPull_recoTrack_histos(int count, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, int chargeTP, const reco::Track &track, const math::XYZPoint &bsPosition)=0
edm::EDGetTokenT< TrackingVertexCollection > label_tv
uint16_t size_type
virtual void fill_recoAssociated_simTrack_histos(int count, const TrackingParticle &tp, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, double dxy, double dz, int nSimHits, const reco::Track *track, int numVertices, double dR)=0
TrackingParticleSelector tpSelector
edm::EDGetTokenT< reco::BeamSpot > bsSrc
math::XYZPointD Point
point in the space
bool appendHits(const C &c)
append hit patterns from vector of hit references
Definition: TrackBase.h:438
std::vector< edm::InputTag > label
std::vector< edm::EDGetTokenT< edm::View< TrajectorySeed > > > labelTokenSeed
T sqrt(T t)
Definition: SSEVec.h:48
int bunchCrossing() const
get the detector field from this detid
FreeTrajectoryState const * freeState(bool withErrors=true) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZPoint Point
point in the space
Definition: TrackBase.h:83
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
#define LogTrace(id)
std::shared_ptr< TrackingRecHit const > RecHitPointer
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
virtual void fill_simAssociated_recoTrack_histos(int count, const reco::Track &track)=0
T const * product() const
Definition: Handle.h:81
std::vector< TrackingVertex > TrackingVertexCollection
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
range recHits() const
virtual void fill_trackBased_histos(int count, int assTracks, int numRecoTracks, int numSimTracks)=0
const int getPU_NumInteractions() const
EncodedEventId eventId() const
Signal source, crossing number.
virtual void fill_generic_recoTrack_histos(int count, const reco::Track &track, const math::XYZPoint &bsPosition, bool isMatched, bool isSigMatched, bool isChargeMatched, int numAssocRecoTracks, int numVertices, int nSimHits, double sharedFraction, double dR)=0
Monte Carlo truth information used for tracking validation.
PerigeeTrajectoryError ftsToPerigeeError(const FTS &originalFTS)
const Point & position() const
position
Definition: BeamSpot.h:62
std::vector< std::string > associators
math::XYZVectorD Vector
point in the space
MTVHistoProducerAlgo * histoProducerAlgo_
virtual void fill_generic_simTrack_histos(int counter, const TrackingParticle::Vector &, const TrackingParticle::Point &vertex, int bx)=0
edm::EDGetTokenT< TrackingParticleCollection > label_tp_fake
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:80
tuple size
Write out results.
edm::ESHandle< MagneticField > theMF
list at
Definition: asciidump.py:428
void TrackerSeedValidator::bookHistograms ( DQMStore::IBooker ibook,
edm::Run const &  ,
edm::EventSetup const &  setup 
)

Method called to book the DQM histograms.

Definition at line 68 of file TrackerSeedValidator.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, MultiTrackValidatorBase::associators, MTVHistoProducerAlgo::bookRecoHistos(), MTVHistoProducerAlgo::bookRecoHistosForStandaloneRunning(), MTVHistoProducerAlgo::bookSimHistos(), builderName, DQMStore::IBooker::cd(), TrackerOfflineValidation_Dqm_cff::dirName, dirName_, edm::EventSetup::get(), histoProducerAlgo_, MTVHistoProducerAlgo::initialize(), edm::InputTag::instance(), edm::InputTag::label(), MultiTrackValidatorBase::label, edm::InputTag::process(), python.rootplot.root2matplotlib::replace(), runStandalone, DQMStore::IBooker::setCurrentFolder(), MultiTrackValidatorBase::theMF, and theTTRHBuilder.

68  {
71 
72  for (unsigned int ww=0;ww<associators.size();ww++){
73  for (unsigned int www=0;www<label.size();www++){
74 
75  ibook.cd();
76  InputTag algo = label[www];
77  string dirName=dirName_;
78  if (algo.process()!="")
79  dirName+=algo.process()+"_";
80  if(algo.label()!="")
81  dirName+=algo.label()+"_";
82  if(algo.instance()!="")
83  dirName+=algo.instance()+"_";
84  // if (dirName.find("Seeds")<dirName.length()){
85  // dirName.replace(dirName.find("Seeds"),6,"");
86  // }
87  string assoc= associators[ww];
88  if (assoc.find("Track")<assoc.length()){
89  assoc.replace(assoc.find("Track"),5,"");
90  }
91  dirName+=assoc;
92  std::replace(dirName.begin(), dirName.end(), ':', '_');
93 
94  ibook.setCurrentFolder(dirName.c_str());
95 
96  // vector of vector initialization
97  histoProducerAlgo_->initialize(); //TO BE FIXED. I'D LIKE TO AVOID THIS CALL
98 
99  string subDirName = dirName + "/simulation";
100  ibook.setCurrentFolder(subDirName.c_str());
101 
102  //Booking histograms concerning with simulated tracks
104 
105  ibook.cd();
106  ibook.setCurrentFolder(dirName.c_str());
107 
108  //Booking histograms concerning with reconstructed tracks
111  }//end loop www
112  }// end loop ww
113 }
void cd(void)
Definition: DQMStore.cc:266
virtual void bookRecoHistosForStandaloneRunning(DQMStore::IBooker &ibook)=0
std::vector< edm::InputTag > label
virtual void bookRecoHistos(DQMStore::IBooker &ibook)=0
virtual void initialize()=0
virtual void bookSimHistos(DQMStore::IBooker &ibook)=0
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::string const & label() const
Definition: InputTag.h:42
std::string const & process() const
Definition: InputTag.h:46
std::vector< std::string > associators
MTVHistoProducerAlgo * histoProducerAlgo_
std::string const & instance() const
Definition: InputTag.h:43
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::ESHandle< MagneticField > theMF
void TrackerSeedValidator::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
virtual

Method called at the end of the event loop.

Reimplemented from edm::EDAnalyzer.

Definition at line 413 of file TrackerSeedValidator.cc.

References MultiTrackValidatorBase::associators, MTVHistoProducerAlgo::fillProfileHistosFromVectors(), MTVHistoProducerAlgo::finalHistoFits(), histoProducerAlgo_, MultiTrackValidatorBase::label, LogTrace, runStandalone, and w.

413  {
414  LogTrace("SeedValidator") << "TrackerSeedValidator::endRun()";
415  int w=0;
416  for (unsigned int ww=0;ww<associators.size();ww++){
417  for (unsigned int www=0;www<label.size();www++){
418 
421 
422  w++;
423  }
424  }
425  //if ( out.size() != 0 && dbe_ ) dbe_->save(out);
426 }
const double w
Definition: UKUtility.cc:23
std::vector< edm::InputTag > label
virtual void fillProfileHistosFromVectors(int counter)=0
#define LogTrace(id)
virtual void finalHistoFits(int counter)=0
std::vector< std::string > associators
MTVHistoProducerAlgo * histoProducerAlgo_

Member Data Documentation

std::string TrackerSeedValidator::builderName
private

Definition at line 35 of file TrackerSeedValidator.h.

Referenced by bookHistograms(), and TrackerSeedValidator().

CosmicTrackingParticleSelector TrackerSeedValidator::cosmictpSelector
private

Definition at line 43 of file TrackerSeedValidator.h.

std::string TrackerSeedValidator::dirName_
private

Definition at line 37 of file TrackerSeedValidator.h.

Referenced by bookHistograms(), and TrackerSeedValidator().

MTVHistoProducerAlgo* TrackerSeedValidator::histoProducerAlgo_
private
bool TrackerSeedValidator::runStandalone
private

Definition at line 39 of file TrackerSeedValidator.h.

Referenced by bookHistograms(), endRun(), and TrackerSeedValidator().

edm::ESHandle<TransientTrackingRecHitBuilder> TrackerSeedValidator::theTTRHBuilder
private

Definition at line 36 of file TrackerSeedValidator.h.

Referenced by analyze(), and bookHistograms().

TrackingParticleSelector TrackerSeedValidator::tpSelector
private

Definition at line 42 of file TrackerSeedValidator.h.

Referenced by analyze(), and TrackerSeedValidator().