Fork me on GitHub

Changeset 377 in svn


Ignore:
Timestamp:
May 12, 2009, 9:41:00 AM (16 years ago)
Author:
Xavier Rouby
Message:

new PDG table ; switch back to old ZDC and old RomanPots

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VeryForward.cc

    r374 r377  
    3232#include "VeryForward.h"
    3333#include "H_RomanPot.h"
     34#include "PdgParticle.h"
    3435#include <iostream>
    3536#include<cmath>
     
    9495  beamline1->fill(DET->RP_beam1Card,1,DET->RP_IP_name);                               
    9596  beamline1->offsetElements(DET->RP_offsetEl_s,-DET->RP_offsetEl_x);
    96   H_RomanPot * rp220_1 = new H_RomanPot("rp220_1",DET->RP_220_s,DET->RP_220_x*(1E6)); // RP 220m, 2mm, beam 1 
    97   H_RomanPot * rp420_1 = new H_RomanPot("rp420_1",DET->RP_420_s,DET->RP_420_x*(1E6)); // RP 420m, 4mm, beam 1 
     97  H_RomanPot * rp220_1 = new H_RomanPot("rp220_1",DET->RP_220_s,DET->RP_220_x*1E6); // RP 220m, 2mm, beam 1 
     98  H_RomanPot * rp420_1 = new H_RomanPot("rp420_1",DET->RP_420_s,DET->RP_420_x*1E6); // RP 420m, 4mm, beam 1 
    9899  beamline1->add(rp220_1);
    99100  beamline1->add(rp420_1);
     
    101102  beamline2->fill(DET->RP_beam2Card,-1,DET->RP_IP_name);                             
    102103  beamline2->offsetElements(DET->RP_offsetEl_s,+DET->RP_offsetEl_x);
    103   H_RomanPot * rp220_2 = new H_RomanPot("rp220_2",DET->RP_220_s,DET->RP_220_x*(1E6));// RP 220m, 2mm, beam 2     
    104   H_RomanPot * rp420_2 = new H_RomanPot("rp420_2",DET->RP_420_s,DET->RP_420_x*(1E6));// RP 420m, 4mm, beam 2     
     104  H_RomanPot * rp220_2 = new H_RomanPot("rp220_2",DET->RP_220_s,DET->RP_220_x*1E6);// RP 220m, 2mm, beam 2     
     105  H_RomanPot * rp420_2 = new H_RomanPot("rp420_2",DET->RP_420_s,DET->RP_420_x*1E6);// RP 420m, 4mm, beam 2     
    105106  beamline2->add(rp220_2);
    106107  beamline2->add(rp420_2);
     
    110111
    111112
     113
    112114void VeryForward::ZDC(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchZDC, TRootGenParticle *particle)
    113115{
    114116  TRootZdcHits *elementZdc;
    115117  float energy = particle->E;
    116   //TLorentzVector genMomentum;
    117118
    118119  // Zero degree calorimeter, for forward neutrons and photons
     
    121122                           && fabs(particle->Eta) > DET->VFD_min_zdc ) {
    122123    elementZdc = (TRootZdcHits*) branchZDC->NewEntry();
    123  
     124
     125     
     126    // for compatibility with 'old' version
     127    TLorentzVector genMomentum;
     128    genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E);
     129    elementZdc->Set(genMomentum);
     130    // ******************
     131   
     132 
     133    //particle->print();
     134 
    124135    // 1) energy smearing
    125136    float energyS = -1.;
     
    158169
    159170    // 4) object nature : e.m. (photon) or had (neutron) ?
    160     elementZdc->hadronic_hit = (bool) (particle->PID==pN);
     171    //elementZdc->hadronic_hit = (bool) (particle->PID==pN);
    161172  }
    162  
    163 }
     173}
     174
     175
    164176void VeryForward::RomanPots(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchRP220,ExRootTreeBranch *branchFP420,TRootGenParticle *particle)
    165177{
    166   int pid=particle->PID;
    167  
     178  float charge = particle->Charge, mass = particle->M;
     179  if (mass<-999) { // unitialised!
     180          PdgParticle pdg_part = DET->PDGtable[particle->PID];
     181          charge  = pdg_part.charge();
     182          mass    = pdg_part.mass();
     183  }
     184  //if(particle->Charge!=1) return; // only particles with Q=+1 can hope to reach RP200/FP420
     185 
    168186  TRootRomanPotHits* elementRP220;
    169   TRootForwardTaggerHits* elementFP420;
     187  //TRootForwardTaggerHits* elementFP420;
     188  TRootRomanPotHits* elementFP420;
    170189 
    171190  TLorentzVector genMomentum;
    172191  genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E);
    173   // if forward proton
    174   if( (pid == pP)  && (particle->Status == 1) &&  (fabs(genMomentum.Eta()) > DET->CEN_max_calo_fwd) )
     192 
     193  // to go faster, why not rejecting particles already going into the ZDC?
     194  if( (particle->Status == 1) &&  (fabs(genMomentum.Eta()) > DET->CEN_max_calo_fwd) )
    175195    {
    176       // !!!!!!!! put here particle->CHARGE and particle->MASS
    177       H_BeamParticle p1; /// put here particle->CHARGE and particle->MASS
    178       p1.smearAng();
    179       p1.smearPos();
     196      //cout << "VeryForward :: M = " << mass << "\t Q = " << charge << "\t\t " << particle->PID << endl;
     197      H_BeamParticle p1(mass,charge); /// put here particle->CHARGE and particle->MASS
     198      p1.smearAng();   p1.smearPos(); // vertex smearing
    180199      p1.setPosition(p1.getX()+DET->RP_cross_x,p1.getY()+DET->RP_cross_y,p1.getTX()-1*kickers_on*DET->RP_cross_ang,p1.getTY(),0);
    181200      p1.set4Momentum(particle->Px,particle->Py,particle->Pz,particle->E);
     
    222241        } else if (p1.getStoppingElement()->getName()=="rp420_1" || p1.getStoppingElement()->getName()=="rp420_2") {
    223242          p1.propagate(DET->RP_420_s);
    224           elementFP420 = (TRootForwardTaggerHits*) branchFP420->NewEntry();
     243          //elementFP420 = (TRootForwardTaggerHits*) branchFP420->NewEntry();
     244          elementFP420 = (TRootRomanPotHits*) branchFP420->NewEntry();
    225245          elementFP420->X  = (1E-6)*p1.getX();  // [m]
    226246          elementFP420->Y  = (1E-6)*p1.getY();  // [m]
Note: See TracChangeset for help on using the changeset viewer.