40 string histoProducerAlgoName = psetForHistoProducerAlgo.
getParameter<
string>(
"ComponentName");
42 histoProducerAlgo_->setDQMStore(
dbe_);
69 for (
unsigned int www=0;www<
label.size();www++){
77 dirName+=algo.
label()+
"_";
84 if (assoc.find(
"Track")<assoc.length()){
85 assoc.replace(assoc.find(
"Track"),5,
"");
97 string subDirName = dirName +
"/simulation";
120 edm::LogInfo(
"TrackValidator") <<
"\n====================================================" <<
"\n"
121 <<
"Analyzing new event" <<
"\n"
122 <<
"====================================================\n" <<
"\n";
135 if (tPCeff.size()==0) {
edm::LogInfo(
"TrackValidator") <<
"TP Collection for efficiency studies has size = 0! Skipping Event." ;
return;}
136 if (tPCfake.size()==0) {
edm::LogInfo(
"TrackValidator") <<
"TP Collection for fake rate studies has size = 0! Skipping Event." ;
return;}
139 event.getByLabel(
bsSrc,recoBeamSpotHandle);
146 for (
unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){
147 if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){
148 puinfo=(*puinfoH)[puinfo_ite];
158 for (
unsigned int ww=0;ww<
associators.size();ww++){
159 for (
unsigned int www=0;www<
label.size();www++){
161 <<
label[www].process()<<
":"
162 <<
label[www].label()<<
":"
163 <<
label[www].instance()<<
" with "
169 event.getByLabel(
label[www], seedCollection);
170 if (seedCollection->size()==0) {
171 edm::LogInfo(
"TrackValidator") <<
"SeedCollection size = 0!" ;
176 LogTrace(
"TrackValidator") <<
"Calling associateRecoToSim method" <<
"\n";
180 LogTrace(
"TrackValidator") <<
"Calling associateSimToReco method" <<
"\n";
189 edm::LogVerbatim(
"TrackValidator") <<
"\n# of TrackingParticles: " << tPCeff.size() <<
"\n";
197 if (tp->charge()==0)
continue;
206 double dxySim = (-vertex.x()*
sin(momentum.phi())+vertex.y()*
cos(momentum.phi()));
207 double dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/
sqrt(momentum.perp2())
208 * momentum.z()/
sqrt(momentum.perp2());
215 std::vector<std::pair<edm::RefToBase<TrajectorySeed>,
double> > rt;
216 if(simRecColl.
find(tp) != simRecColl.
end()){
220 matchedSeedPointer = rt.begin()->first.get();
222 <<
" with pt=" <<
sqrt(tp->momentum().perp2())
223 <<
" associated with quality:" << rt.begin()->second <<
"\n";
227 <<
" with pt=" <<
sqrt(tp->momentum().perp2())
228 <<
" NOT associated to any TrajectorySeed" <<
"\n";
231 int nSimHits = tp->numberOfTrackerHits();
233 double vtx_z_PU = tp->vertex().z();
234 for (
size_t j = 0;
j < tv.size();
j++) {
235 if (tp->eventId().event() == tv[
j].eventId().event()) {
236 vtx_z_PU = tv[
j].position().z();
244 if (matchedSeedPointer) {
249 if(!(tsAtClosestApproachSeed.isValid())){
250 edm::LogVerbatim(
"SeedValidator")<<
"TrajectoryStateClosestToBeamLine not valid";
254 tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
255 tsAtClosestApproachSeed.trackStateAtPCA().position().z());
257 tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
258 tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
261 matchedTrackPointer =
new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
269 if (matchedTrackPointer) asts++;
277 <<
label[www].process()<<
":"
278 <<
label[www].label()<<
":"
279 <<
label[www].instance()
280 <<
": " << seedCollection->size() <<
"\n";
294 if(!(tsAtClosestApproachSeed.isValid())){
295 edm::LogVerbatim(
"SeedValidator")<<
"TrajectoryStateClosestToBeamLine not valid";
299 tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
300 tsAtClosestApproachSeed.trackStateAtPCA().position().z());
302 tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
303 tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
308 reco::Track* trackFromSeed =
new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
311 bool isSigSimMatched(
false);
312 bool isSimMatched(
false);
313 bool isChargeMatched(
true);
314 int numAssocSeeds = 0;
317 double sharedFraction = 0.;
318 std::vector<std::pair<TrackingParticleRef, double> > tp;
319 if(recSimColl.
find(seed) != recSimColl.
end()) {
320 tp = recSimColl[seed];
323 nSimHits = tp[0].first->numberOfTrackerHits();
324 sharedFraction = tp[0].second;
327 if(simRecColl.
find(tp[0].first) != simRecColl.
end()) numAssocSeeds = simRecColl[tp[0].
first].
size();
329 tpbx = tp[0].first->eventId().bunchCrossing();
333 for (
unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
336 isSigSimMatched =
true;
343 edm::LogVerbatim(
"SeedValidator") <<
"TrajectorySeed #" << rT <<
" associated with quality:" << tp.begin()->second <<
"\n";
346 edm::LogVerbatim(
"SeedValidator") <<
"TrajectorySeed #" << rT <<
" NOT associated to any TrackingParticle" <<
"\n";
351 tpbx, nSimHits, sharedFraction);
355 if (tp.size()==0)
continue;
402 LogTrace(
"SeedValidator") <<
"exception found: " << e.
what() <<
"\n";
409 <<
"Total Associated (simToReco): " << ats <<
"\n"
410 <<
"Total Reconstructed: " << rT <<
"\n"
411 <<
"Total Associated (recoToSim): " << at <<
"\n"
412 <<
"Total Fakes: " << rT-at <<
"\n";
419 LogTrace(
"SeedValidator") <<
"TrackerSeedValidator::endRun()";
421 for (
unsigned int ww=0;ww<
associators.size();ww++){
422 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)
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
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
FreeTrajectoryState * freeState(bool withErrors=true) const
edm::InputTag label_tp_fake
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
TrackerSeedValidator(const edm::ParameterSet &pset)
Constructor.
Cos< T >::type cos(const T &t)
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.