GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Producer.C
Go to the documentation of this file.
1 
2 
3 #include "ConfAgent.h"
4 #include "DFAgent.h"
5 
6 #include "AgataKeyFactory.h"
7 #include "AgataFrameFactory.h"
8 #include "BufferIO.h"
9 #include "ConfigurationFrame.h"
10 
11 #ifndef ADF_PSAFrame
12 #include "PSAFrame.h"
13 #endif
14 #ifndef ADF_TrackedFrame
15 #include "TrackedFrame.h"
16 #endif
17 #ifndef ADF_AgataCompositeFrame
18 #include "AgataCompositeFrame.h"
19 #endif
20 
21 #include <iostream>
22 #include <sstream>
23 #include <string>
24 
25 /*
26 compilation:
27  g++ -O -Wall -fPIC -I../ -L../ -lADF producer.c -o producer
28  g++ -g -pg -I../ -L../ -lADF producer.c -o producer
29 
30 --> DEBUG
31 Linux SL4
32 
33 --> VALGRIND
34 
35 Memory leak
36 Profiling
37 
38 */
39 
40 using namespace ADF;
41 
43 
47 int test1(UInt_t nb = 5000)
48 {
49  // To customise
50  // the factory for everything
51  const char factory[] = "Agata";
52  // the type of the produced frame
53  const char frame_type[] = "data:psa";
54  // the version of the primary key and the frame produced
55  Version key_v(2,0), frame_v(65000,1);
56  // end to customize ... works without any changes after
57 
58  // FactoryItem
59  FactoryItem prikeydef(factory,frame_type,key_v);
60  FactoryItem aframedef(factory,frame_type,frame_v);
61 
62  // Check factories are loaded (in principle done at least for the factories defined in ADF)
63  if ( !MainFrameFactory::theMainFactory().IsKnown(aframedef.GetFactoryName().data()) )
64  { std::cout << " Agata Factory not properly loaded " << std::endl; return 1; }
65 
66  // Ask global agent to fill a Configuration frame which is dumped
67  Frame *frame = NULL;
68  frame = MainFrameFactory::theMainFactory().New(prikeydef,aframedef);
69 
70  // change the agent to take into account this configuration
71  ConfAgent::theGlobalAgent()->GetDFAgent()->SetComment("from producer.c");
73 
74  Frame *cframe = NULL;
75  cframe = MainFrameFactory::theMainFactory().New(FactoryItem(factory,"conf:global",key_v),
76  FactoryItem(factory,"conf:global",frame_v));
77 
78  ConfigurationFrame *gconfframe = NULL;
79  if ( cframe )
80  gconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
81 
82  ConfAgent::theGlobalAgent()->GetDFAgent()->Configure(gconfframe,"out");
83  gconfframe->Dump("AFP_0000.adf",true);
84  gconfframe->Dump("AFP_0001.adf",true);
85 
86  for( UInt_t i = 0u; i < nb; i++ ){
87  frame->Stallion();
88  if ( i < nb / 2 )
89  frame->Dump("AFP_0000.adf");
90  else
91  frame->Dump("AFP_0001.adf");
92  }
93 
94  if ( frame )
95  delete frame;
96  if ( gconfframe )
97  delete gconfframe;
98 
99  return 0;
100 }
101 
103 
109 int test2(UInt_t nb = 5000)
110 {
111  // To customise
112  // the factory for everything
113  const char factory[] = "Agata";
114  // the two types of embedded frames
115  const char frame_type1[] = "data:psa";
116  const char frame_type2[] = "data:crystal";
117  // the version of the primary key and the frames to be embedded
118  Version key_v(1,0), frame_v1(65000,0),frame_v2(65000,0);
119  // end to customize ... works without any changes after
120 
121  FactoryItem prikeydef1(factory,frame_type1,key_v);
122  FactoryItem aframedef1(factory,frame_type1,frame_v1);
123  FactoryItem prikeydef2(factory,frame_type2,key_v);
124  FactoryItem aframedef2(factory,frame_type2,frame_v2);
125 // FactoryItem prikeydef(factory,"agata",key_v);
126 
127  // Check factories are loaded (in principle done at least for the factories defined in ADF)
128  if ( !MainFrameFactory::theMainFactory().IsKnown(aframedef1.GetFactoryName().data()) )
129  { std::cout << " Agata Factory not properly loaded " << std::endl; return 1; }
130 
131  // Ask global agent to fill a Configuration frame which is dumped
132  Frame *frame1 = NULL;
133  frame1 = MainFrameFactory::theMainFactory().New(prikeydef1,aframedef1);
134  Frame *frame2 = NULL;
135  frame2 = MainFrameFactory::theMainFactory().New(prikeydef2,aframedef2);
136 
137  // change the agent to take into account this configuration
138  ConfAgent::theGlobalAgent()->GetDFAgent()->SetComment("from producer.c");
139 
142 
143  Frame *cframe = NULL;
144  cframe = MainFrameFactory::theMainFactory().New(FactoryItem(factory,"conf:global",key_v),
145  FactoryItem(factory,"conf:global",key_v));
146 
147  ConfigurationFrame *gconfframe = NULL;
148  if ( cframe )
149  gconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
150 
151  ConfAgent::theGlobalAgent()->GetDFAgent()->Configure(gconfframe,"out");
152  gconfframe->Dump("AFP_0000.adf",true);
153  gconfframe->Dump("AFP_0001.adf",true);
154 
155  for( UInt_t i = 0u; i < nb; i++ ){
156  frame1->Stallion();
157  frame2->Stallion();
158  if ( i < nb / 2 ) {
159  frame1->Dump("AFP_0000.adf");
160  frame2->Dump("AFP_0000.adf");
161  }
162  else {
163  frame1->Dump("AFP_0001.adf");
164  frame2->Dump("AFP_0001.adf");
165  }
166  }
167 
168  if ( frame1 )
169  delete frame1;
170  if ( frame2 )
171  delete frame2;
172  if ( gconfframe )
173  delete gconfframe;
174 
175  return 0;
176 }
177 
179 
186 int test3(UInt_t nb = 5000)
187 {
188  // To customise
189  // the factory for everything
190  const char factory[] = "Agata";
191  // the two types of embedded frames
192  const char frame_type1[] = "data:psa";
193  const char frame_type2[] = "data:tracked";
194  const char frame_type3[] = "data:ranc1";
195 
196  // the version of the primary key and the frames to be embedded
197  Version key_v(4,0), frame_v1(65000,1),frame_v2(65000,0), frame_v3(65000,0);
198  // end to customize ... works without any changes after
199 
200  FactoryItem mainkeydef(factory,"event:data",key_v);
201  FactoryItem mainframedef(factory,"event:data",key_v);
202 
203  FactoryItem prikeydef1(factory,frame_type1,key_v);
204  FactoryItem aframedef1(factory,frame_type1,frame_v1);
205  FactoryItem prikeydef2(factory,frame_type2,key_v);
206  FactoryItem aframedef2(factory,frame_type2,frame_v2);
207  FactoryItem prikeydef3(factory,frame_type3,key_v);
208  FactoryItem aframedef3(factory,frame_type3,frame_v3);
209 
210  // Check factories are loaded (in principle done at least for the factories defined in ADF)
211  if ( !MainFrameFactory::theMainFactory().IsKnown(aframedef1.GetFactoryName().data()) )
212  { std::cout << " Agata Factory not properly loaded " << std::endl; return 1; }
213 
214  // Ask global agent to fill a Configuration frame which is dumped
215  Frame *mainframe = NULL;
216  mainframe = MainFrameFactory::theMainFactory().New(mainkeydef,mainframedef);
217 
218  Frame *frame1 = NULL;
219  frame1 = MainFrameFactory::theMainFactory().New(prikeydef1,aframedef1);
220  Frame *frame2 = NULL;
221  frame2 = MainFrameFactory::theMainFactory().New(prikeydef2,aframedef2);
222  Frame *frame3 = NULL;
223  frame3 = MainFrameFactory::theMainFactory().New(prikeydef3,aframedef3);
224 
225  Frame *cframe = NULL;
226  cframe = MainFrameFactory::theMainFactory().New(FactoryItem("Agata","conf:global",key_v),
227  FactoryItem("Agata","conf:global",frame_v1));
228 
229  // change the agent to take into account this configuration
230  ConfAgent::theGlobalAgent()->GetDFAgent()->SetComment("from producer.c");
235 
236  ConfigurationFrame *gconfframe = NULL;
237  if ( cframe )
238  gconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
239 
240  ConfAgent::theGlobalAgent()->GetDFAgent()->Configure(gconfframe,"out");
241  gconfframe->Dump("AFP_0000.adf",true);
242  gconfframe->Dump("AFP_0001.adf",true);
243 
244  Int_t nb_count[4]; memset(nb_count,0,4*sizeof(Int_t)); Int_t ranc_alone = 0;
245 
246  for( UInt_t i = 0u; i < nb; i++ ){
247 
248  mainframe->Reset(); frame1->Reset(); frame2->Reset(); frame3->Reset();
249 
250  frame1->Stallion();
251  frame2->Stallion();
252  frame3->Stallion();
253 
254  mainframe->AddSubFrame((*frame1));
255  nb_count[0]++;
256 
257  if ( i % 10 > 0 ) {
258  mainframe->AddSubFrame((*frame2));
259  nb_count[1]++;
260  if ( i % 2 == 0 ) {
261  nb_count[3]++;
262  mainframe->AddSubFrame((*frame3));
263  }
264  }
265  else {
266  if ( ranc_alone % 3 ) {
267  nb_count[2]++;
268  mainframe->AddSubFrame((*frame3));
269  }
270  ranc_alone++;
271  }
272 
273  mainframe->Write();
274 
275  if ( i < nb / 2 )
276  mainframe->Dump("AFP_0000.adf");
277  else
278  mainframe->Dump("AFP_0001.adf");
279  }
280  printf(" C0 %d C1 %d C2 %d C3 %d \n",nb_count[0],nb_count[1],nb_count[2],nb_count[3]);
281 
282  if ( mainframe )
283  delete mainframe;
284  if ( frame1 )
285  delete frame1;
286  if ( frame2 )
287  delete frame2;
288  if ( gconfframe )
289  delete gconfframe;
290 
291  return 0;
292 }
293 
294 UShort_t crystal_id = 0u, crystal_status = 0u, PSAStatus = 0; // to test Global
295 Short_t T0;
296 Float_t CoreE1, CoreE2;
297 
298 void PSAStallion(Frame *frame)
299 {
300  PSAInterface *data = GetDataPointer<PSAInterface>(frame);
301 
302  frame->Reset();
303 
304  data->Global()->LinkItem("CrystalID",&crystal_id);
305  data->Global()->LinkItem("CrystalStatus",&crystal_status);
306  data->Global()->LinkItem("PSAStatus",&PSAStatus);
307  data->Global()->LinkItem("T0",&T0);
308  data->Global()->LinkItem("CoreE1",&CoreE1);
309  data->Global()->LinkItem("CoreE2",&CoreE2);
310 
312  T0 = 69;
313  CoreE1 = 1332.516;
314  CoreE2 = 1332.;
315 
316  // fill the hits
317  for (UInt_t h = 0u; h < 3u; h++){
318 
319  Hit *ahit = data->NewHit();
320 
321  if ( h == 0u ) { ahit->SetE(1000.); ahit->SetDE(2.5); }
322  if ( h == 1u ) { ahit->SetE(300.); ahit->SetDE(1.2); }
323  if ( h == 2u ) { ahit->SetE(32.516);ahit->SetDE(0.5); }
324 
325  ahit->SetT(1.2*h);
326  ahit->SetDT(1.2*h);
327 
328  ahit->SetXYZ(5.,10.,15.);
329  ahit->SetDXYZ(1.,2.,3.);
330 
331  ahit->SetStatus(h);
332  }
333  frame->Write();
334 }
335 
337 
341 int dummy1(UInt_t nb = 5000)
342 {
343  // To customise
344  // the factory for everything
345  const char factory[] = "Agata";
346  // the type of the produced frame
347  const char frame_type[] = "data:psa";
348  // the version of the primary key and the frame produced
349  Version key_v(2,0), frame_v(65000,1);
350  // end to customize ... works without any changes after
351 
352  // FactoryItem
353  FactoryItem prikeydef(factory,frame_type,key_v);
354  FactoryItem aframedef(factory,frame_type,frame_v);
355 
356  // Check factories are loaded (in principle done at least for the factories defined in ADF)
357  if ( !MainFrameFactory::theMainFactory().IsKnown(aframedef.GetFactoryName().data()) )
358  { std::cout << " Agata Factory not properly loaded " << std::endl; return 1; }
359 
360  // Ask global agent to fill a Configuration frame which is dumped
361  Frame *frame = NULL;
362  frame = MainFrameFactory::theMainFactory().New(prikeydef,aframedef);
363 
364  Frame *cframe = NULL;
365  cframe = MainFrameFactory::theMainFactory().New(FactoryItem(factory,"conf:global",key_v),
366  FactoryItem("Agata","conf:global",frame_v));
367 
368  ConfigurationFrame *gconfframe = NULL;
369  if ( cframe )
370  gconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
371 
372  // change the agent to take into account this configuration
373  ConfAgent::theGlobalAgent()->GetDFAgent()->SetComment("from producer.c");
375 
376  ConfAgent::theGlobalAgent()->GetDFAgent()->Configure(gconfframe,"out");
377  gconfframe->Dump("AFP_0000.adf",true);
378  gconfframe->Dump("AFP_0001.adf",true);
379 
380  for( UInt_t i = 0u; i < nb; i++ ){
381  PSAStallion(frame);
382  if ( i < nb / 2 )
383  frame->Dump("AFP_0000.adf");
384  else
385  frame->Dump("AFP_0001.adf");
386  }
387 
388  if ( frame )
389  delete frame;
390  if ( gconfframe )
391  delete gconfframe;
392 
393  return 0;
394 }
395 
397 
400 int dummy2(UInt_t nb = 5000)
401 {
402  // To customise
403  // the factory for everything
404  const char factory[] = "Agata";
405  // the two types of embedded frames, the first one should stay data:psa
406  const char frame_type1[] = "data:psa";
407  const char frame_type2[] = "data:crystal";
408  // the version of the primary key and the frames to be embedded
409  Version key_v(2,0), frame_v1(65000,1),frame_v2(65000,0);
410  // end to customize ... works without any changes after
411 
412  FactoryItem mainkeydef(factory,"event:data",key_v);
413  FactoryItem mainframedef(factory,"event:data",key_v);
414 
415  FactoryItem prikeydef1(factory,frame_type1,key_v);
416  FactoryItem aframedef1(factory,frame_type1,frame_v1);
417  FactoryItem prikeydef2(factory,frame_type2,key_v);
418  FactoryItem aframedef2(factory,frame_type2,frame_v2);
419 
420  // Check factories are loaded (in principle done at least for the factories defined in ADF)
421  if ( !MainFrameFactory::theMainFactory().IsKnown(aframedef1.GetFactoryName().data()) )
422  { std::cout << " Agata Factory not properly loaded " << std::endl; return 1; }
423 
424  // Ask global agent to fill a Configuration frame which is dumped
425  Frame *mainframe = NULL;
426  mainframe = MainFrameFactory::theMainFactory().New(mainkeydef,mainframedef);
427 
428  Frame *frame1 = NULL;
429  frame1 = MainFrameFactory::theMainFactory().New(prikeydef1,aframedef1);
430  Frame *frame2 = NULL;
431  frame2 = MainFrameFactory::theMainFactory().New(prikeydef2,aframedef2);
432 
433  Frame *cframe = NULL;
434  cframe = MainFrameFactory::theMainFactory().New(FactoryItem("Agata","conf:global",key_v),
435  FactoryItem("Agata","conf:global",frame_v1));
436 
437  ConfigurationFrame *gconfframe = NULL;
438  if ( cframe )
439  gconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
440 
441  // change the agent to take into account this configuration
442  ConfAgent::theGlobalAgent()->GetDFAgent()->SetComment("from producer.c");
446 
447  ConfAgent::theGlobalAgent()->GetDFAgent()->Configure(gconfframe,"out");
448  gconfframe->Dump("AFP_0000.adf",true);
449  gconfframe->Dump("AFP_0001.adf",true);
450 
451  for( UInt_t i = 0u; i < nb; i++ ){
452 
453  mainframe->Reset(); frame1->Reset(); frame2->Reset();
454 
455  PSAStallion(frame1);
456  frame2->Stallion();
457 
458  mainframe->AddSubFrame((*frame1));
459  mainframe->AddSubFrame((*frame2));
460 
461  if ( i < nb / 2 )
462  mainframe->Dump("AFP_0000.adf");
463  else
464  mainframe->Dump("AFP_0001.adf");
465  }
466 
467  if ( mainframe )
468  delete mainframe;
469  if ( frame1 )
470  delete frame1;
471  if ( frame2 )
472  delete frame2;
473  if ( gconfframe )
474  delete gconfframe;
475 
476  return 0;
477 }
478 
479 
481 
484 int test4(UInt_t nb = 5000)
485 {
486  // To customise
487  // the factory for everything
488  const char factory[] = "Agata";
489  // the type of the produced frame
490  const char frame_type[] = "data:psa";
491  const char frame_conf[] = "conf:psa";
492  // the version of the primary key and the frame produced
493  Version key_v(2,0), frame_v(65000,0);
494  // end to customize ... works without any changes after
495 
496  // FactoryItem
497  FactoryItem prikeydef(factory,frame_type,key_v);
498  FactoryItem aframedef(factory,frame_type,frame_v);
499 
500  // Check factories are loaded (in principle done at least for the factories defined in ADF)
501  if ( !MainFrameFactory::theMainFactory().IsKnown(aframedef.GetFactoryName().data()) )
502  { std::cout << " Agata Factory not properly loaded " << std::endl; return 1; }
503 
504  // Ask global agent to fill a Configuration frame which is dumped
505  Frame *frame = NULL;
506  frame = MainFrameFactory::theMainFactory().New(prikeydef,aframedef);
507 
508  Frame *cframe = NULL;
509  cframe = MainFrameFactory::theMainFactory().New(FactoryItem(factory,"conf:global",key_v),
510  FactoryItem("Agata","conf:global",frame_v));
511 
512  ConfigurationFrame *gconfframe = NULL;
513  if ( cframe )
514  gconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
515 
516  ConfigurationFrame *psaconfframe = NULL;
517  cframe = MainFrameFactory::theMainFactory().New(FactoryItem(factory,frame_conf,key_v),
518  FactoryItem(factory,frame_conf,Version()));
519  if ( cframe )
520  psaconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
521 
522  // change the agent to take into account this configuration
523  ConfAgent::theGlobalAgent()->GetDFAgent()->SetComment("from producer.c");
525  ConfAgent::theGlobalAgent()->GetDFAgent()->AddKnownFrame(psaconfframe,'+');
526 
527  ConfAgent::theGlobalAgent()->GetDFAgent()->Configure(gconfframe,"out");
528  gconfframe->Dump("AFP_0000.adf",true);
529  gconfframe->Dump("AFP_0001.adf",true);
530 
531  for( UInt_t i = 0u; i < nb; i++ ){
532  frame->Stallion();
533  if ( i == nb / 4 || i == nb * 3 / 4) {
534 
535  // in principle the way it should be ... but for the moment, nothing declared
536  // so this method does nothing and return false ... thus the filling
537  // of the pasconfframe is emulated here
538  frame->Configure(psaconfframe,"out");
539  // just to emulate
540  if ( i == nb / 4 ) {
541  psaconfframe->String() =
542  "[Some variables of the PSAFrame Interface are changed File 0]";
543  psaconfframe->Write();
544  psaconfframe->Dump("AFP_0000.adf");
545  }
546  else {
547  psaconfframe->String() =
548  "[Some variables of the PSAFrame Interface are changed File 1]";
549  psaconfframe->Write();
550  psaconfframe->Dump("AFP_0001.adf");
551  }
552  // end just to emulate
553  }
554  if ( i < nb / 2 )
555  frame->Dump("AFP_0000.adf");
556  else
557  frame->Dump("AFP_0001.adf");
558  }
559 
560  if ( frame )
561  delete frame;
562  if ( gconfframe )
563  delete gconfframe;
564  if ( psaconfframe )
565  delete psaconfframe;
566  return 0;
567 }
568 
570 
573 int EB1(UInt_t nb = 5000)
574 {
575  // To customise
576  // the factory for everything
577  const char factory[] = "Agata";
578  // the type of the produced frame
579  const char frame_type[] = "data:psa";
580  const char frame_conf[] = "conf:psa";
581  // the version of the primary key and the frame produced
582  Version key_v(4,0), frame_v(65000,0);
583  // end to customize ... works without any changes after
584 
585  // FactoryItem
586  FactoryItem prikeydef(factory,frame_type,key_v);
587  FactoryItem aframedef(factory,frame_type,frame_v);
588 
589  // Check factories are loaded (in principle done at least for the factories defined in ADF)
590  if ( !MainFrameFactory::theMainFactory().IsKnown(aframedef.GetFactoryName().data()) )
591  { std::cout << " Agata Factory not properly loaded " << std::endl; return 1; }
592 
593  // Ask global agent to fill a Configuration frame which is dumped
594  Frame *frame = NULL;
595  frame = MainFrameFactory::theMainFactory().New(prikeydef,aframedef);
596 
597  Frame *cframe = NULL;
598  cframe = MainFrameFactory::theMainFactory().New(FactoryItem(factory,"conf:global",key_v),
599  FactoryItem(factory,"conf:global",Version()));
600 
601  ConfigurationFrame *gconfframe = NULL;
602  if ( cframe )
603  gconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
604 
605  ConfigurationFrame *psaconfframe = NULL;
606  cframe = MainFrameFactory::theMainFactory().New(FactoryItem(factory,"conf:psa",key_v),
607  FactoryItem("Agata","conf:psa",Version()));
608  if ( cframe )
609  psaconfframe = dynamic_cast<ConfigurationFrame *>(cframe);
610 
611  // change the agent to take into account this configuration
612  ConfAgent::theGlobalAgent()->GetDFAgent()->SetComment("from producer.c");
614  ConfAgent::theGlobalAgent()->GetDFAgent()->AddKnownFrame(psaconfframe,'+');
615 
616  ConfAgent::theGlobalAgent()->GetDFAgent()->Configure(gconfframe,"out");
617  gconfframe->Dump("AFP_0000.adf",true);
618  gconfframe->Dump("AFP_0001.adf",true);
619 
620  AgataKey *fkey =
621  dynamic_cast<AgataKey *>(frame->GetKey());
622  AgataKey *fckey =
623  dynamic_cast<AgataKey *>(cframe->GetKey());
624 
625  for( UInt_t i = 0u; i < nb; i++ ){
626  frame->Stallion();
627  fkey->SetEventNumber(i); fkey->SetTimeStamp(i);
628 
629  if ( i == nb / 4 || i == nb * 3 / 4) {
630 
631  fckey->SetEventNumber(i); fckey->SetTimeStamp(i);
632 
633  // in principle the way it should be ... but for the moment, nothing declared
634  // so this method does nothing and return false ... thus the filling
635  // of the pasconfframe is emulated here
636  frame->Configure(psaconfframe,"out");
637  // just to emulate
638  if ( i == nb / 4 ) {
639  psaconfframe->String() =
640  "[Some variables of the PSAFrame Interface are changed File 0]";
641  psaconfframe->Write();
642  psaconfframe->Dump("AFP_0000.adf");
643  }
644  else {
645  psaconfframe->String() =
646  "[Some variables of the PSAFrame Interface are changed File 1]";
647  psaconfframe->Write();
648  psaconfframe->Dump("AFP_0001.adf");
649  }
650  // end just to emulate
651  }
652  if ( i < nb / 2 )
653  frame->Dump("AFP_0000.adf");
654  else
655  frame->Dump("AFP_0001.adf");
656  }
657 
658  if ( frame )
659  delete frame;
660  if ( gconfframe )
661  delete gconfframe;
662  if ( psaconfframe )
663  delete psaconfframe;
664  return 0;
665 }
666 
667 int main(int argc, char **argv)
668 {
670 
671  const int nbtest = 3;
672  if ( argc == 1 )
673  std::cout << " Usage is : \n\t"
674  << argv[0] << " i \n i being a integer from 0 to "<< nbtest << std::endl;
675 
676  int nwhat; UInt_t number = 100;
677  if ( argc > 1 ) {
678  std::istringstream what(argv[1]); what >> nwhat;
679  }
680  if ( argc > 2 ) {
681  std::istringstream what(argv[2]); what >> number;
682  }
683 
684  switch( nwhat ) {
685  case 1:
686  test1(number);
687  break;
688  case 2:
689  test2(number);
690  break;
691  case 3:
692  test3(number);
693  break;
694  case 4:
695  test4(number);
696  break;
697  case 5:
698  dummy1(number);
699  break;
700  case 6:
701  dummy2(number);
702  break;
703  case 7:
704  EB1(number);
705  break;
706  default:
707  std::cout << " Unknown test number " << nwhat << std::endl;
708  }
710 
711  return 0;
712 }
virtual Key * GetKey()=0
To get the Key associated to this frame.
printf("******************************************************************** \n")
static MainFrameFactory & theMainFactory()
the main (global) keyfactory
static void KilltheGlobalAgent()
to kill the global agent
Definition: ConfAgent.cpp:95
header file for AgataFrameFactory.cpp
Base class for a Frame.
Definition: Frame.h:73
virtual Frame * New(const FactoryItem &key_item, const FactoryItem &frame_item)
just a frame
int main(int argc, char **argv)
Definition: Producer.C:667
header file for TrackedFrame.cpp
int dummy2(UInt_t nb=5000)
To produce quickly two files with two types of Agata frame (PSA with data and crystal stallion) emmbe...
Definition: Producer.C:400
A configuration frame is just an encapsulation of a string.
void PSAStallion(Frame *frame)
Definition: Producer.C:298
Interface to AgataKey.
virtual void SetE(Double_t)
Definition: Hits.h:69
void SetComment(const Char_t *comment)
Definition: DotConf.h:233
virtual void Dump(const Char_t *filename, Bool_t anew=false) const
Dump the content of the frame in a file (for debugging)
Definition: Frame.cpp:180
UShort_t PSAStatus
Definition: Producer.C:294
virtual DFAgent * GetDFAgent()=0
to get the Data Flow Agent in charge of knowing the structure of the DF
Short_t T0
Definition: Producer.C:295
Float_t CoreE2
Definition: Producer.C:296
virtual void SetStatus(UShort_t)
Definition: Hits.h:108
UShort_t crystal_status
Definition: Producer.C:294
header file for AgataCompositeFrame.cpp
static ConfAgent * theGlobalAgent(std::string="Agata")
to get the global agent
Definition: ConfAgent.cpp:402
virtual void SetDE(Double_t)
Definition: Hits.h:98
void AddKnownFrame(const FactoryItem &item_key, const FactoryItem &item_frame, const Char_t opt= '+')
internal use to avoid adding a definition of a Frame that cannot be allocated
Definition: DFAgent.cpp:266
virtual void SetT(Double_t)
Definition: Hits.h:74
virtual Bool_t Configure(const char *name, const char *option)
configuration from/to a file
Definition: Frame.cpp:58
virtual void SetDXYZ(Double_t, Double_t, Double_t)
Definition: Hits.h:91
Base class for a Hit.
Definition: Hits.h:35
virtual Bool_t Configure(ConfigurationFrame *, const char *option="in", Bool_t allow_init=false)
configuration from/to a configuration frame : extact string from the frame and call DoConfigure ...
Definition: DotConf.cpp:343
header file for PSAFrame.cpp
int test3(UInt_t nb=5000)
To produce quickly two ADF files filled with two types of Agata frame (stallion) emmbedded in an data...
Definition: Producer.C:186
Base class for version numbers.
Definition: Version.h:38
header file for BufferIO.cpp
virtual void SetTimeStamp(ULong64_t)=0
virtual UInt_t Write()
It writes to the Frame the content of the string.
UShort_t crystal_id
Definition: Producer.C:294
virtual void SetEventNumber(UInt_t)=0
To set the event number.
int test2(UInt_t nb=5000)
To produce quickly two ADF files filled with two types of Agata frame (stallion)
Definition: Producer.C:109
header file for AgataKeyFactory.cpp
const std::string & GetFactoryName() const
Definition: FactoryItem.h:76
virtual UInt_t Write()
It writes to the Frame the content of the dedicated structures.
Definition: Frame.h:206
Bool_t LinkItem(const Char_t *, const Char_t *, void *)
Only for basic type ... otherwise better to use the most general Link method.
Definition: GObject.cpp:120
header file for DFAgent.cpp
virtual Hit * NewHit()=0
Add a NewHit to the stack of Hits associated to this PSAFrame.
virtual void Reset()=0
Reset the current frame.
int test4(UInt_t nb=5000)
To produce quickly two ADF files filled with just one type of Agata frame (PSA stallion) and a config...
Definition: Producer.C:484
int dummy1(UInt_t nb=5000)
To produce quickly two ADF files filled with just one type of Agata frame (PSA with data) ...
Definition: Producer.C:341
virtual void Stallion(UInt_t repetition=4u)=0
Fill the frame with a given pattern (used for ADF test)
ADF::LogMessage & endl(ADF::LogMessage &log)
header file for ConfAgent.cpp
virtual void SetDT(Double_t)
Definition: Hits.h:103
virtual void Dump(const Char_t *filename, Bool_t anew=false) const =0
Dump the content of the frame in a file (for debugging)
Float_t CoreE1
Definition: Producer.C:296
virtual Bool_t AddSubFrame(const Frame &)
Add a subframe to that frame (only if composite)
Definition: Frame.h:242
int test1(UInt_t nb=5000)
To produce quickly two ADF files filled with just one type of Agata frame (stallion) ...
Definition: Producer.C:47
int EB1(UInt_t nb=5000)
To produce quickly two ADF files filled with just one type of Agata frame (PSA stallion) and a config...
Definition: Producer.C:573
Base class that described an item in a Factory.
Definition: FactoryItem.h:52
virtual void SetXYZ(Double_t, Double_t, Double_t)
Definition: Hits.h:62
virtual GObject * Global()
Definition: GObject.h:353