BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
DchDigitsAnalysisHist.C
Go to the documentation of this file.
1
#include "
TCanvas.h
"
2
#include "
TChain.h
"
3
#include "
TGraph.h
"
4
#include "
TH1F.h
"
5
#include "
TH2F.h
"
6
#include "
TLine.h
"
7
#include "
TMath.h
"
8
9
// #include "../../globaltracking/BmnHitFinderRun1.h"
10
11
using namespace
TMath
;
12
13
const
UInt_t
kNPLANES
= 16;
14
const
UInt_t
kNREALWIRES
= 240;
15
const
UInt_t
kNWIRES
= 256;
16
const
Int_t
Number
= 4;
17
const
Int_t
nb
= 100;
18
const
Float_t
angles
[
kNPLANES
] = {135, 135, 45, 45, 90, 90, 180, 180, 135, 135, 45, 45, 90, 90, 180, 180};
19
const
TString
names
[
kNPLANES
] = {
"VA_1"
,
"VB_1"
,
"UA_1"
,
"UB_1"
,
"YA_1"
,
"YB_1"
,
"XA_1"
,
"XB_1"
,
20
"VA_2"
,
"VB_2"
,
"UA_2"
,
"UB_2"
,
"YA_2"
,
"YB_2"
,
"XA_2"
,
"XB_2"
};
21
22
void
DchDigitsAnalysisHist
(
UInt_t
runId = 0)
23
{
24
// gStyle->SetOptStat(0);
25
/* Load basic libraries */
26
gROOT
->LoadMacro(
"$VMCWORKDIR/macro/run/bmnloadlibs.C"
);
27
bmnloadlibs();
// load bmn libraries
28
29
TChain
* eveTree =
new
TChain
(
"cbmsim"
);
30
TString
inName =
Form
(
"bmn_run%04d_digi.root"
, runId);
31
eveTree->
Add
(inName);
32
33
TClonesArray
* DchDigits;
34
TClonesArray
* DchHits =
new
TClonesArray
(
"BmnDchHit"
);
35
eveTree->
SetBranchAddress
(
"DCH"
, &DchDigits);
36
37
Long64_t
nEvents = eveTree->
GetEntries
();
38
cout << nEvents << endl;
39
40
TH2F
* h_DCH1 =
new
TH2F
(
"h_DCH1"
,
"h_DCH1"
, 500, 0, 0, 500, 0, 0);
41
TH2F
* h_DCH2 =
new
TH2F
(
"h_DCH2"
,
"h_DCH2"
, 500, 0, 0, 500, 0, 0);
42
43
for
(
Int_t
iEv = 0; iEv < nEvents; iEv++) {
44
if
(iEv % 100 == 0)
45
cout <<
"EVENT: "
<< iEv << endl;
46
DchHits->
Clear
();
47
eveTree->
GetEntry
(iEv);
48
ProcessDchDigits(DchDigits, DchHits);
49
// cout << DchHits->GetEntriesFast() << endl;
50
for
(
Int_t
iHit = 0; iHit < DchHits->
GetEntriesFast
(); ++iHit) {
51
BmnDchHit
* hit = (
BmnDchHit
*)DchHits->
At
(iHit);
52
if
(hit->
GetDchId
() == 1)
53
h_DCH1->
Fill
(hit->GetX(), hit->GetY());
54
if
(hit->
GetDchId
() == 2)
55
h_DCH2->
Fill
(hit->GetX(), hit->GetY());
56
}
57
}
58
59
TCanvas
* c_dch1 =
new
TCanvas
(
"dch1"
,
"dch1"
, 1000, 1000);
60
h_DCH1->
Draw
(
"colz"
);
61
TCanvas
* c_dch2 =
new
TCanvas
(
"dch2"
,
"dch2"
, 1000, 1000);
62
h_DCH2->
Draw
(
"colz"
);
63
}
Int_t
int Int_t
UInt_t
unsigned int UInt_t
Float_t
float Float_t
Long64_t
long long Long64_t
TCanvas.h
TChain.h
TGraph.h
TH1F.h
TH2F.h
TLine.h
TMath.h
gROOT
#define gROOT
Form
char * Form(const char *fmt,...)
BmnDchHit
Definition
BmnDchHit.h:9
BmnDchHit::GetDchId
UChar_t GetDchId() const
Definition
BmnDchHit.h:43
TCanvas
TChain
TChain::SetBranchAddress
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
TChain::Add
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
TChain::GetEntries
Long64_t GetEntries() const override
TChain::GetEntry
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
TClonesArray
TClonesArray::Clear
void Clear(Option_t *option="") override
TH1::Draw
void Draw(Option_t *option="") override
TH2F
TH2::Fill
virtual Int_t Fill(const char *namex, const char *namey, Double_t w)
TObjArray::GetEntriesFast
Int_t GetEntriesFast() const
TObjArray::At
TObject * At(Int_t idx) const override
TString
DchDigitsAnalysisHist
void DchDigitsAnalysisHist(UInt_t runId=0)
Definition
DchDigitsAnalysisHist.C:22
angles
const Float_t angles[kNPLANES]
Definition
DchDigitsAnalysisHist.C:18
names
const TString names[kNPLANES]
Definition
DchDigitsAnalysisHist.C:19
kNPLANES
const UInt_t kNPLANES
Definition
DchDigitsAnalysisHist.C:13
kNWIRES
const UInt_t kNWIRES
Definition
DchDigitsAnalysisHist.C:15
Number
const Int_t Number
Definition
DchDigitsAnalysisHist.C:16
kNREALWIRES
const UInt_t kNREALWIRES
Definition
DchDigitsAnalysisHist.C:14
nb
const Int_t nb
Definition
DchDigitsAnalysisHist.C:17
TMath
install
macro
raw
DchDigitsAnalysisHist.C
Generated on
for BmnRoot by
1.17.0