40 string histoProducerAlgoName = psetForHistoProducerAlgo.
getParameter<
string>(
"ComponentName");
61 consumes<reco::TrackToTrackingParticleAssociator>(
edm::InputTag(associator));
73 for (
unsigned int www=0;www<
label.size();www++){
81 dirName+=algo.
label()+
"_";
88 if (assoc.find(
"Track")<assoc.length()){
89 assoc.replace(assoc.find(
"Track"),5,
"");
99 string subDirName = dirName +
"/simulation";
118 edm::LogInfo(
"TrackValidator") <<
"\n====================================================" <<
"\n"
119 <<
"Analyzing new event" <<
"\n"
120 <<
"====================================================\n" <<
"\n";
122 std::vector<const reco::TrackToTrackingParticleAssociator*> associator;
125 event.getByLabel(associatorName,theAssociator);
126 associator.push_back( theAssociator.
product() );
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;}
144 event.getByToken(
bsSrc,recoBeamSpotHandle);
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];
163 for (
unsigned int ww=0;ww<associators.size();ww++){
164 for (
unsigned int www=0;www<
label.size();www++){
166 <<
label[www].process()<<
":"
167 <<
label[www].label()<<
":"
168 <<
label[www].instance()<<
" with "
169 << associators[ww].c_str() <<
"\n";
175 if (seedCollection->size()==0) {
176 edm::LogInfo(
"TrackValidator") <<
"SeedCollection size = 0!" ;
181 LogTrace(
"TrackValidator") <<
"Calling associateRecoToSim method" <<
"\n";
184 LogTrace(
"TrackValidator") <<
"Calling associateSimToReco method" <<
"\n";
192 edm::LogVerbatim(
"TrackValidator") <<
"\n# of TrackingParticles: " << tPCeff.size() <<
"\n";
200 if (tp->charge()==0)
continue;
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());
218 std::vector<std::pair<edm::RefToBase<TrajectorySeed>,
double> > rt;
219 if(simRecColl.
find(tp) != simRecColl.
end()){
223 matchedSeedPointer = rt.begin()->first.get();
225 <<
" with pt=" <<
sqrt(tp->momentum().perp2())
226 <<
" associated with quality:" << rt.begin()->second <<
"\n";
230 <<
" with pt=" <<
sqrt(tp->momentum().perp2())
231 <<
" NOT associated to any TrajectorySeed" <<
"\n";
234 int nSimHits = tp->numberOfTrackerHits();
238 if (matchedSeedPointer) {
243 if(!(tsAtClosestApproachSeed.isValid())){
244 edm::LogVerbatim(
"SeedValidator")<<
"TrajectoryStateClosestToBeamLine not valid";
248 tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
249 tsAtClosestApproachSeed.trackStateAtPCA().position().z());
251 tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
252 tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
255 matchedTrackPointer =
new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
264 if (matchedTrackPointer) asts++;
272 <<
label[www].process()<<
":"
273 <<
label[www].label()<<
":"
274 <<
label[www].instance()
275 <<
": " << seedCollection->size() <<
"\n";
289 if(!(tsAtClosestApproachSeed.isValid())){
290 edm::LogVerbatim(
"SeedValidator")<<
"TrajectoryStateClosestToBeamLine not valid";
294 tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
295 tsAtClosestApproachSeed.trackStateAtPCA().position().z());
297 tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
298 tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
303 reco::Track* trackFromSeed =
new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
306 bool isSigSimMatched(
false);
307 bool isSimMatched(
false);
308 bool isChargeMatched(
true);
309 int numAssocSeeds = 0;
311 double sharedFraction = 0.;
312 std::vector<std::pair<TrackingParticleRef, double> > tp;
313 if(recSimColl.
find(seed) != recSimColl.
end()) {
314 tp = recSimColl[
seed];
317 nSimHits = tp[0].first->numberOfTrackerHits();
318 sharedFraction = tp[0].second;
321 if(simRecColl.
find(tp[0].first) != simRecColl.
end()) numAssocSeeds = simRecColl[tp[0].
first].
size();
326 for (
unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
329 isSigSimMatched =
true;
336 edm::LogVerbatim(
"SeedValidator") <<
"TrajectorySeed #" << rT <<
" associated with quality:" << tp.begin()->second <<
"\n";
339 edm::LogVerbatim(
"SeedValidator") <<
"TrajectorySeed #" << rT <<
" NOT associated to any TrackingParticle" <<
"\n";
344 isChargeMatched, numAssocSeeds,
346 nSimHits, sharedFraction,
dR);
350 if (tp.size()==0)
continue;
397 LogTrace(
"SeedValidator") <<
"exception found: " << e.
what() <<
"\n";
404 <<
"Total Associated (simToReco): " << ats <<
"\n"
405 <<
"Total Reconstructed: " << rT <<
"\n"
406 <<
"Total Associated (recoToSim): " << at <<
"\n"
407 <<
"Total Fakes: " << rT-at <<
"\n";
414 LogTrace(
"SeedValidator") <<
"TrackerSeedValidator::endRun()";
416 for (
unsigned int ww=0;ww<
associators.size();ww++){
417 for (
unsigned int www=0;www<
label.size();www++){
virtual char const * what() const
T getParameter(std::string const &) const
int event() const
get the contents of the subdetector field (should be protected?)
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
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Method called to book the DQM histograms.
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
Sin< T >::type sin(const T &t)
const_iterator find(const key_type &k) const
find element with specified reference key
void endRun(edm::Run const &, edm::EventSetup const &)
Method called at the end of the event loop.
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
virtual void bookRecoHistosForStandaloneRunning(DQMStore::IBooker &ibook)=0
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
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
bool appendHits(const C &c)
append hit patterns from vector of hit references
std::vector< edm::InputTag > label
std::vector< edm::EDGetTokenT< edm::View< TrajectorySeed > > > labelTokenSeed
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
int bunchCrossing() const
get the detector field from this detid
FreeTrajectoryState const * freeState(bool withErrors=true) const
TrackerSeedValidator(const edm::ParameterSet &pset)
Constructor.
Cos< T >::type cos(const T &t)
virtual void bookRecoHistos(DQMStore::IBooker &ibook)=0
virtual void fillProfileHistosFromVectors(int counter)=0
virtual void initialize()=0
virtual void bookSimHistos(DQMStore::IBooker &ibook)=0
math::XYZPoint Point
point in the space
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
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual void finalHistoFits(int counter)=0
std::string parametersDefiner
PTrajectoryStateOnDet const & startingState() const
void setCurrentFolder(const std::string &fullpath)
virtual void fill_simAssociated_recoTrack_histos(int count, const reco::Track &track)=0
T const * product() const
std::vector< TrackingVertex > TrackingVertexCollection
T const * product() const
virtual void fill_trackBased_histos(int count, int assTracks, int numRecoTracks, int numSimTracks)=0
TrackCharge charge() const
Charge (-1, 0 or 1)
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)
virtual ~TrackerSeedValidator()
Destructor.
const Point & position() const
position
std::vector< std::string > associators
math::XYZVectorD Vector
point in the space
void analyze(const edm::Event &, const edm::EventSetup &)
Method called once per event.
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
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
T get(const Candidate &c)
const LocalTrajectoryParameters & parameters() const
edm::ESHandle< MagneticField > theMF