File indexing completed on 2024-04-06 11:57:11
0001 #ifndef Alignment_OfflineValidation_ValidationMisalignedTracker_h
0002 #define Alignment_OfflineValidation_ValidationMisalignedTracker_h
0003
0004
0005 #include <memory>
0006
0007
0008 #include "FWCore/Framework/interface/Frameworkfwd.h"
0009 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0010 #include "FWCore/Framework/interface/ESWatcher.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0013
0014
0015 #include "MagneticField/Engine/interface/MagneticField.h"
0016 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0017 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0018 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0019 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0020 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0021 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0022 #include "DataFormats/TrackReco/interface/Track.h"
0023 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
0024 #include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"
0025 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0026 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
0027 #include "SimDataFormats/Associations/interface/TrackToTrackingParticleAssociator.h"
0028
0029 #include "TTree.h"
0030 #include "TFile.h"
0031
0032 #include "TROOT.h"
0033 #include "TSystem.h"
0034 #include "TCanvas.h"
0035 #include <cmath>
0036 #include "TStyle.h"
0037
0038
0039
0040
0041
0042 class ValidationMisalignedTracker : public edm::one::EDAnalyzer<> {
0043 public:
0044 explicit ValidationMisalignedTracker(const edm::ParameterSet&);
0045 ~ValidationMisalignedTracker() override;
0046 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0047
0048 private:
0049 void analyze(const edm::Event&, const edm::EventSetup&) override;
0050 void endJob() override;
0051
0052
0053
0054 const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
0055 const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_;
0056 const bool selection_eff, selection_fake, ZmassSelection_;
0057 const std::string simobject, trackassociator;
0058 const std::vector<std::string> associators;
0059 const std::vector<edm::InputTag> label;
0060 const edm::InputTag label_tp_effic;
0061 const edm::InputTag label_tp_fake;
0062 const std::string rootfile_;
0063 const edm::EDGetTokenT<edm::HepMCProduct> evtToken_;
0064 const edm::EDGetTokenT<TrackingParticleCollection> tpeffToken_;
0065 const edm::EDGetTokenT<TrackingParticleCollection> tpfakeToken_;
0066 const edm::EDGetTokenT<edm::View<reco::Track>> trackToken_;
0067 const std::vector<edm::EDGetTokenT<reco::TrackToTrackingParticleAssociator>> assocToken_;
0068
0069 bool skip;
0070 int eventCount_;
0071 TTree* tree_eff;
0072 TTree* tree_fake;
0073 TFile* file_;
0074
0075 int irun, ievt;
0076
0077 float mzmu, recmzmu, ptzmu, recptzmu, etazmu, thetazmu, phizmu, recetazmu, recthetazmu, recphizmu;
0078 float recenezmu, enezmu, pLzmu, recpLzmu, yzmu, recyzmu, mxptmu, recmxptmu, minptmu, recminptmu;
0079 int countpart[2], countpartrec[2];
0080 int flag, flagrec, count, countrec;
0081
0082 float ene[2][2], p[2][2], px[2][2], py[2][2], pz[2][2], ptmu[2][2];
0083 float recene[2][2], recp[2][2], recpx[2][2], recpy[2][2], recpz[2][2], recptmu[2][2];
0084
0085 int trackType;
0086 float pt, eta, cottheta, theta, costheta, phi, d0, z0;
0087 int nhit;
0088 float recpt, receta, rectheta, reccottheta, recphi, recd0, recz0;
0089 int nAssoc, recnhit;
0090 float recchiq;
0091 float reseta, respt, resd0, resz0, resphi, rescottheta, eff;
0092
0093 float fakemzmu, fakerecmzmu, fakeptzmu, fakerecptzmu, fakeetazmu, fakethetazmu, fakephizmu, fakerecetazmu,
0094 fakerecthetazmu, fakerecphizmu;
0095 float fakerecenezmu, fakeenezmu, fakepLzmu, fakerecpLzmu, fakeyzmu, fakerecyzmu, fakemxptmu, fakerecmxptmu,
0096 fakeminptmu, fakerecminptmu;
0097 int fakecountpart[2], fakecountpartrec[2], fakeflag, fakeflagrec, fakecount, fakecountsim, fakecountrec;
0098 float fakeene[2][2], fakep[2][2], fakepx[2][2], fakepy[2][2], fakepz[2][2], fakeptmu[2][2];
0099 float fakerecene[2][2], fakerecp[2][2], fakerecpx[2][2], fakerecpy[2][2], fakerecpz[2][2], fakerecptmu[2][2];
0100
0101 int faketrackType;
0102 float fakept, fakeeta, fakecottheta, faketheta, fakecostheta, fakephi, faked0, fakez0;
0103 int fakenhit;
0104 float fakerecpt, fakereceta, fakerectheta, fakereccottheta, fakerecphi, fakerecd0, fakerecz0;
0105 int fakenAssoc, fakerecnhit;
0106 float fakerecchiq;
0107 float fakereseta, fakerespt, fakeresd0, fakeresz0, fakeresphi, fakerescottheta, fake;
0108
0109 double chi2tmp;
0110 float fractiontmp;
0111 bool onlyDiag;
0112
0113 GlobalVector magField;
0114 std::vector<float> ptused;
0115 };
0116
0117 #endif