Re: Calibration problem

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Mon Nov 05 2001 - 10:41:19 EST

  • Next message: Ian Bearden: "BRAT-2-1-23==kGOOD"

    Hi Peter, Djam and Flemming, 
    
    On Fri, 2 Nov 2001 10:44:32 +0100 (CET)
    "Peter H. L. Christiansen" <pchristi@nbi.dk> wrote
    concerning "Calibration problem":
    > Hi devs
    > 
    > I have a small problem that I think others might also run into. 
    > 
    > When I apply calibrations the earliest I can currently do it is in
    > the Begin loop. This is fine for most calibrations, but when you fx
    > have a map of the TPC with the instrumented rows (something that has
    > changed for fx TPM2) then it means that the tpc detector parameters
    > are first updated in the Begin phase, i.e., after Init and Book have
    > been called by the different modules. If some of these uses the
    > instrumented rows information (like BrTpcTrackFollowModule uses it
    > to define histograms) then this could be wrong.
    
    It's not a wrong design - it's wrong behaviour of the modules in
    question.  
    
    See, the point is, which Flemming perfectly well understands as I
    believe he was the one to formulate it, that at construction time, not
    all information is in, and so it is not possible to initialise all
    modules completly - hence the BrModule::Init method.  Now, the
    calibration and run managers can not be initialised before all modules
    have registered all parameters, runs, etc., and modules can not do
    that before all the information is in - which means they can not
    register stuff before Init. 
    
    Therefor, calibration values, etc. are not avaliable until Begin, when
    the managers at the earliest can quarantied to be initialised. 
    
    
    > The problem is related to the fact that BrDbUpdateModule has to be first 
    > in the mainmodule pipeline so that you first register the calibrations you 
    > want to use after init has been called for BrDbUpdateModule. 
    
    No! The "problem" is as described above!  BrCalibrationManager can not
    be initialised until _all_ modules have been initialised! 
     
    > Maybe some of the clever guys can see an easy way of fixing this. I can 
    > only see the rough way of copying the most of the begin method and insert 
    > it in init in my apply calibrations class(BrTpcCalModule). 
    
    The way one _could_ get have the calibration constants avaliable in
    the Book method (and hence the DefineHistograms method), would be to
    initialise the calibration manager _immediately_ after the the modules
    has been initialised.  However, the modules _must_not_ rely on
    calibration information in Book, as you never know if these
    calibration parameters change durring the execution of your job, as
    could very well be the case if you're processing many (not nessecarily
    continuos) runs.   
    
    Hence, the design is as it should be and your classes are the ones
    that has a "problem". 
    
    On Fri, 02 Nov 2001 11:24:11 +0100 (CET)
    Djamel Ouerdane <ouerdane@nbi.dk> wrote
    concerning "Re: Calibration problem":
    > Hi Peter,
    > 
    > For your calibration problem, if you dig a bit into it, you'll see
    > that the problem comes from the managers (run info and calibration),
    > they need to be initialized and updated at different moment. 
    
    Different times you mean - yes?  Actually, they do _not_ need to be
    initilased at different times.  
    
    > FV and I wanted to split this module because of this (I wrote that
    > module a long time ago  now and we should probably think about
    > another solution) but Christian didn't want. 
    
    I think if Flemming think about it for a while he'll agree that we do
    not want the modules to have access to calibration values in the the
    Book method. 
    
    > Another way to solve your problem would be to change a bit this
    > module and  to insert it twice in the module pipeline (before all
    > modules and after all, with a check in init to see if the run info
    > manager has been properly initialized and updated the 1st time, the
    > 2nd time would be the  turn of the calibration manager but this time
    > in Init...clever isn't it ? :)  
    
    This will not work for exactly the reasons outlined above. 
     
    > But that's pretty ugly to insert it twice in the main module...
    
    Yes, but it's a trick that does have it's jusitification at times -
    c.f. the BrHistoIOModule. 
     
    > What do the experts say about it ? 
    
    He ... <grin>The desgin is right, the user is wrong</grin>!
    
    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 : Mon Nov 05 2001 - 10:41:47 EST