16const Float_t angles[
kNPLANES] = {135, 135, 45, 45, 90, 90, 180, 180, 135, 135, 45, 45, 90, 90, 180, 180};
18 "VA_2",
"VB_2",
"UA_2",
"UB_2",
"YA_2",
"YB_2",
"XA_2",
"XB_2"};
24 gROOT->LoadMacro(
"$VMCWORKDIR/macro/run/bmnloadlibs.C");
28 TString inName =
Form(
"bmn_run%04d_digi.root", runId);
35 cout << nEvents << endl;
43 for (
Int_t iEv = 0; iEv < nEvents; iEv++) {
45 cout <<
"EVENT: " << iEv << endl;
52 v_wires[plane][wire] += 1;
56 h_wires[plane]->
Fill(wire);
68 v_wires[
i][j] /= maxSig;
80 myPalette[
i] = FI +
i;
84 TCanvas* SuperCave =
new TCanvas(
"SuperCave",
"SuperCave", 1000, 1500);
88 TPad* pad1 =
new TPad(
"",
"", 0, 0, 1.0, 2.0 / 3.0);
92 TPad* pad2 =
new TPad(
"",
"", 0, 2.0 / 3.0, 1.0, 1.0);
102 h_wires[
i]->
Draw(
"X+");
106 SuperCave->
Print(
Form(
"dch_run%04d.pdf(", runId),
"");
108 SuperCave->
Print(
Form(
"dch_run%04d.pdf)", runId),
"");
110 SuperCave->
Print(
Form(
"dch_run%04d.pdf", runId),
"");
114 }
else if (type ==
"png") {
115 TCanvas* SuperCave =
new TCanvas(
"SuperCave",
"SuperCave", 1000, 1500);
119 TPad* pad1 =
new TPad(
"",
"", 0, 0, 1.0, 2.0 / 3.0);
123 TPad* pad2 =
new TPad(
"",
"", 0, 2.0 / 3.0, 1.0, 1.0);
133 h_wires[
i]->
Draw(
"X+");
134 SuperCave->
SaveAs(
Form(
"dch_run%04d_plane%d.png", runId,
i));
144 chmb1->
SaveAs(
"DCH1_wires.png");
150 chmb2->
SaveAs(
"DCH2_wires.png");
159 Double_t xPol[kNANGLE] = {b, 0, 0, b, b + a, l, l, b + a};
160 Double_t yPol[kNANGLE] = {0, b, b + a, l, l, b + a, b, 0};
182 if (j >= 112 && j < 128) {
198 }
else if (x0 >= a + b) {
199 y0 = -x0 + 2 * a + 3 * b;
216 Float_t x0_ = (x0 - l / 2) * cosPhi - (y0 - l / 2) * sinPhi + l / 2;
217 Float_t y0_ = (x0 - l / 2) * sinPhi + (y0 - l / 2) * cosPhi + l / 2;
218 Float_t x1_ = (x1 - l / 2) * cosPhi - (y1 - l / 2) * sinPhi + l / 2;
219 Float_t y1_ = (x1 - l / 2) * sinPhi + (y1 - l / 2) * cosPhi + l / 2;
224 TEllipse* hole =
new TEllipse((a + 2 * b) / 2, (a + 2 * b) / 2, (a + 2 * b) / 30);
237 Double_t xPol[kNANGLE] = {b, 0, 0, b, b + a, l, l, b + a};
238 Double_t yPol[kNANGLE] = {0, b, b + a, l, l, b + a, b, 0};
259 if (j >= 112 && j < 128) {
275 }
else if (x0 >= a + b) {
276 y0 = -x0 + 2 * a + 3 * b;
290 Float_t x0_ = (x0 - l / 2) * cosPhi - (y0 - l / 2) * sinPhi + l / 2;
291 Float_t y0_ = (x0 - l / 2) * sinPhi + (y0 - l / 2) * cosPhi + l / 2;
292 Float_t x1_ = (x1 - l / 2) * cosPhi - (y1 - l / 2) * sinPhi + l / 2;
293 Float_t y1_ = (x1 - l / 2) * sinPhi + (y1 - l / 2) * cosPhi + l / 2;
298 TEllipse* hole =
new TEllipse((a + 2 * b) / 2, (a + 2 * b) / 2, (a + 2 * b) / 30);
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
Short_t GetWireNumber() const
virtual void SetLabelSize(Float_t size=0.04)
virtual void SetTickLength(Float_t length=0.03)
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
virtual void SetFillColor(Color_t fcolor)
virtual void SetFillStyle(Style_t fstyle)
virtual void SetLineWidth(Width_t lwidth)
virtual void SetLineColorAlpha(Color_t lcolor, Float_t lalpha)
virtual void SetLineColor(Color_t lcolor)
virtual void SetBottomMargin(Float_t bottommargin)
virtual void SetMargin(Float_t left, Float_t right, Float_t bottom, Float_t top)
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
TVirtualPad * cd(Int_t subpadnumber=0) override
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
Long64_t GetEntries() const override
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
static Int_t CreateGradientColorTable(UInt_t Number, Double_t *Stops, Double_t *Red, Double_t *Green, Double_t *Blue, UInt_t NColors, Float_t alpha=1., Bool_t setPalette=kTRUE)
void Draw(Option_t *option="") override
void Draw(Option_t *chopt="") override
void SetTitle(const char *title="") override
void Draw(Option_t *option="") override
virtual Int_t Fill(const char *name, Double_t w)
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
Double_t GetAbsWNDC() const override
void SaveAs(const char *filename="", Option_t *option="") const override
TVirtualPad * cd(Int_t subpadnumber=0) override
void Draw(Option_t *option="") override
void Print(const char *filename, Option_t *option) override
const Float_t angles[kNPLANES]
const TString names[kNPLANES]
void DrawAllWires(TCanvas *c, Int_t *palette, Float_t *wires, Float_t ang, Short_t planeId)
void DchDigitsAnalysis(UInt_t runId=0, TString type="pdf")
void DrawWires(TPad *pad, Int_t *palette, Float_t *wires, Float_t ang)
constexpr Double_t Sqrt2()
constexpr Double_t DegToRad()