41 string histoProducerAlgoName = psetForHistoProducerAlgo.
getParameter<
string>(
"ComponentName");
43 histoProducerAlgo_->setDQMStore(
dbe_);
70 for (
unsigned int www=0;www<
label.size();www++){
78 dirName+=algo.
label()+
"_";
85 if (assoc.find(
"Track")<assoc.length()){
86 assoc.replace(assoc.find(
"Track"),5,
"");
98 string subDirName = dirName +
"/simulation";
121 edm::LogInfo(
"TrackValidator") <<
"\n====================================================" <<
"\n"
122 <<
"Analyzing new event" <<
"\n"
123 <<
"====================================================\n" <<
"\n";
136 if (tPCeff.size()==0) {
edm::LogInfo(
"TrackValidator") <<
"TP Collection for efficiency studies has size = 0! Skipping Event." ;
return;}
137 if (tPCfake.size()==0) {
edm::LogInfo(
"TrackValidator") <<
"TP Collection for fake rate studies has size = 0! Skipping Event." ;
return;}
140 event.getByLabel(
bsSrc,recoBeamSpotHandle);
147 for (
unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){
148 if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){
149 puinfo=(*puinfoH)[puinfo_ite];
159 for (
unsigned int ww=0;ww<
associators.size();ww++){
160 for (
unsigned int www=0;www<
label.size();www++){
162 <<
label[www].process()<<
":"
163 <<
label[www].label()<<
":"
164 <<
label[www].instance()<<
" with "
170 event.getByLabel(
label[www], seedCollection);
171 if (seedCollection->size()==0) {
172 edm::LogInfo(
"TrackValidator") <<
"SeedCollection size = 0!" ;
177 LogTrace(
"TrackValidator") <<
"Calling associateRecoToSim method" <<
"\n";
181 LogTrace(
"TrackValidator") <<
"Calling associateSimToReco method" <<
"\n";
190 edm::LogVerbatim(
"TrackValidator") <<
"\n# of TrackingParticles: " << tPCeff.size() <<
"\n";
198 if (tp->charge()==0)
continue;
207 double dxySim = (-vertex.x()*
sin(momentum.phi())+vertex.y()*
cos(momentum.phi()));
208 double dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/
sqrt(momentum.perp2())
209 * momentum.z()/
sqrt(momentum.perp2());
216 std::vector<std::pair<edm::RefToBase<TrajectorySeed>,
double> > rt;
217 if(simRecColl.
find(tp) != simRecColl.
end()){
221 matchedSeedPointer = rt.begin()->first.get();
223 <<
" with pt=" <<
sqrt(tp->momentum().perp2())
224 <<
" associated with quality:" << rt.begin()->second <<
"\n";
228 <<
" with pt=" <<
sqrt(tp->momentum().perp2())
229 <<
" NOT associated to any TrajectorySeed" <<
"\n";
232 int nSimHits = tp->numberOfTrackerHits();
234 double vtx_z_PU = tp->vertex().z();
235 for (
size_t j = 0;
j < tv.size();
j++) {
236 if (tp->eventId().event() == tv[
j].eventId().event()) {
237 vtx_z_PU = tv[
j].position().z();
245 if (matchedSeedPointer) {
250 if(!(tsAtClosestApproachSeed.isValid())){
251 edm::LogVerbatim(
"SeedValidator")<<
"TrajectoryStateClosestToBeamLine not valid";
255 tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
256 tsAtClosestApproachSeed.trackStateAtPCA().position().z());
258 tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
259 tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
262 matchedTrackPointer =
new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
270 if (matchedTrackPointer) asts++;
278 <<
label[www].process()<<
":"
279 <<
label[www].label()<<
":"
280 <<
label[www].instance()
281 <<
": " << seedCollection->size() <<
"\n";
295 if(!(tsAtClosestApproachSeed.isValid())){
296 edm::LogVerbatim(
"SeedValidator")<<
"TrajectoryStateClosestToBeamLine not valid";
300 tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
301 tsAtClosestApproachSeed.trackStateAtPCA().position().z());
303 tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
304 tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
309 reco::Track* trackFromSeed =
new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
312 bool isSigSimMatched(
false);
313 bool isSimMatched(
false);
314 bool isChargeMatched(
true);
315 int numAssocSeeds = 0;
318 double sharedFraction = 0.;
319 std::vector<std::pair<TrackingParticleRef, double> > tp;
320 if(recSimColl.
find(seed) != recSimColl.
end()) {
321 tp = recSimColl[seed];
324 nSimHits = tp[0].first->numberOfTrackerHits();
325 sharedFraction = tp[0].second;
328 if(simRecColl.
find(tp[0].first) != simRecColl.
end()) numAssocSeeds = simRecColl[tp[0].
first].
size();
330 tpbx = tp[0].first->eventId().bunchCrossing();
334 for (
unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
337 isSigSimMatched =
true;
344 edm::LogVerbatim(
"SeedValidator") <<
"TrajectorySeed #" << rT <<
" associated with quality:" << tp.begin()->second <<
"\n";
347 edm::LogVerbatim(
"SeedValidator") <<
"TrajectorySeed #" << rT <<
" NOT associated to any TrackingParticle" <<
"\n";
352 tpbx, nSimHits, sharedFraction);
356 if (tp.size()==0)
continue;
403 LogTrace(
"SeedValidator") <<
"exception found: " << e.
what() <<
"\n";
410 <<
"Total Associated (simToReco): " << ats <<
"\n"
411 <<
"Total Reconstructed: " << rT <<
"\n"
412 <<
"Total Associated (recoToSim): " << at <<
"\n"
413 <<
"Total Fakes: " << rT-at <<
"\n";
420 LogTrace(
"SeedValidator") <<
"TrackerSeedValidator::endRun()";
422 for (
unsigned int ww=0;ww<
associators.size();ww++){
423 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?)
std::vector< TrackingParticle > TrackingParticleCollection
const_iterator end() const
last iterator over the map (read only)
void cd(void)
go to top directory (ie. root)
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
virtual void bookSimHistos()=0
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
virtual void bookRecoHistos()=0
TrackingParticleSelector tpSelector
math::XYZPointD Point
point in the space
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
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
edm::InputTag label_tp_fake
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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
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)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
virtual void fillProfileHistosFromVectors(int counter)=0
virtual void initialize()=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
virtual void finalHistoFits(int counter)=0
edm::InputTag label_pileupinfo
void setHitPattern(const C &c)
set hit patterns from vector of hit references
std::string parametersDefiner
PTrajectoryStateOnDet const & startingState() const
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
T const * product() const
TrackCharge charge() const
Charge (-1, 0 or 1)
const int getPU_NumInteractions() const
EncodedEventId eventId() const
Signal source, crossing number.
virtual void bookRecoHistosForStandaloneRunning()=0
void goUp(void)
equivalent to "cd .."
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::InputTag label_tp_effic
math::XYZVector Vector
spatial vector
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)
const LocalTrajectoryParameters & parameters() const
edm::ESHandle< MagneticField > theMF
void beginRun(edm::Run const &, edm::EventSetup const &)
Method called before the event loop.