Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:59

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