32 : theDQMRootFileName(iConfig.getParameter<std::
string>(
"DQMRootFileName"))
34 , recoRecoToSimCollectionToken_( consumes<
reco::
RecoToSimCollection>( edm::InputTag( std::
string(
"trackingParticleRecoTrackAsssociation" ) ) ) )
35 , recoSimToRecoCollectionToken_( consumes<
reco::
SimToRecoCollection>( edm::InputTag( std::
string(
"trackingParticleRecoTrackAsssociation" ) ) ) )
37 , std::
string(
"MergedTrackTruth" )
42 , std::
string(
"MergedTrackTruth" )
46 , edmView_recoTrack_Token_( consumes< edm::
View<
reco::Track> >( edm::InputTag( std::
string(
"generalTracks" ) ) ) )
49 , vec_recoVertex_Token_( consumes< std::vector<
reco::Vertex> >( edm::InputTag( std::
string(
"offlinePrimaryVertices" ) ) ) )
78 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
80 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
82 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
85 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
87 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
89 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);
92 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
94 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
96 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
99 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
101 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
103 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
107 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
109 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
111 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
115 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
117 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
119 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
123 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
125 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
127 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
130 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
132 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
134 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
138 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
140 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
142 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
146 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
148 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
150 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
158 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
160 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
162 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
164 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
166 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
168 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
171 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
173 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
175 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
177 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
179 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
181 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
184 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
186 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
188 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
191 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
193 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
195 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
197 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
199 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
201 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
204 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
206 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
208 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
210 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
212 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
214 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
217 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
219 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
221 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
224 subDirName =
dirName +
"/Other";
228 "Number of K^{0}_{S} found per event", 60, 0., 60.);
230 "Number of #Lambda^{0} found per event", 60, 0., 60.);
233 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
235 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
237 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
239 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
241 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
243 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
245 "Resolution of absolute distance from primary vertex to V0 vertex",
248 "Resolution of absolute distance from primary vertex to V0 vertex",
252 "Fake type by cand status",
255 "Fake type by cand status",
258 double minKsMass = 0.49767 - 0.07;
259 double maxKsMass = 0.49767 + 0.07;
260 double minLamMass = 1.1156 - 0.05;
261 double maxLamMass = 1.1156 + 0.05;
262 int ksMassNbins = 100;
263 double ksMassXmin = minKsMass;
264 double ksMassXmax = maxKsMass;
265 int lamMassNbins = 100;
266 double lamMassXmin = minLamMass;
267 double lamMassXmax = maxLamMass;
271 ksMassNbins, minKsMass, maxKsMass);
273 "Mass of good reco K0S",
274 ksMassNbins, minKsMass, maxKsMass);
276 "Mass of fake Lambda",
277 lamMassNbins, minLamMass, maxLamMass);
279 "Mass of good Lambda",
280 lamMassNbins, minLamMass, maxLamMass);
283 "Invariant mass of all K0S",
284 ksMassNbins, ksMassXmin, ksMassXmax);
286 "Invariant mass of all #Lambda^{0}",
287 lamMassNbins, lamMassXmin, lamMassXmax);
290 "Production radius of daughter particle of Ks fake",
293 "Production radius of daughter particle of Lam fake",
525 std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
526 for(std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
527 iVtx < primaryVtxCollectionH->end();
529 if(primaryVtxCollectionH->size() > 1) {
530 if(iVtx->tracksSize() > iVtxPH->tracksSize()) {
554 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueK0s;
555 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueLams;
556 std::vector<double> trueKsMasses;
557 std::vector<double> trueLamMasses;
590 double numK0sFound = 0.;
592 std::vector<double> radDist;
595 if ( k0sCollection->size() > 0 ) {
598 vector<reco::TrackRef> theDaughterTracks;
599 for( reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
600 iK0s != k0sCollection->end();
614 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(0)) )).track() );
615 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(1)) )).track() );
618 for (
int itrack = 0; itrack < 2; itrack++) {
622 std::vector< std::pair<TrackingParticleRef, double> > tp;
634 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
636 tp = (*recotosimCollectionH)[track];
637 if (tp.size() != 0) {
639 tpref = tp.begin()->first;
642 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
647 if(parentVertex.
isNonnull()) radDist.push_back(parentVertex->position().R());
651 if( k0sVtx->position() == parentVertex->position() ) {
652 if( parentVertex->nDaughterTracks() == 2 ) {
653 if( parentVertex->nSourceTracks() == 0 ) {
659 iTP != parentVertex->sourceTracks_end(); iTP++) {
660 if( (*iTP)->pdgId() == 310 ) {
665 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
667 trueK0s.push_back(pair);
668 trueKsMasses.push_back(mass);
672 if( (*iTP)->pdgId() == 3122 ) {
690 k0sVtx = parentVertex;
701 theDaughterTracks.clear();
705 theDaughterTracks.clear();
714 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
731 nKs->
Fill( (
float) numK0sFound );
736 double numLamFound = 0.;
740 if ( lambdaCollection->size() > 0 ) {
743 vector<reco::TrackRef> theDaughterTracks;
744 for( reco::VertexCompositeCandidateCollection::const_iterator iLam = lambdaCollection->begin();
745 iLam != lambdaCollection->end();
757 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(0)) )).track() );
758 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(1)) )).track() );
760 for (
int itrack = 0; itrack < 2; itrack++) {
764 std::vector< std::pair<TrackingParticleRef, double> > tp;
775 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
777 tp = (*recotosimCollectionH)[track];
778 if (tp.size() != 0) {
780 tpref = tp.begin()->first;
783 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
787 if( parentVertex.
isNonnull() ) radDist.push_back(parentVertex->position().R());
791 if( LamVtx->position() == parentVertex->position() ) {
792 if( parentVertex->nDaughterTracks() == 2 ) {
793 if( parentVertex->nSourceTracks() == 0 ) {
799 iTP != parentVertex->sourceTracks_end(); ++iTP) {
800 if(
abs((*iTP)->pdgId()) == 3122 ) {
804 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
806 trueLams.push_back(pair);
807 trueLamMasses.push_back(mass);
811 if(
abs((*iTP)->pdgId() ) == 310 ) {
832 LamVtx = parentVertex;
842 theDaughterTracks.clear();
845 theDaughterTracks.clear();
861 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
892 if( (itp1->
pdgId() == 211 || itp1->
pdgId() == 2212)
896 bool isLambda =
false;
897 if( itp1->
pdgId() == 2212 ) isLambda =
true;
902 iTP1 != piCand1Vertex->sourceTracks_end(); iTP1++) {
903 if(
abs((*iTP1)->pdgId()) == 3122 ) {
912 if (isLambda) particle2pdgId = -211;
913 else particle2pdgId = -2212;
914 if( itp2->
pdgId() == particle2pdgId
922 iTP2 != piCand2Vertex->sourceTracks_end();
931 if(
abs((*iTP2)->pdgId()) == 3122 ) {
938 if(trueLams.size() > 0) {
940 for(std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueLams.begin();
941 iEffCheck != trueLams.end();
944 if( itp1->
parentVertex() == iEffCheck->first->parentVertex()
945 && itp2->
parentVertex() == iEffCheck->second->parentVertex() ) {
965 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt1;
966 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt2;
969 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
971 rt1 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
972 if(rt1.size() != 0) {
981 if( (simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end()) ) {
983 rt2 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
984 if(rt2.size() != 0) {
1015 if(
abs(LamGenEta) > 0.) {
1051 if ( itp1->
pdgId() == 211
1059 iTP1 != piCand1Vertex->sourceTracks_end(); ++iTP1) {
1061 if ( (*iTP1)->pdgId()==310 ) {
1074 iTP2 != piCand2Vertex->sourceTracks_end(); ++iTP2) {
1078 if( (*iTP2)->pdgId() == 310 ) {
1084 if( trueK0s.size() > 0 ) {
1085 for( std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueK0s.begin();
1086 iEffCheck != trueK0s.end();
1089 if (itp1->
parentVertex()==iEffCheck->first->parentVertex() &&
1090 itp2->
parentVertex()==iEffCheck->second->parentVertex()) {
1110 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt1;
1111 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt2;
1114 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
1115 rt1 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
1117 if(rt1.size() != 0) {
1129 if( simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end() ) {
1130 rt2 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
1132 if(rt2.size() != 0) {
1164 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
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
MonitorElement * lamXResolution
MonitorElement * ksEffVsEta_denom
MonitorElement * lamTkEffVsPt
Abs< T >::type abs(const T &t)
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
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
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