Re: Still can't get bb vertex

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Fri Oct 26 2001 - 14:47:14 EDT

  • Next message: Christian Holm Christensen: "Re: Still can't get bb vertex"

    On Fri, 26 Oct 2001 13:20:45 -0500
    "Stephen J. Sanders" <ssanders@ku.edu> wrote
    concerning "Still can't get bb vertex":
    > Hi,
    > I am still failing in getting the new bb vertex stuff working.  Hope 
    > someone
    > (Djamel?!) can tell me where I'm going wrong:
    > 
    > First I do the initilizations:
    > 
    >   BrMainDb *mainDb = BrMainDb::Instance();
    >   mainDb->SetUserName("query");
    >   mainDb->SetHostName("rcas0005.rcf.bnl.gov");
    >   mainDb->SetDbName("BrahmsMain");
    
    So far so good. 
     
    >   mainDb->Connect();
    >   mainDb->ConnectToCalib();
    >   mainDb->ConnectToRun();
    
    You should really check the return value of the Connect... messages,
    as they tell you wether or not your connected to the database. 
     
    >   BrCalibrationManager * calibManager = BrCalibrationManager::Instance();
    >   calibManager->Init();
    >   BrRunInfoManager::Instance()->Register(runno);
    >   BrRunInfoManager::Instance()->Init();
    >   BrRunInfoManager::Instance()->Update(runno);
    
    This is done bye the BrDbUpdateModule - don't do it here. 
    
    >   const BrRunInfo * runInfo = BrRunInfoManager::Instance()->GetCurrentRun();
    > 
    >   BrRunInfoManager::Instance()->List();
    
    
    Do not use List, it will disappear - use Print! 
    
    >   fBblCalibration = (BrBbCalibration *) 
    > (calibManager->Register("BrBbCalibration","BBL"));
    >   if(!fBblCalibration) cout<<"Didn't get left calibration from 
    > manager!!!"<<endl;
    >   fBbrCalibration = (BrBbCalibration *) 
    > (calibManager->Register("BrBbCalibration","BBR"));
    >   if(!fBbrCalibration) cout<<"Didn't get right calibration from 
    > manager!!!"<<endl;
    >   fBblCalibration->Print();
    >   fBbrCalibration->Print();
    
    Do not register calibrations in your setup.  Modules should register
    calibrations as they see fit. 
    
    > ****Which gives me the following output:
    > 
    > BrCalibrationManager::Init()
    
    This _must_ be done much later - all this is taken care of by the
    BrDbUpdateModule - don't do it here. 
    
    > Run information for run # 4713
    > -------------------------------------
    >  Run Type:         Data
    >  Events:           281453
    > GetDetectorParams Request
    >  BrBbCalibration : BBL
    >  Adding BrBbCalibration for BBL
    > GetDetectorParams Request
    >  BrBbCalibration : BBR
    >  Adding BrBbCalibration for BBR
    > BrCalibration: BBL - BBL
    > BrCalibration: BBR - BBR
    > 
    > 
    > ***Then I initialize the modules:
    > 
    >   BrDbUpdateModule * dbMod = new BrDbUpdateModule("DB","DB Update");
    >   dbMod->Init();
    
    This message BrDbUpdateModule::Init must be sent after all modules has
    been created - remember, there's a difference between creation/setup
    and initilisation time (see the flow diagram in "The Guide" - yep,
    that's another RTBM).  
    
    > 
    >   BrBbCalHitsModule * bbHits = new BrBbCalHitsModule("BB","BB Calibrated 
    > hit Module");
    >   bbHits->SetTreeOn(kFALSE);
    >   bbHits->SetUseOldCal(kFALSE);
    >   bbHits->SetMaxTdc(3800);
    >   bbHits->SetMinTdc(10);
    >   bbHits->Init();
    > 
    >   BrBbVertexModule * bbVtx = new BrBbVertexModule("BB","BB Rdo Module");
    >   bbVtx->SetTreeOn(kFALSE);
    >   bbVtx->SetMaxTimeDiff(0.5);
    >   bbVtx->SetZOffBig(19.64);
    >   bbVtx->SetZOffSmall(18.1);
    >   bbVtx->SetZOffFastest(0);
    >   bbVtx->Init();
    >
    > ****Finally I start calling the modules:
    
    You forget to send the message Begin to all modules.  That's important
    too - again refer to "The Guide"! 
    
    Why the heck don't you just use bratmain - and be done with it.  It is
    so much easier since you don't need to worry about all these things. 
    
    > 
    >       BrEventNode * bbHitNode = new BrEventNode("bbHit","bbHit");
    >       dbMod->Event(nextevent, nextevent);
    >       bbHits->Event(nextevent, bbHitNode);
    >       bbVtx->Event(bbHitNode,bbHitNode);
    >       delete bbHitNode;
    > 
    > *****which leads to a seqfault:Program received signal SIGSEGV, 
    > Segmentation fault.
    > 
    > 0xe557228 in BrBbCalibration::GetPedestal (this=0x1095cc20, tube=1)
    >     at BrBbCalibration.cxx:258
    > 258        return ((Float_t*) fPedestal.fRevision->GetArray())[tube-1] ;
    > 
    > 
    > Any suggestions???!!!!!!
    
    Yeps: USE BRATMAIN! 
    
    It's really easy you know.  Put the files brat-help.el and
    root-help.el somewhere Emacs will find it (see - yes, you guessed it -
    "The Guide"), start Emacs, type M-x brat-config-skel and answer the
    questions.  Vola, you're are ready to go.  No need to fumble around
    with programs and stuff.  Now how easy is that?  And it works too!
    Heck, everybody else is using it! 
    
    And if you have trouble doing that, send me your program and I'll tell
    you what you need to do. 
    
    Yours, 
    
    Christian Holm Christensen -------------------------------------------
    Address: Sankt Hansgade 23, 1. th.           Phone:  (+45) 35 35 96 91 
             DK-2200 Copenhagen N                Cell:   (+45) 28 82 16 23
             Denmark                             Office: (+45) 353  25 305 
    Email:   cholm@nbi.dk                        Web:    www.nbi.dk/~cholm
    



    This archive was generated by hypermail 2b30 : Fri Oct 26 2001 - 14:47:52 EDT