ROOT logo
void hlt_rec(const char* input="./") {

  // For real data:
 // AliCDBManager::Instance()->SetDefaultStorage("raw://");
 
  gStyle->SetPalette(1);

  if(!gSystem->AccessPathName("galice.root")){
    cerr << "please delete the galice.root or run at different place." << endl;
    return;
  }
 
  if (!input) {
    cerr << "please specify input or run without arguments" << endl;
    return;
  }

  //////////////////////////////////////////////////////////////////////////////////////////////////
  //
  // init the HLT system in order to define the analysis chain below
  //
  
  AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance();

  gHLT->LoadComponentLibraries("libAliHLTUtil.so");
  gHLT->LoadComponentLibraries("libAliHLTRCU.so");
  gHLT->LoadComponentLibraries("libAliHLTCalo.so");
  gHLT->LoadComponentLibraries("libAliHLTEMCAL.so");
  gHLT->LoadComponentLibraries("libAliHLTPHOS.so");
  gHLT->LoadComponentLibraries("libAliHLTGlobal.so");

  //////////////////////////////////////////////////////////////////////////////////////////////////
  //
  // define the analysis chain to be run
  //

  // Define which modules and RCUs to use
  int moduleStart = 0;
  int moduleEnd = 9;
  int rcuStart = 0;
  int rcuEnd = 1;
  
  // The number of RCUs per module in EMCAL (used for calculating data specification)

  Int_t rcusPerModule = 2;
  Int_t ddlOffset = 4608; // The DDL offset for EMCAL (for PHOS the number is 1792)
  
  TString arg, fwInput, ecInput, dm;

  // Loop over the modules/RCUs
  for (int module = moduleStart; module <= moduleEnd; module++) 
    {
      TString clInput;
      
      for(int rcu = rcuStart; rcu <= rcuEnd; rcu++) 
	{
	  TString publisher, rawanalyzer, dm;

	  // Raw data publisher
	  publisher.Form("EMC-RP_%02d_%d", module, rcu);
	  
	 arg.Form("-verbose -minid %d -datatype 'DDL_RAW ' 'EMCA'  -dataspec 0x%x ", ddlOffset + module*(rcusPerModule) + rcu, 0x1 << (module*rcusPerModule + rcu));
	  AliHLTConfiguration pubConf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
	  cout << arg.Data() << endl;

	  // Raw analyzer
	  arg = "";
	  rawanalyzer.Form("EMC-RA_%02d_%d", module, rcu);
	  AliHLTConfiguration rawConf(rawanalyzer.Data(), "EmcalRawCrude", publisher.Data(), arg.Data());
	   
	  // If you want to have a component subscribing to all the raw analyzers this will be it's input
	  if(fwInput.Length() > 0) fwInput += " ";
	  fwInput+=rawanalyzer;
	  cout << ">>>>>>>>>> fwInput:" << fwInput << endl;
	  
          // digit maker components
          dm.Form("EMC-DM_%02d_%d", module, rcu);
          arg="";
	  // HI-GAIN ~ 15/256 ------ CHECK LOW GAIN FACTOR
          arg.Form("-highgainfactor 0.0167 -lowgainfactor 0.08");
          AliHLTConfiguration dmConf(dm.Data(), "EmcalDigitMaker", rawanalyzer.Data(), arg.Data());
          if(clInput.Length() > 0) clInput += " ";
          clInput+=dm;
	  cout << ">>>>>>>>>> clInput:" << clInput << endl;	
	
	} // end of RCU loop

   	TString cl, ca;

      	cl.Form("EMC-CL_%02d", module);
      	arg = "";
	// digitthreshold was 0.005
      	arg.Form("-digitthreshold 0.0167 -recpointthreshold 0.1");
      	AliHLTConfiguration clConf(cl.Data(), "EmcalClusterizer", clInput.Data(), arg.Data());
      	if(ecInput.Length() > 0) ecInput += " ";
      	ecInput += cl;

    } // end of module loop

  TString ec, test;

     // The call the histo maker 
  	arg.Form("");
  	arg.Form("-pushfraction 5 -beverbose 1");
	test = ecInput + " " + fwInput + " ";
  	AliHLTConfiguration hfConf("emcalHisto","EmcalRawHistoMaker",test.Data(), arg.Data());
	ecInput += " emcalHisto";
	cout << ">>>>>>>>>> test:" << test << endl;	
		
    	ec.Form("ESD-CONVERTER");
    	arg = "";
 	AliHLTConfiguration esdcconf(ec.Data(), "GlobalEsdConverter"   , ecInput.Data(), "");


  // The filewriter 
//  arg.Form("-datatype 'CHANNELT' 'EMCA' -datafile RAout.root -concatenate-blocks -concatenate-events");
//  AliHLTConfiguration fwConf("filewriter", "FileWriter", fwInput.Data(), arg.Data());
  
  // The call the histo maker 
//  arg.Form("");
//  arg.Form("-pushfraction 5 -beverbose 1");
//  AliHLTConfiguration hfConf("emcalHisto","EmcalRawHistoMaker",fwInput.Data(), arg.Data());
  
  // Write the root file 
  //AliHLTConfiguration rwConf("rootFileHisto","ROOTFileWriter", "emcalHisto ESD-CONVERTER","-datafile roothisto.root -concatenate-events -overwrite");



  
  //////////////////////////////////////////////////////////////////////
  //
  // Init and run the reconstruction
  // All but HLT reconstruction is switched off 
  //
  /////////////////////////////////////////////////////////////////////

  TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTCalo.so libAliHLTEMCAL.so libAliHLTGlobal.so chains=";
  option+="ESD-CONVERTER";
  //option+="rootFileHisto loglevel=0x5f";

  AliReconstruction rec;
  

  // uncomment for simulation
  rec.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  rec.SetSpecificStorage("GRP/GRP/Data", Form("local://%s",gSystem->pwd()));

  rec.SetRunReconstruction(":");
  rec.SetEventRange(0,10);
  rec.SetInput(input);
  
  //rec.SetInput("raw.root");
  rec.SetRunVertexFinder(kFALSE);

  rec.SetRunReconstruction("HLT");
  //rec.SetRunTracking(":");
  rec.SetLoadAlignFromCDB(0);
  rec.SetRunQA(":");

  rec.SetOption("HLT", option);
  
  rec.Run();


}
 hlt_rec.C:1
 hlt_rec.C:2
 hlt_rec.C:3
 hlt_rec.C:4
 hlt_rec.C:5
 hlt_rec.C:6
 hlt_rec.C:7
 hlt_rec.C:8
 hlt_rec.C:9
 hlt_rec.C:10
 hlt_rec.C:11
 hlt_rec.C:12
 hlt_rec.C:13
 hlt_rec.C:14
 hlt_rec.C:15
 hlt_rec.C:16
 hlt_rec.C:17
 hlt_rec.C:18
 hlt_rec.C:19
 hlt_rec.C:20
 hlt_rec.C:21
 hlt_rec.C:22
 hlt_rec.C:23
 hlt_rec.C:24
 hlt_rec.C:25
 hlt_rec.C:26
 hlt_rec.C:27
 hlt_rec.C:28
 hlt_rec.C:29
 hlt_rec.C:30
 hlt_rec.C:31
 hlt_rec.C:32
 hlt_rec.C:33
 hlt_rec.C:34
 hlt_rec.C:35
 hlt_rec.C:36
 hlt_rec.C:37
 hlt_rec.C:38
 hlt_rec.C:39
 hlt_rec.C:40
 hlt_rec.C:41
 hlt_rec.C:42
 hlt_rec.C:43
 hlt_rec.C:44
 hlt_rec.C:45
 hlt_rec.C:46
 hlt_rec.C:47
 hlt_rec.C:48
 hlt_rec.C:49
 hlt_rec.C:50
 hlt_rec.C:51
 hlt_rec.C:52
 hlt_rec.C:53
 hlt_rec.C:54
 hlt_rec.C:55
 hlt_rec.C:56
 hlt_rec.C:57
 hlt_rec.C:58
 hlt_rec.C:59
 hlt_rec.C:60
 hlt_rec.C:61
 hlt_rec.C:62
 hlt_rec.C:63
 hlt_rec.C:64
 hlt_rec.C:65
 hlt_rec.C:66
 hlt_rec.C:67
 hlt_rec.C:68
 hlt_rec.C:69
 hlt_rec.C:70
 hlt_rec.C:71
 hlt_rec.C:72
 hlt_rec.C:73
 hlt_rec.C:74
 hlt_rec.C:75
 hlt_rec.C:76
 hlt_rec.C:77
 hlt_rec.C:78
 hlt_rec.C:79
 hlt_rec.C:80
 hlt_rec.C:81
 hlt_rec.C:82
 hlt_rec.C:83
 hlt_rec.C:84
 hlt_rec.C:85
 hlt_rec.C:86
 hlt_rec.C:87
 hlt_rec.C:88
 hlt_rec.C:89
 hlt_rec.C:90
 hlt_rec.C:91
 hlt_rec.C:92
 hlt_rec.C:93
 hlt_rec.C:94
 hlt_rec.C:95
 hlt_rec.C:96
 hlt_rec.C:97
 hlt_rec.C:98
 hlt_rec.C:99
 hlt_rec.C:100
 hlt_rec.C:101
 hlt_rec.C:102
 hlt_rec.C:103
 hlt_rec.C:104
 hlt_rec.C:105
 hlt_rec.C:106
 hlt_rec.C:107
 hlt_rec.C:108
 hlt_rec.C:109
 hlt_rec.C:110
 hlt_rec.C:111
 hlt_rec.C:112
 hlt_rec.C:113
 hlt_rec.C:114
 hlt_rec.C:115
 hlt_rec.C:116
 hlt_rec.C:117
 hlt_rec.C:118
 hlt_rec.C:119
 hlt_rec.C:120
 hlt_rec.C:121
 hlt_rec.C:122
 hlt_rec.C:123
 hlt_rec.C:124
 hlt_rec.C:125
 hlt_rec.C:126
 hlt_rec.C:127
 hlt_rec.C:128
 hlt_rec.C:129
 hlt_rec.C:130
 hlt_rec.C:131
 hlt_rec.C:132
 hlt_rec.C:133
 hlt_rec.C:134
 hlt_rec.C:135
 hlt_rec.C:136
 hlt_rec.C:137
 hlt_rec.C:138
 hlt_rec.C:139
 hlt_rec.C:140
 hlt_rec.C:141
 hlt_rec.C:142
 hlt_rec.C:143
 hlt_rec.C:144
 hlt_rec.C:145
 hlt_rec.C:146
 hlt_rec.C:147
 hlt_rec.C:148
 hlt_rec.C:149
 hlt_rec.C:150
 hlt_rec.C:151
 hlt_rec.C:152
 hlt_rec.C:153
 hlt_rec.C:154
 hlt_rec.C:155
 hlt_rec.C:156
 hlt_rec.C:157
 hlt_rec.C:158
 hlt_rec.C:159
 hlt_rec.C:160
 hlt_rec.C:161
 hlt_rec.C:162
 hlt_rec.C:163
 hlt_rec.C:164
 hlt_rec.C:165
 hlt_rec.C:166