1 |
konec |
1.1 |
#include "UserCode/L1RpcTriggerAnalysis/interface/AnaClu.h"
|
2 |
|
|
#include "TObjArray.h"
|
3 |
|
|
#include "TH1D.h"
|
4 |
konec |
1.3 |
#include "TH2D.h"
|
5 |
konec |
1.1 |
#include "TAxis.h"
|
6 |
|
|
#include "TGraphErrors.h"
|
7 |
|
|
#include "UserCode/L1RpcTriggerAnalysis/interface/RPCDetIdUtil.h"
|
8 |
|
|
#include "UserCode/L1RpcTriggerAnalysis/interface/MuonObj.h"
|
9 |
konec |
1.2 |
#include "UserCode/L1RpcTriggerAnalysis/interface/EventObj.h"
|
10 |
konec |
1.4 |
#include "UserCode/L1RpcTriggerAnalysis/interface/DetCluDigiObj.h"
|
11 |
konec |
1.1 |
#include <sstream>
|
12 |
|
|
#include <algorithm>
|
13 |
|
|
|
14 |
|
|
namespace {
|
15 |
konec |
1.2 |
TH1D *hClu_SizeDigi, *hClu_SizeRHit;
|
16 |
konec |
1.3 |
TH2D *hClu_DigiRHit;
|
17 |
konec |
1.1 |
}
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
void AnaClu::run(
|
21 |
konec |
1.2 |
const EventObj* event,
|
22 |
konec |
1.1 |
const MuonObj* muon,
|
23 |
konec |
1.5 |
const L1ObjColl *l1Coll,
|
24 |
konec |
1.4 |
const std::vector<DetCluDigiObj> & detsHitsCompatibleWithMuon)
|
25 |
konec |
1.1 |
{
|
26 |
konec |
1.2 |
if (cluRunMap.find(event->run) == cluRunMap.end()) cluRunMap[event->run] = std::make_pair(0,0);
|
27 |
|
|
|
28 |
konec |
1.4 |
for (unsigned int i=0; i< detsHitsCompatibleWithMuon.size(); ++i) {
|
29 |
|
|
hClu_SizeRHit->Fill(detsHitsCompatibleWithMuon[i].clusterSize);
|
30 |
|
|
hClu_SizeDigi->Fill(detsHitsCompatibleWithMuon[i].nDigis);
|
31 |
|
|
hClu_DigiRHit->Fill( detsHitsCompatibleWithMuon[i].clusterSize, detsHitsCompatibleWithMuon[i].nDigis);
|
32 |
konec |
1.2 |
cluRunMap[event->run].first++;
|
33 |
konec |
1.4 |
cluRunMap[event->run].second += detsHitsCompatibleWithMuon[i].nDigis;
|
34 |
konec |
1.2 |
}
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
TGraph* AnaClu::resume()
|
38 |
|
|
{
|
39 |
|
|
TGraphErrors * hGraphRun = new TGraphErrors();
|
40 |
akalinow |
1.7 |
// unsigned int nPoints = 0;
|
41 |
konec |
1.6 |
// for( CluRunMap::const_iterator im = cluRunMap.begin(); im != cluRunMap.end(); ++im) if (im->second.first != 0) ++nPoints;
|
42 |
|
|
// hGraphRun->Set(nPoints);
|
43 |
|
|
hGraphRun->Set(cluRunMap.size());
|
44 |
konec |
1.2 |
|
45 |
|
|
unsigned int iPoint=0;
|
46 |
|
|
for( CluRunMap::const_iterator im = cluRunMap.begin(); im != cluRunMap.end(); ++im) {
|
47 |
konec |
1.6 |
// if (im->second.first==0 ) continue;
|
48 |
|
|
double clu=0.;
|
49 |
|
|
double cluErr=0.;
|
50 |
|
|
if (im->second.first !=0 ) {
|
51 |
|
|
clu = static_cast<double>(im->second.second) / im->second.first;
|
52 |
|
|
cluErr = sqrt( static_cast<double>(im->second.second)) / im->second.first;
|
53 |
|
|
}
|
54 |
konec |
1.2 |
std::cout <<" RUN: "<<im->first <<" Cluster: "<< clu <<std::endl;
|
55 |
|
|
hGraphRun->SetPoint(iPoint, im->first, clu);
|
56 |
|
|
hGraphRun->SetPointError(iPoint, 0., cluErr);
|
57 |
|
|
iPoint++;
|
58 |
|
|
}
|
59 |
|
|
return hGraphRun;
|
60 |
konec |
1.1 |
}
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
void AnaClu::init(TObjArray& histos)
|
64 |
|
|
{
|
65 |
konec |
1.2 |
hClu_SizeDigi = new TH1D( "hClu_SizeDigi", "hClu_SizeDigi", 97, -0.5, 96.5); histos.Add( hClu_SizeDigi);
|
66 |
|
|
hClu_SizeRHit = new TH1D( "hClu_SizeRHit", "hClu_SizeRHit", 97, -0.5, 96.5); histos.Add( hClu_SizeRHit);
|
67 |
konec |
1.3 |
hClu_DigiRHit = new TH2D( "hClu_DigiRHit","hClu_DigiRHit", 97, -0.5, 96.5, 97, -0.5, 96.5); histos.Add(hClu_DigiRHit);
|
68 |
konec |
1.1 |
}
|