Fork me on GitHub

Changeset 384 in svn for trunk


Ignore:
Timestamp:
May 15, 2009, 7:28:55 PM (15 years ago)
Author:
Xavier Rouby
Message:

energy flow

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r382 r384  
    9999  }
    100100 
    101  
    102  
    103  
    104101  cout << endl << endl;
    105102 
     
    180177  string line;
    181178  ifstream infile(inputFileList.c_str());
     179  if(!infile.good()) {
     180    cout << "**    ERROR: Input list (" << left << setw(13) << inputFileList << ") not found. Exiting...      **"<< endl;
     181    cout <<"*********************************************************************"<< endl;
     182    exit(1);
     183  }
    182184  infile >> line; // the first line determines the type of input files
    183185 
     
    390392      NTrackJet.clear();     
    391393     
    392      
     394      // 'list_of_active_towers' contains the exact list of calorimetric towers which have some deposits inside (E>0).
     395      // The towers of this list will be smeared according to the calo resolution, afterwards
    393396      D_CaloTowerList list_of_active_towers;
     397 
     398      // 'list_of_towers_with_photon' and 'list_of_centowers_with_neutrals' are list of towers, whose energy is **not** computed.
     399      // They are only used to store the eta/phi of some towers, in order to search later inside 'list_of_active_towers'.
     400      // 'list_of_towers_with_photon' contains the towers hit by photons only
     401      // 'list_of_centowers_with_neutrals' is used to the jet-E-flow calculation: contains the towers with eta < CEN_max_tracker,
     402      //     i.e. towers behind the tracker.
    394403      D_CaloTowerList list_of_towers_with_photon; // to speed up the code: will only look in interesting towers for gamma candidates
    395        
    396      
     404
     405      D_CaloTowerList list_of_centowers_with_neutrals;                // list of towers with neutral particles : for jet E-flow
     406      float etamax_calocoverage_behindtracker = DET->CEN_max_tracker; // finds the extension in eta of the furthest
     407      for (unsigned int i=1; i< DET->TOWER_number+1; i++) {           // cell (at least) partially behind the tracker
     408        if(DET->TOWER_eta_edges[i] > DET->CEN_max_tracker) break;
     409        etamax_calocoverage_behindtracker = DET->TOWER_eta_edges[i];
     410      }
    397411      // 2.1a Loop over all particles in event, to fill the towers
    398412      itGen.Reset();
     
    472486                        {
    473487                          p.SetPtEtaPhiE(sPT,particle->Eta,particle->Phi,sPT*cosh(particle->Eta));
    474                           muon.push_back(D_Particle(p,particle->PID,particle->EtaCalo,particle->PhiCalo));
     488                          muon.push_back(D_Particle(p,pMU,particle->EtaCalo,particle->PhiCalo));
    475489                        }
    476490                      sET = (sPT >0)? sPT : 0;
     
    498512                          if (sET > DET->PTCUT_elec)
    499513                            electron.push_back(D_Particle(p,particle->PID,particle->EtaCalo,particle->PhiCalo));
     514                          //if(DET->JET_Eflow) input_particles.push_back(fastjet::PseudoJet(p.Px(),p.Py(),p.Pz(),p.E()));
    500515                        }
    501516                      else { sET=0;} // if negative smeared energy -- needed for the tracks
     
    517532                      elementTrack->Set(particle->Eta, particle->Phi, particle->EtaCalo, particle->PhiCalo, sET, particle->Charge);
    518533                      TrackCentral.push_back(*elementTrack); // tracks at vertex!
     534                      if(DET->JET_Eflow)
     535                         input_particles.push_back(fastjet::PseudoJet(particle->Px,particle->Py,particle->Pz,particle->E));
    519536                      // TODO!!! apply a smearing on the position of the origin of the track
    520537                      // TODO!!! elementTracks->SetPositionOut(Xout,Yout,Zout);
     
    531548                  list_of_towers_with_photon.addTower(tower);
    532549                }
    533               // 2.1a.2.5 : very forward detectors
     550              // 2.1a.2.5 Neutrals within tracker -- for jet energy flow
     551              else if(  particle->Charge ==0 && fabs(particle->EtaCalo)< etamax_calocoverage_behindtracker)
     552                {
     553                  float iEta=UNDEFINED, iPhi=UNDEFINED;
     554                  DET->BinEtaPhi(particle->PhiCalo,particle->EtaCalo,iPhi,iEta); // fills in iPhi and iEta
     555                  D_CaloTower tower(iEta,iPhi);
     556                  list_of_centowers_with_neutrals.addTower(tower);
     557                }
     558              // 2.1a.2.6 : very forward detectors
    534559              else
    535560                {
     
    551576          delete particle;
    552577        }// loop on all particles 2.1a
    553      
    554      
     578     
    555579      // 2.1b loop on all (activated) towers
    556580      // at this stage, list_of_active_towers may contain several times the same tower
     
    580604        } // loop on towers
    581605     
    582           // 2.1c photon ID
    583           // list_of_towers_with_photon is the list of towers with photon candidates
    584           // already smeared !
    585           // sorts the vector and smears duplicates
     606      // 2.1c photon ID
     607      // list_of_towers_with_photon is the list of towers with photon candidates
     608      // already smeared !
     609      // sorts the vector and smears duplicates
    586610      list_of_towers_with_photon.mergeDuplicates();
    587611      for(unsigned int i=0; i<list_of_towers_with_photon.size(); i++) {
    588612          float eta = list_of_towers_with_photon[i].getEta();
    589613          float phi = list_of_towers_with_photon[i].getPhi();
    590           D_CaloTower cal(list_of_active_towers.getElement(eta,phi));
     614          D_CaloTower cal(list_of_active_towers.getElement(eta,phi)); //// <---------- buh???????
    591615          if(cal.getEta() != UNDEFINED && cal.getPhi() != UNDEFINED &&  cal.getE() > 0)
    592616            {
     
    596620            }
    597621        } // for -- list of photons
    598      
     622
     623      // 2.1d jet-E-flow -- taking into account the neutrals within tracker
     624      if(DET->JET_Eflow) {
     625        list_of_centowers_with_neutrals.mergeDuplicates();
     626        for(unsigned int i=0; i<list_of_centowers_with_neutrals.size(); i++) {
     627             float eta = list_of_centowers_with_neutrals[i].getEta();
     628             float phi = list_of_centowers_with_neutrals[i].getPhi();
     629             D_CaloTower cal(list_of_active_towers.getElement(eta,phi));
     630             if(cal.getEta() != UNDEFINED && cal.getPhi() != UNDEFINED &&  cal.getE() > 0)
     631               {
     632                 TLorentzVector p;
     633                 p.SetPtEtaPhiE(cal.getET(), eta,phi,cal.getE() );
     634                 //cout << "**************list: " << p.Px() << " " << p.Py() << " " << p.Pz() << " " << p.E() << endl;
     635                 input_particles.push_back(fastjet::PseudoJet(p.Px(),p.Py(),p.Pz(),p.E()));
     636               }
     637         } // for - list_of_centowers
     638      } // JET_Eflow
     639
    599640      // 2.2 ********** Output preparation & complex objects  ***********
    600641      // 2.2.1 ********************* sorting collections by decreasing pt
     
    652693              // create a fastjet::PseudoJet with these components and put it onto
    653694              // back of the input_particles vector
    654               input_particles.push_back(fastjet::PseudoJet(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E));
     695              if(!DET->JET_Eflow)
     696                input_particles.push_back(fastjet::PseudoJet(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E));
     697              else { if(fabs(Att.Eta()) > DET->CEN_max_tracker)
     698                input_particles.push_back(fastjet::PseudoJet(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E));
     699              }
    655700            }
    656701        }
  • trunk/src/JetsUtil.cc

    r350 r384  
    134134      // sort jets into increasing pt
    135135      sorted_jets = sorted_by_pt(inclusive_jets);
    136 
    137136      //Bin tracks to make the link
    138137      float  iEtaTrack[TrackCentral.size()];
    139138      float  iPhiTrack[TrackCentral.size()];
    140139      for(unsigned int t = 0; t < TrackCentral.size(); t++)
    141          {
    142            DET->BinEtaPhi(TrackCentral[t].PhiOuter,TrackCentral[t].EtaOuter,iPhiTrack[t],iEtaTrack[t]);
    143          }
     140        {
     141          if(!DET->JET_Eflow)
     142            DET->BinEtaPhi(TrackCentral[t].PhiOuter,TrackCentral[t].EtaOuter,iPhiTrack[t],iEtaTrack[t]);
     143          else {
     144            iPhiTrack[t] = TrackCentral[t].PhiOuter;    iEtaTrack[t] = TrackCentral[t].EtaOuter;
     145          }
     146        }
    144147      int numTrackJet;
    145148      for (unsigned int i = 0; i < sorted_jets.size(); i++)
  • trunk/src/SmearUtil.cc

    r383 r384  
    577577    else if(strstr(temp_string.c_str(),"JET_jetalgo"))      {curstring >> varname >> ivalue;JET_jetalgo       = ivalue;}
    578578    else if(strstr(temp_string.c_str(),"JET_seed"))         {curstring >> varname >> value; JET_seed          = value;}
    579     else if(strstr(temp_string.c_str(),"JET_Eflow"))        {curstring >> varname >> value; JET_Eflow         = value;}
     579    else if(strstr(temp_string.c_str(),"JET_Eflow"))        {curstring >> varname >> ivalue; JET_Eflow        = ivalue;}
    580580 
    581581    else if(strstr(temp_string.c_str(),"BTAG_b"))           {curstring >> varname >> ivalue;BTAG_b            = ivalue;}
     
    638638  f_out <<"**                 of a  generic collider experiment                **"<< endl;
    639639  f_out <<"**                                                                  **"<< endl;
    640   f_out <<"**                --- Version 1.4beta of Delphes ---                **"<< endl;
    641   f_out <<"**               Last date of change: 9 February 2009               **"<< endl;
     640  f_out <<"**                --- Version 1.6 of Delphes ---                    **"<< endl;
     641  f_out <<"**               Last date of change: 7 May 2009                    **"<< endl;
    642642  f_out <<"**                                                                  **"<< endl;
    643643  f_out <<"**                                                                  **"<< endl;
Note: See TracChangeset for help on using the changeset viewer.