59 edm::LogInfo(
"TrackValidator") <<
"\n====================================================" <<
"\n"
60 <<
"Analyzing new event" <<
"\n"
61 <<
"====================================================\n" <<
"\n";
80 event.getByToken(
bsSrc,recoBeamSpotHandle);
87 for (
unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){
88 if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){
89 puinfo=(*puinfoH)[puinfo_ite];
100 for (
unsigned int www=0;www<
label.size();www++){
115 <<
label[www].process()<<
":"
116 <<
label[www].label()<<
":"
117 <<
label[www].instance()<<
" with "
120 LogTrace(
"TrackValidator") <<
"Calling associateRecoToGen method" <<
"\n";
124 LogTrace(
"TrackValidator") <<
"Calling associateGenToReco method" <<
"\n";
131 <<
label[www].process()<<
":"
132 <<
label[www].label()<<
":"
133 <<
label[www].instance()<<
" with "
140 genRecColl= *(gentorecoCollectionH.
product());
144 recGenColl= *(recotogenCollectionH.
product());
155 edm::LogVerbatim(
"TrackValidator") <<
"\n# of GenParticles: " << tPCeff.size() <<
"\n";
180 dxyGen = (-vertex.x()*
sin(momentum.phi())+vertex.y()*
cos(momentum.phi()));
181 dzGen = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/
sqrt(momentum.perp2())
182 * momentum.z()/
sqrt(momentum.perp2());
188 momentumTP = parametersDefinerTP->momentum(event,setup,*tp);
189 vertexTP = parametersDefinerTP->vertex(event,setup,*tp);
190 dxyGen = (-vertexTP.x()*
sin(momentumTP.phi())+vertexTP.y()*
cos(momentumTP.phi()));
191 dzGen = vertexTP.z() - (vertexTP.x()*momentumTP.x()+vertexTP.y()*momentumTP.y())/
sqrt(momentumTP.perp2())
192 * momentumTP.z()/
sqrt(momentumTP.perp2());
212 std::vector<std::pair<RefToBase<Track>,
double> > rt;
213 if(genRecColl.
find(tpr) != genRecColl.
end()){
214 rt = (std::vector<std::pair<RefToBase<Track>,
double> >) genRecColl[tpr];
218 matchedTrackPointer = rt.begin()->first.get();
220 <<
" with pt=" <<
sqrt(momentumTP.perp2())
221 <<
" associated with quality:" << rt.begin()->second <<
"\n";
225 <<
"GenParticle #" << st
226 <<
" with pt,eta,phi: "
227 <<
sqrt(momentumTP.perp2()) <<
" , "
228 << momentumTP.eta() <<
" , "
229 << momentumTP.phi() <<
" , "
230 <<
" NOT associated to any reco::Track" <<
"\n";
241 double vtx_z_PU = vertexTP.z();
254 if (matchedTrackPointer) asts++;
268 <<
label[www].process()<<
":"
269 <<
label[www].label()<<
":"
270 <<
label[www].instance()
271 <<
": " << trackCollection->size() <<
"\n";
283 std::vector<edm::ValueMap<reco::DeDxData> > v_dEdx;
292 v_dEdx.push_back(dEdx1);
293 v_dEdx.push_back(dEdx2);
295 LogTrace(
"TrackValidator") <<
"exception found: " << e.
what() <<
"\n";
305 bool isSigGenMatched(
false);
306 bool isGenMatched(
false);
307 bool isChargeMatched(
true);
308 int numAssocRecoTracks = 0;
311 double sharedFraction = 0.;
312 std::vector<std::pair<GenParticleRef, double> > tp;
313 if(recGenColl.
find(track) != recGenColl.
end()){
314 tp = recGenColl[track];
320 sharedFraction = tp[0].second;
322 if (tp[0].
first->charge() != track->
charge()) isChargeMatched =
false;
323 if(genRecColl.
find(tp[0].first) != genRecColl.
end()) numAssocRecoTracks = genRecColl[tp[0].
first].
size();
329 for (
unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
339 edm::LogVerbatim(
"TrackValidator") <<
"reco::Track #" << rT <<
" with pt=" << track->
pt()
340 <<
" associated with quality:" << tp.begin()->second <<
"\n";
343 edm::LogVerbatim(
"TrackValidator") <<
"reco::Track #" << rT <<
" with pt=" << track->
pt()
344 <<
" NOT associated to any GenParticle" <<
"\n";
348 histoProducerAlgo_->
fill_generic_recoTrack_histos(
w,*track,bs.position(),isGenMatched,isSigGenMatched, isChargeMatched, numAssocRecoTracks, puinfo.getPU_NumInteractions(), tpbx, nSimHits, sharedFraction);
359 if (tp.size()==0)
continue;
383 int chargeTP = tpr->charge();
386 *track,bs.position());
405 <<
"Total Associated (genToReco): " << ats <<
"\n"
406 <<
"Total Reconstructed: " << rT <<
"\n"
407 <<
"Total Associated (recoToGen): " << at <<
"\n"
408 <<
"Total Fakes: " << rT-at <<
"\n";
virtual char const * what() const
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
bool ignoremissingtkcollection_
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > label_pileupinfo
const_iterator end() const
last iterator over the map (read only)
edm::EDGetTokenT< TrackingParticleCollection > label_tp_effic
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual const Point & vertex() const
vertex position (overwritten by PF...)
void analyze(const edm::Event &, const edm::EventSetup &)
Method called once per event.
virtual void fill_dedx_recoTrack_histos(int count, edm::RefToBase< reco::Track > &trackref, const std::vector< edm::ValueMap< reco::DeDxData > > &v_dEdx)=0
Sin< T >::type sin(const T &t)
const_iterator find(const key_type &k) const
find element with specified reference key
std::vector< const TrackAssociatorBase * > associator
edm::EDGetTokenT< reco::RecoToSimCollection > associatormapRtS
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
const TrackAssociatorByChi2 * associatorByChi2
MultiTrackValidatorGenPs(const edm::ParameterSet &pset)
Constructor.
edm::EDGetTokenT< reco::SimToRecoCollection > associatormapStR
edm::EDGetTokenT< reco::BeamSpot > bsSrc
math::XYZPointD Point
point in the space
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 vertz)=0
std::vector< edm::InputTag > label
GenParticleCustomSelector gpSelector
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 tpbunchcrossing, int nSimHits, double sharedFraction)=0
double pt() const
track transverse momentum
Cos< T >::type cos(const T &t)
edm::EDGetTokenT< reco::DeDxData > m_dEdx1Tag
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::InputTag assMapInput
MTVHistoProducerAlgo * histoProducerAlgo_
std::string parametersDefiner
virtual void fill_simAssociated_recoTrack_histos(int count, const reco::Track &track)=0
reco::RecoToGenCollection associateRecoToGen(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< reco::GenParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Association Sim To Reco with Collections (Gen Particle version)
virtual Vector momentum() const GCC11_FINAL
spatial momentum vector
reco::GenToRecoCollection associateGenToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< reco::GenParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Association Sim To Reco with Collections (Gen Particle version)
virtual void fill_trackBased_histos(int count, int assTracks, int numRecoTracks, int numSimTracks)=0
T const * product() const
edm::EDGetTokenT< reco::DeDxData > m_dEdx2Tag
int charge() const
track electric charge
std::vector< std::string > associators
SingleObjectSelector< GenParticleCollection,::GenParticleCustomSelector > GenParticleCustomSelector
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > labelToken
math::XYZVectorD Vector
point in the space
T const * get() const
Returns C++ pointer to the item.
virtual void fill_generic_simTrack_histos(int counter, const TrackingParticle::Vector &, const TrackingParticle::Point &vertex, int bx)=0
edm::EDGetTokenT< TrackingParticleCollection > label_tp_fake
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
virtual ~MultiTrackValidatorGenPs()
Destructor.