ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

/* $Id$ */

/// \ingroup macros
/// \file MUONCheckDI.C
/// \brief Macro for checking AliMUONDataInterface and AliMUONMCDataInterface.
///
/// \author Bruce Becker, DAPNIA/SPhN/CEA Saclay
///
/// Modified to updated versions of data interfaces
/// by Artur Szostak <artursz@iafrica.com> (University of Cape Town)

#if !defined(__CINT__) || defined(__MAKECINT__)
#include "AliMUONHit.h"
#include "AliMUONVDigit.h"
#include "AliMUONVCluster.h"
#include "AliMUONLocalTrigger.h"
#include "AliMUONRegionalTrigger.h"
#include "AliMUONGlobalTrigger.h"
#include "AliMUONMCDataInterface.h"
#include "AliMUONDataInterface.h"
#include "AliMUONVHitStore.h"
#include "AliMUONVDigitStore.h"
#include "AliMUONVClusterStore.h"
#include "AliMUONVTriggerStore.h"
#include "AliMpConstants.h"
#include "AliMpDEManager.h"

#include "AliCDBManager.h"

#include <Rtypes.h>
#include <Riostream.h>
#include <TObjArray.h>
#include <TIterator.h>
#include <TMatrixD.h>

#include <cstdlib>

#endif


/**
 * This routine implements a the comparison functionality which is missing for
 * classes like AliMUONTrack and the various AliMUONxxxTrigger classes.
 * A result of -1 is returned if a < b, 0 if a == b and +1 if a > b.
 */
Int_t Compare(const TObject* a, const TObject* b)
{
	int result = -999;
	if (a->IsA() == AliMUONLocalTrigger::Class() && b->IsA() == AliMUONLocalTrigger::Class())
	{
		result = memcmp(a, b, sizeof(AliMUONLocalTrigger));
	}
	else if (a->IsA() == AliMUONRegionalTrigger::Class() && b->IsA() == AliMUONRegionalTrigger::Class())
	{
		const AliMUONRegionalTrigger* ra = static_cast<const AliMUONRegionalTrigger*>(a);
		const AliMUONRegionalTrigger* rb = static_cast<const AliMUONRegionalTrigger*>(b);
		if (ra->GetId() < rb->GetId()) return -1;
		if (ra->GetId() > rb->GetId()) return 1;
		if (ra->GetLocalOutput(0) < rb->GetLocalOutput(0)) return -1;
		if (ra->GetLocalOutput(0) > rb->GetLocalOutput(0)) return 1;
		if (ra->GetLocalOutput(1) < rb->GetLocalOutput(1)) return -1;
		if (ra->GetLocalOutput(1) > rb->GetLocalOutput(1)) return 1;
		if (ra->GetLocalMask() < rb->GetLocalMask()) return -1;
		if (ra->GetLocalMask() > rb->GetLocalMask()) return 1;
		if (ra->GetOutput() < rb->GetOutput()) return -1;
		if (ra->GetOutput() > rb->GetOutput()) return 1;
		return 0;
	}
	else if (a->IsA() == AliMUONGlobalTrigger::Class() && b->IsA() == AliMUONGlobalTrigger::Class())
	{
		result = memcmp(a, b, sizeof(AliMUONGlobalTrigger));
	}
	else
	{
		result = memcmp(a, b, sizeof(TObject));
	}
	
	if (result < 0) return -1;
	if (result > 0) return 1;
	return 0;
}

/**
 * This method fills internal arrays with local and regional triggers returned
 * by AliMUONMCDataInterface. For each set of interface methods available in
 * AliMUONMCDataInterface a TObjArray is created for local and another for regional
 * triggers. These arrays are filled with copies of the trigger objects.
 * The global trigger object is also copied out using the 2 different methods.
 * The arrays and objects are then compared to each other. The arrays and objects
 * should contain the same information if everything is working correctly with
 * AliMUONMCDataInterface. If not then the difference is printed together with an
 * error message and false is returned.
 */
bool SimTriggersOk()
{
	AliMUONMCDataInterface data("generated/galice.root");
	for (Int_t event = 0; event < data.NumberOfEvents(); event++)
	{
		TObjArray localsFromStore, regionalsFromStore;
		localsFromStore.SetOwner(kTRUE);
		regionalsFromStore.SetOwner(kTRUE);
		AliMUONVTriggerStore* store = data.TriggerStore(event);
		if (store == NULL) return false;
		AliMUONGlobalTrigger* globalFromStore = static_cast<AliMUONGlobalTrigger*>(store->Global()->Clone());
		TIter nextLocal(store->CreateLocalIterator());
		AliMUONLocalTrigger* localTrig;
		while ( (localTrig = static_cast<AliMUONLocalTrigger*>( nextLocal() )) != NULL )
		{
			localsFromStore.Add(localTrig->Clone());
		}
		TIter nextRegional(store->CreateRegionalIterator());
		AliMUONRegionalTrigger* regionalTrig;
		while ( (regionalTrig = static_cast<AliMUONRegionalTrigger*>( nextRegional() )) != NULL )
		{
			regionalsFromStore.Add(regionalTrig->Clone());
		}
		
		TObjArray localsByIndex, regionalsByIndex;
		localsByIndex.SetOwner(kTRUE);
		regionalsByIndex.SetOwner(kTRUE);
		data.GetEvent(event);
		AliMUONGlobalTrigger* globalByMethod = static_cast<AliMUONGlobalTrigger*>(data.GlobalTrigger()->Clone());
		Int_t nlocals = data.NumberOfLocalTriggers();
		for (Int_t i = 0; i < nlocals; i++)
		{
			localTrig = data.LocalTrigger(i);
			localsByIndex.Add(localTrig->Clone());
		}
		Int_t nregionals = data.NumberOfRegionalTriggers();
		for (Int_t i = 0; i < nregionals; i++)
		{
			regionalTrig = data.RegionalTrigger(i);
			regionalsByIndex.Add(regionalTrig->Clone());
		}
		
		// Now check that all the lists of local, regional and global triggers
		// contain the same results.
		// They must. If they do not then something is wrong with the implementation
		// of AliMUONMCDataInterface.
		if (Compare(globalFromStore, globalByMethod) != 0)
		{
			Error(	"SimTriggersOk",
				"The AliMUONMCDataInterface does not return identical global"
				  " triggers through all its user interface methods."
			);
			globalFromStore->Print();
			globalByMethod->Print();
			return false;
		}
		delete globalFromStore;
		delete globalByMethod;
		if (localsFromStore.GetEntriesFast() != localsByIndex.GetEntriesFast())
		{
			Error(	"SimTriggersOk",
				"The AliMUONMCDataInterface does not return all the local triggers"
				  " correctly through all its user interface methods. We got the"
				  " following numbers of local triggers: %d and %d",
				localsFromStore.GetEntriesFast(),
				localsByIndex.GetEntriesFast()
			);
			return false;
		}
		if (regionalsFromStore.GetEntriesFast() != regionalsByIndex.GetEntriesFast())
		{
			Error(	"SimTriggersOk",
				"The AliMUONMCDataInterface does not return all the regional triggers"
				  " correctly through all its user interface methods. We got the"
				  " following numbers of regional triggers: %d and %d",
				regionalsFromStore.GetEntriesFast(),
				regionalsByIndex.GetEntriesFast()
			);
			return false;
		}
		for (Int_t i = 0; i < localsFromStore.GetEntriesFast(); i++)
		{
			if (Compare(localsFromStore[i], localsByIndex[i]) != 0)
			{
				Error(	"SimTriggersOk",
					"The AliMUONMCDataInterface does not return identical local"
					  " triggers through all its user interface methods. The"
					  " incorrect local trigger has index %d.",
					i
				);
				localsFromStore[i]->Print();
				localsByIndex[i]->Print();
				return false;
			}
		}
		for (Int_t i = 0; i < regionalsFromStore.GetEntriesFast(); i++)
		{
			if (Compare(regionalsFromStore[i], regionalsByIndex[i]) != 0)
			{
				Error(	"SimTriggersOk",
					"The AliMUONMCDataInterface does not return identical regional"
					  " triggers through all its user interface methods. The"
					  " incorrect regional trigger has index %d.",
					i
				);
				regionalsFromStore[i]->Print();
				regionalsByIndex[i]->Print();
				return false;
			}
				regionalsFromStore[i]->Print();
				regionalsByIndex[i]->Print();
		}
	}
	return true;
}

/**
 * This method fills internal arrays with s-digits returned by the AliMUONMCDataInterface.
 * For each set of interface methods available a TObjArray is filled with copies of 
 * the s-digits. These arrays are sorted and then compared to each other. The arrays
 * should contain the same s-digit information if everything is working correctly with
 * AliMUONMCDataInterface. If not then the difference is printed together with an
 * error message and false is returned.
 */
bool SimSDigitsOk()
{
	AliMUONMCDataInterface data("generated/galice.root");
	for (Int_t event = 0; event < data.NumberOfEvents(); event++)
	{
		TObjArray digitsFromStore;
		digitsFromStore.SetOwner(kTRUE);
		AliMUONVDigitStore* store = data.SDigitStore(event);
		if (store == NULL) return false;
		TIter next(store->CreateIterator());
		AliMUONVDigit* digit;
		while ( (digit = static_cast<AliMUONVDigit*>( next() )) != NULL )
		{
			digitsFromStore.Add(digit->Clone());
		}
		digitsFromStore.Sort();
		
		TObjArray digitsByDetElem;
		digitsByDetElem.SetOwner(kTRUE);
		data.GetEvent(event);
		for (Int_t detElem = 0; detElem < 1500; detElem++)
		{
			if (! AliMpDEManager::IsValidDetElemId(detElem)) continue;
			Int_t ndigits = data.NumberOfSDigits(detElem);
			for (Int_t i = 0; i < ndigits; i++)
			{
				AliMUONVDigit* digit = data.SDigit(detElem, i);
				digitsByDetElem.Add(digit->Clone());
			}
		}
		digitsByDetElem.Sort();
		
		TObjArray digitsByChamber;
		digitsByChamber.SetOwner(kTRUE);
		data.GetEvent(event);
		for (Int_t chamber = 0; chamber < AliMpConstants::NofChambers(); chamber++)
		for (Int_t cathode = 0; cathode < 2; cathode++)
		{
			Int_t ndigits = data.NumberOfSDigits(chamber, cathode);
			for (Int_t i = 0; i < ndigits; i++)
			{
				AliMUONVDigit* digit = data.SDigit(chamber, cathode, i);
				digitsByChamber.Add(digit->Clone());
			}
		}
		digitsByChamber.Sort();
		
		// Now check that all the lists of s-digits contain the same results.
		// They must. If they do not then something is wrong with the implementation
		// of AliMUONMCDataInterface.
		if (digitsFromStore.GetEntriesFast() != digitsByDetElem.GetEntriesFast()
		    || digitsFromStore.GetEntriesFast() != digitsByChamber.GetEntriesFast())
		{
			Error(	"SimSDigitsOk",
				"The AliMUONMCDataInterface does not return all the s-digits correctly"
				  " through all its user interface methods. We got the following"
				  " numbers of s-digits: %d, %d and %d",
				digitsFromStore.GetEntriesFast(),
				digitsByDetElem.GetEntriesFast(),
				digitsByChamber.GetEntriesFast()
			);
			return false;
		}
		for (Int_t i = 0; i < digitsFromStore.GetEntriesFast(); i++)
		{
			if (digitsFromStore[i]->Compare(digitsByDetElem[i]) != 0
			    || digitsFromStore[i]->Compare(digitsByChamber[i]) != 0)
			{
				Error(	"SimSDigitsOk",
					"The AliMUONMCDataInterface does not return identical s-digits"
					  " through all its user interface methods. The incorrect"
					  " s-digit has index %d after sorting.",
					i
				);
				digitsFromStore[i]->Print();
				digitsByChamber[i]->Print();
				digitsByDetElem[i]->Print();
				return false;
			}
		}
	}
	return true;
}

/**
 * This method fills internal arrays with digits returned by the AliMUONMCDataInterface.
 * For each set of interface methods available a TObjArray is filled with copies of 
 * the digits. These arrays are sorted and then compared to each other. The arrays
 * should contain the same digit information if everything is working correctly with
 * AliMUONMCDataInterface. If not then the difference is printed together with an
 * error message and false is returned.
 */
bool SimDigitsOk()
{
	AliMUONMCDataInterface data("generated/galice.root");
	for (Int_t event = 0; event < data.NumberOfEvents(); event++)
	{
		TObjArray digitsFromStore;
		digitsFromStore.SetOwner(kTRUE);
		AliMUONVDigitStore* store = data.DigitStore(event);
		if (store == NULL) return false;
		TIter next(store->CreateIterator());
		AliMUONVDigit* digit;
		while ( (digit = static_cast<AliMUONVDigit*>( next() )) != NULL )
		{
			digitsFromStore.Add(digit->Clone());
		}
		digitsFromStore.Sort();
		
		TObjArray digitsByDetElem;
		digitsByDetElem.SetOwner(kTRUE);
		data.GetEvent(event);
		for (Int_t detElem = 0; detElem < 1500; detElem++)
		{
			if (! AliMpDEManager::IsValidDetElemId(detElem)) continue;
			Int_t ndigits = data.NumberOfDigits(detElem);
			for (Int_t i = 0; i < ndigits; i++)
			{
				AliMUONVDigit* digit = data.Digit(detElem, i);
				digitsByDetElem.Add(digit->Clone());
			}
		}
		digitsByDetElem.Sort();
		
		TObjArray digitsByChamber;
		digitsByChamber.SetOwner(kTRUE);
		data.GetEvent(event);
		for (Int_t chamber = 0; chamber < AliMpConstants::NofChambers(); chamber++)
		for (Int_t cathode = 0; cathode < 2; cathode++)
		{
			Int_t ndigits = data.NumberOfDigits(chamber, cathode);
			for (Int_t i = 0; i < ndigits; i++)
			{
				AliMUONVDigit* digit = data.Digit(chamber, cathode, i);
				digitsByChamber.Add(digit->Clone());
			}
		}
		digitsByChamber.Sort();
		
		// Now check that all the lists of digits contain the same results.
		// They must. If they do not then something is wrong with the implementation
		// of AliMUONMCDataInterface.
		if (digitsFromStore.GetEntriesFast() != digitsByDetElem.GetEntriesFast()
		    || digitsFromStore.GetEntriesFast() != digitsByChamber.GetEntriesFast())
		{
			Error(	"SimDigitsOk",
				"The AliMUONMCDataInterface does not return all the digits correctly"
				  " through all its user interface methods. We got the following"
				  " numbers of digits: %d, %d and %d",
				digitsFromStore.GetEntriesFast(),
				digitsByDetElem.GetEntriesFast(),
				digitsByChamber.GetEntriesFast()
			);
			return false;
		}
		for (Int_t i = 0; i < digitsFromStore.GetEntriesFast(); i++)
		{
			if (digitsFromStore[i]->Compare(digitsByDetElem[i]) != 0
			    || digitsFromStore[i]->Compare(digitsByChamber[i]) != 0)
			{
				Error(	"SimDigitsOk",
					"The AliMUONMCDataInterface does not return identical digits"
					  " through all its user interface methods. The incorrect"
					  " digit has index %d after sorting.",
					i
				);
				digitsFromStore[i]->Print();
				digitsByChamber[i]->Print();
				digitsByDetElem[i]->Print();
				return false;
			}
		}
	}
	return true;
}

/**
 * This method fills internal arrays with hits returned by the AliMUONMCDataInterface.
 * For each set of interface methods available a TObjArray is filled with copies of 
 * the hits. These arrays are then compared to each other. The arrays should contain
 * the same hit information if everything is working correctly with AliMUONMCDataInterface.
 * If not then the difference is printed together with an error message and false is returned.
 */
bool SimHitsOk()
{
	AliMUONMCDataInterface data("generated/galice.root");
	for (Int_t event = 0; event < data.NumberOfEvents(); event++)
	{
		if (data.NumberOfTracks(event) != data.NumberOfTracks())
		{
			Error(	"SimHitsOk",
				"The AliMUONMCDataInterface does not return the same number of tracks"
				  " through all its user interface methods. We got the following"
				  " numbers of tracks: %d and %d",
				data.NumberOfTracks(event),
				data.NumberOfTracks()
			);
			return false;
		}
		
		for (Int_t track = 0; track < data.NumberOfTracks(); track++)
		{
			TObjArray hitsFromStore;
			hitsFromStore.SetOwner(kTRUE);
			AliMUONVHitStore* store = data.HitStore(event, track);
			if (store == NULL) return false;
			TIter next(store->CreateIterator());
			AliMUONHit* hit;
			while ( (hit = static_cast<AliMUONHit*>( next() )) != NULL )
			{
				hitsFromStore.Add(hit->Clone());
			}
			//hitsFromStore.Sort();  // Unfortunately hits do not implement the Compare method.
			
			TObjArray hitsByMethod;
			hitsByMethod.SetOwner(kTRUE);
			data.GetEvent(event);
			for (Int_t i = 0; i < data.NumberOfHits(track); i++)
			{
				AliMUONHit* hit = data.Hit(track, i);
				hitsByMethod.Add(hit->Clone());
			}
			//hitsByMethod.Sort();  // Unfortunately hits do not implement the Compare method.
			
			// Now check that both lists of hits contain the same results.
			// They must. If they do not then something is wrong with the implementation
			// of AliMUONMCDataInterface.
			if (hitsFromStore.GetEntriesFast() != hitsByMethod.GetEntriesFast())
			{
				Error(	"SimHitsOk",
					"The AliMUONMCDataInterface does not return all the hits correctly"
					" through all its user interface methods. We got the following"
					" numbers of hits: %d and %d",
					hitsFromStore.GetEntriesFast(),
					hitsByMethod.GetEntriesFast()
				);
				return false;
			}
			for (Int_t i = 0; i < hitsFromStore.GetEntriesFast(); i++)
			{
				if (Compare(hitsFromStore[i], hitsByMethod[i]) != 0)
				{
					Error(	"SimHitsOk",
						"The AliMUONMCDataInterface does not return identical hits"
						" through all its user interface methods. The incorrect"
						" hit has index %d after sorting, for track %d.",
						i, track
					);
					hitsFromStore[i]->Print();
					hitsByMethod[i]->Print();
					return false;
				}
			}
		}
	}
	return true;
}

/**
 * This method fills internal arrays with digits returned by the AliMUONDataInterface.
 * For each set of interface methods available a TObjArray is filled with copies of 
 * the digits. These arrays are sorted and then compared to each other. The arrays
 * should contain the same digit information if everything is working correctly with
 * AliMUONDataInterface. If not then the difference is printed together with an
 * error message and false is returned.
 */
bool RecDigitsOk()
{
	AliMUONDataInterface data;
	for (Int_t event = 0; event < data.NumberOfEvents(); event++)
	{
		TObjArray digitsFromStore;
		digitsFromStore.SetOwner(kTRUE);
		AliMUONVDigitStore* store = data.DigitStore(event);
		if (store == NULL) return false;
		TIter next(store->CreateIterator());
		AliMUONVDigit* digit;
		while ( (digit = static_cast<AliMUONVDigit*>( next() )) != NULL )
		{
			digitsFromStore.Add(digit->Clone());
		}
		digitsFromStore.Sort();
		
		TObjArray digitsByDetElem;
		digitsByDetElem.SetOwner(kTRUE);
		data.GetEvent(event);
		for (Int_t detElem = 0; detElem < 1500; detElem++)
		{
			if (! AliMpDEManager::IsValidDetElemId(detElem)) continue;
			Int_t ndigits = data.NumberOfDigits(detElem);
			for (Int_t i = 0; i < ndigits; i++)
			{
				AliMUONVDigit* digit = data.Digit(detElem, i);
				digitsByDetElem.Add(digit->Clone());
			}
		}
		digitsByDetElem.Sort();
		
		TObjArray digitsByChamber;
		digitsByChamber.SetOwner(kTRUE);
		data.GetEvent(event);
		for (Int_t chamber = 0; chamber < AliMpConstants::NofChambers(); chamber++)
		for (Int_t cathode = 0; cathode < 2; cathode++)
		{
			Int_t ndigits = data.NumberOfDigits(chamber, cathode);
			for (Int_t i = 0; i < ndigits; i++)
			{
				AliMUONVDigit* digit = data.Digit(chamber, cathode, i);
				digitsByChamber.Add(digit->Clone());
			}
		}
		digitsByChamber.Sort();
		
		// Now check that all the lists of digits contain the same results.
		// They must. If they do not then something is wrong with the implementation
		// of AliMUONDataInterface.
		if (digitsFromStore.GetEntriesFast() != digitsByDetElem.GetEntriesFast()
		    || digitsFromStore.GetEntriesFast() != digitsByChamber.GetEntriesFast())
		{
			Error(	"RecDigitsOk",
				"The AliMUONDataInterface does not return all the digits correctly"
				  " through all its user interface methods. We got the following"
				  " numbers of digits: %d, %d and %d",
				digitsFromStore.GetEntriesFast(),
				digitsByDetElem.GetEntriesFast(),
				digitsByChamber.GetEntriesFast()
			);
			return false;
		}
		for (Int_t i = 0; i < digitsFromStore.GetEntriesFast(); i++)
		{
			if (digitsFromStore[i]->Compare(digitsByDetElem[i]) != 0
			    || digitsFromStore[i]->Compare(digitsByChamber[i]) != 0)
			{
				Error(	"RecDigitsOk",
					"The AliMUONDataInterface does not return identical digits"
					  " through all its user interface methods. The incorrect"
					  " digit has index %d after sorting.",
					i
				);
				digitsFromStore[i]->Print();
				digitsByChamber[i]->Print();
				digitsByDetElem[i]->Print();
				return false;
			}
		}
	}
	return true;
}

/**
 * This method fills internal arrays with raw clusters returned by AliMUONDataInterface.
 * For each set of interface methods available in AliMUONDataInterface a TObjArray is
 * filled with copies of the raw clusters. These arrays are sorted and then compared
 * to each other. The arrays should contain the same information if everything is
 * working correctly with AliMUONDataInterface. If not then the difference is printed
 * together with an error message and false is returned.
 */
bool RawClustersOk()
{
	AliMUONDataInterface data;
	for (Int_t event = 0; event < data.NumberOfEvents(); event++)
	{
		TObjArray clustersFromStore;
		clustersFromStore.SetOwner(kTRUE);
		AliMUONVClusterStore* store = data.ClusterStore(event);
		if (store == NULL) return false;
		TIter next(store->CreateIterator());
		AliMUONVCluster* cluster;
		while ( (cluster = static_cast<AliMUONVCluster*>( next() )) != NULL )
		{
			clustersFromStore.Add(cluster->Clone());
		}
		clustersFromStore.Sort();
		
		TObjArray clustersByChamber;
		clustersByChamber.SetOwner(kTRUE);
		data.GetEvent(event);
		for (Int_t chamber = 0; chamber < AliMpConstants::NofTrackingChambers(); chamber++)
		{
			Int_t nclusters = data.NumberOfRawClusters(chamber);
			for (Int_t i = 0; i < nclusters; i++)
			{
				AliMUONVCluster* cluster = data.RawCluster(chamber, i);
				clustersByChamber.Add(cluster->Clone());
			}
		}
		clustersByChamber.Sort();
		
		// Now check that all the lists of clusters contain the same results.
		// They must. If they do not then something is wrong with the implementation
		// of AliMUONDataInterface.
		if (clustersFromStore.GetEntriesFast() != clustersByChamber.GetEntriesFast())
		{
			Error(	"RawClustersOk",
				"The AliMUONDataInterface does not return all the clusters correctly"
				  " through all its user interface methods. We got the following"
				  " numbers of clusters: %d and %d",
				clustersFromStore.GetEntriesFast(),
				clustersByChamber.GetEntriesFast()
			);
			return false;
		}
		for (Int_t i = 0; i < clustersFromStore.GetEntriesFast(); i++)
		{
			if (clustersFromStore[i]->Compare(clustersByChamber[i]) != 0)
			{
				Error(	"RawClustersOk",
					"The AliMUONDataInterface does not return identical clusters"
					  " through all its user interface methods. The incorrect"
					  " cluster has index %d after sorting.",
					i
				);
				clustersFromStore[i]->Print();
				clustersByChamber[i]->Print();
				return false;
			}
		}
	}
	return true;
}

/**
 * This method fills internal arrays with local and regional triggers returned
 * by AliMUONDataInterface. For each set of interface methods available in
 * AliMUONDataInterface a TObjArray is created for local and another for regional
 * triggers. These arrays are filled with copies of the trigger objects.
 * The global trigger object is also copied out using the 2 different methods.
 * The arrays and objects are then compared to each other. The arrays and objects
 * should contain the same information if everything is working correctly with
 * AliMUONDataInterface. If not then the difference is printed together with an
 * error message and false is returned.
 */
bool TriggersOk()
{
	AliMUONDataInterface data;
	for (Int_t event = 0; event < data.NumberOfEvents(); event++)
	{
		TObjArray localsFromStore, regionalsFromStore;
		localsFromStore.SetOwner(kTRUE);
		regionalsFromStore.SetOwner(kTRUE);
		AliMUONVTriggerStore* store = data.TriggerStore(event);
		if (store == NULL) return false;
		AliMUONGlobalTrigger* globalFromStore = static_cast<AliMUONGlobalTrigger*>(store->Global()->Clone());
		TIter nextLocal(store->CreateLocalIterator());
		AliMUONLocalTrigger* localTrig;
		while ( (localTrig = static_cast<AliMUONLocalTrigger*>( nextLocal() )) != NULL )
		{
			localsFromStore.Add(localTrig->Clone());
		}
		TIter nextRegional(store->CreateRegionalIterator());
		AliMUONRegionalTrigger* regionalTrig;
		while ( (regionalTrig = static_cast<AliMUONRegionalTrigger*>( nextRegional() )) != NULL )
		{
			regionalsFromStore.Add(regionalTrig->Clone());
		}
		
		TObjArray localsByIndex, regionalsByIndex;
		localsByIndex.SetOwner(kTRUE);
		regionalsByIndex.SetOwner(kTRUE);
		data.GetEvent(event);
		AliMUONGlobalTrigger* globalByMethod = static_cast<AliMUONGlobalTrigger*>(data.GlobalTrigger()->Clone());
		Int_t nlocals = data.NumberOfLocalTriggers();
		for (Int_t i = 0; i < nlocals; i++)
		{
			localTrig = data.LocalTrigger(i);
			localsByIndex.Add(localTrig->Clone());
		}
		Int_t nregionals = data.NumberOfRegionalTriggers();
		for (Int_t i = 0; i < nregionals; i++)
		{
			regionalTrig = data.RegionalTrigger(i);
			regionalsByIndex.Add(regionalTrig->Clone());
		}
		
		// Now check that all the lists of local, regional and global triggers
		// contain the same results.
		// They must. If they do not then something is wrong with the implementation
		// of AliMUONDataInterface.
		if (Compare(globalFromStore, globalByMethod) != 0)
		{
			Error(	"TriggersOk",
				"The AliMUONDataInterface does not return identical global"
				  " triggers through all its user interface methods."
			);
			globalFromStore->Print();
			globalByMethod->Print();
			return false;
		}
		delete globalFromStore;
		delete globalByMethod;
		if (localsFromStore.GetEntriesFast() != localsByIndex.GetEntriesFast())
		{
			Error(	"TriggersOk",
				"The AliMUONDataInterface does not return all the local triggers"
				  " correctly through all its user interface methods. We got the"
				  " following numbers of local triggers: %d and %d",
				localsFromStore.GetEntriesFast(),
				localsByIndex.GetEntriesFast()
			);
			return false;
		}
		if (regionalsFromStore.GetEntriesFast() != regionalsByIndex.GetEntriesFast())
		{
			Error(	"TriggersOk",
				"The AliMUONDataInterface does not return all the regional triggers"
				  " correctly through all its user interface methods. We got the"
				  " following numbers of regional triggers: %d and %d",
				regionalsFromStore.GetEntriesFast(),
				regionalsByIndex.GetEntriesFast()
			);
			return false;
		}
		for (Int_t i = 0; i < localsFromStore.GetEntriesFast(); i++)
		{
			if (Compare(localsFromStore[i], localsByIndex[i]) != 0)
			{
				Error(	"TriggersOk",
					"The AliMUONDataInterface does not return identical local"
					  " triggers through all its user interface methods. The"
					  " incorrect local trigger has index %d.",
					i
				);
				localsFromStore[i]->Print();
				localsByIndex[i]->Print();
				return false;
			}
		}
		for (Int_t i = 0; i < regionalsFromStore.GetEntriesFast(); i++)
		{
			if (Compare(regionalsFromStore[i], regionalsByIndex[i]) != 0)
			{
				Error(	"TriggersOk",
					"The AliMUONDataInterface does not return identical regional"
					  " triggers through all its user interface methods. The"
					  " incorrect regional trigger has index %d.",
					i
				);
				regionalsFromStore[i]->Print();
				regionalsByIndex[i]->Print();
				return false;
			}
		}
	}
	return true;
}

/**
 * This method performs a check of the AliMUONDataInterface and AliMUONMCDataInterface
 * classes. Basically there are at least 2 ways to fetch data using these interfaces:
 * The expert way using the store objects returned by these interface classes or
 * the much slower but easier way of using the NumberOfxxx and Digit(...),
 * RawCluster(...), Track(...) etc. methods to fetch individual data objects.
 * The MUONCheckDI will check that all these various ways of fetching data results
 * in the same information being returned. If yes then kTRUE is returned and a
 * confirmation message is printed, if not then kFALSE is returned with the failure
 * reason printed to screen.
 */
bool MUONCheckDI(bool checkSim = true, bool checkRec = true)
{
	AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");

	// Note: we do not bother checking the AliMUONMCDataInterface::Particle,
	// AliMUONMCDataInterface::Stack and AliMUONMCDataInterface::TrackRefs methods
	// because they are trivial enough to validate from a quick inspecition of
	// the source code.
	
	if (checkSim)
	{
		cout << "Checking simulated hits..." << endl;
		if (! SimHitsOk()) return false;
		cout << "Simulated hits look OK." << endl;
		
		cout << "Checking simulated s-digits..." << endl;
		if (! SimSDigitsOk()) return false;
		cout << "Simulated s-digits look OK." << endl;
		
		cout << "Checking simulated digits..." << endl;
		if (! SimDigitsOk()) return false;
		cout << "Simulated digits look OK." << endl;
		
		cout << "Checking simulated triggers..." << endl;
		if (! SimTriggersOk()) return false;
		cout << "Simulated triggers look OK." << endl;
	}
	
	if (checkRec)
	{
		cout << "Checking reconstructed digits..." << endl;
		if (! RecDigitsOk()) return false;
		cout << "Reconstructed digits look OK." << endl;
		
		cout << "Checking raw clusters..." << endl;
		if (! RawClustersOk()) return false;
		cout << "Raw clusters look OK." << endl;
	
		cout << "Checking reconstructed triggers..." << endl;
		if (! TriggersOk()) return false;
		cout << "Reconstructed triggers look OK." << endl;
	}

	return true;
}
 MUONCheckDI.C:1
 MUONCheckDI.C:2
 MUONCheckDI.C:3
 MUONCheckDI.C:4
 MUONCheckDI.C:5
 MUONCheckDI.C:6
 MUONCheckDI.C:7
 MUONCheckDI.C:8
 MUONCheckDI.C:9
 MUONCheckDI.C:10
 MUONCheckDI.C:11
 MUONCheckDI.C:12
 MUONCheckDI.C:13
 MUONCheckDI.C:14
 MUONCheckDI.C:15
 MUONCheckDI.C:16
 MUONCheckDI.C:17
 MUONCheckDI.C:18
 MUONCheckDI.C:19
 MUONCheckDI.C:20
 MUONCheckDI.C:21
 MUONCheckDI.C:22
 MUONCheckDI.C:23
 MUONCheckDI.C:24
 MUONCheckDI.C:25
 MUONCheckDI.C:26
 MUONCheckDI.C:27
 MUONCheckDI.C:28
 MUONCheckDI.C:29
 MUONCheckDI.C:30
 MUONCheckDI.C:31
 MUONCheckDI.C:32
 MUONCheckDI.C:33
 MUONCheckDI.C:34
 MUONCheckDI.C:35
 MUONCheckDI.C:36
 MUONCheckDI.C:37
 MUONCheckDI.C:38
 MUONCheckDI.C:39
 MUONCheckDI.C:40
 MUONCheckDI.C:41
 MUONCheckDI.C:42
 MUONCheckDI.C:43
 MUONCheckDI.C:44
 MUONCheckDI.C:45
 MUONCheckDI.C:46
 MUONCheckDI.C:47
 MUONCheckDI.C:48
 MUONCheckDI.C:49
 MUONCheckDI.C:50
 MUONCheckDI.C:51
 MUONCheckDI.C:52
 MUONCheckDI.C:53
 MUONCheckDI.C:54
 MUONCheckDI.C:55
 MUONCheckDI.C:56
 MUONCheckDI.C:57
 MUONCheckDI.C:58
 MUONCheckDI.C:59
 MUONCheckDI.C:60
 MUONCheckDI.C:61
 MUONCheckDI.C:62
 MUONCheckDI.C:63
 MUONCheckDI.C:64
 MUONCheckDI.C:65
 MUONCheckDI.C:66
 MUONCheckDI.C:67
 MUONCheckDI.C:68
 MUONCheckDI.C:69
 MUONCheckDI.C:70
 MUONCheckDI.C:71
 MUONCheckDI.C:72
 MUONCheckDI.C:73
 MUONCheckDI.C:74
 MUONCheckDI.C:75
 MUONCheckDI.C:76
 MUONCheckDI.C:77
 MUONCheckDI.C:78
 MUONCheckDI.C:79
 MUONCheckDI.C:80
 MUONCheckDI.C:81
 MUONCheckDI.C:82
 MUONCheckDI.C:83
 MUONCheckDI.C:84
 MUONCheckDI.C:85
 MUONCheckDI.C:86
 MUONCheckDI.C:87
 MUONCheckDI.C:88
 MUONCheckDI.C:89
 MUONCheckDI.C:90
 MUONCheckDI.C:91
 MUONCheckDI.C:92
 MUONCheckDI.C:93
 MUONCheckDI.C:94
 MUONCheckDI.C:95
 MUONCheckDI.C:96
 MUONCheckDI.C:97
 MUONCheckDI.C:98
 MUONCheckDI.C:99
 MUONCheckDI.C:100
 MUONCheckDI.C:101
 MUONCheckDI.C:102
 MUONCheckDI.C:103
 MUONCheckDI.C:104
 MUONCheckDI.C:105
 MUONCheckDI.C:106
 MUONCheckDI.C:107
 MUONCheckDI.C:108
 MUONCheckDI.C:109
 MUONCheckDI.C:110
 MUONCheckDI.C:111
 MUONCheckDI.C:112
 MUONCheckDI.C:113
 MUONCheckDI.C:114
 MUONCheckDI.C:115
 MUONCheckDI.C:116
 MUONCheckDI.C:117
 MUONCheckDI.C:118
 MUONCheckDI.C:119
 MUONCheckDI.C:120
 MUONCheckDI.C:121
 MUONCheckDI.C:122
 MUONCheckDI.C:123
 MUONCheckDI.C:124
 MUONCheckDI.C:125
 MUONCheckDI.C:126
 MUONCheckDI.C:127
 MUONCheckDI.C:128
 MUONCheckDI.C:129
 MUONCheckDI.C:130
 MUONCheckDI.C:131
 MUONCheckDI.C:132
 MUONCheckDI.C:133
 MUONCheckDI.C:134
 MUONCheckDI.C:135
 MUONCheckDI.C:136
 MUONCheckDI.C:137
 MUONCheckDI.C:138
 MUONCheckDI.C:139
 MUONCheckDI.C:140
 MUONCheckDI.C:141
 MUONCheckDI.C:142
 MUONCheckDI.C:143
 MUONCheckDI.C:144
 MUONCheckDI.C:145
 MUONCheckDI.C:146
 MUONCheckDI.C:147
 MUONCheckDI.C:148
 MUONCheckDI.C:149
 MUONCheckDI.C:150
 MUONCheckDI.C:151
 MUONCheckDI.C:152
 MUONCheckDI.C:153
 MUONCheckDI.C:154
 MUONCheckDI.C:155
 MUONCheckDI.C:156
 MUONCheckDI.C:157
 MUONCheckDI.C:158
 MUONCheckDI.C:159
 MUONCheckDI.C:160
 MUONCheckDI.C:161
 MUONCheckDI.C:162
 MUONCheckDI.C:163
 MUONCheckDI.C:164
 MUONCheckDI.C:165
 MUONCheckDI.C:166
 MUONCheckDI.C:167
 MUONCheckDI.C:168
 MUONCheckDI.C:169
 MUONCheckDI.C:170
 MUONCheckDI.C:171
 MUONCheckDI.C:172
 MUONCheckDI.C:173
 MUONCheckDI.C:174
 MUONCheckDI.C:175
 MUONCheckDI.C:176
 MUONCheckDI.C:177
 MUONCheckDI.C:178
 MUONCheckDI.C:179
 MUONCheckDI.C:180
 MUONCheckDI.C:181
 MUONCheckDI.C:182
 MUONCheckDI.C:183
 MUONCheckDI.C:184
 MUONCheckDI.C:185
 MUONCheckDI.C:186
 MUONCheckDI.C:187
 MUONCheckDI.C:188
 MUONCheckDI.C:189
 MUONCheckDI.C:190
 MUONCheckDI.C:191
 MUONCheckDI.C:192
 MUONCheckDI.C:193
 MUONCheckDI.C:194
 MUONCheckDI.C:195
 MUONCheckDI.C:196
 MUONCheckDI.C:197
 MUONCheckDI.C:198
 MUONCheckDI.C:199
 MUONCheckDI.C:200
 MUONCheckDI.C:201
 MUONCheckDI.C:202
 MUONCheckDI.C:203
 MUONCheckDI.C:204
 MUONCheckDI.C:205
 MUONCheckDI.C:206
 MUONCheckDI.C:207
 MUONCheckDI.C:208
 MUONCheckDI.C:209
 MUONCheckDI.C:210
 MUONCheckDI.C:211
 MUONCheckDI.C:212
 MUONCheckDI.C:213
 MUONCheckDI.C:214
 MUONCheckDI.C:215
 MUONCheckDI.C:216
 MUONCheckDI.C:217
 MUONCheckDI.C:218
 MUONCheckDI.C:219
 MUONCheckDI.C:220
 MUONCheckDI.C:221
 MUONCheckDI.C:222
 MUONCheckDI.C:223
 MUONCheckDI.C:224
 MUONCheckDI.C:225
 MUONCheckDI.C:226
 MUONCheckDI.C:227
 MUONCheckDI.C:228
 MUONCheckDI.C:229
 MUONCheckDI.C:230
 MUONCheckDI.C:231
 MUONCheckDI.C:232
 MUONCheckDI.C:233
 MUONCheckDI.C:234
 MUONCheckDI.C:235
 MUONCheckDI.C:236
 MUONCheckDI.C:237
 MUONCheckDI.C:238
 MUONCheckDI.C:239
 MUONCheckDI.C:240
 MUONCheckDI.C:241
 MUONCheckDI.C:242
 MUONCheckDI.C:243
 MUONCheckDI.C:244
 MUONCheckDI.C:245
 MUONCheckDI.C:246
 MUONCheckDI.C:247
 MUONCheckDI.C:248
 MUONCheckDI.C:249
 MUONCheckDI.C:250
 MUONCheckDI.C:251
 MUONCheckDI.C:252
 MUONCheckDI.C:253
 MUONCheckDI.C:254
 MUONCheckDI.C:255
 MUONCheckDI.C:256
 MUONCheckDI.C:257
 MUONCheckDI.C:258
 MUONCheckDI.C:259
 MUONCheckDI.C:260
 MUONCheckDI.C:261
 MUONCheckDI.C:262
 MUONCheckDI.C:263
 MUONCheckDI.C:264
 MUONCheckDI.C:265
 MUONCheckDI.C:266
 MUONCheckDI.C:267
 MUONCheckDI.C:268
 MUONCheckDI.C:269
 MUONCheckDI.C:270
 MUONCheckDI.C:271
 MUONCheckDI.C:272
 MUONCheckDI.C:273
 MUONCheckDI.C:274
 MUONCheckDI.C:275
 MUONCheckDI.C:276
 MUONCheckDI.C:277
 MUONCheckDI.C:278
 MUONCheckDI.C:279
 MUONCheckDI.C:280
 MUONCheckDI.C:281
 MUONCheckDI.C:282
 MUONCheckDI.C:283
 MUONCheckDI.C:284
 MUONCheckDI.C:285
 MUONCheckDI.C:286
 MUONCheckDI.C:287
 MUONCheckDI.C:288
 MUONCheckDI.C:289
 MUONCheckDI.C:290
 MUONCheckDI.C:291
 MUONCheckDI.C:292
 MUONCheckDI.C:293
 MUONCheckDI.C:294
 MUONCheckDI.C:295
 MUONCheckDI.C:296
 MUONCheckDI.C:297
 MUONCheckDI.C:298
 MUONCheckDI.C:299
 MUONCheckDI.C:300
 MUONCheckDI.C:301
 MUONCheckDI.C:302
 MUONCheckDI.C:303
 MUONCheckDI.C:304
 MUONCheckDI.C:305
 MUONCheckDI.C:306
 MUONCheckDI.C:307
 MUONCheckDI.C:308
 MUONCheckDI.C:309
 MUONCheckDI.C:310
 MUONCheckDI.C:311
 MUONCheckDI.C:312
 MUONCheckDI.C:313
 MUONCheckDI.C:314
 MUONCheckDI.C:315
 MUONCheckDI.C:316
 MUONCheckDI.C:317
 MUONCheckDI.C:318
 MUONCheckDI.C:319
 MUONCheckDI.C:320
 MUONCheckDI.C:321
 MUONCheckDI.C:322
 MUONCheckDI.C:323
 MUONCheckDI.C:324
 MUONCheckDI.C:325
 MUONCheckDI.C:326
 MUONCheckDI.C:327
 MUONCheckDI.C:328
 MUONCheckDI.C:329
 MUONCheckDI.C:330
 MUONCheckDI.C:331
 MUONCheckDI.C:332
 MUONCheckDI.C:333
 MUONCheckDI.C:334
 MUONCheckDI.C:335
 MUONCheckDI.C:336
 MUONCheckDI.C:337
 MUONCheckDI.C:338
 MUONCheckDI.C:339
 MUONCheckDI.C:340
 MUONCheckDI.C:341
 MUONCheckDI.C:342
 MUONCheckDI.C:343
 MUONCheckDI.C:344
 MUONCheckDI.C:345
 MUONCheckDI.C:346
 MUONCheckDI.C:347
 MUONCheckDI.C:348
 MUONCheckDI.C:349
 MUONCheckDI.C:350
 MUONCheckDI.C:351
 MUONCheckDI.C:352
 MUONCheckDI.C:353
 MUONCheckDI.C:354
 MUONCheckDI.C:355
 MUONCheckDI.C:356
 MUONCheckDI.C:357
 MUONCheckDI.C:358
 MUONCheckDI.C:359
 MUONCheckDI.C:360
 MUONCheckDI.C:361
 MUONCheckDI.C:362
 MUONCheckDI.C:363
 MUONCheckDI.C:364
 MUONCheckDI.C:365
 MUONCheckDI.C:366
 MUONCheckDI.C:367
 MUONCheckDI.C:368
 MUONCheckDI.C:369
 MUONCheckDI.C:370
 MUONCheckDI.C:371
 MUONCheckDI.C:372
 MUONCheckDI.C:373
 MUONCheckDI.C:374
 MUONCheckDI.C:375
 MUONCheckDI.C:376
 MUONCheckDI.C:377
 MUONCheckDI.C:378
 MUONCheckDI.C:379
 MUONCheckDI.C:380
 MUONCheckDI.C:381
 MUONCheckDI.C:382
 MUONCheckDI.C:383
 MUONCheckDI.C:384
 MUONCheckDI.C:385
 MUONCheckDI.C:386
 MUONCheckDI.C:387
 MUONCheckDI.C:388
 MUONCheckDI.C:389
 MUONCheckDI.C:390
 MUONCheckDI.C:391
 MUONCheckDI.C:392
 MUONCheckDI.C:393
 MUONCheckDI.C:394
 MUONCheckDI.C:395
 MUONCheckDI.C:396
 MUONCheckDI.C:397
 MUONCheckDI.C:398
 MUONCheckDI.C:399
 MUONCheckDI.C:400
 MUONCheckDI.C:401
 MUONCheckDI.C:402
 MUONCheckDI.C:403
 MUONCheckDI.C:404
 MUONCheckDI.C:405
 MUONCheckDI.C:406
 MUONCheckDI.C:407
 MUONCheckDI.C:408
 MUONCheckDI.C:409
 MUONCheckDI.C:410
 MUONCheckDI.C:411
 MUONCheckDI.C:412
 MUONCheckDI.C:413
 MUONCheckDI.C:414
 MUONCheckDI.C:415
 MUONCheckDI.C:416
 MUONCheckDI.C:417
 MUONCheckDI.C:418
 MUONCheckDI.C:419
 MUONCheckDI.C:420
 MUONCheckDI.C:421
 MUONCheckDI.C:422
 MUONCheckDI.C:423
 MUONCheckDI.C:424
 MUONCheckDI.C:425
 MUONCheckDI.C:426
 MUONCheckDI.C:427
 MUONCheckDI.C:428
 MUONCheckDI.C:429
 MUONCheckDI.C:430
 MUONCheckDI.C:431
 MUONCheckDI.C:432
 MUONCheckDI.C:433
 MUONCheckDI.C:434
 MUONCheckDI.C:435
 MUONCheckDI.C:436
 MUONCheckDI.C:437
 MUONCheckDI.C:438
 MUONCheckDI.C:439
 MUONCheckDI.C:440
 MUONCheckDI.C:441
 MUONCheckDI.C:442
 MUONCheckDI.C:443
 MUONCheckDI.C:444
 MUONCheckDI.C:445
 MUONCheckDI.C:446
 MUONCheckDI.C:447
 MUONCheckDI.C:448
 MUONCheckDI.C:449
 MUONCheckDI.C:450
 MUONCheckDI.C:451
 MUONCheckDI.C:452
 MUONCheckDI.C:453
 MUONCheckDI.C:454
 MUONCheckDI.C:455
 MUONCheckDI.C:456
 MUONCheckDI.C:457
 MUONCheckDI.C:458
 MUONCheckDI.C:459
 MUONCheckDI.C:460
 MUONCheckDI.C:461
 MUONCheckDI.C:462
 MUONCheckDI.C:463
 MUONCheckDI.C:464
 MUONCheckDI.C:465
 MUONCheckDI.C:466
 MUONCheckDI.C:467
 MUONCheckDI.C:468
 MUONCheckDI.C:469
 MUONCheckDI.C:470
 MUONCheckDI.C:471
 MUONCheckDI.C:472
 MUONCheckDI.C:473
 MUONCheckDI.C:474
 MUONCheckDI.C:475
 MUONCheckDI.C:476
 MUONCheckDI.C:477
 MUONCheckDI.C:478
 MUONCheckDI.C:479
 MUONCheckDI.C:480
 MUONCheckDI.C:481
 MUONCheckDI.C:482
 MUONCheckDI.C:483
 MUONCheckDI.C:484
 MUONCheckDI.C:485
 MUONCheckDI.C:486
 MUONCheckDI.C:487
 MUONCheckDI.C:488
 MUONCheckDI.C:489
 MUONCheckDI.C:490
 MUONCheckDI.C:491
 MUONCheckDI.C:492
 MUONCheckDI.C:493
 MUONCheckDI.C:494
 MUONCheckDI.C:495
 MUONCheckDI.C:496
 MUONCheckDI.C:497
 MUONCheckDI.C:498
 MUONCheckDI.C:499
 MUONCheckDI.C:500
 MUONCheckDI.C:501
 MUONCheckDI.C:502
 MUONCheckDI.C:503
 MUONCheckDI.C:504
 MUONCheckDI.C:505
 MUONCheckDI.C:506
 MUONCheckDI.C:507
 MUONCheckDI.C:508
 MUONCheckDI.C:509
 MUONCheckDI.C:510
 MUONCheckDI.C:511
 MUONCheckDI.C:512
 MUONCheckDI.C:513
 MUONCheckDI.C:514
 MUONCheckDI.C:515
 MUONCheckDI.C:516
 MUONCheckDI.C:517
 MUONCheckDI.C:518
 MUONCheckDI.C:519
 MUONCheckDI.C:520
 MUONCheckDI.C:521
 MUONCheckDI.C:522
 MUONCheckDI.C:523
 MUONCheckDI.C:524
 MUONCheckDI.C:525
 MUONCheckDI.C:526
 MUONCheckDI.C:527
 MUONCheckDI.C:528
 MUONCheckDI.C:529
 MUONCheckDI.C:530
 MUONCheckDI.C:531
 MUONCheckDI.C:532
 MUONCheckDI.C:533
 MUONCheckDI.C:534
 MUONCheckDI.C:535
 MUONCheckDI.C:536
 MUONCheckDI.C:537
 MUONCheckDI.C:538
 MUONCheckDI.C:539
 MUONCheckDI.C:540
 MUONCheckDI.C:541
 MUONCheckDI.C:542
 MUONCheckDI.C:543
 MUONCheckDI.C:544
 MUONCheckDI.C:545
 MUONCheckDI.C:546
 MUONCheckDI.C:547
 MUONCheckDI.C:548
 MUONCheckDI.C:549
 MUONCheckDI.C:550
 MUONCheckDI.C:551
 MUONCheckDI.C:552
 MUONCheckDI.C:553
 MUONCheckDI.C:554
 MUONCheckDI.C:555
 MUONCheckDI.C:556
 MUONCheckDI.C:557
 MUONCheckDI.C:558
 MUONCheckDI.C:559
 MUONCheckDI.C:560
 MUONCheckDI.C:561
 MUONCheckDI.C:562
 MUONCheckDI.C:563
 MUONCheckDI.C:564
 MUONCheckDI.C:565
 MUONCheckDI.C:566
 MUONCheckDI.C:567
 MUONCheckDI.C:568
 MUONCheckDI.C:569
 MUONCheckDI.C:570
 MUONCheckDI.C:571
 MUONCheckDI.C:572
 MUONCheckDI.C:573
 MUONCheckDI.C:574
 MUONCheckDI.C:575
 MUONCheckDI.C:576
 MUONCheckDI.C:577
 MUONCheckDI.C:578
 MUONCheckDI.C:579
 MUONCheckDI.C:580
 MUONCheckDI.C:581
 MUONCheckDI.C:582
 MUONCheckDI.C:583
 MUONCheckDI.C:584
 MUONCheckDI.C:585
 MUONCheckDI.C:586
 MUONCheckDI.C:587
 MUONCheckDI.C:588
 MUONCheckDI.C:589
 MUONCheckDI.C:590
 MUONCheckDI.C:591
 MUONCheckDI.C:592
 MUONCheckDI.C:593
 MUONCheckDI.C:594
 MUONCheckDI.C:595
 MUONCheckDI.C:596
 MUONCheckDI.C:597
 MUONCheckDI.C:598
 MUONCheckDI.C:599
 MUONCheckDI.C:600
 MUONCheckDI.C:601
 MUONCheckDI.C:602
 MUONCheckDI.C:603
 MUONCheckDI.C:604
 MUONCheckDI.C:605
 MUONCheckDI.C:606
 MUONCheckDI.C:607
 MUONCheckDI.C:608
 MUONCheckDI.C:609
 MUONCheckDI.C:610
 MUONCheckDI.C:611
 MUONCheckDI.C:612
 MUONCheckDI.C:613
 MUONCheckDI.C:614
 MUONCheckDI.C:615
 MUONCheckDI.C:616
 MUONCheckDI.C:617
 MUONCheckDI.C:618
 MUONCheckDI.C:619
 MUONCheckDI.C:620
 MUONCheckDI.C:621
 MUONCheckDI.C:622
 MUONCheckDI.C:623
 MUONCheckDI.C:624
 MUONCheckDI.C:625
 MUONCheckDI.C:626
 MUONCheckDI.C:627
 MUONCheckDI.C:628
 MUONCheckDI.C:629
 MUONCheckDI.C:630
 MUONCheckDI.C:631
 MUONCheckDI.C:632
 MUONCheckDI.C:633
 MUONCheckDI.C:634
 MUONCheckDI.C:635
 MUONCheckDI.C:636
 MUONCheckDI.C:637
 MUONCheckDI.C:638
 MUONCheckDI.C:639
 MUONCheckDI.C:640
 MUONCheckDI.C:641
 MUONCheckDI.C:642
 MUONCheckDI.C:643
 MUONCheckDI.C:644
 MUONCheckDI.C:645
 MUONCheckDI.C:646
 MUONCheckDI.C:647
 MUONCheckDI.C:648
 MUONCheckDI.C:649
 MUONCheckDI.C:650
 MUONCheckDI.C:651
 MUONCheckDI.C:652
 MUONCheckDI.C:653
 MUONCheckDI.C:654
 MUONCheckDI.C:655
 MUONCheckDI.C:656
 MUONCheckDI.C:657
 MUONCheckDI.C:658
 MUONCheckDI.C:659
 MUONCheckDI.C:660
 MUONCheckDI.C:661
 MUONCheckDI.C:662
 MUONCheckDI.C:663
 MUONCheckDI.C:664
 MUONCheckDI.C:665
 MUONCheckDI.C:666
 MUONCheckDI.C:667
 MUONCheckDI.C:668
 MUONCheckDI.C:669
 MUONCheckDI.C:670
 MUONCheckDI.C:671
 MUONCheckDI.C:672
 MUONCheckDI.C:673
 MUONCheckDI.C:674
 MUONCheckDI.C:675
 MUONCheckDI.C:676
 MUONCheckDI.C:677
 MUONCheckDI.C:678
 MUONCheckDI.C:679
 MUONCheckDI.C:680
 MUONCheckDI.C:681
 MUONCheckDI.C:682
 MUONCheckDI.C:683
 MUONCheckDI.C:684
 MUONCheckDI.C:685
 MUONCheckDI.C:686
 MUONCheckDI.C:687
 MUONCheckDI.C:688
 MUONCheckDI.C:689
 MUONCheckDI.C:690
 MUONCheckDI.C:691
 MUONCheckDI.C:692
 MUONCheckDI.C:693
 MUONCheckDI.C:694
 MUONCheckDI.C:695
 MUONCheckDI.C:696
 MUONCheckDI.C:697
 MUONCheckDI.C:698
 MUONCheckDI.C:699
 MUONCheckDI.C:700
 MUONCheckDI.C:701
 MUONCheckDI.C:702
 MUONCheckDI.C:703
 MUONCheckDI.C:704
 MUONCheckDI.C:705
 MUONCheckDI.C:706
 MUONCheckDI.C:707
 MUONCheckDI.C:708
 MUONCheckDI.C:709
 MUONCheckDI.C:710
 MUONCheckDI.C:711
 MUONCheckDI.C:712
 MUONCheckDI.C:713
 MUONCheckDI.C:714
 MUONCheckDI.C:715
 MUONCheckDI.C:716
 MUONCheckDI.C:717
 MUONCheckDI.C:718
 MUONCheckDI.C:719
 MUONCheckDI.C:720
 MUONCheckDI.C:721
 MUONCheckDI.C:722
 MUONCheckDI.C:723
 MUONCheckDI.C:724
 MUONCheckDI.C:725
 MUONCheckDI.C:726
 MUONCheckDI.C:727
 MUONCheckDI.C:728
 MUONCheckDI.C:729
 MUONCheckDI.C:730
 MUONCheckDI.C:731
 MUONCheckDI.C:732
 MUONCheckDI.C:733
 MUONCheckDI.C:734
 MUONCheckDI.C:735
 MUONCheckDI.C:736
 MUONCheckDI.C:737
 MUONCheckDI.C:738
 MUONCheckDI.C:739
 MUONCheckDI.C:740
 MUONCheckDI.C:741
 MUONCheckDI.C:742
 MUONCheckDI.C:743
 MUONCheckDI.C:744
 MUONCheckDI.C:745
 MUONCheckDI.C:746
 MUONCheckDI.C:747
 MUONCheckDI.C:748
 MUONCheckDI.C:749
 MUONCheckDI.C:750
 MUONCheckDI.C:751
 MUONCheckDI.C:752
 MUONCheckDI.C:753
 MUONCheckDI.C:754
 MUONCheckDI.C:755
 MUONCheckDI.C:756
 MUONCheckDI.C:757
 MUONCheckDI.C:758
 MUONCheckDI.C:759
 MUONCheckDI.C:760
 MUONCheckDI.C:761
 MUONCheckDI.C:762
 MUONCheckDI.C:763
 MUONCheckDI.C:764
 MUONCheckDI.C:765
 MUONCheckDI.C:766
 MUONCheckDI.C:767
 MUONCheckDI.C:768
 MUONCheckDI.C:769
 MUONCheckDI.C:770
 MUONCheckDI.C:771
 MUONCheckDI.C:772
 MUONCheckDI.C:773
 MUONCheckDI.C:774
 MUONCheckDI.C:775
 MUONCheckDI.C:776
 MUONCheckDI.C:777
 MUONCheckDI.C:778
 MUONCheckDI.C:779
 MUONCheckDI.C:780
 MUONCheckDI.C:781
 MUONCheckDI.C:782
 MUONCheckDI.C:783
 MUONCheckDI.C:784
 MUONCheckDI.C:785
 MUONCheckDI.C:786
 MUONCheckDI.C:787
 MUONCheckDI.C:788
 MUONCheckDI.C:789
 MUONCheckDI.C:790
 MUONCheckDI.C:791
 MUONCheckDI.C:792
 MUONCheckDI.C:793
 MUONCheckDI.C:794
 MUONCheckDI.C:795
 MUONCheckDI.C:796
 MUONCheckDI.C:797
 MUONCheckDI.C:798
 MUONCheckDI.C:799
 MUONCheckDI.C:800
 MUONCheckDI.C:801
 MUONCheckDI.C:802
 MUONCheckDI.C:803
 MUONCheckDI.C:804
 MUONCheckDI.C:805
 MUONCheckDI.C:806
 MUONCheckDI.C:807
 MUONCheckDI.C:808
 MUONCheckDI.C:809
 MUONCheckDI.C:810
 MUONCheckDI.C:811
 MUONCheckDI.C:812
 MUONCheckDI.C:813
 MUONCheckDI.C:814
 MUONCheckDI.C:815
 MUONCheckDI.C:816
 MUONCheckDI.C:817
 MUONCheckDI.C:818
 MUONCheckDI.C:819
 MUONCheckDI.C:820
 MUONCheckDI.C:821
 MUONCheckDI.C:822
 MUONCheckDI.C:823
 MUONCheckDI.C:824
 MUONCheckDI.C:825
 MUONCheckDI.C:826
 MUONCheckDI.C:827
 MUONCheckDI.C:828
 MUONCheckDI.C:829
 MUONCheckDI.C:830
 MUONCheckDI.C:831
 MUONCheckDI.C:832
 MUONCheckDI.C:833
 MUONCheckDI.C:834
 MUONCheckDI.C:835
 MUONCheckDI.C:836