Hi Christian, Thanks for the very clear example. I have gotten my script working, but your example is much cleaner. My only concern is your comment that the script will not currently work because of problems with some of the modules. We need to have a way for people working on the various charged particle multiplicity analyses needed for the paper to get hold of the common centrality values in the very near term. I understand Hiro and Yuri have already reworked the Si, Tile and BB analyses with some very encouraging results. However, we still need the reworked tpc results using the common centralities. Hopefully, the non-conforming classes will be corrected shortly. I will refrain from posting my script since it is clearly a brut force approach that, hopefully, will soon be obsolete. ...steve Christian Holm Christensen wrote: > Hi Steve et al, > > Before commenting Steve's mail, I'd like to take this chance to point > out that i've updated BRAT: > > * Some fixes in the build system > * Some fixes to do with uninitialised pointer in BrTileParameters > * Some fixes of superflous warnings in BrSiDigModule and > BrTileDigModule > > Updated version number: > > Version: 1.15.7 > CVS Tag: BRAT-1-15-7 > > If you feel we skipped 1.15.6 then you are right. I made that > release, but shortly after found out that it was buggy - sorry. > > On Thu, 03 May 2001 11:31:09 -0500 > "Stephen J. Sanders" <ssanders@ukans.edu> wrote > concerning ": centrality and question": > >> Now my question: Because several modules and corresponding calibrations >> are needed to obtain the centrality value, I wanted to come up with a >> minimal root program that could be run interactively and which would >> illustrate how to put the routines together to get the desired >> centrality results. I'm having considerable trouble with this, >> however. > > > Take a look at brahms_app/cholm_app/jobs/GlbPackage.{h,cxx} and > brahms_app/cholm_app/scripts/RdoConfig.C (in the BRAHMS CVS) for an > example of bundling all (more or less) global data modules together > into one package (GlbPackage) and a configuration script (RdoConfig.C) > to be used with TestMainModule. What you do is to build > GlbPackage.so (assuming Linux - see also Makefile): > > g++ `root-config --cflags` `brat-config --cflags` -I. \ > -g -c GlbPackage.cxx -o GlbPackage.o > rootcint -f GlbPackageCint.cxx -c `brat-config --cflags` -I. \ > GlbPackage.h > g++ `root-config --cflags` `brat-config --cflags` -I. \ > -g -c GlbPackageCint.cxx -o GlbPackageCint.o > g++ -Wl,-soname,GlbPackage.so -o GlbPackage.so \ > GlbPackageCint.o GlbPackage.o > > and put it somewhere searched by ROOT (as set in .rootrc variable > Unix.*.Root.DynamicPath), and put RdoConfig.C somewhere by ROOT (as > set in .rootrc variable Unix.*.Root.MacroPath), and then you're ready > to go: > > TestMainModule RdoConfig.C --help > > to get a list of options. I recommend doing > > TestMainModule RdoConfig.C -i <inputfile> -o <outputfile> \ > -H <histfile> -r <runno> -v 5 > > Incidently, this is what I've used for the past 2 months for all my > analysis on CRF and a sligtly modified RdoConfig.C for local analysis > jobs. > > >> /home/sanders/cern/root_v3.00.06/bin/root.exe: error in loading shared >> libraries: /home/sanders/Brahms/brat/lib/linux/libBrat_Raw.so: undefined >> symbol: __12BrTrigScalerPCcT1 > > > As Hiro said, it has to do with your BratLoad.C. I've updated the one > in brat/test. I've also updated bratroot to preload libBrat_Trig and > updated brat-config to output that library as well if you request > --modlibs. > >> I would like to get the stripped down interactive code working, but >> otherwise things do seem to work OK in a compiled program. > > > In theory, it should be possible to run RdoConfig.C interactively, if > one does away with all the BrAppOption's and BrAppOptionManager, and > replaces that by variables. Then one would have to send the message > BrMainModule::Main by hand though: > > brat [0] .x ModifiedRdoConfig.C > brat [1] BrMainModule::Instance()->Main(); > > >> The disfunctional code that I'm trying to get working follows: (It still >> has a lot of stuff that isn't really needed for just getting out a >> centrality) > > > Rather than commenting on your code, I thought I'd supply you with an > example of how I would do it. Please note that the script will not > work, 'cause some of the modules behave non-module like! Please refer > to the comments in the script to see which. Also refer to the script > to see how to run it interactively. I know the script looks rather > long, but half of it is comments, so it shouldn't be too hard to > read. > > There's another thing: Comments - please comment your code!!! This > goes for quite a lot of people in fact. I had to poke around a bit, > and I was dazzled by the tremendious non-existence of comments! > > This script is a watered down version of what I got in RdoConfig.C. > Feel free to comment, ask questions, and use this example. I believe > the overall idea is somewhat clear. For more, see also class > docuemnation on BrMainModule, BrModule, BrModuleContainer, and source > code of TestMainModule.cxx. > > Yours, > > Christian ----------------------------------------------------------- > Holm Christensen Phone: (+45) 35 35 96 91 > Sankt Hansgade 23, 1. th. Office: (+45) 353 25 305 > DK-2200 Copenhagen N Web: www.nbi.dk/~cholm > Denmark Email: cholm@nbi.dk > > > ------------------------------------------------------------------------ > > // > // 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 > > CentConfig.C > > Content-Type: > > Text/Plain > Content-Encoding: > > 7bit > >
This archive was generated by hypermail 2b29 : Thu May 03 2001 - 22:07:26 EDT