Atlfast::JetMaker Class Reference

Makes Atlfast::Jets from acceptable Atlfast::Clusters. More...

#include <JetMaker.h>

Collaboration diagram for Atlfast::JetMaker:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 JetMaker (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~JetMaker ()
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()
Jetcreate (ICluster *)
bool isAcceptable (Jet *)
void addMuons (Jet *, MuonCollection &)
MsgStream & dumpParameters (MsgStream &) const

Private Types

typedef std::vector< ICluster * > localClusterCollection
typedef localClusterCollection::iterator localClusterIterator
typedef std::vector< ReconstructedParticle * > MuonCollection
typedef MuonCollection::iterator MuonIterator

Private Member Functions

int getJetLabel (MCparticleCollection &mcParticles, Jet *jet, double maxDeltaR, double &deltaR) const
int getTauLabel (MCparticleCollection &mcParticles, Jet *jet, double maxDeltaR, double &deltaR) const
void label (Jet *jet, MCparticleCollection &mcParticles_b, MCparticleCollection &mcParticles_c, MCparticleCollection &mcParticles_tau) const
HepLorentzVector addCells (MsgStream &)
void getUnusedCells (std::vector< const ITwoCptCell * > &, MsgStream &)
void getIsolationCorrectionCells (std::vector< const ITwoCptCell * > &, std::vector< const ITwoCptCell * > &, std::string, MsgStream &)

Private Attributes

HepMC_helper::IMCselectorm_bSelector
HepMC_helper::IMCselectorm_cSelector
HepMC_helper::IMCselectorm_tauSelector
double m_minPT
double m_maxEta
bool m_doSmearing
double m_barrelForwardEta
double m_rconeb
double m_rconef
double m_bPtMin
double m_bMaxDeltaR
double m_cPtMin
double m_cMaxDeltaR
double m_tauPtMin
double m_tauMaxDeltaR
double m_etaTagMax
double m_tauJetPtRatio
bool m_adjustMissETForIsolation
double m_sumET
ISmearerm_smearer
ISmearerm_cellSmearer
TesIOm_tesIO
std::string m_mcLocation
std::string m_inputLocation
std::string m_outputLocation
std::string m_muonLocation
std::string m_unusedCellLocation
std::string m_missingMomentumLocation
std::string m_isolatedElectronLocation
std::string m_isolatedPhotonLocation
KinematicHelper m_kinehelp

Detailed Description

Makes Atlfast::Jets from acceptable Atlfast::Clusters.

Acceptability is based on ET and eta cuts. Once accepted as a jet, the energy is smeared. Initial labelling is performed by searching in the truth block for proximity to b, c and hadronic taus.

JetMaker.jpg

JetMaker sequence

Definition at line 102 of file JetMaker.h.


Member Typedef Documentation

typedef std::vector<ICluster*> Atlfast::JetMaker::localClusterCollection [private]

Definition at line 110 of file JetMaker.h.

typedef localClusterCollection::iterator Atlfast::JetMaker::localClusterIterator [private]

Definition at line 111 of file JetMaker.h.

typedef std::vector<ReconstructedParticle*> Atlfast::JetMaker::MuonCollection [private]

Definition at line 112 of file JetMaker.h.

typedef MuonCollection::iterator Atlfast::JetMaker::MuonIterator [private]

Definition at line 113 of file JetMaker.h.


Constructor & Destructor Documentation

Atlfast::JetMaker::JetMaker ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Athena-Algorithm Constructor

Definition at line 89 of file JetMaker.cxx.

00090     : Algorithm( name, pSvcLocator ),
00091       m_bSelector(0),
00092       m_cSelector(0),
00093       m_tauSelector(0),
00094       m_smearer(0),
00095       m_cellSmearer(0),
00096       m_tesIO(0)
00097   {
00098     
00099     // Setting the parameter defaults.
00100     m_minPT            = 10*GeV;     // Min jet trans momentum
00101     m_maxEta           = 5.0;          //Max jet eta 
00102     m_doSmearing       = true;       //smearing is done
00103     m_rconeb           = 0.400;
00104     m_rconef           = 0.400;
00105     
00106     m_bPtMin           = 5.0*GeV;    //min pt for bquark to label jet
00107     m_bMaxDeltaR       = 0.3;        //max dR for bquark to label jet
00108     
00109     m_cPtMin           = 5.0*GeV;    //min pt for cquark to label jet
00110     m_cMaxDeltaR       = 0.3;
00111     
00112     m_tauPtMin         = 10.0*GeV;
00113     m_tauMaxDeltaR     = 0.3;
00114     
00115     m_etaTagMax        = 2.5;
00116 
00117     m_tauJetPtRatio    = 0;
00118     
00119     m_adjustMissETForIsolation = true;
00120 
00121     // Default paths for entities in the TES
00122     m_inputLocation             = "/Event/AtlfastClusters";
00123     m_outputLocation            = "/Event/AtlfastJets";
00124     m_muonLocation              = "/Event/AtlfastNonIsolatedMuons";
00125     m_unusedCellLocation        = "/Event/AtlfastUnusedCells";
00126     m_missingMomentumLocation   = "/Event/AtlfastMissingMomentum";
00127     m_isolatedElectronLocation  = "/Event/AtlfastIsolatedElectrons";
00128     m_isolatedPhotonLocation    = "/Event/AtlfastIsolatedPhotons";
00129     
00130     // This is how you declare the paramemters to Gaudi so that
00131     // they can be over-written via the job options file
00132     declareProperty( "MinimumPT",                m_minPT ) ;
00133     declareProperty( "MaximumEta",               m_maxEta ) ;
00134     declareProperty( "DoSmearing",               m_doSmearing ); 
00135     declareProperty( "RconeB",                   m_rconeb );
00136     declareProperty( "RconeF",                   m_rconef );
00137     declareProperty( "bPtMin",                   m_bPtMin );
00138     declareProperty( "bMaxDeltaR",               m_bMaxDeltaR );
00139     declareProperty( "cPtMin",                   m_cPtMin );
00140     declareProperty( "cMaxDeltaR",               m_cMaxDeltaR );
00141     declareProperty( "tauPtMin",                 m_tauPtMin );
00142     declareProperty( "tauMaxDeltaR",             m_tauMaxDeltaR );
00143     declareProperty( "etaTagMax",                m_etaTagMax );
00144     declareProperty( "tauJetPtRatio",            m_tauJetPtRatio);
00145     declareProperty( "adjustMissETForIsolation", m_adjustMissETForIsolation);
00146 
00147     declareProperty( "InputLocation",            m_inputLocation ) ;
00148     declareProperty( "OutputLocation",           m_outputLocation ) ;
00149     declareProperty( "UnusedCellLocation",       m_unusedCellLocation ) ;
00150     declareProperty( "MuonLocation",             m_muonLocation );
00151     declareProperty( "MissingMomentumLocation",  m_missingMomentumLocation );
00152     declareProperty( "IsolatedElectronLocation", m_isolatedElectronLocation );
00153     declareProperty( "IsolatedPhotonLocation",   m_isolatedPhotonLocation );
00154 
00155   }

Atlfast::JetMaker::~JetMaker (  )  [virtual]

Default Destructor

Definition at line 157 of file JetMaker.cxx.

00157                       {
00158     
00159     MsgStream log( messageService(), name() ) ;
00160     log << MSG::INFO << "Destructor Called" << endreq;
00161     
00162     if (m_smearer) {
00163       log << MSG::INFO << "Deleting jet Smearer" << endreq;
00164       delete m_smearer;
00165     }
00166     if (m_cellSmearer) {
00167       log << MSG::INFO << "Deleting Cell Smearer" << endreq;
00168       delete m_cellSmearer;
00169     }
00170     if (m_tesIO) {
00171       delete m_tesIO;
00172     }
00173   } 


Member Function Documentation

int Atlfast::JetMaker::getJetLabel ( MCparticleCollection mcParticles,
Jet jet,
double  maxDeltaR,
double &  deltaR 
) const [private]

Definition at line 603 of file JetMaker.cxx.

00606                                                   {
00607     
00608     MsgStream log( messageService(), name() ) ;
00609 
00610     int pdgId    = 0;
00611     double drMin = 999.;
00612     
00613     //Construct an object to select IKinematics within DeltaR of the current jet
00614     PartitionCondition::BelowThresholdDeltaR labelSelector(jet, maxDeltaR); 
00615     MCparticleCollectionCIter src ;
00616     for( src = mcParticles.begin(); src != mcParticles.end(); ++src ){
00617       SimpleKinematic sk(*src);
00618       if(labelSelector(sk)){
00619         pdgId = (*src)->pdg_id();
00620       }      
00621       Phi dPhi( sk.phi() - jet->phi() );
00622       double dR = sqrt((dPhi*dPhi) + 
00623                        (sk.eta()-jet->eta())*(sk.eta()-jet->eta()));
00624       if (dR < drMin) drMin = dR;
00625     }
00626     deltaR = drMin;
00627     return pdgId;
00628   }

int Atlfast::JetMaker::getTauLabel ( MCparticleCollection mcParticles,
Jet jet,
double  maxDeltaR,
double &  deltaR 
) const [private]

Definition at line 632 of file JetMaker.cxx.

00635                                                   {
00636     
00637     MsgStream log( messageService(), name() ) ;
00638     
00639     int pdgId    = 0;
00640     double drMin = 999.;
00641 
00642     //Construct an object to select IKinematics within DeltaR of the current jet
00643     PartitionCondition::BelowThresholdDeltaR labelSelector(jet, maxDeltaR);
00644     MCparticleCollectionCIter src ;
00645     for( src = mcParticles.begin() ; src != mcParticles.end() ; ++src )
00646       {
00647         HepLorentzVector tauHlv = (*src)->momentum();
00648         HepLorentzVector neuHlv;
00649 
00650         // Find Tau children
00651         HepMC::GenVertex*  endVertex = (*src)->end_vertex();
00652         if(!endVertex) continue;
00653 
00654         HepMC::GenVertex::particle_iterator firstChild = 
00655           endVertex->particles_begin(HepMC::children);
00656         
00657         HepMC::GenVertex::particle_iterator endChild = 
00658           endVertex->particles_end(HepMC::children);
00659         
00660         HepMC::GenVertex::particle_iterator thisChild = firstChild; 
00661         
00662         // Find Pt of Taus tau-neutrino
00663         for(; thisChild!=endChild; ++thisChild){
00664           if(  abs((*thisChild)->pdg_id()) == 16){
00665             neuHlv = (*thisChild)->momentum();
00666           }
00667         }
00668         double sigma;
00669         double sqrtene = sqrt(jet->momentum().e()/GeV);
00670         if ( fabs(jet->eta()) < m_barrelForwardEta )
00671           sigma = 0.5/sqrtene;
00672         else
00673           sigma = 1.0/sqrtene;
00674 
00675         double cutQuantity = (m_tauJetPtRatio) ? m_tauJetPtRatio : 1.0 - 2*sigma;
00676 
00677         log << MSG::DEBUG << "m_tauJetPtRatio = " << m_tauJetPtRatio
00678             << ", cutQuantity = " << cutQuantity << endreq;
00679 
00680         HepMC::GenParticle trueHadSystem;
00681         trueHadSystem.set_momentum(tauHlv-neuHlv); 
00682         SimpleKinematic sk(trueHadSystem);
00683         if (labelSelector(sk) &&
00684             (tauHlv-neuHlv).perp()/jet->pT() >= cutQuantity){
00685           Phi dPhi( sk.phi() - jet->phi() );
00686           deltaR = sqrt((dPhi*dPhi) +
00687                         (sk.eta()-jet->eta())*(sk.eta()-jet->eta()));
00688           pdgId = (*src)->pdg_id();
00689         }
00690         Phi dPhi( sk.phi() - jet->phi() );
00691         double dR = sqrt((dPhi*dPhi) + 
00692                          (sk.eta()-jet->eta())*(sk.eta()-jet->eta()));
00693         if (dR < drMin) drMin = dR;
00694       }
00695     
00696     deltaR = drMin;
00697     return pdgId;
00698   }   

void Atlfast::JetMaker::label ( Jet jet,
MCparticleCollection mcParticles_b,
MCparticleCollection mcParticles_c,
MCparticleCollection mcParticles_tau 
) const [private]

Definition at line 562 of file JetMaker.cxx.

00565                                                                    {
00566     
00567     MsgStream log( messageService(), name() ) ;
00568     
00569     double dR = 0.;
00570 
00571     // The getJetLabel and getTauLabel functions loop over the input particle collections
00572     // and return the PDGID of a particle if within maxdeltaR of the jet (0 otherwise). 
00573     // dR is also set to the lowest found particle-jet delta R value
00574 
00575     int bLabel = getJetLabel(mcParticles_b, jet, m_bMaxDeltaR, dR);
00576     jet->setdRbquark(dR);
00577     int cLabel = getJetLabel(mcParticles_c, jet, m_cMaxDeltaR, dR);
00578     jet->setdRcquark(dR);
00579     int tauLabel = getTauLabel( mcParticles_tau, jet, m_tauMaxDeltaR, dR);
00580     jet->setdRhadtau(dR);
00581 
00582     // Set jet label (order dependent)
00583     if(bLabel){
00584       jet->setPdg_id(bLabel);
00585       return;
00586     }
00587     if(cLabel){
00588       jet->setPdg_id(cLabel);
00589       return;
00590     }
00591     if(tauLabel){
00592       jet->setPdg_id(tauLabel);
00593       return;
00594     }
00595 
00596     jet->setPdg_id(0);
00597     return; 
00598 
00599   }

HepLorentzVector Atlfast::JetMaker::addCells ( MsgStream &   )  [private]

Definition at line 700 of file JetMaker.cxx.

00700                                                    {
00701     
00702     std::vector<const ITwoCptCell*> cellsToSmear(0);
00703     std::vector<const ITwoCptCell*> newCellsVector(0);
00704     
00705     getUnusedCells(cellsToSmear,log);
00706     
00707     if (m_adjustMissETForIsolation){
00708       getIsolationCorrectionCells(cellsToSmear,newCellsVector,m_isolatedElectronLocation,log);
00709       getIsolationCorrectionCells(cellsToSmear,newCellsVector,m_isolatedPhotonLocation,log);
00710     }
00711     
00712     log << MSG::DEBUG << "Smearing a total of " << cellsToSmear.size() << " cells" << endreq;
00713     log << MSG::DEBUG << "sumET before adding cells: " << m_sumET << endreq;
00714     
00715     // accumulate used to compute vectorial sum of Cell HepLorentzVectors
00716     // m_sumET also passed into SmearCell to compute sum of smeared cell ETs
00717     HepLorentzVector temp(0., 0., 0., 0.);
00718     HepLorentzVector sum = std::accumulate(cellsToSmear.begin(),
00719                                            cellsToSmear.end(),
00720                                            temp,
00721                                            SmearCell(m_cellSmearer,&m_sumET));
00722     //if (eHitCellPtr) delete eHitCellPtr;
00723 
00724     std::vector<const ITwoCptCell*>::iterator itccItr   = newCellsVector.begin();
00725     std::vector<const ITwoCptCell*>::iterator itccItrE  = newCellsVector.end();
00726 
00727     for (;itccItr!=itccItrE;++itccItr) delete *itccItr;
00728     newCellsVector.clear();
00729 
00730     return sum;
00731   }

void Atlfast::JetMaker::getUnusedCells ( std::vector< const ITwoCptCell * > &  ,
MsgStream &   
) [private]

Definition at line 733 of file JetMaker.cxx.

00733                                                                                           {
00734     
00735     std::vector<const TwoCptCell*> unusedCells(0);
00736     if( !m_tesIO->copy<std::vector<const TwoCptCell*> >(unusedCells,
00737                                                         m_unusedCellLocation)){
00738       log << MSG::INFO << "No unused cells  in TES " << endreq;
00739       return;
00740     }
00741     
00742     log << MSG::DEBUG << unusedCells.size() << " unused cells in TES" << endreq;
00743     
00744     std::copy(unusedCells.begin(),unusedCells.end(),std::back_inserter(cellsToSmear));
00745     
00746     log << MSG::DEBUG  << "Added " << unusedCells.size() << " unused cells to cellToSmear" << endreq;
00747     
00748     return;
00749     
00750   }

void Atlfast::JetMaker::getIsolationCorrectionCells ( std::vector< const ITwoCptCell * > &  ,
std::vector< const ITwoCptCell * > &  ,
std::string  ,
MsgStream &   
) [private]

Definition at line 752 of file JetMaker.cxx.

00755                                                             {
00756     
00757     
00758     std::vector<const ITwoCptCell*> isolationCorrectionCells(0);
00759     
00760     const ReconstructedParticleCollection* dh(0);
00761     if( !m_tesIO->getDH(dh, tesAddress) ) throw "Error in numberInList";
00762     
00763     ReconstructedParticleCollection::const_iterator iter = dh->begin();
00764     
00765     for (; iter != dh->end(); ++iter){
00766       
00767       const HepMC::GenParticle* gp = (*iter)->truth();
00768 
00769       // Get associations of ReconstructedParticle associations 
00770       const IAOO* iaooRP = (*iter);
00771       TypeVisitor tv =
00772         ContainerAssocsDispatcher( iaooRP->begin(), iaooRP->end(), TypeVisitor() );
00773       
00774       // Select the TwoCptCells
00775       std::vector<const TwoCptCell*> tccv = tv.typeVector(TwoCptCell());
00776       log << MSG::DEBUG << "TypeVisitor found " << tccv.size() 
00777           << " TwoCptCells in this cluster" << endreq;
00778       
00779       std::vector<const TwoCptCell*>::iterator tccvi;
00780 
00781       for ( tccvi = tccv.begin(); tccvi != tccv.end();){
00782         const ICell* ic = (*tccvi);
00783 
00784         // See if this TwoCptCell contains the GenParticle that made the
00785         // original ReconstructedParticle
00786         std::vector<const GenParticle*> gpv = ic->particles();
00787         std::vector<const GenParticle*>::iterator gpi;
00788         gpi = std::find(gpv.begin(),gpv.end(),gp);
00789 
00790         if ( gpi == gpv.end() ) ++tccvi;     // If not, go onto next TwoCptCell
00791         else{                                // It's in this one
00792           log << MSG::DEBUG << "GenParticle found in this cell, one of " 
00793               << gpv.size() << " GenParticles" << endreq;
00794           log << MSG::DEBUG << "GenParticle momentum = " << (*gpi)->momentum() << endreq;
00795           log << MSG::DEBUG << "Cell momentum = " << ic->momentum() << endreq;
00796 
00797           if ( gpv.size() > 1){
00798             // Make a new cell with pT reduced by that of the originating GenParticle
00799             ITwoCptCell* newcell_itcc = (*tccvi)->cloneITCC();
00800             newcell_itcc->resetCell();
00801             ICell* newcell = newcell_itcc;
00802             double newpT = ic->momentum().perp() - (*gpi)->momentum().perp();
00803             newpT = ( fabs(newpT) < 1e-10 ) ? 0 : newpT; // problem with precision
00804             newcell->newHit( newpT );
00805             
00806             // Add the new, adjusted hit cell
00807             isolationCorrectionCells.push_back(newcell_itcc);
00808             newcellsVector.push_back(newcell_itcc);
00809           }
00810           
00811           // Remove the pointer to the hit cell
00812           tccvi = tccv.erase(tccvi);
00813           
00814         }
00815       }
00816       // After adjustment, copy all cells into isolationCorrectionCells
00817       std::copy(tccv.begin(),tccv.end(),std::back_inserter(isolationCorrectionCells));
00818     }
00819     
00820     log << MSG::DEBUG << "Added " << isolationCorrectionCells.size() 
00821         << " isolation correction cells to cellsToSmear" << endreq;
00822    
00823     // Add isolationCorrectionCells cells to vector of cells for smearing
00824     std::copy(isolationCorrectionCells.begin(),
00825               isolationCorrectionCells.end(),
00826               std::back_inserter(cellsToSmear));
00827     
00828     return;
00829     
00830   }

StatusCode Atlfast::JetMaker::initialize (  ) 

Standard Athena-Algorithm method

Definition at line 179 of file JetMaker.cxx.

00179                                  {
00180     MsgStream log( messageService(), name() ) ;
00181     
00182     log << MSG::DEBUG << "instantiating a JetSmearer" << endreq;
00183     
00184     
00185     //get the Global Event Data using singleton pattern
00186     GlobalEventData* ged = GlobalEventData::Instance();
00187     int lumi                  = ged->lumi();
00188     int randSeed              = ged->randSeed() ;
00189     m_barrelForwardEta        = ged->barrelForwardEta();
00190     m_mcLocation              = ged->mcLocation();
00191 
00192     // Pass this into GlobalEventData for EventHeaderMaker to read later
00193     ged->set_adjustMissEtForIsolation(m_adjustMissETForIsolation);
00194 
00195     //    m_tesIO = new TesIO(eventDataService());
00196     m_tesIO = new TesIO(m_mcLocation, ged->justHardScatter());
00197     
00198     if(m_doSmearing){
00199       m_smearer                 = new JetSmearer(randSeed, 
00200                                                  lumi,
00201                                                  m_rconeb, 
00202                                                  m_rconef, 
00203                                                  m_barrelForwardEta);    
00204       m_cellSmearer             = new JetSmearer(randSeed, 
00205                                                  lumi,
00206                                                  0., 
00207                                                  0., 
00208                                                  m_barrelForwardEta);    
00209     } else {
00210       m_smearer = NULL;
00211       m_cellSmearer = NULL;
00212     }
00213 
00214     const int BQUARK(ParticleCodes::BQUARK);
00215     const int CQUARK(ParticleCodes::CQUARK);
00216 
00217     //.........................................................
00218     // Construct objects to select b, c and tau quarks with kine conditions
00219     
00220     HepMC_helper::IMCselector* selector;
00221     
00222     std::vector<HepMC_helper::IMCselector*> bSelectors;
00223     selector = new HepMC_helper::IsFromHardScatter();
00224     bSelectors.push_back( selector );
00225     selector = new HepMC_helper::SelectJetTag(BQUARK, m_bPtMin, m_etaTagMax);
00226     bSelectors.push_back( selector );
00227     m_bSelector = new HepMC_helper::NCutter(bSelectors);
00228 
00229     std::vector<HepMC_helper::IMCselector*> cSelectors;
00230     selector = new HepMC_helper::IsFromHardScatter();
00231     cSelectors.push_back( selector );
00232     selector = new HepMC_helper::SelectJetTag(CQUARK, m_cPtMin, m_etaTagMax);
00233     cSelectors.push_back( selector );
00234     m_cSelector = new HepMC_helper::NCutter(cSelectors);
00235 
00236     std::vector<HepMC_helper::IMCselector*> tauSelectors;
00237     selector = new HepMC_helper::IsFromHardScatter();
00238     tauSelectors.push_back( selector );
00239     selector = new HepMC_helper::SelectTauTag(m_tauPtMin, m_etaTagMax);
00240     tauSelectors.push_back( selector );
00241     m_tauSelector = new HepMC_helper::NCutter(tauSelectors);
00242 
00243     //.........................................................
00244     // Tidy up selectors
00245     std::vector<HepMC_helper::IMCselector*>::iterator iter;
00246     for(iter=bSelectors.begin();   iter!=bSelectors.end();   delete *iter, ++iter);
00247     for(iter=cSelectors.begin();   iter!=cSelectors.end();   delete *iter, ++iter);
00248     for(iter=tauSelectors.begin(); iter!=tauSelectors.end(); delete *iter, ++iter);
00249     
00250     
00251 
00252     HeaderPrinter hp("Atlfast JetMaker:", log);
00253     
00254     hp.add("TES Locations:              ");
00255     hp.add(" Muons from                 ", m_muonLocation); 
00256     hp.add(" Clusters from              ", m_inputLocation); 
00257     hp.add(" MC Input Location          ", m_mcLocation);
00258     hp.add(" Jets to                    ", m_outputLocation);
00259     hp.add(" unused cell,cluster sum to ", m_missingMomentumLocation);
00260     hp.add("Smearing on                 ", m_doSmearing);
00261     hp.add("Cluster min Pt              ", m_minPT);
00262     hp.add("Cluster max Eta             ", m_maxEta);           
00263     hp.add("Luminosity                  ", lumi);
00264     hp.add("Initial random seed         ", randSeed);      
00265     hp.add("End cap Cone size           ", m_rconef);
00266     hp.add("Barrel  Cone size           ", m_rconeb);
00267     hp.add("Eta of start of end cap     ", m_barrelForwardEta);
00268     hp.add("Parameters for labels       ", "       ");
00269     hp.add(" Max eta                    ", m_etaTagMax);
00270     hp.add(" b-quark min pt             ", m_bPtMin);
00271     hp.add(" b-quark max DeltaR         ", m_bMaxDeltaR);
00272     hp.add(" c-quark min pt             ", m_cPtMin);
00273     hp.add(" c-quark max DeltaR         ", m_cMaxDeltaR);
00274     hp.add(" tau lep min pt             ", m_tauPtMin);
00275     hp.add(" tau lep max DeltaR         ", m_tauMaxDeltaR);
00276     hp.add(" tau/Jet Pt Ratio           ", m_tauJetPtRatio);
00277     hp.print();
00278     
00279 
00280 
00281     return StatusCode::SUCCESS ;
00282   }

StatusCode Atlfast::JetMaker::execute (  ) 

Standard Athena-Algorithm method

Definition at line 317 of file JetMaker.cxx.

00317                                {
00318     
00319     MsgStream log( messageService(), name() ) ;    
00320 
00321     std::string mess;
00322     // make a message logging stream
00323     
00324     //.............................
00325     // Make some locals stores which be used to keep pointers to
00326     // all of the entities from the event store which are needed by
00327     // this algorithm. These are all local and are typedefed in this class
00328     
00329     localClusterCollection      my_Clusters ;
00330     MuonCollection              my_Muons ;
00331     //................................
00332     
00333     //    if( ! m_tesIO->copy( my_Clusters, m_inputLocation ) ) {
00334     if( ! m_tesIO->copy<IClusterCollection> ( my_Clusters, m_inputLocation ) ) {
00335       log << MSG::INFO << "No Clusters in TES " << endreq;
00336     } else {
00337       log << MSG::DEBUG << my_Clusters.size()<<" Clusters from TES " << endreq;
00338     }
00339     // get non-isolated muons for jet construction
00340     
00341     if( ! m_tesIO->copy<ReconstructedParticleCollection>
00342         ( my_Muons, m_muonLocation ) ) {
00343       log << MSG::DEBUG << "No muons in TES " << endreq;
00344     }  
00345 
00346     // ......................
00347     // Make a container object which will store pointers to all isolated 
00348     // Jetss which are successfully created.  Since it is going to go 
00349     // into the event store, it has to be a special Gaudi type of container. 
00350     // This is typedefined in the entity include file
00351     // As it is going into the TES it needs to be created on the heap with new.
00352     
00353     JetCollection* myJets = new JetCollection ;
00354     
00355     //.........................................................
00356     // From each Cluster create a reconstructed Jet. 
00357     // If all requirements are satisfied add to the collection
00358     
00359     Jet* candidate ;
00360     localClusterIterator src ;
00361     m_sumET = 0.;
00362     HepLorentzVector missingMomentum(0.,0.,0.,0.);
00363     
00364     MCparticleCollection  mcParticles_b ;
00365     MCparticleCollection  mcParticles_c ;
00366     MCparticleCollection  mcParticles_tau ;
00367 
00368     //.........................................................
00369     // Get quarks used in tagging from TES using tesio
00370 
00371     TesIoStat stat = m_tesIO->getMC( mcParticles_b, m_bSelector ) ;
00372     if(!stat){
00373       log << MSG::ERROR <<"Problem getting b-quarks" << endreq; 
00374       return stat;
00375     }
00376     stat = m_tesIO->getMC( mcParticles_c, m_cSelector ) ;
00377     if(!stat){
00378       log << MSG::ERROR <<"Problem getting c-quarks" << endreq; 
00379       return stat;
00380     }
00381     stat = m_tesIO->getMC( mcParticles_tau, m_tauSelector ) ;
00382     if(!stat){
00383       log << MSG::ERROR <<"Problem getting taus" << endreq; 
00384       return stat;
00385     }
00386  
00387     for( src = my_Clusters.begin() ; src != my_Clusters.end() ; ++src ) { 
00388       //
00389       //      ReconstructedParticle rp;
00390       //      std::vector<IAOO*> v;
00391       //      v.push_back(*src);
00392       //      AssocTypeRecoverer atr(v.begin(), v.end());
00393       //      if ((atr.typeVector(rp))->size() == 0){
00394       if ( !IsAssociated<ReconstructedParticle>( *src ) ){
00395         // Make a new jet
00396         candidate = this->create( *src );
00397         
00398         //Make a temp HepLorentzVector from candidates 4-mom
00399         //before muon is added in
00400         HepLorentzVector temp4Vec = candidate->momentum();
00401         
00402         // add isolated muons
00403         this->addMuons(candidate, my_Muons);
00404         
00405         
00406         // add to missing momentum vector if not used in a jet.
00407         // remember, these are smeared momenta if smearing is enabled
00408         if( this->isAcceptable( candidate ) ) {    
00409           
00410           // if the jet is acceptable label the jet
00411           this->label(candidate,mcParticles_b,mcParticles_c,mcParticles_tau);
00412           
00413           log << MSG::DEBUG << "Pushing back a Jet" << endreq;
00414           myJets->push_back( candidate ) ; 
00415           log<<MSG::DEBUG<<"jet "<<*candidate<<endreq;
00416         }else {
00417           log << MSG::DEBUG << "Jet fails cuts" << endreq;
00418           //add in temp4Vec to avoid muon double counting
00419           missingMomentum += temp4Vec;
00420           m_sumET += temp4Vec.perp();
00421           delete candidate;
00422         }
00423       }else{
00424         log << MSG::DEBUG << "Cluster is associated, so ignored" << endreq;
00425       }
00426     }
00427     
00428     log<<MSG::DEBUG<<"Missing momentum: clusters "<<missingMomentum<<endreq;
00429     missingMomentum += addCells(log);
00430     log << MSG::DEBUG << "sumET after adding cells: " << m_sumET << endreq;
00431     log<<MSG::DEBUG<<"Missing momentum: cells+clstrs "
00432        <<missingMomentum<<endreq;
00433 
00434     //......................................
00435     // Register any Jets which have been successfilly created in the 
00436     // transient event store. Allow modification further along the line
00437     // for tagging routines.
00438     log<<MSG::DEBUG<<"Storing "<< myJets->size() <<" Jets"<<endreq;
00439     stat = m_tesIO->store( myJets, m_outputLocation, true) ;
00440     if(!stat){
00441       log<<MSG::ERROR<<"Could not store jets"<<endreq;
00442       return stat;
00443     }
00444 
00445 
00446     MissingMomentum* mm = new MissingMomentum(missingMomentum,m_sumET);
00447     stat = m_tesIO->store(mm,m_missingMomentumLocation ) ;
00448     std::string message = stat? "Stored missing mom":"Failed to store missing mom";
00449     log<<MSG::DEBUG<<message<<endreq;
00450   
00451 
00452     return StatusCode::SUCCESS;
00453   }

StatusCode Atlfast::JetMaker::finalize (  ) 

Standard Athena-Algorithm method

Definition at line 288 of file JetMaker.cxx.

00288                                {
00289 
00290     MsgStream log( messageService(), name() ) ;
00291     log << MSG::INFO << "finalizing" << endreq;    
00292 
00293     if (m_bSelector)    delete m_bSelector;
00294     if (m_cSelector)    delete m_cSelector;
00295     if (m_tauSelector)  delete m_tauSelector;
00296 
00297     return StatusCode::SUCCESS ;
00298   }

Jet * Atlfast::JetMaker::create ( ICluster  ) 

Takes a single Cluster and smears it to create a Jet

Definition at line 468 of file JetMaker.cxx.

00469   {
00470     Jet* jet;
00471     MsgStream log( messageService(), name() ) ;
00472     HepLorentzVector vec = src->momentum();
00473     
00474     if (m_doSmearing) 
00475       {
00476         // Ask our Smearer make a smeared 4-vector
00477         vec = m_smearer->smear(vec);      
00478       }
00479     
00480     jet = new Jet(vec, *src);
00481     log << MSG::DEBUG << "Unsmeared Cluster: " << *src << endreq;
00482     log << MSG::DEBUG << "Smeared Jet      : " << jet << endreq ;
00483     
00484     //IAOO* js = jet;
00485     //assert(!js->unAssociated());
00486     // return Jet
00487     return jet;
00488     
00489     
00490   }

bool Atlfast::JetMaker::isAcceptable ( Jet  ) 

Decides whether a candidate jet passes ET and eta cuts

Definition at line 534 of file JetMaker.cxx.

00535   {
00536     
00537     MsgStream log( messageService(), name() ) ;
00538     
00539     // Apply kinematic criteria to the candidate jet
00540     
00541     if( candidate->pT() < m_minPT ) {        
00542       log << MSG::DEBUG << "Candidate failed pt cut: pt " << candidate->pT() 
00543           << " min was " << m_minPT << endreq;
00544       return false ;
00545     }
00546     
00547     if( abs(candidate->eta()) > m_maxEta ) {
00548       log << MSG::DEBUG << "Candidate failed max eta cut: eta " 
00549           << candidate->eta() 
00550           << " max was " << m_maxEta << endreq;
00551       return false ;
00552     }
00553     
00554     return true ;
00555   }

void Atlfast::JetMaker::addMuons ( Jet ,
MuonCollection  
)

Adds non-isolated muons to the jets

Definition at line 497 of file JetMaker.cxx.

00498   {
00499     
00500     MsgStream log( messageService(), name() ) ;
00501     
00502     if (muons.size() == 0) return;
00503     
00504     MuonIterator first = muons.begin() ;
00505     MuonIterator last  = muons.end() ;
00506     
00507     // Partition muons to get those that satisfy the dR condition in either eta region
00508     MuonIterator partitionLast = 
00509       partition(first,last,PartitionCondition::BelowThresholdDeltaR(jet,m_rconeb,m_rconef,m_barrelForwardEta));
00510     
00511     if (partitionLast == first){
00512       log << MSG::DEBUG << "No muons in R cone" << endreq;
00513       return;
00514     }
00515 
00516     log << MSG::DEBUG << "Adding " << partitionLast-first << " muons to Jet" << endreq;
00517 
00518     // Add muon momenta to jet
00519     for (MuonIterator muItr = first; muItr != partitionLast;++muItr) jet->addMuon(*muItr);
00520     
00521     // Remove muons from list
00522     muons.erase(first,partitionLast);
00523     
00524   }

MsgStream& Atlfast::JetMaker::dumpParameters ( MsgStream &   )  const

Dump jet parameters (not implemented)


Member Data Documentation

HepMC_helper::IMCselector* Atlfast::JetMaker::m_bSelector [private]

Definition at line 119 of file JetMaker.h.

HepMC_helper::IMCselector* Atlfast::JetMaker::m_cSelector [private]

Definition at line 120 of file JetMaker.h.

HepMC_helper::IMCselector* Atlfast::JetMaker::m_tauSelector [private]

Definition at line 121 of file JetMaker.h.

double Atlfast::JetMaker::m_minPT [private]

Definition at line 129 of file JetMaker.h.

double Atlfast::JetMaker::m_maxEta [private]

Definition at line 130 of file JetMaker.h.

bool Atlfast::JetMaker::m_doSmearing [private]

Definition at line 131 of file JetMaker.h.

double Atlfast::JetMaker::m_barrelForwardEta [private]

Definition at line 133 of file JetMaker.h.

double Atlfast::JetMaker::m_rconeb [private]

Definition at line 134 of file JetMaker.h.

double Atlfast::JetMaker::m_rconef [private]

Definition at line 135 of file JetMaker.h.

double Atlfast::JetMaker::m_bPtMin [private]

Definition at line 137 of file JetMaker.h.

double Atlfast::JetMaker::m_bMaxDeltaR [private]

Definition at line 138 of file JetMaker.h.

double Atlfast::JetMaker::m_cPtMin [private]

Definition at line 139 of file JetMaker.h.

double Atlfast::JetMaker::m_cMaxDeltaR [private]

Definition at line 140 of file JetMaker.h.

double Atlfast::JetMaker::m_tauPtMin [private]

Definition at line 141 of file JetMaker.h.

double Atlfast::JetMaker::m_tauMaxDeltaR [private]

Definition at line 142 of file JetMaker.h.

double Atlfast::JetMaker::m_etaTagMax [private]

Definition at line 143 of file JetMaker.h.

double Atlfast::JetMaker::m_tauJetPtRatio [private]

Definition at line 144 of file JetMaker.h.

bool Atlfast::JetMaker::m_adjustMissETForIsolation [private]

Definition at line 146 of file JetMaker.h.

double Atlfast::JetMaker::m_sumET [private]

Definition at line 149 of file JetMaker.h.

ISmearer* Atlfast::JetMaker::m_smearer [private]

Definition at line 157 of file JetMaker.h.

ISmearer* Atlfast::JetMaker::m_cellSmearer [private]

Definition at line 158 of file JetMaker.h.

TesIO* Atlfast::JetMaker::m_tesIO [private]

Definition at line 161 of file JetMaker.h.

std::string Atlfast::JetMaker::m_mcLocation [private]

Definition at line 163 of file JetMaker.h.

std::string Atlfast::JetMaker::m_inputLocation [private]

Definition at line 171 of file JetMaker.h.

std::string Atlfast::JetMaker::m_outputLocation [private]

Definition at line 172 of file JetMaker.h.

std::string Atlfast::JetMaker::m_muonLocation [private]

Definition at line 173 of file JetMaker.h.

std::string Atlfast::JetMaker::m_unusedCellLocation [private]

Definition at line 174 of file JetMaker.h.

std::string Atlfast::JetMaker::m_missingMomentumLocation [private]

Definition at line 175 of file JetMaker.h.

std::string Atlfast::JetMaker::m_isolatedElectronLocation [private]

Definition at line 176 of file JetMaker.h.

std::string Atlfast::JetMaker::m_isolatedPhotonLocation [private]

Definition at line 177 of file JetMaker.h.

KinematicHelper Atlfast::JetMaker::m_kinehelp [private]

Definition at line 183 of file JetMaker.h.


The documentation for this class was generated from the following files:
Generated on Mon Sep 24 14:19:40 2007 for AtlfastAlgs by  doxygen 1.5.1