/* * ---- Delphes ---- * A Fast Simulator for general purpose LHC detector * S. Ovyn ~~~~ severine.ovyn@uclouvain.be * * Center for Particle Physics and Phenomenology (CP3) * Universite Catholique de Louvain (UCL) * Louvain-la-Neuve, Belgium * */ // \brief Trigger class, and some generic definitions #include "interface/FrogUtil.h" #include "TRandom.h" #include "Utilities/FROG/Includes/FROG/FROG_DetId.h" #include "Utilities/FROG/Includes/FROG/FROG_Geometry.h" #include "Utilities/FROG/Includes/FROG/FROG_Geometry.cpp" #include "Utilities/FROG/Includes/FROG/FROG_Events.h" #include "Utilities/FROG/Includes/FROG/FROG_Events.cpp" #include "Utilities/FROG/Includes/FROG/FROG_Element_Tools.h" #include "Utilities/FROG/Includes/FROG/FROG_Element_Tools.cpp" #include "Utilities/FROG/Includes/FROG/FROG_Net_Tools.h" #include "Utilities/FROG/Includes/FROG/FROG_Net_Tools.cpp" #include "Utilities/FROG/Includes/FROG/FROG_Path.h" #include "Utilities/FROG/Includes/FROG/FROG_Path.cpp" #include "Utilities/FROG/Includes/FROG/FROG_Coord.h" #include "Utilities/FROG/Includes/FROG/FROG_Coord.cpp" #include "Utilities/FROG/Includes/FROG/FROG_ReadCards.h" #include "Utilities/FROG/Includes/FROG/FROG_ReadCards.cpp" #include "Utilities/FROG/Includes/FROG/FROG_ZLib.h" #include "Utilities/FROG/Includes/FROG/FROG_ZLib.cpp" #include #include #include #include #include using namespace std; using namespace FROG_COORD; FrogDisplay::FrogDisplay() {} //PROTON 1 void FrogDisplay::Build_1Event(FROG_Element_Event* event1) { double posp_x = 0.0299923*1000; double posp_y = 0.00602767*1000; double posp_z = 0; FROG_Element_Event_Hit* hitp = new FROG_Element_Event_Hit(500000001 + ((int)posp_z)/50, posp_x, posp_y, posp_z, -1); double dirp_x = 0*1000; double dirp_y = 0*1000; double dirp_z = -1*1000; float Pp = sqrt(dirp_x*dirp_x + dirp_y*dirp_y + dirp_z*dirp_z); float Ptp = sqrt(dirp_x*dirp_x + dirp_y*dirp_y); FROG_Element_Base_With_DetId_And_Name* trackCollectionP = new FROG_Element_Base_With_DetId_And_Name(EVTID_TRK+1000, "Tracks: protons"); FROG_Element_Event_Track* trackp= new FROG_Element_Event_Track(0,Pp,Ptp,0); trackp->addDaughter(hitp); double pos2p_x = 0.0299923*1000+0*1000*0.4; double pos2p_y = 0.00602767*1000+0*1000*0.4; double pos2p_z = -1*1000*0.4; FROG_Element_Event_Hit* hit2p = new FROG_Element_Event_Hit(500000001 + ((int)pos2p_z)/50, pos2p_x, pos2p_y, pos2p_z, -1); trackp->addDaughter(hit2p); trackCollectionP->addDaughter(trackp); // photon 1 FROG_Element_Base_With_DetId_And_Name* trackCollection = new FROG_Element_Base_With_DetId_And_Name(EVTID_TRK,"Tracks: Photons"); FROG_Element_Event_Track* track1 = new FROG_Element_Event_Track(0,1,1,0); double pos0_x = 0.0299923*1000; double pos0_y = 0.00602767*1000; double pos0_z = -0.309438*1000; FROG_Element_Event_Hit* hit0 = new FROG_Element_Event_Hit(400000001 + ((int)pos0_z)/50, pos0_x, pos0_y, pos0_z, -1); track1->addDaughter(hit0); double pos1_x = 0.03*1000; double pos1_y = 0.00602856*1000; double pos1_z = -0.309567*1000; FROG_Element_Event_Hit* hit1 = new FROG_Element_Event_Hit(400000001 + ((int)pos1_z)/50, pos1_x, pos1_y, pos1_z, -1); track1->addDaughter(hit1); trackCollection->addDaughter(track1); // photon 2 FROG_Element_Event_Track* track2 = new FROG_Element_Event_Track(0,1,1,0); double pos2_x = 0.0299923*1000; double pos2_y = 0.00602767*1000; double pos2_z = -0.312795*1000; FROG_Element_Event_Hit* hit2 = new FROG_Element_Event_Hit(400000001 + ((int)pos2_z)/50, pos2_x, pos2_y, pos2_z, -1); track2->addDaughter(hit2); double pos3_x = 0.0291312*1000; double pos3_y = 0.00599684*1000; double pos3_z = -0.326865*1000; FROG_Element_Event_Hit* hit3 = new FROG_Element_Event_Hit(400000001 + ((int)pos3_z)/50, pos3_x, pos3_y, pos3_z, -1); track2->addDaughter(hit3); double pos4_x = 0.0272812*1000; double pos4_y = 0*1000; double pos4_z = -0.325133*1000; FROG_Element_Event_Hit* hit4 = new FROG_Element_Event_Hit(400000001 + ((int)pos4_z)/50, pos4_x, pos4_y, pos4_z, -1); track2->addDaughter(hit4); double pos5_x = 0.0147219*1000; double pos5_y = -0.04071*1000; double pos5_z = -0.313375*1000; FROG_Element_Event_Hit* hit5 = new FROG_Element_Event_Hit(400000001 + ((int)pos5_z)/50, pos5_x, pos5_y, pos5_z, -1); track2->addDaughter(hit5); trackCollection->addDaughter(track2); // photon 3 FROG_Element_Event_Track* track3 = new FROG_Element_Event_Track(0,1,1,0); double pos6_x = 0.0299923*1000; double pos6_y = 0.00602767*1000; double pos6_z = -0.241733*1000; FROG_Element_Event_Hit* hit6 = new FROG_Element_Event_Hit(400000001 + ((int)pos6_z)/50, pos6_x, pos6_y, pos6_z, -1); track3->addDaughter(hit6); double pos7_x = 0.0247239*1000; double pos7_y = 0.00635725*1000; double pos7_z = -0.327258*1000; FROG_Element_Event_Hit* hit7 = new FROG_Element_Event_Hit(400000001 + ((int)pos7_z)/50, pos7_x, pos7_y, pos7_z, -1); track3->addDaughter(hit7); double pos8_x = 0.023245*1000; double pos8_y = 0*1000; double pos8_z = -0.325292*1000; FROG_Element_Event_Hit* hit8 = new FROG_Element_Event_Hit(400000001 + ((int)pos8_z)/50, pos8_x, pos8_y, pos8_z, -1); track3->addDaughter(hit8); double pos9_x = 0.0137742*1000; double pos9_y = -0.04071*1000; double pos9_z = -0.312698*1000; FROG_Element_Event_Hit* hit9 = new FROG_Element_Event_Hit(400000001 + ((int)pos9_z)/50, pos9_x, pos9_y, pos9_z, -1); track3->addDaughter(hit9); trackCollection->addDaughter(track3); // photon 4 FROG_Element_Event_Track* track4 = new FROG_Element_Event_Track(0,1,1,0); double pos10_x = 0.0299923*1000; double pos10_y = 0.00602767*1000; double pos10_z = -0.103114*1000; FROG_Element_Event_Hit* hit10 = new FROG_Element_Event_Hit(400000001 + ((int)pos10_z)/50, pos10_x, pos10_y, pos10_z, -1); track4->addDaughter(hit10); double pos11_x = 0.0169713*1000; double pos11_y = 0.0106604*1000; double pos11_z = -0.324528*1000; FROG_Element_Event_Hit* hit11 = new FROG_Element_Event_Hit(400000001 + ((int)pos11_z)/50, pos11_x, pos11_y, pos11_z, -1); track4->addDaughter(hit11); double pos12_x = 0.0159847*1000; double pos12_y = 0*1000; double pos12_z = -0.322034*1000; FROG_Element_Event_Hit* hit12 = new FROG_Element_Event_Hit(400000001 + ((int)pos12_z)/50, pos12_x, pos12_y, pos12_z, -1); track4->addDaughter(hit12); double pos13_x = 0.00925296*1000; double pos13_y = -0.0727334*1000; double pos13_z = -0.305018*1000; FROG_Element_Event_Hit* hit13 = new FROG_Element_Event_Hit(400000001 + ((int)pos13_z)/50, pos13_x, pos13_y, pos13_z, -1); track4->addDaughter(hit13); trackCollection->addDaughter(track4); // photon 5 FROG_Element_Event_Track* track5 = new FROG_Element_Event_Track(0,1,1,0); double pos14_x = 0.0299923*1000; double pos14_y = 0.00602767*1000; double pos14_z = -0.0550703*1000; FROG_Element_Event_Hit* hit14 = new FROG_Element_Event_Hit(400000001 + ((int)pos14_z)/50, pos14_x, pos14_y, pos14_z, -1); track5->addDaughter(hit14); double pos15_x = 0.03*1000; double pos15_y = 0.00597767*1000; double pos15_z = -0.0558923*1000; FROG_Element_Event_Hit* hit15 = new FROG_Element_Event_Hit(400000001 + ((int)pos15_z)/50, pos15_x, pos15_y, pos15_z, -1); track5->addDaughter(hit15); trackCollection->addDaughter(track5); // photon 6 FROG_Element_Event_Track* track6 = new FROG_Element_Event_Track(0,1,1,0); double pos16_x = 0.0299923*1000; double pos16_y = 0.00602767*1000; double pos16_z = -0.0724158*1000; FROG_Element_Event_Hit* hit16 = new FROG_Element_Event_Hit(400000001 + ((int)pos16_z)/50, pos16_x, pos16_y, pos16_z, -1); track6->addDaughter(hit16); double pos17_x = 0.03*1000; double pos17_y = 0.00602949*1000; double pos17_z = -0.0725471*1000; FROG_Element_Event_Hit* hit17 = new FROG_Element_Event_Hit(400000001 + ((int)pos17_z)/50, pos17_x, pos17_y, pos17_z, -1); track6->addDaughter(hit17); trackCollection->addDaughter(track6); // photon 7 FROG_Element_Event_Track* track7 = new FROG_Element_Event_Track(0,1,1,0); double pos18_x = 0.0299923*1000; double pos18_y = 0.00602767*1000; double pos18_z = -0.108963*1000; FROG_Element_Event_Hit* hit18 = new FROG_Element_Event_Hit(400000001 + ((int)pos18_z)/50, pos18_x, pos18_y, pos18_z, -1); track7->addDaughter(hit18); double pos19_x = 0.03*1000; double pos19_y = 0.0060305*1000; double pos19_z = -0.109102*1000; FROG_Element_Event_Hit* hit19 = new FROG_Element_Event_Hit(400000001 + ((int)pos19_z)/50, pos19_x, pos19_y, pos19_z, -1); track7->addDaughter(hit19); trackCollection->addDaughter(track7); // photon 8 FROG_Element_Event_Track* track8 = new FROG_Element_Event_Track(0,1,1,0); double pos20_x = 0.0299923*1000; double pos20_y = 0.00602767*1000; double pos20_z = -0.189456*1000; FROG_Element_Event_Hit* hit20 = new FROG_Element_Event_Hit(400000001 + ((int)pos20_z)/50, pos20_x, pos20_y, pos20_z, -1); track8->addDaughter(hit20); double pos21_x = 0.0248364*1000; double pos21_y = 0.0129674*1000; double pos21_z = -0.321989*1000; FROG_Element_Event_Hit* hit21 = new FROG_Element_Event_Hit(400000001 + ((int)pos21_z)/50, pos21_x, pos21_y, pos21_z, -1); track8->addDaughter(hit21); double pos22_x = 0.0222521*1000; double pos22_y = 0*1000; double pos22_z = -0.319622*1000; FROG_Element_Event_Hit* hit22 = new FROG_Element_Event_Hit(400000001 + ((int)pos22_z)/50, pos22_x, pos22_y, pos22_z, -1); track8->addDaughter(hit22); double pos23_x = 0.0141387*1000; double pos23_y = -0.04071*1000; double pos23_z = -0.312192*1000; FROG_Element_Event_Hit* hit23 = new FROG_Element_Event_Hit(400000001 + ((int)pos23_z)/50, pos23_x, pos23_y, pos23_z, -1); track8->addDaughter(hit23); trackCollection->addDaughter(track8); // photon 9 FROG_Element_Event_Track* track9 = new FROG_Element_Event_Track(0,1,1,0); double pos24_x = 0.0299923*1000; double pos24_y = 0.00602767*1000; double pos24_z = -0.162889*1000; FROG_Element_Event_Hit* hit24 = new FROG_Element_Event_Hit(400000001 + ((int)pos24_z)/50, pos24_x, pos24_y, pos24_z, -1); track9->addDaughter(hit24); double pos25_x = 0.0275782*1000; double pos25_y = 0*1000; double pos25_z = -0.266817*1000; FROG_Element_Event_Hit* hit25 = new FROG_Element_Event_Hit(400000001 + ((int)pos25_z)/50, pos25_x, pos25_y, pos25_z, -1); track9->addDaughter(hit25); trackCollection->addDaughter(track9); // photon 10 FROG_Element_Event_Track* track10 = new FROG_Element_Event_Track(0,1,1,0); double pos26_x = 0.0299923*1000; double pos26_y = 0.00602767*1000; double pos26_z = -0.0968708*1000; FROG_Element_Event_Hit* hit26 = new FROG_Element_Event_Hit(400000001 + ((int)pos26_z)/50, pos26_x, pos26_y, pos26_z, -1); track10->addDaughter(hit26); double pos27_x = 0.03*1000; double pos27_y = 0.00603619*1000; double pos27_z = -0.0970637*1000; FROG_Element_Event_Hit* hit27 = new FROG_Element_Event_Hit(400000001 + ((int)pos27_z)/50, pos27_x, pos27_y, pos27_z, -1); track10->addDaughter(hit27); trackCollection->addDaughter(track10); // photon 11 FROG_Element_Event_Track* track11 = new FROG_Element_Event_Track(0,1,1,0); double pos28_x = 0.0299923*1000; double pos28_y = 0.00602767*1000; double pos28_z = -0.211734*1000; FROG_Element_Event_Hit* hit28 = new FROG_Element_Event_Hit(400000001 + ((int)pos28_z)/50, pos28_x, pos28_y, pos28_z, -1); track11->addDaughter(hit28); double pos29_x = 0.0231748*1000; double pos29_y = 0.00496626*1000; double pos29_z = -0.328422*1000; FROG_Element_Event_Hit* hit29 = new FROG_Element_Event_Hit(400000001 + ((int)pos29_z)/50, pos29_x, pos29_y, pos29_z, -1); track11->addDaughter(hit29); double pos30_x = 0.0221601*1000; double pos30_y = 0*1000; double pos30_z = -0.326734*1000; FROG_Element_Event_Hit* hit30 = new FROG_Element_Event_Hit(400000001 + ((int)pos30_z)/50, pos30_x, pos30_y, pos30_z, -1); track11->addDaughter(hit30); double pos31_x = 0.0138423*1000; double pos31_y = -0.04071*1000; double pos31_z = -0.312897*1000; FROG_Element_Event_Hit* hit31 = new FROG_Element_Event_Hit(400000001 + ((int)pos31_z)/50, pos31_x, pos31_y, pos31_z, -1); track11->addDaughter(hit31); trackCollection->addDaughter(track11); // photon 12 FROG_Element_Event_Track* track12 = new FROG_Element_Event_Track(0,1,1,0); double pos32_x = 0.0299923*1000; double pos32_y = 0.00602767*1000; double pos32_z = -0.233216*1000; FROG_Element_Event_Hit* hit32 = new FROG_Element_Event_Hit(400000001 + ((int)pos32_z)/50, pos32_x, pos32_y, pos32_z, -1); track12->addDaughter(hit32); double pos33_x = 0.03*1000; double pos33_y = 0.00603839*1000; double pos33_z = -0.233429*1000; FROG_Element_Event_Hit* hit33 = new FROG_Element_Event_Hit(400000001 + ((int)pos33_z)/50, pos33_x, pos33_y, pos33_z, -1); track12->addDaughter(hit33); trackCollection->addDaughter(track12); // photon 13 FROG_Element_Event_Track* track13 = new FROG_Element_Event_Track(0,1,1,0); double pos34_x = 0.0299923*1000; double pos34_y = 0.00602767*1000; double pos34_z = -0.0352209*1000; FROG_Element_Event_Hit* hit34 = new FROG_Element_Event_Hit(400000001 + ((int)pos34_z)/50, pos34_x, pos34_y, pos34_z, -1); track13->addDaughter(hit34); double pos35_x = 0.03*1000; double pos35_y = 0.00603501*1000; double pos35_z = -0.0353909*1000; FROG_Element_Event_Hit* hit35 = new FROG_Element_Event_Hit(400000001 + ((int)pos35_z)/50, pos35_x, pos35_y, pos35_z, -1); track13->addDaughter(hit35); trackCollection->addDaughter(track13); // photon 14 FROG_Element_Event_Track* track14 = new FROG_Element_Event_Track(0,1,1,0); double pos36_x = 0.0299923*1000; double pos36_y = 0.00602767*1000; double pos36_z = -0.0678788*1000; FROG_Element_Event_Hit* hit36 = new FROG_Element_Event_Hit(400000001 + ((int)pos36_z)/50, pos36_x, pos36_y, pos36_z, -1); track14->addDaughter(hit36); double pos37_x = 0.03*1000; double pos37_y = 0.00602573*1000; double pos37_z = -0.0680089*1000; FROG_Element_Event_Hit* hit37 = new FROG_Element_Event_Hit(400000001 + ((int)pos37_z)/50, pos37_x, pos37_y, pos37_z, -1); track14->addDaughter(hit37); trackCollection->addDaughter(track14); // photon 15 FROG_Element_Event_Track* track15 = new FROG_Element_Event_Track(0,1,1,0); double pos38_x = 0.0299923*1000; double pos38_y = 0.00602767*1000; double pos38_z = -0.0418564*1000; FROG_Element_Event_Hit* hit38 = new FROG_Element_Event_Hit(400000001 + ((int)pos38_z)/50, pos38_x, pos38_y, pos38_z, -1); track15->addDaughter(hit38); double pos39_x = 0.0281432*1000; double pos39_y = 0*1000; double pos39_z = -0.148365*1000; FROG_Element_Event_Hit* hit39 = new FROG_Element_Event_Hit(400000001 + ((int)pos39_z)/50, pos39_x, pos39_y, pos39_z, -1); track15->addDaughter(hit39); trackCollection->addDaughter(track15); event1->addDaughter(trackCollectionP); event1->addDaughter(trackCollection); } void FrogDisplay::BuidEvents(string outputfilename,int nEntryFrog) { const Font_t kExRootFont = 42; const Float_t kExRootFontSize = 0.07; gROOT->SetStyle("Plain"); gROOT->cd(); gStyle->SetCanvasColor(10); gStyle->SetPadColor(10); gStyle->SetFillColor(-1); gStyle->SetPaperSize(20, 24); gStyle->SetStatFont(kExRootFont); gStyle->SetTextFont(kExRootFont); gStyle->SetTextSize(kExRootFontSize); gStyle->SetLegendBorderSize(0); gStyle->SetOptStat(0); TChain* chain = new TChain("Analysis"); TChain* chainGen = new TChain("GEN"); chain ->Add(outputfilename.c_str()); chainGen->Add(outputfilename.c_str()); ExRootTreeReader *treeReader = new ExRootTreeReader(chain); ExRootTreeReader *treeReaderGen = new ExRootTreeReader(chainGen); const TClonesArray* branchElectron = treeReader ->UseBranch("Electron"); const TClonesArray* branchMuon = treeReader ->UseBranch("Muon"); const TClonesArray* branchTau = treeReader ->UseBranch("TauJet"); const TClonesArray* branchPhoton = treeReader ->UseBranch("Photon"); const TClonesArray* branchJet = treeReader ->UseBranch("Jet"); const TClonesArray* branchMET = treeReader ->UseBranch("ETmis"); TRootElectron* elec; TRootMuon* muon; TRootTauJet* tau; TRootPhoton* photon; TRootJet* jet; TRootETmis* met; Long64_t allEntries; allEntries=treeReader->GetEntries(); FROG_Events* frog_events = new FROG_Events(); if(nEntryFrog > allEntries) { cout<<"nEntry to display by frog greater than number of available events... Exit"<ReadEntry(entry); treeReaderGen->ReadEntry(entry); //Create a new event FROG_Element_Event* frog_event = new FROG_Element_Event(1,entry); frog_events->AddEvent(frog_event); //Create a new branch in the event with name SIM and ID = EVTID_SIM FROG_Element_Base_With_DetId_And_Name* frog_branchSIM = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM,"SIM"); frog_event->addDaughter(frog_branchSIM); //SIM ELEC //Create a new sub-branch in the SIM branch with name Electrons: this sub branch will contais all the electrons FROG_Element_Base_With_DetId_And_Name* frog_branchElectrons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+1000,"Electrons"); frog_branchSIM->addDaughter(frog_branchElectrons); for(int p=0;pGetEntriesFast();p++){ elec = (TRootElectron*) branchElectron->At(p); cout<<"Elec nO "<PT<<" Eta "<Eta<<" Phi"<Phi<E,elec->Eta,elec->Phi); frog_branchElectrons->addDaughter(frog_elec); } //SIM MUONS //Create a new sub-branch in the SIM branch with name Muons: this sub branch will contais all the muons FROG_Element_Base_With_DetId_And_Name* frog_branchMuons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+2000,"Muons"); frog_branchSIM->addDaughter(frog_branchMuons); for(int p=0;pGetEntriesFast();p++){ muon = (TRootMuon*) branchMuon->At(p); cout<<"Muon nO"<PT<<"Eta "<Eta<<" Phi"<Phi<E,muon->Eta,muon->Phi); frog_branchMuons->addDaughter(frog_muon); } //SIM TAUS //Create a new sub-branch in the SIM branch with name Taus: this sub branch will contais all the Taus FROG_Element_Base_With_DetId_And_Name* frog_branchTaus = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+3000,"Taus"); frog_branchSIM->addDaughter(frog_branchTaus); for(int p=0;pGetEntriesFast();p++){ tau = (TRootTauJet*) branchTau->At(p); cout<<"Tau nO"<PT<<"Eta "<Eta<<" Phi"<Phi<E,tau->Eta,tau->Phi); frog_branchTaus->addDaughter(frog_tau); } //SIM PHOTONS //Create a new sub-branch in the SIM branch with name Photons: this sub branch will contais all the Photons FROG_Element_Base_With_DetId_And_Name* frog_branchPhotons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+4000,"Photons"); frog_branchSIM->addDaughter(frog_branchPhotons); for(int p=0;pGetEntriesFast();p++){ photon = (TRootPhoton*) branchPhoton->At(p); cout<<"Photon nO"<PT<<"Eta "<Eta<<" Phi"<Phi<E,photon->Eta,photon->Phi); frog_branchPhotons->addDaughter(frog_photon); } //SIM JETS //Create a new sub-branch in the SIM branch with name Jets: this sub branch will contais all the Jets FROG_Element_Base_With_DetId_And_Name* frog_branchJets = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+5000,"Jets"); frog_branchSIM->addDaughter(frog_branchJets); for(int p=0;pGetEntriesFast();p++){ jet = (TRootJet*) branchJet->At(p); cout<<"Jet nO"<PT<<"Eta "<Eta<<" Phi"<Phi<E,jet->Eta,jet->Phi); frog_branchJets->addDaughter(frog_jet); } //SIM MET //Create a new sub-branch in the SIM branch with name MET: this sub branch will contais all the METs FROG_Element_Base_With_DetId_And_Name* frog_branchMET = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+6000,"MET"); frog_branchSIM->addDaughter(frog_branchMET); for(int p=0;pGetEntriesFast();p++){ met = (TRootETmis*) branchMET->At(p); cout<<"MET nO"<ET<<"Eta "<<0<<" Phi"<Phi<ET,0,met->Phi, met->ET); frog_branchMET->addDaughter(frog_met); } //Save the event in the .vis file frog_events->SaveInLive("DelphesToFrog.vis",false,false,(unsigned int)-1); } delete treeReader; delete treeReaderGen; delete frog_events; } void FrogDisplay::BuildGeom(string DetDatacard) { //Smearing information RESOLution *DET = new RESOLution(); DET->ReadDataCard(DetDatacard); // This element is the root of the "file" tree. (don't change this line) FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY); FROG_Element_Base* mygeom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(mygeom); FROG_Element_Base_With_DetId_And_Name* detector = new FROG_Element_Base_With_DetId_And_Name(900000000,"Delphes"); mygeom->addDaughter(detector); double Rayon_Tracker=40; double Rayon_Calo = Rayon_Tracker*1.5; double Rayon_Muon = Rayon_Tracker*2; double Lenght_Tracker=100; double Lenght_Calo=Lenght_Tracker+Lenght_Tracker/2.5; double Lenght_Muon=Lenght_Calo+Lenght_Calo/2.5; double Lenght_CaloFwd=Lenght_Muon+Lenght_Muon/2.5; int NumPhi=100; float frac=1; //************************************************Tracker************************************************* //******************************************************************************************************** FROG_Element_Base_With_DetId_And_Name* Tracker = new FROG_Element_Base_With_DetId_And_Name(910000000,"Tracker"); detector->addDaughter(Tracker); unsigned int DetIdCountTracker = 1; double ray=Rayon_Tracker; double rayCone = tan(EtaToTheta(DET->CEN_max_tracker))*Lenght_Tracker/2; if(ray < rayCone)ray=rayCone; double dphi = 6.283185307179586476925286766559 /NumPhi; for(double phi=0; phi<=6.2831/frac;phi+=dphi){ FROG_Element_Primitive_CustomSurface* trackerCone1 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10, rayCone*sin(phi) ,rayCone*cos(phi) ,-Lenght_Tracker/2, rayCone*sin(phi+dphi) ,rayCone*cos(phi+dphi) ,-Lenght_Tracker/2, 0 , 0 , 0, 0 , 0 , 0 ); Tracker->addDaughter(trackerCone1); DetIdCountTracker++; FROG_Element_Primitive_CustomSurface* trackerCone2 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10, 0 , 0 ,0, 0 , 0 ,0, rayCone*sin(phi) , rayCone*cos(phi) , Lenght_Tracker/2, rayCone*sin(phi+dphi) , rayCone*sin(phi+dphi) , Lenght_Tracker/2 ); Tracker->addDaughter(trackerCone2); DetIdCountTracker++; FROG_Element_Primitive_CustomSurface* trackerB = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10, ray*sin(phi) ,ray*cos(phi) ,-Lenght_Tracker*0.5, ray*sin(phi+dphi) ,ray*cos(phi+dphi) ,-Lenght_Tracker*0.5, ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Tracker*0.5, ray*sin(phi) ,ray*cos(phi) , Lenght_Tracker*0.5); Tracker->addDaughter(trackerB); DetIdCountTracker++; FROG_Element_Primitive_CustomSurface* trackerEndCap1 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10, rayCone*sin(phi) , rayCone*cos(phi) , -(Lenght_Tracker)/2, rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) , -(Lenght_Tracker)/2, ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Tracker)/2, ray*sin(phi) , ray*cos(phi) , -(Lenght_Tracker)/2 ); Tracker->addDaughter(trackerEndCap1); DetIdCountTracker++; FROG_Element_Primitive_CustomSurface* trackerEndCap2 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10, rayCone*sin(phi) , rayCone*cos(phi) , (Lenght_Tracker)/2, rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) , (Lenght_Tracker)/2, ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Tracker)/2, ray*sin(phi) , ray*cos(phi) , (Lenght_Tracker)/2 ); Tracker->addDaughter(trackerEndCap2); DetIdCountTracker++; } Rayon_Calo = ray*1.5; //******************************************Central calorimeters****************************************** //******************************************************************************************************** FROG_Element_Base_With_DetId_And_Name* CALO = new FROG_Element_Base_With_DetId_And_Name(920000000,"Calo"); detector->addDaughter(CALO); unsigned int DetIdCountCalo = 1; float rayConeD = tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_Tracker/2; float rayConeF = tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_Calo/2; ray=Rayon_Calo; if(rayaddDaughter(caloB); DetIdCountCalo++; //Partial cone + side FROG_Element_Primitive_CustomSurface* caloEndCap1a = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountCalo*10, rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Tracker)/2, rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Tracker)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Calo)/2, rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Calo)/2 ); CALO->addDaughter(caloEndCap1a); DetIdCountCalo++; //Close Endcap + side FROG_Element_Primitive_CustomSurface* caloEndCap1b = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountTracker*10, rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Calo)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Calo)/2, ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Calo)/2, ray*sin(phi) , ray*cos(phi) , (Lenght_Calo)/2 ); CALO->addDaughter(caloEndCap1b); DetIdCountCalo++; //Partial cone - side FROG_Element_Primitive_CustomSurface* caloEndCap2a = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountCalo*10, rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Tracker)/2, rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Tracker)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Calo)/2, rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Calo)/2 ); CALO->addDaughter(caloEndCap2a); DetIdCountCalo++; //Close Endcap - side FROG_Element_Primitive_CustomSurface* caloEndCap2b = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountTracker*10, rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Calo)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Calo)/2, ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Calo)/2, ray*sin(phi) , ray*cos(phi) , -(Lenght_Calo)/2 ); CALO->addDaughter(caloEndCap2b); DetIdCountCalo++; } Rayon_Muon = ray*1.2; //***********************************************Muon chambers******************************************** //******************************************************************************************************** FROG_Element_Base_With_DetId_And_Name* MUON = new FROG_Element_Base_With_DetId_And_Name(930000000,"Muon"); detector->addDaughter(MUON); unsigned int DetIdCountMuon = 1; rayConeD = tan(EtaToTheta(DET->CEN_max_mu))*Lenght_Calo/2; rayConeF = tan(EtaToTheta(DET->CEN_max_mu))*Lenght_Muon/2; ray=Rayon_Muon; if(rayaddDaughter(muonB); DetIdCountMuon++; //Partial cone + side FROG_Element_Primitive_CustomSurface* muonEndCap1a = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10, rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Calo)/2, rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Calo)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Muon)/2, rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Muon)/2 ); MUON->addDaughter(muonEndCap1a); DetIdCountMuon++; //Close Endcap + side FROG_Element_Primitive_CustomSurface* muonEndCap1b = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10, rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_Muon)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_Muon)/2, ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_Muon)/2, ray*sin(phi) , ray*cos(phi) , (Lenght_Muon)/2 ); MUON->addDaughter(muonEndCap1b); DetIdCountMuon++; //Partial cone - side FROG_Element_Primitive_CustomSurface* muonEndCap2a = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10, rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Calo)/2, rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Calo)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Muon)/2, rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Muon)/2 ); MUON->addDaughter(muonEndCap2a); DetIdCountMuon++; //Close Endcap - side FROG_Element_Primitive_CustomSurface* muonEndCap2b = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10, rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_Muon)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_Muon)/2, ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_Muon)/2, ray*sin(phi) , ray*cos(phi) , -(Lenght_Muon)/2 ); MUON->addDaughter(muonEndCap2b); DetIdCountMuon++; } //******************************************Forward calorimeters****************************************** //******************************************************************************************************** FROG_Element_Base_With_DetId_And_Name* CALOFWD = new FROG_Element_Base_With_DetId_And_Name(940000000,"CaloFwd"); detector->addDaughter(CALOFWD); unsigned int DetIdCountCaloFwd = 1; rayConeD = tan(EtaToTheta(DET->CEN_max_calo_fwd))*Lenght_Muon; rayConeF = tan(EtaToTheta(DET->CEN_max_calo_fwd))*Lenght_CaloFwd; ray=tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_CaloFwd; for(double phi=0; phi<=6.2831/frac;phi+=dphi){ //Partial cone + side FROG_Element_Primitive_CustomSurface* caloFWDEndCap1a = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10, rayConeD*sin(phi) , rayConeD*cos(phi) , (Lenght_Muon)/2, rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , (Lenght_Muon)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_CaloFwd)/2, rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_CaloFwd)/2 ); CALOFWD->addDaughter(caloFWDEndCap1a); DetIdCountCaloFwd++; //Close Endcap + side FROG_Element_Primitive_CustomSurface* caloFWDEndCap1b = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10, rayConeF*sin(phi) , rayConeF*cos(phi) , (Lenght_CaloFwd)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , (Lenght_CaloFwd)/2, ray*sin(phi+dphi) , ray*cos(phi+dphi) , (Lenght_CaloFwd)/2, ray*sin(phi) , ray*cos(phi) , (Lenght_CaloFwd)/2 ); CALOFWD->addDaughter(caloFWDEndCap1b); DetIdCountCaloFwd++; //BARREL FROG_Element_Primitive_CustomSurface* caloFWDB1 = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountMuon*10, ray*sin(phi) ,ray*cos(phi) , Lenght_Muon*0.5, ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_Muon*0.5, ray*sin(phi+dphi) ,ray*cos(phi+dphi) , Lenght_CaloFwd*0.5, ray*sin(phi) ,ray*cos(phi) , Lenght_CaloFwd*0.5); CALOFWD->addDaughter(caloFWDB1); DetIdCountCaloFwd++; //Partial cone - side FROG_Element_Primitive_CustomSurface* caloFWDEndCap2a = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10, rayConeD*sin(phi) , rayConeD*cos(phi) , -(Lenght_Muon)/2, rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) , -(Lenght_Muon)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_CaloFwd)/2, rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_CaloFwd)/2 ); CALOFWD->addDaughter(caloFWDEndCap2a); DetIdCountCaloFwd++; //Close Endcap - side FROG_Element_Primitive_CustomSurface* caloFWDEndCap2b = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10, rayConeF*sin(phi) , rayConeF*cos(phi) , -(Lenght_CaloFwd)/2, rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) , -(Lenght_CaloFwd)/2, ray*sin(phi+dphi) , ray*cos(phi+dphi) , -(Lenght_CaloFwd)/2, ray*sin(phi) , ray*cos(phi) , -(Lenght_CaloFwd)/2); CALOFWD->addDaughter(caloFWDEndCap2b); DetIdCountCaloFwd++; //BARREL FROG_Element_Primitive_CustomSurface* caloFWDB2 = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountMuon*10, ray*sin(phi) ,ray*cos(phi) , -Lenght_Muon*0.5, ray*sin(phi+dphi) ,ray*cos(phi+dphi) , -Lenght_Muon*0.5, ray*sin(phi+dphi) ,ray*cos(phi+dphi) , -Lenght_CaloFwd*0.5, ray*sin(phi) ,ray*cos(phi) , -Lenght_CaloFwd*0.5); CALOFWD->addDaughter(caloFWDB2); DetIdCountCaloFwd++; } FROG_Geometry* CustomGeom = new FROG_Geometry(prim); CustomGeom->Save("DelphesToFrog.geom"); FROG_ELEMENT::PrintTree(prim); return; }