46 string histoProducerAlgoName = psetForHistoProducerAlgo.
getParameter<
string>(
"ComponentName");
48 histoProducerAlgo_->setDQMStore(
dbe_);
82 if (!UseAssociators) {
97 for (
unsigned int www=0;www<
label.size();www++){
104 dirName+=algo.
label()+
"_";
107 if (dirName.find(
"Tracks")<dirName.length()){
108 dirName.replace(dirName.find(
"Tracks"),6,
"");
111 if (assoc.find(
"Track")<assoc.length()){
112 assoc.replace(assoc.find(
"Track"),5,
"");
123 string subDirName = dirName +
"/simulation";
148 using namespace reco;
150 edm::LogInfo(
"TrackValidator") <<
"\n====================================================" <<
"\n"
151 <<
"Analyzing new event" <<
"\n"
152 <<
"====================================================\n" <<
"\n";
170 event.getByLabel(
bsSrc,recoBeamSpotHandle);
177 for (
unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){
178 if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){
179 puinfo=(*puinfoH)[puinfo_ite];
189 for (
unsigned int ww=0;ww<
associators.size();ww++){
190 for (
unsigned int www=0;www<
label.size();www++){
205 <<
label[www].process()<<
":"
206 <<
label[www].label()<<
":"
207 <<
label[www].instance()<<
" with "
210 LogTrace(
"TrackValidator") <<
"Calling associateRecoToSim method" <<
"\n";
211 recSimColl=
associator[ww]->associateRecoToSim(trackCollection,
214 LogTrace(
"TrackValidator") <<
"Calling associateSimToReco method" <<
"\n";
215 simRecColl=
associator[ww]->associateSimToReco(trackCollection,
221 <<
label[www].process()<<
":"
222 <<
label[www].label()<<
":"
223 <<
label[www].instance()<<
" with "
230 simRecColl= *(simtorecoCollectionH.
product());
234 recSimColl= *(recotosimCollectionH.
product());
245 edm::LogVerbatim(
"TrackValidator") <<
"\n# of TrackingParticles: " << tPCeff.size() <<
"\n";
268 dxySim = (-vertex.x()*
sin(momentum.phi())+vertex.y()*
cos(momentum.phi()));
269 dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/
sqrt(momentum.perp2())
270 * momentum.z()/
sqrt(momentum.perp2());
276 momentumTP = parametersDefinerTP->momentum(event,setup,*tp);
277 vertexTP = parametersDefinerTP->vertex(event,setup,*tp);
278 dxySim = (-vertexTP.x()*
sin(momentumTP.phi())+vertexTP.y()*
cos(momentumTP.phi()));
279 dzSim = vertexTP.z() - (vertexTP.x()*momentumTP.x()+vertexTP.y()*momentumTP.y())/
sqrt(momentumTP.perp2())
280 * momentumTP.z()/
sqrt(momentumTP.perp2());
300 std::vector<std::pair<RefToBase<Track>,
double> > rt;
301 if(simRecColl.
find(tpr) != simRecColl.
end()){
302 rt = (std::vector<std::pair<RefToBase<Track>,
double> >) simRecColl[tpr];
306 matchedTrackPointer = rt.begin()->first.get();
308 <<
" with pt=" <<
sqrt(momentumTP.perp2())
309 <<
" associated with quality:" << rt.begin()->second <<
"\n";
313 <<
"TrackingParticle #" << st
314 <<
" with pt,eta,phi: "
315 <<
sqrt(momentumTP.perp2()) <<
" , "
316 << momentumTP.eta() <<
" , "
317 << momentumTP.phi() <<
" , "
318 <<
" NOT associated to any reco::Track" <<
"\n";
325 int nSimHits = simhits.end()-simhits.begin();
327 double vtx_z_PU = vertexTP.z();
328 for (
size_t j = 0;
j < tv.size();
j++) {
330 vtx_z_PU = tv[
j].position().z();
337 if (matchedTrackPointer) asts++;
351 <<
label[www].process()<<
":"
352 <<
label[www].label()<<
":"
353 <<
label[www].instance()
354 <<
": " << trackCollection->size() <<
"\n";
366 std::vector<edm::ValueMap<reco::DeDxData> > v_dEdx;
375 v_dEdx.push_back(dEdx1);
376 v_dEdx.push_back(dEdx2);
378 LogTrace(
"TrackValidator") <<
"exception found: " << e.
what() <<
"\n";
388 bool isSigSimMatched(
false);
389 bool isSimMatched(
false);
390 bool isChargeMatched(
true);
391 int numAssocRecoTracks = 0;
394 double sharedFraction = 0.;
395 std::vector<std::pair<TrackingParticleRef, double> > tp;
396 if(recSimColl.
find(track) != recSimColl.
end()){
397 tp = recSimColl[track];
399 std::vector<PSimHit> simhits=tp[0].first->trackPSimHit(
DetId::Tracker);
400 nSimHits = simhits.
end()-simhits.begin();
401 sharedFraction = tp[0].second;
403 if (tp[0].
first->charge() != track->
charge()) isChargeMatched =
false;
404 if(simRecColl.
find(tp[0].first) != simRecColl.
end()) numAssocRecoTracks = simRecColl[tp[0].
first].
size();
406 tpbx = tp[0].first->eventId().bunchCrossing();
408 for (
unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
411 isSigSimMatched =
true;
416 edm::LogVerbatim(
"TrackValidator") <<
"reco::Track #" << rT <<
" with pt=" << track->
pt()
417 <<
" associated with quality:" << tp.begin()->second <<
"\n";
420 edm::LogVerbatim(
"TrackValidator") <<
"reco::Track #" << rT <<
" with pt=" << track->
pt()
421 <<
" NOT associated to any TrackingParticle" <<
"\n";
425 histoProducerAlgo_->
fill_generic_recoTrack_histos(
w,*track,bs.position(),isSimMatched,isSigSimMatched, isChargeMatched, numAssocRecoTracks, puinfo.getPU_NumInteractions(), tpbx, nSimHits, sharedFraction);
436 if (tp.size()==0)
continue;
460 int chargeTP = tpr->charge();
463 *track,bs.position());
482 <<
"Total Associated (simToReco): " << ats <<
"\n"
483 <<
"Total Reconstructed: " << rT <<
"\n"
484 <<
"Total Associated (recoToSim): " << at <<
"\n"
485 <<
"Total Fakes: " << rT-at <<
"\n";
495 for (
unsigned int ww=0;ww<
associators.size();ww++){
496 for (
unsigned int www=0;www<
label.size();www++){
virtual char const * what() const
T getParameter(std::string const &) const
void endRun(edm::Run const &, edm::EventSetup const &)
Method called at the end of the event loop.
int event() const
get the contents of the subdetector field (should be protected?)
bool ignoremissingtkcollection_
CosmicTrackingParticleSelector cosmictpSelector
std::vector< TrackingParticle > TrackingParticleCollection
const_iterator end() const
last iterator over the map (read only)
virtual void fill_dedx_recoTrack_histos(int count, edm::RefToBase< reco::Track > &trackref, std::vector< edm::ValueMap< reco::DeDxData > > v_dEdx)=0
const std::vector< PSimHit > & trackPSimHit() const
void cd(void)
go to top directory (ie. root)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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
std::vector< const TrackAssociatorBase * > associator
void analyze(const edm::Event &, const edm::EventSetup &)
Method called once per event.
virtual void bookSimHistos()=0
void beginRun(edm::Run const &, edm::EventSetup const &)
Method called before the event loop.
math::XYZVectorD Vector
point in the space
virtual void fill_generic_simTrack_histos(int counter, ParticleBase::Vector, ParticleBase::Point vertex, int bx)=0
virtual void fill_recoAssociated_simTrack_histos(int count, const TrackingParticle &tp, ParticleBase::Vector momentumTP, ParticleBase::Point vertexTP, double dxy, double dz, int nSimHits, const reco::Track *track, int numVertices, double vertz)=0
virtual void bookRecoHistos()=0
virtual void fill_ResoAndPull_recoTrack_histos(int count, ParticleBase::Vector momentumTP, ParticleBase::Point vertexTP, int chargeTP, const reco::Track &track, math::XYZPoint bsPosition)=0
virtual void fill_generic_recoTrack_histos(int count, const reco::Track &track, math::XYZPoint bsPosition, bool isMatched, bool isSigMatched, bool isChargeMatched, int numAssocRecoTracks, int numVertices, int tpbunchcrossing, int nSimHits, double sharedFraction)=0
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
math::XYZPointD Point
point in the space
std::vector< edm::InputTag > label
edm::InputTag label_tp_fake
int bunchCrossing() const
get the detector field from this detid
double pt() const
track transverse momentum
TrackingParticleSelector tpSelector
Cos< T >::type cos(const T &t)
edm::InputTag associatormap
virtual void fillProfileHistosFromVectors(int counter)=0
virtual void initialize()=0
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
MultiTrackValidator(const edm::ParameterSet &pset)
Constructor.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
ObjectSelector< CosmicTrackingParticleSelector > CosmicTrackingParticleSelector
virtual void finalHistoFits(int counter)=0
edm::InputTag label_pileupinfo
MTVHistoProducerAlgo * histoProducerAlgo_
std::string parametersDefiner
virtual void fill_simAssociated_recoTrack_histos(int count, const reco::Track &track)=0
std::vector< TrackingVertex > TrackingVertexCollection
virtual void fillHistosFromVectors(int counter)=0
T const * product() const
virtual void fill_trackBased_histos(int count, int assTracks, int numRecoTracks, int numSimTracks)=0
Vector momentum() const
spatial momentum vector
T const * product() const
EncodedEventId eventId() const
virtual void bookRecoHistosForStandaloneRunning()=0
void goUp(void)
equivalent to "cd .."
int charge() const
track electric charge
std::vector< std::string > associators
T const * get() const
Returns C++ pointer to the item.
const Point & vertex() const
vertex position
edm::InputTag label_tp_effic
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)
T get(const Candidate &c)
virtual ~MultiTrackValidator()
Destructor.