GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSIPrespecWatchers.C
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2010 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
21 // ROOT/GW includes
22 #include "GSIPrespecWatchers.h"
23 #include "Frame.h"
24 #include "AgataKeyFactory.h"
25 #include "TH2.h"
26 
27 // Prespec includes
28 #include "UnpackData.h"
29 #include "UnpackLib.h"
30 #include "SortData.h"
31 #include "SortLib.h"
32 #include "FRSCalibrData.h"
33 #include "FRSCalibr.h"
34 #include "HectorCalibrData.h"
35 #include "HectorCalibr.h"
36 #include "FRSAnl.h"
37 #include "FRSAnlData.h"
38 #include "LyccaLib.h"
39 #include "LyccaData.h"
40 
41 // system includes
42 #include <cstdlib>
43 
44 #include "eventapiV50/s_filhe_swap.h"
45 #include "eventapiV50/s_ves10_1_swap.h"
46 #include "eventapiV50/s_vehe_swap.h"
47 #include "eventapiV50/s_evhe_swap.h"
48 #include "eventapiV50/s_ve10_1_swap.h"
49 #include "eventapiV50/s_bufhe_swap.h"
50 extern "C" {
51 #include "eventapiV50/f_evt.h"
52 }
53 
54 using namespace Gw;
55 
57 
58 //Unpack::Unpack(const char *name, const char *title, TTree *tree) :
59 // BaseGSIWatcher(name,title,tree),
60 // fUnpackData(0x0),
61 // fUnpacker(0x0),
62 // fsis(8)
63 //{
64 // fUnpackData = new UnpackData(); fUnpacker = new PhDUnpacker();
65 //
66 // if ( GetTree() ) { // just add the branch for that watcher ... should be there as AddBranches is virtual and should be in this class
67 // SetBranches();
68 // }
69 // // usser's spectra
70 // BuildSpectraByUser();
71 //}
72 
73 Unpack::Unpack(const char *name, const char *title, TTree *tree, Short_t do_spectra, Short_t do_tree) :
74  BaseGSIWatcher(name,title,tree,do_spectra,do_tree),
75  fUnpackData(0x0),
76  fUnpacker(0x0),
77  fsis(8)
78 {
79  fUnpackData = new UnpackData(); fUnpacker = new PhDUnpacker();
80 
81  if ( GetTree() ) { // just add the branch for that watcher ... should be there as AddBranches is virtual and should be in this class
82  SetBranches();
83  }
84  // usser's spectra
86 }
87 
89 {
90  if ( fUnpackData )
91  delete fUnpackData;
92 
93  if ( fUnpacker )
94  delete fUnpacker;
95 }
96 
97 void Unpack::AddBranches(TTree *tree)
98 {
99  tree->Branch("UnpackData","UnpackData",&fUnpackData,32000,99);
100 }
101 
102 
104 {
105  ADF::RawFrame *rframe = 0x0; Int_t *pMBSData = 0x0;
106 
107  // if ( gDebug > 3 )
108  // fLog << info << "BaseGSIWatcher::Exec is called 1 \n" << dolog;
109 // cout << "Fill branch unpack " << endl;
110 
111  // be sure the frame has been set properly
112  if ( fMBSFrame == 0x0 || !fMBSFrame->IsValid() ) {
113 // cout << " ***Wrong frame " << endl;
114  SetLastExecStatus(-1);
115  return;
116  }
117  if ( fMBSFrame == 0x0 || !fMBSFrame->IsValid() ) {
118  SetLastExecStatus(-1);
119  return;
120  }
121  // ADF part
122  rframe =
124  // MBS part + pseudo ADF key in the MBS part
125  pMBSData = (Int_t *)(rframe->RawBuffer().Address()); ADF_MBS *ADF_MBS_Key = (ADF_MBS *)pMBSData;
126 
127  if ( ADF_MBS_Key->idmbs == 0x100 ) { // well formed 'event'
128  ADF_MBS_Key->type = 10 ; ADF_MBS_Key->subtype = 1;
129  }
130  // cout << "trigger" << ADF_MBS_Key->trigger << endl;
131 
132  if( !fUnpacker->CheckEventHeader(ADF_MBS_Key->dlen, ADF_MBS_Key->type, ADF_MBS_Key->subtype,
133  ADF_MBS_Key->dummy, ADF_MBS_Key->trigger , ADF_MBS_Key->count,
134  fUnpackData) ){
135 
136 // cout << " ***Wrong imbs frame " << endl;
137  SetLastExecStatus(-1) ;
138  return;
139  }
140 
141 
142  // now read all sub_event using eventAPI facilities ... cannot be done, no event header !
143 
144  // -3 is because apparently the coded value does not take into account additional TS,ev# in the ADF_MBS_Key structure
145  Int_t i_nrest = (ADF_MBS_Key->dlen+4)/2 - 4 - 3;
146  // or
147  // Int_t i_nrest = rframe->GetKey()->GetDataLength()/4 - sizeof(ADF_MBS_Key)/4;
148 
149  Int_t i_offset = 7; // first sub event starts at 7*4 bytes in the Data part of the Raw Frame
150 
151  // fOffset.clear();
152  while (i_nrest >= 3) {
153 
154  const s_ves10_1* p_subhead = (const s_ves10_1*)(pMBSData+i_offset);
155  Int_t i_size = (p_subhead->l_dlen-2)/2;
156  Int_t i_styp = p_subhead->i_subtype;
157  Int_t i_typ = p_subhead->i_type;
158  Int_t i_cont = p_subhead->h_control;
159 // Int_t i_crate = p_subhead->h_subcrate; //Not Used variables.
160  Int_t i_proc = p_subhead->i_procid;
161 
162  // now apply unpacker
163  fUnpacker->UnpackSubevent(i_typ, i_styp, i_size, i_proc, i_cont, ADF_MBS_Key->trigger, pMBSData + i_offset + 3,
164  fUnpackData);
165  //if ( fUnpacker->UnpackSubevent(i_typ, i_styp, i_size, i_proc, i_cont, ADF_MBS_Key->trigger,
166  // pMBSData + i_offset + 3,
167  // fUnpackData) == 0 ) SetLastExecStatus(-1);
168  i_nrest -= i_size + 3;
169  i_offset += i_size + 3;
170 
171  }
172 }
173 
174 void Unpack::Clear(Option_t * /*opt */)
175 {
176  fUnpackData->Clear();
177 }
178 
179 
181 {
182  // VME 12 is important ... hit pattern of lLYCCA strips ... should be used to have an uniform response
183 
184  Int_t i;
185  TString name = "";
186  for (i=0;i<fsis.GetSize();i++){
187  name = "raw_sis_";
188  name+=i;
189  fsis.Add( MakeTH1 <TH1F>( (const Char_t*) name,"Raw data for SIS module",6000,0,6000,"VME_AGATA") );
190  }
191  // Add a conditions name, title of condition, leaf it applies on, name, title of the associated spectrum
192  std::pair <GCond1D *, TH1 * > r1 = MakeGCond1D("C_qtrigger","Cut On qtrigger","qtrigger","qtrigger","qtrigger distribution",20,0,20);
193 }
194 
196 {
197  Int_t i;
198  for (i=0;i<fsis.GetSize();i++){
199  ((TH1 *)fsis[i])->Fill(fUnpackData->energyArray[i]);
200  }
201 }
202 
203 // SORT branch of the prespec LIB
204 
205 ClassImp(Sort);
206 
207 Sort::Sort(const char *name, const char *title, TTree *tree, Short_t do_spectra, Short_t do_tree) :
208  BaseGSIWatcher(name,title,tree,do_spectra,do_tree),
209  fUnpackData(0x0),
210  fSortData(0x0),
211  fSortClass(0x0)
212 {
213  Unpack *unpack_w = (Unpack *)Watcher::GetLastRegistered("Unpack","class");
214  if ( unpack_w == 0x0 ) {
215  fLog << error << " AN Unpack watcher should be registered before " << nline;
216  }
217  else fUnpackData = unpack_w->GetUnpackData();
218 
219  fSortData = new SortData(); fSortClass = new SortClass();
220 
221  if ( GetTree() ) { // just add the branch for that watcher ... should be there as AddBranches is virtual and should be in this class
222  SetBranches();
223  }
224 
225  // usser's spectra
227 }
228 
230 {
231  if ( fSortData )
232  delete fSortData;
233  if ( fSortClass )
234  delete fSortClass;
235 }
236 
238 {
239  fTrigger = MakeTH1 <TH1F>("Sort.trigger","Trigger @ the Sort level",20,0,20);
240 }
241 
243 {
244  fTrigger->Fill( fSortData->trigger );
245 }
246 
247 void Sort::AddBranches(TTree *tree)
248 {
249  tree->Branch("SortData","SortData",&fSortData,32000,99);
250 }
251 
253 {
254  //Add here the function for the data processing
255  fSortClass->FRSSort(fUnpackData,fSortData); //DR: ATT, not respecting const param, check it in the prespecLIB
256  fSortClass->HectorSort(fUnpackData,fSortData); //DR: ATT, not respecting const param, check it in the prespecLIB
257  fSortClass->LyccaSort(fUnpackData,fSortData); //DR: ATT, not respecting const param, check it in the prespecLIB
258  fSortClass->AgataTSort(fUnpackData,fSortData); //DR: ATT, not respecting const param, check it in the prespecLIB
259  fSortClass->FingerSort(fUnpackData,fSortData); //DR: ATT, not respecting const param, check it in the prespecLIB
260 #ifdef TRLO_F
261  fSortClass->TrloSort(fUnpackData,fSortData); //DR: ATT, not respecting const param, check it in the prespecLIB
262 #endif //TRLO_F
263 }
264 
265 void Sort::Clear(Option_t * /*opt */)
266 {
267  fSortData->Clear();
268 }
269 
271 // Calib branch of the prespec LIB //
273 
275 
276 Calibr::Calibr(const char *name, const char *title, TTree *tree, Short_t do_spectra, Short_t do_tree) :
277  BaseGSIWatcher(name,title,tree,do_spectra,do_tree),
278  fSortData(0x0),
279  fFRSCalibrData(0x0),
280  fHectorCalibrData(0x0),
281  fFRSCalibr(0x0),
282  fHectorCalibr(0x0)
283 {
284  Sort *sort_w = (Sort *)Watcher::GetLastRegistered("Sort","class");
285  if ( sort_w == 0x0 ) {
286  fLog << error << " A Sort watcher should be registered before " << nline;
287  }
288  else {
289  // fLog << error << " ******************** Ok ****************** " << dolog;
290  fSortData = sort_w->GetSortData();
291  }
292 
293  fFRSCalibrData = new FRSCalibrData(); fFRSCalibr = new FRSCalibr();
294  fHectorCalibrData = new HectorCalibrData(); fHectorCalibr = new HectorCalibr();
295 
296  if ( GetTree() ) { // just add the branch for that watcher ... should be there as AddBranches is virtual and should be in this class
297  SetBranches();
298  }
299  // usser's spectra
301 
302  fLog << dolog;
303 }
304 
306 {
307  if ( fFRSCalibrData )
308  delete fFRSCalibrData;
309  if ( fFRSCalibr )
310  delete fFRSCalibr;
311  if ( fHectorCalibrData )
312  delete fHectorCalibrData;
313  if ( fHectorCalibr )
314  delete fHectorCalibr;
315 }
316 
318 {
319  fTrigger = MakeTH1 <TH1F>("Calibr.trigger","Trigger @ the Calibr level",20,0,20);
320 }
321 
323 {
324  fTrigger->Fill(fFRSCalibrData->triggerC );
325 }
326 
327 void Calibr::AddBranches(TTree *tree)
328 {
329  tree->Branch("FRSCalibrData","FRSCalibrData",&fFRSCalibrData,32000,99);
330  tree->Branch("HectorCalibrData","HectorCalibrData",&fHectorCalibrData,32000,99);
331 }
332 
334 {
335  //Add here the function for the data processing
336  fFRSCalibr->Process_FRS_Calibr(fSortData,fFRSCalibrData); // Process all FRS
338 }
339 
340 void Calibr::Clear(Option_t * /*opt */)
341 {
342  fFRSCalibrData->Clear();
343  fHectorCalibrData->Clear();
344 }
345 
346 ClassImp(Anl);
347 
348 Anl::Anl(const char *name, const char *title, TTree *tree, Short_t do_spectra, Short_t do_tree) :
349  BaseGSIWatcher(name,title,tree,do_spectra,do_tree),
350  fSortData(0x0),
351  fFRSCalibrData(0x0),
352  fHectorCalibrData(0x0),
353  fFRSAnl(0x0),
354  fFRSAnlData(0x0),
355  fLyccaLib(0x0),
356  fLyccaData(0x0)
357 {
358  Sort *sort_w = (Sort *)Watcher::GetLastRegistered("Sort","class");
359  if ( sort_w == 0x0 ) {
360  fLog << error << " A Sort watcher should be registered before " << nline;
361  }
362  else fSortData = sort_w->GetSortData();
363 
364  Calibr *calib_w = (Calibr *)Watcher::GetLastRegistered("Calibr","class");
365  if ( calib_w == 0x0 ) {
366  fLog << error << " A Calib watcher should be registered before " << nline;
367  }
368  else {
369  fFRSCalibrData = calib_w->GetFRSCalibrData();
371  }
372 
373  //ANALAYSE FRS
374  fFRSAnlData = new FRSAnlData(); fFRSAnl = new FRSAnl();
375  fLyccaData = new LyccaData(); fLyccaLib = new LyccaLib();
376 
377  if ( GetTree() ) { // just add the branch for that watcher ... should be there as AddBranches is virtual and should be in this class
378  SetBranches();
379  }
380  // usser's spectra
382 
383  fLog << dolog;
384 }
385 
387 {
388  if ( fFRSAnlData )
389  delete fFRSAnlData;
390  if ( fFRSAnl )
391  delete fFRSAnl;
392  if ( fLyccaData )
393  delete fLyccaData;
394  if ( fLyccaLib )
395  delete fLyccaLib;
396 }
397 
399 {
400  fTa_PvsN = MakeTH2 <TH2F>("Calibr.TA_PvsN","Target DSSD P energy vs N energy",1000,0,2000,1000,0,2000);
401  fTa_PvsP = MakeTH2 <TH2F>("Calibr.TA_PvsP","Target DSSD P energy vs P energy",1000,0,2000,1000,0,2000);
402  fTa_NvsN = MakeTH2 <TH2F>("Calibr.TA_NvsN","Target DSSD N energy vs N energy",1000,0,2000,1000,0,2000);
403  fTa_N_strip = MakeTH2 <TH2F>("Calibr.N_strip","Target DSSD N energy vs strip number",32,0,32,1000,0,2000);
404  fTa_P_strip = MakeTH2 <TH2F>("Calibr.P_strip","Target DSSD P energy vs strip number",32,0,32,1000,0,2000);
405 
406  fWall_D06_NvsP = MakeTH2 <TH2F>("Calibr.Wall_D06_PvsN","Wall DSSD module 06, P versus N side",1000,0,2000,1000,0,2000);
407  fWall_D07_NvsP = MakeTH2 <TH2F>("Calibr.Wall_D07_PvsN","Wall DSSD module 07, P versus N side",1000,0,2000,1000,0,2000);
408  fWall_D11_NvsP = MakeTH2 <TH2F>("Calibr.Wall_D11_PvsN","Wall DSSD module 11, P versus N side",1000,0,2000,1000,0,2000);
409  fWall_D12_NvsP = MakeTH2 <TH2F>("Calibr.Wall_D12_PvsN","Wall DSSD module 12, P versus N side",1000,0,2000,1000,0,2000);
410  fWall_D13_NvsP = MakeTH2 <TH2F>("Calibr.Wall_D13_PvsN","Wall DSSD module 13, P versus N side",1000,0,2000,1000,0,2000);
411  fWall_D14_NvsP = MakeTH2 <TH2F>("Calibr.Wall_D14_PvsN","Wall DSSD module 14, P versus N side",1000,0,2000,1000,0,2000);
412  fWall_D18_NvsP = MakeTH2 <TH2F>("Calibr.Wall_D18_PvsN","Wall DSSD module 18, P versus N side",1000,0,2000,1000,0,2000);
413  fWall_D19_NvsP = MakeTH2 <TH2F>("Calibr.Wall_D19_PvsN","Wall DSSD module 19, P versus N side",1000,0,2000,1000,0,2000);
414 
415 }
416 
418 {
419  for(int i=0;i<31;i++){
420  for(int j=0;j<31;j++){
421  fTa_PvsN->Fill(fLyccaData->t_DSSD_EcalN[i],fLyccaData->t_DSSD_EcalP[j]);
422  fTa_PvsP->Fill(fLyccaData->t_DSSD_EcalP[i],fLyccaData->t_DSSD_EcalP[j]);
423  fTa_NvsN->Fill(fLyccaData->t_DSSD_EcalN[i],fLyccaData->t_DSSD_EcalN[j]);
424  }
425  fTa_N_strip->Fill(i,fLyccaData->t_DSSD_EcalN[i]);
426  fTa_P_strip->Fill(i,fLyccaData->t_DSSD_EcalP[i]);
427  }
428  //Fill spectra of the wall DSSD
429  for (int i=0;i<16;i++){
430  for(int j=0;j<16;j++){
431  fWall_D06_NvsP->Fill(fLyccaData->w_DSSD_EcalN[06][i],fLyccaData->w_DSSD_EcalP[06][j]);
432  fWall_D07_NvsP->Fill(fLyccaData->w_DSSD_EcalN[07][i],fLyccaData->w_DSSD_EcalP[07][j]);
433  fWall_D11_NvsP->Fill(fLyccaData->w_DSSD_EcalN[11][i],fLyccaData->w_DSSD_EcalP[11][j]);
434  fWall_D12_NvsP->Fill(fLyccaData->w_DSSD_EcalN[12][i],fLyccaData->w_DSSD_EcalP[12][j]);
435  fWall_D13_NvsP->Fill(fLyccaData->w_DSSD_EcalN[13][i],fLyccaData->w_DSSD_EcalP[13][j]);
436  fWall_D14_NvsP->Fill(fLyccaData->w_DSSD_EcalN[14][i],fLyccaData->w_DSSD_EcalP[14][j]);
437  fWall_D18_NvsP->Fill(fLyccaData->w_DSSD_EcalN[18][i],fLyccaData->w_DSSD_EcalP[18][j]);
438  fWall_D19_NvsP->Fill(fLyccaData->w_DSSD_EcalN[19][i],fLyccaData->w_DSSD_EcalP[19][j]);
439  }
440  }
441 }
442 
443 
444 void Anl::AddBranches(TTree *tree)
445 {
446  tree->Branch("FRSAnlData","FRSAnlData",&fFRSAnlData,32000,99);
447  tree->Branch("LyccaData","LyccaData",&fLyccaData,32000,99);
448 }
449 
451 {
452  //ANALYSE FRS
453  fFRSAnl->Process_FRS_IDS(fFRSAnlData,fFRSCalibrData);
455 }
456 
457 void Anl::Clear(Option_t * /* opt */ )
458 {
459  fFRSAnlData->Clear();
460  fLyccaData->Clear();
461 }
462 
464 
465 LightLYCCAVertexBuilder_1::LightLYCCAVertexBuilder_1(const char *name, const char *title):
466  Gw::WatcherWithTag(name, title,0x0,0x0),
467  VertexBuilder(),
468  fMeanBeta(0.5),
469  fZTa_Wall(3670.),
470  fZTDSSDOffset(0.0),
471  fcosTheta(0.0)
472 {
473  //3590 -> 3670 as distance
474  // use to pass the vertex information from this watcher to another watcher
475  fVertexFrame = MainFrameFactory::theMainFactory().
476  NewSharedFrame( FactoryItem("Agata","meta:vertex",Version(0,0)), FactoryItem("Agata","meta:vertex",Version(1,1)) );
477  fIsToBeDeleted = true;
478 
479  // data provided by analysis are required
480  Anl *anl_w = (Anl *)Watcher::GetLastRegistered("Anl","class");
481  if ( anl_w == 0x0 ) {
482  fLog << error << " A Anl watcher should be registered before " << nline;
483  }
484  fLyccaData = anl_w->GetLyccaData();
485 }
486 
487 void LightLYCCAVertexBuilder_1::SetTA_Wall(Double_t z_tdssd_offset, Double_t ta_wall)
488 {
489  fZTa_Wall = ta_wall; fZTDSSDOffset = z_tdssd_offset;
490 }
491 
493 {
494  fMeanBeta = beta;
495 }
496 
498 {
499  fMeanBeta = fLyccaData->LYCCA_Beta_Cor;
500 }
501 
502 void LightLYCCAVertexBuilder_1::SetTheta(Double_t cosTheta)
503 {
504  fcosTheta=cosTheta;
505 }
506 
508 {
509  return fcosTheta;
510 }
511 void LightLYCCAVertexBuilder_1::SetPosWall(Double_t xw,Double_t yw, Double_t zw)
512 {
513  fWallPosx=xw; fWallPosy=yw; fWallPosz=zw;
514  // cout << fWallPosx <<" " << fWallPosy << " " << fWallPosz << endl;
515 
516 }
517 
518 void LightLYCCAVertexBuilder_1::GetPosWall(Double_t & xw,Double_t &yw, Double_t & zw)
519 {
520  xw=fWallPosx; yw=fWallPosy; zw=fWallPosz;
521  // cout << fWallPosx <<" " << fWallPosy << " " << fWallPosz << endl;
522 // cout << xw <<" " << yw << " " << zw << endl;
523 }
524 
525 void LightLYCCAVertexBuilder_1::Exec(Option_t * /*option*/)
526 {
527  // prepare the vertex so that it is defined in the agata reference system using fZTDSSDOffset.
528  // Is is the Z position of target DSSD in AGATA Frameworkork
529  // fZTDSSDOffset > 0 means target DSSD is in positive direction compared to agata center (following beam direction)
530  // fZTDSSDOffset < 0 means target DSSD is in negative direction compared to agata center (following beam direction)
531 // SetVertex(fLyccaData->Pos_target_x1,fLyccaData->Pos_target_y1,fZTDSSDOffset,
532 // fLyccaData->w_DSSD_x-fLyccaData->Pos_target_x1,fLyccaData->w_DSSD_y-fLyccaData->Pos_target_y1,fZTa_Wall,
533 // fMeanBeta);
534  //Other posisition/vertex
536  Float_t TA_TO_WALL = 7628 - 4016;
537  Float_t OFFSET_FROM_CENTER_AGATA = 0;
538  LightLYCCAVertexBuilder_1::SetTA_Wall(OFFSET_FROM_CENTER_AGATA, TA_TO_WALL);//input manually for the moment. TODO:from parameter files.
539  SetVertex(fLyccaData->Pos_target_x2,fLyccaData->Pos_target_y2,fZTDSSDOffset,
540  fLyccaData->Pos_deltaX2,fLyccaData->Pos_deltaY2,fZTa_Wall,
541  fMeanBeta);
542  LightLYCCAVertexBuilder_1::SetPosWall(fLyccaData->w_DSSD_x, fLyccaData->w_DSSD_y, TA_TO_WALL);
543 
544 
545 }
546 
547 /* method to unpack all in Go4
548 void TSPEUnpackProc::GeneralUnpacker(TSPEUnpackEvent* tgt)
549 {
550 
551  tgt->SetValid(kFALSE); // by default output event rejected
552 
553  tgt->n_tracked_gammas = 0;
554 
555  // Unpack data structure for non go4 dependant librairy
556  // The pointer (public field) of the structure has to be copy/link with
557  // the one from the TSPEUnpackEvent *tgt.
558  // UnpackData *data_unpack = new UnpackData;
559 
560  TGo4MbsEvent *fInput = dynamic_cast<TGo4MbsEvent*> (GetInputEvent());
561  if (fInput==0) return;
562 
563  Int_t qLength = fInput->GetDlen() ;
564  Int_t qType = fInput->GetType() ;
565  Int_t qSubType = fInput->GetSubtype();
566  Int_t qDummy = fInput->GetDummy() ;
567  Int_t qTrigger = fInput->GetTrigger();
568  Int_t qEventNr = fInput->GetCount() ;
569 
570  if( ! fUnpacker->CheckEventHeader(qLength, qType, qSubType,
571  qDummy, qTrigger, qEventNr,
572  tgt) ) return ;
573 
574  // Event OK, now assign pointer to local subevent header!
575  fInput->ResetIterator();
576  TGo4MbsSubEvent *psubevt = 0;
577 
578  // fInput->PrintEvent();
579 
580  while ((psubevt=fInput->NextSubEvent())!= 0) { // start subevents loop
581  Int_t subEventType = psubevt->GetType();
582  Int_t subEventSubType = psubevt->GetSubtype();
583  Int_t *pData = psubevt->GetDataField();
584  Int_t lenMax = (psubevt->GetDlen()-2)/2; // Count how many words we have to decode
585  Int_t procId = psubevt->GetProcid();
586  Int_t controlId = psubevt->GetControl();
587 
588  //Unpack the sub-event, if successful fill the histograms
589  fUnpacker->UnpackSubevent(subEventType,subEventSubType,
590  lenMax, procId, controlId, qTrigger,
591  pData,
592  tgt) ;
593 
594  }; // end subevents loop
595 
596  FillHistograms(qTrigger, tgt);
597 
598  tgt->SetValid(kTRUE); // accept event
599 }
600 */
601 /*
602 void get_position(Int_t* event_data, s_vehe* event_header , char* option, Float_t& posX, Float_t& posY, Float_t& multiX,Float_t& multiY,Float_t& maxEX, Float_t& maxEY)
603 {
604  bool DSSDUseSubPixelAlgorithm;
605  if (option == "sub_pixel_algo") DSSDUseSubPixelAlgorithm = true;
606  else DSSDUseSubPixelAlgorithm = false;
607 
608  Int_t raw_vme12[3][32]; // LYCCA target
609 
610  for (int j=0;j<32;j++) for (int i=0;i<3;i++) raw_vme12[i][j]=-1;
611  int result = 0;
612  Int_t trigNum = event_header->i_trigger;
613 
614  //Get data pointeur of subevent from the data pointeur of event (MBS API)
615  //proper cast.
616  s_ves10_1 *subevent_header = 0;
617  INTS4 *sub_evt_data = 0;
618  INTS4 length = 0;
619  Int_t procID = 0;
620  Int_t controlID = 0;
621  int sub_event_nb = 0;
622 
623  // Get subevent 9
624  sub_event_nb = 8; //the 9th subevent in the dataflow -> LYCCA procID90
625  result = f_evt_get_subevent((s_ve10_1*)(event_header), sub_event_nb, (INTS4**)&subevent_header, (INTS4**)&sub_evt_data, &length);
626 
627  if((trigNum==2)||(trigNum==3)||(trigNum==4)||(trigNum==5)||(trigNum==7)) {
628  procID = subevent_header->i_procid;
629  controlID= subevent_header->h_control;
630  if (result==GETEVT__SUCCESS && procID==90 && (controlID == 20 || controlID == 21)){
631  GetRaw_target(sub_evt_data,length,procID,raw_vme12); }
632  }
633 
634 */
635 
636 
637 
638 
virtual ~Sort()
LyccaLib * fLyccaLib
virtual Bool_t IsValid() const
true if it is a valid pointer
Definition: Frame.h:616
PhDUnpacker * fUnpacker
helper class to unpack data, see prespec library
LyccaData * GetLyccaData()
to get back the Data from LYCCA
TH2 * fTa_PvsP
void GetPosWall(Double_t &, Double_t &, Double_t &)
Get the position of the recoil on the wallD.
virtual Frame * GetFrame() const
Definition: Frame.h:625
virtual void Clear(Option_t *="")
Should be used to reset a various data filled by this watcher.
TH2 * fWall_D07_NvsP
SortClass * fSortClass
helper class to sort data from an UnpackData, see prespec library
Interface for any watcher that is a VertexBuilder.
virtual void AddBranches(TTree *tree)
Add the specific branches filled by this watcher to the given tree.
virtual void SetVertex(Double_t=0., Double_t=0., Double_t=0., Double_t=0., Double_t=0., Double_t=1., Double_t=0.02)
modify the current vertext definition. In principle done by event by event in Exec ...
LogMessage & error(LogMessage &)
UnpackData * fUnpackData
UnpackData, see prespec library.
FRSCalibrData * fFRSCalibrData
CalibrData, see prespec library.
virtual void Clear(Option_t *="")
Should be used to reset a various data filled by this watcher.
void BuildSpectraByUser()
define user spectra ... to be implementted by user only if it defines its ones spectra without condit...
Int_t count
Definition: GSIWatchers.h:41
SortData * fSortData
Sort step is mandatory before calling this.
virtual void FillBranches()
Should be used to reset a various data filled by this watcher.
TH2 * fTa_NvsN
void FillSpectraByUser()
Fill user spectra ... to be implementted by user only if it defines its ones spectra without conditio...
Int_t idmbs
Definition: GSIWatchers.h:38
void FillSpectraByUser()
Fill user spectra ... to be implementted by user only if it defines its ones spectra without conditio...
void FillSpectraByUser()
Fill user spectra ... to be implementted by user only if it defines its ones spectra without conditio...
FRSCalibrData * GetFRSCalibrData()
to get back the CalibrData from FRS
TH2 * fTa_N_strip
virtual void AddBranches(TTree *tree)
Add the specific branches filled by this watcher to the given tree.
TH2 * fWall_D18_NvsP
LogMessage & nline(LogMessage &)
Bool_t fIsToBeDeleted
True if the vertex frame is to be deleted by this. Otherwise it is extracted from a trigger i...
TH2 * fTa_PvsN
virtual void AddBranches(TTree *tree)
Add the specific branches filled by this watcher to the given tree.
FRSAnlData * fFRSAnlData
UnpackData * fUnpackData
Unpack step is mandatory before calling this.
FRSCalibr * fFRSCalibr
helper class to sort data from an UnpackData, see prespec library
void SetTA_Wall(Double_t z_tdssd_offset=0, Double_t ta_wall=3590.)
tdssd_offset is the z position of target DSSD in the AGATA FrameWork, ta_wall distance from ta to wal...
void SetPosWall(Double_t, Double_t, Double_t)
Set the position of the recoil on the wallD.
virtual void AddBranches(TTree *tree)
Add the specific branches filled by this watcher to the given tree.
HectorCalibrData * fHectorCalibrData
Calibr(const char *name, const char *title, TTree *tree=0x0, Short_t do_spectra=2, Short_t do_tree=2)
void BuildSpectraByUser()
define user spectra ... to be implementted by user only if it defines its ones spectra without condit...
Anl(const char *name, const char *title, TTree *tree=0x0, Short_t do_spectra=2, Short_t do_tree=2)
TObjArray fsis
void BuildSpectraByUser()
define user spectra ... to be implementted by user only if it defines its ones spectra without condit...
TH2 * fWall_D13_NvsP
virtual ~Unpack()
Sort(const char *name, const char *title, TTree *tree=0x0, Short_t do_spectra=2, Short_t do_tree=2)
virtual std::pair< GCond1D *, TH1 * > MakeGCond1D(const Char_t *name_cond, const Char_t *title_cond, const Char_t *name_leaf, const Char_t *name_hist, const Char_t *title_hist, Int_t bin, Double_t min, Double_t max, Option_t *opt="F", const Char_t *sub="")
Build a 1D condition using the given leaf. It allocates also the spectrum.
void SetLastExecStatus(Short_t s=0)
reset last status. 0 means no error, 0 < means error, > 0 means ok with conditions ...
Definition: Watchers.h:294
header file for Frame.cpp
LogMessage fLog
Definition: Watchers.h:86
virtual void FillBranches()
Should be used to reset a various data filled by this watcher.
void SetMeanBeta(Double_t beta=0.5)
Change mean beta.
Base class for version numbers.
Definition: Version.h:38
LightLYCCAVertexBuilder_1(const char *, const char *)
void FillSpectraByUser()
Fill user spectra ... to be implementted by user only if it defines its ones spectra without conditio...
FRSCalibrData * fFRSCalibrData
CalibrData, see prespec library.
virtual void Clear(Option_t *="")
Should be used to reset a various data filled by this watcher.
Short_t trigger
Definition: GSIWatchers.h:36
helper structure to decode the data content of the additional key following the ADF key ...
Definition: GSIWatchers.h:31
A RawFrame gives direct access to the underlying buffer.
Definition: Frame.h:557
TH2 * fTa_P_strip
header file for AgataKeyFactory.cpp
LogMessage & dolog(LogMessage &)
void BuildSpectraByUser()
watch the current frame i.e. fill the UnpackData with the content of the MBS Frame ...
Short_t dummy
Definition: GSIWatchers.h:37
virtual void FillBranches()
Should be used to reset a various data filled by this watcher.
virtual BufferIO & RawBuffer()
This method gives access in reading/writing mode to the underlying data buffer.
Definition: Frame.h:580
Sort data from unpackdata watchers.
virtual void Clear(Option_t *="")
clear the current event attached to the different branches
SortData * GetSortData()
to get back the SortData
Double_t GetTheta()
Get the cosinus of the angle.
TH2 * fWall_D12_NvsP
Short_t subtype
Definition: GSIWatchers.h:34
void SetTheta(Double_t cosTheta)
Set the cos of the angle.
Unpack data from mbs encapsulated in ADF frame.
TH2 * fWall_D11_NvsP
void SetBeta()
Set Lycca beta.
ADF::SharedFP * fMBSFrame
MBS data are encapsulated in an ADF Frame.
Definition: GSIWatchers.h:51
TH1 * fTrigger
LyccaData * fLyccaData
Base for a watcher on an ancillary (raw) frame @ GSI.
Definition: GSIWatchers.h:47
virtual ~Calibr()
FRSAnl * fFRSAnl
For the Analysis step.
virtual void Exec(Option_t *option="")
watch the current frame
HectorCalibr * fHectorCalibr
ClassImp(Unpack)
TH2 * fWall_D06_NvsP
Unpack(const char *name, const char *title, TTree *tree=0x0, Short_t do_spectra=2, Short_t do_tree=2)
SharedFP * fVertexFrame
Pointer to a Vertex Frame. Has to do SharedFP since can be in the data flow.
UnpackData * GetUnpackData()
to get back the UnpackData
Int_t dlen
Definition: GSIWatchers.h:33
SortData * fSortData
SortData, see prespec library.
Char_t * Address()
for classes that needs it to write directly data into it.
Definition: BufferIO.h:98
HectorCalibrData * fHectorCalibrData
HectorCalibrData * GetHectorCalibrData()
to get back the CalibrData from Hector
Short_t type
Definition: GSIWatchers.h:35
TH2 * fWall_D19_NvsP
virtual void FillBranches()
fill the current event attached to the different branches
SortData * fSortData
Sort step is mandatory before calling this.
virtual ~Anl()
virtual void SetBranches()
add branches to the tree and the ciruclar tree
TH2 * fWall_D14_NvsP
Base class that described an item in a Factory.
Definition: FactoryItem.h:52
TTree * GetTree()
to get the current Tree