17 : m_currdir(0), m_maxLS(100), m_weightThreshold(0.5), m_trueOnly(
true)
18 , m_runHisto(
true), m_runHistoProfile(
true), m_runHistoBXProfile(
true), m_runHistoBXProfile2D(
false), m_runHisto2D(
false)
19 , m_bsConstrained(
false)
20 , m_histoParameters() { }
24 , m_maxLS(iConfig.getParameter<unsigned int>(
"maxLSBeforeRebin"))
25 , m_weightThreshold(iConfig.getUntrackedParameter<double>(
"weightThreshold",0.5))
26 , m_trueOnly(iConfig.getUntrackedParameter<bool>(
"trueOnly",
true))
27 , m_runHisto(iConfig.getUntrackedParameter<bool>(
"runHisto",
true))
28 , m_runHistoProfile(iConfig.getUntrackedParameter<bool>(
"runHistoProfile",
true))
29 , m_runHistoBXProfile(iConfig.getUntrackedParameter<bool>(
"runHistoBXProfile",
true))
30 , m_runHistoBXProfile2D(iConfig.getUntrackedParameter<bool>(
"runHistoBXProfile2D",
false))
31 , m_runHisto2D(iConfig.getUntrackedParameter<bool>(
"runHisto2D",
false))
32 , m_bsConstrained(iConfig.getParameter<bool>(
"bsConstrained"))
34 , m_lumiDetailsToken( iC.consumes<
LumiDetails, edm::
InLumi >( edm::InputTag( std::
string(
"lumiProducer" ) ) ) )
56 edm::LogInfo(
"HistogramBooking") <<
"Vertex histogram booking in directory " << dirname;
58 m_hnvtx = currdir->
make<TH1F>(
"nvtx",
"Number of Vertices",60,-0.5,59.5);
59 m_hnvtx->GetXaxis()->SetTitle(
"vertices");
m_hnvtx->GetYaxis()->SetTitle(
"Events");
61 m_hntruevtx = currdir->
make<TH1F>(
"ntruevtx",
"Number of True Vertices",60,-0.5,59.5);
64 m_hntruevtxvslumi = currdir->
make<TProfile>(
"ntruevtxvslumi",
"Number of True Vertices vs BX lumi",250,0.,10.);
67 m_hntruevtxvslumi2D = currdir->
make<TH2D>(
"ntruevtxvslumi2D",
"Number of True Vertices vs BX lumi",250,0.,10.,100,-0.5,99.5);
70 m_hntracks = currdir->
make<TH1F>(
"ntracks",
"Number of Tracks",300,-0.5,299.5);
73 m_hsqsumptsq = currdir->
make<TH1F>(
"sqsumptsq",
"sqrt(sum pt**2)",1000,0.,1000.);
85 m_hndof = currdir->
make<TH1F>(
"ndof",
"Number of degree of freedom",250,-0.5,499.5);
86 m_hndof->GetXaxis()->SetTitle(
"ndof");
m_hndof->GetYaxis()->SetTitle(
"Vertices");
88 m_hndofvstracks = currdir->
make<TH2F>(
"ndofvstracks",
"Ndof vs Ntracks",300,-0.5,299.5,250,-0.5,499.5);
91 m_hndofvsvtxz = currdir->
make<TProfile>(
"ndofvsvtxz",
"Ndof vs Vertex Z position",200,
111 m_hweights = currdir->
make<TH1F>(
"weights",
"Tracks weights",51,0.,1.02);
114 m_haveweight = currdir->
make<TH1F>(
"aveweight",
"Tracks average weights sum",51,0.,1.02);
118 m_hvtxx = currdir->
make<TH1F>(
"vtxx",
"Vertex X position",
123 m_hvtxx->GetXaxis()->SetTitle(
"X [cm]");
m_hvtxx->GetYaxis()->SetTitle(
"Vertices");
125 m_hvtxy = currdir->
make<TH1F>(
"vtxy",
"Vertex Y position",
130 m_hvtxy->GetXaxis()->SetTitle(
"Y [cm]");
m_hvtxy->GetYaxis()->SetTitle(
"Vertices");
132 m_hvtxz = currdir->
make<TH1F>(
"vtxz",
"Vertex Z position",
137 m_hvtxz->GetXaxis()->SetTitle(
"Z [cm]");
m_hvtxz->GetYaxis()->SetTitle(
"Vertices");
212 (*m_hvtxxrun)->GetXaxis()->SetTitle(
"X [cm]"); (*m_hvtxxrun)->GetYaxis()->SetTitle(
"Vertices");
213 (*m_hvtxyrun)->GetXaxis()->SetTitle(
"Y [cm]"); (*m_hvtxyrun)->GetYaxis()->SetTitle(
"Vertices");
214 (*m_hvtxzrun)->GetXaxis()->SetTitle(
"Z [cm]"); (*m_hvtxzrun)->GetYaxis()->SetTitle(
"Vertices");
217 (*m_hvtxxvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hvtxxvsorbrun)->GetYaxis()->SetTitle(
"X [cm]");
218 (*m_hvtxxvsorbrun)->SetBit(TH1::kCanRebin);
219 (*m_hvtxyvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hvtxyvsorbrun)->GetYaxis()->SetTitle(
"Y [cm]");
220 (*m_hvtxyvsorbrun)->SetBit(TH1::kCanRebin);
221 (*m_hvtxzvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hvtxzvsorbrun)->GetYaxis()->SetTitle(
"Z [cm]");
222 (*m_hvtxzvsorbrun)->SetBit(TH1::kCanRebin);
223 (*m_hnvtxvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hnvtxvsorbrun)->GetYaxis()->SetTitle(
"Nvertices");
224 (*m_hnvtxvsorbrun)->SetBit(TH1::kCanRebin);
228 (*m_hvtxxvsbxrun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxxvsbxrun)->GetYaxis()->SetTitle(
"X [cm]");
229 (*m_hvtxyvsbxrun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxyvsbxrun)->GetYaxis()->SetTitle(
"Y [cm]");
230 (*m_hvtxzvsbxrun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxzvsbxrun)->GetYaxis()->SetTitle(
"Z [cm]");
231 (*m_hnvtxvsbxrun)->GetXaxis()->SetTitle(
"BX"); (*m_hnvtxvsbxrun)->GetYaxis()->SetTitle(
"Nvertices");
233 (*m_hnvtxvsbxvslumirun)->GetXaxis()->SetTitle(
"BX"); (*m_hnvtxvsbxvslumirun)->GetYaxis()->SetTitle(
"BX lumi [10^{30}cm^{-2}s^{-1}]");
236 (*m_hvtxxvsbx2drun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxxvsbx2drun)->GetYaxis()->SetTitle(
"X [cm]");
237 (*m_hvtxyvsbx2drun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxyvsbx2drun)->GetYaxis()->SetTitle(
"Y [cm]");
238 (*m_hvtxzvsbx2drun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxzvsbx2drun)->GetYaxis()->SetTitle(
"Z [cm]");
243 (*m_hnvtxvsbxvsorbrun)->GetXaxis()->SetTitle(
"BX#"); (*m_hnvtxvsbxvsorbrun)->GetYaxis()->SetTitle(
"time [orbit#]");
244 (*m_hnvtxvsbxvsorbrun)->SetBit(TH1::kCanRebin);
245 (*m_hnvtxvsorbrun2D)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hnvtxvsorbrun2D)->GetYaxis()->SetTitle(
"Nvertices");
246 (*m_hnvtxvsorbrun2D)->SetBit(TH1::kCanRebin);
256 for(reco::VertexCollection::const_iterator vtx=vertices.begin();vtx!=vertices.end();++vtx) {
257 if(!vtx->isFake()) ntruevtx++;
261 double aveweight =
m_bsConstrained ? vtx->ndof()/(2.*vtx->tracksSize()) : (vtx->ndof()+3)/(2.*vtx->tracksSize());
296 int nheavytracks = 0;
298 double sumpt2heavy = 0.;
302 sumpt2 += (*trk)->pt()*(*trk)->pt();
306 sumpt2heavy += (*trk)->pt()*(*trk)->pt();
344 if(ntruevtx < (*m_hnvtxvsorbrun2D)->GetYaxis()->GetXmax() && ntruevtx > (*m_hnvtxvsorbrun2D)->GetYaxis()->GetXmin()) {
345 (*m_hnvtxvsorbrun2D)->Fill(orbit,ntruevtx,weight);
TProfile ** m_hvtxyvsorbrun
T getUntrackedParameter(std::string const &, T const &) const
TFileDirectory * m_currdir
const bool m_runHistoProfile
const edm::ParameterSet m_histoParameters
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TProfile2D ** m_hnvtxvsbxvsorbrun
RunHistogramManager m_rhm
int bunchCrossing() const
TProfile2D ** m_hnvtxvsbxvslumirun
std::vector< Vertex > VertexCollection
collection of Vertex objects
void fill(const edm::Event &iEvent, const reco::VertexCollection &vertices, const double weight=1.)
TProfile * m_haveweightvsvtxzchk
edm::EDGetTokenT< LumiDetails > m_lumiDetailsToken
TProfile * m_hntruevtxvslumi
TFileDirectory & tFileDirectory()
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
TProfile ** m_hnvtxvsbxrun
TProfile ** m_hvtxzvsbxrun
TH2D * m_hntruevtxvslumi2D
TProfile ** m_hvtxyvsbxrun
const bool m_bsConstrained
TProfile ** makeTProfile(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
LuminosityBlock const & getLuminosityBlock() const
const bool m_runHistoBXProfile2D
T * make(const Args &...args) const
make new ROOT object
TProfile ** m_hnvtxvsorbrun
void book(const std::string dirname="")
TProfile ** m_hvtxzvsorbrun
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
void beginRun(const edm::Run &iRun)
TProfile2D ** makeTProfile2D(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax, const unsigned int nbiny, const double ymin, const double ymax)
void beginRun(const edm::Run &iRun)
TH2F ** m_hnvtxvsorbrun2D
TProfile ** m_hvtxxvsorbrun
TProfile * m_hntracksvsvtxz
TProfile * m_haveweightvsvtxz
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
TH2F ** makeTH2F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax, const unsigned int nbiny, const double ymin, const double ymax)
const double m_weightThreshold
volatile std::atomic< bool > shutdown_flag false
TProfile ** m_hvtxxvsbxrun
const bool m_runHistoBXProfile
const unsigned int m_maxLS
RunHistogramManager m_fhm