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

EtMissTest Class Reference

Collaboration diagram for EtMissTest:

Collaboration graph
[legend]
List of all members.

Public Methods

 EtMissTest ()
 ~EtMissTest ()
void FillingTest (G3EventProxy *ev)

Private Methods

void upDate (G3EventProxy *ev)
void FillEtMiss (G3EventProxy *ev, EtMiss *a)
void Print (EtMiss a)
void PrintEvInfo (G3EventProxy *ev)
string CheckSchemeName ()

Private Attributes

SimpleConfigurable< string > _Scheme
MySetup_mysetup

Constructor & Destructor Documentation

EtMissTest::EtMissTest  
 

Definition at line 84 of file EtMissTest.cpp.

References _mysetup, and _Scheme.

00085 {    
00086   Observer<G3EventProxy *>::init() ;
00087   _Scheme=SimpleConfigurable<string>("default","EtMissScheme");
00088   _mysetup = new MySetup;
00089 }

EtMissTest::~EtMissTest   [inline]
 

Definition at line 72 of file EtMissTest.cpp.

References _mysetup.

00072 { cout<<"End of EtMissTest"<<endl;delete _mysetup;}


Member Function Documentation

string EtMissTest::CheckSchemeName   [private]
 

Definition at line 235 of file EtMissTest.cpp.

References _Scheme.

Referenced by FillEtMiss, and FillingTest.

00236 {
00240  
00241   if(_Scheme.value()=="pippo") return _Scheme.value();
00242   if(_Scheme.value()=="pappo") return _Scheme.value();
00243   if(_Scheme.value()=="MetGenCalo") return _Scheme.value();
00244   if(_Scheme.value()=="MetCaloTower") return _Scheme.value();
00245   //list here all existing scheme
00246  
00247   return "default";
00248   
00249 }

void EtMissTest::FillEtMiss G3EventProxy *    ev,
EtMiss   a
[private]
 

Definition at line 146 of file EtMissTest.cpp.

References CheckSchemeName, EtMiss::SetEECal, EtMiss::SetEHCal, EtMiss::SetEScalECal, EtMiss::SetEScalHCal, EtMiss::SetEScalTotal, EtMiss::SetEtMiss, and EtMiss::SetETotal.

Referenced by FillingTest.

00147 {
00148 
00149   string scheme = CheckSchemeName();
00150     if(scheme != "default")
00151     {
00152       RecItr<ConcreteMet> gMet(ev->recEvent(),scheme.c_str());
00153       cout<<"AAA    ConcreteMet    AAAA"<<endl;
00154       while (gMet.next())
00155         {
00156           cout<<*gMet<<endl;
00157           a->SetEtMiss(gMet->getMissingEx(),gMet->getMissingEy());
00158         }
00159       
00160     }
00161   
00162   // Now it dela with ECAL and HCAL always looking at cell  
00164   // "vectorial"
00165 
00166   JetMetParticleSetup  * jps = Singleton<JetMetParticleSetup>::instance();
00167   double towerEtThreshold = jps->getEcalPlusHcalTowerEtCut();
00168   cout<<"AAA towerEtThreshold: "<<towerEtThreshold<<endl;
00169   double EEcal[3] = {0,0,0};
00170   double EHcal[3] = {0,0,0};
00171   double ETot[3]  = {0,0,0};
00172   //Scalar
00173   double EScEcal[5] = {0,0,0,0,0};
00174   double EScHcal[5] = {0,0,0,0,0};
00175   double EScTot[5]  = {0,0,0,0,0};
00176 
00177   RecItr<EcalPlusHcalTower> aTower(ev->recEvent());
00178   while(aTower.next())
00179     {
00180       HepPoint3D position = aTower->Position();
00181       double theta = position.theta();
00182       double phi   = position.phi();
00183       double EnEcal = aTower->EnergyEcalTower();
00184       double EnHcal = aTower->EnergyHcalTower();
00185       if(aTower->Energy()*sin(theta) > towerEtThreshold)
00186         {
00187           double Ex_E=EnEcal*sin(theta)*cos(phi);
00188           double Ey_E=EnEcal*sin(theta)*sin(phi);
00189           double Ez_E=EnEcal*cos(theta);
00190           double Ex_H=EnHcal*sin(theta)*cos(phi);
00191           double Ey_H=EnHcal*sin(theta)*sin(phi);
00192           double Ez_H=EnHcal*cos(theta);
00193 
00194           EEcal[0] += Ex_E;
00195           EEcal[1] += Ey_E;
00196           EEcal[2] += Ez_E;
00197 
00198           EHcal[0] += Ex_H;
00199           EHcal[1] += Ey_H;
00200           EHcal[2] += Ez_H;
00201 
00202 
00203           EScEcal[0] += fabs(Ex_E);
00204           EScEcal[1] += fabs(Ey_E);
00205           EScEcal[2] += fabs(Ez_E);
00206           EScEcal[3] += sqrt(Ex_E*Ex_E+Ey_E*Ey_E);
00207           EScEcal[4] += sqrt(Ex_E*Ex_E+Ey_E*Ey_E+Ez_E*Ez_E);
00208 
00209           EScHcal[0] += fabs(Ex_H);
00210           EScHcal[1] += fabs(Ey_H);
00211           EScHcal[2] += fabs(Ez_H);
00212           EScHcal[3] += sqrt(Ex_H*Ex_H+Ey_H*Ey_H);
00213           EScHcal[4] += sqrt(Ex_H*Ex_H+Ey_H*Ey_H+Ez_H*Ez_H);
00214 
00215         }
00216     }
00217 
00218   for (int i=0;i<3;i++)
00219     {
00220       ETot[i]=EEcal[i]+EHcal[i];
00221     }
00222   
00223   a->SetEECal(EEcal[0],EEcal[1],EEcal[2]);
00224   a->SetEHCal(EHcal[0],EHcal[1],EHcal[2]);
00225   
00226   a->SetEScalECal(EScEcal[0],EScEcal[1],EScEcal[2],EScEcal[3],EScEcal[4]);
00227   a->SetEScalHCal(EScHcal[0],EScHcal[1],EScHcal[2],EScHcal[3],EScHcal[4]);
00228   a->SetETotal(ETot[0],ETot[1],ETot[2]);
00229   if(scheme == "default") a->SetEtMiss(-1*ETot[0],-1*ETot[1]);
00230   // what EScalTotal would mean is not yet clear to me 
00231   a->SetEScalTotal(0.9,0.4,0.3,11,12);
00232 
00233 }

void EtMissTest::FillingTest G3EventProxy *    ev
 

Definition at line 91 of file EtMissTest.cpp.

References CheckSchemeName, FillEtMiss, Print, and PrintEvInfo.

Referenced by upDate.

00092 {
00093   PrintEvInfo(ev);
00094   EtMiss* myMet = new EtMiss(CheckSchemeName());
00095   FillEtMiss (ev,myMet);
00096   Print(*myMet);
00097   delete myMet;
00098 }

void EtMissTest::Print EtMiss    a [private]
 

Definition at line 119 of file EtMissTest.cpp.

References EtMiss::getE, EtMiss::getEECal, EtMiss::getEHCal, EtMiss::getEMissX, EtMiss::getEMissY, EtMiss::getEScalar, EtMiss::getEScalarECal, EtMiss::getEScalarHCal, EtMiss::getEtMiss, EtMiss::getETrue, and EtMiss::WhichScheme.

Referenced by FillingTest.

00120 {
00121   cout<<"===========  scheme : "<<a.WhichScheme()<<endl;
00122   cout<<"*************EtMiss*************************** \n";
00123   cout<<" "<<a.getEMissX()<<"  "<<a.getEMissY()<<"  "<<a.getEtMiss()<<endl;
00124   
00125   cout<<"\n ********* ECAL ******************"<<endl;
00126   for (int i=0;i<5;i++){cout<<a.getEECal(i)<<" ";}
00127   cout<<endl;
00128   for (int i=0;i<5;i++){cout<<a.getEScalarECal(i)<<" ";}
00129 
00130   cout<<"\n ********* HCAL ******************"<<endl;
00131   for (int i=0;i<5;i++){cout<<a.getEHCal(i)<<" ";}
00132   cout<<endl;
00133   for (int i=0;i<5;i++){cout<<a.getEScalarHCal(i)<<" ";}
00134 
00135   cout<<"\n ********* Total ******************"<<endl;
00136   for (int i=0;i<5;i++){cout<<a.getE(i)<<" ";}
00137   cout<<endl;
00138   for (int i=0;i<5;i++){cout<<a.getEScalar(i)<<" ";}
00139 
00140   cout<<"\n ********* MC ******************"<<endl;
00141   for (int i=0;i<5;i++){cout<<a.getETrue(i)<<" ";}
00142   cout<<endl<<endl;
00143 
00144 }

void EtMissTest::PrintEvInfo G3EventProxy *    ev [private]
 

Definition at line 100 of file EtMissTest.cpp.

Referenced by FillingTest.

00101 {
00102   static int nEvRead=0;
00103   cout <<"======================================================================= " << endl;
00104   cout << " ======> Reading " << ++nEvRead << " Event" << endl; 
00105 
00106   cout <<" pythia run " << ev->simSignal()->originalId().runNumber()
00107        <<" pythia ev  " << ev->simSignal()->originalId().eventInRun() << endl;
00108 
00109   cout << " oohit Run Number " << ev->simSignal()->id().runNumber()
00110        << " event number "     << ev->simSignal()->id().eventInRun() << endl;
00111 
00112   cout <<" digi run = "     << ev->pEvent()->id().runNumber()
00113        <<" event number = " << ev->pEvent()->id().eventInRun() << endl;
00114 
00115   cout <<"***************************************************************** " << endl;
00116 
00117 }

void EtMissTest::upDate G3EventProxy *    ev [inline, private]
 

Definition at line 75 of file EtMissTest.cpp.

References FillingTest.

00075 {if (ev!=0) FillingTest(ev);}


Member Data Documentation

MySetup* EtMissTest::_mysetup [private]
 

Definition at line 81 of file EtMissTest.cpp.

Referenced by EtMissTest, and ~EtMissTest.

SimpleConfigurable<string> EtMissTest::_Scheme [private]
 

Definition at line 79 of file EtMissTest.cpp.

Referenced by CheckSchemeName, and EtMissTest.


The documentation for this class was generated from the following file:
Generated on Tue May 10 10:01:36 2005 for XANADOO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002