Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-16 06:12:14

0001 #ifndef CalibTracker_SiStripLorentzAngle_SiStripCalibLorentzAngle_h
0002 #define CalibTracker_SiStripLorentzAngle_SiStripCalibLorentzAngle_h
0003 
0004 // user includes
0005 #include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
0006 #include "CondFormats/DataRecord/interface/SiStripLorentzAngleRcd.h"
0007 #include "CondFormats/SiStripObjects/interface/SiStripLorentzAngle.h"
0008 #include "DataFormats/Common/interface/Handle.h"
0009 #include "DataFormats/DetId/interface/DetId.h"
0010 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0011 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0012 #include "DQMServices/Core/interface/DQMStore.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0017 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0018 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0019 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0020 #include "MagneticField/Engine/interface/MagneticField.h"
0021 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0022 
0023 // system includes
0024 #include <memory>
0025 #include <cstring>
0026 #include <iostream>
0027 #include <map>
0028 
0029 // ROOT includes
0030 #include <TGraph.h>
0031 #include <TProfile.h>
0032 #include <TStyle.h>
0033 #include <TH1D.h>
0034 #include <TH2D.h>
0035 #include <TF1.h>
0036 #include <TFile.h>
0037 #include <TTree.h>
0038 #include <TGraphErrors.h>
0039 #include <TDirectory.h>
0040 #include "TROOT.h"
0041 
0042 class TrackerTopology;
0043 
0044 class SiStripCalibLorentzAngle : public ConditionDBWriter<SiStripLorentzAngle> {
0045 public:
0046   typedef dqm::legacy::MonitorElement MonitorElement;
0047   typedef dqm::legacy::DQMStore DQMStore;
0048   explicit SiStripCalibLorentzAngle(const edm::ParameterSet &conf);
0049 
0050   ~SiStripCalibLorentzAngle() override;
0051 
0052   std::unique_ptr<SiStripLorentzAngle> getNewObject() override;
0053 
0054   void algoBeginJob(const edm::EventSetup &) override;
0055 
0056 private:
0057   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0058   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
0059   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_;
0060   edm::ESGetToken<SiStripLorentzAngle, SiStripLorentzAngleRcd> lorentzAngleToken_;
0061 
0062   const TrackerGeometry *tkGeom_ = nullptr;
0063   const TrackerTopology *tTopo_ = nullptr;
0064 
0065   typedef std::map<std::string, TProfile *> ProfileMap;
0066   ProfileMap Profiles;
0067   typedef std::map<std::string, TH1D *> TH1Dmap;
0068   TH1Dmap TH1Ds;
0069   typedef std::map<std::string, TH2D *> TH2Dmap;
0070   TH2Dmap TH2Ds;
0071   std::vector<MonitorElement *> histolist;
0072 
0073   TF1 *fitfunc, *fitfunc2IT, *FitFunction2IT, *FitFunction;
0074 
0075   float histoEntries, gR, gphi, geta, gz, globalX, globalY, globalZ, muH, theBfield, AsymmParam;
0076   int goodFit, goodFit1IT, badFit, TIB, TOB, Layer, MonoStereo;
0077   const GlobalPoint gposition;
0078 
0079   float mean_TIB1, mean_TIB2, mean_TIB3, mean_TIB4, mean_TOB1, mean_TOB2, mean_TOB3, mean_TOB4, mean_TOB5, mean_TOB6;
0080 
0081   float hallMobility, meanMobility_TIB, meanMobility_TOB;
0082 
0083   bool LayerDB, CalibByMC;
0084 
0085   TGraphErrors *TIB_graph, *TOB_graph;
0086 
0087   TTree *ModuleTree;
0088   TFile *hFile;
0089 
0090   TDirectory *LorentzAngle_Plots, *Rootple, *MuH, *TIB_MuH, *TOB_MuH, *MuH_vs_Phi, *TIB_Phi, *TOB_Phi, *MuH_vs_Eta,
0091       *TIB_Eta, *TOB_Eta;
0092   TDirectory *FirstIT_GoodFit_Histos, *TIB_1IT_GoodFit, *TOB_1IT_GoodFit, *SecondIT_GoodFit_Histos, *TIB_2IT_GoodFit,
0093       *TOB_2IT_GoodFit, *SecondIT_BadFit_Histos, *TIB_2IT_BadFit, *TOB_2IT_BadFit;
0094 
0095   std::map<uint32_t, float> detid_la;
0096   edm::ParameterSet conf_;
0097 };
0098 
0099 #endif