36 : theDQMRootFileName(iConfig.getParameter<std::
string>(
"DQMRootFileName"))
38 , recoRecoToSimCollectionToken_( consumes<
reco::
RecoToSimCollection>( edm::InputTag( std::
string(
"trackingParticleRecoTrackAsssociation" ) ) ) )
39 , recoSimToRecoCollectionToken_( consumes<
reco::
SimToRecoCollection>( edm::InputTag( std::
string(
"trackingParticleRecoTrackAsssociation" ) ) ) )
41 , std::
string(
"MergedTrackTruth" )
46 , std::
string(
"MergedTrackTruth" )
50 , edmView_recoTrack_Token_( consumes< edm::
View<
reco::Track> >( edm::InputTag( std::
string(
"generalTracks" ) ) ) )
53 , vec_recoVertex_Token_( consumes< std::vector<
reco::Vertex> >( edm::InputTag( std::
string(
"offlinePrimaryVertices" ) ) ) )
82 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
84 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
86 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
89 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
91 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
93 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);
96 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
98 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
100 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
103 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
105 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
107 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
111 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
113 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
115 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
119 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
121 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
123 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
127 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
129 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
131 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
134 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
136 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
138 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
142 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
144 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
146 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
150 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
152 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
154 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
162 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
164 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
166 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
168 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
170 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
172 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
175 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
177 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
179 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
181 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
183 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
185 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
188 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
190 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
192 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
195 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
197 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
199 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
201 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
203 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
205 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
208 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
210 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
212 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
214 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
216 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
218 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
221 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
223 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
225 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
228 subDirName =
dirName +
"/Other";
232 "Number of K^{0}_{S} found per event", 60, 0., 60.);
234 "Number of #Lambda^{0} found per event", 60, 0., 60.);
237 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
239 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
241 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
243 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
245 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
247 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
249 "Resolution of absolute distance from primary vertex to V0 vertex",
252 "Resolution of absolute distance from primary vertex to V0 vertex",
256 "Fake type by cand status",
259 "Fake type by cand status",
262 double minKsMass = 0.49767 - 0.07;
263 double maxKsMass = 0.49767 + 0.07;
264 double minLamMass = 1.1156 - 0.05;
265 double maxLamMass = 1.1156 + 0.05;
266 int ksMassNbins = 100;
267 double ksMassXmin = minKsMass;
268 double ksMassXmax = maxKsMass;
269 int lamMassNbins = 100;
270 double lamMassXmin = minLamMass;
271 double lamMassXmax = maxLamMass;
275 ksMassNbins, minKsMass, maxKsMass);
277 "Mass of good reco K0S",
278 ksMassNbins, minKsMass, maxKsMass);
280 "Mass of fake Lambda",
281 lamMassNbins, minLamMass, maxLamMass);
283 "Mass of good Lambda",
284 lamMassNbins, minLamMass, maxLamMass);
287 "Invariant mass of all K0S",
288 ksMassNbins, ksMassXmin, ksMassXmax);
290 "Invariant mass of all #Lambda^{0}",
291 lamMassNbins, lamMassXmin, lamMassXmax);
294 "Production radius of daughter particle of Ks fake",
297 "Production radius of daughter particle of Lam fake",
529 std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
530 for(std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
531 iVtx < primaryVtxCollectionH->end();
533 if(primaryVtxCollectionH->size() > 1) {
534 if(iVtx->tracksSize() > iVtxPH->tracksSize()) {
558 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueK0s;
559 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueLams;
560 std::vector<double> trueKsMasses;
561 std::vector<double> trueLamMasses;
594 double numK0sFound = 0.;
596 std::vector<double> radDist;
599 if ( k0sCollection->size() > 0 ) {
602 vector<reco::TrackRef> theDaughterTracks;
603 for( reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
604 iK0s != k0sCollection->end();
618 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(0)) )).track() );
619 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(1)) )).track() );
622 for (
int itrack = 0; itrack < 2; itrack++) {
626 std::vector< std::pair<TrackingParticleRef, double> > tp;
638 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
640 tp = (*recotosimCollectionH)[track];
641 if (tp.size() != 0) {
643 tpref = tp.begin()->first;
646 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
651 if(parentVertex.
isNonnull()) radDist.push_back(parentVertex->position().R());
655 if( k0sVtx->position() == parentVertex->position() ) {
656 if( parentVertex->nDaughterTracks() == 2 ) {
657 if( parentVertex->nSourceTracks() == 0 ) {
663 iTP != parentVertex->sourceTracks_end(); iTP++) {
664 if( (*iTP)->pdgId() == 310 ) {
669 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
671 trueK0s.push_back(pair);
672 trueKsMasses.push_back(mass);
676 if( (*iTP)->pdgId() == 3122 ) {
694 k0sVtx = parentVertex;
705 theDaughterTracks.clear();
709 theDaughterTracks.clear();
718 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
735 nKs->
Fill( (
float) numK0sFound );
740 double numLamFound = 0.;
744 if ( lambdaCollection->size() > 0 ) {
747 vector<reco::TrackRef> theDaughterTracks;
748 for( reco::VertexCompositeCandidateCollection::const_iterator iLam = lambdaCollection->begin();
749 iLam != lambdaCollection->end();
761 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(0)) )).track() );
762 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(1)) )).track() );
764 for (
int itrack = 0; itrack < 2; itrack++) {
768 std::vector< std::pair<TrackingParticleRef, double> > tp;
779 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
781 tp = (*recotosimCollectionH)[track];
782 if (tp.size() != 0) {
784 tpref = tp.begin()->first;
787 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
791 if( parentVertex.
isNonnull() ) radDist.push_back(parentVertex->position().R());
795 if( LamVtx->position() == parentVertex->position() ) {
796 if( parentVertex->nDaughterTracks() == 2 ) {
797 if( parentVertex->nSourceTracks() == 0 ) {
803 iTP != parentVertex->sourceTracks_end(); ++iTP) {
804 if(
abs((*iTP)->pdgId()) == 3122 ) {
808 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
810 trueLams.push_back(pair);
811 trueLamMasses.push_back(mass);
815 if(
abs((*iTP)->pdgId() ) == 310 ) {
836 LamVtx = parentVertex;
846 theDaughterTracks.clear();
849 theDaughterTracks.clear();
865 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
896 if( (itp1->
pdgId() == 211 || itp1->
pdgId() == 2212)
900 bool isLambda =
false;
901 if( itp1->
pdgId() == 2212 ) isLambda =
true;
906 iTP1 != piCand1Vertex->sourceTracks_end(); iTP1++) {
907 if(
abs((*iTP1)->pdgId()) == 3122 ) {
916 if (isLambda) particle2pdgId = -211;
917 else particle2pdgId = -2212;
918 if( itp2->
pdgId() == particle2pdgId
926 iTP2 != piCand2Vertex->sourceTracks_end();
935 if(
abs((*iTP2)->pdgId()) == 3122 ) {
942 if(trueLams.size() > 0) {
944 for(std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueLams.begin();
945 iEffCheck != trueLams.end();
948 if( itp1->
parentVertex() == iEffCheck->first->parentVertex()
949 && itp2->
parentVertex() == iEffCheck->second->parentVertex() ) {
969 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt1;
970 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt2;
973 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
975 rt1 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
976 if(rt1.size() != 0) {
985 if( (simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end()) ) {
987 rt2 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
988 if(rt2.size() != 0) {
1019 if(
abs(LamGenEta) > 0.) {
1055 if ( itp1->
pdgId() == 211
1063 iTP1 != piCand1Vertex->sourceTracks_end(); ++iTP1) {
1065 if ( (*iTP1)->pdgId()==310 ) {
1078 iTP2 != piCand2Vertex->sourceTracks_end(); ++iTP2) {
1082 if( (*iTP2)->pdgId() == 310 ) {
1088 if( trueK0s.size() > 0 ) {
1089 for( std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueK0s.begin();
1090 iEffCheck != trueK0s.end();
1093 if (itp1->
parentVertex()==iEffCheck->first->parentVertex() &&
1094 itp2->
parentVertex()==iEffCheck->second->parentVertex()) {
1114 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt1;
1115 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt2;
1118 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
1119 rt1 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
1121 if(rt1.size() != 0) {
1133 if( simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end() ) {
1134 rt2 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
1136 if(rt2.size() != 0) {
1168 if(
abs(K0sGenEta) > 0.) {
MonitorElement * ksTkFakeVsPt
edm::EDGetTokenT< edm::SimVertexContainer > edmSimVertexContainerToken_
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
MonitorElement * lamTkFakeVsR_num
MonitorElement * ksEffVsR
unsigned int K0sCandStatus
edm::EDGetTokenT< reco::SimToRecoCollection > recoSimToRecoCollectionToken_
V0Validator(const edm::ParameterSet &)
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_k0s_Token_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< TrackingParticle > TrackingParticleCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * ksFakeVsPt_denom
void cd(void)
go to top directory (ie. root)
MonitorElement * lamTkEffVsR
int pdgId() const
PDG ID.
Point vertex() const
Parent vertex position.
MonitorElement * lamFakeVsPt
MonitorElement * ksTkFakeVsEta
MonitorElement * ksFakeVsR_denom
MonitorElement * ksFakeVsEta_num
unsigned int LamPiCandStatus[2]
MonitorElement * lamEffVsEta_num
std::vector< Vertex > VertexCollection
collection of Vertex objects
MonitorElement * lamFakeVsPt_denom
const double piMassSquared
MonitorElement * ksEffVsR_num
MonitorElement * ksFakeVsPt_num
MonitorElement * lamFakeVsR_denom
MonitorElement * lamEffVsPt_denom
unsigned int K0sPiCandStatus[2]
MonitorElement * lamEffVsPt_num
MonitorElement * lamTkFakeVsR
MonitorElement * lamFakeVsR
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * ksFakeVsEta
MonitorElement * lamZResolution
MonitorElement * lamFakeDauRadDist
MonitorElement * lamTkEffVsEta
MonitorElement * lamEffVsR
MonitorElement * ksFakeVsEta_denom
bool isNonnull() const
Checks for non-null.
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_
MonitorElement * fakeLamMass
MonitorElement * ksFakeDauRadDist
MonitorElement * lamTkFakeVsEta_num
edm::RefVector< edm::HepMCProduct, HepMC::GenVertex > GenVertexRefVector
MonitorElement * lamTkFakeVsPt
MonitorElement * ksEffVsPt_denom
auto const T2 &decltype(t1.eta()) t2
MonitorElement * ksTkFakeVsEta_num
MonitorElement * ksTkEffVsR_num
MonitorElement * lamFakeVsEta_denom
const double protonMassSquared
MonitorElement * lamXResolution
MonitorElement * ksEffVsEta_denom
MonitorElement * lamTkEffVsPt
Abs< T >::type abs(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")
MonitorElement * goodKsMass
MonitorElement * fakeKsMass
edm::EDGetTokenT< std::vector< reco::Vertex > > vec_recoVertex_Token_
MonitorElement * ksTkEffVsPt
MonitorElement * goodLamMass
MonitorElement * ksFakeVsPt
edm::Ref< TrackingVertexCollection > TrackingVertexRef
unsigned int LamGenStatus
edm::EDGetTokenT< edm::SimTrackContainer > edmSimTrackContainerToken_
MonitorElement * lamTkFakeVsEta
unsigned int K0sGenStatus
MonitorElement * ksMassAll
MonitorElement * lamTkEffVsR_num
MonitorElement * ksTkEffVsR
MonitorElement * lamTkEffVsEta_num
MonitorElement * ksXResolution
MonitorElement * lamEffVsEta_denom
std::vector< TrackingVertex > TrackingVertexCollection
std::vector< SimVertex > SimVertexContainer
MonitorElement * lamFakeVsEta
MonitorElement * ksAbsoluteDistResolution
edm::AssociationMap< edm::OneToManyWithQualityGeneric< edm::View< reco::Track >, TrackingParticleCollection, double > > RecoToSimCollection
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollection_Eff_Token_
MonitorElement * ksCandStatus
MonitorElement * lamCandStatus
MonitorElement * lamEffVsEta
MonitorElement * lamTkFakeVsPt_num
MonitorElement * lamFakeVsEta_num
std::string theDQMRootFileName
MonitorElement * ksTkEffVsPt_num
MonitorElement * lamFakeVsPt_num
MonitorElement * lamMassAll
MonitorElement * lamFakeVsR_num
edm::EDGetTokenT< edm::View< reco::Track > > edmView_recoTrack_Token_
const TrackingVertexRef & parentVertex() const
MonitorElement * lamEffVsR_num
MonitorElement * ksFakeVsR
MonitorElement * ksEffVsEta
MonitorElement * lamTkEffVsPt_num
Vector momentum() const
spatial momentum vector
edm::EDGetTokenT< reco::RecoToSimCollection > recoRecoToSimCollectionToken_
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_lambda_Token_
edm::AssociationMap< edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double > > SimToRecoCollection
MonitorElement * lamAbsoluteDistResolution
MonitorElement * ksZResolution
unsigned int LamCandStatus
Monte Carlo truth information used for tracking validation.
MonitorElement * ksEffVsPt_num
MonitorElement * ksTkEffVsEta_num
MonitorElement * lamEffVsPt
MonitorElement * ksEffVsR_denom
MonitorElement * ksTkFakeVsPt_num
MonitorElement * ksTkEffVsEta
MonitorElement * ksFakeVsR_num
MonitorElement * ksEffVsEta_num
virtual void endRun(const edm::Run &, const edm::EventSetup &)
T const * get() const
Returns C++ pointer to the item.
MonitorElement * lamYResolution
MonitorElement * ksEffVsPt
std::vector< SimTrack > SimTrackContainer
edm::RefVector< edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector
void setCurrentFolder(const std::string &fullpath)
MonitorElement * ksTkFakeVsR
MonitorElement * ksYResolution
MonitorElement * lamEffVsR_denom
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * ksTkFakeVsR_num