38 string histoProducerAlgoName = psetForHistoProducerAlgo.
getParameter<
string>(
"ComponentName");
40 histoProducerAlgo_->setDQMStore(
dbe_);
74 if (!UseAssociators) {
88 for (
unsigned int www=0;www<
label.size();www++){
95 dirName+=algo.
label()+
"_";
98 if (dirName.find(
"Tracks")<dirName.length()){
99 dirName.replace(dirName.find(
"Tracks"),6,
"");
102 if (assoc.find(
"Track")<assoc.length()){
103 assoc.replace(assoc.find(
"Track"),5,
"");
114 string subDirName = dirName +
"/simulation";
139 using namespace reco;
141 edm::LogInfo(
"TrackValidator") <<
"\n====================================================" <<
"\n"
142 <<
"Analyzing new event" <<
"\n"
143 <<
"====================================================\n" <<
"\n";
161 event.getByLabel(
bsSrc,recoBeamSpotHandle);
165 for (
unsigned int ww=0;ww<
associators.size();ww++){
166 for (
unsigned int www=0;www<
label.size();www++){
181 <<
label[www].process()<<
":"
182 <<
label[www].label()<<
":"
183 <<
label[www].instance()<<
" with "
186 LogTrace(
"TrackValidator") <<
"Calling associateRecoToSim method" <<
"\n";
187 recSimColl=
associator[ww]->associateRecoToSim(trackCollection,
190 LogTrace(
"TrackValidator") <<
"Calling associateSimToReco method" <<
"\n";
191 simRecColl=
associator[ww]->associateSimToReco(trackCollection,
197 <<
label[www].process()<<
":"
198 <<
label[www].label()<<
":"
199 <<
label[www].instance()<<
" with "
206 simRecColl= *(simtorecoCollectionH.
product());
210 recSimColl= *(recotosimCollectionH.
product());
221 edm::LogVerbatim(
"TrackValidator") <<
"\n# of TrackingParticles: " << tPCeff.size() <<
"\n";
243 dxySim = (-vertex.x()*
sin(momentum.phi())+vertex.y()*
cos(momentum.phi()));
244 dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/
sqrt(momentum.perp2())
245 * momentum.z()/
sqrt(momentum.perp2());
251 momentumTP = parametersDefinerTP->momentum(event,setup,*tp);
252 vertexTP = parametersDefinerTP->vertex(event,setup,*tp);
253 dxySim = (-vertexTP.x()*
sin(momentumTP.phi())+vertexTP.y()*
cos(momentumTP.phi()));
254 dzSim = vertexTP.z() - (vertexTP.x()*momentumTP.x()+vertexTP.y()*momentumTP.y())/
sqrt(momentumTP.perp2())
255 * momentumTP.z()/
sqrt(momentumTP.perp2());
273 bool isRecoMatched(
false);
275 std::vector<std::pair<RefToBase<Track>,
double> > rt;
276 if(simRecColl.
find(tpr) != simRecColl.
end()){
277 rt = (std::vector<std::pair<RefToBase<Track>,
double> >) simRecColl[tpr];
280 isRecoMatched =
true; matchedTrackPointer = rt.begin()->first.get();
282 <<
" with pt=" <<
sqrt(momentumTP.perp2())
283 <<
" associated with quality:" << rt.begin()->second <<
"\n";
287 <<
"TrackingParticle #" << st
288 <<
" with pt,eta,phi: "
289 <<
sqrt(momentumTP.perp2()) <<
" , "
290 << momentumTP.eta() <<
" , "
291 << momentumTP.phi() <<
" , "
292 <<
" NOT associated to any reco::Track" <<
"\n";
299 int nSimHits = simhits.end()-simhits.begin();
315 <<
label[www].process()<<
":"
316 <<
label[www].label()<<
":"
317 <<
label[www].instance()
318 <<
": " << trackCollection->size() <<
"\n";
329 std::vector<edm::ValueMap<reco::DeDxData> > v_dEdx;
338 v_dEdx.push_back(dEdx1);
339 v_dEdx.push_back(dEdx2);
341 LogTrace(
"TrackValidator") <<
"exception found: " << e.
what() <<
"\n";
350 bool isSimMatched(
false);
351 std::vector<std::pair<TrackingParticleRef, double> > tp;
352 if(recSimColl.
find(track) != recSimColl.
end()){
353 tp = recSimColl[track];
357 edm::LogVerbatim(
"TrackValidator") <<
"reco::Track #" << rT <<
" with pt=" << track->
pt()
358 <<
" associated with quality:" << tp.begin()->second <<
"\n";
361 edm::LogVerbatim(
"TrackValidator") <<
"reco::Track #" << rT <<
" with pt=" << track->
pt()
362 <<
" NOT associated to any TrackingParticle" <<
"\n";
377 if (tp.size()==0)
continue;
401 int chargeTP = tpr->charge();
404 *track,bs.position());
426 <<
"Total Associated (simToReco): " << ats <<
"\n"
427 <<
"Total Reconstructed: " << rT <<
"\n"
428 <<
"Total Associated (recoToSim): " << at <<
"\n"
429 <<
"Total Fakes: " << rT-at <<
"\n";
438 for (
unsigned int ww=0;ww<
associators.size();ww++){
439 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.
bool ignoremissingtkcollection_
CosmicTrackingParticleSelector cosmictpSelector
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")
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 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
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
math::XYZPointD Point
point in the space
virtual void fill_generic_recoTrack_histos(int count, const reco::Track &track, math::XYZPoint bsPosition, bool isMatched)=0
std::vector< edm::InputTag > label
edm::InputTag label_tp_fake
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 fill_generic_simTrack_histos(int counter, ParticleBase::Vector, ParticleBase::Point vertex)=0
virtual void finalHistoFits(int counter)=0
MTVHistoProducerAlgo * histoProducerAlgo_
std::string parametersDefiner
virtual void fill_simAssociated_recoTrack_histos(int count, const reco::Track &track)=0
virtual void fillHistosFromVectors(int counter)=0
T const * product() const
Vector momentum() const
spatial momentum vector
T const * product() const
virtual void bookRecoHistosForStandaloneRunning()=0
void goUp(void)
equivalent to "cd .."
std::vector< std::string > associators
std::vector< TrackingParticle > TrackingParticleCollection
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="")
void setCurrentFolder(const std::string &fullpath)
T get(const Candidate &c)
virtual ~MultiTrackValidator()
Destructor.
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)=0