Fork me on GitHub

Changeset 100 in svn for trunk/src


Ignore:
Timestamp:
Dec 18, 2008, 2:39:26 PM (16 years ago)
Author:
severine ovyn
Message:

Remove datacard bug + CaloTowers OK

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/BFieldProp.cc

    r94 r100  
    2525//------------------------------------------------------------------------------
    2626
    27 TrackPropagation::TrackPropagation() {
     27TrackPropagation::TrackPropagation(string DetDatacard) {
    2828
     29 DET = new RESOLution();
     30 DET->ReadDataCard(DetDatacard);
    2931 MAXITERATION = 10000;
    3032 MINSEGLENGTH = 70;
     
    4345 
    4446  //out of trackibg coverage?
    45   if(sqrt(Xvertex1*Xvertex1+Yvertex1*Yvertex1) > TRACK_radius){return;}
    46   if(fabs(Zvertex1) > TRACK_length){return;}
     47  if(sqrt(Xvertex1*Xvertex1+Yvertex1*Yvertex1) > DET->TRACK_radius){return;}
     48  if(fabs(Zvertex1) > DET->TRACK_length){return;}
    4749 
    4850  float Px = Part->Px;
     
    6264     double vz = pz/M;
    6365
    64      double Bx = TRACK_bfield_x;
    65      double By = TRACK_bfield_y;
    66      double Bz = TRACK_bfield_z;
     66     double Bx = DET->TRACK_bfield_x;
     67     double By = DET->TRACK_bfield_y;
     68     double Bz = DET->TRACK_bfield_z;
    6769
    6870     double ax =  (q/M)*(Bz*vy - By*vz);
     
    8082     int k = 0;
    8183     
     84     double Radius=DET->TRACK_radius;
     85     double Length=DET->TRACK_length;
     86
    8287     while(k < MAXITERATION){
    8388        k++;
     
    99104        z  += vz*dt;
    100105
    101        if( (x*x+y*y) > TRACK_radius*TRACK_radius ){ x /= (x*x+y*y)/(TRACK_radius*TRACK_radius); y /= (x*x+y*y)/(TRACK_radius*TRACK_radius); break;}
    102        if( fabs(z)>TRACK_length)break;
     106       if( (x*x+y*y) > Radius*Radius ){ x /= (x*x+y*y)/(Radius*Radius); y /= (x*x+y*y)/(Radius*Radius); break;}
     107       if( fabs(z)>Length)break;
    103108
    104109       xold = x;
  • trunk/src/FrogUtil.cc

    r97 r100  
    485485 
    486486  double Rayon_Tracker=50;
    487   double Rayon_Calo = Rayon_Tracker*2;
    488   double Lenght_Tracker=120;
    489   double Lenght_Calo=Lenght_Tracker+Lenght_Tracker/2;
    490   double Lenght_FWCalo=Lenght_Tracker+Lenght_Tracker;
    491  
    492   int NumPhi=10;
     487  double Rayon_Calo = Rayon_Tracker*1.5;
     488  double Rayon_Muon = Rayon_Tracker*2;
     489  double Lenght_Tracker=100;
     490  double Lenght_Calo=Lenght_Tracker+Lenght_Tracker/2.5;
     491  double Lenght_Muon=Lenght_Calo+Lenght_Calo/2.5;
     492  double Lenght_FWCalo=Lenght_Tracker+1.5*Lenght_Tracker;
     493 
     494  int plus=1;
     495  int NumPhi=4;
    493496 
    494497  //************************************************Tracker*************************************************
     
    498501  detector->addDaughter(Tracker);
    499502  unsigned int DetIdCountTracker = 1;
    500   for(double ray=0;ray <= Rayon_Tracker;ray +=5){
     503  for(double ray=0;ray <= Rayon_Tracker;ray +=plus){
     504  //  double ray=Rayon_Tracker;
    501505    double length = ray/tan(EtaToTheta(DET->CEN_max_tracker));
    502506    if(length >= Lenght_Tracker)
    503507      {
    504         FROG_Element_Primitive_Cylinder* tracker = new FROG_Element_Primitive_Cylinder(9100000+DetIdCountTracker*10,ray,0,0,0,0,0,Lenght_Tracker,NumPhi,0);
     508        FROG_Element_Primitive_Cylinder* tracker = new FROG_Element_Primitive_Cylinder(9100000+DetIdCountTracker*10,ray,0,0,0,0,0,Lenght_Tracker,NumPhi,1);
     509//      FROG_Element_Primitive_Cone* tracker = new FROG_Element_Primitive_Cone(9100000+DetIdCountTracker*10,ray,0,0,0,0,0,Lenght_Tracker,NumPhi,1);
    505510        Tracker->addDaughter(tracker);   DetIdCountTracker++;
    506511      }
     
    518523  unsigned int DetIdCountCalo = 1;
    519524 
    520   for(double ray=Rayon_Tracker;ray <= Rayon_Calo ;ray +=5){
     525  for(double ray=Rayon_Tracker;ray <= Rayon_Calo ;ray +=plus){
    521526    double length = ray/tan(EtaToTheta(DET->CEN_max_calo_cen));
    522527    double add;
     
    529534      }
    530535  }
    531   for(double ray=0;ray <= Rayon_Tracker;ray +=5){
     536  for(double ray=0;ray <= Rayon_Tracker;ray +=plus){
    532537    double length = ray/tan(EtaToTheta(DET->CEN_max_calo_cen));
    533538    double add;
     
    552557  double eta_Max=DET->CEN_max_calo_fwd,eta_Min=DET->CEN_max_calo_cen;
    553558 
    554   for(double ray=0;ray <= 50;ray +=5){
     559  for(double ray=0;ray <= 50;ray +=plus){
    555560    double length = ray/tan(EtaToTheta(eta_Max));
    556561    double add;
    557     if(length >= Lenght_FWCalo)add=(Lenght_FWCalo-Lenght_Calo)/2;
    558     else add=(length-Lenght_Calo)/2;
     562    if(length >= Lenght_FWCalo)add=(Lenght_FWCalo-Lenght_Muon)/2;
     563    else add=(length-Lenght_Muon)/2;
    559564   
    560565    if(add > 0 && ray < Lenght_FWCalo*tan(EtaToTheta(eta_Min)))
    561566      {
    562         FROG_Element_Primitive_Cylinder* caloFW1 = new FROG_Element_Primitive_Cylinder(9300000+DetIdCountFwCalo*10,ray,0,0,(Lenght_Calo+add)/2,0,0,add,NumPhi,0);
     567        FROG_Element_Primitive_Cylinder* caloFW1 = new FROG_Element_Primitive_Cylinder(9300000+DetIdCountFwCalo*10,ray,0,0,(Lenght_Muon+add)/2,0,0,add,NumPhi,0);
    563568        FWCALO->addDaughter(caloFW1);   DetIdCountFwCalo++;
    564         FROG_Element_Primitive_Cylinder* caloFW2 = new FROG_Element_Primitive_Cylinder(9300000+DetIdCountFwCalo*10,ray,0,0,-(Lenght_Calo+add)/2,0,0,add,NumPhi,0);
     569        FROG_Element_Primitive_Cylinder* caloFW2 = new FROG_Element_Primitive_Cylinder(9300000+DetIdCountFwCalo*10,ray,0,0,-(Lenght_Muon+add)/2,0,0,add,NumPhi,0);
    565570        FWCALO->addDaughter(caloFW2);   DetIdCountFwCalo++;
    566571      }
    567572  }
     573
     574  //***********************************************Muon chambers********************************************
     575  //********************************************************************************************************
     576  //
     577  FROG_Element_Base_With_DetId_And_Name* MUON = new FROG_Element_Base_With_DetId_And_Name(940000000,"MuonDet");
     578  detector->addDaughter(MUON);
     579  unsigned int DetIdCountMuon = 1;
     580
     581  for(double ray=Rayon_Calo;ray <= Rayon_Muon ;ray +=plus){
     582    double length = ray/tan(EtaToTheta(DET->CEN_max_mu));
     583    double add;
     584    if(length >= Lenght_Muon)add=Lenght_Muon;
     585    else add=ray/tan(EtaToTheta(DET->CEN_max_calo_cen));
     586    if(add > 0)
     587      {
     588        FROG_Element_Primitive_Cylinder* muon = new FROG_Element_Primitive_Cylinder(9400000+DetIdCountMuon*10,ray,0,0,0,0,0,add,NumPhi,0);
     589        MUON->addDaughter(muon);   DetIdCountMuon++;
     590      }
     591  }
     592  for(double ray=0;ray <= Rayon_Calo;ray +=plus){
     593    double length = ray/tan(EtaToTheta(DET->CEN_max_calo_cen));
     594    double add;
     595    if(length >= Lenght_Muon)add=(Lenght_Muon-Lenght_Calo)/2;
     596    else add=(length-Lenght_Calo)/2;
     597    if(add > 0)
     598      {
     599        FROG_Element_Primitive_Cylinder* muonP = new FROG_Element_Primitive_Cylinder(9400000+DetIdCountMuon*10,ray,0,0,(Lenght_Calo+add)/2,0,0,add,NumPhi,0);
     600        MUON->addDaughter(muonP);   DetIdCountMuon++;
     601        FROG_Element_Primitive_Cylinder* muonM = new FROG_Element_Primitive_Cylinder(9400000+DetIdCountMuon*10,ray,0,0,-(Lenght_Calo+add)/2,0,0,add,NumPhi,0);
     602        MUON->addDaughter(muonM);   DetIdCountMuon++;
     603      }
     604  }
     605
     606 
    568607   
    569608  FROG_Geometry* CustomGeom = new FROG_Geometry(prim);
  • trunk/src/JetUtils.cc

    r94 r100  
    1515using namespace std;
    1616
    17 JetsUtil::JetsUtil() {
    18  
    19   switch(JET_jetalgo) {
     17JetsUtil::JetsUtil(const string DetDatacard) {
     18 
     19 DET = new RESOLution();
     20 DET->ReadDataCard(DetDatacard);
     21 
     22  switch(DET->JET_jetalgo) {
    2023  default:
    2124  case 1: {
    22    
    2325    // set up a CDF midpoint jet definition
    2426#ifdef ENABLE_PLUGIN_CDFCONES
    25     plugins = new fastjet::CDFJetCluPlugin(JET_seed,JET_coneradius,JET_C_adjacencycut,JET_C_maxiterations,JET_C_iratch,JET_overlap);
     27    plugins = new fastjet::CDFJetCluPlugin(DET->JET_seed,DET->JET_coneradius,DET->JET_C_adjacencycut,DET->JET_C_maxiterations,DET->JET_C_iratch,DET->JET_overlap);
    2628    jet_def = fastjet::JetDefinition(plugins);
    2729#else
     
    3436    // set up a CDF midpoint jet definition
    3537#ifdef ENABLE_PLUGIN_CDFCONES
    36     plugins = new fastjet::CDFMidPointPlugin (JET_seed,JET_coneradius,JET_M_coneareafraction,JET_M_maxpairsize,JET_M_maxiterations,JET_overlap);
     38    plugins = new fastjet::CDFMidPointPlugin (DET->JET_seed,DET->JET_coneradius,DET->JET_M_coneareafraction,DET->JET_M_maxpairsize,DET->JET_M_maxiterations,DET->JET_overlap);
    3739    jet_def = fastjet::JetDefinition(plugins);
    3840#else
     
    4547    // set up a siscone jet definition
    4648#ifdef ENABLE_PLUGIN_SISCONE
    47     plugins = new fastjet::SISConePlugin (JET_coneradius,JET_overlap,JET_S_npass, JET_S_protojet_ptmin);
     49    plugins = new fastjet::SISConePlugin (DET->JET_coneradius,DET->JET_overlap,DET->JET_S_npass, DET->JET_S_protojet_ptmin);
    4850    jet_def = fastjet::JetDefinition(plugins);
    4951#else
     
    5456   
    5557  case 4: {
    56     jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, JET_coneradius);
     58
     59    jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, DET->JET_coneradius);
    5760  }
    5861    break;
    5962   
    6063  case 5: {
    61     jet_def = fastjet::JetDefinition(fastjet::cambridge_algorithm,JET_coneradius);
     64    jet_def = fastjet::JetDefinition(fastjet::cambridge_algorithm,DET->JET_coneradius);
    6265  }
    6366    break;
    6467   
    6568  case 6: {
    66     jet_def = fastjet::JetDefinition(fastjet::antikt_algorithm,JET_coneradius);
     69    jet_def = fastjet::JetDefinition(fastjet::antikt_algorithm,DET->JET_coneradius);
    6770  }
    6871    break;
     
    7174}
    7275
    73 vector<fastjet::PseudoJet> JetsUtil::RunJets(const vector<fastjet::PseudoJet> & input_particles)
     76vector<fastjet::PseudoJet> JetsUtil::RunJets(const vector<fastjet::PseudoJet>& input_particles)
    7477{
    7578  inclusive_jets.clear();
    7679  sorted_jets.clear();
    77  
    7880  // run the jet clustering with the above jet definition
    7981  if(input_particles.size()!=0)
     
    9698  for (unsigned int i = 0; i < sorted_jets.size(); i++) {
    9799    JET.SetPxPyPzE(sorted_jets[i].px(),sorted_jets[i].py(),sorted_jets[i].pz(),sorted_jets[i].E());
    98     if(JET.Pt() > PTCUT_jet)
     100    if(JET.Pt() > DET->PTCUT_jet)
    99101      {
    100102        elementJet = (TRootJet*) branchJet->NewEntry();
     
    102104        // b-jets
    103105        bool btag=false;
    104         if((fabs(JET.Eta()) < CEN_max_tracker && Btaggedjet(JET, NFCentralQ)))btag=true;
     106        if((fabs(JET.Eta()) < DET->CEN_max_tracker && DET->Btaggedjet(JET, NFCentralQ)))btag=true;
    105107        elementJet->Btag = btag;
    106108      }
     
    116118    JET.SetPxPyPzE(sorted_jets[i].px(),sorted_jets[i].py(),sorted_jets[i].pz(),sorted_jets[i].E());
    117119    // Tau jet identification : 1! track and electromagnetic collimation
    118     if(fabs(JET.Eta()) < (CEN_max_tracker - TAU_track_scone)) {
    119       double Energie_tau_central = EnergySmallCone(towers,JET.Eta(),JET.Phi());
     120    if(fabs(JET.Eta()) < (DET->CEN_max_tracker - DET->TAU_track_scone)) {
     121      double Energie_tau_central = DET->EnergySmallCone(towers,JET.Eta(),JET.Phi());
    120122      if(
    121          ( Energie_tau_central/JET.E() > TAU_energy_frac ) &&
    122          ( NumTracks(TrackCentral,TAU_track_pt,JET.Eta(),JET.Phi()) == 1 ) &&
    123          ( JET.Pt() > PTCUT_taujet)
     123         ( Energie_tau_central/JET.E() > DET->TAU_energy_frac ) &&
     124         ( DET->NumTracks(TrackCentral,DET->TAU_track_pt,JET.Eta(),JET.Phi()) == 1 ) &&
     125         ( JET.Pt() > DET->PTCUT_taujet)
    124126         ) {
    125127        elementTauJet = (TRootTauJet*) branchTauJet->NewEntry();
  • trunk/src/VeryForward.cc

    r94 r100  
    2626//------------------------------------------------------------------------------
    2727
    28 VeryForward::VeryForward() {
    29  
     28VeryForward::VeryForward(string DetDatacard) {
     29 
     30 DET = new RESOLution();
     31 DET->ReadDataCard(DetDatacard);
     32 
    3033  //Initialisation of Hector
    3134  relative_energy = true; // should always be true
     
    6265  TLorentzVector genMomentum;
    6366  // Zero degree calorimeter, for forward neutrons and photons
    64   if (particle->Status ==1 && (pid == pN || pid == pGAMMA ) && eta > VFD_min_zdc ) {
     67  if (particle->Status ==1 && (pid == pN || pid == pGAMMA ) && eta > DET->VFD_min_zdc ) {
    6568    genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E);
    6669    // !!!!!!!!! vérifier que particle->Z est bien en micromÚtres!!!
     
    7578    //double theta = (1E-6)*sqrt( pow(tx,2) + pow(ty,2) );
    7679    //double flight_distance = (DET->ZDC_S - particle->Z*(1E-6))/cos(theta) ; // assumes that Z is in micrometers
    77     double flight_distance = (VFD_s_zdc - particle->Z*(1E-6));
     80    double flight_distance = (DET->VFD_s_zdc - particle->Z*(1E-6));
    7881    // assumes also that the emission angle is so small that 1/(cos theta) = 1
    7982    elementZdc->T = 0*particle->T + flight_distance/speed_of_light; // assumes highly relativistic particles
     
    9598  genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E);
    9699  // if forward proton
    97   if( (pid == pP)  && (particle->Status == 1) &&  (fabs(genMomentum.Eta()) > CEN_max_calo_fwd) )
     100  if( (pid == pP)  && (particle->Status == 1) &&  (fabs(genMomentum.Eta()) > DET->CEN_max_calo_fwd) )
    98101    {
    99102      // !!!!!!!! put here particle->CHARGE and particle->MASS
     
    112115      if(p1.stopped(beamline)) {
    113116        if (p1.getStoppingElement()->getName()=="rp220_1" || p1.getStoppingElement()->getName()=="rp220_2") {
    114           p1.propagate(RP_220_s);
     117          p1.propagate(DET->RP_220_s);
    115118          elementRP220 = (TRootRomanPotHits*) branchRP220->NewEntry();
    116119          elementRP220->X  = (1E-6)*p1.getX();  // [m]
     
    125128         
    126129        } else if (p1.getStoppingElement()->getName()=="rp420_1" || p1.getStoppingElement()->getName()=="rp420_2") {
    127           p1.propagate(RP_420_s);
     130          p1.propagate(DET->RP_420_s);
    128131          elementFP420 = (TRootRomanPotHits*) branchFP420->NewEntry();
    129132          elementFP420->X  = (1E-6)*p1.getX();  // [m]
Note: See TracChangeset for help on using the changeset viewer.