Changeset 219 in svn for trunk/src/FrogUtil.cc
- Timestamp:
- Feb 2, 2009, 12:33:21 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.