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

testXANAGeometry.cpp File Reference

#include <XANADOO/domain/interface/XANAEsdEvent.h>
#include <XANADOO/XANAClusters/interface/XANACluster.h>
#include <XANADOO/XANAClusters/interface/XANACaloRecHit.h>
#include <XANADOO/XANAClusters/interface/XANAEmCluster.h>
#include <XANADOO/XANAClusters/interface/XANASuperCluster.h>
#include <XANADOO/XANAClusters/interface/XANAHadCluster.h>
#include <XANADOO/XANATracks/interface/XANATrack.h>
#include <XANADOO/XANAMcInfo/interface/XANAGeneratorEvent.h>
#include <XANADOO/XANAMcInfo/interface/XANAGeantEvent.h>
#include <XANADOO/XANAMcInfo/interface/XANAGeneratorParticle.h>
#include <XANADOO/XANAElectronCandidate/interface/XANAElectronCandidate.h>
#include <XANADOO/XANAElectronCandidate/interface/XANAElectronTrack.h>
#include <XANADOO/XANAElectronCandidate/interface/XANAElectronSeed.h>
#include <XANADOO/XANAMuons/interface/XANAMuonCandidate.h>
#include <XANADOO/XANAMcInfo/interface/XANAGeantTrack.h>
#include <XANADOO/XANAMcInfo/interface/XANAGeantVertex.h>
#include <XANADOO/XANAGeometry/interface/XANAEcalGeometry.h>
#include <string>
#include <vector>
#include <TH1.h>
#include <TH2.h>

Include dependency graph for testXANAGeometry.cpp:

Include dependency graph

Go to the source code of this file.

Functions

int main (int argc, char **argv)


Function Documentation

int main int    argc,
char **    argv
 

Definition at line 29 of file testXANAGeometry.cpp.

References XANAEcalGeometry::getEast, XANAEcalGeometry::getEtaORxIndex, XANAEcalGeometry::getNorth, XANAEcalGeometry::getNorthWest, XANAEcalGeometry::getPhiORyIndex, XANAEcalGeometry::getSouth, XANAEcalGeometry::getSouthEast, XANAEcalGeometry::getSouthWest, XANAEcalGeometry::getWest, and XANAEcalGeometry::isXtal.

00030 {
00031   std::cout<<"[OVAL]essai dif"<<endl;
00032   TFile *f2 = new TFile("testXANAGeometry.root", "recreate");
00033   f2->cd();
00034 
00035   TH1F * hIetaORx = new TH1F("hIetaORx","IetaORx",170, 0., 170.);
00036   TH2F * hIetaORx2 = new TH2F("hIetaORx2","IetaORx",170, 0., 170., 1, 0., 170.);
00037 
00038   TH1F * hIphiORy = new TH1F("hIphiORy","IphiORy",360, 0., 360.);
00039   TH2F * hIphiORy2 = new TH2F("hIphiORy2","IphiORy",360, 0., 360., 1, 0., 360.);
00040 
00041   TH2F * testEnd=new TH2F("testEnd","ENDCAP",100, 0., 100., 100, 0., 100.);
00042   TH2F * mapEndcap= new TH2F("mapEndcap", "map", 100, 0., 100., 100, 0., 100);
00043   Float_t position[3];
00044   XANAEcalGeometry * geom = new XANAEcalGeometry();
00045   Int_t ordre=1;
00046 
00047   for(int xtal=0; xtal<10000; xtal++)
00048     {
00049       if (geom->isXtal(xtal,-1)==0)
00050         {
00051           Int_t Ieta=xtal%100;
00052           Int_t Iphi=int(xtal/100);
00053           mapEndcap->Fill(Ieta, Iphi, 100.);
00054         }
00055       
00056     }
00057 
00058   position[0]=-1.55589;
00059   position[1]=33.8957;
00060   position[2]=-316.538;
00061   //This is the position of a XANACellID in the Endcap
00062   
00063 
00064   HepPoint3D pos(position[0],position[1],position[2]);
00065   
00066   XANACellID cell = XANACellID(pos);
00067   Int_t Ieta=geom->getEtaORxIndex(cell);
00068   Int_t Iphi=geom->getPhiORyIndex(cell);
00069   
00070   testEnd->Fill(Ieta, Iphi, ordre);
00071   ordre++;
00072     
00073   XANACellID east=geom->getEast(cell);
00074   
00075   while(!(east==cell))
00076     {
00077       cell=east;
00078       east=geom->getEast(cell);
00079     }   
00080   
00081   Ieta=geom->getEtaORxIndex(cell);
00082   hIetaORx->Fill(Ieta);
00083   hIetaORx2->Fill(Ieta,1);
00084 
00085   Iphi=geom->getPhiORyIndex(cell);
00086   hIphiORy->Fill(Iphi);
00087   hIphiORy2->Fill(Iphi,1);
00088   
00089   testEnd->Fill(Ieta, Iphi, ordre);
00090   ordre++;
00091   
00092   XANACellID north=geom->getNorth(cell);
00093   
00094   while(!(north==cell))
00095     {
00096       cell=north;
00097     }
00098   
00099   Iphi=geom->getPhiORyIndex(cell);
00100   Ieta=geom->getEtaORxIndex(cell);
00101   testEnd->Fill(Ieta, Iphi, ordre);
00102   ordre++;
00103   
00104   cell=geom->getNorth(cell);
00105   Iphi=geom->getPhiORyIndex(cell);
00106   Ieta=geom->getEtaORxIndex(cell);
00107   testEnd->Fill(Ieta, Iphi, ordre);
00108   ordre++;
00109   
00110   XANACellID west=geom->getWest(cell);
00111   
00112   while(!(west==cell))
00113     {
00114       cell=west;
00115       west=geom->getWest(cell);
00116     }   
00117   Iphi=geom->getPhiORyIndex(cell);
00118   Ieta=geom->getEtaORxIndex(cell);
00119   testEnd->Fill(Ieta, Iphi, ordre);
00120   ordre++;
00121   
00122   cell=geom->getSouth(cell);
00123   Iphi=geom->getPhiORyIndex(cell);
00124   Ieta=geom->getEtaORxIndex(cell);
00125   testEnd->Fill(Ieta, Iphi, ordre);
00126   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00127   
00128   
00129   
00130   ordre=1;
00131   cell = XANACellID(pos);
00132   
00133   for(int dec=1; dec<25; dec++)
00134     {
00135       cell=geom->getWest(cell);
00136     }
00137   
00138   Iphi=geom->getPhiORyIndex(cell);
00139   Ieta=geom->getEtaORxIndex(cell);
00140   testEnd->Fill(Ieta, Iphi, ordre);
00141   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00142   
00143   cell=geom->getNorthWest(cell);
00144   Iphi=geom->getPhiORyIndex(cell);
00145   Ieta=geom->getEtaORxIndex(cell);
00146   testEnd->Fill(Ieta, Iphi, ordre);
00147   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00148   cell=geom->getWest(cell);
00149   Iphi=geom->getPhiORyIndex(cell);
00150   Ieta=geom->getEtaORxIndex(cell);
00151   testEnd->Fill(Ieta, Iphi, ordre);
00152   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00153   cell=geom->getSouthWest(cell);
00154   Iphi=geom->getPhiORyIndex(cell);
00155   Ieta=geom->getEtaORxIndex(cell);
00156   testEnd->Fill(Ieta, Iphi, ordre);
00157   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00158   cell=geom->getSouth(cell);
00159   Iphi=geom->getPhiORyIndex(cell);
00160   Ieta=geom->getEtaORxIndex(cell);
00161   testEnd->Fill(Ieta, Iphi, ordre);
00162   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00163   cell=geom->getSouthEast(cell);
00164   Iphi=geom->getPhiORyIndex(cell);
00165   Ieta=geom->getEtaORxIndex(cell);
00166   testEnd->Fill(Ieta, Iphi, ordre);
00167   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00168   cell=geom->getEast(cell);
00169   Iphi=geom->getPhiORyIndex(cell);
00170   Ieta=geom->getEtaORxIndex(cell);
00171   testEnd->Fill(Ieta, Iphi, ordre);
00172   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00173   cell=geom->getSouthEast(cell);
00174   Iphi=geom->getPhiORyIndex(cell);
00175   Ieta=geom->getEtaORxIndex(cell);
00176   testEnd->Fill(Ieta, Iphi, ordre);
00177   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00178   cell=geom->getSouth(cell);
00179   Iphi=geom->getPhiORyIndex(cell);
00180   Ieta=geom->getEtaORxIndex(cell);
00181   testEnd->Fill(Ieta, Iphi, ordre);
00182   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00183   cell=geom->getSouth(cell);
00184   Iphi=geom->getPhiORyIndex(cell);
00185   Ieta=geom->getEtaORxIndex(cell);
00186   testEnd->Fill(Ieta, Iphi, ordre);
00187   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00188   cell=geom->getSouthWest(cell);
00189   Iphi=geom->getPhiORyIndex(cell);
00190   Ieta=geom->getEtaORxIndex(cell);
00191   testEnd->Fill(Ieta, Iphi, ordre);
00192   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00193   cell=geom->getWest(cell);
00194   Iphi=geom->getPhiORyIndex(cell);
00195   Ieta=geom->getEtaORxIndex(cell);
00196   testEnd->Fill(Ieta, Iphi, ordre);
00197   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00198   cell=geom->getNorthWest(cell);
00199   Iphi=geom->getPhiORyIndex(cell);
00200   Ieta=geom->getEtaORxIndex(cell);
00201   testEnd->Fill(Ieta, Iphi, ordre);
00202   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00203   cell=geom->getNorth(cell);
00204   Iphi=geom->getPhiORyIndex(cell);
00205   Ieta=geom->getEtaORxIndex(cell);
00206   testEnd->Fill(Ieta, Iphi, ordre);
00207   ordre++; std::cout<<"[OVAL]  Ieta="<<Ieta<<"  Iphi="<<Iphi<<std::endl;
00208   
00209   
00210   f2->Write();
00211   f2->Close();
00212   
00213 }


Generated on Tue May 10 10:01:26 2005 for XANADOO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002