Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

test1.cpp

Go to the documentation of this file.
00001 
00002 // 
00003 // Simple test routine: print the Lorentz vector of the Eflows.
00004 //
00005 // Author : C. Delaere
00006 //
00007 // Date: 2001-08-08
00008 //
00009 //
00011 
00012 #include <fstream>
00013 #include "AlephExManager.h"
00014 #include "AlephCollection.h"
00015 #include <vector>
00016 #include "AlToolBox.h"
00017 #include "AlBjet.h"
00018 #include "AlephRegisteredAction.h"
00019 
00020 extern ofstream fout;
00021 
00023 //  User Init
00025 
00026 class testclass:public AlephAbstractInteractiveFunction
00027 {
00028         public:
00029                 testclass(AlephInteractiveHandler *ptr):AlephAbstractInteractiveFunction(ptr) {}
00030                 virtual string Name() {return "test";}
00031                 virtual int Code() {return 555;}
00032                 virtual void Run(vector<float>& options,AlphaBanks& EventInfo) 
00033                         { 
00034                                 // dummy routine: returns always the same track, eflow and the same jet
00035                                 vector<float> output;
00036                                 output.push_back(2);
00037                                 output.push_back(1); // a track
00038                                 output.push_back(3); // px
00039                                 output.push_back(0); // py
00040                                 output.push_back(0); // pz
00041                                 output.push_back(0); // ch
00042                                 SendMessage(Code(),output,"Dummy test routine");
00043                                 output.clear();
00044                                 output.push_back(1);
00045                                 output.push_back(2);  // an eflow
00046                                 output.push_back(10); // E
00047                                 output.push_back(0);  // px
00048                                 output.push_back(10); // py
00049                                 output.push_back(0);  // pz
00050                                 output.push_back(1);  // ch
00051                                 SendMessage(Code(),output,"Dummy test routine");
00052                                 output.clear();
00053                                 output.push_back(0);
00054                                 output.push_back(4);   // a jet
00055                                 output.push_back(0.5); // sin theta ~ radius
00056                                 output.push_back(0);   // px
00057                                 output.push_back(0);   // py
00058                                 output.push_back(5);   // pz
00059                                 SendMessage(Code(),output,"Dummy test routine");
00060                         }
00061                 virtual vector<pair<string,float> > OptionsList() 
00062                         { 
00063                                 vector<pair<string,float> > output ; 
00064                                 pair<string,float> mypair;
00065                                 mypair.first = "option 1";
00066                                 mypair.second = 10;
00067                                 output.push_back(mypair);
00068                                 mypair.first = "dummy 2";
00069                                 mypair.second = 3.1415;
00070                                 output.push_back(mypair);
00071                                 return output;
00072                         }
00073 };
00074 
00075 void AlephExManager::UserInit() 
00076 {
00077 AlephRegisteredAction<testclass> mytestclass;
00078 }
00079 
00082 
00084 //  User Event
00086 bool AlephExManager::UserEvent(AlphaBanks& EventInfo)
00087 {
00088 /*
00089 // get pointers to the objects used in the analysis
00090   AlephCollection<AlEflw *> theEflows=EventInfo.EflwPV();
00091 // loop on the collection and print some values
00092   for(AlephCollection<AlEflw *>::iterator ieflw = theEflows.begin();
00093                                           ieflw < theEflows.end();
00094                                           ieflw++)
00095           cout << "P = (" << (*ieflw)->QX() << "," << (*ieflw)->QY()
00096                << "," << (*ieflw)->QZ() << ")    E = " << (*ieflw)->QE() << endl; */
00097 int event = EventInfo.Event().number();
00098 int run = EventInfo.Run().number();
00099 cout << run << " " << event << endl;
00100 AlephCollection<AlElec *> theElecs=EventInfo.ElecPV();
00101 cout << theElecs.size() << " Elecs" << endl;
00102 for(AlephCollection<AlElec *>::iterator imu = theElecs.begin(); imu< theElecs.end(); imu++)
00103 {
00104 if(((*imu)->getTrack())&&((*imu)->getEflw()))
00105 cout << (*imu)->getTrack()->QE() << "  " << (*imu)->getEflw()->QE() << endl;
00106 }
00107 if(
00108 (run==53425)&&(event==10379)||
00109 (run==53332)&&(event==6362)||
00110 (run==53363)&&(event==6147)||
00111 (run==53516)&&(event==2587)||
00112 (run==53580)&&(event==10463)||
00113 (run==53868)&&(event==1300)||
00114 (run==54139)&&(event==3979)||
00115 (run==55150)&&(event==969)||
00116 (run==54327)&&(event==13331)||
00117 (run==54338)&&(event==12836)||
00118 (run==54430)&&(event==323)||
00119 (run==54592)&&(event==2777)||
00120 (run==54601)&&(event==4097)||
00121 (run==54902)&&(event==1630)||
00122 (run==55037)&&(event==6674)||
00123 (run==54960)&&(event==1696)||
00124 (run==55147)&&(event==2496)||
00125 (run==55360)&&(event==7000)||
00126 (run==55365)&&(event==10685)||
00127 (run==55447)&&(event==5085)||
00128 (run==55488)&&(event==4)||
00129 (run==55589)&&(event==1971)||
00130 (run==55597)&&(event==957)||
00131 (run==55713)&&(event==5654)||
00132 (run==56331)&&(event==3701)
00133 ) {
00134 return true;
00135 }
00136 
00137 return false;
00138 }
00139 
00142 
00144 //  User Term
00146 void AlephExManager::UserTerm() {}

Generated at Wed Jun 18 17:19:20 2003 for ALPHA++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001