26 #include "TRootEmbeddedCanvas.h"
54 if (plane != NULL )plane->
print();
63 Info(
"process",
"Event %ld",
nEvents);
69 Double_t angle_open_sim = 0;
71 TVector3 possim = TVector3(0,0,0);
72 TVector3 pgammasim = TVector3(0,0,1);
73 TVector3 ppolasim = TVector3(0,1,0);
74 TVector3 pgamma = TVector3(0,0,1);
76 TVector3 ppola = TVector3(0,1,0);
77 TVector3 ppositron, pelectron;
78 Double_t epositron= -1.0, eelectron = -1.0;
84 Bool_t palready = kFALSE;
85 for(Int_t i = 0; i<nMCtr; i++){
88 if(pdgcode == 11 && palready) pdgcode = -11;
92 pgammasim = track->
GetP();
94 pgamma = track->
GetP();
95 egamma = track->
GetE();
100 ppositron = track->
GetP();
101 epositron = track->
GetE();
104 pelectron = track->
GetP();
105 eelectron = track->
GetE();
109 Double_t u1u2 = ppositron.Unit()*pelectron.Unit();
110 angle_open_sim=acos(u1u2);
116 TVector3 ppola2 = ppolasim.Cross(pgammasim.Unit());
117 TVector3 pPlusMC = TVector3(ppositron.Dot(pgammasim.Unit()),ppositron.Dot(ppolasim.Unit()),ppositron.Dot(ppola2.Unit())).Unit();
118 TVector3 pMinusMC = TVector3(pelectron.Dot(pgammasim.Unit()),pelectron.Dot(ppolasim.Unit()),pelectron.Dot(ppola2.Unit())).Unit();
120 Double_t phiPlusMC = TMath::ATan2(pPlusMC.Pz(),pPlusMC.Py());
121 Double_t phiMinusMC = TMath::ATan2(pMinusMC.Pz(),pMinusMC.Py());
122 Double_t phipmMC = 0.5*(phiPlusMC+phiMinusMC);
123 if(gRandom->Rndm()<0.5) phipmMC += TMath::Pi();
124 while(phipmMC>TMath::Pi()) phipmMC -= 2*TMath::Pi();
125 while(phipmMC<-TMath::Pi()) phipmMC += 2*TMath::Pi();
134 Int_t nV = vArray->GetEntries();
135 Int_t nIn = 0, nOut = 0;
136 for(Int_t iV = 0; iV<nV; iV++){
139 Double_t e1 = eelectron;
140 Double_t e2 = epositron;
152 TVector3 p = p1.Unit() + p2.Unit();
158 hDistRecoSim->Fill(xV-possim.x()-150,yV-possim.y()-150,zV-possim.z()-250);
163 Double_t u1u2 = p1.Unit()*p2.Unit();
164 Double_t angle_open=acos(u1u2);
165 hOpen->Fill(angle_open);
168 TVector3 pPlus = TVector3(p1.Dot(pgammasim.Unit()),p1.Dot(ppolasim.Unit()),p1.Dot(ppola2.Unit()));
169 TVector3 pMinus = TVector3(p2.Dot(pgammasim.Unit()),p2.Dot(ppolasim.Unit()),p2.Dot(ppola2.Unit()));
170 Double_t phiPlus = TMath::ATan2(pPlus.Pz(),pPlus.Py());
171 Double_t phiMinus = TMath::ATan2(pMinus.Pz(),pMinus.Py());
172 Double_t phipm = 0.5*(phiPlus+phiMinus);
173 if(gRandom->Rndm()<0.5) phipm += TMath::Pi();
174 while(phipm>TMath::Pi()) phipm -= 2*TMath::Pi();
175 while(phipm<-TMath::Pi()) phipm += 2*TMath::Pi();
176 Double_t deltaphipm = phipm-phipmMC;
177 while(deltaphipm>TMath::Pi()) deltaphipm -= 2*TMath::Pi();
178 while(deltaphipm<-TMath::Pi()) deltaphipm += 2*TMath::Pi();
181 Double_t theta = pgammasim.Angle(p1.Unit()+p2.Unit());
186 for(Int_t i = 0; i<3; i++){
187 data[0+i] = possim[i];
190 data[9+i] = pgammasim[i];
197 data[17] = angle_open;
199 if(TMath::Abs(xV-possim.x()-150)<10 &&TMath::Abs(yV-possim.y()-150)<10 &&TMath::Abs(zV-possim.z()-250)<10){
228 hPhiPmMC =
new TH1F(
"hPhiPmMC",
"",200,-TMath::Pi(),TMath::Pi());
229 hPhiPm =
new TH1F(
"hPhiPm",
"",200,-TMath::Pi(),TMath::Pi());
230 hPhiPmCut =
new TH1F(
"hPhiPmCut",
"",200,-TMath::Pi(),TMath::Pi());
231 hDeltaPhiPm =
new TH1F(
"hDeltaPhiPm",
"",200,-TMath::Pi(),TMath::Pi());
232 hOpenMC =
new TH1F(
"hOpenMC",
"",200,0,TMath::Pi());
233 hOpen =
new TH1F(
"hOpen",
"",200,0,TMath::Pi());
234 hDeltaOpen =
new TH1F(
"hDeltaOpen",
"",200,-TMath::Pi(),TMath::Pi());
235 hOpenCut =
new TH1F(
"hOpenCut",
"",200,0,TMath::Pi());
236 hDistRecoSim =
new TH3F(
"hDistRecoSim",
"",200,-50,50,200,-50,50,200,-50,50);
237 hPosition =
new TH3F(
"hPosition",
"",100,0,300,100,0,300,128,0,512);
238 hPositionCut =
new TH3F(
"hPositionCut",
"",100,0,300,100,0,300,128,0,512);
240 hTheta =
new TH1F(
"hTheta",
"",200,0,TMath::Pi());
241 hThetaCut =
new TH1F(
"hThetaCut",
"",200,0,TMath::Pi());
243 hNin =
new TH1F(
"hNin",
"",20,0,20);
244 hNout =
new TH1F(
"hNout",
"",20,0,20);
246 fNtuple =
new TNtupleD(
"fNtuple",
"Vertex data",
"x:y:z:px:py:pz:pBx:pBy:pBz:pxsim:pysim:pzsim:e:e1:e2:theta:phipm:open:cut");
282 TCanvas* c = ecTab->GetCanvas();
283 c->GetPad(1)->Delete();
284 c->GetPad(2)->Delete();
287 for(Int_t plane = 0; plane<2;plane++){
288 TVirtualPad* cMap = c->GetPad(plane+1);
290 TH2F* h =
new TH2F(
"h",
"",512,0,512,288,0,288);
291 for(Int_t i=1;i<
NADC;i++){
292 for(Int_t j=0;j<
NCHAN;j++){
294 h->SetBinContent(i+1,j+1,q);
313 UInt_t ysize = 10*ysize2;
314 TGTransientFrame*
main =
new TGTransientFrame(gClient->GetRoot(), fMain, xsize, ysize);
315 main->Connect(
"CloseWindow()",
"HarpoRecoMonitorGui", main,
"CloseWindow()");
316 main->DontCallClose();
319 main->SetCleanup(kDeepCleanup);
321 TGVerticalFrame* frame =
new TGVerticalFrame(main,xsize,ysize,kVerticalFrame);
324 TGLayoutHints* fLayout1 =
new TGLayoutHints(kLHintsLeft ,5,5,5,5);
325 TGLayoutHints* fLayout2 =
new TGLayoutHints(kLHintsRight ,5,5,5,5);
326 TGLayoutHints* fLayout3 =
new TGLayoutHints(kLHintsTop | kLHintsExpandX ,5,5,5,5);
327 TGLayoutHints* fLayout4 =
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5);
335 TGLabel* fAnalysisLabel =
new TGLabel(frame,
"Template analysis");
338 TGHorizontalFrame* nBinsFrame =
new TGHorizontalFrame(frame,xsize,ysize2,kHorizontalFrame);
339 TGLabel* nBinsLabel =
new TGLabel(nBinsFrame,
"fNbins");
343 main->AddFrame(frame,fLayout4);
344 frame->AddFrame(fAnalysisLabel,fLayout3);
345 frame->AddFrame(nBinsFrame,fLayout3);
346 nBinsFrame->AddFrame(nBinsLabel,fLayout1);
353 TGTextButton* setConf =
new TGTextButton(frame,
"Save Config",
id);
354 setConf->Associate(fMain);
356 frame->AddFrame(setConf,fLayout3);
358 main->MapSubwindows();
HarpoRecoEvent * GetRecoEvent()
void print()
Overloaded method which do all job.
Dummy analysis to run as test and example. Give basic histograms of the data.
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
int main(int argc, char **argv)
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Object containing the reconstruction information for one event (with array of HarpoRecoClusters Harpo...
void Save(char *mode=NULL)
A class store HARPO row DCC event data and header. End provide access metods to the row data...
TFile * OpenHistFile(const char *ananame)
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
HarpoDetEvent * GetDetEvent(Long_t plane=XDCC)
Data from Keller temperuture and pressure sensors.
TVirtualPad * MakeNiceHisto(TH1 *hist, TVirtualPad *c1, const char *opt, Bool_t copy)
void ConfigFrame(TGMainFrame *fMain, Int_t id)
TpcSimMCTrack * GetTrack(Int_t i)
TGNumberEntry * fChooseNbins
TpcSimMCEvent * GetMCEvent()
TClonesArray * GetVertex3DArray()
HarpoEventHeader * GetHeader()
const ULong_t gkNDetectors
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
void DisplayAnalysis(TRootEmbeddedCanvas *ecTab, TGListBox *infobox)
Redefine empty default.
R__EXTERN HarpoDetSet * gHDetSet
3D vertex object, containing position, angle and associated 2D vertexes, and quality info ...