- Timestamp:
- Dec 18, 2008, 2:39:26 PM (16 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/BFieldProp.cc
r94 r100 25 25 //------------------------------------------------------------------------------ 26 26 27 TrackPropagation::TrackPropagation( ) {27 TrackPropagation::TrackPropagation(string DetDatacard) { 28 28 29 DET = new RESOLution(); 30 DET->ReadDataCard(DetDatacard); 29 31 MAXITERATION = 10000; 30 32 MINSEGLENGTH = 70; … … 43 45 44 46 //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;} 47 49 48 50 float Px = Part->Px; … … 62 64 double vz = pz/M; 63 65 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; 67 69 68 70 double ax = (q/M)*(Bz*vy - By*vz); … … 80 82 int k = 0; 81 83 84 double Radius=DET->TRACK_radius; 85 double Length=DET->TRACK_length; 86 82 87 while(k < MAXITERATION){ 83 88 k++; … … 99 104 z += vz*dt; 100 105 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; 103 108 104 109 xold = x; -
trunk/src/FrogUtil.cc
r97 r100 485 485 486 486 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; 493 496 494 497 //************************************************Tracker************************************************* … … 498 501 detector->addDaughter(Tracker); 499 502 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; 501 505 double length = ray/tan(EtaToTheta(DET->CEN_max_tracker)); 502 506 if(length >= Lenght_Tracker) 503 507 { 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); 505 510 Tracker->addDaughter(tracker); DetIdCountTracker++; 506 511 } … … 518 523 unsigned int DetIdCountCalo = 1; 519 524 520 for(double ray=Rayon_Tracker;ray <= Rayon_Calo ;ray += 5){525 for(double ray=Rayon_Tracker;ray <= Rayon_Calo ;ray +=plus){ 521 526 double length = ray/tan(EtaToTheta(DET->CEN_max_calo_cen)); 522 527 double add; … … 529 534 } 530 535 } 531 for(double ray=0;ray <= Rayon_Tracker;ray += 5){536 for(double ray=0;ray <= Rayon_Tracker;ray +=plus){ 532 537 double length = ray/tan(EtaToTheta(DET->CEN_max_calo_cen)); 533 538 double add; … … 552 557 double eta_Max=DET->CEN_max_calo_fwd,eta_Min=DET->CEN_max_calo_cen; 553 558 554 for(double ray=0;ray <= 50;ray += 5){559 for(double ray=0;ray <= 50;ray +=plus){ 555 560 double length = ray/tan(EtaToTheta(eta_Max)); 556 561 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; 559 564 560 565 if(add > 0 && ray < Lenght_FWCalo*tan(EtaToTheta(eta_Min))) 561 566 { 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); 563 568 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); 565 570 FWCALO->addDaughter(caloFW2); DetIdCountFwCalo++; 566 571 } 567 572 } 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 568 607 569 608 FROG_Geometry* CustomGeom = new FROG_Geometry(prim); -
trunk/src/JetUtils.cc
r94 r100 15 15 using namespace std; 16 16 17 JetsUtil::JetsUtil() { 18 19 switch(JET_jetalgo) { 17 JetsUtil::JetsUtil(const string DetDatacard) { 18 19 DET = new RESOLution(); 20 DET->ReadDataCard(DetDatacard); 21 22 switch(DET->JET_jetalgo) { 20 23 default: 21 24 case 1: { 22 23 25 // set up a CDF midpoint jet definition 24 26 #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); 26 28 jet_def = fastjet::JetDefinition(plugins); 27 29 #else … … 34 36 // set up a CDF midpoint jet definition 35 37 #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); 37 39 jet_def = fastjet::JetDefinition(plugins); 38 40 #else … … 45 47 // set up a siscone jet definition 46 48 #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); 48 50 jet_def = fastjet::JetDefinition(plugins); 49 51 #else … … 54 56 55 57 case 4: { 56 jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, JET_coneradius); 58 59 jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, DET->JET_coneradius); 57 60 } 58 61 break; 59 62 60 63 case 5: { 61 jet_def = fastjet::JetDefinition(fastjet::cambridge_algorithm, JET_coneradius);64 jet_def = fastjet::JetDefinition(fastjet::cambridge_algorithm,DET->JET_coneradius); 62 65 } 63 66 break; 64 67 65 68 case 6: { 66 jet_def = fastjet::JetDefinition(fastjet::antikt_algorithm, JET_coneradius);69 jet_def = fastjet::JetDefinition(fastjet::antikt_algorithm,DET->JET_coneradius); 67 70 } 68 71 break; … … 71 74 } 72 75 73 vector<fastjet::PseudoJet> JetsUtil::RunJets(const vector<fastjet::PseudoJet> &input_particles)76 vector<fastjet::PseudoJet> JetsUtil::RunJets(const vector<fastjet::PseudoJet>& input_particles) 74 77 { 75 78 inclusive_jets.clear(); 76 79 sorted_jets.clear(); 77 78 80 // run the jet clustering with the above jet definition 79 81 if(input_particles.size()!=0) … … 96 98 for (unsigned int i = 0; i < sorted_jets.size(); i++) { 97 99 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) 99 101 { 100 102 elementJet = (TRootJet*) branchJet->NewEntry(); … … 102 104 // b-jets 103 105 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; 105 107 elementJet->Btag = btag; 106 108 } … … 116 118 JET.SetPxPyPzE(sorted_jets[i].px(),sorted_jets[i].py(),sorted_jets[i].pz(),sorted_jets[i].E()); 117 119 // 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()); 120 122 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) 124 126 ) { 125 127 elementTauJet = (TRootTauJet*) branchTauJet->NewEntry(); -
trunk/src/VeryForward.cc
r94 r100 26 26 //------------------------------------------------------------------------------ 27 27 28 VeryForward::VeryForward() { 29 28 VeryForward::VeryForward(string DetDatacard) { 29 30 DET = new RESOLution(); 31 DET->ReadDataCard(DetDatacard); 32 30 33 //Initialisation of Hector 31 34 relative_energy = true; // should always be true … … 62 65 TLorentzVector genMomentum; 63 66 // 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 ) { 65 68 genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E); 66 69 // !!!!!!!!! vérifier que particle->Z est bien en micromÚtres!!! … … 75 78 //double theta = (1E-6)*sqrt( pow(tx,2) + pow(ty,2) ); 76 79 //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)); 78 81 // assumes also that the emission angle is so small that 1/(cos theta) = 1 79 82 elementZdc->T = 0*particle->T + flight_distance/speed_of_light; // assumes highly relativistic particles … … 95 98 genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E); 96 99 // 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) ) 98 101 { 99 102 // !!!!!!!! put here particle->CHARGE and particle->MASS … … 112 115 if(p1.stopped(beamline)) { 113 116 if (p1.getStoppingElement()->getName()=="rp220_1" || p1.getStoppingElement()->getName()=="rp220_2") { 114 p1.propagate( RP_220_s);117 p1.propagate(DET->RP_220_s); 115 118 elementRP220 = (TRootRomanPotHits*) branchRP220->NewEntry(); 116 119 elementRP220->X = (1E-6)*p1.getX(); // [m] … … 125 128 126 129 } 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); 128 131 elementFP420 = (TRootRomanPotHits*) branchFP420->NewEntry(); 129 132 elementFP420->X = (1E-6)*p1.getX(); // [m]
Note:
See TracChangeset
for help on using the changeset viewer.