/*********************************************************************** ** ** ** /----------------------------------------------\ ** ** | Delphes, a framework for the fast simulation | ** ** | of a generic collider experiment | ** ** \----------------------------------------------/ ** ** ** ** ** ** This package uses: ** ** ------------------ ** ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] ** ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] ** ** FROG: [hep-ex/0901.2718v1] ** ** ** ** ------------------------------------------------------------------ ** ** ** ** Main authors: ** ** ------------- ** ** ** ** Severine Ovyn Xavier Rouby ** ** severine.ovyn@uclouvain.be xavier.rouby@cern ** ** ** ** Center for Particle Physics and Phenomenology (CP3) ** ** Universite catholique de Louvain (UCL) ** ** Louvain-la-Neuve, Belgium ** ** ** ** Copyright (C) 2008-2009, ** ** All rights reserved. ** ** ** ***********************************************************************/ #include #include "TROOT.h" #include "TApplication.h" #include "TStyle.h" #include "TChain.h" #include "TClonesArray.h" #include "BlockClasses.h" #include "ExRootTreeReader.h" #include "FrogUtil.h" #include "FROG_Coord.h" #include "FROG_Coord.cpp" #include "FROG_Geometry.h" #include "FROG_Geometry.cpp" #include "FROG_DetId.h" #include "FROG_Events.h" #include "FROG_Events.cpp" #include "FROG_Element_Tools.h" #include "FROG_Element_Tools.cpp" #include "FROG_Net_Tools.h" #include "FROG_Net_Tools.cpp" #include "FROG_Path.h" #include "FROG_Path.cpp" #include "FROG_ReadCards.h" #include "FROG_ReadCards.cpp" #include "FROG_ZLib.h" #include "FROG_ZLib.cpp" using namespace std; using namespace FROG_COORD; const float twopi = 6.283185307179586476925286766559; FrogDisplay::FrogDisplay() { //Smearing information DET = new RESOLution(); nEntryFrog = DET->NEvents_Frog; } FrogDisplay::FrogDisplay(const string& DetDatacard) { //Smearing information DET = new RESOLution(); DET->ReadDataCard(DetDatacard); nEntryFrog = DET->NEvents_Frog; } FrogDisplay::FrogDisplay(const RESOLution* DetDatacard) { //Smearing information DET = new RESOLution(*DetDatacard); nEntryFrog = DET->NEvents_Frog; } FrogDisplay::FrogDisplay(const FrogDisplay& frog) { DET = new RESOLution(*(frog.DET)); nEntryFrog = DET->NEvents_Frog; } FrogDisplay& FrogDisplay::operator=(const FrogDisplay& frog) { if (this==&frog) return *this; DET = new RESOLution(*(frog.DET)); nEntryFrog = DET->NEvents_Frog; return *this; } void FrogDisplay::BuildEvents(const string& outputfilename) { 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; unsigned int allEntries=treeReader->GetEntries(); FROG_Events* frog_events = new FROG_Events(); if(nEntryFrog > allEntries) { cerr <<"** ERROR: number of entries to display > available events **"<< endl; nEntryFrog = allEntries; } for(unsigned int entry = 0; entry < nEntryFrog; ++entry){ //cout<<"Event n° "<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); } /* Pointer hierachy frog_events -frog_event -frog_branchSIM -frog_branchElectrons -frog_elec -frog_branchMuons -frog_muon -frog_branchTaus -frog_tau -frog_branchPhotons -frog_photon -frog_photon -frog_jet -frog_branchMET -frog_met */ delete treeReader; delete treeReaderGen; delete frog_events; delete chain; delete chainGen; } void FrogDisplay::BuildGeom() { // 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 = twopi /NumPhi; for(double phi=0; phi<=twopi/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<=twopi/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"); delete prim; delete CustomGeom; /* pointer hierarchy prim -> mygeom -> detector -> Tracker -> CALO -> MUON -> CALOFWD pointers that have been added into others will be properly deleted by the destructor of their "mother" */ //FROG_ELEMENT::PrintTree(prim); return; }