[260] | 1 | /***********************************************************************
|
---|
| 2 | ** **
|
---|
| 3 | ** /----------------------------------------------\ **
|
---|
| 4 | ** | Delphes, a framework for the fast simulation | **
|
---|
| 5 | ** | of a generic collider experiment | **
|
---|
| 6 | ** \----------------------------------------------/ **
|
---|
| 7 | ** **
|
---|
| 8 | ** **
|
---|
| 9 | ** This package uses: **
|
---|
| 10 | ** ------------------ **
|
---|
| 11 | ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
|
---|
| 12 | ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
|
---|
| 13 | ** FROG: [hep-ex/0901.2718v1] **
|
---|
| 14 | ** **
|
---|
| 15 | ** ------------------------------------------------------------------ **
|
---|
| 16 | ** **
|
---|
| 17 | ** Main authors: **
|
---|
| 18 | ** ------------- **
|
---|
| 19 | ** **
|
---|
| 20 | ** Severine Ovyn Xavier Rouby **
|
---|
| 21 | ** severine.ovyn@uclouvain.be xavier.rouby@cern **
|
---|
| 22 | ** **
|
---|
| 23 | ** Center for Particle Physics and Phenomenology (CP3) **
|
---|
| 24 | ** Universite catholique de Louvain (UCL) **
|
---|
| 25 | ** Louvain-la-Neuve, Belgium **
|
---|
| 26 | ** **
|
---|
| 27 | ** Copyright (C) 2008-2009, **
|
---|
| 28 | ** All rights reserved. **
|
---|
| 29 | ** **
|
---|
| 30 | ***********************************************************************/
|
---|
[97] | 31 |
|
---|
[260] | 32 |
|
---|
[219] | 33 | #include <iostream>
|
---|
[97] | 34 |
|
---|
[219] | 35 | #include "TROOT.h"
|
---|
| 36 | #include "TApplication.h"
|
---|
| 37 | #include "TStyle.h"
|
---|
| 38 | #include "TChain.h"
|
---|
| 39 | #include "TClonesArray.h"
|
---|
[97] | 40 |
|
---|
[219] | 41 | #include "BlockClasses.h"
|
---|
| 42 | #include "ExRootTreeReader.h"
|
---|
| 43 | #include "FrogUtil.h"
|
---|
[97] | 44 |
|
---|
[219] | 45 | #include "FROG_Coord.h"
|
---|
| 46 | #include "FROG_Coord.cpp"
|
---|
| 47 | #include "FROG_Geometry.h"
|
---|
| 48 | #include "FROG_Geometry.cpp"
|
---|
| 49 | #include "FROG_DetId.h"
|
---|
| 50 | #include "FROG_Events.h"
|
---|
| 51 | #include "FROG_Events.cpp"
|
---|
| 52 | #include "FROG_Element_Tools.h"
|
---|
| 53 | #include "FROG_Element_Tools.cpp"
|
---|
| 54 | #include "FROG_Net_Tools.h"
|
---|
| 55 | #include "FROG_Net_Tools.cpp"
|
---|
| 56 | #include "FROG_Path.h"
|
---|
| 57 | #include "FROG_Path.cpp"
|
---|
| 58 | #include "FROG_ReadCards.h"
|
---|
| 59 | #include "FROG_ReadCards.cpp"
|
---|
| 60 | #include "FROG_ZLib.h"
|
---|
| 61 | #include "FROG_ZLib.cpp"
|
---|
[97] | 62 |
|
---|
| 63 | using namespace std;
|
---|
| 64 | using namespace FROG_COORD;
|
---|
| 65 |
|
---|
[219] | 66 | const float twopi = 6.283185307179586476925286766559;
|
---|
[97] | 67 |
|
---|
[219] | 68 | FrogDisplay::FrogDisplay() {
|
---|
| 69 | //Smearing information
|
---|
| 70 | DET = new RESOLution();
|
---|
| 71 | nEntryFrog = DET->NEvents_Frog;
|
---|
| 72 | }
|
---|
[97] | 73 |
|
---|
[219] | 74 | FrogDisplay::FrogDisplay(const string& DetDatacard) {
|
---|
| 75 | //Smearing information
|
---|
| 76 | DET = new RESOLution();
|
---|
| 77 | DET->ReadDataCard(DetDatacard);
|
---|
| 78 | nEntryFrog = DET->NEvents_Frog;
|
---|
| 79 | }
|
---|
[112] | 80 |
|
---|
[219] | 81 | FrogDisplay::FrogDisplay(const RESOLution* DetDatacard) {
|
---|
| 82 | //Smearing information
|
---|
| 83 | DET = new RESOLution(*DetDatacard);
|
---|
| 84 | nEntryFrog = DET->NEvents_Frog;
|
---|
| 85 | }
|
---|
[97] | 86 |
|
---|
[219] | 87 | FrogDisplay::FrogDisplay(const FrogDisplay& frog) {
|
---|
| 88 | DET = new RESOLution(*(frog.DET));
|
---|
| 89 | nEntryFrog = DET->NEvents_Frog;
|
---|
[97] | 90 | }
|
---|
| 91 |
|
---|
[219] | 92 | FrogDisplay& FrogDisplay::operator=(const FrogDisplay& frog) {
|
---|
| 93 | if (this==&frog) return *this;
|
---|
| 94 | DET = new RESOLution(*(frog.DET));
|
---|
| 95 | nEntryFrog = DET->NEvents_Frog;
|
---|
| 96 | return *this;
|
---|
| 97 | }
|
---|
| 98 |
|
---|
| 99 | void FrogDisplay::BuildEvents(const string& outputfilename) {
|
---|
[97] | 100 | const Font_t kExRootFont = 42;
|
---|
| 101 | const Float_t kExRootFontSize = 0.07;
|
---|
| 102 | gROOT->SetStyle("Plain");
|
---|
| 103 | gROOT->cd();
|
---|
| 104 | gStyle->SetCanvasColor(10);
|
---|
| 105 | gStyle->SetPadColor(10);
|
---|
| 106 | gStyle->SetFillColor(-1);
|
---|
| 107 | gStyle->SetPaperSize(20, 24);
|
---|
| 108 | gStyle->SetStatFont(kExRootFont);
|
---|
| 109 | gStyle->SetTextFont(kExRootFont);
|
---|
| 110 | gStyle->SetTextSize(kExRootFontSize);
|
---|
| 111 | gStyle->SetLegendBorderSize(0);
|
---|
| 112 | gStyle->SetOptStat(0);
|
---|
| 113 |
|
---|
| 114 | TChain* chain = new TChain("Analysis");
|
---|
| 115 | TChain* chainGen = new TChain("GEN");
|
---|
| 116 | chain ->Add(outputfilename.c_str());
|
---|
| 117 | chainGen->Add(outputfilename.c_str());
|
---|
| 118 |
|
---|
| 119 | ExRootTreeReader *treeReader = new ExRootTreeReader(chain);
|
---|
| 120 | ExRootTreeReader *treeReaderGen = new ExRootTreeReader(chainGen);
|
---|
| 121 |
|
---|
| 122 | const TClonesArray* branchElectron = treeReader ->UseBranch("Electron");
|
---|
| 123 | const TClonesArray* branchMuon = treeReader ->UseBranch("Muon");
|
---|
| 124 | const TClonesArray* branchTau = treeReader ->UseBranch("TauJet");
|
---|
| 125 | const TClonesArray* branchPhoton = treeReader ->UseBranch("Photon");
|
---|
| 126 | const TClonesArray* branchJet = treeReader ->UseBranch("Jet");
|
---|
| 127 | const TClonesArray* branchMET = treeReader ->UseBranch("ETmis");
|
---|
| 128 |
|
---|
| 129 | TRootElectron* elec;
|
---|
| 130 | TRootMuon* muon;
|
---|
| 131 | TRootTauJet* tau;
|
---|
| 132 | TRootPhoton* photon;
|
---|
| 133 | TRootJet* jet;
|
---|
| 134 | TRootETmis* met;
|
---|
| 135 |
|
---|
[219] | 136 | unsigned int allEntries=treeReader->GetEntries();
|
---|
[97] | 137 |
|
---|
| 138 | FROG_Events* frog_events = new FROG_Events();
|
---|
[219] | 139 | if(nEntryFrog > allEntries) {
|
---|
[246] | 140 | cerr <<"** ERROR: number of entries to display > available events **"<< endl;
|
---|
[219] | 141 | nEntryFrog = allEntries;
|
---|
| 142 | }
|
---|
| 143 |
|
---|
| 144 | for(unsigned int entry = 0; entry < nEntryFrog; ++entry){
|
---|
| 145 | //cout<<"Event n° "<<entry<<endl;
|
---|
[97] | 146 | treeReader ->ReadEntry(entry);
|
---|
| 147 | treeReaderGen->ReadEntry(entry);
|
---|
| 148 |
|
---|
| 149 | //Create a new event
|
---|
| 150 | FROG_Element_Event* frog_event = new FROG_Element_Event(1,entry);
|
---|
| 151 | frog_events->AddEvent(frog_event);
|
---|
| 152 |
|
---|
| 153 | //Create a new branch in the event with name SIM and ID = EVTID_SIM
|
---|
| 154 | FROG_Element_Base_With_DetId_And_Name* frog_branchSIM = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM,"SIM");
|
---|
| 155 | frog_event->addDaughter(frog_branchSIM);
|
---|
[219] | 156 |
|
---|
| 157 |
|
---|
[97] | 158 | //SIM ELEC
|
---|
| 159 | //Create a new sub-branch in the SIM branch with name Electrons: this sub branch will contais all the electrons
|
---|
| 160 | FROG_Element_Base_With_DetId_And_Name* frog_branchElectrons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+1000,"Electrons");
|
---|
| 161 | frog_branchSIM->addDaughter(frog_branchElectrons);
|
---|
| 162 |
|
---|
| 163 | for(int p=0;p<branchElectron->GetEntriesFast();p++){
|
---|
| 164 | elec = (TRootElectron*) branchElectron->At(p);
|
---|
[219] | 165 | // cout<<"Elec nO "<<p<<" PT: "<<elec->PT<<" Eta "<<elec->Eta<<" Phi"<<elec->Phi<<endl;
|
---|
[97] | 166 | FROG_Element_Event_Candidate* frog_elec = new FROG_Element_Event_Candidate(11,elec->E,elec->Eta,elec->Phi);
|
---|
| 167 | frog_branchElectrons->addDaughter(frog_elec);
|
---|
| 168 | }
|
---|
[219] | 169 |
|
---|
[97] | 170 |
|
---|
| 171 | //SIM MUONS
|
---|
| 172 | //Create a new sub-branch in the SIM branch with name Muons: this sub branch will contais all the muons
|
---|
| 173 | FROG_Element_Base_With_DetId_And_Name* frog_branchMuons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+2000,"Muons");
|
---|
| 174 | frog_branchSIM->addDaughter(frog_branchMuons);
|
---|
| 175 | for(int p=0;p<branchMuon->GetEntriesFast();p++){
|
---|
| 176 | muon = (TRootMuon*) branchMuon->At(p);
|
---|
[219] | 177 | // cout<<"Muon nO"<<p<<" PT: "<<muon->PT<<"Eta "<<muon->Eta<<" Phi"<<muon->Phi<<endl;
|
---|
[97] | 178 | FROG_Element_Event_Candidate* frog_muon = new FROG_Element_Event_Candidate(13,muon->E,muon->Eta,muon->Phi);
|
---|
| 179 | frog_branchMuons->addDaughter(frog_muon);
|
---|
| 180 | }
|
---|
[219] | 181 |
|
---|
[97] | 182 |
|
---|
| 183 | //SIM TAUS
|
---|
| 184 | //Create a new sub-branch in the SIM branch with name Taus: this sub branch will contais all the Taus
|
---|
| 185 | FROG_Element_Base_With_DetId_And_Name* frog_branchTaus = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+3000,"Taus");
|
---|
| 186 | frog_branchSIM->addDaughter(frog_branchTaus);
|
---|
| 187 | for(int p=0;p<branchTau->GetEntriesFast();p++){
|
---|
| 188 | tau = (TRootTauJet*) branchTau->At(p);
|
---|
[219] | 189 | // cout<<"Tau nO"<<p<<" PT: "<<tau->PT<<"Eta "<<tau->Eta<<" Phi"<<tau->Phi<<endl;
|
---|
[97] | 190 | FROG_Element_Event_Candidate* frog_tau = new FROG_Element_Event_Candidate(15,tau->E,tau->Eta,tau->Phi);
|
---|
| 191 | frog_branchTaus->addDaughter(frog_tau);
|
---|
| 192 | }
|
---|
[219] | 193 |
|
---|
[97] | 194 |
|
---|
| 195 | //SIM PHOTONS
|
---|
| 196 | //Create a new sub-branch in the SIM branch with name Photons: this sub branch will contais all the Photons
|
---|
| 197 | FROG_Element_Base_With_DetId_And_Name* frog_branchPhotons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+4000,"Photons");
|
---|
| 198 | frog_branchSIM->addDaughter(frog_branchPhotons);
|
---|
| 199 | for(int p=0;p<branchPhoton->GetEntriesFast();p++){
|
---|
| 200 | photon = (TRootPhoton*) branchPhoton->At(p);
|
---|
[219] | 201 | // cout<<"Photon nO"<<p<<" PT: "<<photon->PT<<"Eta "<<photon->Eta<<" Phi"<<photon->Phi<<endl;
|
---|
[107] | 202 | FROG_Element_Event_Candidate* frog_photon = new FROG_Element_Event_Candidate(22,photon->E,photon->Eta,photon->Phi);
|
---|
[97] | 203 | frog_branchPhotons->addDaughter(frog_photon);
|
---|
| 204 | }
|
---|
[219] | 205 |
|
---|
[97] | 206 |
|
---|
| 207 | //SIM JETS
|
---|
[112] | 208 | //Create a new sub-branch in the SIM branch with name Jets: this sub branch will contais all the Jets
|
---|
[97] | 209 | FROG_Element_Base_With_DetId_And_Name* frog_branchJets = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+5000,"Jets");
|
---|
| 210 | frog_branchSIM->addDaughter(frog_branchJets);
|
---|
| 211 | for(int p=0;p<branchJet->GetEntriesFast();p++){
|
---|
| 212 | jet = (TRootJet*) branchJet->At(p);
|
---|
[219] | 213 | // cout<<"Jet nO"<<p<<" PT: "<<jet->PT<<"Eta "<<jet->Eta<<" Phi"<<jet->Phi<<endl;
|
---|
[97] | 214 | FROG_Element_Event_Jet* frog_jet = new FROG_Element_Event_Jet(jet->E,jet->Eta,jet->Phi);
|
---|
| 215 | frog_branchJets->addDaughter(frog_jet);
|
---|
| 216 | }
|
---|
| 217 |
|
---|
[219] | 218 |
|
---|
[97] | 219 | //SIM MET
|
---|
| 220 | //Create a new sub-branch in the SIM branch with name MET: this sub branch will contais all the METs
|
---|
| 221 | FROG_Element_Base_With_DetId_And_Name* frog_branchMET = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+6000,"MET");
|
---|
| 222 | frog_branchSIM->addDaughter(frog_branchMET);
|
---|
| 223 | for(int p=0;p<branchMET->GetEntriesFast();p++){
|
---|
| 224 | met = (TRootETmis*) branchMET->At(p);
|
---|
[219] | 225 | // cout<<"MET nO"<<p<<" ET: "<<met->ET<<"Eta "<<0<<" Phi"<<met->Phi<<endl;
|
---|
[97] | 226 | FROG_Element_Event_MET* frog_met = new FROG_Element_Event_MET(0,met->ET,0,met->Phi, met->ET);
|
---|
| 227 | frog_branchMET->addDaughter(frog_met);
|
---|
| 228 | }
|
---|
| 229 |
|
---|
| 230 | //Save the event in the .vis file
|
---|
| 231 | frog_events->SaveInLive("DelphesToFrog.vis",false,false,(unsigned int)-1);
|
---|
| 232 | }
|
---|
[219] | 233 |
|
---|
| 234 | /* Pointer hierachy
|
---|
| 235 | frog_events
|
---|
| 236 | -frog_event
|
---|
| 237 | -frog_branchSIM
|
---|
| 238 | -frog_branchElectrons
|
---|
| 239 | -frog_elec
|
---|
| 240 | -frog_branchMuons
|
---|
| 241 | -frog_muon
|
---|
| 242 | -frog_branchTaus
|
---|
| 243 | -frog_tau
|
---|
| 244 | -frog_branchPhotons
|
---|
| 245 | -frog_photon
|
---|
| 246 | -frog_photon
|
---|
| 247 | -frog_jet
|
---|
| 248 | -frog_branchMET
|
---|
| 249 | -frog_met
|
---|
| 250 | */
|
---|
| 251 |
|
---|
[97] | 252 | delete treeReader;
|
---|
| 253 | delete treeReaderGen;
|
---|
| 254 | delete frog_events;
|
---|
[219] | 255 | delete chain;
|
---|
| 256 | delete chainGen;
|
---|
[97] | 257 | }
|
---|
| 258 |
|
---|
[219] | 259 | void FrogDisplay::BuildGeom() {
|
---|
| 260 |
|
---|
[97] | 261 | // This element is the root of the "file" tree. (don't change this line)
|
---|
| 262 | FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY);
|
---|
[219] | 263 |
|
---|
[97] | 264 | FROG_Element_Base* mygeom = new FROG_Element_Base(C_GEOMETRY);
|
---|
| 265 | prim->addDaughter(mygeom);
|
---|
| 266 |
|
---|
| 267 | FROG_Element_Base_With_DetId_And_Name* detector = new FROG_Element_Base_With_DetId_And_Name(900000000,"Delphes");
|
---|
| 268 | mygeom->addDaughter(detector);
|
---|
| 269 |
|
---|
[112] | 270 | double Rayon_Tracker=40;
|
---|
[100] | 271 | double Rayon_Calo = Rayon_Tracker*1.5;
|
---|
| 272 | double Rayon_Muon = Rayon_Tracker*2;
|
---|
| 273 | double Lenght_Tracker=100;
|
---|
| 274 | double Lenght_Calo=Lenght_Tracker+Lenght_Tracker/2.5;
|
---|
| 275 | double Lenght_Muon=Lenght_Calo+Lenght_Calo/2.5;
|
---|
[112] | 276 | double Lenght_CaloFwd=Lenght_Muon+Lenght_Muon/2.5;
|
---|
[97] | 277 |
|
---|
[112] | 278 | int NumPhi=100;
|
---|
| 279 | float frac=1;
|
---|
[97] | 280 |
|
---|
| 281 | //************************************************Tracker*************************************************
|
---|
| 282 | //********************************************************************************************************
|
---|
| 283 |
|
---|
| 284 | FROG_Element_Base_With_DetId_And_Name* Tracker = new FROG_Element_Base_With_DetId_And_Name(910000000,"Tracker");
|
---|
| 285 | detector->addDaughter(Tracker);
|
---|
| 286 | unsigned int DetIdCountTracker = 1;
|
---|
[112] | 287 |
|
---|
| 288 | double ray=Rayon_Tracker;
|
---|
| 289 | double rayCone = tan(EtaToTheta(DET->CEN_max_tracker))*Lenght_Tracker/2;
|
---|
| 290 | if(ray < rayCone)ray=rayCone;
|
---|
| 291 |
|
---|
[219] | 292 | double dphi = twopi /NumPhi;
|
---|
[183] | 293 | for(double phi=0; phi<=twopi/frac;phi+=dphi){
|
---|
[112] | 294 |
|
---|
| 295 | FROG_Element_Primitive_CustomSurface* trackerCone1 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,
|
---|
[183] | 296 | rayCone*sin(phi) ,rayCone*cos(phi) ,-Lenght_Tracker/2,
|
---|
| 297 | rayCone*sin(phi+dphi) ,rayCone*cos(phi+dphi) ,-Lenght_Tracker/2,
|
---|
| 298 | 0 , 0 , 0,
|
---|
| 299 | 0 , 0 , 0);
|
---|
[112] | 300 | Tracker->addDaughter(trackerCone1); DetIdCountTracker++;
|
---|
| 301 |
|
---|
| 302 | FROG_Element_Primitive_CustomSurface* trackerCone2 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,
|
---|
[183] | 303 | 0 , 0 ,0,
|
---|
| 304 | 0 , 0 ,0,
|
---|
| 305 | rayCone*sin(phi) , rayCone*cos(phi) , Lenght_Tracker/2,
|
---|
| 306 | rayCone*sin(phi+dphi) , rayCone*sin(phi+dphi) , Lenght_Tracker/2);
|
---|
[112] | 307 | Tracker->addDaughter(trackerCone2); DetIdCountTracker++;
|
---|
| 308 |
|
---|
| 309 |
|
---|
| 310 | FROG_Element_Primitive_CustomSurface* trackerB = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,
|
---|
[183] | 311 | ray*sin(phi) ,ray*cos(phi) ,-Lenght_Tracker*0.5,
|
---|
| 312 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) ,-Lenght_Tracker*0.5,
|
---|
| 313 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Tracker*0.5,
|
---|
| 314 | ray*sin(phi) ,ray*cos(phi) , Lenght_Tracker*0.5);
|
---|
[112] | 315 | Tracker->addDaughter(trackerB); DetIdCountTracker++;
|
---|
| 316 |
|
---|
| 317 | FROG_Element_Primitive_CustomSurface* trackerEndCap1 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,
|
---|
[183] | 318 | rayCone*sin(phi) , rayCone*cos(phi) , -(Lenght_Tracker)/2,
|
---|
| 319 | rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) , -(Lenght_Tracker)/2,
|
---|
| 320 | ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Tracker)/2,
|
---|
| 321 | ray*sin(phi) , ray*cos(phi) , -(Lenght_Tracker)/2);
|
---|
[112] | 322 | Tracker->addDaughter(trackerEndCap1); DetIdCountTracker++;
|
---|
| 323 |
|
---|
| 324 | FROG_Element_Primitive_CustomSurface* trackerEndCap2 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,
|
---|
[183] | 325 | rayCone*sin(phi) , rayCone*cos(phi) , (Lenght_Tracker)/2,
|
---|
| 326 | rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) , (Lenght_Tracker)/2,
|
---|
| 327 | ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Tracker)/2,
|
---|
| 328 | ray*sin(phi) , ray*cos(phi) , (Lenght_Tracker)/2);
|
---|
[112] | 329 | Tracker->addDaughter(trackerEndCap2); DetIdCountTracker++;
|
---|
| 330 |
|
---|
[97] | 331 | }
|
---|
| 332 |
|
---|
[112] | 333 | Rayon_Calo = ray*1.5;
|
---|
| 334 |
|
---|
[97] | 335 | //******************************************Central calorimeters******************************************
|
---|
| 336 | //********************************************************************************************************
|
---|
| 337 |
|
---|
| 338 | FROG_Element_Base_With_DetId_And_Name* CALO = new FROG_Element_Base_With_DetId_And_Name(920000000,"Calo");
|
---|
| 339 | detector->addDaughter(CALO);
|
---|
| 340 | unsigned int DetIdCountCalo = 1;
|
---|
| 341 |
|
---|
[112] | 342 | float rayConeD = tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_Tracker/2;
|
---|
| 343 | float rayConeF = tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_Calo/2;
|
---|
| 344 | ray=Rayon_Calo;
|
---|
| 345 | if(ray<rayConeF)ray=rayConeF;
|
---|
| 346 |
|
---|
[183] | 347 | for(double phi=0; phi<=twopi/frac;phi+=dphi){
|
---|
[112] | 348 |
|
---|
| 349 | //BARREL
|
---|
| 350 | FROG_Element_Primitive_CustomSurface* caloB = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountCalo*10,
|
---|
[183] | 351 | ray*sin(phi) ,ray*cos(phi) ,-Lenght_Calo*0.5,
|
---|
| 352 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) ,-Lenght_Calo*0.5,
|
---|
| 353 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Calo*0.5,
|
---|
| 354 | ray*sin(phi) ,ray*cos(phi) , Lenght_Calo*0.5);
|
---|
[112] | 355 | CALO->addDaughter(caloB); DetIdCountCalo++;
|
---|
| 356 |
|
---|
| 357 | //Partial cone + side
|
---|
| 358 | FROG_Element_Primitive_CustomSurface* caloEndCap1a = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountCalo*10,
|
---|
[183] | 359 | rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Tracker)/2,
|
---|
| 360 | rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Tracker)/2,
|
---|
| 361 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Calo)/2,
|
---|
| 362 | rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Calo)/2);
|
---|
[112] | 363 | CALO->addDaughter(caloEndCap1a); DetIdCountCalo++;
|
---|
| 364 |
|
---|
| 365 | //Close Endcap + side
|
---|
| 366 | FROG_Element_Primitive_CustomSurface* caloEndCap1b = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountTracker*10,
|
---|
[183] | 367 | rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Calo)/2,
|
---|
| 368 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Calo)/2,
|
---|
| 369 | ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Calo)/2,
|
---|
| 370 | ray*sin(phi) , ray*cos(phi) , (Lenght_Calo)/2);
|
---|
[112] | 371 | CALO->addDaughter(caloEndCap1b); DetIdCountCalo++;
|
---|
| 372 |
|
---|
| 373 | //Partial cone - side
|
---|
| 374 | FROG_Element_Primitive_CustomSurface* caloEndCap2a = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountCalo*10,
|
---|
[183] | 375 | rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Tracker)/2,
|
---|
| 376 | rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Tracker)/2,
|
---|
| 377 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Calo)/2,
|
---|
| 378 | rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Calo)/2);
|
---|
[112] | 379 | CALO->addDaughter(caloEndCap2a); DetIdCountCalo++;
|
---|
| 380 |
|
---|
| 381 | //Close Endcap - side
|
---|
| 382 | FROG_Element_Primitive_CustomSurface* caloEndCap2b = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountTracker*10,
|
---|
[183] | 383 | rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Calo)/2,
|
---|
| 384 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Calo)/2,
|
---|
| 385 | ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Calo)/2,
|
---|
| 386 | ray*sin(phi) , ray*cos(phi) , -(Lenght_Calo)/2);
|
---|
[112] | 387 | CALO->addDaughter(caloEndCap2b); DetIdCountCalo++;
|
---|
| 388 |
|
---|
[97] | 389 | }
|
---|
[112] | 390 |
|
---|
| 391 | Rayon_Muon = ray*1.2;
|
---|
| 392 |
|
---|
| 393 | //***********************************************Muon chambers********************************************
|
---|
| 394 | //********************************************************************************************************
|
---|
| 395 |
|
---|
| 396 | FROG_Element_Base_With_DetId_And_Name* MUON = new FROG_Element_Base_With_DetId_And_Name(930000000,"Muon");
|
---|
| 397 | detector->addDaughter(MUON);
|
---|
| 398 | unsigned int DetIdCountMuon = 1;
|
---|
| 399 |
|
---|
| 400 | rayConeD = tan(EtaToTheta(DET->CEN_max_mu))*Lenght_Calo/2;
|
---|
| 401 | rayConeF = tan(EtaToTheta(DET->CEN_max_mu))*Lenght_Muon/2;
|
---|
| 402 | ray=Rayon_Muon;
|
---|
| 403 | if(ray<rayConeF)ray=rayConeF;
|
---|
| 404 |
|
---|
[183] | 405 | for(double phi=0; phi<=twopi/frac;phi+=dphi){
|
---|
[112] | 406 |
|
---|
| 407 | //BARREL
|
---|
| 408 | FROG_Element_Primitive_CustomSurface* muonB = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
|
---|
[183] | 409 | ray*sin(phi) ,ray*cos(phi) ,-Lenght_Muon*0.5,
|
---|
| 410 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) ,-Lenght_Muon*0.5,
|
---|
| 411 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Muon*0.5,
|
---|
| 412 | ray*sin(phi) ,ray*cos(phi) , Lenght_Muon*0.5);
|
---|
[112] | 413 | MUON->addDaughter(muonB); DetIdCountMuon++;
|
---|
| 414 |
|
---|
| 415 | //Partial cone + side
|
---|
| 416 | FROG_Element_Primitive_CustomSurface* muonEndCap1a = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
|
---|
[183] | 417 | rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Calo)/2,
|
---|
| 418 | rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Calo)/2,
|
---|
| 419 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Muon)/2,
|
---|
| 420 | rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Muon)/2);
|
---|
[112] | 421 | MUON->addDaughter(muonEndCap1a); DetIdCountMuon++;
|
---|
| 422 |
|
---|
| 423 | //Close Endcap + side
|
---|
| 424 | FROG_Element_Primitive_CustomSurface* muonEndCap1b = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
|
---|
[183] | 425 | rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Muon)/2,
|
---|
| 426 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Muon)/2,
|
---|
| 427 | ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Muon)/2,
|
---|
| 428 | ray*sin(phi) , ray*cos(phi) , (Lenght_Muon)/2);
|
---|
[112] | 429 | MUON->addDaughter(muonEndCap1b); DetIdCountMuon++;
|
---|
| 430 |
|
---|
| 431 | //Partial cone - side
|
---|
| 432 | FROG_Element_Primitive_CustomSurface* muonEndCap2a = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
|
---|
[183] | 433 | rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Calo)/2,
|
---|
| 434 | rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Calo)/2,
|
---|
| 435 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Muon)/2,
|
---|
| 436 | rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Muon)/2);
|
---|
[112] | 437 | MUON->addDaughter(muonEndCap2a); DetIdCountMuon++;
|
---|
| 438 |
|
---|
| 439 | //Close Endcap - side
|
---|
| 440 | FROG_Element_Primitive_CustomSurface* muonEndCap2b = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
|
---|
[183] | 441 | rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Muon)/2,
|
---|
| 442 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Muon)/2,
|
---|
| 443 | ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Muon)/2,
|
---|
| 444 | ray*sin(phi) , ray*cos(phi) , -(Lenght_Muon)/2);
|
---|
[112] | 445 | MUON->addDaughter(muonEndCap2b); DetIdCountMuon++;
|
---|
[97] | 446 | }
|
---|
| 447 |
|
---|
[112] | 448 |
|
---|
[97] | 449 | //******************************************Forward calorimeters******************************************
|
---|
| 450 | //********************************************************************************************************
|
---|
| 451 |
|
---|
[112] | 452 | FROG_Element_Base_With_DetId_And_Name* CALOFWD = new FROG_Element_Base_With_DetId_And_Name(940000000,"CaloFwd");
|
---|
| 453 | detector->addDaughter(CALOFWD);
|
---|
| 454 | unsigned int DetIdCountCaloFwd = 1;
|
---|
[97] | 455 |
|
---|
[112] | 456 | rayConeD = tan(EtaToTheta(DET->CEN_max_calo_fwd))*Lenght_Muon;
|
---|
| 457 | rayConeF = tan(EtaToTheta(DET->CEN_max_calo_fwd))*Lenght_CaloFwd;
|
---|
| 458 | ray=tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_CaloFwd;
|
---|
| 459 |
|
---|
[183] | 460 | for(double phi=0; phi<=twopi/frac;phi+=dphi){
|
---|
[97] | 461 |
|
---|
[112] | 462 | //Partial cone + side
|
---|
| 463 | FROG_Element_Primitive_CustomSurface* caloFWDEndCap1a = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10,
|
---|
[183] | 464 | rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Muon)/2,
|
---|
| 465 | rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Muon)/2,
|
---|
| 466 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_CaloFwd)/2,
|
---|
| 467 | rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_CaloFwd)/2);
|
---|
[112] | 468 | CALOFWD->addDaughter(caloFWDEndCap1a); DetIdCountCaloFwd++;
|
---|
| 469 |
|
---|
| 470 | //Close Endcap + side
|
---|
| 471 | FROG_Element_Primitive_CustomSurface* caloFWDEndCap1b = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10,
|
---|
[183] | 472 | rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_CaloFwd)/2,
|
---|
| 473 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_CaloFwd)/2,
|
---|
| 474 | ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_CaloFwd)/2,
|
---|
| 475 | ray*sin(phi) , ray*cos(phi) , (Lenght_CaloFwd)/2);
|
---|
[112] | 476 | CALOFWD->addDaughter(caloFWDEndCap1b); DetIdCountCaloFwd++;
|
---|
| 477 |
|
---|
| 478 | //BARREL
|
---|
| 479 | FROG_Element_Primitive_CustomSurface* caloFWDB1 = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountMuon*10,
|
---|
[183] | 480 | ray*sin(phi) ,ray*cos(phi) , Lenght_Muon*0.5,
|
---|
| 481 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Muon*0.5,
|
---|
| 482 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_CaloFwd*0.5,
|
---|
| 483 | ray*sin(phi) ,ray*cos(phi) , Lenght_CaloFwd*0.5);
|
---|
[112] | 484 | CALOFWD->addDaughter(caloFWDB1); DetIdCountCaloFwd++;
|
---|
| 485 |
|
---|
| 486 | //Partial cone - side
|
---|
| 487 | FROG_Element_Primitive_CustomSurface* caloFWDEndCap2a = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10,
|
---|
[183] | 488 | rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Muon)/2,
|
---|
| 489 | rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Muon)/2,
|
---|
| 490 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_CaloFwd)/2,
|
---|
| 491 | rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_CaloFwd)/2);
|
---|
[112] | 492 | CALOFWD->addDaughter(caloFWDEndCap2a); DetIdCountCaloFwd++;
|
---|
| 493 |
|
---|
| 494 | //Close Endcap - side
|
---|
| 495 | FROG_Element_Primitive_CustomSurface* caloFWDEndCap2b = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10,
|
---|
[183] | 496 | rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_CaloFwd)/2,
|
---|
| 497 | rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_CaloFwd)/2,
|
---|
| 498 | ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_CaloFwd)/2,
|
---|
| 499 | ray*sin(phi) , ray*cos(phi) , -(Lenght_CaloFwd)/2);
|
---|
[112] | 500 | CALOFWD->addDaughter(caloFWDEndCap2b); DetIdCountCaloFwd++;
|
---|
| 501 |
|
---|
| 502 | //BARREL
|
---|
| 503 | FROG_Element_Primitive_CustomSurface* caloFWDB2 = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountMuon*10,
|
---|
[183] | 504 | ray*sin(phi) ,ray*cos(phi) , -Lenght_Muon*0.5,
|
---|
| 505 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) , -Lenght_Muon*0.5,
|
---|
| 506 | ray*sin(phi+dphi) ,ray*cos(phi+dphi) , -Lenght_CaloFwd*0.5,
|
---|
| 507 | ray*sin(phi) ,ray*cos(phi) , -Lenght_CaloFwd*0.5);
|
---|
[112] | 508 | CALOFWD->addDaughter(caloFWDB2); DetIdCountCaloFwd++;
|
---|
[100] | 509 | }
|
---|
[219] | 510 |
|
---|
[97] | 511 | FROG_Geometry* CustomGeom = new FROG_Geometry(prim);
|
---|
| 512 | CustomGeom->Save("DelphesToFrog.geom");
|
---|
[219] | 513 |
|
---|
| 514 | delete prim;
|
---|
| 515 | delete CustomGeom;
|
---|
| 516 |
|
---|
| 517 | /* pointer hierarchy
|
---|
| 518 | prim
|
---|
| 519 | -> mygeom
|
---|
| 520 | -> detector
|
---|
| 521 | -> Tracker
|
---|
| 522 | -> CALO
|
---|
| 523 | -> MUON
|
---|
| 524 | -> CALOFWD
|
---|
| 525 | pointers that have been added into others will be properly deleted by the destructor of their "mother"
|
---|
| 526 | */
|
---|
| 527 |
|
---|
| 528 |
|
---|
[171] | 529 | //FROG_ELEMENT::PrintTree(prim);
|
---|
[97] | 530 | return;
|
---|
| 531 |
|
---|
| 532 | }
|
---|