--- PamelaLevel2/doc/examples/example1.C 2006/06/16 16:43:55 1.1 +++ PamelaLevel2/doc/examples/example1.C 2006/10/09 12:37:52 1.2 @@ -22,62 +22,62 @@ // TFile f(file); // - TTree *T = pam_event->LoadPamTrees(&f); // << load Pamela trees from file f + TTree *T = pam_event->GetPamTree(&f); // << get Pamela trees from file f Int_t nevent = T->GetEntries(); // cout << endl<<" Start loop over events "; for (Int_t i=0; iGetEntry(i); - //================================================================================ - // some general quantities - //================================================================================ - // tracker - ntrack->Fill( pam_event->GetNTracks()); - // calorimeter - qtot->Fill(pam_event->qtot); - // ToF - Int_t npa=0; - for(Int_t ipa=0; ipa<6; ipa++)npa = npa + pam_event->GetNHitPaddles(ipa); - npaddle->Fill(npa); - //================================================================================ - // track related variables - //================================================================================ - for(Int_t it=0; itGetNTracks(); it++){ // << loop over the "physical" tracks (no track images) - // - // << get the it-th physical pamela track - // << PamTrack combines the tracker, calorimeter and ToF track-related variables - // << (in case of image, choose the best track by means of calorimeter and ToF data) - // - PamTrack *track = pam_event->GetTrack(it); - // - // << if the track fit is good, fill some histos - // - if( track->chi2 > 0 && track->chi2 < 100){ - // - // << spatial residuals on the first calorimeter plane for the sorted track // - Float_t rxs = track->tbar[0][0] - pam_event->cbar[0][0]; - Float_t rys = track->tbar[0][1] - pam_event->cbar[0][1]; - resxs->Fill(rxs); - resys->Fill(rys); - // - rig->Fill( track->GetRigidity() ); - // - // << spatial residuals on the first calorimeter plane for the image track - // - if(track->HasImage()){ // << if the sorted track has an image... - // - PamTrack *image = pam_event->GetTrackImage(it); // << ...get the image track - // - Float_t rxi = image->tbar[0][0] - pam_event->cbar[0][0]; - Float_t ryi = image->tbar[0][1] - pam_event->cbar[0][1]; - resxi->Fill(rxi); - resyi->Fill(ryi); - }; - }; - }; // end loop over tracks - //================================================================================ + T->GetEntry(i); + //================================================================================ + // some general quantities + //================================================================================ + // tracker + ntrack->Fill( pam_event->GetNTracks() ); //<< + // calorimeter + qtot->Fill( pam_event->qtot ); //<< + // ToF + Int_t npa=0; + for(Int_t ipa=0; ipa<6; ipa++)npa = npa + pam_event->GetNHitPaddles(ipa); //<< + npaddle->Fill(npa); + //================================================================================ + // track related variables + //================================================================================ + for(Int_t it=0; itGetNTracks(); it++){ // << loop over the "physical" tracks (no track images) + // + // << get the it-th physical pamela track + // << PamTrack combines the tracker, calorimeter and ToF track-related variables + // << (in case of image, choose the best track by means of calorimeter and ToF data) + // + PamTrack *track = pam_event->GetTrack(it); //<< + // + // << if the track fit is good, fill some histos + // + if( track->chi2 > 0 && track->chi2 < 100){ + // + // << spatial residuals on the first calorimeter plane for the sorted track + // + Float_t rxs = track->tbar[0][0] - pam_event->cbar[0][0]; + Float_t rys = track->tbar[0][1] - pam_event->cbar[0][1]; + resxs->Fill(rxs); + resys->Fill(rys); + // + rig->Fill( track->GetRigidity() ); + // + // << spatial residuals on the first calorimeter plane for the image track + // + if(track->HasImage()){ // << if the sorted track has an image... + // + PamTrack *image = pam_event->GetTrackImage(it); // << ...get the image track + // + Float_t rxi = image->tbar[0][0] - pam_event->cbar[0][0]; + Float_t ryi = image->tbar[0][1] - pam_event->cbar[0][1]; + resxi->Fill(rxi); + resyi->Fill(ryi); + }; + }; + }; // end loop over tracks + //================================================================================ }; // end loop over the events cout << endl << endl << " Done "<< endl<