1 |
konec |
1.1 |
#include "UserCode/L1RpcTriggerAnalysis/interface/AnaHitSpec.h"
|
2 |
|
|
|
3 |
|
|
#include <cmath>
|
4 |
|
|
#include <sstream>
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
#include "UserCode/L1RpcTriggerAnalysis/interface/EventObj.h"
|
8 |
|
|
#include "UserCode/L1RpcTriggerAnalysis/interface/TrackObj.h"
|
9 |
|
|
#include "UserCode/L1RpcTriggerAnalysis/interface/HitSpecObj.h"
|
10 |
|
|
#include "UserCode/L1RpcTriggerAnalysis/interface/Utilities.h"
|
11 |
|
|
#include "UserCode/L1RpcTriggerAnalysis/interface/RPCDetIdUtil.h"
|
12 |
|
|
|
13 |
|
|
#include "TObjArray.h"
|
14 |
|
|
#include "TH1D.h"
|
15 |
|
|
#include "TH2D.h"
|
16 |
|
|
#include "TProfile.h"
|
17 |
|
|
#include "TGraphErrors.h"
|
18 |
|
|
|
19 |
|
|
#include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
|
20 |
|
|
|
21 |
|
|
namespace {
|
22 |
|
|
TH2D *hHitSpec_PtVsPhi_BarPlus, *hHitSpec_PtVsPhi_BarMinus;
|
23 |
|
|
TH2D *hHitSpec_PtVsPhi_EndPlus, *hHitSpec_PtVsPhi_EndMinus;
|
24 |
|
|
TH2D *hHitSpec_PtVsPhiGen_Plus, *hHitSpec_PtVsPhiGen_Minus;
|
25 |
|
|
TH2D *hHitSpec_PtVsPhiGenAtPhi0_Plus, *hHitSpec_PtVsPhiGenAtPhi0_Minus;
|
26 |
|
|
}
|
27 |
|
|
void AnaHitSpec::init(TObjArray& histos)
|
28 |
|
|
{
|
29 |
|
|
hHitSpec_PtVsPhi_BarPlus = new TH2D("hHitSpec_PtVsPhi_BarPlus","hHitSpec_PtVsPhi_BarPlus", 32, 0., 1.6, L1PtScale::nPtBins, L1PtScale::ptBins);
|
30 |
|
|
histos.Add(hHitSpec_PtVsPhi_BarPlus);
|
31 |
|
|
hHitSpec_PtVsPhi_BarMinus = new TH2D("hHitSpec_PtVsPhi_BarMinus","hHitSpec_PtVsPhi_BarMinus", 32, 0., 1.6, L1PtScale::nPtBins, L1PtScale::ptBins);
|
32 |
|
|
histos.Add(hHitSpec_PtVsPhi_BarMinus);
|
33 |
|
|
hHitSpec_PtVsPhi_EndPlus = new TH2D("hHitSpec_PtVsPhi_EndPlus","hHitSpec_PtVsPhi_EndPlus", 32, 0., 1.6, L1PtScale::nPtBins, L1PtScale::ptBins);
|
34 |
|
|
histos.Add(hHitSpec_PtVsPhi_EndPlus);
|
35 |
|
|
hHitSpec_PtVsPhi_EndMinus = new TH2D("hHitSpec_PtVsPhi_EndMinus","hHitSpec_PtVsPhi_EndMinus", 32, 0., 1.6, L1PtScale::nPtBins, L1PtScale::ptBins);
|
36 |
|
|
histos.Add(hHitSpec_PtVsPhi_EndMinus);
|
37 |
|
|
|
38 |
|
|
hHitSpec_PtVsPhiGen_Plus = new TH2D("hHitSpec_PtVsPhiGen_Plus","hHitSpec_PtVsPhiGen_Plus", 28, 0.8, 2.2, L1PtScale::nPtBins, L1PtScale::ptBins);
|
39 |
|
|
histos.Add(hHitSpec_PtVsPhiGen_Plus);
|
40 |
|
|
hHitSpec_PtVsPhiGen_Minus = new TH2D("hHitSpec_PtVsPhiGen_Minus","hHitSpec_PtVsPhiGen_Minus", 28, -0.2, 1.2, L1PtScale::nPtBins, L1PtScale::ptBins);
|
41 |
|
|
histos.Add(hHitSpec_PtVsPhiGen_Minus);
|
42 |
|
|
|
43 |
|
|
hHitSpec_PtVsPhiGenAtPhi0_Plus = new TH2D("hHitSpec_PtVsPhiGenAtPhi0_Plus","hHitSpec_PtVsPhiGenAtPhi0_Plus", 28, 0.8, 2.2, L1PtScale::nPtBins, L1PtScale::ptBins);
|
44 |
|
|
histos.Add(hHitSpec_PtVsPhiGenAtPhi0_Plus);
|
45 |
|
|
hHitSpec_PtVsPhiGenAtPhi0_Minus = new TH2D("hHitSpec_PtVsPhiGenAtPhi0_Minus","hHitSpec_PtVsPhiGenAtPhi0_Minus", 28, -0.2, 1.2, L1PtScale::nPtBins, L1PtScale::ptBins);
|
46 |
|
|
histos.Add(hHitSpec_PtVsPhiGenAtPhi0_Minus);
|
47 |
|
|
}
|
48 |
|
|
|
49 |
|
|
void AnaHitSpec::run(const EventObj* ev, const TrackObj * simu, const HitSpecObj * hitSpec)
|
50 |
|
|
{
|
51 |
|
|
double pt = simu->pt() > 160 ? 150. : simu->pt();
|
52 |
|
|
if (simu->charge() == 1) hHitSpec_PtVsPhiGen_Plus->Fill(simu->phi() , pt);
|
53 |
|
|
if (simu->charge() ==-1) hHitSpec_PtVsPhiGen_Minus->Fill(simu->phi(), pt);
|
54 |
|
|
|
55 |
|
|
if (!hitSpec) return;
|
56 |
|
|
uint32_t rawId = hitSpec->rawId();
|
57 |
|
|
if (!rawId) return;
|
58 |
|
|
RPCDetId idDet ( rawId );
|
59 |
|
|
RPCDetIdUtil idUtil( rawId );
|
60 |
|
|
if (theH.find(rawId) == theH.end()) {
|
61 |
|
|
std::stringstream str, strName;
|
62 |
|
|
strName << "hHitSpec_"<<rawId;
|
63 |
|
|
str << "DetId: "<<rawId;
|
64 |
|
|
if (idUtil.isBarrel() ) {
|
65 |
|
|
str<<", Bar, l="<<idUtil.layer()<<", sec:"<<idDet.sector()<<", roll:"<<idDet.roll();
|
66 |
|
|
} else {
|
67 |
|
|
str<<", End, l="<< idUtil.layer()<<", ring:"<<idDet.ring()<<", chmbr: "<<(idDet.sector()-1)*6+idDet.subsector()<<", roll:"<<idDet.roll();
|
68 |
|
|
}
|
69 |
|
|
theH[rawId] = new TH2D( strName.str().c_str(), str.str().c_str(),
|
70 |
|
|
L1PtScale::nPtBins, L1PtScale::ptBins,
|
71 |
|
|
100, 0.8, 1.2);
|
72 |
|
|
}
|
73 |
|
|
if (idUtil.isBarrel()) {
|
74 |
|
|
if (simu->charge() == 1) hHitSpec_PtVsPhi_BarPlus->Fill(hitSpec->position().phi() , pt);
|
75 |
|
|
if (simu->charge() ==-1) hHitSpec_PtVsPhi_BarMinus->Fill(hitSpec->position().phi() , pt);
|
76 |
|
|
} else {
|
77 |
|
|
if (simu->charge() == 1) hHitSpec_PtVsPhi_EndPlus->Fill(hitSpec->position().phi() , pt);
|
78 |
|
|
if (simu->charge() ==-1) hHitSpec_PtVsPhi_EndMinus->Fill(hitSpec->position().phi() , pt);
|
79 |
|
|
}
|
80 |
|
|
theH[rawId]->Fill( pt, hitSpec->position().phi() );
|
81 |
|
|
|
82 |
|
|
if (fabs( hitSpec->position().phi()-1.025) < 0.025) {
|
83 |
|
|
if (simu->charge() == 1) hHitSpec_PtVsPhiGenAtPhi0_Plus->Fill(simu->phi() , pt);
|
84 |
|
|
if (simu->charge() ==-1) hHitSpec_PtVsPhiGenAtPhi0_Minus->Fill(simu->phi(), pt);
|
85 |
|
|
}
|
86 |
|
|
}
|
87 |
|
|
|
88 |
|
|
void AnaHitSpec::resume(TObjArray& histos)
|
89 |
|
|
{
|
90 |
|
|
std::cout <<" AnaHitSpec, SIZE OF HISTOS IS: " << theH.size() << std::endl;
|
91 |
|
|
for (HMap::const_iterator ih = theH.begin(); ih != theH.end(); ++ih) {
|
92 |
|
|
double nTOT = ih->second->Integral();
|
93 |
|
|
double nENT = ih->second->GetEntries();
|
94 |
|
|
if (nTOT > 1000.) std::cout <<" key: "<< ih->first
|
95 |
|
|
<<" name: "<< ih->second->GetName()
|
96 |
|
|
<<" title: "<< ih->second->GetTitle()
|
97 |
|
|
<<" Integral: "<< nTOT <<" Entries: "<< nENT<< std::endl;
|
98 |
|
|
if (ih->second->Integral() > 1000) histos.Add(ih->second);
|
99 |
|
|
}
|
100 |
|
|
}
|