00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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
00034
00035
00036 #if defined(__GNUC__)
00037 #pragma interface
00038 #endif
00039
00040
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
00077 AlThrust AThrust() const;
00078
00079
00080 float Sphericity() const;
00081 float Aplanarity() const;
00082 float Planarity() const;
00083
00084
00085 AlephCollection<AlJet> DurhamJet(float theYcut, int Scheme=1, float Qelep=0.) const;
00086
00087 AlephCollection<AlJet> JadeJet(float theYcut, int Scheme=1, float Qelep=0.) const;
00088
00089 vector<float> DurhamYn(int, float Qelep=0.) const;
00090
00091
00092 AlephCollection<AlTau> ATauJn(vector<float> argus, float Qelep=0) const;
00093
00094
00095 void FilterMu(vector<float>);
00096 void FilterEl(const AlephCollection<AlMuon *>&, vector<float>);
00097 void FilterTau(vector<float>);
00098
00099
00100 QvecBase GetSum() const;
00101 QvecBase GetMiss(float QELEP=0.) const;
00102
00103 };
00104
00105 #if defined(__GNUC__)
00106 #pragma implementation
00107 #endif
00108
00109
00110
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
00168 #include "AlephAlgoThrust.h"
00169
00170
00171 #include "AlephDurhamAlgo.h"
00172 #include "AlephJadeAlgo.h"
00173
00174
00175 #include "AlephAlgoLeptons.h"
00176
00177 #endif
00178
00179
00180
00181
00182