Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-16 22:18:31

0001 // system includes
0002 #include <vector>
0003 #include <iostream>
0004 #include <cstdlib>
0005 #include <cstdio>
0006 
0007 // user includes
0008 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0009 #include "DataFormats/Common/interface/Handle.h"
0010 #include "DataFormats/DetId/interface/DetIdCollection.h"
0011 #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementError.h"
0012 #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementVector.h"
0013 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0014 #include "DataFormats/OnlineMetaData/interface/OnlineLuminosityRecord.h"
0015 #include "DataFormats/Scalers/interface/LumiScalers.h"
0016 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
0017 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
0018 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0019 #include "FWCore/Framework/interface/ESHandle.h"
0020 #include "FWCore/Framework/interface/Event.h"
0021 #include "FWCore/Framework/interface/EventSetup.h"
0022 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024 #include "FWCore/ServiceRegistry/interface/Service.h"
0025 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0026 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0027 #include "MagneticField/Engine/interface/MagneticField.h"
0028 #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h"
0029 #include "RecoLocalTracker/Records/interface/TkStripCPERecord.h"
0030 #include "RecoLocalTracker/SiStripClusterizer/interface/SiStripClusterInfo.h"
0031 #include "RecoTracker/Record/interface/CkfComponentsRecord.h"
0032 #include "RecoTracker/SingleTrackPattern/interface/CosmicTrajectoryBuilder.h"
0033 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
0034 #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
0035 #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h"
0036 #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
0037 #include "TrackingTools/TrackFitters/interface/KFTrajectoryFitter.h"
0038 #include "TrackingTools/TrackFitters/interface/KFTrajectorySmoother.h"
0039 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
0040 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
0041 
0042 // ROOT includes
0043 #include "TRandom2.h"
0044 #include "TROOT.h"
0045 #include "TFile.h"
0046 #include "TH1F.h"
0047 #include "TH2F.h"
0048 #include "TTree.h"
0049 
0050 class TrackerTopology;
0051 
0052 class HitEff : public edm::one::EDAnalyzer<> {
0053 public:
0054   explicit HitEff(const edm::ParameterSet& conf);
0055   ~HitEff() override = default;
0056 
0057 private:
0058   void beginJob() override;
0059   void endJob() override;
0060   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0061 
0062   // ----------member data ---------------------------
0063 
0064   const edm::EDGetTokenT<LumiScalersCollection> scalerToken_;
0065   const edm::EDGetTokenT<OnlineLuminosityRecord> metaDataToken_;
0066   const edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > commonModeToken_;
0067 
0068   SiStripClusterInfo siStripClusterInfo_;
0069 
0070   bool addLumi_;
0071   bool addCommonMode_;
0072   bool cutOnTracks_;
0073   unsigned int trackMultiplicityCut_;
0074   bool useFirstMeas_;
0075   bool useLastMeas_;
0076   bool useAllHitsFromTracksWithMissingHits_;
0077 
0078   const edm::EDGetTokenT<reco::TrackCollection> combinatorialTracks_token_;
0079   const edm::EDGetTokenT<std::vector<Trajectory> > trajectories_token_;
0080   const edm::EDGetTokenT<TrajTrackAssociationCollection> trajTrackAsso_token_;
0081   const edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > clusters_token_;
0082   const edm::EDGetTokenT<DetIdCollection> digis_token_;
0083   const edm::EDGetTokenT<MeasurementTrackerEvent> trackerEvent_token_;
0084 
0085   // ES tokens
0086 
0087   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
0088   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
0089   const edm::ESGetToken<StripClusterParameterEstimator, TkStripCPERecord> cpeToken_;
0090   const edm::ESGetToken<SiStripQuality, SiStripQualityRcd> siStripQualityToken_;
0091   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_;
0092   const edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> measurementTkToken_;
0093   const edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> chi2MeasurementEstimatorToken_;
0094   const edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_;
0095 
0096   edm::ParameterSet conf_;
0097 
0098   TTree* traj;
0099   int events, EventTrackCKF;
0100 
0101   int compSettings;
0102   unsigned int layers;
0103   bool DEBUG;
0104   unsigned int whatlayer;
0105 
0106 // Tree declarations
0107 // Trajectory positions for modules included in the study
0108 #ifdef ExtendedCALIBTree
0109   float timeDT, timeDTErr;
0110   int timeDTDOF;
0111   float timeECAL, dedx;
0112   int dedxNOM;
0113   int nLostHits;
0114   float p, chi2;
0115 #endif
0116   float TrajGlbX, TrajGlbY, TrajGlbZ;
0117   float TrajLocX, TrajLocY, TrajLocAngleX, TrajLocAngleY;
0118   float TrajLocErrX, TrajLocErrY;
0119   float ClusterLocX, ClusterLocY, ClusterLocErrX, ClusterLocErrY, ClusterStoN;
0120   float ResX, ResXSig;
0121   unsigned int ModIsBad;
0122   unsigned int Id;
0123   unsigned int SiStripQualBad;
0124   bool withinAcceptance;
0125   bool highPurity;
0126   int nHits;
0127   float pT;
0128   unsigned int trajHitValid, run, event, bunchx;
0129   int tquality;
0130   float instLumi, PU;
0131   float commonMode;
0132 };
0133 
0134 //#endif