Re: centrality and question

From: Stephen J. Sanders (ssanders@ukans.edu)
Date: Thu May 03 2001 - 14:09:51 EDT

  • Next message: Christian Holm Christensen: "BRAT update and Re: centrality and question"

    Hiro, Thanks.  Adding Trig to BratLoad.C did the trick for the second
    problem.   ...steve
    
    Hironori Ito wrote:
    
    > 	About the Error "undefined symbol: __12BrTrigScalerPCcT1 ".  You
    > need to put "Trig" in the BratLoad.C file if you are using simple root.  I
    > am not sure it is loaded in bratroot.  
    > 
    > 	Hiro
    > 	
    > On Thu, 3 May 2001, Stephen J. Sanders wrote:
    > 
    >> Hi,  At the collaboration meeting last week we agreed that for the
    >> multiplicity paper we would analyze the dN/deta
    >> distributions for the different detector systems using common centrality
    >> cuts: 0-5, 5-10, 10-20,20-30,30-40,40-50.  It was also decided to use the
    >> centrality derived from the Si+Tile multiplicities for this analysis.
    >> Yesterday I made a few minor corrections to the mult routines so that
    >> BrMultCent reports the same centrality as the earlier BrRdoModuleMult
    >> module.  The returned centrality is given in percent.   In order to get the
    >> correct results, however, you MUST set the OutlierMethod in
    >> BrSiRdoModule and BrTileRdoModule to kNoCorrection.
    >> This is NOT the default for the BrTileTdoModule, and a coding error
    >> in BrSiRdoModule (now fixed) prevented it from being the default there.
    >> The code that I used to compare the old and new centrality classes
    >> is in brahms_app/sjs_app/mult/src/multReplay.cxx
    >> 
    >> 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.
    >> 
    >> First,  the BrMultCentModule segfaults when I attempt call the Init element
    >> in the interactive environment. 
    >> 
    >> ...so I thought I would see if I could get the rest working by 
    >> commenting cout
    >> statements referring to this module...
    >> 
    >> However, I now can only read the first data event from the raw data 
    >> file.  When
    >> it tries to read the second event, I get the error:
    >> 
    >> /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
    >> 
    >> My last brat update was yesterday and I completely rebuilt the system at 
    >> that time.  Does
    >> anyone have any idea what might cause the undefined symbol error?
    >> 
    >> I would like to get the stripped down interactive code working, but 
    >> otherwise things do seem
    >> to work OK in a compiled program.
    >> 
    >> 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)
    >> 
    >> #include <Centrality.h>
    >> 
    >> Centrality::Centrality(Int_t runno)
    >> {
    >>   Int_t i,j;
    >>   fRunno = runno;
    >> 
    >> //------------------------------------------------------------------
    >> // Create parameters database manager
    >>   BrParameterDbManager* fParamDBManager;
    >>   fParamDBManager = BrParameterDbManager::Instance();
    >>   fParamDBManager->SetDbParameterFileName("DetectorParameters.txt");
    >>   BrDetectorParamsTPC* tpm1_param = (BrDetectorParamsTPC*)
    >>    fParamDBManager->GetDetectorParameters("BrDetectorParamsTPC","TPM1");
    >> // Create and initialiaze a geometry manager
    >>   BrGeometryDbManager* geom = BrGeometryDbManager::Instance();
    >>   geom->SetDbFileName("mrs_90.geo");
    >> // Tile Calibrations
    >>   fTileCalibration = BrTileTmpCalibration::Instance();
    >>   fTileCalibration->SetDebugLevel(10);
    >>   cout<<"runno: "<<runno<<endl;
    >>   if(runno>0) fTileCalibration->ReadASCIIFile(runno);
    >>   cout<<" after fTileCalibration->ReadASCIIFILE"<<endl;
    >> // Si Calibrations
    >>   fSiCalibration = BrSiTmpCalibration::Instance();
    >>   fSiCalibration->SetDebugLevel(10);
    >>   if(runno>0) fSiCalibration->ReadASCIIFile(runno);
    >> 
    >> // Centrality Calibrations
    >>   fCalibration = BrMultCentTmpCalibration::Instance();
    >>   fCalibration->SetDebugLevel(10);
    >> 
    >> 
    >> }
    >> Centrality::~Centrality()
    >> {
    >> }
    >> 
    >> int Centrality::GetEvent(BrRawDataInput* input, BrEvent*& event)
    >> {
    >>   // Get next event
    >>   cout<<"GetEvent"<<endl;
    >>   BrEvent *e = new BrEvent("event", 0, 0);
    >>   cout<<"new BrEvent "<<e<<"  input: "<<input<<endl;
    >>   do {
    >>    input->Event(e);
    >>    cout<<" input: "<<input<<endl;;
    >>    if (input->Eof()) {
    >>      delete e;
    >>      cout<<"Returning status -1 from GetEvent"<<endl;
    >>      return -1;
    >>    }
    >>    if (input->Error()) {
    >>      delete e;
    >>      cout<<"Returning status 0 from GetEvent"<<endl;
    >>      input->Close(); // BrRawDataInput doesn't close on Error (only on EoF)
    >>      return 0;
    >>    }
    >>   } while (!input->GetDataState());
    >>   event = e;
    >>   cout<<"return event"<<event<<endl;
    >>   return 1;
    >> }
    >> 
    >> 
    >> 
    >> void Centrality::Replay( )
    >> {
    >>   Char_t fname[80];
    >>   Int_t seqnum;
    >>   Int_t status;
    >>   Int_t i;
    >>   Int_t ncnt;
    >>   Int_t EventNo;
    >>   Float_t bbZ;
    >>   Float_t zdcZ;
    >>   Float_t tpmZ;
    >>   Float_t bbMult;
    >>   Float_t vertex;
    >>  
    >>   TString* tableName = new TString;
    >>   *tableName = BrDetectorList::GetDetectorName(kBrTPM1);
    >>   *tableName += " Cluster VtxData";
    >>  
    >>   BrRdoModuleZDC * rdoZDC = new 
    >> BrRdoModuleZDC("BrRdoModuleZDC","BrRdoModuleZDC");
    >>   rdoZDC->Init();
    >>   BrRdoModuleBB * rdoBB = new 
    >> BrRdoModuleBB("BrRdoModuleBB","BrRdoModuleBB");
    >>   BrTPCClusterFinder * cluster = new BrTPCClusterFinder("TPM1","TPM1");
    >>   BrTPMClusterVertexModule * rdoVtx = new 
    >> BrTPMClusterVertexModule("VTX","VertexFinder","TPM1");
    >>   BrTileRdoModule * rdoTile = new BrTileRdoModule("tile","tile");
    >>   rdoTile->Init();
    >>   rdoTile->SetDebugLevel(0);
    >>   BrTileRdoModule::EOutlierMethod fTileOutlier = 
    >> (BrTileRdoModule::EOutlierMethod) 3;
    >>   rdoTile->SetOutlierMethod( fTileOutlier);
    >>   cout<<" rdoTile defined"<<endl;
    >>   BrSiRdoModule * rdoSi = new BrSiRdoModule("si","si");
    >>   rdoSi->Init();
    >>   rdoSi->SetDebugLevel(0);
    >>   BrSiRdoModule::EOutlierMethod fSiOutlier = 
    >> (BrSiRdoModule::EOutlierMethod) 3;
    >>   rdoSi->SetOutlierMethod( fSiOutlier);
    >>   cout<<" rdoSi defined"<<endl;
    >>   //BrMultCentModule* centModule = new BrMultCentModule("cent","cent");
    >>   //centModule->Init();
    >>   //centModule->SetDebugLevel(0);
    >>   //cout<<" centModule defined"<<endl;
    >>  
    >>   rdoBB->SetDebugLevel(0);
    >>   rdoBB->Init();
    >>   cluster->SetMaxPixelCutoff( 10.0 );
    >>   cluster->Init();
    >>   cluster->SetDebugLevel(0);
    >>  
    >>   rdoVtx->Init();
    >>   BrTPCPreProcess *preProcessor = new BrTPCPreProcess( "TPM1", "TPM1 
    >> Preprocessor" );
    >>   preProcessor->Init();
    >>   seqnum = 0;
    >>  
    >>   status=0;
    >>   ncnt=0;
    >>   seqnum = 0;   
    >>   sprintf(fname,"data/run%6dseq%3d.dat",fRunno,seqnum);
    >>   for(i=0;i<(Int_t) strlen(fname);i++)
    >>    if(fname[i]==' ') fname[i]='0';
    >> 
    >>   input = new BrRawDataInput("test");
    >>   cout<<"Open Raw Data File: "<<fname<<endl;
    >>   if(!input->Open(fname,"DISKFILE"))
    >>    {
    >>      cout<< "Failed to open at A "<< fname<<endl;
    >>      return;
    >>    };
    >>   //Get first event to extract run number
    >>   if ((status=GetEvent(input, nextevent)) != 1)
    >>    {
    >>      cout<< "Failed to get first event"<<endl;
    >>      return;
    >>    };
    >>  
    >>   EventNo=nextevent->GetEventNumber();
    >>   cout<<"EventNo: "<<EventNo<<endl;
    >> 
    >>      delete nextevent;
    >>   //Get first event to extract run number
    >>   if ((status=GetEvent(input, nextevent)) != 1)
    >>    {
    >>      cout<< "Failed to get first event"<<endl;
    >>      return;
    >>    };
    >>  
    >>   EventNo=nextevent->GetEventNumber();
    >>   cout<<"2nd EventNo: "<<EventNo<<endl;
    >> 
    >>   maxevnt = 100;
    >>   cout<<"maxevnt = "<<maxevnt<<endl;
    >>   while(status==1 && ncnt<maxevnt)
    >>    {
    >>      BrEventNode * outNode = new BrEventNode("mult","mult");
    >>      cout<<"New BrEventNode"<<endl;
    >>      rdoZDC->Event(nextevent,outNode);
    >>      rdoBB->Event(nextevent,outNode);
    >>      BrRdoZDC  * rdodataZDC = (BrRdoZDC *) outNode->GetObject("RdoZDC");
    >>      BrRdoBB  * rdodataBB = (BrRdoBB *) outNode->GetObject("BB");
    >>      zdcZ   = (Float_t) rdodataZDC->GetZ();
    >>      bbZ    = (Float_t) rdodataBB->GetZ0() ;
    >>      bbMult = (Float_t) rdodataBB->GetMult();
    >>      vertex =(fabs(bbZ)>150.&&fabs(zdcZ)<100.)? zdcZ:bbZ;
    >>      cout<<"vertex: "<<vertex<<endl;
    >>      if(fabs(vertex)<110&&fabs(zdcZ)<200)
    >>      {
    >>    preProcessor->Event(nextevent);
    >>    cluster->Event(nextevent);
    >>    rdoVtx->SetDetectorHits(cluster->GetDetectorHits());
    >>    rdoVtx->Event(nextevent,outNode);
    >>    rdoTile->Event(nextevent,outNode);
    >>    rdoSi->Event(nextevent,outNode);
    >>    BrTileRdo * rdoTileNBI = (BrTileRdo *) outNode->GetObject("RdoMultTile");
    >>    BrSiRdo * rdoSiNBI = (BrSiRdo *) outNode->GetObject("RdoMultSi");
    >>    BrVertex* vtxTpm1 = (BrVertex*)outNode->GetObject(tableName->Data());
    >>    //centModule->Event(outNode,outNode);
    >>    //BrMultCent * cent = (BrMultCent *) outNode->GetObject("CentMult");
    >>    //cout<<"vertex: "<<vertex<<"   centrality: "<<cent->GetCent()<<endl; 
    >>    
    >>      }
    >>      ncnt++;
    >>      delete outNode;
    >>      delete nextevent;
    >>      status=GetEvent(input,nextevent);
    >>      cout<<" status"<<status<<endl;
    >>      if(status==-1)
    >>    {
    >>      cout<<"Last EventNo: " <<EventNo<<endl;
    >>      goto FIN;
    >>    }
    >>      EventNo=nextevent->GetEventNumber();
    >>    };
    >> FIN: cout<<"# of ntuple entries: "<<ncnt<<endl;
    >>   delete rdoZDC;
    >>   delete rdoBB;
    >> }
    >> 
    >> 
    >> 
    



    This archive was generated by hypermail 2b29 : Thu May 03 2001 - 14:11:03 EDT