My First Analysis with Beta =========================== November 14, 1998 ----------------- Aim at: ------ 1. running a very simple Beta analysis producing a few histograms before November 27 (bet with Gloria!); 2. setting up a selection of D and D* to exercise the vertexing packages and interfaces by Riccardo&Gautier. Preliminary work: ---------------- 1. I went through the tutorial by Natalia: http://hep.ucsb.edu/people/natalia/tutorial/tutorial/node1.html very useful, includes a brief discussion on all relevant points, including framework and database; gives also a detailed account of everything is needed to setup and run a modified version of SampleBetaAnalysis (also .tcl file etc!) 2. I tried out the official Beta Tutorial for release 6.10.10: http://www.slac.stanford.edu/BFROOT/doc/www/Physics/BetaTutorial/BetaTutorial.html Working from Trieste I have to ssh vesta.slac.stanford.edu and then ssh shire. To facilitate remote work: editing by "emacs -nw" (no window), paw files copied to local machine using "kslac" and afs rather than ftp (/afs/slac.stanford.edu/u/ec/lanceri/...) or also (better!): edit locally files with direct access to the afs directory. The tutorial is OK: I tried it up to the point of analyzing 3 events and producing histograms with SampleBetaAnalysis. Run 061749 from MDC I production has been used as in the tutorial (bbsim.xdr file). The data file was also loaded into my Federated Database but I did not try running the analysis on the db (to be done...!). Remember: >srtpath 6.10.10 SunOS5 (to set up correct paths for srt) >setboot (to set up OO_FD_BOOT env.variable) I had a problem with available disc space, requested 200Mb on afs, obtained it immediately. 3. I had a look at the code of the analysis examples available in the packages BetaUser and BetaExamples. Easy to navigate using the Light documentation: http://www.slac.stanford.edu/BFROOT/dist/releases/6.10.10/doc/src/Project.html Next: ---- 1. Following the procedure outlined by Natalia for MySampleBetaAnalysis, set up MyFirstAnalysis modifying MyAnalysis in package BetaUser, with a simple histogram+ntuple example 2. Set up a D/D* selection 3. Try vertexing routines November 24th, 1998 ------------------- Now: set up MyFirstAnalysis modifying MyAnalysis in package BetaUser, editing files in /afs/slac.stanford.edu/u/ec/lanceri/Beta61010/BetaUser 1. MyAnalysis.hh => MyFirstAnalysis.hh 2. MyAnalysis.cc => MyFirstAnalysis.cc 3. AppUserBuild.cc 4. myAnalysis.tcl => myFirstAnalysis.tcl compile and link: must be performed on shire!!! gmake BetaUser.lib does not work if performed from directory BetaUser, seems to work from the release directory (?); better to follow the instructions in the tutorial directly referring to shire rather than the UCSB tutorial... compile and link in batch mode, see instructions: bsub -q bldrecoq -Rsol26 -o gmake.log gmake lib setenv BetaXdr yes bsub -q bldrecoq -Rsol26 -o gmake.log gmake BetaUser.bin November 25th, 1998 ------------------- Continue: modify also the .tcl script to run my executable in conditions similar to those described in the tutorial: 5. xdr.tcl => mytcl.tcl In this version of the tcl script I have source ./myFirstAnalysis.tcl instead of source ./myAnalysis.tcl the analysis sequence to be appended is still called MyAnalysis in both myFirstAnalysis.tcl and mytcl.tcl, as before then, after checking that run016749.xdr and bbsim.xdr and dat are still there, ./betarun ../BetaUser/mytcl.tcl ... >ev beg -nev 10 >exit OK !!!! It works. I get my own histogram directory MYFIRSTANALYSIS and an empty histogram. The histograms filled by other modules in other directories are OK, with 10 events as expected. Now I have to fill histograms in my module with some meaningful quantities, i.e.: - number of charged tracks / event; - momentum of charged tracks; - impact parameter of charged tracks in the transverse plane. To do this, I have to: 1. Book histograms MyFirstAnalysis.hh define pointers of type HepHistogram* MyFirstAnalysis.cc book histograms 2. Fill histograms MyFirstAnalysis.cc fill histograms To have a cleaner environment in my code, I removed all unneccessary lists, except eventInfoList that may be useful later. Recompilation and relinking: OK after a small correction. As a first trial, I fill only histogram 2 (momentum), 20 events: OK. November 28, 1998 ----------------- Completing the first set of histograms: problems in reading data? Problems in staged tape? remove: rm run061749.xdr and rm bbsim.xdr (NB rm not accepted directly on shire, accepted on axts11 via afs, probably I had created the links that way?). Tape re-staged. > ./betarun ../BetaUser/mytcl.tcl ... unknown module (??? problems in MyAnalysis???) > ev beg -nev 10 SvtBuildEnv begin Job ** Error #2002007: BdbApplication::instance(): The OO_FD_BOOT environment variable isn't set I had forgotten: >srtpath 6.10.10 SunOS5 >setboot Try again. Could not find datafile "IfrPid/ifrdiscr.rwend" Path was ".:RELEASE:PARENT" DchDetector: number of sets to destroy: 14 number of sets to destroy51 IfrDetector: number of sets to be destroyed -- 24 completion at Sat Nov 28 04:06:11 PST 1998 maybe someting wrong in initializations. Restart from scratch logging out (also remember: setenv BetaXdr yes before linking!) (continued on 29/11/98) --------------------- Tried again (recompile, relink, restage data tape...): same problem!? Could not find datafile "IfrPid/ifrdiscr.rwend" Path was ".:RELEASE:PARENT" etc.etc. Something wrong with my code? (one line only added in MyFirstAnalysis.cc !) Let's try with the standard tutorial test tcl script (xdr.tcl): ./betarun ../BetaUser/xdr.tcl ... > ev beg -nev 3 ... same result! Go and look for "IfrPid/ifrdiscr.rwend" I cannot find this file in /afs/slac.stanford.edu/g/babar/dist/releases/6.10.10/IfrPid and anyway there is something fishy: in the preliminary bugs hypernews http://babar-hn.slac.stanford.edu:5090/HyperNews/get/prelimbugs/857.html there is some discussion about IFR calibration files that might be related to this problem. Let me try to follow again the tutorial from scratch, in a new different release directory, to check if some environment variable was corrupted after my tests (?!?). In fact there seems to be something wrong with my procedures: after repeating the tutorial in a new release directory B61010/ with: ./betarun ../BetaUser/xdr.tcl the program runs correctly on 3 events. November 30, 1998 ----------------- Back to Beta61010/ initializing properly, it works. I get the second histogram by: _numChTracks->accumulate(trackList->length()); OK!, but the third has still problems: _impChTracks->accumulate(trkPtr->recoTrk()->fitResult()->helix().d0()); gives a compilation error "/afs/slac.stanford.edu/u/ec/lanceri/Beta61010/BetaUser/MyFirstAnalysis.cc", line 156: Error: The type "const TrkRecoTrk" is incomplete. 1 Error(s) and 1 Warning(s) detected. To be understood... by the way: trkPtr is a pointer of type BtaCandidate* recoTrk() is a member function of the class BtaCandidate that returns a pointer of type TrkRecoTrk* fitResult() is a member function of the class TrkRecoTrk that returns a pointer of type TrkFit* helix() is a member function of the class TrkFit that returns an object of type TrkExchangePar d0() is a member function of the class TrkExchangePar that returns an object of type double (accessor function to a parameter of the fitted helix) December 2, 1998 ---------------- double fltL = 0.; _impChTracks->accumulate(trkPtr->recoTrk()->fitResult()->helix(fltL).d0()); compilation goes into a loop after "/afs/slac.stanford.edu/u/ec/lanceri/Beta61010/BetaUser/MyFirstAnalysis.hh", lin e 74: Warning: MyFirstAnalysis::event hides the virtual function AppModule::even t(AbsEvent*). 1 Warning(s) detected. lib stage done in /afs/slac.stanford.edu/u/ec/lanceri/Beta61010/BetaUser -> database.lib: (Tue Dec 1 08:24:53 PST 1998) lib stage done in /afs/slac.stanford.edu/u/ec/lanceri/Beta61010/database -> workdir.lib: (Tue Dec 1 08:24:55 PST 1998) ... gmakegmake: *** Waiting for unfinished jobs.... [1]: *** Waiting for unfinished jobs.... gmake: *** [lib] Cpu Limit Exceeded (core dumped) gmake[1]: *** [BetaUser.lib] Cpu Limit Exceeded (core dumped) ??????? to be understood... December 14, 1998 ----------------- I had no time to devote to this in the last few days: however last week following a suggestion by GV I found that the problem was trivial... The compilation errors were due to the fact that I had not declared #include "TrkBase/TrkRecoTrk.hh" #include "TrkBase/TrkExchangePar.hh" in MyFirstAnalysis.cc after adding the histogram filling with track i.p.: the rest of the code was OK !!! OK, point 1. is done. Next (possibly on TS machines... importrel!!!!): 2. Set up a D/D* selection (also gamagamma -> 4 prongs ?) 3. Try vertexing routines Update of the situation of vertexing packages: http://babar-hn.slac.stanford.edu:5090/HyperNews/get/VertexTools.html and in particular: http://www.slac.stanford.edu/~rfaccini/Vertex/userGuide.html http://www-lpnhep.in2p3.fr/babar/public/christian/newfeatures.html http://www.slac.stanford.edu/~martinef/Phone_meeting_11dec98.html December 23, 1998 ----------------- GDR succeeded in running 6.10.13 reco on MDC1 D*D* events (crash after about 600 out of 2000) and storing them in our local database. We set up together 6.10.13 on /babar0/lanceri (as usual: newrel, then addpkg BetaUser, SvtEnv) 1) special local settings: # set datasize limit # limit datasize 1000M # # only DELPHI (CERN libraries version) # setenv CERN /cern- 2) other preliminaries: - taken away last line in SvtEnv/SvtLayouts.dat - copied&modified .bbobjy (bot in home dir. and in release dir.) - copied some .tcl files from workdir(GDR): bdbGHit.tcl beta on sim data bdbLoader.tcl xdr->sim->db bdbReco.tcl beta on reco data (NB: modif wrt standard .tcl: mod disable IfrMuCalib mod disable IfrMakeChargedPid mod disable IfrMakeNeutralPid collectionName set "/users/dellaric/DstarDstarKpi_rec") bearProduction.tcl xdr->reco->db xdr.tcl beta on xdr 3) database: list of available commands and cleaning up gmake database.help gmake database.deleteboot CONFIRM_DELETEBOOT=yes 4) in the release dir.: gmake setboot /usr/object/alphaosf1/bin/oocleanup /usr/object/alphaosf1/bin/oocleanup -local cd workdir 5) in workdir: (normally: setboot to select my own db; now select GDR db) setenv OO_FD_BOOT /babar3/objy/dellaric/6.10.13/BaBar.BOOT (then: execute BetaApp on db reco data) ./bin/OSF1V4/BetaApp bdbReco.tcl (followed by the usual commands; analyse 400 evts: OK, histograms are there) December 27, 1998 ----------------- To run my analysis in TS: copy from slac (/afs/slac.stanford.edu/u/ec/lanceri/Beta61010/BetaUser/) MyFirstAnalysis.cc MyFirstAnalysis.hh myFirstAnalysis.tcl AppUserBuild.cc and modify (MyFirstAnalysis instead of MyAnalysis) : bdbReco.tcl -> mybdbReco.tcl then go to step (1) of the previous working day; skip all db preparations limit datasize 1000M setenv CERN /cern- setboot (not necessary: I forgot I should select GDR db) gmake BetaUser.all ... I get a few warnings in compilation, then: Linking with Bdb Simulation Reconstruction for BetaUser ld: Archive: /babar2/babar/dist/releases/6.10.13/lib/OSF1V4/libBetaSequences.a has no table of contents (not searched) add one with 'ar ts' Fatal error in: /usr/lib/cmplrs/cc/ld Bus error bin stage done in /babar0/users/lanceri/6.10.13/BetaUser something went wrong. Try: gmake ==> OK now? cd workdir setenv OO_FD_BOOT /babar3/objy/dellaric/6.10.13/BaBar.BOOT ./betarun ../BetaUser/mybdbReco.tcl ... > ev beg -nev 10 ... IfrMuCalib begin Job opened /afs/slac.stanford.edu/g/babar/reco/datafiles/IfrPid_discrdata_0009.rwend rw file momentum range : [ 0, 4]; 16 bins correctly read data ... BdbEventInput: Unable to locate collection "events" >exit It looks like a db problem: to be understood... December 28, 1998 ----------------- Try again in /babar0/users/lanceri/6.10.13, cleaning up: limit datasize 1000M setenv CERN /cern- gmake clean ==> do srtpath first! srtpath 6.10.13 OSF1V4 gmake clean cd workdir/ setenv OO_FD_BOOT /babar3/objy/dellaric/6.10.13/BaBar.BOOT ./betarun ../BetaUser/mybdbReco.tcl => RELEASE/bin/OSF1V4/BetaApp does not exist cd .. gmake => errors... need kslac for some geant4 files?? probably gmake is too much, anyway kslac gmake lib => usual warnings on overloaded virtual functions gmake BetaUser.bin => usual warnings on overloaded virtual functions ... Linking with Bdb Simulation Reconstruction for BetaUser ld: Archive: /babar2/babar/dist/releases/6.10.13/lib/OSF1V4/libBetaSequences.a has n o table of contents (not searched) add one with 'ar ts' Unresolved: __vtbl_34IfdDataProxy__T17SvtGlobalEleConst Make sure that the first noninlined virtual member function of 'IfdDataProxy' is defined. ... many similar messages, then: ... Fatal error in: /usr/lib/cmplrs/cc/ld Bus error bin stage done in /babar0/users/lanceri/6.10.13/BetaUser try anyway: cd workdir/ setenv OO_FD_BOOT /babar3/objy/dellaric/6.10.13/BaBar.BOOT ./betarun ../BetaUser/mybdbReco.tcl => RELEASE/bin/OSF1V4/BetaApp does not exist restart from scratch? cd .. gmake clean gmake BetaUser.all ... Adding template files to library ar: Error: phase error on testCache__45IfdDataProxy__T28IfdHepAList__T12BtaCandi dateXv.o NFS3 RFS3_WRITE failed for server axts06 : RPC: Timed out ar: error writing from temporary file 0: Connection timed out gmake[1]: *** [templates] Error 1 gmake: *** [BetaUser.all] Error 2 boh! I get similar problems on successive trials December 29, 1998 ----------------- Time out problems yesterday and this morning due to local network problems, in particular the connection of axts06 (/babar0/ !). Fixed by s.m.. To restart Objectivity on axts06: ~babarobj/bin/StartObjy December 30, 1998 ----------------- Let's start again. In /babar0/users/lanceri/6.10.13 limit datasize 1000M srtpath 6.10.13 OSF1V4 gmake BetaUser.all ??? errors => ar: Error: phase error on WorkBook1.o /bin/sh: 23737 Memory fault - core dumped gmake clean kslac gmake lib ??=> lib stage done in /babar0/users/lanceri/6.10.13/SvtEnv gmake[2]: *** Warning: Clock skew detected. Your build may be incomplete. ?? still local network problems ?? gmake BetaUser.bin Now make sure the .tcl file is OK: I can no longer find the sequence: mod disable IfrMuCalib mod disable IfrMakeChargedPid mod disable IfrMakeNeutralPid collectionName set "/users/dellaric/DstarDstarKpi_rec" ) ???? I put it back in mybdbReco.tcl cd ../workdir setenv OO_FD_BOOT /babar3/objy/dellaric/6.10.13/BaBar.BOOT ./betarun ../BetaUser/mybdbReco.tcl > ev beg -nev 10 => still problems: BdbEventInput: Unable to locate collection "events" OK, see tutorial: incomplete initialization of BdbEventInput! => I put it in myAnalysis.tcl: module talk BdbEventInput collectionName set "/users/dellaric/DstarDstarKpi_rec" exit cd ../workdir setenv OO_FD_BOOT /babar3/objy/dellaric/6.10.13/BaBar.BOOT ./betarun ../BetaUser/mybdbReco.tcl > ev beg -nev 10 => still problems: BdbEventInput: Unable to locate collection "events" => try moving module disabling and db connection to myFirstAnalysis.tcl: mod disable IfrMuCalib mod disable IfrMakeChargedPid mod disable IfrMakeNeutralPid module talk BdbEventInput collectionName set "/users/dellaric/DstarDstarKpi_rec" exit ./betarun ../BetaUser/mybdbReco.tcl > ev beg -nev 10 ... => OK !!! finally it works (see plots on 400 events) January 2, 1999 --------------- Set up a module to select D*->Dpi; use as an example the filling of histograms (histogram directory TAGMAKEDDSTAR): find out in what module they are booked/filled. The similar directory MYFIRSTANALYSIS is not explicitely initialized in MyFirstAnalysis.cc: there must be a mechanism in place somewhere to initialize separate directories for histograms booked in different classes. Go and look for it in the Light documentation: Release 6.10.10 and Release 7.6.2: Package/class: EventTagTools/TagMakeDDstar also interesting: EventTagTools/TagClassifyGammaGamma EventTagTools/TagMakePrimaryVertex EventTagTools/TagMakeBeam print listings from the local repository: ) setenv BFCURRENT 6.10.13 ) cd $BFDIST/releases/$BFCURRENT/EventTagTools axts11(/babar2/babar/dist/releases/6.10.13/EventTagTools:) lpspr etc. etc. OK. The examples are there. It is still not completely clear to me where these different modules are enabled/disabled. Let's have a look at how my Beta application is built: 1) /babar0/users/lanceri/6.10.13/BetaUser/AppUserBuild.cc in the constructor of this class: // Setup data source BtaAppBuild(this) // Now, load the modules for the actual user (sample) analyses add( new MyFirstAnalysis( "MyFirstAnalysis", "my first analysis" ) ); 2) /babar0/users/lanceri/6.10.13/BetaUser/mybdbReco.tcl in this tcl file: sourceFoundFile BetaSequences/betaSetup.tcl sourceFoundFile BetaSequences/bdbRecoSetup.tcl ... sourceFoundFile PhysProdTools/PhysProdSequence.tcl ... sourceFoundFile EventTagTools/TagProdCreateSequence.tcl => defines the sequence "TagProdCreateSequence" including also the tagging modules: sequence append TagProdCreateSequence TagMakeDDstar sourceFoundFile BetaUser/myFirstAnalysis.tcl => defines the sequence "MyAnalysis" path create Everything path append Everything BetaSetup path append Everything EventSource path append Everything BetaStandard path append Everything MyAnalysis NB: recall that (see Framework user interface): "Modules" can be associated in "Sequences" (lists of Modules) ; "Modules" and "Sequences" can be combined into "Paths" (complete execution sequences). In this case the path "Everything" includes several standard sequences; one of them (probably "BetaStandard") includes the module "TagMakeDDstar" OK. The mechanism is clear, forget about the details for the moment. Continue with the study of TagMakeDDstar and TagClassifyGammaGamma.