FlyoDoc_2011 Pisa 2011 by GmP --- 011

flyopunta/src/src_uti/outnt.cpp

00001 /**************************************************************************
00002                           gdevnt.cpp  -  description
00003                              -------------------
00004     begin                : Sun Dec 17 2000
00005     copyright            : (C) 2000 by Giuseppe M Pierazzini
00006     email                : pierazzini@unipi.it
00007  ***************************************************************************
00008  *                                                                         *
00009  *   NA48  simulation program.                                             *
00010  *                                                                         *
00011  ***************************************************************************/
00012 
00013 /***********************/
00014 
00015 //
00016 //      NTout new version            5-09-00  Tirrenia   GmP
00017 //
00018 
00019 #define APRI    0
00020 #define RIEMPI  1
00021 #define CHIUDI  2
00022 #define ALLGEN  3
00023 
00024 #define NEUTRI  1
00025 #define CARICHI 2
00026 #define ALLCHR  3
00027 
00028 #include "flyoh.h"
00029 #include "flyoana.h"
00030 //#include <string.h>
00031 
00032 
00033 
00034 
00035 #include <TROOT.h>
00036 #include <TChain.h>
00037 #include "TMath.h"
00038 #include "TRandom3.h"
00039 #include <TTree.h>
00040 #include <TFile.h>
00041 #include <TSystem.h>
00042 #include "TH1.h"
00043 #include "TH2.h"
00044 #include "TH3.h"
00045 
00046 TFile *outfile;
00047 TTree *mytree;
00048 TH1F *Pk  ;
00049 TH1F *Zv  ;
00050 TH1F *Gnum ;
00051 TH1F *Gtype ;
00052 TH3F *Dtxyz;
00053 TH1F *mqvv;
00054 TH1F *mqlam;
00055 TH1F *veto;
00056 TH1F *Momgas;
00057 TH1F *Momall;
00058 TH1F *Wire;
00059 //-------------------------------------------------------------
00060 //                 S c r i v i _ Dati
00061 //-------------------------------------------------------------
00062 
00063 void Scrivi_Dati ( int caso )
00064 {
00065  
00066     if ( WrtNt==0 )    return;
00067     if ( Wrtype==1 )   Scrivi_Root_out ( caso );
00068     else
00069         if ( Wrtype==2 ) Scrivi_Root_plots ( caso );
00070         else return;  // do nothing...
00071 }
00074 
00075 string  BranchWrap ( void *prt,string nikname,string var,string dim,string tipo )
00076 
00077 {
00078     string first="";
00079     string second="";
00080 
00081     first=nikname+"_"+var;
00082     if ( dim.size() <1 ) second=first+tipo;
00083     else second=first+"["+dim+"]"+tipo;
00084 
00085     mytree->Branch ( first.c_str(),prt,second.c_str() );
00086     return first;
00087 
00088 }
00089 //=======================================================
00090 
00091 //=======================================================
00098 void Scrivi_Root_out ( int caso )
00099 {
00100 // No output
00101  
00102    static  double  tempo_last_scrittura=0.;
00103     float  twrdif=0.;
00104     if ( WrtNt==0 ) return;
00105    
00106     string Dim="";
00107     string Tub="";
00108     string nik="";
00109 
00110 // Initialization for tree output
00111 // Cases
00112 
00113 
00114 
00115     switch ( caso )
00116     {
00117     case APRI:
00118 
00119         // Open file and define pointer to the mytree class
00120         outfile = new TFile ( OutGn,"RECREATE" );
00121         mytree = new TTree ( "fly","Device Variables" );
00122 
00123         // Head block
00124 
00125         mytree->Branch ( "Header"  ,  & ( evento_.Gen.type ),
00126                          "type/I:lastype:burst:event:run:ift:trigf:pipev" );
00127         mytree->Branch ( "Time"  ,  & ( evento_.Gen.tempo ),
00128                          "tempo/D:tdif/f:ttrigdif" );
00129         
00130         mytree->Branch ( "Twri"  ,  & twrdif,
00131                          "twrdif/f" );
00132         mytree->Branch ( "Beam"  ,  & ( evento_.Gen.xt ),
00133                          "xt/f:yt:zt:xv:yv:zv:pxk:pyk:pzk:pk:pxkf:pykf:pzkf:pkf" );
00134 
00135 
00136         if ( Abilita_Pair>0||Abilita_Brems>0 )
00137         {
00138             mytree->Branch ( "Prod",& ( evento_.Gen.Ipair ),
00139                              "Ipair/I:IBR:IDZ:ITSR:ITLG:IFUS" );
00140         }
00141 
00142         if ( Pipeline==0 )  //attenzione illuminazione: informazioni utili se pipeline==0!
00143         {
00144 // blocco illumina. Si abilita con la label illumina nel file epc..
00145 
00146             if ( Luce!=0 )
00147             {
00148                 nik="Lu";
00149                 BranchWrap ( &GasIdo, nik,"gasflag"  , "","/I" );
00150                 Dim=BranchWrap ( &Luce->npr, nik,"npr"  , "","/I" );
00151                 BranchWrap ( Luce->idm,  nik,"idm"  , Dim,"/I" );
00152                 BranchWrap ( Luce->id,   nik,"id"   , Dim,"/I" );
00153                 BranchWrap ( Luce->ifato,nik,"ifato", Dim,"/I" );
00154                 BranchWrap ( Luce->devstry,nik,"devstry", Dim,"/L" );
00155                 BranchWrap ( Luce->theta,nik,"theta", Dim,"/f" );
00156                 BranchWrap ( Luce->thetastar,nik,"thetastar", Dim,"/f" );
00157                 BranchWrap ( Luce->xg,   nik,"xg"   , Dim,"/f" );
00158                 BranchWrap ( Luce->yg,   nik,"yg"   , Dim,"/f" );
00159                 BranchWrap ( Luce->zg,   nik,"zg"   , Dim,"/f" );
00160                 BranchWrap ( Luce->tg,   nik,"tg"   , Dim,"/f" );
00161                 BranchWrap ( Luce->xf,   nik,"xf"   , Dim,"/f" );
00162                 BranchWrap ( Luce->yf,   nik,"yf"   , Dim,"/f" );
00163                 BranchWrap ( Luce->zf,   nik,"zf"   , Dim,"/f" );
00164                 BranchWrap ( Luce->pxg,  nik,"pxg"  , Dim,"/f" );
00165                 BranchWrap ( Luce->pyg,  nik,"pyg"  , Dim,"/f" );
00166                 BranchWrap ( Luce->pzg,  nik,"pzg"  , Dim,"/f" );
00167                 BranchWrap ( Luce->pxf,  nik,"pxf"  , Dim,"/f" );
00168                 BranchWrap ( Luce->pyf,  nik,"pyf"  , Dim,"/f" );
00169                 BranchWrap ( Luce->pzf,  nik,"pzf"  , Dim,"/f" );
00170                 BranchWrap ( Luce->mass, nik,"mass" , Dim,"/f" );
00171 
00172                 BranchWrap ( Luce->pxsg,  nik,"pxsg"  , Dim,"/f" );
00173                 BranchWrap ( Luce->pysg,  nik,"pysg"  , Dim,"/f" );
00174                 BranchWrap ( Luce->pzsg,  nik,"pzsg"  , Dim,"/f" );
00175 
00176             }
00177 
00178             // radiografia devices.. meglio usare i valori rivelati e misurati???????????????
00179             // si abilita con la label radx
00180             
00181             if ( Radio!=0 )
00182             {
00183                 cout<<"\n  radio";
00184                 // locco radiografia ( hit nei dev)   vedi evento.h....
00185                 nik="Rd";
00186                 Dim=BranchWrap ( &Radio->nrdx,nik, "nrdx", ""  , "/I" );
00187                 BranchWrap ( Radio->dvradx,nik,"dvradx", Dim, "/I" );
00188                 BranchWrap ( Radio->idmx,  nik,"idmx" ,  Dim, "/I" );
00189                 BranchWrap ( Radio->xradx, nik,"xradx",  Dim, "/F" );
00190                 BranchWrap ( Radio->yradx, nik,"yradx" , Dim, "/F" );
00191                 BranchWrap ( Radio->zradx, nik,"zradx",  Dim, "/F" );
00192                 BranchWrap ( Radio->tradx, nik,"tradx",  Dim, "/F" );
00193                 BranchWrap ( Radio->pxradx,nik,"pxradx", Dim, "/F" );
00194                 BranchWrap ( Radio->pyradx,nik,"pyradx", Dim, "/F" );
00195                 BranchWrap ( Radio->pzradx,nik,"pzradx", Dim, "/F" );
00196                 BranchWrap ( Radio->eradx, nik,"eradx" , Dim, "/F" );
00197                 BranchWrap ( Radio->evista,nik,"evista", Dim, "/F" );
00198             }
00199         }
00200 
00201 
00202         Device *dev;
00203         for ( dev=Apparato; dev!=0; dev=dev->next )
00204         {
00205       
00206             if ( dev->wrout==0 || dev->escludi>0 ) continue;
00207             nik=dev->Get_NickName();
00208 
00209             BranchWrap ( &dev->mhit,       nik,"mhit"  ,"" ,"/I" );          // numeri di hits (da particelle)
00210             Dim=BranchWrap ( &dev->hit_recorded , nik,"rhit"  ,"" ,"/I" );   //recorded hits (può essere < di  hist)
00211             BranchWrap ( dev->index ,         nik,"index" ,Dim,"/I" );       //  id della particella
00212             BranchWrap ( dev->mid,            nik,"mid"   ,Dim,"/I" );        // indice di materia
00213             BranchWrap ( dev->structinfo,     nik,"struct"  ,Dim,"/I" );      //  indice di sottostruttura
00214             BranchWrap ( dev->mdead,          nik,"dead"  ,Dim,"/I" );        // indice di morte
00215             BranchWrap ( dev->devstory,       nik,"devstry",Dim,"/L" );       //storia dei dev passati
00216             BranchWrap ( &dev->emDev ,        nik,"emdev" ,"" ,"/F" );        // energia rivelata nel dev
00217             BranchWrap ( dev->mxd,  nik,"mxd" ,Dim,"/F" );          //  x in dev system
00218             BranchWrap ( dev->myd,  nik,"myd" ,Dim,"/F" );          //  y in dev system
00219             BranchWrap ( dev->mzd,  nik,"mzd" ,Dim,"/F" );          //  z in dev system
00220             BranchWrap ( dev->mdd,  nik,"mdd" ,Dim,"/F" );          // distanza dall'asse centrale del dev
00221             BranchWrap ( dev->me,   nik,"me"  ,Dim,"/F" );          // released energy in dev
00222             BranchWrap ( dev->mxl,  nik,"mxl" ,Dim,"/F" );          // x in lab system
00223             BranchWrap ( dev->myl,  nik,"myl" ,Dim,"/F" );          // y in lab system
00224             BranchWrap ( dev->mzl,  nik,"mzl" ,Dim,"/F" );          // z in lab system
00225             BranchWrap ( dev->gpx,  nik,"gpx" ,Dim,"/F" );          // impulso x della particella 
00226             BranchWrap ( dev->gpy,  nik,"gpy" ,Dim,"/F" );          // impulso y della particella
00227             BranchWrap ( dev->gpz,  nik,"gpz" ,Dim,"/F" );          // impulso z della particella 
00228             BranchWrap ( dev->ge,   nik,"ge" ,Dim,"/F" );           // energia generata 
00229             BranchWrap ( dev->dtemp, nik,"dtempo",Dim,"/D" );       // hits_time-T_trigger (per pipeline)
00230 
00231             string devnome;
00232             devnome=dev->Get_Nome();
00233 
00234             DevStraw *devstr =(DevStraw*) dev;
00235             if (devnome=="St1u"|| devnome=="St1v"||devnome=="St1x"||devnome=="St1y"||
00236                 devnome=="St2u"|| devnome=="St2v"||devnome=="St2x"||devnome=="St2y"||             
00237                 devnome=="St3u"|| devnome=="St3v"||devnome=="St3x"||devnome=="St3y"||
00238                 devnome=="St4u"|| devnome=="St4v"||devnome=="St4x"||devnome=="St4y"                              
00239             )
00240             {
00241                 Dim=BranchWrap (&devstr->nwire,  nik,"nwire" ,"","/I" );   // numero cluster 
00242                 BranchWrap ( devstr->Wirecoor,  nik,"wirex" ,Dim,"/f" );   // coordinate in wire
00243                 BranchWrap ( devstr->Wiredtim,  nik,"wiredt" ,Dim,"/f" );  // tot tempo_drift
00244                 BranchWrap ( devstr->Wiret0tim, nik,"wiret0tim" ,Dim,"/f" );  // dif tempo_trailing
00245                  BranchWrap ( devstr->Wiret0stim, nik,"wiret0stim" ,Dim,"/f" ); // sum tempo_trailing
00246                  BranchWrap ( devstr->Wiredtempo, nik,"wiredtempo" ,Dim,"/f" ); //dif tempo-tempo_tubo_usato 
00247                 BranchWrap ( &devstr->flag_pileup, nik,"flagpileup","","/I" );   // verifica wire pileup
00248                 
00249                 BranchWrap ( &devstr->tubiseen, nik,"tubiseen","","/I" );   // numero di tubi colpiti
00250                  
00251                 Tub=BranchWrap (&devstr->ntub1,  nik,"ntub1" ,"","/I" );     // N. tubi piano 1             
00252                 BranchWrap ( devstr->tubo1,  nik,"tubo1" ,Tub,"/I" );         // indirizzo tubi 0-111     
00253                 BranchWrap ( devstr->use_tubo1,  nik,"usetubo1" ,Tub,"/I" );   // > 0 se usato nella ricostruzione
00254                 BranchWrap ( devstr->toc_tubo1,  nik,"toctubo1" ,Tub,"/I" );    // molteplicità di hit nel tubo         
00255                 BranchWrap ( devstr->t0_tubo1,  nik,"t0tubo1" ,Tub,"/d" );   // T0 del tubo (+-20ns)
00256                 BranchWrap ( devstr->ts_tubo1,  nik,"tdtubo1" ,Tub,"/d" );   // Tempo fine drift
00257                 BranchWrap ( devstr->tmp_tubo1,  nik,"tmptubo1" ,Tub,"/d" );   //tempo di generazione del tubo
00258                 
00259                 Tub=BranchWrap (&devstr->ntub2,  nik,"ntub2" ,"","/I" );                 
00260                 BranchWrap ( devstr->tubo2,  nik,"tubo2" ,Tub,"/I" );      
00261                 BranchWrap ( devstr->use_tubo2,  nik,"usetubo2" ,Tub,"/I" );   // > 0 se usato nella ricost
00262                 BranchWrap ( devstr->toc_tubo2,  nik,"toctubo2" ,Tub,"/I" );                  
00263                 BranchWrap ( devstr->t0_tubo2,  nik,"t0tubo2" ,Tub,"/d" ); 
00264                 BranchWrap ( devstr->ts_tubo2,  nik,"tdtubo2" ,Tub,"/d" ) ;           
00265                 BranchWrap ( devstr->tmp_tubo2,  nik,"tmptubo2" ,Tub,"/d" ); 
00266                 
00267                 
00268                 Tub=BranchWrap( &devstr->ntub3,  nik,"ntub3" ,"","/I" );                 
00269                 BranchWrap ( devstr->tubo3,  nik,"tubo3" ,Tub,"/I" );    
00270                 BranchWrap ( devstr->use_tubo3,  nik,"usetubo3" ,Tub,"/I" );   // > 0 se usato nella ricost
00271                 BranchWrap ( devstr->toc_tubo3,  nik,"toctubo3" ,Tub,"/I" );  
00272                 BranchWrap ( devstr->t0_tubo3,  nik,"t0tubo3" ,Tub,"/d" ); 
00273                 BranchWrap ( devstr->ts_tubo3,  nik,"tdtubo3" ,Tub,"/d" ); 
00274                 BranchWrap ( devstr->tmp_tubo3,  nik,"tmptubo3" ,Tub,"/d" );  
00275                 
00276                 Tub=BranchWrap (&devstr->ntub4,  nik,"ntub4" ,"","/I" );     
00277                 BranchWrap ( devstr->tubo4,  nik,"tubo4" ,Tub,"/I" ); 
00278                 BranchWrap ( devstr->use_tubo4,  nik,"usetubo4" ,Tub,"/I" );   // > 0 se usato nella ricostri
00279                 BranchWrap ( devstr->toc_tubo4,  nik,"toctubo4" ,Tub,"/I" );  
00280                 BranchWrap ( devstr->t0_tubo4,  nik,"t0tubo4" ,Tub,"/d" ); 
00281                 BranchWrap ( devstr->ts_tubo4,  nik,"tdtubo4" ,Tub,"/d" ); 
00282                 BranchWrap ( devstr->tmp_tubo4,  nik,"tmptubo4" ,Tub,"/d" );     
00283                 
00284                 
00285                 
00286             }
00287 
00288             else if (devnome=="Lkry")
00289             {
00290                 DevLkr *devcal =(DevLkr*) dev;  // casting to the correct device
00291                 BranchWrap ( &devcal->padhit, nik,"padhit","","/I" );       //npad
00292                 BranchWrap ( &devcal->dist_max, nik,"dist_max","","/F" );   // distanza massima tra due cluster
00293                 BranchWrap ( &devcal->epad28, nik,"epad28","","/F" );       // energia pad 2X8
00294                 BranchWrap ( &devcal->m28x  , nik,"m28x","","/F" );         // momento  in x
00295                 BranchWrap ( &devcal->m28qx , nik,"m28qx","","/F" );        // 2. momento in x
00296                 BranchWrap ( &devcal->m28y  , nik,"m28y","","/F" );         // momento in y 
00297                 BranchWrap ( &devcal->m28qy , nik,"m28qy","","/F" );        // 2. momento in y
00298                 BranchWrap ( &devcal->epad44, nik,"epad44","","/F" );       // come sopra per pad 4X4
00299                 BranchWrap ( &devcal->m44x  , nik,"m44x","","/F" );
00300                 BranchWrap ( &devcal->m44qx , nik,"m44qx","","/F" );
00301                 BranchWrap ( &devcal->m44y  , nik,"m44y","","/F" );
00302                 BranchWrap ( &devcal->m44qy , nik,"m44qy","","/F" );
00303 
00304                 BranchWrap ( &devcal->quad1 , nik,"quad1","","/F" );        // energia quadrante 1
00305                 BranchWrap ( &devcal->quad2 , nik,"quad2","","/F" );        // energia quadrante 2
00306                 BranchWrap ( &devcal->quad3 , nik,"quad3","","/F" );        // energia quadrante 3
00307                 BranchWrap ( &devcal->quad4 , nik,"quad4","","/F" );        // energia quadrante 4
00308 
00309             }
00310 
00311         }
00312 
00313 
00314         //traccie  StrawChamber
00315 
00316         if ( Trkstraw !=0 )
00317         {
00318             nik = "Tr";
00319 
00320             Dim = BranchWrap ( &Trkstraw->ntrk_done, nik, "ntrk", "", "/I" );    // numero di tracce ric.
00321 
00322             BranchWrap ( &Trkstraw->charge_all, nik, "chall", "", "/I");         // carica totale
00323             BranchWrap ( Trkstraw->Trk2Root.mask, nik, "mask", Dim,"/I" );       // maschere camere usate  per ogni hit
00324             BranchWrap ( Trkstraw->Trk2Root.usepl, nik, "usepl", Dim,"/I" );     // numero di piani usati 
00325             BranchWrap ( Trkstraw->Trk2Root.camere, nik, "camere", Dim,"/I" );    //numero di camere usate
00326             BranchWrap ( Trkstraw->Trk2Root.single, nik, "single", Dim,"/I" );    // piani singoli
00327             BranchWrap ( Trkstraw->Trk2Root.ic0, nik, "ic0", Dim,"/I" );          //cluster camera 0
00328             BranchWrap ( Trkstraw->Trk2Root.ic1, nik, "ic1", Dim,"/I" );          //cluster camera 1
00329             BranchWrap ( Trkstraw->Trk2Root.ic2, nik, "ic2",Dim,"/I" );           //cluster camera 2
00330             BranchWrap ( Trkstraw->Trk2Root.ic3, nik, "ic3",Dim,"/I" );           //cluster camera 3
00331             BranchWrap ( Trkstraw->Trk2Root.zbyy, nik,"zbyy", Dim, "/F" );        // z da magnete y test di convergenza
00332             BranchWrap ( Trkstraw->Trk2Root.zbyx, nik,"zbyx", Dim, "/F" );        // z da magnete x test di convergenza
00333             BranchWrap ( Trkstraw->Trk2Root.chiq, nik,"chiq", Dim, "/F" );        // fit chiq
00334             BranchWrap ( Trkstraw->Trk2Root.charge, nik, "charge",Dim,"/F" );     // carica della traccia
00335             BranchWrap ( Trkstraw->Trk2Root.xmg, nik, "xmg", Dim, "/F" );         // x al magnete
00336             BranchWrap ( Trkstraw->Trk2Root.ymg, nik, "ymg", Dim, "/F" );         // y al magnete
00337             BranchWrap ( Trkstraw->Trk2Root.p,nik,"ptrk", Dim, "/F" );            // p della traccia
00338             BranchWrap ( Trkstraw->Trk2Root.py, nik, "py", Dim, "/F" );           // py
00339             BranchWrap ( Trkstraw->Trk2Root.pxin, nik, "pxin", Dim, "/F" );       // pxin  prima del magnete 
00340             BranchWrap ( Trkstraw->Trk2Root.pzin, nik, "pzin", Dim, "/F" );       // pzin  prima
00341             BranchWrap ( Trkstraw->Trk2Root.pxout, nik, "pxout", Dim, "/F" );     // pxout  dopo
00342             BranchWrap ( Trkstraw->Trk2Root.pzout, nik, "pzout", Dim, "/F" );     // pzout  dopo
00343             BranchWrap ( Trkstraw->Trk2Root.xhodx, nik, "xhodx", Dim, "/F" );     // x at hodx
00344             BranchWrap ( Trkstraw->Trk2Root.yhodx, nik, "yhodx", Dim, "/F" );     // y at hodx
00345 
00346 
00347 
00348 
00349         }
00350 
00351 //  studio dei cluster  nelle camere
00352 
00353         for (int ic=0;ic<4;ic++)
00354         {
00355             if ( ChambClus[ic]!=0 )
00356 
00357 
00358             {
00359                 stringstream sigla;
00360                 sigla<<"Cls"<<ic;
00361                 sigla>>nik;
00362 
00363 
00364                 Dim = BranchWrap ( &ChambClus[ic]->ncls, nik, "ncls", "", "/I" );  // numero dei cluster
00365 
00366                 BranchWrap ( &ChambClus[ic]->nwu , nik, "nwu", "", "/I" );    // numero per piano
00367                 BranchWrap ( &ChambClus[ic]->nwv , nik, "nwv", "", "/I" );
00368                 BranchWrap ( &ChambClus[ic]->nwx , nik, "nwx", "", "/I" );
00369                 BranchWrap ( &ChambClus[ic]->nwy , nik, "nwy", "", "/I" );
00370 
00371                 BranchWrap (ChambClus[ic]->hitu , nik, "hitu",Dim,"/I");       // hits piano
00372                 BranchWrap (ChambClus[ic]->hitv , nik, "hitv",Dim,"/I");
00373                 BranchWrap (ChambClus[ic]->hitx , nik, "hitx",Dim,"/I");
00374                 BranchWrap (ChambClus[ic]->hity , nik, "hity",Dim,"/I");
00375                 BranchWrap (ChambClus[ic]->maskera , nik, "mask",Dim,"/I");
00376                 BranchWrap (ChambClus[ic]->planes , nik, "planes",Dim,"/I");    // piani coinvolti
00377                 BranchWrap (ChambClus[ic]->Ufil , nik, "Ufil",Dim,"/F");        // wire del piano 
00378                 BranchWrap (ChambClus[ic]->Vfil , nik, "Vfil",Dim,"/F");
00379                 BranchWrap (ChambClus[ic]->Xfil , nik, "Xfil",Dim,"/F");
00380                 BranchWrap (ChambClus[ic]->Yfil , nik, "Yfil",Dim,"/F");
00381                 
00382                 BranchWrap (ChambClus[ic]->Udtim , nik, "Udtim",Dim,"/F");     // tempo del wire
00383                 BranchWrap (ChambClus[ic]->Vdtim , nik, "Vdtim",Dim,"/F");
00384                 BranchWrap (ChambClus[ic]->Xdtim , nik, "Xdtim",Dim,"/F");
00385                 BranchWrap (ChambClus[ic]->Ydtim , nik, "Ydtim",Dim,"/F");
00386                 
00387                 
00388                 
00389                 BranchWrap (ChambClus[ic]->X , nik, "X",Dim,"/F");             // cordinata ricostruita
00390                 BranchWrap (ChambClus[ic]->Y , nik, "Y",Dim,"/F");
00391                 BranchWrap (ChambClus[ic]->Z , nik, "Z",Dim,"/F");
00392                 BranchWrap (ChambClus[ic]->chiq , nik, "chiq",Dim,"/F");       // chiq del fit
00393                 
00394                 
00395                 
00396                 
00397 
00398             }
00399 
00400         }
00401 
00402 
00403         if ( Akpivv!=0 )
00404         {
00405             mytree->Branch ( "Anakpivv",&Akpivv->np,"kvv_np/I:kvv_charge/f:kvv_chiqtrk/f"
00406                              ":kvv_pxkp:kvv_pykp:kvv_pzkp:kvv_momk"
00407                              ":kvv_pxpi:kvv_pypi:kvv_pzpi:kvv_mompi:kvv_tmom:kvv_epi:kvv_pxvv:kvv_pyvv:kvv_pzvv:kvv_momvv:kvv_mqvv:kvv_evv"
00408                              ":kvv_masvv:kvv_chiqvert:kvv_xvv:kvv_yvv:kvv_zvv:kvv_xlac:kvv_ylac:kvv_zlac");
00409         }
00410         
00411         
00412   // dati per le analisi       
00413             if ( Akmunu!=0 )
00414         {
00415             
00416             mytree->Branch ( "Anakmunu",&Akmunu->np,"knu_np/I:knu_charge/f:knu_chiqtrk/f"
00417                              ":knu_pxkp:knu_pykp:knu_pzkp:knu_momk"
00418                              ":knu_pxmu:knu_pymu:knu_pzmu:knu_mommu:knu_tmom:knu_emu:knu_pxnu:knu_pynu:knu_pznu:knu_momnu:knu_mqnu:knu_enu"
00419                              ":knu_masnu:knu_chiqvert:knu_xnu:knu_ynu:knu_znu:knu_xlac:knu_ylac:knu_zlac:knu_timedif");
00420         }
00421         
00422         
00423         
00424         
00425 
00426 
00427         if ( Akpip0!=0 )
00428         {    //float charge,chisq,pmis,masmis, ppip;
00429             mytree->Branch ( "Anakpip0",&Akpip0->good,"pip0_good/I:pip0_charge/f:pip0_chisq/f:"
00430                              "pip0_pmis/f:pip0_masmis/f:pip0_ppip/f ");
00431         }
00432 
00433 
00434    if ( Akpip0ee!=0 )
00435         {    
00436   /*        
00437     int good;
00438     float chiq_vert,xvtx,yvtx,zvtx, mqinv,mqgg,mqee;
00439     float momk,pxkp,pykp,pzkp,pxpip,pypip,pzpip,pxelec,pyelec,pzelec,pxelep,pyelep,pzelep;    
00440   */        
00441             mytree->Branch ( "Anakpip0ee",&Akpip0ee->good,"p0ee_good/I:p0ee_chiq/f:"
00442                              "p0ee_xvtx/f:p0ee_yvtx/f:p0ee_zvtx/f ");
00443         }
00444 
00445 
00446 
00447 
00448 
00449         if ( Aklambda!=0 )
00450         {
00451             mytree->Branch ( "Anaklambda",&Aklambda->np,"lam_np/I:lam_charge/f:lam_pxlam:lam_pylam:lam_pzlam:lam_momlam"
00452                              ":lam_elam:lam_masqlam:lam_pxpim:lam_pypim:lam_pzpim:lam_mompim:lam_epim:lam_pxprt:lam_pyprt:lam_pzprt"
00453                              ":lam_momprt:lam_eprt:lam_xlam:lam_ylam:lam_zlam:lam_dlam" );
00454 
00455         }
00456 
00457 
00458 
00459         /* int nt;
00460            float pq,engm,enlk,kp;
00461            float pmis,pmisx,pmisy,pmisz,ptrs;
00462            float emisq,rapsel,vtxz;
00463            float Xtcal,Ytcal,discal;
00464         */
00465 
00466         if ( Ake2g!=0 )
00467         {
00468             mytree->Branch ( "Anake2g",&Ake2g->nt,"e2g_nt/I:e2g_pq/f:e2g_engm:e2g_enlk:e2g_kp"
00469                              ":e2g_miske:e2g_miskex:e2g_miskey:e2g_miskez:e2g_ptrske"
00470                              ":e2g_emisq:e2g_rapsel"
00471                              ":e2g_Xtcal:e2g_Ytcal:e2g_discal:e2g_vtx:e2g_vty:e2g_vtz");
00472 
00473         }
00474 
00475 
00476 
00477 
00478 
00479 //chod_acc_0,rich_hit_3,muv3_acc,lkr_4x4_30,lav_12,lav_all;
00480         if ( Auser!=0 )
00481         {
00482             mytree->Branch ( "Anauser",&Auser->chod_acc_0,
00483                              "chod_acc_0/I:rich_hit_3:muv3_acc:lkr_4x4_30:lavs[12]:lav_12:lav_all:buoncut[7]");
00484 
00485         }
00486 
00487 
00488         break;
00489 //==============================================================================
00490     case RIEMPI:
00491        
00492 
00493         if ( FitDone>0 || WrtNt>1 )   //??????( FitDone>0 || WrtNt>1 )   /?
00494         {
00495            
00496           twrdif=evento_.Gen.tempo-tempo_last_scrittura;
00497           if(twrdif<0.)twrdif=evento_.Gen.tempo; // at burst beginning.. restart the twrdef..
00498           tempo_last_scrittura=evento_.Gen.tempo;
00499             SelRea->AddNt();
00500             mytree->Fill();
00501         }
00502         
00503         break;
00504 
00505 
00506     case CHIUDI:
00507 
00508         mytree->Write();
00509         outfile->Write();
00510         outfile->Close();
00511         break;
00512 
00513     default:
00514         break;
00515     }
00516 }
00517 
00518 
00519 //=======================================================
00520 
00524 void Scrivi_Root_plots ( int caso )
00525 {
00526 // da riscrivere secondo le necessità.....adesso è dummy
00527 }
 All Classes Namespaces Files Functions Variables