Changeset 11 for trunk/modules


Ignore:
Timestamp:
Sep 11, 2008, 1:41:12 PM (16 years ago)
Author:
Pavel Demin
Message:

add SISCone jet algorithm and update names for ConeJetFinder modules

Location:
trunk/modules
Files:
4 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/MadGraphPartonSelector.cc

    r2 r11  
    3333
    3434  void InsertParticleID(Int_t pid);
    35   void InsertAncestorID(Int_t pid);
     35  void InsertExclAncestorID(Int_t pid);
     36  void InsertInclAncestorID(Int_t pid);
    3637
    3738private:
    3839
    3940  Bool_t hasBadAncestor(ExRootGenParticle *object);
     41  Bool_t hasGoodAncestor(ExRootGenParticle *object);
    4042
    4143  TClonesArray *fBranchParticle;
    4244
    4345  set< Int_t > fParticleIDSet;
    44   set< Int_t > fAncestorIDSet;
     46  set< Int_t > fExclAncestorIDSet;
     47  set< Int_t > fInclAncestorIDSet;
    4548};
    4649
     
    6164//------------------------------------------------------------------------------
    6265
    63 void MadGraphPartonClassifier::InsertAncestorID(Int_t pid)
    64 {
    65   fAncestorIDSet.insert(pid);
     66void MadGraphPartonClassifier::InsertExclAncestorID(Int_t pid)
     67{
     68  fExclAncestorIDSet.insert(pid);
     69}
     70
     71//------------------------------------------------------------------------------
     72
     73void MadGraphPartonClassifier::InsertInclAncestorID(Int_t pid)
     74{
     75  fInclAncestorIDSet.insert(pid);
    6676}
    6777
     
    7686  set< Int_t >::const_iterator itParticleIDSet;
    7787
     88  // keep all particles if there is no pid in the list
     89  if(fExclAncestorIDSet.empty())
     90  {
     91    return kFALSE;
     92  }
     93
    7894  for(i = 0; i < kMaxAncestors; ++i)
    7995  {
     
    90106
    91107    // skip particles with pid included in list
    92     itAncestorIDSet = fAncestorIDSet.find(pidAbs);
    93 
    94     if(itAncestorIDSet != fAncestorIDSet.end()) return kTRUE;
     108    itAncestorIDSet = fExclAncestorIDSet.find(pidAbs);
     109
     110    if(itAncestorIDSet != fExclAncestorIDSet.end()) return kTRUE;
     111  }
     112
     113  return kFALSE;
     114}
     115
     116//------------------------------------------------------------------------------
     117
     118Bool_t MadGraphPartonClassifier::hasGoodAncestor(ExRootGenParticle *object)
     119{
     120  const int kMaxAncestors = 10;
     121  Int_t i, pidAbs;
     122  ExRootGenParticle *particle = object;
     123  set< Int_t >::const_iterator itAncestorIDSet;
     124  set< Int_t >::const_iterator itParticleIDSet;
     125
     126  // keep all particles if there is no pid in the list
     127  if(fInclAncestorIDSet.empty())
     128  {
     129    return kTRUE;
     130  }
     131
     132  for(i = 0; i < kMaxAncestors; ++i)
     133  {
     134
     135    if(particle->M1 < 0 || particle->M2 > -1) return kFALSE;
     136
     137//    if(particle->PID == 21) return kFALSE;
     138
     139    particle = static_cast<ExRootGenParticle*>(fBranchParticle->At(particle->M1));
     140
     141    if(particle->PID == 21) return kFALSE;
     142
     143    pidAbs = TMath::Abs(particle->PID);
     144
     145    // keep particles with pid included in list
     146    itAncestorIDSet = fInclAncestorIDSet.find(pidAbs);
     147
     148    if(itAncestorIDSet != fInclAncestorIDSet.end()) return kTRUE;
    95149  }
    96150
     
    145199  if(hasBadAncestor(particle)) return -1;
    146200
     201  if(!hasGoodAncestor(particle)) return -1;
     202
    147203  return 0;
    148204}
     
    197253  {
    198254    pid = param[i].GetInt();
    199     fClassifier->InsertAncestorID(pid);
     255    fClassifier->InsertExclAncestorID(pid);
     256  }
     257
     258  // read ancestor IDs from configuration file and setup classifier
     259
     260  param = GetParam("IncludedAncestorIDs");
     261  sizeParam = param.GetSize();
     262
     263  for(i = 0; i < sizeParam; ++i)
     264  {
     265    pid = param[i].GetInt();
     266    fClassifier->InsertInclAncestorID(pid);
    200267  }
    201268
     
    209276
    210277void MadGraphPartonSelector::Finish()
    211 { 
     278{
    212279  if(fFilter) delete fFilter;
    213280  if(fClassifier) delete fClassifier;
  • trunk/modules/MadGraphShowerPartonSelector.cc

    r2 r11  
    3535  void SetEtaMax(Double_t eta);
    3636  void InsertParticleID(Int_t pid);
    37   void InsertAncestorID(Int_t pid);
     37  void InsertExclAncestorID(Int_t pid);
     38  void InsertInclAncestorID(Int_t pid);
    3839  void SetHadronizationInfo(Bool_t info);
    3940
     
    4142
    4243  Bool_t hasBadAncestor(ExRootGenParticle *object);
     44  Bool_t hasGoodAncestor(ExRootGenParticle *object);
    4345
    4446  Double_t fEtaMax;
     
    4749
    4850  set< Int_t > fParticleIDSet;
    49   set< Int_t > fAncestorIDSet;
     51  set< Int_t > fExclAncestorIDSet;
     52  set< Int_t > fInclAncestorIDSet;
    5053};
    5154
     
    7376//------------------------------------------------------------------------------
    7477
    75 void MadGraphShowerPartonClassifier::InsertAncestorID(Int_t pid)
    76 {
    77   fAncestorIDSet.insert(pid);
     78void MadGraphShowerPartonClassifier::InsertExclAncestorID(Int_t pid)
     79{
     80  fExclAncestorIDSet.insert(pid);
     81}
     82
     83//------------------------------------------------------------------------------
     84
     85void MadGraphShowerPartonClassifier::InsertInclAncestorID(Int_t pid)
     86{
     87  fInclAncestorIDSet.insert(pid);
    7888}
    7989
     
    96106  if(particle->PID == 21) return kFALSE;
    97107
     108  // keep all particles if there is no pid in the list
     109  if(fExclAncestorIDSet.empty())
     110  {
     111    return kFALSE;
     112  }
     113
    98114  pidAbs = TMath::Abs(particle->PID);
    99115
    100116  // skip particles with pid included in list
    101   itAncestorIDSet = fAncestorIDSet.find(pidAbs);
    102 
    103   if(itAncestorIDSet != fAncestorIDSet.end()) return kTRUE;
     117  itAncestorIDSet = fExclAncestorIDSet.find(pidAbs);
     118
     119  if(itAncestorIDSet != fExclAncestorIDSet.end()) return kTRUE;
    104120  if(particle->M2 > -1) return kFALSE;
    105121
     
    115131
    116132    // skip particles with pid included in list
    117     itAncestorIDSet = fAncestorIDSet.find(pidAbs);
    118 
    119     if(itAncestorIDSet != fAncestorIDSet.end()) return kTRUE;
     133    itAncestorIDSet = fExclAncestorIDSet.find(pidAbs);
     134
     135    if(itAncestorIDSet != fExclAncestorIDSet.end()) return kTRUE;
     136    if(particle->M2 > -1) return kFALSE;
     137  }
     138
     139  return kFALSE;
     140}
     141
     142//------------------------------------------------------------------------------
     143
     144Bool_t MadGraphShowerPartonClassifier::hasGoodAncestor(ExRootGenParticle *object)
     145{
     146  const int kMaxAncestors = 10;
     147  Int_t i, pidAbs;
     148  ExRootGenParticle *particle = object;
     149  set< Int_t >::const_iterator itAncestorIDSet;
     150
     151  for(i = 0; i < kMaxAncestors && particle->Status != 3; ++i)
     152  {
     153    if(particle->M1 < 0) return kFALSE;
     154
     155    particle = static_cast<ExRootGenParticle*>(fBranchParticle->At(particle->M1));
     156  }
     157
     158  if(particle->PID == 21) return kFALSE;
     159
     160  // keep all particles if there is no pid in the list
     161  if(fInclAncestorIDSet.empty())
     162  {
     163    return kTRUE;
     164  }
     165
     166  pidAbs = TMath::Abs(particle->PID);
     167
     168  // keep particles with pid included in list
     169  itAncestorIDSet = fInclAncestorIDSet.find(pidAbs);
     170
     171  if(itAncestorIDSet != fInclAncestorIDSet.end()) return kTRUE;
     172  if(particle->M2 > -1) return kFALSE;
     173
     174  for(i = 0; i < kMaxAncestors; ++i)
     175  {
     176    if(particle->M1 < 0) return kFALSE;
     177
     178    if(particle->PID == 21) return kFALSE;
     179
     180    particle = static_cast<ExRootGenParticle*>(fBranchParticle->At(particle->M1));
     181
     182    pidAbs = TMath::Abs(particle->PID);
     183
     184    // keep particles with pid included in list
     185    itAncestorIDSet = fInclAncestorIDSet.find(pidAbs);
     186
     187    if(itAncestorIDSet != fInclAncestorIDSet.end()) return kTRUE;
    120188    if(particle->M2 > -1) return kFALSE;
    121189  }
     
    159227  if(hasBadAncestor(particle)) return -1;
    160228
     229  if(!hasGoodAncestor(particle)) return -1;
     230
    161231  return 0;
    162232}
     
    214284  {
    215285    pid = param[i].GetInt();
    216     fClassifier->InsertAncestorID(pid);
     286    fClassifier->InsertExclAncestorID(pid);
     287  }
     288
     289  // read ancestor IDs from configuration file and setup classifier
     290
     291  param = GetParam("IncludedAncestorIDs");
     292  sizeParam = param.GetSize();
     293
     294  for(i = 0; i < sizeParam; ++i)
     295  {
     296    pid = param[i].GetInt();
     297    fClassifier->InsertInclAncestorID(pid);
    217298  }
    218299
  • trunk/modules/ModulesLinkDef.h

    r2 r11  
    77#include "modules/MadGraphMatchingTreeWriter.h"
    88#include "modules/MadGraphKtJetFinder.h"
    9 #include "modules/MadGraphConeJetFinder.h"
     9#include "modules/MadGraphCDFConeJetFinder.h"
     10#include "modules/MadGraphSISConeJetFinder.h"
    1011#include "modules/MadGraphIsolatedLeptonFinder.h"
    1112#include "modules/PythiaFix.h"
     
    2930#pragma link C++ class MadGraphMatchingTreeWriter+;
    3031#pragma link C++ class MadGraphKtJetFinder+;
    31 #pragma link C++ class MadGraphConeJetFinder+;
     32#pragma link C++ class MadGraphCDFConeJetFinder+;
     33#pragma link C++ class MadGraphSISConeJetFinder+;
    3234#pragma link C++ class MadGraphIsolatedLeptonFinder+;
    3335#pragma link C++ class PythiaFix+;
Note: See TracChangeset for help on using the changeset viewer.