Changeset 219 in svn
- Timestamp:
- Feb 2, 2009, 12:33:21 PM (16 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/BFieldProp.cc
r199 r219 9 9 * */ 10 10 11 #include " interface/BFieldProp.h"11 #include "BFieldProp.h" 12 12 #include<cmath> 13 #include "TMath.h"14 13 using namespace std; 15 14 … … 17 16 //------------------------------------------------------------------------------ 18 17 19 TrackPropagation::TrackPropagation(const string DetDatacard): 20 MAXITERATION(10000), q(-9999.), phi_0(-9999.), gammam(-9999.), omega(-9999.), r(-9999.), 21 x_c(-9999.), y_c(-9999.), R_c(-9999.), Phi_c(-9999.), 22 rr(-9999.), t(-9999.), t_z(-9999.), t_T(-9999.), 23 x_t(-9999.), y_t(-9999.), z_t(-9999.), 24 R_t(-9999.), Phi_t(-9999.), Theta_t(-9999.), Eta_t(-9999.), 25 Px_t(-9999), Py_t(-9999), Pz_t(-9999), PT_t(-9999), p_t(-9999), E_t(-9999) { 26 27 // if(DetDatacard="") { DET = new RESOLution(); } 28 // else DET = new RESOLution(DetDatacard); 29 DET = new RESOLution(); 30 DET->ReadDataCard(DetDatacard); 31 32 // magnetic field parameters 18 TrackPropagation::TrackPropagation(){ 19 DET = new RESOLution(); 20 init(); 21 } 22 23 TrackPropagation::TrackPropagation(const string& DetDatacard){ 24 DET = new RESOLution(); 25 DET->ReadDataCard(DetDatacard); 26 init(); 27 } 28 29 TrackPropagation::TrackPropagation(const RESOLution* DetDatacard){ 30 DET= new RESOLution(*DetDatacard); 31 init(); 32 } 33 34 TrackPropagation::TrackPropagation(const TrackPropagation & tp){ 35 MAXITERATION = tp.MAXITERATION; 36 DET = new RESOLution(*(tp.DET)); 37 R_max = tp.R_max; z_max = tp.z_max; 38 B_x = tp.B_x; B_y = tp.B_y; B_z = tp.B_z; 39 q = tp.q; phi_0 = tp.phi_0; 40 gammam= tp.gammam; omega = tp.omega; 41 r = tp.r; rr = tp.rr; 42 x_c = tp.x_c; y_c = tp.y_c; 43 R_c = tp.R_c; Phi_c = tp.Phi_c; 44 t = tp.t; t_z = tp.t_z; t_T = tp.t_T; 45 x_t = tp.x_t; y_t = tp.y_t; z_t = tp.z_t; 46 R_t = tp.R_t; Phi_t = tp.Phi_t; 47 Theta_t=tp.Theta_t; Eta_t = tp.Eta_t; 48 Px_t = tp.Px_t; Py_t = tp.Py_t; Pz_t = tp.Pz_t; 49 PT_t = tp.PT_t; p_t = tp.p_t; E_t = tp.E_t; 50 loop_overflow_counter = tp.loop_overflow_counter; 51 } 52 53 TrackPropagation& TrackPropagation::operator=(const TrackPropagation & tp) { 54 if(this==&tp) return *this; 55 MAXITERATION = tp.MAXITERATION; 56 DET = new RESOLution(*(tp.DET)); 57 R_max = tp.R_max; z_max = tp.z_max; 58 B_x = tp.B_x; B_y = tp.B_y; B_z = tp.B_z; 59 q = tp.q; phi_0 = tp.phi_0; 60 gammam= tp.gammam; omega = tp.omega; 61 r = tp.r; rr = tp.rr; 62 x_c = tp.x_c; y_c = tp.y_c; 63 R_c = tp.R_c; Phi_c = tp.Phi_c; 64 t = tp.t; t_z = tp.t_z; t_T = tp.t_T; 65 x_t = tp.x_t; y_t = tp.y_t; z_t = tp.z_t; 66 R_t = tp.R_t; Phi_t = tp.Phi_t; 67 Theta_t=tp.Theta_t; Eta_t = tp.Eta_t; 68 Px_t = tp.Px_t; Py_t = tp.Py_t; Pz_t = tp.Pz_t; 69 PT_t = tp.PT_t; p_t = tp.p_t; E_t = tp.E_t; 70 loop_overflow_counter = tp.loop_overflow_counter; 71 return *this; 72 } 73 74 75 76 void TrackPropagation::init() { 77 MAXITERATION = 10000; 78 q= UNDEFINED; phi_0= UNDEFINED; gammam= UNDEFINED; omega=UNDEFINED; r=UNDEFINED; 79 x_c=UNDEFINED; y_c=UNDEFINED; R_c=UNDEFINED; Phi_c=UNDEFINED; 80 rr=UNDEFINED; t=UNDEFINED; t_z=UNDEFINED; t_T=UNDEFINED; 81 x_t=UNDEFINED; y_t=UNDEFINED; z_t=UNDEFINED; 82 R_t=UNDEFINED; Phi_t=UNDEFINED; Theta_t=UNDEFINED; Eta_t=UNDEFINED; 83 Px_t=UNDEFINED; Py_t=UNDEFINED; Pz_t=UNDEFINED; PT_t=UNDEFINED; p_t=UNDEFINED; E_t=UNDEFINED; 84 85 // DET has been initialised in the constructors 86 // magnetic field parameters 33 87 R_max = DET->TRACK_radius; 34 88 z_max = DET->TRACK_length/2.; … … 39 93 loop_overflow_counter=0; 40 94 } 95 96 41 97 42 98 void TrackPropagation::Propagation(const TRootGenParticle *Part,TLorentzVector &momentum) { … … 81 137 rr = sqrt( pow(R_c,2.) + pow(r,2.) ); // temp variable 82 138 t_T=0; 83 t_z = gammam / Part->Pz * (-Part->Z + z_max* TMath::Sign((Float_t)1.,(Float_t)Part->Pz) ) ; 139 int sign_pz= (Part->Pz >0) ? 1 : -1; 140 t_z = gammam / Part->Pz * (-Part->Z + z_max*sign_pz ) ; 84 141 if ( fabs(R_c - r) > R_max || R_c + r < R_max ) t = t_z; 85 142 else { … … 103 160 R_t = sqrt( pow(x_t,2.) + pow(y_t,2.) ); 104 161 Phi_t = atan2( y_t, x_t); 105 /*if(R_t>0) {162 if(R_t>0) { 106 163 Theta_t = acos( z_t / sqrt(z_t*z_t+ R_t*R_t)); 107 164 Eta_t = - log(tan(Theta_t/2.)); … … 109 166 Theta_t=0; Eta_t = 9999; 110 167 } 111 */ 168 112 169 Px_t = - Part->PT * sin(omega*t + phi_0); 113 170 Py_t = Part->PT * cos(omega*t + phi_0); … … 116 173 p_t = sqrt(PT_t*PT_t + Pz_t*Pz_t); 117 174 E_t=sqrt(Part->M*Part->M +p_t); 118 if(p_t != fabs(Pz_t) ) Eta_t = log( (p_t+Pz_t)/(p_t-Pz_t) )/2.;119 if(p_t>0) Theta_t = acos(Pz_t/p_t);175 //if(p_t != fabs(Pz_t) ) Eta_t = log( (p_t+Pz_t)/(p_t-Pz_t) )/2.; 176 //if(p_t>0) Theta_t = acos(Pz_t/p_t); 120 177 momentum.SetPxPyPzE(Px_t,Py_t,Pz_t,E_t); 121 178 -
trunk/src/FrogUtil.cc
r186 r219 10 10 11 11 // \brief Trigger class, and some generic definitions 12 13 #include "interface/FrogUtil.h"14 #include "TRandom.h"15 16 #include "Utilities/FROG/Includes/FROG/FROG_DetId.h"17 #include "Utilities/FROG/Includes/FROG/FROG_Geometry.h"18 #include "Utilities/FROG/Includes/FROG/FROG_Geometry.cpp"19 #include "Utilities/FROG/Includes/FROG/FROG_Events.h"20 #include "Utilities/FROG/Includes/FROG/FROG_Events.cpp"21 #include "Utilities/FROG/Includes/FROG/FROG_Element_Tools.h"22 #include "Utilities/FROG/Includes/FROG/FROG_Element_Tools.cpp"23 #include "Utilities/FROG/Includes/FROG/FROG_Net_Tools.h"24 #include "Utilities/FROG/Includes/FROG/FROG_Net_Tools.cpp"25 #include "Utilities/FROG/Includes/FROG/FROG_Path.h"26 #include "Utilities/FROG/Includes/FROG/FROG_Path.cpp"27 #include "Utilities/FROG/Includes/FROG/FROG_Coord.h"28 #include "Utilities/FROG/Includes/FROG/FROG_Coord.cpp"29 #include "Utilities/FROG/Includes/FROG/FROG_ReadCards.h"30 #include "Utilities/FROG/Includes/FROG/FROG_ReadCards.cpp"31 #include "Utilities/FROG/Includes/FROG/FROG_ZLib.h"32 #include "Utilities/FROG/Includes/FROG/FROG_ZLib.cpp"33 34 12 #include <iostream> 35 #include <sstream> 36 #include <fstream> 37 #include <iomanip> 38 #include <cstring> 13 14 #include "TROOT.h" 15 #include "TApplication.h" 16 #include "TStyle.h" 17 #include "TChain.h" 18 #include "TClonesArray.h" 19 20 #include "BlockClasses.h" 21 #include "ExRootTreeReader.h" 22 #include "FrogUtil.h" 23 24 #include "FROG_Coord.h" 25 #include "FROG_Coord.cpp" 26 #include "FROG_Geometry.h" 27 #include "FROG_Geometry.cpp" 28 #include "FROG_DetId.h" 29 #include "FROG_Events.h" 30 #include "FROG_Events.cpp" 31 #include "FROG_Element_Tools.h" 32 #include "FROG_Element_Tools.cpp" 33 #include "FROG_Net_Tools.h" 34 #include "FROG_Net_Tools.cpp" 35 #include "FROG_Path.h" 36 #include "FROG_Path.cpp" 37 #include "FROG_ReadCards.h" 38 #include "FROG_ReadCards.cpp" 39 #include "FROG_ZLib.h" 40 #include "FROG_ZLib.cpp" 39 41 40 42 using namespace std; 41 43 using namespace FROG_COORD; 42 44 43 const float twopi = 6.2831; 44 45 FrogDisplay::FrogDisplay() {} 46 47 //PROTON 1 48 void FrogDisplay::Build_1Event(FROG_Element_Event* event1) 49 { 50 double posp_x = 0.0299923*1000; 51 double posp_y = 0.00602767*1000; 52 double posp_z = 0; 53 FROG_Element_Event_Hit* hitp = new FROG_Element_Event_Hit(500000001 + ((int)posp_z)/50, posp_x, posp_y, posp_z, -1); 54 double dirp_x = 0*1000; 55 double dirp_y = 0*1000; 56 double dirp_z = -1*1000; 57 float Pp = sqrt(dirp_x*dirp_x + dirp_y*dirp_y + dirp_z*dirp_z); 58 float Ptp = sqrt(dirp_x*dirp_x + dirp_y*dirp_y); 59 FROG_Element_Base_With_DetId_And_Name* trackCollectionP = new FROG_Element_Base_With_DetId_And_Name(EVTID_TRK+1000, "Tracks: protons"); 60 FROG_Element_Event_Track* trackp= new FROG_Element_Event_Track(0,Pp,Ptp,0); 61 trackp->addDaughter(hitp); 62 double pos2p_x = 0.0299923*1000+0*1000*0.4; 63 double pos2p_y = 0.00602767*1000+0*1000*0.4; 64 double pos2p_z = -1*1000*0.4; 65 FROG_Element_Event_Hit* hit2p = new FROG_Element_Event_Hit(500000001 + ((int)pos2p_z)/50, pos2p_x, pos2p_y, pos2p_z, -1); 66 trackp->addDaughter(hit2p); 67 trackCollectionP->addDaughter(trackp); 68 69 // photon 1 70 FROG_Element_Base_With_DetId_And_Name* trackCollection = new FROG_Element_Base_With_DetId_And_Name(EVTID_TRK,"Tracks: Photons"); 71 FROG_Element_Event_Track* track1 = new FROG_Element_Event_Track(0,1,1,0); 72 double pos0_x = 0.0299923*1000; 73 double pos0_y = 0.00602767*1000; 74 double pos0_z = -0.309438*1000; 75 FROG_Element_Event_Hit* hit0 = new FROG_Element_Event_Hit(400000001 + ((int)pos0_z)/50, pos0_x, pos0_y, pos0_z, -1); 76 track1->addDaughter(hit0); 77 double pos1_x = 0.03*1000; 78 double pos1_y = 0.00602856*1000; 79 double pos1_z = -0.309567*1000; 80 FROG_Element_Event_Hit* hit1 = new FROG_Element_Event_Hit(400000001 + ((int)pos1_z)/50, pos1_x, pos1_y, pos1_z, -1); 81 track1->addDaughter(hit1); 82 83 84 trackCollection->addDaughter(track1); 85 // photon 2 86 FROG_Element_Event_Track* track2 = new FROG_Element_Event_Track(0,1,1,0); 87 double pos2_x = 0.0299923*1000; 88 double pos2_y = 0.00602767*1000; 89 double pos2_z = -0.312795*1000; 90 FROG_Element_Event_Hit* hit2 = new FROG_Element_Event_Hit(400000001 + ((int)pos2_z)/50, pos2_x, pos2_y, pos2_z, -1); 91 track2->addDaughter(hit2); 92 double pos3_x = 0.0291312*1000; 93 double pos3_y = 0.00599684*1000; 94 double pos3_z = -0.326865*1000; 95 FROG_Element_Event_Hit* hit3 = new FROG_Element_Event_Hit(400000001 + ((int)pos3_z)/50, pos3_x, pos3_y, pos3_z, -1); 96 track2->addDaughter(hit3); 97 double pos4_x = 0.0272812*1000; 98 double pos4_y = 0*1000; 99 double pos4_z = -0.325133*1000; 100 FROG_Element_Event_Hit* hit4 = new FROG_Element_Event_Hit(400000001 + ((int)pos4_z)/50, pos4_x, pos4_y, pos4_z, -1); 101 track2->addDaughter(hit4); 102 double pos5_x = 0.0147219*1000; 103 double pos5_y = -0.04071*1000; 104 double pos5_z = -0.313375*1000; 105 FROG_Element_Event_Hit* hit5 = new FROG_Element_Event_Hit(400000001 + ((int)pos5_z)/50, pos5_x, pos5_y, pos5_z, -1); 106 track2->addDaughter(hit5); 107 trackCollection->addDaughter(track2); 108 109 // photon 3 110 FROG_Element_Event_Track* track3 = new FROG_Element_Event_Track(0,1,1,0); 111 double pos6_x = 0.0299923*1000; 112 double pos6_y = 0.00602767*1000; 113 double pos6_z = -0.241733*1000; 114 FROG_Element_Event_Hit* hit6 = new FROG_Element_Event_Hit(400000001 + ((int)pos6_z)/50, pos6_x, pos6_y, pos6_z, -1); 115 track3->addDaughter(hit6); 116 double pos7_x = 0.0247239*1000; 117 double pos7_y = 0.00635725*1000; 118 double pos7_z = -0.327258*1000; 119 FROG_Element_Event_Hit* hit7 = new FROG_Element_Event_Hit(400000001 + ((int)pos7_z)/50, pos7_x, pos7_y, pos7_z, -1); 120 track3->addDaughter(hit7); 121 double pos8_x = 0.023245*1000; 122 double pos8_y = 0*1000; 123 double pos8_z = -0.325292*1000; 124 FROG_Element_Event_Hit* hit8 = new FROG_Element_Event_Hit(400000001 + ((int)pos8_z)/50, pos8_x, pos8_y, pos8_z, -1); 125 track3->addDaughter(hit8); 126 double pos9_x = 0.0137742*1000; 127 double pos9_y = -0.04071*1000; 128 double pos9_z = -0.312698*1000; 129 FROG_Element_Event_Hit* hit9 = new FROG_Element_Event_Hit(400000001 + ((int)pos9_z)/50, pos9_x, pos9_y, pos9_z, -1); 130 track3->addDaughter(hit9); 131 trackCollection->addDaughter(track3); 132 133 // photon 4 134 FROG_Element_Event_Track* track4 = new FROG_Element_Event_Track(0,1,1,0); 135 double pos10_x = 0.0299923*1000; 136 double pos10_y = 0.00602767*1000; 137 double pos10_z = -0.103114*1000; 138 FROG_Element_Event_Hit* hit10 = new FROG_Element_Event_Hit(400000001 + ((int)pos10_z)/50, pos10_x, pos10_y, pos10_z, -1); 139 track4->addDaughter(hit10); 140 double pos11_x = 0.0169713*1000; 141 double pos11_y = 0.0106604*1000; 142 double pos11_z = -0.324528*1000; 143 FROG_Element_Event_Hit* hit11 = new FROG_Element_Event_Hit(400000001 + ((int)pos11_z)/50, pos11_x, pos11_y, pos11_z, -1); 144 track4->addDaughter(hit11); 145 double pos12_x = 0.0159847*1000; 146 double pos12_y = 0*1000; 147 double pos12_z = -0.322034*1000; 148 FROG_Element_Event_Hit* hit12 = new FROG_Element_Event_Hit(400000001 + ((int)pos12_z)/50, pos12_x, pos12_y, pos12_z, -1); 149 track4->addDaughter(hit12); 150 double pos13_x = 0.00925296*1000; 151 double pos13_y = -0.0727334*1000; 152 double pos13_z = -0.305018*1000; 153 FROG_Element_Event_Hit* hit13 = new FROG_Element_Event_Hit(400000001 + ((int)pos13_z)/50, pos13_x, pos13_y, pos13_z, -1); 154 track4->addDaughter(hit13); 155 trackCollection->addDaughter(track4); 156 157 // photon 5 158 FROG_Element_Event_Track* track5 = new FROG_Element_Event_Track(0,1,1,0); 159 double pos14_x = 0.0299923*1000; 160 double pos14_y = 0.00602767*1000; 161 double pos14_z = -0.0550703*1000; 162 FROG_Element_Event_Hit* hit14 = new FROG_Element_Event_Hit(400000001 + ((int)pos14_z)/50, pos14_x, pos14_y, pos14_z, -1); 163 track5->addDaughter(hit14); 164 double pos15_x = 0.03*1000; 165 double pos15_y = 0.00597767*1000; 166 double pos15_z = -0.0558923*1000; 167 FROG_Element_Event_Hit* hit15 = new FROG_Element_Event_Hit(400000001 + ((int)pos15_z)/50, pos15_x, pos15_y, pos15_z, -1); 168 track5->addDaughter(hit15); 169 trackCollection->addDaughter(track5); 170 171 // photon 6 172 FROG_Element_Event_Track* track6 = new FROG_Element_Event_Track(0,1,1,0); 173 double pos16_x = 0.0299923*1000; 174 double pos16_y = 0.00602767*1000; 175 double pos16_z = -0.0724158*1000; 176 FROG_Element_Event_Hit* hit16 = new FROG_Element_Event_Hit(400000001 + ((int)pos16_z)/50, pos16_x, pos16_y, pos16_z, -1); 177 track6->addDaughter(hit16); 178 double pos17_x = 0.03*1000; 179 double pos17_y = 0.00602949*1000; 180 double pos17_z = -0.0725471*1000; 181 FROG_Element_Event_Hit* hit17 = new FROG_Element_Event_Hit(400000001 + ((int)pos17_z)/50, pos17_x, pos17_y, pos17_z, -1); 182 track6->addDaughter(hit17); 183 trackCollection->addDaughter(track6); 184 185 // photon 7 186 FROG_Element_Event_Track* track7 = new FROG_Element_Event_Track(0,1,1,0); 187 double pos18_x = 0.0299923*1000; 188 double pos18_y = 0.00602767*1000; 189 double pos18_z = -0.108963*1000; 190 FROG_Element_Event_Hit* hit18 = new FROG_Element_Event_Hit(400000001 + ((int)pos18_z)/50, pos18_x, pos18_y, pos18_z, -1); 191 track7->addDaughter(hit18); 192 double pos19_x = 0.03*1000; 193 double pos19_y = 0.0060305*1000; 194 double pos19_z = -0.109102*1000; 195 FROG_Element_Event_Hit* hit19 = new FROG_Element_Event_Hit(400000001 + ((int)pos19_z)/50, pos19_x, pos19_y, pos19_z, -1); 196 track7->addDaughter(hit19); 197 trackCollection->addDaughter(track7); 198 199 // photon 8 200 FROG_Element_Event_Track* track8 = new FROG_Element_Event_Track(0,1,1,0); 201 double pos20_x = 0.0299923*1000; 202 double pos20_y = 0.00602767*1000; 203 double pos20_z = -0.189456*1000; 204 FROG_Element_Event_Hit* hit20 = new FROG_Element_Event_Hit(400000001 + ((int)pos20_z)/50, pos20_x, pos20_y, pos20_z, -1); 205 track8->addDaughter(hit20); 206 double pos21_x = 0.0248364*1000; 207 double pos21_y = 0.0129674*1000; 208 double pos21_z = -0.321989*1000; 209 FROG_Element_Event_Hit* hit21 = new FROG_Element_Event_Hit(400000001 + ((int)pos21_z)/50, pos21_x, pos21_y, pos21_z, -1); 210 track8->addDaughter(hit21); 211 double pos22_x = 0.0222521*1000; 212 double pos22_y = 0*1000; 213 double pos22_z = -0.319622*1000; 214 FROG_Element_Event_Hit* hit22 = new FROG_Element_Event_Hit(400000001 + ((int)pos22_z)/50, pos22_x, pos22_y, pos22_z, -1); 215 track8->addDaughter(hit22); 216 double pos23_x = 0.0141387*1000; 217 double pos23_y = -0.04071*1000; 218 double pos23_z = -0.312192*1000; 219 FROG_Element_Event_Hit* hit23 = new FROG_Element_Event_Hit(400000001 + ((int)pos23_z)/50, pos23_x, pos23_y, pos23_z, -1); 220 track8->addDaughter(hit23); 221 trackCollection->addDaughter(track8); 222 223 // photon 9 224 FROG_Element_Event_Track* track9 = new FROG_Element_Event_Track(0,1,1,0); 225 double pos24_x = 0.0299923*1000; 226 double pos24_y = 0.00602767*1000; 227 double pos24_z = -0.162889*1000; 228 FROG_Element_Event_Hit* hit24 = new FROG_Element_Event_Hit(400000001 + ((int)pos24_z)/50, pos24_x, pos24_y, pos24_z, -1); 229 track9->addDaughter(hit24); 230 double pos25_x = 0.0275782*1000; 231 double pos25_y = 0*1000; 232 double pos25_z = -0.266817*1000; 233 FROG_Element_Event_Hit* hit25 = new FROG_Element_Event_Hit(400000001 + ((int)pos25_z)/50, pos25_x, pos25_y, pos25_z, -1); 234 track9->addDaughter(hit25); 235 trackCollection->addDaughter(track9); 236 237 // photon 10 238 FROG_Element_Event_Track* track10 = new FROG_Element_Event_Track(0,1,1,0); 239 double pos26_x = 0.0299923*1000; 240 double pos26_y = 0.00602767*1000; 241 double pos26_z = -0.0968708*1000; 242 FROG_Element_Event_Hit* hit26 = new FROG_Element_Event_Hit(400000001 + ((int)pos26_z)/50, pos26_x, pos26_y, pos26_z, -1); 243 track10->addDaughter(hit26); 244 double pos27_x = 0.03*1000; 245 double pos27_y = 0.00603619*1000; 246 double pos27_z = -0.0970637*1000; 247 FROG_Element_Event_Hit* hit27 = new FROG_Element_Event_Hit(400000001 + ((int)pos27_z)/50, pos27_x, pos27_y, pos27_z, -1); 248 track10->addDaughter(hit27); 249 trackCollection->addDaughter(track10); 250 251 // photon 11 252 FROG_Element_Event_Track* track11 = new FROG_Element_Event_Track(0,1,1,0); 253 double pos28_x = 0.0299923*1000; 254 double pos28_y = 0.00602767*1000; 255 double pos28_z = -0.211734*1000; 256 FROG_Element_Event_Hit* hit28 = new FROG_Element_Event_Hit(400000001 + ((int)pos28_z)/50, pos28_x, pos28_y, pos28_z, -1); 257 track11->addDaughter(hit28); 258 double pos29_x = 0.0231748*1000; 259 double pos29_y = 0.00496626*1000; 260 double pos29_z = -0.328422*1000; 261 FROG_Element_Event_Hit* hit29 = new FROG_Element_Event_Hit(400000001 + ((int)pos29_z)/50, pos29_x, pos29_y, pos29_z, -1); 262 track11->addDaughter(hit29); 263 double pos30_x = 0.0221601*1000; 264 double pos30_y = 0*1000; 265 double pos30_z = -0.326734*1000; 266 FROG_Element_Event_Hit* hit30 = new FROG_Element_Event_Hit(400000001 + ((int)pos30_z)/50, pos30_x, pos30_y, pos30_z, -1); 267 track11->addDaughter(hit30); 268 double pos31_x = 0.0138423*1000; 269 double pos31_y = -0.04071*1000; 270 double pos31_z = -0.312897*1000; 271 FROG_Element_Event_Hit* hit31 = new FROG_Element_Event_Hit(400000001 + ((int)pos31_z)/50, pos31_x, pos31_y, pos31_z, -1); 272 track11->addDaughter(hit31); 273 trackCollection->addDaughter(track11); 274 275 // photon 12 276 FROG_Element_Event_Track* track12 = new FROG_Element_Event_Track(0,1,1,0); 277 double pos32_x = 0.0299923*1000; 278 double pos32_y = 0.00602767*1000; 279 double pos32_z = -0.233216*1000; 280 FROG_Element_Event_Hit* hit32 = new FROG_Element_Event_Hit(400000001 + ((int)pos32_z)/50, pos32_x, pos32_y, pos32_z, -1); 281 track12->addDaughter(hit32); 282 double pos33_x = 0.03*1000; 283 double pos33_y = 0.00603839*1000; 284 double pos33_z = -0.233429*1000; 285 FROG_Element_Event_Hit* hit33 = new FROG_Element_Event_Hit(400000001 + ((int)pos33_z)/50, pos33_x, pos33_y, pos33_z, -1); 286 track12->addDaughter(hit33); 287 trackCollection->addDaughter(track12); 288 289 // photon 13 290 FROG_Element_Event_Track* track13 = new FROG_Element_Event_Track(0,1,1,0); 291 double pos34_x = 0.0299923*1000; 292 double pos34_y = 0.00602767*1000; 293 double pos34_z = -0.0352209*1000; 294 FROG_Element_Event_Hit* hit34 = new FROG_Element_Event_Hit(400000001 + ((int)pos34_z)/50, pos34_x, pos34_y, pos34_z, -1); 295 track13->addDaughter(hit34); 296 double pos35_x = 0.03*1000; 297 double pos35_y = 0.00603501*1000; 298 double pos35_z = -0.0353909*1000; 299 FROG_Element_Event_Hit* hit35 = new FROG_Element_Event_Hit(400000001 + ((int)pos35_z)/50, pos35_x, pos35_y, pos35_z, -1); 300 track13->addDaughter(hit35); 301 trackCollection->addDaughter(track13); 302 303 // photon 14 304 FROG_Element_Event_Track* track14 = new FROG_Element_Event_Track(0,1,1,0); 305 double pos36_x = 0.0299923*1000; 306 double pos36_y = 0.00602767*1000; 307 double pos36_z = -0.0678788*1000; 308 FROG_Element_Event_Hit* hit36 = new FROG_Element_Event_Hit(400000001 + ((int)pos36_z)/50, pos36_x, pos36_y, pos36_z, -1); 309 track14->addDaughter(hit36); 310 double pos37_x = 0.03*1000; 311 double pos37_y = 0.00602573*1000; 312 double pos37_z = -0.0680089*1000; 313 FROG_Element_Event_Hit* hit37 = new FROG_Element_Event_Hit(400000001 + ((int)pos37_z)/50, pos37_x, pos37_y, pos37_z, -1); 314 track14->addDaughter(hit37); 315 trackCollection->addDaughter(track14); 316 317 // photon 15 318 FROG_Element_Event_Track* track15 = new FROG_Element_Event_Track(0,1,1,0); 319 double pos38_x = 0.0299923*1000; 320 double pos38_y = 0.00602767*1000; 321 double pos38_z = -0.0418564*1000; 322 FROG_Element_Event_Hit* hit38 = new FROG_Element_Event_Hit(400000001 + ((int)pos38_z)/50, pos38_x, pos38_y, pos38_z, -1); 323 track15->addDaughter(hit38); 324 double pos39_x = 0.0281432*1000; 325 double pos39_y = 0*1000; 326 double pos39_z = -0.148365*1000; 327 FROG_Element_Event_Hit* hit39 = new FROG_Element_Event_Hit(400000001 + ((int)pos39_z)/50, pos39_x, pos39_y, pos39_z, -1); 328 track15->addDaughter(hit39); 329 trackCollection->addDaughter(track15); 330 event1->addDaughter(trackCollectionP); 331 event1->addDaughter(trackCollection); 332 333 } 334 335 void FrogDisplay::BuidEvents(string outputfilename,int nEntryFrog) 336 { 45 const float twopi = 6.283185307179586476925286766559; 46 47 FrogDisplay::FrogDisplay() { 48 //Smearing information 49 DET = new RESOLution(); 50 nEntryFrog = DET->NEvents_Frog; 51 } 52 53 FrogDisplay::FrogDisplay(const string& DetDatacard) { 54 //Smearing information 55 DET = new RESOLution(); 56 DET->ReadDataCard(DetDatacard); 57 nEntryFrog = DET->NEvents_Frog; 58 } 59 60 FrogDisplay::FrogDisplay(const RESOLution* DetDatacard) { 61 //Smearing information 62 DET = new RESOLution(*DetDatacard); 63 nEntryFrog = DET->NEvents_Frog; 64 } 65 66 FrogDisplay::FrogDisplay(const FrogDisplay& frog) { 67 DET = new RESOLution(*(frog.DET)); 68 nEntryFrog = DET->NEvents_Frog; 69 } 70 71 FrogDisplay& FrogDisplay::operator=(const FrogDisplay& frog) { 72 if (this==&frog) return *this; 73 DET = new RESOLution(*(frog.DET)); 74 nEntryFrog = DET->NEvents_Frog; 75 return *this; 76 } 77 78 void FrogDisplay::BuildEvents(const string& outputfilename) { 337 79 const Font_t kExRootFont = 42; 338 80 const Float_t kExRootFontSize = 0.07; … … 371 113 TRootETmis* met; 372 114 373 Long64_t allEntries; 374 allEntries=treeReader->GetEntries(); 115 unsigned int allEntries=treeReader->GetEntries(); 375 116 376 117 FROG_Events* frog_events = new FROG_Events(); 377 if(nEntryFrog > allEntries) 378 {379 cout<<"nEntry to display by frog greater than number of available events... Exit"<<endl;380 return;381 } 382 for( Int_t entry = 0; entry < nEntryFrog; ++entry){383 //cout<<"Event n° "<<entry<<endl;118 if(nEntryFrog > allEntries) { 119 cout<<"nEntry to display by FROG greater than number of available events... "<<endl; 120 nEntryFrog = allEntries; 121 } 122 123 for(unsigned int entry = 0; entry < nEntryFrog; ++entry){ 124 //cout<<"Event n° "<<entry<<endl; 384 125 treeReader ->ReadEntry(entry); 385 126 treeReaderGen->ReadEntry(entry); 386 127 387 128 //Create a new event 388 389 129 FROG_Element_Event* frog_event = new FROG_Element_Event(1,entry); 390 130 frog_events->AddEvent(frog_event); … … 393 133 FROG_Element_Base_With_DetId_And_Name* frog_branchSIM = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM,"SIM"); 394 134 frog_event->addDaughter(frog_branchSIM); 395 135 136 396 137 //SIM ELEC 397 138 //Create a new sub-branch in the SIM branch with name Electrons: this sub branch will contais all the electrons … … 401 142 for(int p=0;p<branchElectron->GetEntriesFast();p++){ 402 143 elec = (TRootElectron*) branchElectron->At(p); 403 // cout<<"Elec nO "<<p<<" PT: "<<elec->PT<<" Eta "<<elec->Eta<<" Phi"<<elec->Phi<<endl;144 // cout<<"Elec nO "<<p<<" PT: "<<elec->PT<<" Eta "<<elec->Eta<<" Phi"<<elec->Phi<<endl; 404 145 FROG_Element_Event_Candidate* frog_elec = new FROG_Element_Event_Candidate(11,elec->E,elec->Eta,elec->Phi); 405 406 146 frog_branchElectrons->addDaughter(frog_elec); 407 147 } 148 408 149 409 150 //SIM MUONS … … 413 154 for(int p=0;p<branchMuon->GetEntriesFast();p++){ 414 155 muon = (TRootMuon*) branchMuon->At(p); 415 // cout<<"Muon nO"<<p<<" PT: "<<muon->PT<<"Eta "<<muon->Eta<<" Phi"<<muon->Phi<<endl;156 // cout<<"Muon nO"<<p<<" PT: "<<muon->PT<<"Eta "<<muon->Eta<<" Phi"<<muon->Phi<<endl; 416 157 FROG_Element_Event_Candidate* frog_muon = new FROG_Element_Event_Candidate(13,muon->E,muon->Eta,muon->Phi); 417 158 frog_branchMuons->addDaughter(frog_muon); 418 159 } 160 419 161 420 162 //SIM TAUS … … 424 166 for(int p=0;p<branchTau->GetEntriesFast();p++){ 425 167 tau = (TRootTauJet*) branchTau->At(p); 426 // cout<<"Tau nO"<<p<<" PT: "<<tau->PT<<"Eta "<<tau->Eta<<" Phi"<<tau->Phi<<endl;168 // cout<<"Tau nO"<<p<<" PT: "<<tau->PT<<"Eta "<<tau->Eta<<" Phi"<<tau->Phi<<endl; 427 169 FROG_Element_Event_Candidate* frog_tau = new FROG_Element_Event_Candidate(15,tau->E,tau->Eta,tau->Phi); 428 170 frog_branchTaus->addDaughter(frog_tau); 429 171 } 172 430 173 431 174 //SIM PHOTONS … … 435 178 for(int p=0;p<branchPhoton->GetEntriesFast();p++){ 436 179 photon = (TRootPhoton*) branchPhoton->At(p); 437 // cout<<"Photon nO"<<p<<" PT: "<<photon->PT<<"Eta "<<photon->Eta<<" Phi"<<photon->Phi<<endl;180 // cout<<"Photon nO"<<p<<" PT: "<<photon->PT<<"Eta "<<photon->Eta<<" Phi"<<photon->Phi<<endl; 438 181 FROG_Element_Event_Candidate* frog_photon = new FROG_Element_Event_Candidate(22,photon->E,photon->Eta,photon->Phi); 439 182 frog_branchPhotons->addDaughter(frog_photon); 440 183 } 184 441 185 442 186 //SIM JETS … … 446 190 for(int p=0;p<branchJet->GetEntriesFast();p++){ 447 191 jet = (TRootJet*) branchJet->At(p); 448 // cout<<"Jet nO"<<p<<" PT: "<<jet->PT<<"Eta "<<jet->Eta<<" Phi"<<jet->Phi<<endl;192 // cout<<"Jet nO"<<p<<" PT: "<<jet->PT<<"Eta "<<jet->Eta<<" Phi"<<jet->Phi<<endl; 449 193 FROG_Element_Event_Jet* frog_jet = new FROG_Element_Event_Jet(jet->E,jet->Eta,jet->Phi); 450 194 frog_branchJets->addDaughter(frog_jet); 451 195 } 452 196 197 453 198 //SIM MET 454 199 //Create a new sub-branch in the SIM branch with name MET: this sub branch will contais all the METs … … 457 202 for(int p=0;p<branchMET->GetEntriesFast();p++){ 458 203 met = (TRootETmis*) branchMET->At(p); 459 // cout<<"MET nO"<<p<<" ET: "<<met->ET<<"Eta "<<0<<" Phi"<<met->Phi<<endl;204 // cout<<"MET nO"<<p<<" ET: "<<met->ET<<"Eta "<<0<<" Phi"<<met->Phi<<endl; 460 205 FROG_Element_Event_MET* frog_met = new FROG_Element_Event_MET(0,met->ET,0,met->Phi, met->ET); 461 206 frog_branchMET->addDaughter(frog_met); … … 465 210 frog_events->SaveInLive("DelphesToFrog.vis",false,false,(unsigned int)-1); 466 211 } 467 212 213 /* Pointer hierachy 214 frog_events 215 -frog_event 216 -frog_branchSIM 217 -frog_branchElectrons 218 -frog_elec 219 -frog_branchMuons 220 -frog_muon 221 -frog_branchTaus 222 -frog_tau 223 -frog_branchPhotons 224 -frog_photon 225 -frog_photon 226 -frog_jet 227 -frog_branchMET 228 -frog_met 229 */ 230 468 231 delete treeReader; 469 232 delete treeReaderGen; 470 233 delete frog_events; 471 } 472 473 void FrogDisplay::BuildGeom(string DetDatacard) 474 { 475 //Smearing information 476 RESOLution *DET = new RESOLution(); 477 DET->ReadDataCard(DetDatacard); 478 234 delete chain; 235 delete chainGen; 236 } 237 238 void FrogDisplay::BuildGeom() { 239 479 240 // This element is the root of the "file" tree. (don't change this line) 480 241 FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY); 481 242 482 243 FROG_Element_Base* mygeom = new FROG_Element_Base(C_GEOMETRY); 483 244 prim->addDaughter(mygeom); … … 508 269 if(ray < rayCone)ray=rayCone; 509 270 510 double dphi = 6.283185307179586476925286766559/NumPhi;271 double dphi = twopi /NumPhi; 511 272 for(double phi=0; phi<=twopi/frac;phi+=dphi){ 512 273 … … 726 487 CALOFWD->addDaughter(caloFWDB2); DetIdCountCaloFwd++; 727 488 } 728 729 730 731 489 732 490 FROG_Geometry* CustomGeom = new FROG_Geometry(prim); 733 491 CustomGeom->Save("DelphesToFrog.geom"); 734 492 493 delete prim; 494 delete CustomGeom; 495 496 /* pointer hierarchy 497 prim 498 -> mygeom 499 -> detector 500 -> Tracker 501 -> CALO 502 -> MUON 503 -> CALOFWD 504 pointers that have been added into others will be properly deleted by the destructor of their "mother" 505 */ 506 507 735 508 //FROG_ELEMENT::PrintTree(prim); 736 509 return; 737 510 738 511 } 739 -
trunk/src/LHEFConverter.cc
r18 r219 4 4 #include "TLorentzVector.h" 5 5 6 #include "Utilities/ExRootAnalysis/interface/ExRootTreeWriter.h" 7 #include "Utilities/ExRootAnalysis/interface/ExRootTreeBranch.h" 8 #include "Utilities/ExRootAnalysis/interface/BlockClasses.h" 9 10 #include "interface/LHEFConverter.h" 11 #include "Utilities/ExRootAnalysis/interface/LHEF.h" 6 #include "ExRootTreeWriter.h" 7 #include "BlockClasses.h" 8 #include "LHEFConverter.h" 12 9 13 10 using namespace std; -
trunk/src/SmearUtil.cc
r177 r219 13 13 14 14 15 #include " interface/SmearUtil.h"15 #include "SmearUtil.h" 16 16 #include "TRandom.h" 17 17 18 18 #include <iostream> 19 #include <fstream> 19 20 #include <sstream> 20 #include <fstream>21 21 #include <iomanip> 22 23 24 25 22 using namespace std; 23 24 25 ParticleUtil::ParticleUtil(const TLorentzVector &genMomentum, int pid) { 26 _pid=pid; 27 _e = genMomentum.E(); 28 _px = genMomentum.Px(); 29 _py = genMomentum.Py(); 30 _pz = genMomentum.Pz(); 31 _pt = genMomentum.Pt(); 32 33 //_e, _px, _py, _pz, _pt; 34 //float _eta, _etaCalo, _phi, _phiCalo; 35 //int _pid; 36 } 26 37 27 38 //------------------------------------------------------------------------------ … … 147 158 } 148 159 160 161 RESOLution::RESOLution(const RESOLution & DET) { 162 // Detector characteristics 163 CEN_max_tracker = DET.CEN_max_tracker; 164 CEN_max_calo_cen = DET.CEN_max_calo_cen; 165 CEN_max_calo_fwd = DET.CEN_max_calo_fwd; 166 CEN_max_mu = DET.CEN_max_mu; 167 168 // Energy resolution for electron/photon 169 ELG_Scen = DET.ELG_Scen; 170 ELG_Ncen = DET.ELG_Ncen; 171 ELG_Ccen = DET.ELG_Ccen; 172 ELG_Cfwd = DET.ELG_Cfwd; 173 ELG_Sfwd = DET.ELG_Sfwd; 174 ELG_Nfwd = DET.ELG_Nfwd; 175 176 // Energy resolution for hadrons in ecal/hcal/hf 177 HAD_Shcal = DET.HAD_Shcal; 178 HAD_Nhcal = DET.HAD_Nhcal; 179 HAD_Chcal = DET.HAD_Chcal; 180 HAD_Shf = DET.HAD_Shf; 181 HAD_Nhf = DET.HAD_Nhf; 182 HAD_Chf = DET.HAD_Chf; 183 184 // Muon smearing 185 MU_SmearPt = DET.MU_SmearPt; 186 187 // Tracking efficiencies 188 TRACK_ptmin = DET.TRACK_ptmin; 189 TRACK_eff = DET.TRACK_eff; 190 191 // Calorimetric towers 192 TOWER_number = DET.TOWER_number; 193 TOWER_eta_edges = new float[TOWER_number+1]; 194 for(unsigned int i=0; i<TOWER_number +1; i++) TOWER_eta_edges[i] = DET.TOWER_eta_edges[i]; 195 196 TOWER_dphi = new float[TOWER_number]; 197 for(unsigned int i=0; i<TOWER_number; i++) TOWER_dphi[i] = DET.TOWER_dphi[i]; 198 199 // Thresholds for reconstructed objetcs 200 PTCUT_elec = DET.PTCUT_elec; 201 PTCUT_muon = DET.PTCUT_muon; 202 PTCUT_jet = DET.PTCUT_jet; 203 PTCUT_gamma = DET.PTCUT_gamma; 204 PTCUT_taujet = DET.PTCUT_taujet; 205 206 // General jet variable 207 JET_coneradius = DET.JET_coneradius; 208 JET_jetalgo = DET.JET_jetalgo; 209 JET_seed = DET.JET_seed; 210 211 // Tagging definition 212 BTAG_b = DET.BTAG_b; 213 BTAG_mistag_c = DET.BTAG_mistag_c; 214 BTAG_mistag_l = DET.BTAG_mistag_l; 215 216 // FLAGS 217 FLAG_bfield = DET.FLAG_bfield; 218 FLAG_vfd = DET.FLAG_vfd; 219 FLAG_trigger = DET.FLAG_trigger; 220 FLAG_frog = DET.FLAG_frog; 221 222 // In case BField propagation allowed 223 TRACK_radius = DET.TRACK_radius; 224 TRACK_length = DET.TRACK_length; 225 TRACK_bfield_x = DET.TRACK_bfield_x; 226 TRACK_bfield_y = DET.TRACK_bfield_y; 227 TRACK_bfield_z = DET.TRACK_bfield_z; 228 229 // In case Very forward detectors allowed 230 VFD_min_calo_vfd = DET.VFD_min_calo_vfd; 231 VFD_max_calo_vfd = DET.VFD_max_calo_vfd; 232 VFD_min_zdc = DET.VFD_min_zdc; 233 VFD_s_zdc = DET.VFD_s_zdc; 234 235 RP_220_s = DET.RP_220_s; 236 RP_220_x = DET.RP_220_x; 237 RP_420_s = DET.RP_420_s; 238 RP_420_x = DET.RP_420_x; 239 240 // In case FROG event display allowed 241 NEvents_Frog = DET.NEvents_Frog; 242 243 JET_overlap = DET.JET_overlap; 244 // MidPoint algorithm definition 245 JET_M_coneareafraction = DET.JET_M_coneareafraction; 246 JET_M_maxpairsize = DET.JET_M_maxpairsize; 247 JET_M_maxiterations = DET.JET_M_maxiterations; 248 // Define Cone algorithm. 249 JET_C_adjacencycut = DET.JET_C_adjacencycut; 250 JET_C_maxiterations = DET.JET_C_maxiterations; 251 JET_C_iratch = DET.JET_C_iratch; 252 //Define SISCone algorithm. 253 JET_S_npass = DET.JET_S_npass; 254 JET_S_protojet_ptmin = DET.JET_S_protojet_ptmin; 255 256 //For Tau-jet definition 257 TAU_energy_scone = DET.TAU_energy_scone; 258 TAU_track_scone = DET.TAU_track_scone; 259 TAU_track_pt = DET.TAU_track_pt; 260 TAU_energy_frac = DET.TAU_energy_frac; 261 262 PT_QUARKS_MIN = DET.PT_QUARKS_MIN; 263 } 264 265 RESOLution& RESOLution::operator=(const RESOLution& DET) { 266 if(this==&DET) return *this; 267 // Detector characteristics 268 CEN_max_tracker = DET.CEN_max_tracker; 269 CEN_max_calo_cen = DET.CEN_max_calo_cen; 270 CEN_max_calo_fwd = DET.CEN_max_calo_fwd; 271 CEN_max_mu = DET.CEN_max_mu; 272 273 // Energy resolution for electron/photon 274 ELG_Scen = DET.ELG_Scen; 275 ELG_Ncen = DET.ELG_Ncen; 276 ELG_Ccen = DET.ELG_Ccen; 277 ELG_Cfwd = DET.ELG_Cfwd; 278 ELG_Sfwd = DET.ELG_Sfwd; 279 ELG_Nfwd = DET.ELG_Nfwd; 280 281 // Energy resolution for hadrons in ecal/hcal/hf 282 HAD_Shcal = DET.HAD_Shcal; 283 HAD_Nhcal = DET.HAD_Nhcal; 284 HAD_Chcal = DET.HAD_Chcal; 285 HAD_Shf = DET.HAD_Shf; 286 HAD_Nhf = DET.HAD_Nhf; 287 HAD_Chf = DET.HAD_Chf; 288 289 // Muon smearing 290 MU_SmearPt = DET.MU_SmearPt; 291 292 // Tracking efficiencies 293 TRACK_ptmin = DET.TRACK_ptmin; 294 TRACK_eff = DET.TRACK_eff; 295 296 // Calorimetric towers 297 TOWER_number = DET.TOWER_number; 298 TOWER_eta_edges = new float[TOWER_number+1]; 299 for(unsigned int i=0; i<TOWER_number +1; i++) TOWER_eta_edges[i] = DET.TOWER_eta_edges[i]; 300 301 TOWER_dphi = new float[TOWER_number]; 302 for(unsigned int i=0; i<TOWER_number; i++) TOWER_dphi[i] = DET.TOWER_dphi[i]; 303 304 // Thresholds for reconstructed objetcs 305 PTCUT_elec = DET.PTCUT_elec; 306 PTCUT_muon = DET.PTCUT_muon; 307 PTCUT_jet = DET.PTCUT_jet; 308 PTCUT_gamma = DET.PTCUT_gamma; 309 PTCUT_taujet = DET.PTCUT_taujet; 310 311 // General jet variable 312 JET_coneradius = DET.JET_coneradius; 313 JET_jetalgo = DET.JET_jetalgo; 314 JET_seed = DET.JET_seed; 315 316 // Tagging definition 317 BTAG_b = DET.BTAG_b; 318 BTAG_mistag_c = DET.BTAG_mistag_c; 319 BTAG_mistag_l = DET.BTAG_mistag_l; 320 321 // FLAGS 322 FLAG_bfield = DET.FLAG_bfield; 323 FLAG_vfd = DET.FLAG_vfd; 324 FLAG_trigger = DET.FLAG_trigger; 325 FLAG_frog = DET.FLAG_frog; 326 327 // In case BField propagation allowed 328 TRACK_radius = DET.TRACK_radius; 329 TRACK_length = DET.TRACK_length; 330 TRACK_bfield_x = DET.TRACK_bfield_x; 331 TRACK_bfield_y = DET.TRACK_bfield_y; 332 TRACK_bfield_z = DET.TRACK_bfield_z; 333 334 // In case Very forward detectors allowed 335 VFD_min_calo_vfd = DET.VFD_min_calo_vfd; 336 VFD_max_calo_vfd = DET.VFD_max_calo_vfd; 337 VFD_min_zdc = DET.VFD_min_zdc; 338 VFD_s_zdc = DET.VFD_s_zdc; 339 340 RP_220_s = DET.RP_220_s; 341 RP_220_x = DET.RP_220_x; 342 RP_420_s = DET.RP_420_s; 343 RP_420_x = DET.RP_420_x; 344 345 // In case FROG event display allowed 346 NEvents_Frog = DET.NEvents_Frog; 347 348 JET_overlap = DET.JET_overlap; 349 // MidPoint algorithm definition 350 JET_M_coneareafraction = DET.JET_M_coneareafraction; 351 JET_M_maxpairsize = DET.JET_M_maxpairsize; 352 JET_M_maxiterations = DET.JET_M_maxiterations; 353 // Define Cone algorithm. 354 JET_C_adjacencycut = DET.JET_C_adjacencycut; 355 JET_C_maxiterations = DET.JET_C_maxiterations; 356 JET_C_iratch = DET.JET_C_iratch; 357 //Define SISCone algorithm. 358 JET_S_npass = DET.JET_S_npass; 359 JET_S_protojet_ptmin = DET.JET_S_protojet_ptmin; 360 361 //For Tau-jet definition 362 TAU_energy_scone = DET.TAU_energy_scone; 363 TAU_track_scone = DET.TAU_track_scone; 364 TAU_track_pt = DET.TAU_track_pt; 365 TAU_energy_frac = DET.TAU_energy_frac; 366 367 PT_QUARKS_MIN = DET.PT_QUARKS_MIN; 368 return *this; 369 } 370 371 372 373 149 374 //------------------------------------------------------------------------------ 150 375 void RESOLution::ReadDataCard(const string datacard) { … … 155 380 ifstream fichier_a_lire(datacard.c_str()); 156 381 if(!fichier_a_lire.good()) { 157 cout << datacard << "Datadard " << datacard << " not found, use default values" << endl;382 cout <<"** Datadard not found, use default values **" << endl; 158 383 return; 159 384 } … … 252 477 } 253 478 254 void RESOLution::Logfile( stringLogName) {479 void RESOLution::Logfile(const string& LogName) { 255 480 //void RESOLution::Logfile(string outputfilename) { 256 481 … … 617 842 energyS = ((energyS1>0)?energyS1:0) + ((energyS2>0)?energyS2:0); 618 843 } 619 if( abs(hadron.Eta()) > CEN_max_calo_cen && fabs(hadron.Eta()) < CEN_max_calo_fwd){844 if(fabs(hadron.Eta()) > CEN_max_calo_cen && fabs(hadron.Eta()) < CEN_max_calo_fwd){ 620 845 energyS = gRandom->Gaus(energy, sqrt( 621 846 pow(HAD_Nhf,2) + … … 720 945 //***********************Isolation criteria*********************** 721 946 //**************************************************************** 722 bool RESOLution::Isolation( Float_t phi,Float_t eta,const vector<TLorentzVector> &tracks,float PT_TRACK2)947 bool RESOLution::Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks, const float pt_second_track) 723 948 { 724 949 bool isolated = false; 725 Float_t deltar=5000.; // Initial value; should be high; no further repercussion950 float deltar=5000.; // Initial value; should be high; no further repercussion 726 951 // loop on all final charged particles, with p_t >2, close enough from the electron 727 952 for(unsigned int i=0; i < tracks.size(); i++) 728 953 { 729 if(tracks[i].Pt() < PT_TRACK2)continue;730 Float_t genDeltaR = DeltaR(phi,eta,tracks[i].Phi(),tracks[i].Eta()); // slower to evaluate954 if(tracks[i].Pt() < pt_second_track)continue; 955 float genDeltaR = DeltaR(phi,eta,tracks[i].Phi(),tracks[i].Eta()); 731 956 if( 732 957 (genDeltaR > deltar) || … … 735 960 deltar=genDeltaR; 736 961 } 737 if(deltar > 0.5) isolated = true; // returns the closest distance962 if(deltar > 0.5) isolated = true; 738 963 return isolated; 739 964 } … … 769 994 float DeltaPhi(const float phi1, const float phi2) { 770 995 float deltaphi=phi1-phi2; // in here, -PI < phi < PI 771 if(fabs(deltaphi) > PI) deltaphi=2.*PI-fabs(deltaphi);// put deltaphi between 0 and PI 996 if(fabs(deltaphi) > PI) { 997 deltaphi=2.*PI -fabs(deltaphi);// put deltaphi between 0 and PI 998 } 772 999 else deltaphi=fabs(deltaphi); 773 1000 -
trunk/src/TreeClasses.cc
r17 r219 1 #include " interface/TreeClasses.h"1 #include "TreeClasses.h" 2 2 3 3 TCompare *RESOLJET::fgCompare =0; -
trunk/src/TreeClassesLinkDef.h
r17 r219 34 34 #pragma link C++ class TWOLEPTON; 35 35 36 37 //$$$$$$$$$$$$$$$$$$38 36 #pragma link C++ class RESOLJET; 39 37 #pragma link C++ class RESOLELEC; -
trunk/src/TriggerUtil.cc
r74 r219 11 11 // \brief Trigger class, and some generic definitions 12 12 13 #include "interface/TriggerUtil.h" 14 #include "TRandom.h" 13 #include "TriggerUtil.h" 15 14 16 15 #include <iostream> 16 #include <iomanip> 17 17 #include <sstream> 18 18 #include <fstream> 19 #include <iomanip> 20 #include <cstring> 19 #include <string> 21 20 22 21 using namespace std; … … 26 25 } 27 26 28 void TriggerTable::TriggerCardReader(const string filename){27 void TriggerTable::TriggerCardReader(const string& filename){ 29 28 ifstream trigger_file(filename.c_str()); 30 29 if( !trigger_file.good() ) { … … 49 48 50 49 51 void TriggerTable::PrintTriggerTable( stringLogName) {50 void TriggerTable::PrintTriggerTable(const string& LogName) { 52 51 53 52 ofstream f_out(LogName.c_str(),ios::app); … … 186 185 187 186 } 188 void TriggerBit::PrintTrigCondition(string LogName,int i) 187 188 189 void TriggerBit::PrintTrigCondition(const string& LogName,const int i) 189 190 { 190 191 int elec_size = TriggerBit::ElecValues.size(); -
trunk/src/VeryForward.cc
r100 r219 9 9 * */ 10 10 11 #include "interface/VeryForward.h" 12 #include "interface/SmearUtil.h" 13 #include "TRandom.h" 14 11 #include "VeryForward.h" 12 #include "H_RomanPot.h" 15 13 #include <iostream> 16 #include <sstream>17 #include <fstream>18 #include <iomanip>19 20 14 #include<cmath> 21 22 15 23 16 using namespace std; … … 26 19 //------------------------------------------------------------------------------ 27 20 28 VeryForward::VeryForward(string DetDatacard) { 29 30 DET = new RESOLution(); 31 DET->ReadDataCard(DetDatacard); 32 21 VeryForward::VeryForward() { 22 DET = new RESOLution(); 23 init(); 24 } 25 26 VeryForward::VeryForward(const string& DetDatacard) { 27 DET = new RESOLution(); 28 DET->ReadDataCard(DetDatacard); 29 init(); 30 } 31 32 VeryForward::VeryForward(const RESOLution * DetDatacard) { 33 DET = new RESOLution(*DetDatacard); 34 init(); 35 } 36 37 VeryForward::VeryForward(const VeryForward& vf) { 38 DET = new RESOLution(*(vf.DET)); 39 beamline1 = new H_BeamLine(*(vf.beamline1)); 40 beamline2 = new H_BeamLine(*(vf.beamline2)); 41 } 42 43 VeryForward& VeryForward::operator=(const VeryForward& vf){ 44 if (this==&vf) return *this; 45 DET = new RESOLution(*(vf.DET)); 46 beamline1 = new H_BeamLine(*(vf.beamline1)); 47 beamline2 = new H_BeamLine(*(vf.beamline2)); 48 return *this; 49 } 50 51 52 void VeryForward::init() { 33 53 //Initialisation of Hector 34 54 relative_energy = true; // should always be true … … 52 72 beamline2->add(rp220_2); 53 73 beamline2->add(rp420_2); 54 55 74 56 75 }
Note:
See TracChangeset
for help on using the changeset viewer.