14 #ifndef ADF_TrackedFrame
17 #ifndef ADF_AgataCompositeFrame
51 const char factory[] =
"Agata";
53 const char frame_type[] =
"data:psa";
55 Version key_v(2,0), frame_v(65000,1);
64 { std::cout <<
" Agata Factory not properly loaded " <<
std::endl;
return 1; }
83 gconfframe->
Dump(
"AFP_0000.adf",
true);
84 gconfframe->
Dump(
"AFP_0001.adf",
true);
86 for( UInt_t i = 0u; i < nb; i++ ){
89 frame->
Dump(
"AFP_0000.adf");
91 frame->
Dump(
"AFP_0001.adf");
113 const char factory[] =
"Agata";
115 const char frame_type1[] =
"data:psa";
116 const char frame_type2[] =
"data:crystal";
118 Version key_v(1,0), frame_v1(65000,0),frame_v2(65000,0);
122 FactoryItem aframedef1(factory,frame_type1,frame_v1);
124 FactoryItem aframedef2(factory,frame_type2,frame_v2);
129 { std::cout <<
" Agata Factory not properly loaded " <<
std::endl;
return 1; }
132 Frame *frame1 = NULL;
134 Frame *frame2 = NULL;
143 Frame *cframe = NULL;
152 gconfframe->
Dump(
"AFP_0000.adf",
true);
153 gconfframe->
Dump(
"AFP_0001.adf",
true);
155 for( UInt_t i = 0u; i < nb; i++ ){
159 frame1->
Dump(
"AFP_0000.adf");
160 frame2->
Dump(
"AFP_0000.adf");
163 frame1->
Dump(
"AFP_0001.adf");
164 frame2->
Dump(
"AFP_0001.adf");
190 const char factory[] =
"Agata";
192 const char frame_type1[] =
"data:psa";
193 const char frame_type2[] =
"data:tracked";
194 const char frame_type3[] =
"data:ranc1";
197 Version key_v(4,0), frame_v1(65000,1),frame_v2(65000,0), frame_v3(65000,0);
200 FactoryItem mainkeydef(factory,
"event:data",key_v);
201 FactoryItem mainframedef(factory,
"event:data",key_v);
204 FactoryItem aframedef1(factory,frame_type1,frame_v1);
206 FactoryItem aframedef2(factory,frame_type2,frame_v2);
208 FactoryItem aframedef3(factory,frame_type3,frame_v3);
212 { std::cout <<
" Agata Factory not properly loaded " <<
std::endl;
return 1; }
215 Frame *mainframe = NULL;
218 Frame *frame1 = NULL;
220 Frame *frame2 = NULL;
222 Frame *frame3 = NULL;
225 Frame *cframe = NULL;
241 gconfframe->
Dump(
"AFP_0000.adf",
true);
242 gconfframe->
Dump(
"AFP_0001.adf",
true);
244 Int_t nb_count[4]; memset(nb_count,0,4*
sizeof(Int_t)); Int_t ranc_alone = 0;
246 for( UInt_t i = 0u; i < nb; i++ ){
266 if ( ranc_alone % 3 ) {
276 mainframe->
Dump(
"AFP_0000.adf");
278 mainframe->
Dump(
"AFP_0001.adf");
280 printf(
" C0 %d C1 %d C2 %d C3 %d \n",nb_count[0],nb_count[1],nb_count[2],nb_count[3]);
300 PSAInterface *data = GetDataPointer<PSAInterface>(frame);
317 for (UInt_t h = 0u; h < 3u; h++){
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); }
345 const char factory[] =
"Agata";
347 const char frame_type[] =
"data:psa";
349 Version key_v(2,0), frame_v(65000,1);
358 { std::cout <<
" Agata Factory not properly loaded " <<
std::endl;
return 1; }
364 Frame *cframe = NULL;
377 gconfframe->
Dump(
"AFP_0000.adf",
true);
378 gconfframe->
Dump(
"AFP_0001.adf",
true);
380 for( UInt_t i = 0u; i < nb; i++ ){
383 frame->
Dump(
"AFP_0000.adf");
385 frame->
Dump(
"AFP_0001.adf");
404 const char factory[] =
"Agata";
406 const char frame_type1[] =
"data:psa";
407 const char frame_type2[] =
"data:crystal";
409 Version key_v(2,0), frame_v1(65000,1),frame_v2(65000,0);
412 FactoryItem mainkeydef(factory,
"event:data",key_v);
413 FactoryItem mainframedef(factory,
"event:data",key_v);
416 FactoryItem aframedef1(factory,frame_type1,frame_v1);
418 FactoryItem aframedef2(factory,frame_type2,frame_v2);
422 { std::cout <<
" Agata Factory not properly loaded " <<
std::endl;
return 1; }
425 Frame *mainframe = NULL;
428 Frame *frame1 = NULL;
430 Frame *frame2 = NULL;
433 Frame *cframe = NULL;
448 gconfframe->
Dump(
"AFP_0000.adf",
true);
449 gconfframe->
Dump(
"AFP_0001.adf",
true);
451 for( UInt_t i = 0u; i < nb; i++ ){
462 mainframe->
Dump(
"AFP_0000.adf");
464 mainframe->
Dump(
"AFP_0001.adf");
488 const char factory[] =
"Agata";
490 const char frame_type[] =
"data:psa";
491 const char frame_conf[] =
"conf:psa";
493 Version key_v(2,0), frame_v(65000,0);
502 { std::cout <<
" Agata Factory not properly loaded " <<
std::endl;
return 1; }
508 Frame *cframe = NULL;
528 gconfframe->
Dump(
"AFP_0000.adf",
true);
529 gconfframe->
Dump(
"AFP_0001.adf",
true);
531 for( UInt_t i = 0u; i < nb; i++ ){
533 if ( i == nb / 4 || i == nb * 3 / 4) {
542 "[Some variables of the PSAFrame Interface are changed File 0]";
543 psaconfframe->
Write();
544 psaconfframe->
Dump(
"AFP_0000.adf");
548 "[Some variables of the PSAFrame Interface are changed File 1]";
549 psaconfframe->
Write();
550 psaconfframe->
Dump(
"AFP_0001.adf");
555 frame->
Dump(
"AFP_0000.adf");
557 frame->
Dump(
"AFP_0001.adf");
577 const char factory[] =
"Agata";
579 const char frame_type[] =
"data:psa";
580 const char frame_conf[] =
"conf:psa";
582 Version key_v(4,0), frame_v(65000,0);
591 { std::cout <<
" Agata Factory not properly loaded " <<
std::endl;
return 1; }
597 Frame *cframe = NULL;
617 gconfframe->
Dump(
"AFP_0000.adf",
true);
618 gconfframe->
Dump(
"AFP_0001.adf",
true);
625 for( UInt_t i = 0u; i < nb; i++ ){
629 if ( i == nb / 4 || i == nb * 3 / 4) {
640 "[Some variables of the PSAFrame Interface are changed File 0]";
641 psaconfframe->
Write();
642 psaconfframe->
Dump(
"AFP_0000.adf");
646 "[Some variables of the PSAFrame Interface are changed File 1]";
647 psaconfframe->
Write();
648 psaconfframe->
Dump(
"AFP_0001.adf");
653 frame->
Dump(
"AFP_0000.adf");
655 frame->
Dump(
"AFP_0001.adf");
667 int main(
int argc,
char **argv)
671 const int nbtest = 3;
673 std::cout <<
" Usage is : \n\t"
674 << argv[0] <<
" i \n i being a integer from 0 to "<< nbtest <<
std::endl;
676 int nwhat; UInt_t number = 100;
678 std::istringstream what(argv[1]); what >> nwhat;
681 std::istringstream what(argv[2]); what >> number;
707 std::cout <<
" Unknown test number " << nwhat <<
std::endl;
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
header file for AgataFrameFactory.cpp
virtual Frame * New(const FactoryItem &key_item, const FactoryItem &frame_item)
just a frame
int main(int argc, char **argv)
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...
A configuration frame is just an encapsulation of a string.
void PSAStallion(Frame *frame)
virtual void SetE(Double_t)
void SetComment(const Char_t *comment)
virtual void Dump(const Char_t *filename, Bool_t anew=false) const
Dump the content of the frame in a file (for debugging)
virtual DFAgent * GetDFAgent()=0
to get the Data Flow Agent in charge of knowing the structure of the DF
virtual void SetStatus(UShort_t)
header file for AgataCompositeFrame.cpp
static ConfAgent * theGlobalAgent(std::string="Agata")
to get the global agent
virtual void SetDE(Double_t)
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
virtual void SetT(Double_t)
virtual Bool_t Configure(const char *name, const char *option)
configuration from/to a file
virtual void SetDXYZ(Double_t, Double_t, Double_t)
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 ...
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...
Base class for version numbers.
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.
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)
header file for AgataKeyFactory.cpp
const std::string & GetFactoryName() const
virtual UInt_t Write()
It writes to the Frame the content of the dedicated structures.
Bool_t LinkItem(const Char_t *, const Char_t *, void *)
Only for basic type ... otherwise better to use the most general Link method.
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...
int dummy1(UInt_t nb=5000)
To produce quickly two ADF files filled with just one type of Agata frame (PSA with data) ...
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)
virtual void Dump(const Char_t *filename, Bool_t anew=false) const =0
Dump the content of the frame in a file (for debugging)
virtual Bool_t AddSubFrame(const Frame &)
Add a subframe to that frame (only if composite)
int test1(UInt_t nb=5000)
To produce quickly two ADF files filled with just one type of Agata frame (stallion) ...
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...
Base class that described an item in a Factory.
virtual void SetXYZ(Double_t, Double_t, Double_t)
virtual GObject * Global()