Fork me on GitHub

Changeset 65 in svn


Ignore:
Timestamp:
Dec 2, 2008, 11:16:48 AM (16 years ago)
Author:
severine ovyn
Message:

remove fill bug

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r64 r65  
    3030#include "interface/JetUtils.h"
    3131
     32#include "Utilities/FROG/Examples/Sim_Delphes/FrogUtil.h"
    3233
    3334#include <vector>
     
    232233            {
    233234            genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E);
    234 //cout<<"avant "<<genMomentum.Pt()<<endl;
    235             TRACP->Propagation(particle,genMomentum);
    236 //cout<<"apres "<<genMomentum.Pt()<<endl;
     235            //TRACP->Propagation(particle,genMomentum);
    237236            float eta=fabs(genMomentum.Eta());
    238237            switch(pid) {
     
    241240              DET->SmearElectron(genMomentum);
    242241              electron.push_back(genMomentum);
    243   //            cout<<"apres le smearing "<<genMomentum.Pt()<<endl;
    244 
    245242              elecPID.push_back(particle->PID);
    246243              break; // case pE
     
    276273                // back of the input_particles vector
    277274                input_particles.push_back(fastjet::PseudoJet(genMomentum.Px(),genMomentum.Py(),genMomentum.Pz(), genMomentum.E()));
    278             //   cout<<"on remplie avec "<<pid<<" Pt "<<genMomentum.Pt()<<" Eta "<<genMomentum.Eta()<<" Phi "<<genMomentum.Eta()<<endl;
    279275 
    280276                genMomentumCalo.SetPxPyPzE(CaloTower.fourVector.px,CaloTower.fourVector.py,CaloTower.fourVector.pz,CaloTower.fourVector.E);
     
    310306         
    311307        } // while
    312 // cout<<"*************"<<endl;     
     308
     309   // computes the Missing Transverse Momentum
     310   TLorentzVector Att(0.,0.,0.,0.);
     311   for(unsigned int i=0; i < towers.size(); i++)
     312     {
     313        Att.SetPxPyPzE(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E);
     314        PTmis = PTmis + Att;
     315     }
     316   elementEtmis = (TRootETmis*) branchETmis->NewEntry();
     317   elementEtmis->ET = (PTmis).Pt();
     318   elementEtmis->Phi = (-PTmis).Phi();
     319   elementEtmis->Px = (-PTmis).Px();
     320   elementEtmis->Py = (-PTmis).Py();
     321   //*****************************
     322   
    313323      for(unsigned int i=0; i < electron.size(); i++) {
    314324        if(electron[i].E()!=0 && fabs(electron[i].Eta()) < DET->MAX_TRACKER && electron[i].Pt() > DET->ELEC_pt)
     
    330340      }
    331341     
    332       // computes the Missing Transverse Momentum
    333       TLorentzVector Att(0.,0.,0.,0.);
    334       for(unsigned int i=0; i < towers.size(); i++)
    335         {
    336           Att.SetPxPyPzE(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E);
    337           PTmis = PTmis + Att;
    338         }
    339       elementEtmis = (TRootETmis*) branchETmis->NewEntry();
    340       elementEtmis->ET = (PTmis).Pt();
    341       elementEtmis->Phi = (-PTmis).Phi();
    342       elementEtmis->Px = (-PTmis).Px();
    343       elementEtmis->Py = (-PTmis).Py();
    344 
    345       //*****************************
    346       treeWriter->Fill();
    347      
    348342      sorted_jets=JETRUN->RunJets(input_particles);
    349343      JETRUN->RunJetBtagging(treeWriter, branchJet,sorted_jets,NFCentralQ);
     
    352346      // Add here the trigger
    353347      // Should test all the trigger table on the event, based on reconstructed objects
     348      treeWriter->Fill();
    354349     
    355350    } // Loop over all events
    356351
     352
    357353  treeWriter->Write();
    358  
     354  delete treeWriter;
     355
     356/*  if(DET->DOTRIGGER == 1)
     357    {
     358//      TChain chainT("Analysis");
     359//      chainT.Add(outputfilename.c_str());
     360      ExRootTreeReader *treeReaderT = new ExRootTreeReader("Analysis");
     361
     362
     363      const TClonesArray *branchElecTrig = treeReaderT->UseBranch("Electron");
     364      const TClonesArray *branchMuonTrig = treeReaderT->UseBranch("Muon");
     365      const TClonesArray *branchJetTrig = treeReaderT->UseBranch("Jet");
     366      const TClonesArray *branchTauJetTrig = treeReaderT->UseBranch("TauJet");
     367      const TClonesArray *branchPhotonTrig = treeReaderT->UseBranch("Photon");
     368      const TClonesArray *branchETmisTrig = treeReaderT->UseBranch("ETmis");
     369   
     370     // Loop over all events
     371     Long64_t entryT, allEntriesT = treeReaderT->GetEntries();
     372      cout << "** Chain contains " << allEntriesT << " events" << endl;
     373     for(entryT = 0; entryT < allEntriesT; ++entryT)
     374        {
     375//cout<<"entry "<<entryT<<endl;
     376        }
     377   }
     378*/
     379
    359380  cout << "** Exiting..." << endl;
    360381 
    361   delete treeWriter;
    362382  delete treeReader;
    363383  delete DET;
  • trunk/src/JetUtils.cc

    r53 r65  
    106106      }
    107107  } // for itJet : loop on all jets
    108  treeWriter->Fill();
    109108 
    110109}
     
    131130  } // for itJet : loop on all jets
    132131 
    133   treeWriter->Fill();
    134132 
    135133}
  • trunk/src/VeryForward.cc

    r53 r65  
    8080    elementZdc->side = sign(eta);
    8181   
    82     treeWriter->Fill();
    8382   
    8483  }
     
    140139
    141140      }
    142      treeWriter->Fill();
    143141      //                if(p1.stopped(beamline) && (p1.getStoppingElement()->getS() > 100))
    144142      //                        cout << "Eloss ="  << 7000.-p1.getE() << " ; " << p1.getStoppingElement()->getName() << endl;
Note: See TracChangeset for help on using the changeset viewer.