1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 /// \class AliMUONRecData
20 /// Class containing MUON data: hits, digits, rawclusters, globaltrigger, localtrigger, etc ..
21 /// The classe makes the lik between the MUON data lists and the event trees from loaders
23 /// \author Gines Martinez, Subatech, September 2003
26 #include "AliMUONRecData.h"
27 #include "AliMUONDataIterator.h"
28 #include "AliMUONConstants.h"
29 #include "AliMUONDigit.h"
30 #include "AliMUONGlobalTrigger.h"
31 #include "AliMUONLocalTrigger.h"
32 #include "AliMUONRegionalTrigger.h"
33 #include "AliMUONTriggerCrateStore.h"
34 #include "AliMUONTriggerCircuit.h"
35 #include "AliMUONGeometryTransformer.h"
36 #include "AliMUONRawCluster.h"
37 #include "AliMUONTrack.h"
38 #include "AliMUONTriggerTrack.h"
40 #include "AliRunLoader.h"
45 #include <TParticle.h>
47 #include <Riostream.h>
51 ClassImp(AliMUONRecData)
54 //_____________________________________________________________________________
55 AliMUONRecData::AliMUONRecData()
59 fRecTriggerTracks(0x0),
64 /// Default constructor
66 //_____________________________________________________________________________
67 AliMUONRecData::AliMUONRecData(AliLoader * loader, const char* name, const char* title)
68 : AliMUONData(loader, name, title),
71 fRecTriggerTracks(0x0),
76 /// Standard constructor
79 //_____________________________________________________________________________
80 AliMUONRecData::AliMUONRecData(const char* galiceFile)
81 : AliMUONData(galiceFile, "MUONFolder"),
84 fRecTriggerTracks(0x0),
89 /// Constructor for loading data from gAlice file
92 //_____________________________________________________________________________
93 AliMUONRecData::~AliMUONRecData()
95 /// Destructor for AliMUONRecData
98 fRawClusters->Delete();
102 fRecTracks->Delete();
105 if (fRecTriggerTracks){
106 fRecTriggerTracks->Delete();
107 delete fRecTriggerTracks;
110 //_____________________________________________________________________________
111 void AliMUONRecData::AddRawCluster(Int_t id, const AliMUONRawCluster& c)
113 /// Add a MUON rawcluster to the list in the detection plane id
115 TClonesArray &lrawcl = *((TClonesArray*) fRawClusters->At(id));
116 new(lrawcl[fNrawclusters[id]++]) AliMUONRawCluster(c);
118 //_____________________________________________________________________________
119 void AliMUONRecData::AddRecTrack(const AliMUONTrack& track)
121 /// Add a MUON rectrack
123 TClonesArray &lrectracks = *fRecTracks;
124 new(lrectracks[fNrectracks++]) AliMUONTrack(track);
126 //_____________________________________________________________________________
127 void AliMUONRecData::AddRecTriggerTrack(const AliMUONTriggerTrack& triggertrack)
129 /// Add a MUON triggerrectrack
131 TClonesArray &lrectriggertracks = *fRecTriggerTracks;
132 new(lrectriggertracks[fNrectriggertracks++]) AliMUONTriggerTrack(triggertrack);
134 //____________________________________________________________________________
135 Bool_t AliMUONRecData::IsRawClusterBranchesInTree()
137 /// Checking if there are RawCluster Branches In TreeR
140 AliError("No treeR in memory");
145 sprintf(branchname,"%sRawClusters1",GetName());
146 TBranch * branch = 0x0;
147 branch = TreeR()->GetBranch(branchname);
148 if (branch) return kTRUE;
152 //____________________________________________________________________________
153 Bool_t AliMUONRecData::IsTrackBranchesInTree()
155 /// Checking if there are Track Branches In TreeT
157 AliError("No treeT in memory");
162 sprintf(branchname,"%sTrack",GetName());
163 TBranch * branch = 0x0;
164 branch = TreeT()->GetBranch(branchname);
165 if (branch) return kTRUE;
169 //____________________________________________________________________________
170 Bool_t AliMUONRecData::IsTriggerBranchesInTree()
172 /// Checking if there are Trigger Branches In TreeR
174 AliError("No treeR in memory");
179 sprintf(branchname,"%sLocalTrigger",GetName());
180 TBranch * branch = 0x0;
181 branch = TreeR()->GetBranch(branchname);
182 if (branch) return kTRUE;
186 //____________________________________________________________________________
187 Bool_t AliMUONRecData::IsTriggerTrackBranchesInTree()
189 /// Checking if there are TriggerTrack Branches In TreeT
191 AliError("No treeT in memory");
196 sprintf(branchname,"%sTriggerTrack",GetName());
197 TBranch * branch = 0x0;
198 branch = TreeT()->GetBranch(branchname);
199 if (branch) return kTRUE;
203 //____________________________________________________________________________
204 void AliMUONRecData::FillOwn(Option_t* option)
206 /// Method to fill the trees
208 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
209 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
210 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
211 const char *cTC = strstr(option,"TC"); // global and local Trigger branches Copy in TreeR
214 TBranch * branch = 0x0;
218 if ( TreeR() && cRC && cTC )
224 if ( TreeR() && cRC )
226 if ( IsTriggerBranchesInTree() )
228 // Branch per branch filling
229 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++)
231 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
232 branch = TreeR()->GetBranch(branchname);
244 if (IsRawClusterBranchesInTree())
246 // Branch per branch filling
247 sprintf(branchname,"%sLocalTrigger",GetName());
248 branch = TreeR()->GetBranch(branchname);
250 sprintf(branchname,"%sRegionalTrigger",GetName());
251 branch = TreeR()->GetBranch(branchname);
253 sprintf(branchname,"%sGlobalTrigger",GetName());
254 branch = TreeR()->GetBranch(branchname);
266 if ( TreeT() && cRT && cRL )
272 if ( TreeT() && cRT )
274 if (IsTriggerTrackBranchesInTree())
276 sprintf(branchname,"%sTrack",GetName());
277 branch = TreeT()->GetBranch(branchname);
286 if ( TreeT() && cRL )
288 if (IsTrackBranchesInTree())
290 sprintf(branchname,"%sTriggerTrack",GetName());
291 branch = TreeT()->GetBranch(branchname);
302 //_____________________________________________________________________________
303 void AliMUONRecData::MakeOwnBranch(Option_t* option)
305 /// Create Tree branches for the MUON.
307 const Int_t kBufferSize = 4000;
310 //Setting Data Container
311 SetDataContainer(option);
313 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
314 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
315 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
316 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
317 const char *cTC = strstr(option,"TC"); // global and local Trigger branches Copy in TreeR
319 TBranch * branch = 0x0;
321 if (TreeR() && cRC ) {
322 // one branch for raw clusters per tracking detection plane
325 for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
326 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
328 branch = TreeR()->GetBranch(branchname);
330 AliInfo(Form("Branch %s is already in tree.",branchname));
333 branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize);
334 //Info("MakeBranch","Making Branch %s for rawcluster in detection plane %d\n",branchname,i+1);
338 if (TreeR() && cTC ) {
340 // one branch for global trigger
342 sprintf(branchname,"%sGlobalTrigger",GetName());
344 branch = TreeR()->GetBranch(branchname);
346 AliInfo(Form("Branch GlobalTrigger is already in treeR."));
349 branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize);
350 //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
353 // one branch for regional trigger
355 sprintf(branchname,"%sRegionalTrigger",GetName());
357 branch = TreeR()->GetBranch(branchname);
359 AliInfo(Form("Branch RegionalTrigger is already in treeR."));
362 branch = TreeR()->Branch(branchname, &fRegionalTrigger, kBufferSize);
365 // one branch for local trigger
367 sprintf(branchname,"%sLocalTrigger",GetName());
369 branch = TreeR()->GetBranch(branchname);
371 AliInfo(Form("Branch LocalTrigger is already in treeR."));
374 branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize);
375 //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
378 if (TreeT() && cRT ) {
379 sprintf(branchname,"%sTrack",GetName());
380 branch = TreeT()->GetBranch(branchname);
382 AliInfo(Form("Branch %s is already in tree.",GetName()));
385 branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize);
386 //Info("MakeBranch","Making Branch %s for tracks \n",branchname);
389 if (TreeT() && cRL ) {
390 sprintf(branchname,"%sTriggerTrack",GetName());
391 branch = TreeT()->GetBranch(branchname);
393 AliInfo(Form("Branch %s is already in tree.",GetName()));
396 branch = TreeT()->Branch(branchname,&fRecTriggerTracks,kBufferSize);
397 //Info("MakeBranch","Making Branch %s for trigger tracks \n",branchname);
400 //____________________________________________________________________________
401 void AliMUONRecData::SetOwnDataContainer(Option_t* option)
403 /// Setting data containers of muon data
405 const char *cRC = strstr(option,"RC"); // RawCluster
406 const char *cRT = strstr(option,"RT"); // Reconstructed Tracks
407 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Tracks
408 //const char *cRP = strstr(option,"RP"); // Reconstructed Particles
409 const char *cTC = strstr(option,"TC"); // global and local Trigger branches Copy in TreeR
411 AliDebug(1,Form("option=%s",option));
414 // Containers for rawclusters, globaltrigger and local trigger tree
416 if (fRawClusters == 0x0) {
417 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
418 fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
419 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
420 TClonesArray* tca = new TClonesArray("AliMUONRawCluster",10000);
422 fRawClusters->AddAt(tca,i);
426 // ResetRawClusters();
427 // It breaks the correct functioning of the combined reconstruction (AZ)
431 if (fLocalTrigger == 0x0) {
432 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
434 if (fRegionalTrigger == 0x0) {
435 fRegionalTrigger = new TClonesArray("AliMUONRegionalTrigger",16);
437 if (fGlobalTrigger== 0x0) {
438 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
441 // This is not necessary here since trigger info ins copied from digits info on flight to RecPoint output
445 // Containers for rectracks and rectrigger tracks
447 if (fRecTracks == 0x0) {
448 fRecTracks = new TClonesArray("AliMUONTrack",100);
453 if (fRecTriggerTracks == 0x0 && cRL) {
454 fRecTriggerTracks = new TClonesArray("AliMUONTriggerTrack",100);
456 ResetRecTriggerTracks();
460 //____________________________________________________________________________
461 void AliMUONRecData::SetOwnTreeAddress(Option_t* option)
463 // Setting Data containers
464 SetOwnDataContainer(option);
466 /// Setting Addresses to the events trees
468 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
469 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
470 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
471 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
472 const char *cTC = strstr(option,"TC"); // global and local Trigger branches Copy in TreeR
474 // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree.
476 TBranch * branch = 0x0;
478 AliDebug(1,Form("option=%s",option));
481 // Branch address for rawclusters, globaltrigger and local trigger tree
482 if ( TreeR() && fRawClusters && cRC && !strstr(cRC,"RCC")) {
483 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
484 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
486 branch = TreeR()->GetBranch(branchname);
487 if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
488 else AliWarning(Form("(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i));
492 if ( TreeR() && fLocalTrigger && cTC) {
493 sprintf(branchname,"%sLocalTrigger",GetName());
494 branch = TreeR()->GetBranch(branchname);
495 if (branch) branch->SetAddress(&fLocalTrigger);
496 else AliWarning(Form("(%s) Failed for LocalTrigger. Can not find branch in treeR.",GetName()));
498 if ( TreeR() && fRegionalTrigger && cTC) {
499 sprintf(branchname,"%sRegionalTrigger",GetName());
500 branch = TreeR()->GetBranch(branchname);
501 if (branch) branch->SetAddress(&fRegionalTrigger);
502 else AliWarning(Form("(%s) Failed for RegionalTrigger. Can not find branch in treeR.",GetName()));
504 if ( TreeR() && fGlobalTrigger && cTC) {
505 sprintf(branchname,"%sGlobalTrigger",GetName());
506 branch = TreeR()->GetBranch(branchname);
507 if (branch) branch->SetAddress(&fGlobalTrigger);
508 else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeR.",GetName()));
512 if ( TreeT() && fRecTracks && cRT ) {
513 sprintf(branchname,"%sTrack",GetName());
514 branch = TreeT()->GetBranch(branchname);
515 if (branch) branch->SetAddress(&fRecTracks);
516 else AliWarning(Form("(%s) Failed for Tracks. Can not find branch in tree.",GetName()));
519 if ( TreeT() && fRecTriggerTracks && cRL ) {
520 sprintf(branchname,"%sTriggerTrack",GetName());
521 branch = TreeT()->GetBranch(branchname);
522 if (branch) branch->SetAddress(&fRecTriggerTracks);
523 else AliWarning(Form("(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName()));
527 //____________________________________________________________________________
528 void AliMUONRecData::Fill(Option_t* option)
530 /// Method to fill the trees
532 AliMUONData::Fill(option);
536 //_____________________________________________________________________________
537 void AliMUONRecData::MakeBranch(Option_t* option)
539 /// Create Tree branches for the MUON.
541 AliMUONData::MakeBranch(option);
542 MakeOwnBranch(option);
545 //____________________________________________________________________________
546 void AliMUONRecData::SetDataContainer(Option_t* option)
548 /// Setting data containers of muon data
549 AliMUONData::SetDataContainer(option);
550 SetOwnDataContainer(option);
553 //____________________________________________________________________________
554 void AliMUONRecData::SetTreeAddress(Option_t* option)
556 AliMUONData::SetTreeAddress(option);
557 SetOwnTreeAddress(option);
560 //____________________________________________________________________________
561 TClonesArray* AliMUONRecData::RawClusters(Int_t DetectionPlane)
563 /// Getting Raw Clusters
566 return ( (TClonesArray*) fRawClusters->At(DetectionPlane) );
571 //_______________________________________________________________________________
572 void AliMUONRecData::ResetRawClusters()
574 /// Reset number of raw clusters and the raw clust array for this detector
576 for ( int i=0;i<AliMUONConstants::NTrackingCh();i++ ) {
577 if ((*fRawClusters)[i]) ((TClonesArray*)fRawClusters->At(i))->Clear();
578 if (fNrawclusters) fNrawclusters[i]=0;
582 //____________________________________________________________________________
583 void AliMUONRecData::ResetRecTracks()
585 /// Reset tracks information
588 if (fRecTracks) fRecTracks->Delete(); // necessary to delete in case of memory allocation
591 //____________________________________________________________________________
592 void AliMUONRecData::ResetRecTriggerTracks()
594 /// Reset tracks information
596 fNrectriggertracks = 0;
597 if (fRecTriggerTracks) fRecTriggerTracks->Delete(); // necessary to delete in case of memory allocation
600 //_____________________________________________________________________________
602 AliMUONRecData::DumpRecPoints(Int_t event2Check, Option_t* opt)
606 fLoader->LoadRecPoints("READ");
609 Int_t nevents = fRunLoader->GetNumberOfEvents();
610 for (Int_t ievent=0; ievent<nevents; ievent++) {
611 if (event2Check!=0) ievent=event2Check;
612 printf(">>> Event %d \n",ievent);
614 // Getting event ievent
615 fRunLoader->GetEvent(ievent);
616 Int_t nchambers = AliMUONConstants::NTrackingCh();
617 SetTreeAddress("RC,TC");
621 for (Int_t ichamber=0; ichamber<nchambers; ichamber++) {
623 sprintf(branchname,"MUONRawClusters%d",ichamber+1);
624 //printf(">>> branchname %s\n",branchname);
626 // Loop on rec points
627 Int_t nrecpoints = (Int_t) RawClusters(ichamber)->GetEntriesFast();
628 // printf(">>> Chamber %2d, Number of recpoints = %6d \n",ichamber+1, nrecpoints);
629 for (Int_t irecpoint=0; irecpoint<nrecpoints; irecpoint++) {
630 AliMUONRawCluster* mRecPoint = static_cast<AliMUONRawCluster*>(RawClusters(ichamber)->At(irecpoint));
631 mRecPoint->Print(opt);
635 if (event2Check!=0) ievent=nevents;
637 fLoader->UnloadRecPoints();
640 //_____________________________________________________________________________
642 AliMUONRecData::DumpTracks(Int_t event2Check, Option_t* opt)
646 fLoader->LoadTracks("READ");
649 Int_t nevents = fRunLoader->GetNumberOfEvents();
651 for (Int_t ievent=0; ievent<nevents; ievent++)
653 if (event2Check!=0) ievent=event2Check;
655 printf(">>> Event %d \n",ievent);
657 // Getting event ievent
658 fRunLoader->GetEvent(ievent);
660 Int_t nchambers = AliMUONConstants::NTrackingCh();
661 SetTreeAddress("RT");
665 for (Int_t ichamber=0; ichamber<nchambers; ++ichamber)
668 TClonesArray* tracks = RecTracks();
669 Int_t ntracks = (Int_t) tracks->GetEntriesFast();
671 for (Int_t i=0; i<ntracks; ++i)
673 AliMUONTrack* mTrack = static_cast<AliMUONTrack*>(tracks->At(i));
678 if (event2Check!=0) ievent=nevents;
680 fLoader->UnloadTracks();
683 //_____________________________________________________________________________
685 AliMUONRecData::DumpRecTrigger(Int_t event2Check,
686 Int_t write, Bool_t readFromRP)
688 /// Reads and dumps trigger objects from MUON.RecPoints.root
690 TClonesArray * globalTrigger;
691 TClonesArray * localTrigger;
693 // Do NOT print out all the info if the loop runs over all events
694 Int_t printout = (event2Check == 0 ) ? 0 : 1 ;
696 // Book a ntuple for more detailled studies
697 TNtuple *tupleGlo = new TNtuple("TgtupleGlo","Global Trigger Ntuple","ev:global:slpt:shpt:uplpt:uphpt:lplpt:lplpt");
698 TNtuple *tupleLoc = new TNtuple("TgtupleLoc","Local Trigger Ntuple","ev:LoCircuit:LoStripX:LoDev:StripY:LoLpt:LoHpt:y11:y21:x11");
701 Int_t sLowpt=0,sHighpt=0;
702 Int_t uSLowpt=0,uSHighpt=0;
703 Int_t lSLowpt=0,lSHighpt=0;
705 AliMUONTriggerCrateStore* crateManager = new AliMUONTriggerCrateStore();
706 crateManager->ReadFromFile();
708 AliMUONGeometryTransformer* transformer = new AliMUONGeometryTransformer(kFALSE);
709 transformer->ReadGeometryData("volpath.dat", "geometry.root");
711 TClonesArray* triggerCircuit = new TClonesArray("AliMUONTriggerCircuit", 234);
713 for (Int_t i = 0; i < AliMUONConstants::NTriggerCircuit(); i++) {
714 AliMUONTriggerCircuit* c = new AliMUONTriggerCircuit();
715 c->SetTransformer(transformer);
716 c->Init(i,*crateManager);
717 TClonesArray& circuit = *triggerCircuit;
718 new(circuit[circuit.GetEntriesFast()])AliMUONTriggerCircuit(*c);
724 AliInfoStream() << " reading from digits \n";
725 fLoader->LoadDigits("READ");
726 sprintf(fileName,"TriggerCheckFromDigits.root");
728 AliInfoStream() << " reading from RecPoints \n";
729 fLoader->LoadRecPoints("READ");
730 sprintf(fileName,"TriggerCheckFromRP.root");
734 AliMUONGlobalTrigger *gloTrg(0x0);
735 AliMUONLocalTrigger *locTrg(0x0);
737 Int_t nevents = fRunLoader->GetNumberOfEvents();
738 for (Int_t ievent=0; ievent<nevents; ievent++) {
739 if (event2Check!=0) ievent=event2Check;
740 if (ievent%100==0 || event2Check)
741 AliInfoStream() << "Processing event " << ievent << endl;
742 fRunLoader->GetEvent(ievent);
745 SetTreeAddress("D,GLT");
748 SetTreeAddress("RC,TC");
752 globalTrigger = GlobalTrigger();
753 localTrigger = LocalTrigger();
755 Int_t nglobals = (Int_t) globalTrigger->GetEntriesFast(); // should be 1
756 Int_t nlocals = (Int_t) localTrigger->GetEntriesFast(); // up to 234
757 if (printout) printf("###################################################\n");
758 if (printout) printf("event %d nglobal %d nlocal %d \n",ievent,nglobals,nlocals);
760 for (Int_t iglobal=0; iglobal<nglobals; iglobal++) { // Global Trigger
761 gloTrg = static_cast<AliMUONGlobalTrigger*>(globalTrigger->At(iglobal));
763 sLowpt+=gloTrg->SingleLpt() ;
764 sHighpt+=gloTrg->SingleHpt() ;
765 uSLowpt+=gloTrg->PairUnlikeLpt();
766 uSHighpt+=gloTrg->PairUnlikeHpt();
767 lSLowpt+=gloTrg->PairLikeLpt();
768 lSHighpt+=gloTrg->PairLikeHpt();
770 if (printout) gloTrg->Print("full");
772 } // end of loop on Global Trigger
774 for (Int_t ilocal=0; ilocal<nlocals; ilocal++) { // Local Trigger
775 locTrg = static_cast<AliMUONLocalTrigger*>(localTrigger->At(ilocal));
780 if ( locTrg->LoSdev()==1 && locTrg->LoDev()==0 &&
781 locTrg->LoStripX()==0) xTrig=kFALSE; // no trigger in X
782 else xTrig=kTRUE; // trigger in X
783 if (locTrg->LoTrigY()==1 &&
784 locTrg->LoStripY()==15 ) yTrig = kFALSE; // no trigger in Y
785 else yTrig = kTRUE; // trigger in Y
787 if (xTrig && yTrig) { // make Trigger Track if trigger in X and Y
789 if (printout) locTrg->Print("full");
791 AliMUONTriggerCircuit* circuit = (AliMUONTriggerCircuit*)triggerCircuit->At(locTrg->LoCircuit()-1);
793 tupleLoc->Fill(ievent,locTrg->LoCircuit(),locTrg->LoStripX(),locTrg->LoDev(),locTrg->LoStripY(),locTrg->LoLpt(),locTrg->LoHpt(),circuit->GetY11Pos(locTrg->LoStripX()),circuit->GetY21Pos(locTrg->LoStripX()+locTrg->LoDev()+1),circuit->GetX11Pos(locTrg->LoStripY()));
796 } // end of loop on Local Trigger
799 tupleGlo->Fill(ievent,nglobals,gloTrg->SingleLpt(),gloTrg->SingleHpt(),gloTrg->PairUnlikeLpt(),gloTrg->PairUnlikeHpt(),gloTrg->PairLikeLpt(),gloTrg->PairLikeHpt());
802 if (event2Check!=0) ievent=nevents;
803 } // end loop on event
805 // Print out summary if loop ran over all event
809 printf("=============================================\n");
810 printf("================ SUMMARY ==================\n");
812 printf("Total number of events processed %d \n", (event2Check==0) ? nevents : 1);
814 printf(" Global Trigger output Low pt High pt\n");
815 printf(" number of Single :\t");
816 printf("%i\t%i\t",sLowpt,sHighpt);
818 printf(" number of UnlikeSign pair :\t");
819 printf("%i\t%i\t",uSLowpt,uSHighpt);
821 printf(" number of LikeSign pair :\t");
822 printf("%i\t%i\t",lSLowpt,lSHighpt);
824 printf("=============================================\n");
829 TFile *myFile = new TFile(fileName, "RECREATE");
835 fLoader->UnloadRecPoints();
839 delete triggerCircuit;