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

AlephCollection.h

Go to the documentation of this file.
00001 
00002 // AlephCollection.h
00003 // Subclass of vector.h
00004 //
00005 // Author: Dan Wallin (with contributions from M. Hoerndl)
00006 // modified by:  C. Delaere, V. Lemaitre, O. van der Aa :
00007 //                 - added Pointers method
00008 //                 - added Leptons filter algos
00009 //                 - added GetSum and GetMiss
00010 //                 - new Jet Algos (form Orca)
00011 //
00013 
00014 #ifndef __AlephCollection__
00015 #define __AlephCollection__
00016 
00017 #include <iostream.h>
00018 #include <vector>
00019 #include <algorithm>
00020 #include "AlObject.h"
00021 #include "QvecBase.h"
00022 #include "AlThrust.h"
00023 #include "AlJet.h"
00024 #include "AlBjet.h"
00025 #include "AlTau.h"
00026 #include "AlEflw.h"
00027 #include "AlElec.h"
00028 #include "AlMuon.h"
00029 #include "CLHEP/Matrix/Matrix.h"
00030 #include "CLHEP/Matrix/SymMatrix.h"
00031 #include "CLHEP/Matrix/Vector.h"
00032 
00033 // Prevents the compiler from generating several copies of 
00034 // methods during the precompiling stage, which leads to longer
00035 // compile time. 
00036 #if defined(__GNUC__)
00037 #pragma interface
00038 #endif
00039 
00040 // some additional possible naming
00041 #define AlephSelection AlephCollection;
00042 
00044 
00047 template <class Type>
00048 class AlephCollection: public vector<Type>{
00049   
00050 public:  
00051   
00053   AlephCollection::AlephCollection():vector<Type>(){}
00054   
00056   AlephCollection::AlephCollection(int i):vector<Type>(i){}
00057   
00059   void append(AlephCollection<Type>);
00060   
00062   void looperase(AlephCollection<Type>::iterator &it){
00063     AlephCollection::iterator tmp=it;
00064     it--;
00065     erase(tmp);
00066   }
00067   
00069   AlephCollection<Type *> Pointers()
00070     {
00071       AlephCollection<Type *> out;
00072       for (unsigned int i=0;i<size();i++) out.push_back(&((*this)[i]));
00073       return out;
00074     }
00075 
00076   // The Thrust algorithm
00077   AlThrust AThrust() const;
00078 
00079   // Sphericity, aplanarity and planarity
00080   float Sphericity() const;
00081   float Aplanarity() const;
00082   float Planarity()  const;
00083   
00084   // DurhamJet (jet clustering)
00085   AlephCollection<AlJet> DurhamJet(float theYcut, int Scheme=1, float Qelep=0.) const;
00086   // JadeJet (jet clustering)
00087   AlephCollection<AlJet> JadeJet(float theYcut, int Scheme=1, float Qelep=0.) const;
00088   // DurhamYn
00089   vector<float> DurhamYn(int, float Qelep=0.) const;
00090 
00091   // ATauJn (Tau candidates generator)
00092   AlephCollection<AlTau> ATauJn(vector<float> argus, float Qelep=0) const;
00093 
00094   // Filter Leptons
00095   void FilterMu(vector<float>);
00096   void FilterEl(const AlephCollection<AlMuon *>&, vector<float>);
00097   void FilterTau(vector<float>);
00098 
00099   // General methods
00100   QvecBase GetSum() const;
00101   QvecBase GetMiss(float QELEP=0.) const;
00102 
00103 };
00104 
00105 #if defined(__GNUC__)
00106 #pragma implementation
00107 #endif
00108 // Implementations...
00109 
00110 // Appends a vector of a certain kind to another vector
00111 template <class Type>
00112 void AlephCollection<Type>::append(AlephCollection<Type> cv)
00113 {
00114   for(iterator i=cv.begin();i<cv.end();i++) push_back(*i);
00115 }
00116 
00118 template <class Type> 
00119 QvecBase AlephCollection<Type>::GetSum()  const
00120 {
00121   QvecBase Psum;
00122   HepLorentzVector P_4sum(0.,0.,0.,0.);
00123   float chtot=0.;
00124   const_iterator it;
00125   for (it=begin();it<end();it++)
00126     if (!((*it)->isLocked()))
00127       { 
00128         if ((*it)->TYPE() == ALTHRUST ) 
00129           { 
00130             cout << "WARNING Type is AlThrust: type not supported !" << endl; 
00131             exit(1);
00132           }
00133         P_4sum += (*it)->A4V(); 
00134         chtot += (*it)->QCH();
00135       }
00136   Psum.setA4V(P_4sum);
00137   Psum.setQCH(chtot);
00138   return Psum;
00139 }
00140 
00142 template <class Type> 
00143 QvecBase AlephCollection<Type>::GetMiss(float QELEP) const
00144 {
00145   if(QELEP==0.) cout << "WARNING, Pmiss calculated with QELEP=0 !" << endl;
00146   QvecBase Pmiss;
00147   HepLorentzVector P_4miss(0.,0.,0.,QELEP);
00148   float chtot=0.;
00149   const_iterator it;
00150   for (it=begin();it<end();it++) 
00151     if (!((*it)->isLocked()))
00152       { 
00153         if ((*it)->TYPE() == ALTHRUST ) 
00154           { 
00155             cout << "WARNING Type is AlThrust: type not supported !" << endl; 
00156             exit(1);
00157           }
00158         P_4miss -= (*it)->A4V(); 
00159         chtot -= (*it)->QCH();
00160       }
00161   P_4miss.setE(max(P_4miss.e(),P_4miss.rho()));
00162   Pmiss.setA4V(P_4miss);
00163   Pmiss.setQCH(chtot);
00164   return Pmiss;
00165 }
00166 
00167 // AlThrust algorithm
00168 #include "AlephAlgoThrust.h"
00169 
00170 // Jet clustering
00171 #include "AlephDurhamAlgo.h"
00172 #include "AlephJadeAlgo.h"
00173 
00174 // Leptons algorithmes
00175 #include "AlephAlgoLeptons.h"
00176 
00177 #endif
00178 
00179 
00180 
00181 
00182 

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