Index: /trunk/data/trigger_ATLAS.dat
===================================================================
--- /trunk/data/trigger_ATLAS.dat	(revision 250)
+++ /trunk/data/trigger_ATLAS.dat	(revision 250)
@@ -0,0 +1,16 @@
+#TRIGGER CARD      # DO NOT REMOVE THIS IS A TAG!
+
+# list of trigger algorithms
+# trigger_name	>> algorithm                   #comments
+Inclusive Isol electron  >> IElec1_PT:  '25'                            
+di-electron Isol         >> IELEC1_PT:  '15'   &&   IELEC2_PT:   '15'    
+Inclusive Photon         >> GAMMA1_PT:  '60'                            
+di-Photon                >> GAMMA1_PT:  '20'   &&   GAMMA2_PT:   '20'    
+Inclusive Isol muon      >> IMuon1_PT:  '20'                            
+di-muon                  >> MUON1_PT:   '10'   &&   MUON2_PT:    '10'    
+Taujet and ETmis         >> TAU1_PT:    '35'   &&   ETMIS_PT:    '45'
+Jet and ETmis            >> JET1_PT:    '70'   &&   ETMIS_PT:    '70'
+Inclusive 1 jet          >> JET1_PT:    '400'
+Inclusive 3 jets         >> JET1_PT:    '165'  &&   JET2_PT:     '165'    &&     JET3_PT:    '165'
+Inclusive 4 jets         >> JET1_PT:    '110'  &&   JET2_PT:     '110'    &&     JET3_PT:    '110'   &&     JET4_PT:    '110'
+
Index: /trunk/data/trigger_CMS.dat
===================================================================
--- /trunk/data/trigger_CMS.dat	(revision 250)
+++ /trunk/data/trigger_CMS.dat	(revision 250)
@@ -0,0 +1,20 @@
+#TRIGGER CARD      # DO NOT REMOVE THIS IS A TAG!
+
+# list of trigger algorithms
+# trigger_name	>> algorithm                   #comments
+Inclusive electron  >> ELEC1_PT:   '29'                            
+di-electron         >> ELEC1_PT:   '17'   &&   ELEC2_PT:   '17'    
+Inclusive Photon    >> GAMMA1_PT:  '80'                            
+di-Photon           >> GAMMA1_PT:  '40'   &&   GAMMA2_PT:  '25'    
+Inclusive muon      >> MUON1_PT:   '19'                            
+di-muon             >> MUON1_PT:   '7'    &&   MUON2_PT:   '7'    
+Taujet and ETmis    >> TAU1_PT:    '86'   &&   ETMIS_PT:   '65'
+di-Taujets          >> TAU1_PT:    '59'   &&   TAU2_PT:    '59' 
+Jet and ETmis       >> JET1_PT:    '180'  &&   ETMIS_PT:   '123'
+Taujet and electron >> TAU1_PT:    '45'   &&   ELEC1_PT:   '19'
+Taujet and muon     >> TAU1_PT:    '40'   &&   ELEC1_PT:   '15'
+Inclusive b-jet     >> Bjet1_PT:   '237'                            
+Inclusive 1 jet     >> JET1_PT:    '657'
+Inclusive 3 jets    >> JET1_PT:    '247'  &&   JET2_PT:    '247'    &&     JET3_PT:    '247' 
+Inclusive 4 jets    >> JET1_PT:    '113'  &&   JET2_PT:    '113'    &&     JET3_PT:    '113'   &&     JET4_PT:    '113'
+
Index: /trunk/interface/TriggerUtil.h
===================================================================
--- /trunk/interface/TriggerUtil.h	(revision 249)
+++ /trunk/interface/TriggerUtil.h	(revision 250)
@@ -16,4 +16,5 @@
 
 #include "BlockClasses.h"
+#include "Utilities/ExRootAnalysis/interface/TSimpleArray.h"
 #include "Utilities/ExRootAnalysis/interface/ExRootTreeBranch.h"
 
@@ -24,5 +25,5 @@
  public:
 
-  TriggerBit(); 
+  TriggerBit(){}; 
   TriggerBit(const TriggerBit& tb);
   TriggerBit& operator=(const TriggerBit& tb);
@@ -35,10 +36,16 @@
       TClonesArray *branchPhotonTrig,  TClonesArray *branchETmisTrig);
   vector<float> GetCuts(const vector<string> &Sequences);
+  TSimpleArray<TRootJet> SubArrayBjets(TClonesArray *JET);
+  TSimpleArray<TRootElectron> SubArrayIElec(TClonesArray *ELEC);
+  TSimpleArray<TRootMuon> SubArrayIMuon(TClonesArray *MUON);
 
  private:
  
   vector<float> ElecValues;
+  vector<float> IElecValues;
   vector<float> MuonValues;
+  vector<float> IMuonValues;
   vector<float> JetValues;
+  vector<float> BjetValues;
   vector<float> TauJetValues;
   vector<float> EtmisValues;
@@ -58,12 +65,5 @@
 
   void TriggerCardReader(const string& filename="data/trigger.dat");
-  // avant, Ã§a s'appellait TriggerReader
-  // appelle la mÃ©thode TriggerBit::GetTrigCondition
-
-  
   void PrintTriggerTable(const string& LogName);
-  // fait un cout des triggers bits, c'est toujours pratique
-  // appelle la mÃ©thode TriggerBit::PriniTrigCondition
-  
   bool GetGlobalResult(TClonesArray *branchElecTrig, TClonesArray *branchMuonTrig,
       TClonesArray *branchJetTrig, TClonesArray *branchTauJetTrig,
@@ -71,19 +71,10 @@
 
   void WriteResult();
-    // sauve dans le TTree
-    // ce nom est stupide, faut le changer
     
  private:
-  //bool Evaluate( int event_i );
-  // boucle sur list_of_trigger_bits, comme on a dit
-  // appelle la methode TriggerBit::Evaluate ou TriggerBit::GetResult (Ã  voir)
-  // renvoie la rÃ©ponse globale du trigger
-  // Ã  la fin, mettre has_been_evaluated = true;
-  // voir le NB ci-dessous
   
   vector<TriggerBit> list_of_trigger_bits;
   bool has_been_evaluated;
   bool GlobalResult;
-  int event_i;
 
 };
Index: /trunk/src/TriggerUtil.cc
===================================================================
--- /trunk/src/TriggerUtil.cc	(revision 249)
+++ /trunk/src/TriggerUtil.cc	(revision 250)
@@ -27,5 +27,4 @@
 TriggerTable& TriggerTable::operator=(TriggerTable&tt) {
   if (this == &tt) return *this;
-  event_i = tt.event_i;
   has_been_evaluated = tt.has_been_evaluated;
   GlobalResult = tt.GlobalResult;
@@ -36,5 +35,4 @@
 
 TriggerTable::TriggerTable(const TriggerTable& tt) {
-  event_i = tt.event_i;
   has_been_evaluated = tt.has_been_evaluated;
   GlobalResult = tt.GlobalResult;
@@ -47,5 +45,7 @@
    ifstream trigger_file(filename.c_str());
    if( !trigger_file.good() ) {
-	cout << "ERROR: Trigger input file "<< filename << " not found. Exiting.\n";
+       cerr << left  << setw(30) <<"** ERROR: Trigger input file "<<""
+          << right << setw(15) <<filename<<""
+          << right << setw(24)  <<"not found. Exiting... **"<<endl;
 	return;
    }
@@ -111,11 +111,12 @@
 
 //*************************************************************************
-TriggerBit::TriggerBit() {
-}
 
 TriggerBit::~TriggerBit() {
 	ElecValues.clear();
+	IElecValues.clear();
 	MuonValues.clear();
+	IMuonValues.clear();
 	JetValues.clear();
+	BjetValues.clear();
 	TauJetValues.clear();
 	EtmisValues.clear();
@@ -127,9 +128,20 @@
 	ElecValues.push_back(tb.ElecValues[i]);
 
+  for(unsigned int i=0; i<tb.IElecValues.size(); i++)
+        IElecValues.push_back(tb.IElecValues[i]);
+
+
   for(unsigned int i=0; i<tb.MuonValues.size(); i++)
 	MuonValues.push_back(tb.MuonValues[i]);
 
+  for(unsigned int i=0; i<tb.IMuonValues.size(); i++)
+        IMuonValues.push_back(tb.IMuonValues[i]);
+
   for(unsigned int i=0; i<tb.JetValues.size(); i++)
         JetValues.push_back(tb.JetValues[i]);
+
+  for(unsigned int i=0; i<tb.BjetValues.size(); i++)
+        BjetValues.push_back(tb.BjetValues[i]);
+
 
   for(unsigned int i=0; i<tb.TauJetValues.size(); i++)
@@ -150,9 +162,18 @@
         ElecValues.push_back(tb.ElecValues[i]);
 
+  for(unsigned int i=0; i<tb.IElecValues.size(); i++)
+        IElecValues.push_back(tb.IElecValues[i]);
+
   for(unsigned int i=0; i<tb.MuonValues.size(); i++)
         MuonValues.push_back(tb.MuonValues[i]);
 
+  for(unsigned int i=0; i<tb.IMuonValues.size(); i++)
+        IMuonValues.push_back(tb.IMuonValues[i]);
+
   for(unsigned int i=0; i<tb.JetValues.size(); i++)
         JetValues.push_back(tb.JetValues[i]);
+
+  for(unsigned int i=0; i<tb.BjetValues.size(); i++)
+        BjetValues.push_back(tb.BjetValues[i]);
 
   for(unsigned int i=0; i<tb.TauJetValues.size(); i++)
@@ -175,7 +196,15 @@
       TClonesArray *branchPhotonTrig,  TClonesArray *branchETmisTrig)
 {
+
+  TSimpleArray<TRootJet> bjets=SubArrayBjets(branchJetTrig);
+  TSimpleArray<TRootElectron> Ielectron=SubArrayIElec(branchElecTrig);
+  TSimpleArray<TRootMuon> Imuon=SubArrayIMuon(branchMuonTrig);
+ 
   int elec_size = ElecValues.size();
+  int Ielec_size = IElecValues.size();
   int muon_size = MuonValues.size();
+  int Imuon_size = IMuonValues.size();
   int jet_size = JetValues.size();
+  int bjet_size = BjetValues.size();
   int taujet_size = TauJetValues.size();
   int gamma_size = GammaValues.size();
@@ -185,6 +214,9 @@
   if(
      (branchElecTrig->GetEntries() >= elec_size )
+      && (Ielectron.GetEntries() >= Ielec_size )
       && (branchMuonTrig->GetEntries() >= muon_size )
+      && (Imuon.GetEntries() >= Imuon_size )
       && (branchJetTrig->GetEntries() >= jet_size )
+      && (bjets.GetEntries() >= bjet_size )
       && (branchTauJetTrig->GetEntries() >= taujet_size )
       && (branchPhotonTrig->GetEntries() >= gamma_size )
@@ -198,4 +230,16 @@
            if(electron->PT < ElecValues[i])Result=false;}}
 
+      if(Ielec_size!=0)
+        {
+         TRootElectron *i_elec; Ielectron.Reset();
+         int i=0;
+         while((i_elec = Ielectron.Next()))
+              {
+                if(i_elec->PT < IElecValues[i])Result=false;
+                i++;
+              }
+        }
+
+
       if(muon_size!=0){
         TRootMuon *muon;
@@ -204,4 +248,15 @@
            if(muon->PT < MuonValues[i])Result=false;}}
 
+      if(Imuon_size!=0)
+        {
+         TRootMuon *i_muon; Imuon.Reset();
+         int i=0;
+         while((i_muon = Imuon.Next()))
+              {
+                if(i_muon->PT < IMuonValues[i])Result=false;
+                i++;
+              }
+        }
+
       if(jet_size!=0){
         TRootJet *jet;
@@ -209,4 +264,22 @@
            jet = (TRootJet*)branchJetTrig->At(i);
            if(jet->PT < JetValues[i])Result=false;}}
+
+      if(jet_size!=0){
+        TRootJet *jet;
+        for(int i=0;i<jet_size;i++){
+           jet = (TRootJet*)branchJetTrig->At(i);
+           if(jet->PT < JetValues[i])Result=false;}}
+
+      if(bjet_size!=0)
+        {
+         TRootJet *i_bjets; bjets.Reset();
+         int i=0;
+         while((i_bjets = bjets.Next()))
+              {
+                if(i_bjets->PT < BjetValues[i])Result=false;
+                i++;
+              }
+        }
+
 
       if(taujet_size!=0){
@@ -234,41 +307,54 @@
 
   vector<string> ElecSequences;
+  vector<string> IElecSequences;
   vector<string> MuonSequences;
+  vector<string> IMuonSequences;
   vector<string> JetSequences;
   vector<string> TauJetSequences;
   vector<string> EtmisSequences;
   vector<string> GammaSequences;
-
-  char *result = NULL;
+  vector<string> BjetSequences;
+
+///  char *result =NULL;
+  char * result = new char[256];
   result = strtok( (char*) trigger_algorithm.c_str(),"&");
   while( result != NULL )
      {
        if(strstr (result,"ELEC"))ElecSequences.push_back(result);
+       if(strstr (result,"IElec"))IElecSequences.push_back(result);
        if(strstr (result,"MUON"))MuonSequences.push_back(result);
+       if(strstr (result,"IMuon"))IMuonSequences.push_back(result);
        if(strstr (result,"JET"))JetSequences.push_back(result);
-       if(strstr (result,"TAUJET"))TauJetSequences.push_back(result);
+       if(strstr (result,"TAU"))TauJetSequences.push_back(result);
        if(strstr (result,"ETMIS"))EtmisSequences.push_back(result);
        if(strstr (result,"GAMMA"))GammaSequences.push_back(result);
+       if(strstr (result,"Bjet"))BjetSequences.push_back(result);
        result = strtok( NULL,"&");
      }
+  delete result;
 
   ElecValues = GetCuts(ElecSequences);
+  IElecValues = GetCuts(IElecSequences);
   MuonValues = GetCuts(MuonSequences);
+  IMuonValues = GetCuts(IMuonSequences);
   JetValues = GetCuts(JetSequences);
   TauJetValues = GetCuts(TauJetSequences);
   EtmisValues = GetCuts(EtmisSequences);
   GammaValues = GetCuts(GammaSequences);
-
-}
-
+  BjetValues = GetCuts(BjetSequences);
+
+}
 
 void TriggerBit::PrintTrigCondition(const string& LogName,const int i) 
 {
   int elec_size = TriggerBit::ElecValues.size();
+  int Ielec_size = TriggerBit::IElecValues.size();
   int muon_size = TriggerBit::MuonValues.size();
+  int Imuon_size = TriggerBit::IMuonValues.size();
   int jet_size = TriggerBit::JetValues.size();
   int taujet_size = TriggerBit::TauJetValues.size();
   int gamma_size = TriggerBit::GammaValues.size();
   int etmis_size = TriggerBit::EtmisValues.size();
+  int bjets_size = TriggerBit::BjetValues.size();
   
   ofstream f_out(LogName.c_str(),ios::app);
@@ -279,35 +365,39 @@
   f_out <<"#*************************"<<"\n";
   f_out << left << setw(45) <<"*   # Number of reconstructed objects required:"<<""<<right << setw(23)<<"*"<<"\n";
-  f_out << left << setw(1) <<"*"
-        << internal << setw(10) << "Electron"<< ""<< internal << setw(10) << "Muon"    << ""
-        << internal << setw(10) << "Jets"    << ""<< internal << setw(10) << "Tau-jets "<< ""
-        << internal << setw(10) << "Photons" << ""<< internal << setw(10) << "ETmis "<< ""<< right    << setw(9)  <<"*"<<"\n";
-  f_out << left << setw(1) <<"*"
-        << internal << setw(10) << elec_size << ""<< internal << setw(10) << muon_size << ""
-        << internal << setw(10) << jet_size  << ""<< internal << setw(10) << taujet_size << ""
-        << internal << setw(10) << gamma_size<< ""<< internal << setw(10) << etmis_size << ""<< right << setw(9)<<"*"<<"\n";
-  f_out << left << setw(45) <<"*   # Values of the related thresholds: "<<""<<right << setw(25)<<"*"<<"\n";
+  
   if(elec_size!=0){
-  f_out << left << setw(20) <<"*    - Electrons: "<<"";
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(2) << elec_size <<""<< left << setw(20)<<"Electron(s) with p_T: "<<"";
   for(int i=0;i<elec_size;i++){f_out << left << setw(5) << TriggerBit::ElecValues[i]<<"";}f_out <<"\n";}
 
+  if(Ielec_size!=0){
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(2) << Ielec_size <<""<< left << setw(20)<<"Isolated electron(s) with p_T: "<<"";
+  for(int i=0;i<Ielec_size;i++){f_out << left << setw(5) << TriggerBit::IElecValues[i]<<"";}f_out <<"\n";}
+
   if(muon_size!=0){
-  f_out << left << setw(20) <<"*    - Muons: "<<"";
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(2) << muon_size <<""<< left << setw(20)<<"Muon(s) with p_T: "<<"";
   for(int i=0;i<muon_size;i++){f_out << left << setw(5) << TriggerBit::MuonValues[i]<<"";}f_out <<"\n";}
 
+  if(Imuon_size!=0){
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(2) << Imuon_size <<""<< left << setw(20)<<"Isolated muon(s) with p_T: "<<"";
+  for(int i=0;i<Imuon_size;i++){f_out << left << setw(5) << TriggerBit::IMuonValues[i]<<"";}f_out <<"\n";}
+
   if(jet_size!=0){
-  f_out << left << setw(20) <<"*    - Jets: "<<"";
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(2) << jet_size <<""<< left << setw(20)<<"Jet(s) with p_T: "<<"";
   for(int i=0;i<jet_size;i++){f_out << left << setw(5) << TriggerBit::JetValues[i]<<"";}f_out <<"\n";}
 
   if(taujet_size!=0){
-  f_out << left << setw(20) <<"*    - Tau-jets: "<<"";
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(2) << taujet_size <<""<< left << setw(20)<<"Tau-jet(s) with p_T: "<<"";
   for(int i=0;i<taujet_size;i++){f_out << left << setw(5) << TriggerBit::TauJetValues[i]<<"";}f_out <<"\n";}
- 
+
+  if(bjets_size!=0){
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(2) << bjets_size <<""<< left << setw(20)<<"B-jet(s) with p_T: "<<"";
+  for(int i=0;i<bjets_size;i++){f_out << left << setw(5) << TriggerBit::BjetValues[i]<<"";}f_out <<"\n";}
+
   if(gamma_size!=0){
-  f_out << left << setw(20) <<"*    - Photons: "<<"";
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(2) << gamma_size <<""<< left << setw(20)<<"Photon(s) with p_T: "<<"";
   for(int i=0;i<gamma_size;i++){f_out << left << setw(5) << TriggerBit::GammaValues[i]<<"";}f_out <<"\n";}
  
   if(etmis_size!=0){
-  f_out << left << setw(20) <<"*    - ETMIS: "<<"";
+  f_out << left << setw(5) <<"**  -"<<""<< left << setw(20)<<"Transverse missing energy with p_T: "<<"";
   for(int i=0;i<etmis_size;i++){f_out << left << setw(5) << TriggerBit::EtmisValues[i]<<"";}f_out <<"\n";}
   f_out <<"*                                                                    *"<<"\n";
@@ -328,6 +418,44 @@
    }
   return OrderedValue;
-
-}
-
-
+}
+
+TSimpleArray<TRootJet> TriggerBit::SubArrayBjets(TClonesArray *JET)
+{
+   TIter itJet((TCollection*)JET);
+   TRootJet *jet;
+   itJet.Reset();
+   TSimpleArray<TRootJet> array;
+   while( (jet = (TRootJet*) itJet.Next()) )
+     {
+        if(jet->Btag==1)array.Add(jet);
+     }
+   return array;
+}
+
+TSimpleArray<TRootElectron> TriggerBit::SubArrayIElec(TClonesArray *ELEC)
+{
+   TIter itElec((TCollection*)ELEC);
+   TRootElectron *electron;
+   itElec.Reset();
+   TSimpleArray<TRootElectron> array;
+   while( (electron = (TRootElectron*) itElec.Next()) )
+     {
+        if(electron->IsolFlag==1)array.Add(electron);
+     }
+   return array;
+}
+
+TSimpleArray<TRootMuon> TriggerBit::SubArrayIMuon(TClonesArray *MUON)
+{
+   TIter itMuon((TCollection*)MUON);
+   TRootMuon *muon;
+   itMuon.Reset();
+   TSimpleArray<TRootMuon> array;
+   while( (muon = (TRootMuon*) itMuon.Next()) )
+     {
+        if(muon->IsolFlag==1)array.Add(muon);
+     }
+   return array;
+}
+
+
