Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-23 22:52:45

0001 #ifndef CalibTracker_SiStripLorentzAngle_SiStripLAProfileBooker_h
0002 #define CalibTracker_SiStripLorentzAngle_SiStripLAProfileBooker_h
0003 
0004 #include <map>
0005 
0006 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 
0009 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0010 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0011 
0012 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0013 #include "MagneticField/Engine/interface/MagneticField.h"
0014 
0015 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0016 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0017 
0018 #include "CalibTracker/Records/interface/SiStripDetCablingRcd.h"
0019 #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h"
0020 
0021 #include "DQMServices/Core/interface/DQMStore.h"
0022 
0023 #include "DataFormats/DetId/interface/DetId.h"
0024 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0025 
0026 #include <TTree.h>
0027 #include <TFile.h>
0028 #include <TH1D.h>
0029 #include <TDirectory.h>
0030 
0031 class TrackerTopology;
0032 
0033 class SiStripLAProfileBooker : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0034 public:
0035   typedef dqm::legacy::MonitorElement MonitorElement;
0036   typedef dqm::legacy::DQMStore DQMStore;
0037   explicit SiStripLAProfileBooker(const edm::ParameterSet& conf);
0038 
0039   ~SiStripLAProfileBooker() override;
0040 
0041   void beginRun(edm::Run const&, const edm::EventSetup& c) override;
0042 
0043   void endRun(edm::Run const&, const edm::EventSetup& c) override;
0044 
0045   void endJob() override;
0046 
0047   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0048 
0049   void getlayer(const DetId& detid, const TrackerTopology* tTopo, std::string& name, unsigned int& layerid);
0050 
0051 private:
0052   typedef struct {
0053     float thickness;
0054     float pitch;
0055     LocalVector magfield;
0056   } detparameters;
0057   typedef std::map<unsigned int, detparameters*> detparmap;
0058   typedef std::map<unsigned int, MonitorElement*> histomap;
0059 
0060   int trackcollsize, trajsize, RunNumber, EventNumber, ClSize, HitCharge, Type, Layer, Wheel, bw_fw, Ext_Int,
0061       MonoStereo, ParticleCharge;
0062   float sumx, hit_std_dev, barycenter, TanTrackAngle, TanTrackAngleParallel, SignCorrection, MagField, XGlobal, YGlobal,
0063       ZGlobal, Momentum, pt, chi2norm, EtaTrack, PhiTrack;
0064   int nstrip, eventcounter, size, HitNr, hitcounter, hitcounter_2ndloop, worse_double_hit, better_double_hit,
0065       HitPerTrack;
0066   int id_detector, TrackCounter, EventCounter;
0067   float thick_detector, pitch_detector;
0068   uint8_t Amplitudes[100];
0069 
0070   TTree *HitsTree, *TrackTree, *EventTree;
0071   TFile* hFile;
0072 
0073   TDirectory *Hit_Tree, *Track_Tree, *Event_Tree;
0074 
0075   histomap histos;
0076   histomap summaryhisto;
0077 
0078   DQMStore* dbe_;
0079 
0080   detparmap detmap;
0081   detparmap summarydetmap;
0082   edm::ParameterSet conf_;
0083   std::string treename_;
0084 
0085   const TrackerGeometry* tkGeom_ = nullptr;
0086   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0087   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
0088   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_;
0089   edm::ESGetToken<SiStripDetCabling, SiStripDetCablingRcd> detCablingToken_;
0090 };
0091 
0092 #endif