41 string histoProducerAlgoName = psetForHistoProducerAlgo.
getParameter<
string>(
"ComponentName");
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,
"");
95 string subDirName = dirName +
"/simulation";
119 edm::LogInfo(
"TrackValidator") <<
"\n====================================================" <<
"\n"
120 <<
"Analyzing new event" <<
"\n"
121 <<
"====================================================\n" <<
"\n";
134 if (tPCeff.size()==0) {
edm::LogInfo(
"TrackValidator") <<
"TP Collection for efficiency studies has size = 0! Skipping Event." ;
return;}
135 if (tPCfake.size()==0) {
edm::LogInfo(
"TrackValidator") <<
"TP Collection for fake rate studies has size = 0! Skipping Event." ;
return;}
138 event.getByToken(
bsSrc,recoBeamSpotHandle);
145 for (
unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){
146 if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){
147 puinfo=(*puinfoH)[puinfo_ite];
157 for (
unsigned int ww=0;ww<
associators.size();ww++){
158 for (
unsigned int www=0;www<
label.size();www++){
160 <<
label[www].process()<<
":"
161 <<
label[www].label()<<
":"
162 <<
label[www].instance()<<
" with "
169 if (seedCollection->size()==0) {
170 edm::LogInfo(
"TrackValidator") <<
"SeedCollection size = 0!" ;
175 LogTrace(
"TrackValidator") <<
"Calling associateRecoToSim method" <<
"\n";
179 LogTrace(
"TrackValidator") <<
"Calling associateSimToReco method" <<
"\n";
188 edm::LogVerbatim(
"TrackValidator") <<
"\n# of TrackingParticles: " << tPCeff.size() <<
"\n";
196 if (tp->charge()==0)
continue;
205 double dxySim = (-vertex.x()*
sin(momentum.phi())+vertex.y()*
cos(momentum.phi()));
206 double dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/
sqrt(momentum.perp2())
207 * momentum.z()/
sqrt(momentum.perp2());
214 std::vector<std::pair<edm::RefToBase<TrajectorySeed>,
double> > rt;
215 if(simRecColl.
find(tp) != simRecColl.
end()){
219 matchedSeedPointer = rt.begin()->first.get();
221 <<
" with pt=" <<
sqrt(tp->momentum().perp2())
222 <<
" associated with quality:" << rt.begin()->second <<
"\n";
226 <<
" with pt=" <<
sqrt(tp->momentum().perp2())
227 <<
" NOT associated to any TrajectorySeed" <<
"\n";
230 int nSimHits = tp->numberOfTrackerHits();
234 if (matchedSeedPointer) {
239 if(!(tsAtClosestApproachSeed.isValid())){
240 edm::LogVerbatim(
"SeedValidator")<<
"TrajectoryStateClosestToBeamLine not valid";
244 tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
245 tsAtClosestApproachSeed.trackStateAtPCA().position().z());
247 tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
248 tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
251 matchedTrackPointer =
new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
260 if (matchedTrackPointer) asts++;
268 <<
label[www].process()<<
":"
269 <<
label[www].label()<<
":"
270 <<
label[www].instance()
271 <<
": " << seedCollection->size() <<
"\n";
285 if(!(tsAtClosestApproachSeed.isValid())){
286 edm::LogVerbatim(
"SeedValidator")<<
"TrajectoryStateClosestToBeamLine not valid";
290 tsAtClosestApproachSeed.trackStateAtPCA().position().y(),
291 tsAtClosestApproachSeed.trackStateAtPCA().position().z());
293 tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(),
294 tsAtClosestApproachSeed.trackStateAtPCA().momentum().z());
299 reco::Track* trackFromSeed =
new reco::Track(0.,0., vSeed1, pSeed, 1, seedPerigeeErrors.covarianceMatrix());
302 bool isSigSimMatched(
false);
303 bool isSimMatched(
false);
304 bool isChargeMatched(
true);
305 int numAssocSeeds = 0;
307 double sharedFraction = 0.;
308 std::vector<std::pair<TrackingParticleRef, double> > tp;
309 if(recSimColl.
find(seed) != recSimColl.
end()) {
310 tp = recSimColl[
seed];
313 nSimHits = tp[0].first->numberOfTrackerHits();
314 sharedFraction = tp[0].second;
317 if(simRecColl.
find(tp[0].first) != simRecColl.
end()) numAssocSeeds = simRecColl[tp[0].
first].
size();
322 for (
unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
325 isSigSimMatched =
true;
332 edm::LogVerbatim(
"SeedValidator") <<
"TrajectorySeed #" << rT <<
" associated with quality:" << tp.begin()->second <<
"\n";
335 edm::LogVerbatim(
"SeedValidator") <<
"TrajectorySeed #" << rT <<
" NOT associated to any TrackingParticle" <<
"\n";
340 isChargeMatched, numAssocSeeds,
342 nSimHits, sharedFraction,
dR);
346 if (tp.size()==0)
continue;
393 LogTrace(
"SeedValidator") <<
"exception found: " << e.
what() <<
"\n";
400 <<
"Total Associated (simToReco): " << ats <<
"\n"
401 <<
"Total Reconstructed: " << rT <<
"\n"
402 <<
"Total Associated (recoToSim): " << at <<
"\n"
403 <<
"Total Fakes: " << rT-at <<
"\n";
410 LogTrace(
"SeedValidator") <<
"TrackerSeedValidator::endRun()";
412 for (
unsigned int ww=0;ww<
associators.size();ww++){
413 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?)
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > label_pileupinfo
std::vector< TrackingParticle > TrackingParticleCollection
const_iterator end() const
last iterator over the map (read only)
edm::EDGetTokenT< TrackingParticleCollection > label_tp_effic
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Method called to book the DQM histograms.
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 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
edm::EDGetTokenT< TrackingVertexCollection > label_tv
virtual void bookRecoHistosForStandaloneRunning(DQMStore::IBooker &ibook)=0
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 dR)=0
TrackingParticleSelector tpSelector
edm::EDGetTokenT< reco::BeamSpot > bsSrc
math::XYZPointD Point
point in the space
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
bool appendHits(const C &c)
append hit patterns from vector of hit references
std::vector< edm::InputTag > label
std::vector< edm::EDGetTokenT< edm::View< TrajectorySeed > > > labelTokenSeed
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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)
virtual void bookRecoHistos(DQMStore::IBooker &ibook)=0
virtual void fillProfileHistosFromVectors(int counter)=0
virtual void initialize()=0
virtual void bookSimHistos(DQMStore::IBooker &ibook)=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
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual void finalHistoFits(int counter)=0
std::string parametersDefiner
PTrajectoryStateOnDet const & startingState() const
void setCurrentFolder(const std::string &fullpath)
virtual void fill_simAssociated_recoTrack_histos(int count, const reco::Track &track)=0
T const * product() const
std::vector< TrackingVertex > TrackingVertexCollection
T const * product() const
virtual void fill_trackBased_histos(int count, int assTracks, int numRecoTracks, int numSimTracks)=0
TrackCharge charge() const
Charge (-1, 0 or 1)
const int getPU_NumInteractions() const
EncodedEventId eventId() const
Signal source, crossing number.
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 nSimHits, double sharedFraction, double dR)=0
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::EDGetTokenT< TrackingParticleCollection > label_tp_fake
math::XYZVector Vector
spatial vector
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
T get(const Candidate &c)
const LocalTrajectoryParameters & parameters() const
edm::ESHandle< MagneticField > theMF