90 likes | 215 Views
Status of TT6ApvAnalysisFactory. How to manage “n” apv ? (apv creation, apv association to DetUnits, loop over apvs ...) Tommaso’s idea: the ApvAnalysisFactory. Changes since last consorzio: Tommaso’s ApvAnalysisDispenser: ApvAnalysisFactory* pippo = ApvAnalysisFactoryDispenser->factory()
E N D
Status of TT6ApvAnalysisFactory How to manage “n” apv ? (apv creation, apv association to DetUnits, loop over apvs ...) Tommaso’s idea: the ApvAnalysisFactory Changes since last consorzio: Tommaso’s ApvAnalysisDispenser: ApvAnalysisFactory* pippo = ApvAnalysisFactoryDispenser->factory() MyFactory* myFactory = dynamic_cast<MyFactory*>(ApvAnalysisFactoryDispenser->factory()) Different ApvAnalysis implementations (Reference, TT6, …) are obtained by instantiating the proper ApvAlysisFactory
The typical main program: int main (int argc, char** argv){ TBTrackerBuilderFromAscii theTBTrackerBuilderFromAscii; ApvEventReader* theEventReader = new ZebraReaderAdapterForX5Boctober2001; TT6ApvAnalysisFactory theApvAnalysisFactory; //Asking for the numbering also triggers the creation of the geometry //via the FullTracker interface TBNumberingFactory theNumberingFactory; theNumberingFactory.construct(); DetUnitNumbering<TrackerSimHitTag> theNumbering; // -- Get Detector Modules CmsTracker::DetContainer theDets = FullTracker::instance()->dets(); // -- Construct All Apvs ApvAnalysisFactoryDispenser::factory()->constructAllApvs(); do { nEvents++; for (vector<ApvAnalysis *>::const_iterator iapv = allTheApvs.begin(); iapv != allTheApvs.end(); iapv++){ ApvAnalysis* theApv = (*iapv); theApv->rawSignal(); ....... } } while (theEventReader->nextEvent() && nEvents < nMaxEvents); delete theEventReader; return 0; } event reader factory is registered in the dispenser: pluggable apv framework ! use the factory to construct apvs loop over apvs
the TT6ApvAnalysisFactory: • TT6 needs to perform some internal tasks communicating data between PedestalCalculator, NoiseCalculator, ApvMask … • cannot perform them in main (if code is to be “implementation transparent” to the user) • have to perfom them inside the apv class itself: TT6ApvAnalysis • needs to be triggered by the TT6ApvAnalysisFactory ! Implemented functions: void addDetUnitAndConstructApvs(const DetUnit *); void constructAuxiliaryApvClasses(ApvAnalysis *); Construct TT6-type apv and auxiliary classes Added functions: void setParameters(int nEvForInit, int nEvForUpd, int fNoisyDef, float cutToAvoidSignal, float cutForNoisyStrips, float cutForDeadStrips) bool nextEvent() sets TT6 parameters for apv creation inits apv to next event propagates call to eventReader->nextEvent()
The typical TT6 main program: int main (int argc, char** argv){ TBTrackerBuilderFromAscii theTBTrackerBuilderFromAscii; ApvEventReader* theEventReader = new ZebraReaderAdapterForX5Boctober2001; TT6ApvAnalysisFactory theApvAnalysisFactory; TT6ApvAnalysisFactory* theTT6AnalysisFactory = dynamic_cast<TT6ApvAnalysisFactory*>(ApvAnalysisFactoryDispenser::factory()); theTT6AnalysisFactory->setEventReader(theEventReader); theTT6AnalysisFactory->setParameters(nEventForInitialization, nEventForUpdate, fNoisyStripDefinition, cutToAvoidSignal, cutForNoisyStrips, cutForDeadStrips); TBNumberingFactory theNumberingFactory; theNumberingFactory.construct(); DetUnitNumbering<TrackerSimHitTag> theNumbering; CmsTracker::DetContainer theDets = FullTracker::instance()->dets(); ApvAnalysisFactoryDispenser::factory()->constructAllApvs(); do { nEvents++; for (vector<ApvAnalysis *>::const_iterator iapv = allTheApvs.begin(); iapv != allTheApvs.end(); iapv++){ ApvAnalysis* theApv = (*iapv); theApv->rawSignal(); ....... } } while (theTT6AnalysisFactory->nextEvent() && nEvents < nMaxEvents); delete theEventReader; return 0; } pointer for specific TT6 tasks Assign event reader and parameters loop on TT6ApvAnalysis::nextEvent() !
TT6ApvAnalysis added features: void newEvent() • update counters • clear flags • performs TT6 internal tasks : • transfers rawNoise from TT6PedestalCalculator to TT6NoiseCalculator • adjourns mask every 100 events • triggers updatePedestal • makes sure that noise and peds are updated at each event void preProcessEvent() (executed when any data is requested to the apv) • buffered rawSignal() • buffered pedestalSubtractedSignal() • "robust" TT6NoiseCalculator::updateStatus • "robust" TT6PedestalCalculator::updateStatus • = wating to be committed
Changes proposed by Ian Factory: bool ApvAnalysisFactory::nextEvent() void ApvAnalysisFactory::updateCalibration() Apv: void ApvAnalysis::newEvent() void ApvAnalysis::updateCalibration() make NoiseCalculator, PedestalCalculator and CommonModeCalculator interchangeable in different apv frameworks standard in all apv frameworks triggers ApvAnalysis::updateCalibration() standard in all apv frameworks renames preProcessEvent() ? Better concentrate on PSI work … !
Discussion: What is still needed for HIP analysis at PSI ? useful HIP selection variables(Iacopo's talk 10 Apr.): • Area of PedestalSubtractedSignal • truncated RMS distribution • CommonMode distrib. with truncated mean • CM distrib. with truncated Median • slope of CM profile ? • need to use clustering information ? seems ok with current framework need new CommonModeCalculator ? framework with more CM calculators ? Need an histogramming class / environment !
Temptative analysis framework: standard histograms, for each apv, of hip selection variables after cuts, n-tuple where selection variables + ped sub data is stored, for each candidate "hipped" apv INFO event number run number nAPV APV idModule idApv SELECTION • Selection flag • Area of PedestalSubtractedSignal • trunc.RMS • C.M. with truncated mean • C.M. with truncated Median • ...... DATA 128 Ped Sub Values (or id pointing to hist ?)
Conclusions: • The TT6 ApvAnalysis implementation has been ported to Tommaso's Factory framework • Few modifications to the TT6 code make its use "transparent" • Same kind of improvements proposed for all other ApvAnalysis implementations • Still discussing further modifications but: • Better concentrate efforts on PSI test beam HIP analysisbetter • Is all requested functionality available ? • Probably need different CommonNoise calculators • Start to think the way selected data will be analyzed (n-tuple structure)