// // Example script for running a centrality analysis. // Do // // promtp% bratroot // brat [0] .x cent.C // brat [1] BrMainModule::Instance()->Main(); // // That's it. // // #ifndef __CINT__ CentConfig() #endif { //================================================================== // // Some local variables // Int_t maxEvents = 1000000; Int_t runNo = 0; const Char_t* geomFile = "mrs_90.geo"; const Char_t* inputFile = ""; const Char_t* outputFile = "output.root"; Int_t nInputs = 1; Int_t debug = 0; Int_t verbose = 5; //================================================================== // // Our various managers. // BrParameterDbManager* fParamDBManager = BrParameterDbManager::Instance(); fParamDBManager->SetDbParameterFileName("DetectorParameters.txt"); BrGeometryDbManager* geom = BrGeometryDbManager::Instance(); geom->SetDbFileName(geomFile); //__________________________________________________________________ // // Temporary hack for Tile and Silicon calibrations // BrTileTmpCalibration* tileCalib = BrTileTmpCalibration::Instance(); tileCalib->ReadASCIIFile(runNo); BrSiTmpCalibration* siCalib = BrSiTmpCalibration::Instance(); siCalib->ReadASCIIFile(runNo); //================================================================== // // Our main module container. // BrMainModule* mainModule = new BrMainModule("CentMainModule", "Centrality config", "Steve Sanders", 0, 1, 0); mainModule->SetMaxEvents(maxEvents); mainModule->SetMaxRuns(nInputs); //================================================================== // // Now for our modules // // Our input module // BrIOModule* inputModule = new BrRawDataInput("rawInput", "Raw Data Input"); if (nInputs == 1) { // For one input file inputModule->SetIOMode(BrIOModule::kBrJobFile| BrRawDataInput::kBrRawDiskFile); inputModule->AddFile(inputFile); } else { // If we wanted more than one input file we could do inputModule->SetIOMode(BrIOModule::kBrRunFile| BrRawDataInput::kBrRawDiskFile); char* baseName[128]; for (Int_t i = 0; i < nInputs; i++) { sprintf(baseName, "run%06dseq%03d.dat", runNo, i); inputModule->AddFile(baseName); } } // We can easly add BrIOModules to a container! mainModule->AddModule(inputModule); //__________________________________________________________________ // // Histogram module to make sure we get hsitograms the right // place. // BrHistIOModule* histModule = new BrHistIOModule("histograms", "Some histograms"); histModule->AddFile(histOption->GetValue()); mainModule->AddModule(histModule); mainModule->SetHistOn(); //__________________________________________________________________ // // Trigger filter to select some specific triggers // BrTriggerFilter* trigModule = new BrTriggerFilter("trigModule", "Trigger Filter"); // trigModule->AddTrigger(1); // trigModule->AddTrigger(4); // trigModule->AddTrigger(5); trigModule->AddTrigger(6); mainModule->AddModule(trigModule); //__________________________________________________________________ // // ZDC module // BrRdoModuleZDC* zdcModule = new BrRdoModuleZDC("ZDC", "ZDC Reducer"); mainModule->AddModule(zdcModule); //__________________________________________________________________ // // BB module // BrRdoModuleBB* bbModule = new BrRdoModuleBB("BB","Beam-Beam Reducer"); mainModule->AddModule(bbModule); //__________________________________________________________________ // // TPM1 seqeunce preprocessor // BrTPCPreProcess *preProcessor = new BrTPCPreProcess("TPM1", "TPM1 Preprocessor"); mainModule->AddModule(preProcessor); //__________________________________________________________________ // // TPM1 cluster module // // Who ever made this module _must_ make sure that the // BrTPCClusterFinder has the method // Event(BrEventNode*, BrEventNode*) // This is very VERY important! BrTPCClusterFinder* tpm1clsModule = new BrTPCClusterFinder("TPM1", "TPM1"); tpm1clsModule->SetMaxPixelCutoff(10); mainModule->AddModule(tpm1clsModule); //__________________________________________________________________ // // TPM1 cluster vertex module // // Who ever wrote this should redefine the cosntructor to take only // two arguments: The name and the title. The proper place to // specify the name of the detector is in the name! BrTPMClusterVertexModule* tmp1vtxModule = new BrTPMClusterVertexModule("VTX", "VertexFinder","TPM1"); mainModule->AddModule(tmp1vtxModule); //__________________________________________________________________ // // TMA Module // BrTileRdoModule* tileModule = new BrTileRdoModule("MultTile","Tile Reducer"); tileModule->SetOutlierMethod(BrTileRdoModule::kNoCorrection); mainModule->AddModule(tileModule); //__________________________________________________________________ // // SMA Module // BrSiRdoModule* siModule = new BrSiRdoModule("MultSi","Si Reducer"); siModule->SetOutlierMethod(BrSiRdoModule::kNoCorrection); mainModule->AddModule(siModule); //__________________________________________________________________ // // Output module // BrIOModule* outputModule = new BrEventIO("ouputModule", "Output module"); outputModule->SetIOMode(BrIOModule::kBrJobFile| BrIOModule::kBrRecreateFile); outputModule->AddFile(outputFile); mainModule->AddModule(outputModule); //================================================================== // // That is it. Now we just need to tell what kind of debug and // verbosity level we want. // mainModule->SetDebug(debug); mainModule->SetVerbose(verbose); } #ifndef __CINT__ // This is how one could encapsulate the trouble some TPC classes, so // that they could be put in a container class TPCFUBAR : public BrModule { private: BrTPCPreProcess* fPreProcessor; BrTPCClusterFinder* fTpm1ClsModule; BrTPMClusterVertexModule* fTmp1VtxModule; public: TPCFUBAR(const char* name, const char* title) : BrModule(name, title) { fPreProcessor = new BrTPCPreProcess("TPM1", "TPM1 Preprocessor"); fTpm1ClsModule = new BrTPCClusterFinder("TPM1", "TPM1"); fTmp1VtxModule = new BrTPMClusterVertexModule("VTX", "VertexFinder","TPM1"); } void Init() { fPreProcessor->Init(); fTpm1ClsModule->Init(); fTmp1VtxModule->Init(); } void Event(BrEventNode* inNode, BrEventNode* outNode) { fPreProcessor->Event(inNode, outNode); fTpm1ClsModule->Event(inNode); fTmp1VtxModule->SetDetectorHits(fTpm1ClsModule->GetDetectorHits()); fTmp1VtxModule->Event(inNode, outnode); } ClassDef(TPCFUBAR, 0) // Hack for TPC modules }; ClassImp(TPCFUBAR); #endif