Fork me on GitHub

Changeset 242 in svn


Ignore:
Timestamp:
Feb 5, 2009, 11:53:26 AM (16 years ago)
Author:
Xavier Rouby
Message:

memory leak free code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VeryForward.cc

    r219 r242  
    2121VeryForward::VeryForward() {
    2222   DET = new RESOLution();
     23   beamline1 = new H_BeamLine(1,500.);
     24   beamline2 = new H_BeamLine(1,500.);
    2325   init();
     26  //Initialisation of Hector
     27  relative_energy = true; // should always be true
     28  kickers_on = 1;         // should always be 1
     29
    2430}
    2531
     
    2733   DET = new RESOLution();
    2834   DET->ReadDataCard(DetDatacard);
     35   beamline1 = new H_BeamLine(1,500.);
     36   beamline2 = new H_BeamLine(1,500.);
    2937   init();
     38  //Initialisation of Hector
     39  relative_energy = true; // should always be true
     40  kickers_on = 1;         // should always be 1
     41
    3042}
    3143
    3244VeryForward::VeryForward(const RESOLution * DetDatacard) {
    3345   DET = new RESOLution(*DetDatacard);
     46   beamline2 = new H_BeamLine(1,500.);
     47   beamline1 = new H_BeamLine(1,500.);
     48
    3449   init();
     50  //Initialisation of Hector
     51  relative_energy = true; // should always be true
     52  kickers_on = 1;         // should always be 1
     53
    3554}
    3655
     
    5776  // user should provide : (1) optics file for each beamline, and IPname,
    5877  // and offset data (s,x) for optical elements
    59   beamline1 = new H_BeamLine(1,500.);
    6078  beamline1->fill("data/LHCB1IR5_v6.500.tfs",1,"IP5");
    6179  beamline1->offsetElements(120,-0.097);
    6280  H_RomanPot * rp220_1 = new H_RomanPot("rp220_1",220,2000); // RP 220m, 2mm, beam 1
    6381  H_RomanPot * rp420_1 = new H_RomanPot("rp420_1",420,4000); // RP 420m, 4mm, beam 1
    64   beamline1->add(rp220_1);
     82  beamline1->add(rp220_1); 
    6583  beamline1->add(rp420_1);
    6684 
    67   beamline2 = new H_BeamLine(1,500.);
    6885  beamline2->fill("data/LHCB1IR5_v6.500.tfs",-1,"IP5");
    6986  beamline2->offsetElements(120,+0.097);
     
    7289  beamline2->add(rp220_2);
    7390  beamline2->add(rp420_2);
    74  
     91  // rp220_1, rp220_2, rp420_1 and rp420_2 will be deallocated in ~H_AbstractBeamLine
     92  // do not put explicit delete
    7593}
     94
    7695
    7796void VeryForward::ZDC(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchZDC,TRootGenParticle *particle)
Note: See TracChangeset for help on using the changeset viewer.