Пример #1
0
microboone_geo(TString volName="")
{
  gSystem->Load("libGeom");
  gSystem->Load("libGdml");

  TGeoManager::Import("microboone.gdml");

  TList* mat = gGeoManager->GetListOfMaterials();
  TIter next(mat);
  TObject *obj;
  while (obj = next()) {
    obj->Print();
  }

  gGeoManager->CheckOverlaps(0.01);
  gGeoManager->PrintOverlaps();
  gGeoManager->SetMaxVisNodes(70000);

  //gGeoManager->GetTopVolume()->Draw();
  //if ( ! volName.IsNull() ) gGeoManager->FindVolumeFast(volName)->Draw("ogl");
  //gGeoManager->FindVolumeFast("volFieldCage")->Draw();

  TFile *tf = new TFile("microboone.root", "RECREATE");
 
  gGeoManager->Write();

  tf->Close();
}
Пример #2
0
//_____________________________________________________________________________
void THaHashList::PrintOpt( Option_t* opt ) const
{
  // Print all objects in the list. Pass option 'opt' through to each object
  // being printed. (This is the old ROOT 2.x behavior).

  TIter next(this);
  TObject* object;
  while((object = next()))
    object->Print(opt);
}
Пример #3
0
void tables_read()
{
   // now open connection to database for read-only
   TSQLFile* f = new TSQLFile(dbname, "open", username, userpass);
   if (f->IsZombie()) { delete f; return; }

   // see list of keys
   f->ls();

   // get histogram from DB and draw it
   TH1* h1 = (TH1*) f->Get("histo");
   if (h1!=0) {
       h1->SetDirectory(0);
       h1->Draw();
   }

   // get TList with other objects
   TObject* obj = f->Get("list");
   cout << "Printout of TList object" << endl;
   if (obj!=0) obj->Print("*");
   delete obj;

   // and get TClonesArray
   obj = f->Get("clones");
   cout << "Printout of TClonesArray object" << endl;
   if (obj!=0) obj->Print("*");
   delete obj;

   // this is query to select data of hole class from different tables
   cout << "================ TBox QUERY ================ " << endl;
   cout << f->MakeSelectQuery(TBox::Class()) << endl;
   cout << "================ END of TBox QUERY ================ " << endl;

   cout << "================== TH1I QUERY ================ " << endl;
   cout << f->MakeSelectQuery(TH1I::Class()) << endl;
   cout << "================ END of TH1I QUERY ================ " << endl;

   // close connection to database
   delete f;
}
Пример #4
0
lbnend_geo(TString volName="")
{
  gSystem->Load("libGeom");
  gSystem->Load("libGdml");

  TGeoManager::Import("lbnend.gdml");

  drawopt optuboone[] = {
    {"volTPC",        kOrange-7},
    {"volTPCPlane",        kOrange-7},
    {"volTPCPlaneVert",        kOrange-7},
    {0, 0}
  };

  for (int i=0;; ++i) {
    if (optuboone[i].volume==0) break;
      gGeoManager->FindVolumeFast(optuboone[i].volume)->SetLineColor(optuboone[i].color);
  }
  
  TList* mat = gGeoManager->GetListOfMaterials();
  TIter next(mat);
  TObject *obj;
  while (obj = next()) {
    obj->Print();
  }

  gGeoManager->GetTopNode();
  gGeoManager->CheckOverlaps(1e-16);
  gGeoManager->PrintOverlaps();
  gGeoManager->SetMaxVisNodes(70000);

  //gGeoManager->GetTopVolume()->Draw();
  //if ( ! volName.IsNull() ) gGeoManager->FindVolumeFast(volName)->Draw("ogl");
  
  gGeoManager->FindVolumeFast("volWorld")->Draw("ogl");


  TFile *tf = new TFile("lbnend.root", "RECREATE");
 
  gGeoManager->Write();

  tf->Close();
}
Пример #5
0
/**
 * Dumps the AliHLTGlobalTriggerDecision objects found in HLT output data.
 *
 * \param dataSource  This is the path to the raw data or the ROOT/DATE file
 *     contining the raw data. (default is the current directory).
 * \param firstEvent  The event number of the first event to process. (default = 0)
 * \param lastEvent  The event number of the last event to process. If this is
 *     less than firstEvent then it is set to maximum events available
 *     automatically. (default = -1)
 * \param output  Specifies the name of a ROOT output file. This file will be
 *     generated and the objects written to it. If the value is NULL then
 *     no output is written to file. (default = NULL)
 * \param debug  Specifies if full debug messages should be printed.
 */
void DumpGlobalTrigger(
		const char* dataSource = "./",
		Int_t firstEvent = 0,
		Int_t lastEvent = -1,
		const char* output = NULL,
		bool debug = false
	)
{
	if (debug)
	{
		AliLog::SetModuleDebugLevel("HLT", AliLog::kMaxType);
		AliHLTSystem* sys = AliHLTPluginBase::GetInstance();
		sys->SetGlobalLoggingLevel(kHLTLogAll);
	}
	
	gSystem->Load("libHLTrec");
	TFile* file = NULL;
	if (output != NULL)
	{
		file = new TFile(output, "RECREATE");
		if (file == NULL)
		{
			cerr << "ERROR: Could not create file '" << output << "'." << endl;
			return;
		}
	}
	
	// Setup the raw reader and HLTOUT handler.
	AliRawReader* rawReader = AliRawReader::Create(dataSource);
	if (rawReader == NULL)
	{
		cerr << "ERROR: Could not create raw reader for '" << dataSource << "'." << endl;
		if (file != NULL) delete file;
		return;
	}
	if (! rawReader->IsRawReaderValid())
	{
		cerr << "ERROR: Raw reader is not valid for '" << dataSource << "'." << endl;
		delete rawReader;
		if (file != NULL) delete file;
		return;
	}
	AliHLTOUT* hltout = AliHLTOUT::New(rawReader);
	if (hltout == NULL)
	{
		cerr << "ERROR: Could not create an AliHLTOUT object for '" << dataSource << "'." << endl;
		delete rawReader;
		if (file != NULL) delete file;
		return;
	}
	
	// Make sure that the lastEvent is greater than firstEvent.
	if (lastEvent < firstEvent) lastEvent = rawReader->GetNumberOfEvents();
	if (lastEvent < firstEvent) lastEvent = firstEvent;
	
	// Need to call NextEvent once here or we will start at the wrong event.
	if (! rawReader->NextEvent())
	{
		cout << "No events found in '" << dataSource << "'." << endl;
		AliHLTOUT::Delete(hltout);
		delete rawReader;
		if (file != NULL) delete file;
		return;
	}
	
	// Now step through the events.
	for (int i = 0; i < firstEvent; i++) rawReader->NextEvent();
	for (int i = firstEvent; i <= lastEvent; i++)
	{
		int result = hltout->Init();
		if (result != 0)
		{
			cerr << "ERROR: could not initialise HLTOUT." << endl;
			hltout->Reset();
			continue;
		}
		cout << "#################### Event " << i << " in " << dataSource
			<< " has event ID = " << hltout->EventId()
			<< " (0x" << hex << hltout->EventId() << dec << ")"
			<< " ####################" << endl;
		
		for (result = hltout->SelectFirstDataBlock();
		     result >= 0;
		     result = hltout->SelectNextDataBlock()
		    )
		{
			AliHLTComponentDataType dt;
			AliHLTUInt32_t spec = 0;
			hltout->GetDataBlockDescription(dt, spec);
			TObject* obj = hltout->GetDataObject();
			if (obj == NULL) continue;
			if (obj->IsA()->GetBaseClass("AliHLTGlobalTriggerDecision") != NULL)
			{
				if (dt != kAliHLTDataTypeGlobalTrigger)
				{
					cerr << "WARNING: Found an AliHLTGlobalTriggerDecision object in a data block of type '"
						<< AliHLTComponent::DataType2Text(dt).c_str()
						<< "' but expected '"
						<< AliHLTComponent::DataType2Text(kAliHLTDataTypeGlobalTrigger).c_str()
						<< "'." << endl;
				}
				if (file != NULL)
				{
					obj->Write(
						Form("HLTGlobalDecision_event_0x%llX", hltout->EventId()),
						TObject::kOverwrite
					);
				}
				obj->Print();
			}
			hltout->ReleaseDataObject(obj);
		}
		
		result = hltout->Reset();
		if (result != 0)
		{
			cerr << "ERROR: could not reset HLTOUT." << endl;
			hltout->Reset();
			continue;
		}
		rawReader->NextEvent();
	}
	
	AliHLTOUT::Delete(hltout);
	delete rawReader;
	if (file != NULL) delete file;
}
Пример #6
0
/**
 * Generates a default CDB entry for the trigger menu in the given CDB storage
 * (local by default).
 * \param cdbPath  The path to the default CDB storage.
 */
void HM_PHYSICS_V0001(
		      const char* cdbPath = "local://$ALICE_ROOT/OCDB",
		      Int_t version = 0,
		      Int_t firstRun = 0,
		      Int_t lastRun = AliCDBRunRange::Infinity()
		      ) {
  gSystem->Load("libAliHLTTrigger");
  
  // Setup the CDB default storage and run number.
  AliCDBManager* cdbManager = AliCDBManager::Instance();
  if (cdbManager == NULL) {
    cerr << "ERROR: Global CDB manager object does not exist." << endl;
    return;
  }

  AliCDBStorage* storage = cdbManager->GetStorage(cdbPath);
  if (storage == NULL) {
    cerr << "ERROR: Could not get storage for: " << cdbPath << endl;
    return;
  }

  // /////////////////////////////////////////////////////////////////////////////////////////	
  // Create the trigger menu.
  AliHLTGlobalTriggerConfig config("HM-COSMICS-V0001");

  config.AddSymbol("domainAll", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"*******:***\")");
  
  // /////////////////////////////////////////////////////////////////////////////////////////	
  // the domain definitions for the global HLT output and the HLT DDLs
  //config.AddSymbol("domainHLTOUT", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"*******:HLT \")");
  config.AddSymbol("domainHLTDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:HLT\\0\")");

  // some explicite domain entries
  config.AddSymbol("domainTObject"   , "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"ROOTTOBJ:HLT \")");
  config.AddSymbol("domainESD"       , "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"ALIESDV0:HLT \")");
  config.AddSymbol("domainHistogram" , "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"ROOTHIST:HLT \")");

  config.AddSymbol("domainSPDCluster", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"CLUSTERS:ISPD\")");
  config.AddSymbol("domainSDDCluster", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"CLUSTERS:ISDD\")");
  config.AddSymbol("domainSSDCluster", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"CLUSTERS:ISSD\")");
  config.AddSymbol("domainTPCCluster", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"CLUSTERS:TPC \")");

  // an explicite HLTOUT selection which avoids wildcards
  config.AddSymbol("domainHLTOUT", "AliHLTTriggerDomain", "", 
		   "domainTObject    | "
		   "domainESD        | "
		   "domainHistogram  | "
		   "domainSPDCluster | "
		   "domainSDDCluster | "
		   "domainSSDCluster | "
		   "domainTPCCluster"
		   );

  // /////////////////////////////////////////////////////////////////////////////////////////	
  // -- DETECTOR READOUT DOMAINS
  config.AddSymbol("domainSPDDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:SPD\\0\")");
  config.AddSymbol("domainSDDDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:SDD\\0\")");
  config.AddSymbol("domainSSDDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:SSD\\0\")");
  config.AddSymbol("domainTPCDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:TPC\\0\")");
  config.AddSymbol("domainTRDDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:TRD\\0\")");
  config.AddSymbol("domainTOFDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:TOF\\0\")");
  config.AddSymbol("domainHMPDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:HMP\\0\")");
  config.AddSymbol("domainPHSDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:PHS\\0\")");
  config.AddSymbol("domainCPVDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:CPV\\0\")");
  config.AddSymbol("domainPMDDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:PMD\\0\")");
  config.AddSymbol("domainMCHDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:MCH\\0\")");
  config.AddSymbol("domainMTRDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:MTR\\0\")");
  config.AddSymbol("domainFMDDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:FMD\\0\")");
  config.AddSymbol("domainT00DDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:T00\\0\")");
  config.AddSymbol("domainV00DDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:V00\\0\")");
  config.AddSymbol("domainZDCDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:ZDC\\0\")");
  config.AddSymbol("domainACODDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:ACO\\0\")");
  config.AddSymbol("domainCTPDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:TRI\\0\")");
  config.AddSymbol("domainEMCDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:EMC\\0\")");

  // /////////////////////////////////////////////////////////////////////////////////////////	
  // -- DETECTOR READOUT DOMAINS - SPECIAL
  config.AddSymbol("domainALLDDL", "AliHLTTriggerDomain", "", "AliHLTTriggerDomain(\"DAQRDOUT:***\\0\")");
  
  // /////////////////////////////////////////////////////////////////////////////////////////	
  // NOTE: always make sure that the global HLT output and the HLT DDLs are included
  // in the readout, i.e. add domainHLTOUT|domainHLTDDL to the trigger domain

  // -- BarrelMultiplicity
  config.AddItem(
		 "BarrelMultiplicityTrigger", 
		 "domainHLTOUT|domainALLDDL", 
		 "H-TRACK_MULTIPLICITY-V0002.001-CENTRAL-ALL"
		 );

  config.AddItem(
		 "BarrelHighMultiplicity", 
		 "domainHLTOUT|domainALLDDL", 
		 "H-TRACK_MULTIPLICITY-V0002.002-CENTRAL-ALL"
		 );

  config.AddItem(
		 "BarrelPt_v01", 
		 "domainHLTOUT|domainALLDDL", 
		 "H-TRACK_MULTIPLICITY-V0002.003-CENTRAL-ALL"
		 );

  config.AddItem(
		 "BarrelPt_v01", 
		 "domainHLTOUT|domainALLDDL", 
		 "H-TRACK_MULTIPLICITY-V0002.004-CENTRAL-ALL"
		 );

  config.AddItem(
		 "BarrelPt_v01", 
		 "domainHLTOUT|domainALLDDL", 
		 "H-TRACK_MULTIPLICITY-V0002.005-CENTRAL-ALL"
		 );

  // -- Min bias trigger
  config.AddItem(
		 "true",
		 "domainALLDDL|domainHLTOUT", 
		 10, "H-MINBIAS_SCALE_DOWN-V0002.001-CENTRAL-ALL"
		 );

  
  // /////////////////////////////////////////////////////////////////////////////////////////	
  // default domain in case there is no global trigger
  // readout the output of the reconstruction
  // this refers to the domain domainHLTOUT|domainHLTDDL
  config.SetDefaultTriggerDescription("No HLT global trigger");

  // HLT payload also stored for not triggered events
  config.DefaultTriggerDomain().Add("*******", "HLT ");
  AliHLTReadoutList readoutlist;
  readoutlist.Enable(AliHLTReadoutList::kHLT);
  config.DefaultTriggerDomain().Add(readoutlist);
  
  
  TObject* menu = AliHLTGlobalTriggerConfig::Menu()->Clone();
  menu->Print();
  
  // /////////////////////////////////////////////////////////////////////////////////////////	
  // Write the trigger menu object to the CDB.
  AliCDBId id("HLT/ConfigHLT/HLTGlobalTrigger", firstRun, lastRun, version);
  AliCDBMetaData* metaData = new AliCDBMetaData();
  metaData->SetResponsible("ALICE HLT [email protected]");
  metaData->SetComment("HM-PHYSICS-V0001");
  storage->Put(menu, id, metaData);


  // /////////////////////////////////////////////////////////////////////////////////////////	
  // /////////////////////////////////////////////////////////////////////////////////////////	
  // /////////////////////////////////////////////////////////////////////////////////////////	
  //
  // component configurations
  gROOT->LoadMacro("$ALICE_ROOT/HLT/exa/makeComponentConfigurationObject.C");

  // /////////////////////////////////////////////////////////////////////////////////////////	
  // configuration of BarrelMultiplicityTrigger instances
  makeComponentConfigurationObject("HLT/ConfigHLT/BarrelMultiplicityTrigger", "-mintracks 10", cdbPath, firstRun, lastRun);
  makeComponentConfigurationObject("HLT/ConfigHLT/BarrelHighMultiplicity", "-mintracks 100"  , cdbPath, firstRun, lastRun);
  makeComponentConfigurationObject("HLT/ConfigHLT/BarrelPt_v01", "-mintracks 1 -minpt 0.5"   , cdbPath, firstRun, lastRun);
  makeComponentConfigurationObject("HLT/ConfigHLT/BarrelPt_v02", "-mintracks 1 -minpt 1.0"   , cdbPath, firstRun, lastRun);
  makeComponentConfigurationObject("HLT/ConfigHLT/BarrelPt_v03", "-mintracks 1 -minpt 5.0"   , cdbPath, firstRun, lastRun);
}
Пример #7
0
void cafZFlatNtupleMaker(int ind, int partype, int syscode)
{
	gROOT->ProcessLine(".!date");
	gBenchmark->Start("metphoana_time");


	std::ostringstream ostr;
	ostr << ind;
	std::string base_dir("./");
	std::string str_ind = ostr.str();


	
	int datasets = 0;

		if (partype == 0) { //zee
			datasets = 8;
		} else if (partype == 1) { //zmumu
			datasets = 8;
		} else if (partype == 2) { //ztautau
			datasets = 2;
		}

	TStnAna* ap = new TStnAna();
	ap->GetInputModule()->SetPrintLevel(1);	// print file name as they are opened
	
	TStnCatalog* c = new TStnCatalog();
		
	TStnDataset *dsp[datasets];
	
		if (partype == 0) {
			dsp[0] = new TStnDataset("cdfpstn","ze1s6d");
			dsp[1] = new TStnDataset("cdfpstn","ze1sad");
			dsp[2] = new TStnDataset("cdfpstn","ze0scd");
			dsp[3] = new TStnDataset("cdfpstn","ze0sdd");
			dsp[4] = new TStnDataset("cdfpstn","ze0sed");
			dsp[5] = new TStnDataset("cdfpstn","ze0see");
			dsp[6] = new TStnDataset("cdfpstn","ze0seh");
			dsp[7] = new TStnDataset("cdfpstn","ze0sej");

			c->InitDataset(dsp[0]);
			c->InitDataset(dsp[1]);
			c->InitDataset(dsp[2]);
			c->InitDataset(dsp[3]);
			c->InitDataset(dsp[4]);
			c->InitDataset(dsp[5]);
			c->InitDataset(dsp[6]);
			c->InitDataset(dsp[7]);
			ap->AddDataset(dsp[0]);
			ap->AddDataset(dsp[1]);
			ap->AddDataset(dsp[2]);
			ap->AddDataset(dsp[3]);
			ap->AddDataset(dsp[4]);
			ap->AddDataset(dsp[5]);
			ap->AddDataset(dsp[6]);
			ap->AddDataset(dsp[7]);
		}

		if (partype == 1) {
			dsp[0] = new TStnDataset("cdfpstn","ze1s6m");
			dsp[1] = new TStnDataset("cdfpstn","ze1s9m");
			dsp[2] = new TStnDataset("cdfpstn","ze0sbm");
			dsp[3] = new TStnDataset("cdfpstn","ze0scm");
			dsp[4] = new TStnDataset("cdfpstn","ze0sdm");
			dsp[5] = new TStnDataset("cdfpstn","ze0sem");
			dsp[6] = new TStnDataset("cdfpstn","ze0sfm");
			dsp[7] = new TStnDataset("cdfpstn","ze0sgm");
			c->InitDataset(dsp[0]);
			c->InitDataset(dsp[1]);
			c->InitDataset(dsp[2]);
			c->InitDataset(dsp[3]);
			c->InitDataset(dsp[4]);
			c->InitDataset(dsp[5]);
			c->InitDataset(dsp[6]);
			c->InitDataset(dsp[7]);
			ap->AddDataset(dsp[0]);
			ap->AddDataset(dsp[1]);
			ap->AddDataset(dsp[2]);
			ap->AddDataset(dsp[3]);
			ap->AddDataset(dsp[4]);
			ap->AddDataset(dsp[5]);
			ap->AddDataset(dsp[6]);
			ap->AddDataset(dsp[7]);
		}

		if (partype == 2) {
			dsp[0] = new TStnDataset("cdfpstn","ze0s8t");
			dsp[1] = new TStnDataset("cdfpstn","ze0sat");
			c->InitDataset(dsp[0]);
			c->InitDataset(dsp[1]);
			ap->AddDataset(dsp[0]);
			ap->AddDataset(dsp[1]);
		}


		double sum=0;
		for (int i=0; i < datasets; i++) {
			std::cout << "Nfile="<< dsp[i]->GetNFiles() << std::endl;
			std::cout << "NEvts="<< dsp[i]->GetNEvents() << std::endl;
			sum+= dsp[i]->GetNEvents();
			TObjArray* myarr = dsp[i]->GetListOfFiles();
			TIterator *it = myarr->MakeIterator();
			TObject *obj;
			while (obj = (TObject*) it->Next()) {
				obj->Print();
			}
		}
		std::cout << "Total Evts="<< sum << std::endl;




	int split = 0;

	if (partype == 0 || partype == 1) split = 200;
	if (partype == 2) split = 10;	
	
		std::cout << "split, IND=" << ind << ", " << split <<std::endl;
		ap->SetSplit(ind, split);
		std::cout << "syscode, MomPdg, parType=" << syscode << ", " << 23 << ", " << partype <<std::endl;



	TH1::AddDirectory(kFALSE); //do not add these histos to memory 
	

  /******************************************************/
  // define all module here
  /******************************************************/
  
  //PassFailTree *passFailFile = new PassFailTree;
  //BadPointerChecker *ptChecker = new BadPointerChecker;
  
	TriggerModule* trigMod;
	trigMod = new TriggerModule;
		trigMod->SetGoodRunListFile("goodrun_v19_pho_00.txt");  // to p13
		trigMod->SetGoodRunBit(1);		//1= use good run, 0=do not use it
		trigMod->SetTriggerBit(0);		// 1= require tigger, 0=NO
		trigMod->SetMinVtx(0);
		trigMod->SetMaxVtx(1000);
		trigMod->SetUseVtxZcut(0);		//1= require z<60 0=not cut on z
	
	InitSuperPhotons* myinit = new InitSuperPhotons;

	TagTightPhotons* tagTight = new TagTightPhotons;
	TagLoosePhotons* tagLoose = new TagLoosePhotons;
	
	TagElectrons* tagTightEle = new TagElectrons;
	TagLooseElectrons* tagLooseEle = new TagLooseElectrons;

	PhoEleFilter* pef = new PhoEleFilter;

	TMyJetFilterModule *m5 = new TMyJetFilterModule();  //---------- My Vertex Filter Initialization
		m5->SetMinNjet15(1);				//Jets required to pass (Et>15GeV)
		m5->SetJTC_imode(0); 			// 0==MC; 1==data
		m5->SetJTC_systcode(syscode);			// if >0 +sigma deviation, <0 -sigma deviation, all corrections are added in quadratures up to the given correction level
		m5->SetUnclParamSwitch(0); 	// 0==photon parametrization; 1==Zee parametrization 
		m5->SetMaxDeltaPhiJMet(0.3); 	// controls dPhi in MyMetCleanUpCut
		m5->SetNpointsToGenerate(0); 	// number of pseudo-experiments per each event
		m5->SetSelectMetEvent(0); 		// 0==do nothing; 1==select event with large MET
		m5->SetRemoveDuplicate(0); 	// 0==do nothing; 1==remove "duplicate" events; -1==select "duplicate" events; "duplicate"==bad match with jets  
		m5->SetRemoveBadMet(0); 		// -1=select events with bad met; 1=remove events with bad met; 0==do nothing
		///m5->SetUseMetPDFscenario(1);  // this over writes the Npoints generates. scenarios 1=370
												//	2=1000, 3=100000,4=15873,5=100 default=100
		m5->SetDumpEvent(0); 			// 0==do nothing; 1==dump event
		m5->SetDumpEventFileName("DATA_dumpEvent.dat");
		m5->SetLargeMetEventFileName("DATA_largeMetEvent.dat");
		m5->SetDatFileName("DATA_jet.dat");
		

	//TagPMTSpikes* tagPMT = new TagPMTSpikes;
		//tagPMT->SetMode(1);	//1= pass only if no spikes found
	
	TagBeamHalo* tagBH = new TagBeamHalo();
	
	//TEmTimingModule* EmT = new TEmTimingModule();
	
	//SetEmTimes* setEmTime = new SetEmTimes;  // set EM time of super photons
		//setEmTime->SetEmTimeCorrectionFile("EmTCEMtable_p13.txt");

	TagPhoenixPhotons* tagPhoenix = new TagPhoenixPhotons;
	
	TagConvElectrons* tagConvEle = new TagConvElectrons;

	FlatStupleMaker_MC_EWK *flatS = new FlatStupleMaker_MC_EWK;	
		flatS->SetMomPDG(23);
		flatS->SetDecayType(partype);			//0=z->ee,1=z->nunu,2=z->tautau
		std::string Stuple;
			if (partype == 0) Stuple="Stuple_Zee.root"; 
			if (partype == 1) Stuple="Stuple_Zmm.root"; 
			if (partype == 2) Stuple="Stuple_Ztt.root"; 

		std::string stuplefile = base_dir + Stuple + str_ind;
		flatS->SetStupleName(stuplefile.c_str()); 
	
	//ap->AddModule(passFailFile,1);
	//ap->AddModule(ptChecker,1);
	ap->AddModule(trigMod,1);
	ap->AddModule(myinit,1);
	ap->AddModule(tagTight,1);
	ap->AddModule(tagLoose,1);
	ap->AddModule(tagTightEle,1);
	ap->AddModule(tagLooseEle,1);
	ap->AddModule(pef,1);
	ap->AddModule(m5,1);
	//ap->AddModule(tagPMT,1);
	ap->AddModule(tagBH,1);
	//ap->AddModule(EmT,1);
	//ap->AddModule(setEmTime,1);
	ap->AddModule(tagPhoenix,1);
	ap->AddModule(tagConvEle,1);
	ap->AddModule(flatS,1);

	ap->GetInputModule()->SetPrintLevel(1);	// print file name as they are opened
	ap->Run();
  	
	
	std::string filename = "FlatStuple.root"+str_ind;
	ap->SaveHist(filename.c_str(),2);
	std::cout << "/************* JOB SUMMARY ******************************/" <<std::endl;
	std::cout << "::::::::: Created ROOT file      => "<< filename << std::endl;
	//std::cout << "::::::::: Created Pass/Fail file => "<< passFailFile->GetFileName() << std::endl;
	gBenchmark->Show("metphoana_time");
	gROOT->ProcessLine(".!date");
	std::cout << "/********************************************************/" <<std::endl;
	
	//gROOT->ProcessLine(".q");
}