Changeset 377 in svn
- Timestamp:
- May 12, 2009, 9:41:00 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VeryForward.cc
r374 r377 32 32 #include "VeryForward.h" 33 33 #include "H_RomanPot.h" 34 #include "PdgParticle.h" 34 35 #include <iostream> 35 36 #include<cmath> … … 94 95 beamline1->fill(DET->RP_beam1Card,1,DET->RP_IP_name); 95 96 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 197 H_RomanPot * rp420_1 = new H_RomanPot("rp420_1",DET->RP_420_s,DET->RP_420_x* (1E6)); // RP 420m, 4mm, beam 197 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 98 99 beamline1->add(rp220_1); 99 100 beamline1->add(rp420_1); … … 101 102 beamline2->fill(DET->RP_beam2Card,-1,DET->RP_IP_name); 102 103 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 2104 H_RomanPot * rp420_2 = new H_RomanPot("rp420_2",DET->RP_420_s,DET->RP_420_x* (1E6));// RP 420m, 4mm, beam 2104 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 105 106 beamline2->add(rp220_2); 106 107 beamline2->add(rp420_2); … … 110 111 111 112 113 112 114 void VeryForward::ZDC(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchZDC, TRootGenParticle *particle) 113 115 { 114 116 TRootZdcHits *elementZdc; 115 117 float energy = particle->E; 116 //TLorentzVector genMomentum;117 118 118 119 // Zero degree calorimeter, for forward neutrons and photons … … 121 122 && fabs(particle->Eta) > DET->VFD_min_zdc ) { 122 123 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 124 135 // 1) energy smearing 125 136 float energyS = -1.; … … 158 169 159 170 // 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); 161 172 } 162 163 } 173 } 174 175 164 176 void VeryForward::RomanPots(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchRP220,ExRootTreeBranch *branchFP420,TRootGenParticle *particle) 165 177 { 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 168 186 TRootRomanPotHits* elementRP220; 169 TRootForwardTaggerHits* elementFP420; 187 //TRootForwardTaggerHits* elementFP420; 188 TRootRomanPotHits* elementFP420; 170 189 171 190 TLorentzVector genMomentum; 172 191 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) ) 175 195 { 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 180 199 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); 181 200 p1.set4Momentum(particle->Px,particle->Py,particle->Pz,particle->E); … … 222 241 } else if (p1.getStoppingElement()->getName()=="rp420_1" || p1.getStoppingElement()->getName()=="rp420_2") { 223 242 p1.propagate(DET->RP_420_s); 224 elementFP420 = (TRootForwardTaggerHits*) branchFP420->NewEntry(); 243 //elementFP420 = (TRootForwardTaggerHits*) branchFP420->NewEntry(); 244 elementFP420 = (TRootRomanPotHits*) branchFP420->NewEntry(); 225 245 elementFP420->X = (1E-6)*p1.getX(); // [m] 226 246 elementFP420->Y = (1E-6)*p1.getY(); // [m]
Note:
See TracChangeset
for help on using the changeset viewer.