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

test2.cpp

Go to the documentation of this file.
00001 
00002 //
00003 // Author : C. Delaere
00004 //
00005 // Date: 2001-08-27
00006 //
00008 
00009 
00010 #include <fstream>
00011 #include "AlephExManager.h"
00012 #include "AlephCollection.h"
00013 #include <vector>
00014 
00015 extern ofstream fout;
00016 
00017 
00019 //  User Init
00021 
00022 void AlephExManager::UserInit() {}
00023 
00026 
00027 float QQRADP = 57.29577951; // rad -> deg conversion
00028 // a functor to sort collections of pointors
00029 struct order
00030 {
00031         bool operator()(QvecBase* a, QvecBase* b)
00032         {
00033                 return ((*a) < (*b)) ;
00034         }
00035 };
00037 //  User Event
00039 bool AlephExManager::UserEvent(AlphaBanks& EventInfo)
00040 {
00041 // get vectors of pointers to the objects used in the analysis
00042   AlephCollection<AlTrack *> altp =EventInfo.TrackPV();
00043   AlephCollection<AlMuon  *> almup=EventInfo.MuonPV();
00044   AlephCollection<AlElec  *> alelp=EventInfo.ElecPV();
00045   AlephCollection<AlEflw  *> alefp=EventInfo.EflwPV();
00046 // get general event information
00047   float QELEP = EventInfo.Event().Energy();
00048 // Good quality charged Tracks selection
00049   int Nchsel=0;
00050   for (AlephCollection<AlTrack *>::iterator Ich=altp.begin(); Ich<altp.end(); Ich++)
00051     {
00052       int Ntpc = (*Ich)->NT();
00053       float costhch = (*Ich)->QCT();
00054       float d0 = (*Ich) -> QDB();
00055       float z0 = (*Ich) -> QZB();
00056 
00057       if ((Ntpc<4)||(costhch>0.95)||(d0>2.)||(z0>10.)
00058           ||(costhch<-.95)||(d0<-2)||(z0<-10))
00059         {
00060           (*Ich)->Lock();          // Lock the tracks (for leptons algos)
00061           altp.looperase(Ich);     // Erases elements in the altp vector
00062         }
00063       else Nchsel++;
00064     }
00065 // Don't consider events without Eflows, or without enough good tracks
00066   if (alefp.size()<2) return 0;
00067   if (altp.size()<2) return 0;
00068   
00069 // Initialize leptons loops
00070   //generate raw taus candidates
00071   AlephCollection<AlTau> JJ = alefp.ATauJn(theCardsReader()->TAIDcuts(),QELEP);
00072   AlephCollection<AlTau*> altaup = JJ.Pointers();
00073 
00074   //filter muons
00075   almup.FilterMu(theCardsReader()->MUIDcuts());
00076   cout << " found " << almup.size() << " muon(s)" << endl;
00077   
00078   //filter electrons
00079   alelp.FilterEl(almup,theCardsReader()->ELIDcuts());
00080   cout << " found " << alelp.size() << " eletron(s)" << endl;
00081 
00082   //filter taus and select the most energetic one
00083   altaup.FilterTau(theCardsReader()->TAIDcuts());
00084   QvecBase::SortCriterium = 0;
00085   sort(altaup.begin(),altaup.end(),order());
00086   AlTau* seltau = NULL;
00087   if(altaup.size()!=0 ) seltau = *(altaup.end()-1);
00088   cerr << " found " << altaup.size() << " tau(s)" << endl;
00089 
00090 // Compute acoplanarity and acolinearity
00091 //     ( Make 2 jets using Durham PE for a fixed number of jet,
00092 //       enter a negative values of Ycut = -number of jets!    )
00093   int jetr;
00094   float Ycut = -2.;// force 2 jets
00095   int scheme = 1;  // E-scheme
00096   AlephCollection<AlJet> Jn = alefp.DurhamJet(Ycut, scheme, 0);
00097   jetr = Jn.size();
00098   float acopl=180.;
00099   float acolin=90.;
00100   if(jetr == 2)
00101     {
00102       acopl= acos(min(max(cos(Jn[0].QPH()-Jn[1].QPH()),-1.),1.))*QQRADP;
00103       acolin= acos(min(max(Jn[1].QCOSA(Jn[0]),(float)-1.),(float)1.))*QQRADP;
00104     }
00105   cout << "acoplanarity/acolinearity with tau    are: " << acopl << "  " << acolin << endl;
00106   
00107 // If there is a tau, compute acoplww acolww without the tau
00108   float acoplww = 180.;
00109   float acolww  = 90.;
00110   AlephCollection<AlJet> Jn3;
00111   if(altaup.size())
00112     {
00113       // lock all tracks belonging to the Tau.(use the recursive lock)
00114       seltau->Lock(1);
00115       int alefpsize=0;
00116       for (AlephCollection<AlEflw*>::iterator i = alefp.begin(); i != alefp.end(); i++)
00117          if (!((*i)->isLocked())) alefpsize++;
00118       if (alefpsize>1)
00119         { 
00120          Ycut = -2;
00121          scheme = 1;
00122          Jn3 = alefp.DurhamJet(Ycut, scheme, 0);
00123          // compute acoplanarity and acolinearity
00124          if(jetr == 2) 
00125           {
00126             float acoplww = 180.;
00127             float acolww  = 90.;
00128             acoplww= acos(min(max(cos(Jn3[0].QPH()-Jn3[1].QPH()),-1.),1.))*QQRADP;
00129             acolww= acos(min(max(Jn3[1].QCOSA(Jn3[0]),(float)-1),(float)1))*QQRADP;
00130             cout << "acoplanarity/acolinearity without tau are: " << acoplww << "  " << acolww << endl;
00131           }
00132        }
00133        seltau->unLock(1);
00134     }
00135   return true;
00136 }
00137 
00140 
00142 //  User Term
00144 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