26 #include "TRootEmbeddedCanvas.h"
53 if (plane != NULL )plane->
print();
65 Double_t angle_open_sim = 0;
66 Double_t angle_omega_sim = 0;
68 TVector3 possim = TVector3(0,0,0);
69 TVector3 pgammasim = TVector3(0,0,1);
70 TVector3 ppolasim = TVector3(0,1,0);
71 TVector3 pgamma = TVector3(0,0,1);
72 TVector3 ppola = TVector3(0,1,0);
73 TVector3 ppositron, pelectron;
74 Double_t epositron = -1.0, eelectron = -1.0;
78 for(Int_t i = 0; i<nIonTr; i++){
81 for(Int_t j = 0; j<nPoints; j++){
90 Bool_t palready = kFALSE;
91 for(Int_t i = 0; i<nMCtr; i++){
94 if(pdgcode == 11 && palready) pdgcode = -11;
98 pgammasim = track->
GetP();
100 pgamma = track->
GetP();
105 ppositron = track->
GetP();
106 epositron = track->
GetE();
109 pelectron = track->
GetP();
110 eelectron = track->
GetE();
121 Double_t u1u2 = ppositron.Unit()*pelectron.Unit();
123 angle_open_sim=acos(u1u2);
125 TVector3 ppola2 = ppolasim.Cross(pgammasim.Unit());
126 TVector3 pPlus = TVector3(ppositron.Dot(pgammasim.Unit()),ppositron.Dot(ppolasim.Unit()),ppositron.Dot(ppola2.Unit())).Unit();
127 TVector3 pMinus = TVector3(pelectron.Dot(pgammasim.Unit()),pelectron.Dot(ppolasim.Unit()),pelectron.Dot(ppola2.Unit())).Unit();
128 angle_omega_sim = atan2((pPlus.Px()*pMinus.Py() - pMinus.Px()*pPlus.Py()),
129 (pPlus.Px()*pMinus.Pz() - pMinus.Px()*pPlus.Pz()));
142 const Int_t kNdata = 41;
143 Double_t data[kNdata];
144 for(Int_t i = 0; i<kNdata; i++) data[i] = -1000;
145 for(Int_t i = 0; i<3; i++){
146 data[10+i] = ppositron[i];
147 data[13+i] = pelectron[i];
149 data[32] = epositron;
150 data[33] = eelectron;
152 TVector3 psumsim = ppositron + pelectron;
153 data[23] = psumsim.Unit().x();
154 data[24] = psumsim.Unit().y();
155 data[25] = psumsim.Unit().z();
157 Double_t xStart[2] = {-1,-1};
158 Double_t zStart[2] = {1000,1000};
160 Int_t nCl = clArray->GetEntries();
161 for(Int_t iCl = 0; iCl<nCl; iCl++){
164 if(cl->
GetZ()<zStart[plane]){
165 xStart[plane] = cl->
GetX();
166 zStart[plane] = cl->
GetZ();
175 Double_t fTstart = 90;
176 Double_t fTend = 430;
178 for(Int_t plane = 0; plane<2; plane++){
182 if ( m == NULL )
continue;
185 Double_t qTotBefore = 0;
186 Double_t qTotAfter = 0;
187 for(Int_t j=0;j<
NCHAN;j++){
188 for(Int_t i=0;i<
NADC;i++){
191 if(i< fTstart ) qTotBefore += q;
192 if( i >fTend) qTotAfter += q;
193 if(i>=fTstart && i<=fTend) qTotIn += q;
196 if(qTotBefore>fThr || qTotAfter>fThr)
198 data[35] = qTotBefore;
199 data[36] = qTotAfter;
210 data[26] = xStart[
XPLANE];
211 data[27] = xStart[
YPLANE];
213 data[29] = possim.x();
214 data[30] = possim.y();
215 data[31] = possim.z();
216 data[5] = angle_omega_sim;
217 data[6] = angle_open_sim;
223 Int_t nV = vArray->GetEntries();
224 for(Int_t iV = 0; iV<nV; iV++){
230 Double_t u1u2 = p1.Unit()*p2.Unit();
231 Double_t angle_open=acos(u1u2);
233 TVector3 ppola2 = ppola.Cross(pgamma);
234 TVector3 pPlus = TVector3(p1.Dot(pgamma.Unit()),p1.Dot(ppola.Unit()),p1.Dot(ppola2.Unit()));
235 TVector3 pMinus = TVector3(p2.Dot(pgamma.Unit()),p2.Dot(ppola.Unit()),p2.Dot(ppola2.Unit()));
236 Double_t angle_omega = atan2((pPlus.Px()*pMinus.Py() - pMinus.Px()*pPlus.Py()),
237 (pPlus.Px()*pMinus.Pz() - pMinus.Px()*pPlus.Pz()));
242 data[3] = angle_omega;
243 data[4] = angle_open;
244 TVector3 psum = (p1 + p2).Unit();
249 Double_t d1[2] = {0,0};
250 Double_t d2[2] = {0,0};
251 d1[0] = (ppositron - p1).Mag();
252 d2[0] = (ppositron - p2).Mag();
253 d1[1] = (pelectron - p1).Mag();
254 d2[1] = (pelectron - p2).Mag();
257 if(d1[0]+d2[1]<d1[1]+d2[0]){
259 data[32] = eelectron;
260 data[33] = epositron;
262 for(Int_t i = 0; i<3; i++){
264 data[10+i] = pelectron[i];
265 data[13+i] = ppositron[i];
267 data[10+i] = ppositron[i];
268 data[13+i] = pelectron[i];
280 Double_t fWidthX = 50, fWidthZ = 50;
281 Double_t q1[2] = {0,0}, q2[2] = {0,0};
282 for(Int_t plane = 0; plane<2; plane++){
284 for(Int_t i=0;i<
NADC;i++){
285 for(Int_t j=0;j<
NCHAN;j++){
288 if(TMath::Abs(j-data[plane]-p1[plane]/p1[2]*(i-data[2]))>fWidthX && TMath::Abs(j-data[plane]-p2[plane]/p2[2]*(i-data[2]))>fWidthX )
continue;
289 if(TMath::Abs(i-data[2]-p1[2]/p1[plane]*(j-data[plane]))>fWidthZ && TMath::Abs(i-data[2]-p2[2]/p2[plane]*(j-data[plane]))>fWidthZ)
continue;
291 if((i-data[2])*psum[plane]-(j-data[plane])*psum[2]>0) r = 1. - r;
293 q2[plane] += q*(1.-r);
323 hDist =
new TH1F(
"hDist",
"",500,0,500);
324 hP =
new TH2F(
"hP",
"",100,-1,1,100,-1,1);
326 hOmega =
new TH1F(
"hOmega",
"",200,-3.5,3.5);
327 hOpen =
new TH1F(
"hOpen",
"",200,0,3.5);
328 hDeltaOmega =
new TH1F(
"hDeltaOmega",
"",200,-3.5,3.5);
329 hDeltaOpen =
new TH1F(
"hDeltaOpen",
"",200,-3.5,3.5);
330 hOmegaSim =
new TH1F(
"hOmegaSim",
"",200,-3.5,3.5);
331 hOpenSim =
new TH1F(
"hOpenSim",
"",200,0,3.5);
332 hDiffOpen =
new TH1F(
"hDiffOpen",
"",200,-0.5,0.5);
335 gBeam =
new TGraph2D();
337 fNtuple =
new TNtupleD(
"fNtuple",
"Vertex data",
"x0:y0:z0:omega:alpha:omegasim:alphasim:px:py:pz:px1sim:py1sim:pz1sim:px2sim:py2sim:pz2sim:px1:py1:pz1:px2:py2:pz2:iV:pxsim:pysim:pzsim:xS:yS:zS:xsim:ysim:zsim:e1:e2:trig:qBefore:qAfter:qx1:qy1:qx2:qy2");
350 gBeam->Write(
"gBeam");
368 TCanvas* c = ecTab->GetCanvas();
369 c->GetPad(1)->Delete();
370 c->GetPad(2)->Delete();
373 for(Int_t plane = 0; plane<2;plane++){
374 TVirtualPad* cMap = c->GetPad(plane+1);
376 TH2F* h =
new TH2F(
"h",
"",512,0,512,288,0,288);
377 for(Int_t i=1;i<
NADC;i++){
378 for(Int_t j=0;j<
NCHAN;j++){
380 h->SetBinContent(i+1,j+1,q);
399 UInt_t ysize = 10*ysize2;
400 TGTransientFrame*
main =
new TGTransientFrame(gClient->GetRoot(), fMain, xsize, ysize);
401 main->Connect(
"CloseWindow()",
"HarpoRecoMonitorGui", main,
"CloseWindow()");
402 main->DontCallClose();
405 main->SetCleanup(kDeepCleanup);
407 TGVerticalFrame* frame =
new TGVerticalFrame(main,xsize,ysize,kVerticalFrame);
410 TGLayoutHints* fLayout1 =
new TGLayoutHints(kLHintsLeft ,5,5,5,5);
411 TGLayoutHints* fLayout2 =
new TGLayoutHints(kLHintsRight ,5,5,5,5);
412 TGLayoutHints* fLayout3 =
new TGLayoutHints(kLHintsTop | kLHintsExpandX ,5,5,5,5);
413 TGLayoutHints* fLayout4 =
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5);
421 TGLabel* fAnalysisLabel =
new TGLabel(frame,
"Template analysis");
424 TGHorizontalFrame* nBinsFrame =
new TGHorizontalFrame(frame,xsize,ysize2,kHorizontalFrame);
425 TGLabel* nBinsLabel =
new TGLabel(nBinsFrame,
"fNbins");
429 main->AddFrame(frame,fLayout4);
430 frame->AddFrame(fAnalysisLabel,fLayout3);
431 frame->AddFrame(nBinsFrame,fLayout3);
432 nBinsFrame->AddFrame(nBinsLabel,fLayout1);
439 TGTextButton* setConf =
new TGTextButton(frame,
"Save Config",
id);
440 setConf->Associate(fMain);
442 frame->AddFrame(setConf,fLayout3);
444 main->MapSubwindows();
TpcSimIonisationTrack * GetIonisationTrack(Int_t iTr)
HarpoRecoEvent * GetRecoEvent()
void ConfigFrame(TGMainFrame *fMain, Int_t id)
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...
A class store HARPO row DCC event data and header. End provide access metods to the row data...
Cluster object, containing position, charge and quality information.
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)
TpcSimMCTrack * GetTrack(Int_t i)
void DisplayAnalysis(TRootEmbeddedCanvas *ecTab, TGListBox *infobox)
Redefine empty default.
TGNumberEntry * fChooseNbins
TpcSimMCEvent * GetMCEvent()
A class store HARPO raw PMM2 event buffer and header. End provide access metods to the row data...
TClonesArray * GetVertex3DArray()
HarpoEventHeader * GetHeader()
void Save(char *mode=NULL)
void print()
Overloaded method which do all job.
const ULong_t gkNDetectors
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
TClonesArray * GetClustersArray()
R__EXTERN HarpoDetSet * gHDetSet
Dummy analysis to run as test and example. Give basic histograms of the data.
3D vertex object, containing position, angle and associated 2D vertexes, and quality info ...