33 Double_t xtmp =
X, ytmp =
Y;
35 X =
AX +
BX*xtmp +
CX*TMath::Power(xtmp,2) ;
36 Y =
AY +
BY*ytmp +
CY*TMath::Power(ytmp,2) ;
54 fLog <<
warning <<
"Dante.conf not found in the current directory ... LoadCalibration should be called at least once !! " <<
dolog;
64 std::ifstream in(calib_file); std::string
tmp;
66 if ( in.is_open() == false )
71 while ( in.good() && !in.eof() ) {
73 if ( tmp[0] ==
'#' ) {
78 Float_t dz, rz1, ry, rz2, rx, tx1, tx2,ty1, ty2, ax, bx, cx, ay, by, cy ;
80 std::istringstream decode(tmp);
86 decode >>
gLUT[j][i] ;
96 decode >> dz >> rz1 >> ry >> rz2 >> rx >> tx1 >> tx2 >> ty1 >> ty2 >> ax >> bx >> cx >> ay >> by >> cy ;
130 fRotation[which].RotateZ(rz1*TMath::Pi()/180.);
131 fRotation[which].RotateY(ry*TMath::Pi()/180.);
132 fRotation[which].RotateZ(rz2*TMath::Pi()/180.);
133 fRotation[which].RotateX((360.-rx)*TMath::Pi()/180.);
226 #ifndef Gw_AgataEventContainer
230 #ifndef Gw_AgataEventDisplay
234 #ifndef Gw_AgataGeometryTransformer
240 Float_t DisplayDante::fgMetric = 10.;
257 fTypeName = AgataEventDisplay::Instance()->RegisterBranch();
259 AgataEventDisplay::Instance()->SetTrackStyle(
"Rectangle",
fTypeName);
264 fPositions =
new TObjArray(gMaxNumberOfModules);
265 fPositions->SetOwner(
false);
271 TString
tmp; TH2F *h;
273 tmp = Form(
"Dante_X_Y_%d",i);
274 h = MakeTH2<TH2F>(tmp.Data(),
"Raw Position in Dante",2048,0,4096,2048,0,4096);
275 fPositions->Add ( h ) ;
277 tmp = Form(
"Dante_X_Y_%d_C",i);
278 h = MakeTH2<TH2F>(tmp.Data(),
"Calibrated Positions in Dante;X;Y",1000,-30,30,1000,-30,30);
281 fPos3D = MakeTH3<TH3F>(
"Pos3D",
"Positions of recoils in beam system;X;Y;Z",100,-150,150,100,-150,150,100,-150,150);
283 fR = MakeTH1<TH1F>(
"R",
"R position",100,0,200);
284 fTheta = MakeTH1<TH1F>(
"Theta",
"Theta angles",90,0,180);
285 fPhi = MakeTH1<TH1F>(
"Phi",
"Phi angles",90,-180,180);
287 fThetaxPhi = MakeTH2<TH2F>(
"ThetaxPhi",
"Raw Position in Dante",180,0,180,360,-180,180);
297 TTask::SetActive(active);
298 AgataEventDisplay::Instance()->Reset();
304 if ( option ==
"" ) {
306 UShort_t which_pad = 1u;
318 if ( option.Contains(
"3D") ) {
319 printf(
" ==> OPTION %s \n",o);
320 if ( option.Contains(
"OGL") )
326 if ( option ==
"2D" ) {
327 c->Divide(2, 2, 0.001, 0.001);
342 AgataEventDisplay::SetDefaultDanteConf(danteConfFile);
343 AgataEventDisplay::SetDefaultAgataPath(agataPathFile);
344 AgataEventDisplay::Instance()->BuildDefaultGeometry(
true,
false);
345 AgataEventDisplay::Instance()->ShowDisplay();
354 UShort_t nb_fired = 0u;
364 if (
fDante[i].has_fired ) {
374 if (
fDante[i].has_fired ) {
389 if (
fDante[i].has_fired ) {
393 fR->Fill(vtmp.Mag());
394 fTheta->Fill(vtmp.Theta()*180./TMath::Pi());
395 fPhi->Fill(vtmp.Phi()*180./TMath::Pi());
396 fThetaxPhi->Fill(vtmp.Theta()*180./TMath::Pi(),vtmp.Phi()*180./TMath::Pi());
428 GetTree()->Branch(
"NbDante", &fNbDante,
"NbDante/I");
429 GetTree()->Branch(
"WhichDante", fWhichDante,
"WhichDante[NbDante]/s");
431 GetTree()->Branch(
"DanteXc", fDanteXc,
"Xc[NbDante]/F");
432 GetTree()->Branch(
"DanteYc", fDanteYc,
"Yc[NbDante]/F");
434 GetTree()->Branch(
"DanteA", fDanteA,
"A[NbDante]/F");
436 GetTree()->Branch(
"DanteXr", fDanteXr,
"DanteXr[NbDante]/F");
437 GetTree()->Branch(
"DanteYr", fDanteYr,
"DanteYr[NbDante]/F");
438 GetTree()->Branch(
"DanteZr", fDanteZr,
"DanteZr[NbDante]/F");
440 GetTree()->Branch(
"DanteBeta", &fDanteBeta,
"DanteBeta/F");
445 delete [] fWhichDante;
457 printf(
"MyDanteTree::Exec is called \n");
464 if ( !
fDante[i].has_fired ) {
468 fWhichDante[fNbDante] = i;
469 fDanteXc[fNbDante] =
fDante[i].
X;
470 fDanteYc[fNbDante] =
fDante[i].
Y;
476 fDanteA[fNbDante] =
fDante[i].
A;
512 Short_t nb_fired = 0u, which = -1;
515 if ( !
fDante[i].has_fired )
518 nb_fired++; which = i;
520 if ( nb_fired == 1 && which == 1 ) {
TRotation fRotation_tmp[4][gMaxNumberOfModules]
virtual Bool_t IsValid() const
true if it is a valid pointer
virtual VertexInterface * GetVertex()
Get the vertex data interface.
printf("******************************************************************** \n")
virtual void ShowEve(const Char_t *danteConfFile, const Char_t *agataPathFile)
show eve event display
Interface for any watcher that is a VertexBuilder.
virtual void SetBranches()
LogMessage & warning(LogMessage &)
AgataEventDisplay a class to work on a specific event display.
virtual void DoCanvas(TCanvas *c, Option_t *o)
To be overwritten by real implementation if a canvas is produced.
virtual void SetPosition(Double_t, Double_t, Double_t, Double_t=0.0)=0
Set the position of the source (last argument is used in case the position depends on time) ...
Base for a watcher on an ancillary (raw) frame.
Bool_t fIsToBeDeleted
True if the vertex frame is to be deleted by this. Otherwise it is extracted from a trigger i...
Apply the doppler correction.
static Short_t gLUT[gNumberOfItems][gMaxNumberOfModules]
void SetLastExecStatus(Short_t s=0)
reset last status. 0 means no error, 0 < means error, > 0 means ok with conditions ...
BaseDanteWatcher(const char *, const char *, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
Base class for a Watcher that fill a TTree or some branches of a TTree.
Base class for version numbers.
virtual void Exec(Option_t *option="")
watch the current frame
virtual void Exec(Option_t *option="")
watch the current frame
Base class for Dante Watcher.
LogMessage & dolog(LogMessage &)
To display the basic spectra for Dante.
virtual void Exec(Option_t *option="")
watch the current frame
virtual ~BaseDanteWatcher()
MyDante fDante[gMaxNumberOfModules]
Double_t threshold_y_down
DisplayDante(const char *, const char *, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
virtual void FillTree()
Fill the tree if it is the owner of the tree.
virtual void Exec(Option_t *option="")
watch the current frame
Float_t rawBuf[gMaxSlots *gMaxChannels+gExtraSize]
TRotation fRotation[gMaxNumberOfModules]
virtual void Exec(Option_t *option="")
watch the current frame
void SetActive(Bool_t active=true)
Toggle active task.
virtual void SetDirection(Double_t, Double_t, Double_t, Double_t=0.0)=0
set the direction of the source (last argument is used in case the position depends on time) ...
static const Short_t gMaxNumberOfModules
Double_t threshold_x_right
SharedFP * fVertexFrame
Pointer to a Vertex Frame. Has to do SharedFP since can be in the data flow.
virtual void SetBeta(Double_t, Double_t=0.0)=0
set recoil velocity
Double_t threshold_x_left
ClassImp(BaseDanteWatcher)
MyDanteTree(const char *name, const char *title, TTree *tree=0x0)
DoDanteDoppler(const char *, const char *, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
Bool_t LoadCalibration(const char *calib_file="Dante.conf")
void ChangeMeanBeta(Double_t b)
static const Short_t gNumberOfItems
Base class that described an item in a Factory.
void ComputeRealPosition(Short_t)
TTree * GetTree()
to get the current Tree