diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloCellContainer.h b/Calorimeter/CaloEvent/CaloEvent/CaloCellContainer.h index 567abb83da5a9f9d54dadcee93b8d51dedcf62e5..3adbd33280bbc29246a8b867b1a56ed930e3e475 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloCellContainer.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloCellContainer.h @@ -63,6 +63,7 @@ class CaloCellContainer : public DataVector<CaloCell> friend class CaloCellContainerFinalizerTool; friend class CaloCompactCellTool; friend class FullCaloCellContMaker; + friend class EmptyCellBuilderTool; public: @@ -213,6 +214,7 @@ time this method of findCellVector is used */ /** @brief If @ flag is true, then the container size equals the maximum hash. * Only CaloCellContainerFinalizer tool is allowed to set this. + * Now, set this in EmptyCellBuilderTool as it is always true. */ void setHasTotalSize(const bool); diff --git a/Calorimeter/CaloTools/src/CaloNoiseToolDB.cxx b/Calorimeter/CaloTools/src/CaloNoiseToolDB.cxx index f6391b631fe818d22d5832cc2777429867ee6fc4..135668e8c2b6760321a739199fabf79d87c5cf39 100644 --- a/Calorimeter/CaloTools/src/CaloNoiseToolDB.cxx +++ b/Calorimeter/CaloTools/src/CaloNoiseToolDB.cxx @@ -111,8 +111,6 @@ CaloNoiseToolDB::initialize() if (m_rescaleForHV) { ATH_CHECK( m_larHVCellCorrTool.retrieve() ); ATH_MSG_INFO( "Retrieved " << m_larHVCellCorrTool << " for on-the-fly noise rescaling" ); - ATH_CHECK( detStore()->regFcn(&ILArCellHVCorrTool::LoadCalibration, &(*m_larHVCellCorrTool),&CaloNoiseToolDB::clearCache, this) ); - ATH_MSG_INFO( "Regestered callback on ILArCellHVCorrTool::LoadCalibration" ); } else { m_larHVCellCorrTool.disable(); diff --git a/Control/AthLinks/AthLinks/tools/AssociationVectorIterator.h b/Control/AthLinks/AthLinks/tools/AssociationVectorIterator.h index 9cdbeeba9af5d3b8a268a6b1f590dc9ba3277360..04dffafdcb8de74823db3c59e346402316c394c2 100644 --- a/Control/AthLinks/AthLinks/tools/AssociationVectorIterator.h +++ b/Control/AthLinks/AthLinks/tools/AssociationVectorIterator.h @@ -11,10 +11,10 @@ * not be included directly into client code. */ - class AssociationVectorIterator + class AssociationVectorIterator + : public std::iterator<std::bidirectional_iterator_tag, asso_type*> { public: - /*! \brief alternate constructor * * The alternate constructor is the only meaningful constructor. It requires diff --git a/Control/AthenaConfiguration/CMakeLists.txt b/Control/AthenaConfiguration/CMakeLists.txt index 9f1ab05d497938c6a9f6c6c4f9ad97ec76fd7aea..d7316c7fbbd39f9ca49e3c3fbe083b38fa645c67 100644 --- a/Control/AthenaConfiguration/CMakeLists.txt +++ b/Control/AthenaConfiguration/CMakeLists.txt @@ -14,7 +14,7 @@ atlas_install_scripts( share/confTool.py python/iconfTool/iconfTool ) atlas_install_data( share/*.ref ) atlas_add_test( ComponentAccumulatorTest - SCRIPT python -m unittest -v AthenaConfiguration.ComponentAccumulator + SCRIPT python -m unittest -v AthenaConfiguration.ComponentAccumulatorTest POST_EXEC_SCRIPT nopost.sh ) atlas_add_test( UnifyPropertiesTest diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py index 40c4b80b7cb06f21ae8df50de6e59ce698e2a535..6c44b4f06cd1a6fa4f89dc6dffd4a58ed7c23613 100644 --- a/Control/AthenaConfiguration/python/ComponentAccumulator.py +++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py @@ -5,7 +5,6 @@ from AthenaCommon.Configurable import Configurable,ConfigurableService,Configura from AthenaCommon.CFElements import isSequence,findSubSequence,findAlgorithm,flatSequencers,findOwningSequence,checkSequenceConsistency from AthenaCommon.AlgSequence import AthSequencer -from AthenaConfiguration.AthConfigFlags import AthConfigFlags import GaudiKernel.GaudiHandles as GaudiHandles from GaudiKernel.GaudiHandles import PublicToolHandle, PublicToolHandleArray, ServiceHandle, PrivateToolHandle, PrivateToolHandleArray import ast @@ -40,6 +39,7 @@ class ComponentAccumulator(object): #To check if this accumulator was merged: self._wasMerged=False + self._isMergable=True def empty(self): @@ -465,7 +465,9 @@ class ComponentAccumulator(object): if not isinstance(other,ComponentAccumulator): raise TypeError("Attempt merge wrong type %s. Only instances of ComponentAccumulator can be added" % type(other).__name__) - + + if not other._isMergable: + raise ConfigurationError("Attempted to merge the accumulator that was unsafely manipulated (likely with foreach_component, ...)") if not Configurable.configurableRun3Behavior: raise ConfigurationError("discoverd Configurable.configurableRun3Behavior=False while working woth ComponentAccumulator") @@ -603,6 +605,7 @@ class ComponentAccumulator(object): def store(self,outfile,nEvents=10,useBootStrapFile=True,threaded=False): from AthenaCommon.Utils.unixtools import find_datafile import pickle + self._isMergable = True # this is CA we store, it is ok it is not mergable if useBootStrapFile: import glob # first load basics from the bootstrap-pickle @@ -738,7 +741,6 @@ class ComponentAccumulator(object): self._wasMerged=True def createApp(self,OutputLevel=3): - log = logging.getLogger("ComponentAccumulator") self._wasMerged=True from Gaudi.Main import BootstrapHelper bsh=BootstrapHelper() @@ -774,14 +776,14 @@ class ComponentAccumulator(object): name=comp.getJobOptName() for k, v in comp.getValuedProperties().items(): if isinstance(v,Configurable): - log.debug("Adding "+name+"."+k+" = "+v.getFullName()) + self._msg.debug("Adding "+name+"."+k+" = "+v.getFullName()) bsh.addPropertyToCatalogue(jos,name,k,v.getFullName()) addCompToJos(v) elif isinstance(v,GaudiHandles.GaudiHandleArray): bsh.addPropertyToCatalogue(jos,name,k,str([ v1.getFullName() for v1 in v ])) else: if not isSequence(comp) and k!="Members": #This property his handled separatly - log.debug("Adding "+name+"."+k+" = "+str(v)) + self._msg.debug("Adding "+name+"."+k+" = "+str(v)) bsh.addPropertyToCatalogue(jos,name,k,str(v)) pass pass @@ -796,7 +798,7 @@ class ComponentAccumulator(object): #Add tree of algorithm sequences: for seqName, algoList in flatSequencers( self._sequence ).iteritems(): - log.debug("Members of %s : %s" % (seqName,str([alg.getFullName() for alg in algoList]))) + self._msg.debug("Members of %s : %s" % (seqName,str([alg.getFullName() for alg in algoList]))) bsh.addPropertyToCatalogue(jos,seqName,"Members",str( [alg.getFullName() for alg in algoList])) for alg in algoList: addCompToJos(alg) @@ -821,7 +823,6 @@ class ComponentAccumulator(object): def run(self,maxEvents=None,OutputLevel=3): - log = logging.getLogger("ComponentAccumulator") app = self.createApp (OutputLevel) #Determine maxEvents @@ -831,22 +832,22 @@ class ComponentAccumulator(object): else: maxEvents=-1 - print "INITIALIZE STEP" + self._msg.info("INITIALIZE STEP") sc = app.initialize() if not sc.isSuccess(): - log.error("Failed to initialize AppMgr") + self._msg.error("Failed to initialize AppMgr") return sc app.printAlgsSequences() #could be removed later .... sc = app.start() if not sc.isSuccess(): - log.error("Failed to start AppMgr") + self._msg.error("Failed to start AppMgr") return sc sc = app.run(maxEvents) if not sc.isSuccess(): - log.error("Failure running application") + self._msg.error("Failure running application") return sc app.stop().ignore() @@ -856,6 +857,27 @@ class ComponentAccumulator(object): sc1 = app.terminate() return sc1 + def foreach_component(self, path): + """ Utility to set properties of components using wildcards + + Example: + forcomps(ca, "*/HLTTop/*/*Hypo*").OutputLevel=VERBOSE + + The compoments name & locations in the CF tree are translated into the unix like path. + Components of matching path are taken under consideration in setting the property. + If the property is set succesfully an INFO message is printed. Else, a warning is printed. + + The convention for path of nested components is as follows: + Sequencer - only the name is used in the path + Algorithm - full name - type/instance_name (aka full name) is used + PrivateTools - the name of the property + the type/instance_name are added + PublicTools - are located under ToolSvc/ and type/instance_name is used + Services - located under SvcMgr/ and type/instance_name is used + """ + from AthenaConfiguration.PropSetterProxy import PropSetterProxy + self._isMergable=False + return PropSetterProxy(self, path) + def CAtoGlobalWrapper(cfgmethod,flags): @@ -865,304 +887,3 @@ def CAtoGlobalWrapper(cfgmethod,flags): result.appendToGlobals() return - - - -# self test -import unittest - -class TestComponentAccumulator( unittest.TestCase ): - def setUp(self): - - Configurable.configurableRun3Behavior+=1 - # trivial case without any nested sequences - from AthenaCommon.Configurable import ConfigurablePyAlgorithm # guinea pig algorithms - from AthenaCommon.CFElements import seqAND, parOR - from AthenaCommon.Logging import log - from AthenaCommon.Constants import DEBUG - - log.setLevel(DEBUG) - - dummyCfgFlags=AthConfigFlags() - dummyCfgFlags.lock() - - class Algo(ConfigurablePyAlgorithm): - def __init__(self, name): - super( ConfigurablePyAlgorithm, self ).__init__( name ) - - def AlgsConf1(flags): - acc = ComponentAccumulator() - a1=Algo("Algo1") - a2=Algo("Algo2") - return acc,[a1,a2] - - - def AlgsConf2(flags): - acc = ComponentAccumulator() - result,algs=AlgsConf1( flags ) - acc.merge(result) - algs.append(Algo("Algo3")) - return acc,algs - - acc = ComponentAccumulator() - - # top level algs - acc1,algs=AlgsConf2(dummyCfgFlags) - acc.merge(acc1) - acc.addEventAlgo(algs) - - def AlgsConf3(flags): - acc = ComponentAccumulator() - na1=Algo("NestedAlgo1") - return acc,na1 - - def AlgsConf4(flags): - acc,na1= AlgsConf3( flags ) - NestedAlgo2 = Algo("NestedAlgo2") - NestedAlgo2.OutputLevel=7 - return acc,na1,NestedAlgo2 - - acc.addSequence( seqAND("Nest") ) - acc.addSequence( seqAND("subSequence1"), parentName="Nest" ) - acc.addSequence( parOR("subSequence2"), parentName="Nest" ) - - acc.addSequence( seqAND("sub2Sequence1"), parentName="subSequence1") - acc.addSequence( seqAND("sub3Sequence1"), parentName="subSequence1") - acc.addSequence( seqAND("sub4Sequence1"), parentName="subSequence1") - - accNA1=AlgsConf4(dummyCfgFlags) - acc.merge(accNA1[0]) - acc.addEventAlgo(accNA1[1:],"sub2Sequence1" ) - acc.store(open("testFile.pkl", "w")) - self.acc = acc - - - def test_algorihmsAreAdded( self ): - self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo1", 1).name(), "Algo1", "Algorithm not added to a top sequence" ) - self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo2", 1).name(), "Algo2", "Algorithm not added to a top sequence" ) - self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo3", 1).name(), "Algo3", "Algorithm not added to a top sequence" ) - - def test_sequencesAreAdded( self ): - self.assertIsNotNone( self.acc.getSequence("subSequence1" ), "Adding sub-sequence failed" ) - self.assertIsNotNone( self.acc.getSequence("subSequence2" ), "Adding sub-sequence failed" ) - self.assertIsNotNone( self.acc.getSequence("sub2Sequence1"), "Adding sub-sequence failed" ) - self.assertIsNotNone( findSubSequence( self.acc.getSequence("subSequence1"), "sub2Sequence1"), "Adding sub-sequence done in a wrong place" ) - - def test_algorithmsInNestedSequences( self ): - self.assertIsNotNone( findAlgorithm( self.acc.getSequence(), "NestedAlgo1" ), "Algorithm added to nested sequence" ) - self.assertIsNotNone( findAlgorithm( self.acc.getSequence(), "NestedAlgo1", 1 ) is None, "Algorithm mistakenly in top sequence" ) - self.assertIsNotNone( findAlgorithm( findSubSequence( self.acc.getSequence(), "sub2Sequence1"), "NestedAlgo1", 1 ), "Algorithm not in right sequence" ) - - - def test_readBackConfiguration( self ): - import pickle - with open( "testFile.pkl" ) as f: - s = pickle.load( f ) - self.assertIsNotNone( s, "The pickle has no content") - -class TestHLTCF( unittest.TestCase ): - def runTest( self ): - # replicate HLT issue, it occured because the sequnces were recorded in the order of storing in the dict and thus the - # some of them (in this case hltSteps) did not have properties recorded - from AthenaCommon.CFElements import seqAND, seqOR, parOR - from AthenaCommon.Configurable import ConfigurablePyAlgorithm # guinea pig algorithms - Configurable.configurableRun3Behavior=1 - acc = ComponentAccumulator() - acc.addSequence( seqOR("hltTop") ) - algos2 = ConfigurablePyAlgorithm( "RecoAlgInTop" ) - acc.addEventAlgo( algos2, sequenceName="hltTop" ) # some algo - acc.addSequence( seqAND("hltSteps"), parentName="hltTop" ) - acc.addSequence( parOR("hltStep_1"), parentName="hltSteps" ) - acc.addSequence( seqAND("L2CaloEgammaSeq"), "hltStep_1" ) - acc.addSequence( parOR("hltStep_2"), parentName="hltSteps" ) - acc.moveSequence( "L2CaloEgammaSeq", "hltStep_2" ) - - acc.store(open("testFile2.pkl", "w")) - import pickle - f = open("testFile2.pkl") - s = pickle.load(f) - f.close() - self.assertNotEqual( s['hltSteps']['Members'], '[]', "Empty set of members in hltSteps, Sequences recording order metters" ) - - -class MultipleParentsInSequences( unittest.TestCase ): - def runTest( self ): - # test if an algorithm (or sequence) can be controlled by more than one sequence - Configurable.configurableRun3Behavior=1 - from AthenaCommon.CFElements import seqAND - from AthenaCommon.Configurable import ConfigurablePyAlgorithm # guinea pig algorithms - accTop = ComponentAccumulator() - - recoSeq = seqAND("seqReco") - recoAlg = ConfigurablePyAlgorithm( "recoAlg" ) - recoSeq += recoAlg - - acc1 = ComponentAccumulator() - acc1.addSequence( seqAND("seq1") ) - acc1.addSequence( recoSeq, parentName="seq1" ) - - acc2 = ComponentAccumulator() - acc2.addSequence( seqAND("seq2") ) - acc2.addSequence( recoSeq, parentName="seq2" ) - - accTop.merge( acc1 ) - accTop.merge( acc2 ) - - accTop.printConfig() - - self.assertIsNotNone( findAlgorithm( accTop.getSequence( "seq1" ), "recoAlg" ), "Algorithm missing in the first sequence" ) - self.assertIsNotNone( findAlgorithm( accTop.getSequence( "seq2" ), "recoAlg" ), "Algorithm missing in the second sequence" ) - s = accTop.getSequence( "seqReco" ) - self.assertEqual( len( s.getChildren() ), 1, "Wrong number of algorithms in reco seq: %d " % len( s.getChildren() ) ) - self.assertIs( findAlgorithm( accTop.getSequence( "seq1" ), "recoAlg" ), findAlgorithm( accTop.getSequence( "seq2" ), "recoAlg" ), "Algorithms are cloned" ) - self.assertIs( findAlgorithm( accTop.getSequence( "seq1" ), "recoAlg" ), recoAlg, "Clone of the original inserted in sequence" ) - - accTop.store( open("dummy.pkl", "w") ) - import pickle - # check if the recording did not harm the sequences - with open("dummy.pkl") as f: - s = pickle.load( f ) - self.assertEquals( s['seq1']["Members"], "['AthSequencer/seqReco']", "After pickling recoSeq missing in seq1 " + s['seq1']["Members"]) - self.assertEquals( s['seq2']["Members"], "['AthSequencer/seqReco']", "After pickling recoSeq missing in seq2 " + s['seq2']["Members"]) - self.assertEquals( s['seqReco']["Members"], "['ConfigurablePyAlgorithm/recoAlg']", "After pickling seqReco is corrupt " + s['seqReco']["Members"] ) - -class ForbidRecursiveSequences( unittest.TestCase ): - def runTest( self ): - #Can't add a sequence with the same name below itself, e.g. - # \__ AthAlgSeq (seq: PAR AND) - # \__ seq1 (seq: SEQ AND) - # \__ seq1 (seq: SEQ AND) - def selfSequence(): - Configurable.configurableRun3Behavior=1 - from AthenaCommon.CFElements import seqAND - accTop = ComponentAccumulator() - accTop.wasMerged() - seq1 = seqAND("seq1") - seq1_again = seqAND("seq1") - accTop.addSequence(seq1) - accTop.addSequence(seq1_again, parentName = "seq1") - - #Allowed to add a sequence with the same name at same depth, e.g. - # \__ AthAlgSeq (seq: PAR AND) - # \__ seq1 (seq: SEQ AND) - # \__ seq2 (seq: SEQ AND) - # \__ seq2 (seq: SEQ AND) - # should not raise any exceptions - def selfTwinSequence(): - Configurable.configurableRun3Behavior=1 - from AthenaCommon.CFElements import seqAND - accTop = ComponentAccumulator() - accTop.wasMerged() - seq1 = seqAND("seq1") - seq2 = seqAND("seq2") - seq2_again = seqAND("seq1") - accTop.addSequence(seq1) - accTop.addSequence(seq2, parentName = "seq1") - accTop.addSequence(seq2_again, parentName = "seq1") - accTop.wasMerged() - - - #Can't add a sequence with the same name two steps below itself, e.g. - # \__ AthAlgSeq (seq: PAR AND) - # \__ seq1 (seq: SEQ AND) - # \__ seq2 (seq: SEQ AND) - # \__ seq1 (seq: SEQ AND) - def selfGrandParentSequence(): - Configurable.configurableRun3Behavior=1 - from AthenaCommon.CFElements import seqAND - accTop = ComponentAccumulator() - accTop.store( open("test.pkl", "w") )#silence RuntimeError - seq1 = seqAND("seq1") - seq2 = seqAND("seq2") - seq1_again = seqAND("seq1") - accTop.addSequence(seq1) - accTop.addSequence(seq2, parentName = "seq1") - accTop.addSequence(seq1_again, parentName = "seq2") - accTop.wasMerged() - - #Can't merge sequences with the same name two steps below itself, e.g. - # \__ AthAlgSeq (seq: PAR AND) - # \__ seq1 (seq: SEQ AND) - # \__ seq2 (seq: SEQ AND) - # \__ seq1 (seq: SEQ AND) - def selfMergedGrandParentSequence(): - Configurable.configurableRun3Behavior=1 - from AthenaCommon.CFElements import seqAND - acc1=ComponentAccumulator() - acc1.wasMerged() - acc1.addSequence(seqAND("seq1")) - acc2=ComponentAccumulator() - acc2.wasMerged() - acc2.addSequence(seqAND("seq2")) - acc2.addSequence(seqAND("seq1"), "seq2") - acc1.merge(acc2) - - self.assertRaises(RuntimeError, selfSequence ) - self.assertRaises(RuntimeError, selfGrandParentSequence ) - self.assertRaises(RuntimeError, selfMergedGrandParentSequence ) - -class FailedMerging( unittest.TestCase ): - def runTest( self ): - topCA = ComponentAccumulator() - - def badMerge(): - someCA = ComponentAccumulator() - topCA.merge( (someCA, 1, "hello") ) - self.assertRaises(RuntimeError, badMerge ) - topCA.wasMerged() - - -class MergeMovingAlgorithms( unittest.TestCase ): - def runTest( self ): - Configurable.configurableRun3Behavior=1 - from AthenaCommon.CFElements import seqAND - from AthenaCommon.Configurable import ConfigurablePyAlgorithm # guinea pig algorithms - destinationCA = ComponentAccumulator() - destinationCA.addSequence( seqAND("dest") ) - - sourceCA = ComponentAccumulator() - sourceCA.addEventAlgo(ConfigurablePyAlgorithm("alg1")) - sourceCA.addEventAlgo(ConfigurablePyAlgorithm("alg2")) - sourceCA.addSequence( seqAND("innerSeq") ) - sourceCA.addEventAlgo(ConfigurablePyAlgorithm("alg3"), sequenceName="innerSeq" ) - - destinationCA.merge( sourceCA, sequenceName="dest" ) - - #destinationCA.merge( sourceCA ) - self.assertIsNotNone( findAlgorithm( destinationCA.getSequence("dest"), "alg1" ), "Algorithm not placed in sub-sequence" ) - self.assertIsNotNone( findSubSequence( destinationCA.getSequence(), "innerSeq" ), "The sequence is not added" ) - self.assertIsNotNone( findAlgorithm( destinationCA.getSequence("dest"), "alg3" ), "Algorithm deep in thesource CA not placed in sub-sequence of destiantion CA" ) - destinationCA.wasMerged() - sourceCA.wasMerged() - -class TestComponentAccumulatorAccessors( unittest.TestCase ): - def runTest( self ): - ca = ComponentAccumulator() - from AthenaCommon.Configurable import ConfigurablePyAlgorithm # guinea pig algorithms - ca.addEventAlgo(ConfigurablePyAlgorithm("alg1")) - - self.assertIsNotNone( ca.getEventAlgo(), "Found single alg") - self.assertEquals( len(ca.getEventAlgos()), 1 , "Found single alg") -# no idea why this assersts do not recognise exceptions -# self.assertRaises(ConfigurationError, ca.getEventAlgo("alg2")) - - ca.addEventAlgo(ConfigurablePyAlgorithm("alg2")) - - self.assertIsNotNone( ca.getEventAlgo("alg2"), "Found single alg") - self.assertEquals( len(ca.getEventAlgos()), 2 , "Found single alg") - # self.assertRaises(ConfigurationError, ca.getEventAlgo(), "Single Alg API ambiguity") - - class Tool(ConfigurableAlgTool): - def __init__(self, *args, **kwargs): - super(Tool, self).__init__(*args, **kwargs) - def getDlls(self): - return None - - - ca.addPublicTool( Tool(name="tool1") ) - self.assertIsNotNone( ca.getPublicTool(), "Found single tool") - ca.addPublicTool( Tool(name="tool2") ) -# self.assertRaises(ConfigurationError, ca.getPublicTool(), "Found single tool") - -if __name__ == "__main__": - unittest.main() diff --git a/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py b/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py new file mode 100644 index 0000000000000000000000000000000000000000..b97d2d485fe2385ad1061f7d73f15270b2ac87da --- /dev/null +++ b/Control/AthenaConfiguration/python/ComponentAccumulatorTest.py @@ -0,0 +1,320 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +# self test of ComponentAccumulator + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.AthConfigFlags import AthConfigFlags +from AthenaCommon.CFElements import findSubSequence,findAlgorithm +from AthenaCommon.Configurable import Configurable, ConfigurablePyAlgorithm # guinea pig algorithms +from AthenaCommon.CFElements import seqAND, seqOR, parOR +from AthenaCommon.Logging import log +from AthenaCommon.Constants import DEBUG, INFO + +import unittest + +class TestComponentAccumulator( unittest.TestCase ): + def setUp(self): + + + # trivial case without any nested sequences + + Configurable.configurableRun3Behavior+=1 + + log.setLevel(DEBUG) + + dummyCfgFlags=AthConfigFlags() + dummyCfgFlags.lock() + + class Algo(ConfigurablePyAlgorithm): + def __init__(self, name): + super( ConfigurablePyAlgorithm, self ).__init__( name ) + + def AlgsConf1(flags): + acc = ComponentAccumulator() + a1=Algo("Algo1") + a2=Algo("Algo2") + return acc,[a1,a2] + + + def AlgsConf2(flags): + acc = ComponentAccumulator() + result,algs=AlgsConf1( flags ) + acc.merge(result) + a = Algo("Algo3") + print "algo3 when created", id(a) + algs.append(a) + return acc,algs + + acc = ComponentAccumulator() + + # top level algs + acc1,algs=AlgsConf2(dummyCfgFlags) + acc.merge(acc1) + acc.addEventAlgo(algs) + + def AlgsConf3(flags): + acc = ComponentAccumulator() + na1=Algo("NestedAlgo1") + return acc,na1 + + def AlgsConf4(flags): + acc,na1= AlgsConf3( flags ) + NestedAlgo2 = Algo("NestedAlgo2") + NestedAlgo2.OutputLevel=7 + return acc,na1,NestedAlgo2 + + acc.addSequence( seqAND("Nest") ) + acc.addSequence( seqAND("subSequence1"), parentName="Nest" ) + acc.addSequence( parOR("subSequence2"), parentName="Nest" ) + + acc.addSequence( seqAND("sub2Sequence1"), parentName="subSequence1") + acc.addSequence( seqAND("sub3Sequence1"), parentName="subSequence1") + acc.addSequence( seqAND("sub4Sequence1"), parentName="subSequence1") + + accNA1=AlgsConf4(dummyCfgFlags) + acc.merge(accNA1[0]) + acc.addEventAlgo(accNA1[1:],"sub2Sequence1" ) + acc.store(open("testFile.pkl", "w")) + self.acc = acc + + + def test_algorihmsAreAdded( self ): + self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo1", 1).name(), "Algo1", "Algorithm not added to a top sequence" ) + self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo2", 1).name(), "Algo2", "Algorithm not added to a top sequence" ) + self.assertEqual( findAlgorithm( self.acc.getSequence(), "Algo3", 1).name(), "Algo3", "Algorithm not added to a top sequence" ) + + def test_sequencesAreAdded( self ): + self.assertIsNotNone( self.acc.getSequence("subSequence1" ), "Adding sub-sequence failed" ) + self.assertIsNotNone( self.acc.getSequence("subSequence2" ), "Adding sub-sequence failed" ) + self.assertIsNotNone( self.acc.getSequence("sub2Sequence1"), "Adding sub-sequence failed" ) + self.assertIsNotNone( findSubSequence( self.acc.getSequence("subSequence1"), "sub2Sequence1"), "Adding sub-sequence done in a wrong place" ) + + def test_algorithmsInNestedSequences( self ): + self.assertIsNotNone( findAlgorithm( self.acc.getSequence(), "NestedAlgo1" ), "Algorithm added to nested sequence" ) + self.assertIsNotNone( findAlgorithm( self.acc.getSequence(), "NestedAlgo1", 1 ) is None, "Algorithm mistakenly in top sequence" ) + self.assertIsNotNone( findAlgorithm( findSubSequence( self.acc.getSequence(), "sub2Sequence1"), "NestedAlgo1", 1 ), "Algorithm not in right sequence" ) + + + def test_readBackConfiguration( self ): + import pickle + with open( "testFile.pkl" ) as f: + s = pickle.load( f ) + self.assertIsNotNone( s, "The pickle has no content") + + def test_foreach_component( self ): + from AthenaCommon.Logging import logging + logging.getLogger('foreach_component').setLevel(DEBUG) + algo3 = self.acc.getEventAlgo("Algo3") + algo3.OutputLevel = INFO + self.acc.foreach_component("*/Algo3").OutputLevel = DEBUG # restet to debug level + self.assertEqual( algo3.OutputLevel, DEBUG, "wrong OutputLevel value for Algo3") + self.acc.foreach_component("*sub2*/*").OutputLevel = INFO + self.assertEqual(self.acc.getEventAlgo("NestedAlgo1").OutputLevel, INFO, "wrong OutputLevel value for NestedAlgo1") + self.assertEqual(self.acc.getEventAlgo("NestedAlgo2").OutputLevel, INFO, "wrong OutputLevel value for NestedAlgo1") + + + +class TestHLTCF( unittest.TestCase ): + def runTest( self ): + # replicate HLT issue, it occured because the sequnces were recorded in the order of storing in the dict and thus the + # some of them (in this case hltSteps) did not have properties recorded + + + Configurable.configurableRun3Behavior=1 + acc = ComponentAccumulator() + acc.addSequence( seqOR("hltTop") ) + algos2 = ConfigurablePyAlgorithm( "RecoAlgInTop" ) + acc.addEventAlgo( algos2, sequenceName="hltTop" ) # some algo + acc.addSequence( seqAND("hltSteps"), parentName="hltTop" ) + acc.addSequence( parOR("hltStep_1"), parentName="hltSteps" ) + acc.addSequence( seqAND("L2CaloEgammaSeq"), "hltStep_1" ) + acc.addSequence( parOR("hltStep_2"), parentName="hltSteps" ) + acc.moveSequence( "L2CaloEgammaSeq", "hltStep_2" ) + + acc.store(open("testFile2.pkl", "w")) + import pickle + f = open("testFile2.pkl") + s = pickle.load(f) + f.close() + self.assertNotEqual( s['hltSteps']['Members'], '[]', "Empty set of members in hltSteps, Sequences recording order metters" ) + + +class MultipleParentsInSequences( unittest.TestCase ): + def runTest( self ): + # test if an algorithm (or sequence) can be controlled by more than one sequence + Configurable.configurableRun3Behavior=1 + + accTop = ComponentAccumulator() + + recoSeq = seqAND("seqReco") + recoAlg = ConfigurablePyAlgorithm( "recoAlg" ) + recoSeq += recoAlg + + acc1 = ComponentAccumulator() + acc1.addSequence( seqAND("seq1") ) + acc1.addSequence( recoSeq, parentName="seq1" ) + + acc2 = ComponentAccumulator() + acc2.addSequence( seqAND("seq2") ) + acc2.addSequence( recoSeq, parentName="seq2" ) + + accTop.merge( acc1 ) + accTop.merge( acc2 ) + + accTop.printConfig() + + self.assertIsNotNone( findAlgorithm( accTop.getSequence( "seq1" ), "recoAlg" ), "Algorithm missing in the first sequence" ) + self.assertIsNotNone( findAlgorithm( accTop.getSequence( "seq2" ), "recoAlg" ), "Algorithm missing in the second sequence" ) + s = accTop.getSequence( "seqReco" ) + self.assertEqual( len( s.getChildren() ), 1, "Wrong number of algorithms in reco seq: %d " % len( s.getChildren() ) ) + self.assertIs( findAlgorithm( accTop.getSequence( "seq1" ), "recoAlg" ), findAlgorithm( accTop.getSequence( "seq2" ), "recoAlg" ), "Algorithms are cloned" ) + self.assertIs( findAlgorithm( accTop.getSequence( "seq1" ), "recoAlg" ), recoAlg, "Clone of the original inserted in sequence" ) + + accTop.store( open("dummy.pkl", "w") ) + import pickle + # check if the recording did not harm the sequences + with open("dummy.pkl") as f: + s = pickle.load( f ) + self.assertEquals( s['seq1']["Members"], "['AthSequencer/seqReco']", "After pickling recoSeq missing in seq1 " + s['seq1']["Members"]) + self.assertEquals( s['seq2']["Members"], "['AthSequencer/seqReco']", "After pickling recoSeq missing in seq2 " + s['seq2']["Members"]) + self.assertEquals( s['seqReco']["Members"], "['ConfigurablePyAlgorithm/recoAlg']", "After pickling seqReco is corrupt " + s['seqReco']["Members"] ) + +class ForbidRecursiveSequences( unittest.TestCase ): + def runTest( self ): + #Can't add a sequence with the same name below itself, e.g. + # \__ AthAlgSeq (seq: PAR AND) + # \__ seq1 (seq: SEQ AND) + # \__ seq1 (seq: SEQ AND) + def selfSequence(): + Configurable.configurableRun3Behavior=1 + from AthenaCommon.CFElements import seqAND + accTop = ComponentAccumulator() + accTop.wasMerged() + seq1 = seqAND("seq1") + seq1_again = seqAND("seq1") + accTop.addSequence(seq1) + accTop.addSequence(seq1_again, parentName = "seq1") + + #Allowed to add a sequence with the same name at same depth, e.g. + # \__ AthAlgSeq (seq: PAR AND) + # \__ seq1 (seq: SEQ AND) + # \__ seq2 (seq: SEQ AND) + # \__ seq2 (seq: SEQ AND) + # should not raise any exceptions + def selfTwinSequence(): + Configurable.configurableRun3Behavior=1 + from AthenaCommon.CFElements import seqAND + accTop = ComponentAccumulator() + accTop.wasMerged() + seq1 = seqAND("seq1") + seq2 = seqAND("seq2") + seq2_again = seqAND("seq1") + accTop.addSequence(seq1) + accTop.addSequence(seq2, parentName = "seq1") + accTop.addSequence(seq2_again, parentName = "seq1") + accTop.wasMerged() + + + #Can't add a sequence with the same name two steps below itself, e.g. + # \__ AthAlgSeq (seq: PAR AND) + # \__ seq1 (seq: SEQ AND) + # \__ seq2 (seq: SEQ AND) + # \__ seq1 (seq: SEQ AND) + def selfGrandParentSequence(): + Configurable.configurableRun3Behavior=1 + from AthenaCommon.CFElements import seqAND + accTop = ComponentAccumulator() + seq1 = seqAND("seq1") + seq2 = seqAND("seq2") + seq1_again = seqAND("seq1") + accTop.addSequence(seq1) + accTop.addSequence(seq2, parentName = "seq1") + accTop.addSequence(seq1_again, parentName = "seq2") + accTop.wasMerged() + + #Can't merge sequences with the same name two steps below itself, e.g. + # \__ AthAlgSeq (seq: PAR AND) + # \__ seq1 (seq: SEQ AND) + # \__ seq2 (seq: SEQ AND) + # \__ seq1 (seq: SEQ AND) + def selfMergedGrandParentSequence(): + Configurable.configurableRun3Behavior=1 + from AthenaCommon.CFElements import seqAND + acc1=ComponentAccumulator() + acc1.wasMerged() + acc1.addSequence(seqAND("seq1")) + acc2=ComponentAccumulator() + acc2.wasMerged() + acc2.addSequence(seqAND("seq2")) + acc2.addSequence(seqAND("seq1"), "seq2") + acc1.merge(acc2) + + self.assertRaises(RuntimeError, selfSequence ) + self.assertRaises(RuntimeError, selfGrandParentSequence ) + self.assertRaises(RuntimeError, selfMergedGrandParentSequence ) + +class FailedMerging( unittest.TestCase ): + def runTest( self ): + topCA = ComponentAccumulator() + + def badMerge(): + someCA = ComponentAccumulator() + topCA.merge( (someCA, 1, "hello") ) + self.assertRaises(RuntimeError, badMerge ) + topCA.wasMerged() + + +class MergeMovingAlgorithms( unittest.TestCase ): + def runTest( self ): + Configurable.configurableRun3Behavior=1 + destinationCA = ComponentAccumulator() + destinationCA.addSequence( seqAND("dest") ) + + sourceCA = ComponentAccumulator() + sourceCA.addEventAlgo(ConfigurablePyAlgorithm("alg1")) + sourceCA.addEventAlgo(ConfigurablePyAlgorithm("alg2")) + sourceCA.addSequence( seqAND("innerSeq") ) + sourceCA.addEventAlgo(ConfigurablePyAlgorithm("alg3"), sequenceName="innerSeq" ) + + destinationCA.merge( sourceCA, sequenceName="dest" ) + + #destinationCA.merge( sourceCA ) + self.assertIsNotNone( findAlgorithm( destinationCA.getSequence("dest"), "alg1" ), "Algorithm not placed in sub-sequence" ) + self.assertIsNotNone( findSubSequence( destinationCA.getSequence(), "innerSeq" ), "The sequence is not added" ) + self.assertIsNotNone( findAlgorithm( destinationCA.getSequence("dest"), "alg3" ), "Algorithm deep in thesource CA not placed in sub-sequence of destiantion CA" ) + destinationCA.wasMerged() + sourceCA.wasMerged() + + +class TestComponentAccumulatorAccessors( unittest.TestCase ): + def runTest( self ): + ca = ComponentAccumulator() + from AthenaCommon.Configurable import ConfigurablePyAlgorithm,ConfigurableAlgTool + ca.addEventAlgo(ConfigurablePyAlgorithm("alg1")) + + self.assertIsNotNone( ca.getEventAlgo(), "Found single alg") + self.assertEquals( len(ca.getEventAlgos()), 1 , "Found single alg") +# no idea why this assersts do not recognise exceptions +# self.assertRaises(ConfigurationError, ca.getEventAlgo("alg2")) + + ca.addEventAlgo(ConfigurablePyAlgorithm("alg2")) + + self.assertIsNotNone( ca.getEventAlgo("alg2"), "Found single alg") + self.assertEquals( len(ca.getEventAlgos()), 2 , "Found single alg") + # self.assertRaises(ConfigurationError, ca.getEventAlgo(), "Single Alg API ambiguity") + + class Tool(ConfigurableAlgTool): + def __init__(self, *args, **kwargs): + super(Tool, self).__init__(*args, **kwargs) + def getDlls(self): + return None + + + ca.addPublicTool( Tool(name="tool1") ) + self.assertIsNotNone( ca.getPublicTool(), "Found single tool") + ca.addPublicTool( Tool(name="tool2") ) +# self.assertRaises(ConfigurationError, ca.getPublicTool(), "Found single tool") + + +if __name__ == "__main__": + unittest.main() diff --git a/Control/AthenaConfiguration/python/PropSetterProxy.py b/Control/AthenaConfiguration/python/PropSetterProxy.py new file mode 100644 index 0000000000000000000000000000000000000000..e55e6e32fa2b15c2c6517c5c0f2c36a0f60d5676 --- /dev/null +++ b/Control/AthenaConfiguration/python/PropSetterProxy.py @@ -0,0 +1,79 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +from AthenaCommon.Logging import logging +from AthenaCommon.CFElements import isSequence +from AthenaCommon.Configurable import ConfigurableAlgTool +from GaudiKernel.GaudiHandles import PrivateToolHandle, PrivateToolHandleArray +class PropSetterProxy(object): + __compPaths = {} + __scannedCA = None + + def __init__(self, ca, path): + self.__path = path + self.__findComponents( ca ) + + def __setattr__(self, name, value): + if name.startswith("_PropSetterProxy"): + return super(PropSetterProxy, self).__setattr__(name, value) + + msg = logging.getLogger('foreach_component') + if name != "OutputLevel": + msg.warning( "Only OutputLevel is allowed to be changed with the foreach_component at the moment" ) + return + + + import fnmatch + for component_path, component in PropSetterProxy.__compPaths.iteritems(): + if fnmatch.fnmatch( component_path, self.__path ): + if name in component.getProperties(): + try: + setattr( component, name, value ) + msg.info( "Set property: %s to value %s of component %s because it matched %s " % ( name, str(value), component_path, self.__path ) ) + except Exception, ex: + msg.warning( "Failed to set property: %s to value %s of component %s because it matched %s, reason: %s" % ( name, str(value), component_path, self.__path, str(ex) ) ) + pass + else: + msg.warning( "No such a property: %s in component %s, tried to set it because it matched %s" % ( name, component_path, self.__path ) ) + + + def __findComponents(self, ca): + if ca is not PropSetterProxy.__scannedCA: + PropSetterProxy.__scannedCA = ca + PropSetterProxy.__compPaths = {} + def __add(path, comp): + if comp.getName() == "": + return + PropSetterProxy.__compPaths[ path ] = comp + + + for svc in ca._services: + PropSetterProxy.__compPaths['SvcMgr/'+svc.getFullName()] = svc + for t in ca._publicTools: + PropSetterProxy.__compPaths['ToolSvc/'+t.getFullName()] = t + + def __nestAlg(startpath, comp): # it actually dives inside the algorithms and (sub) tools + if comp.getName() == "": + return + for name, value in comp.getProperties().iteritems(): + if isinstance( value, ConfigurableAlgTool ) or isinstance( value, PrivateToolHandle ): + __add( startpath+"/"+name+"/"+value.getFullName(), value ) + __nestAlg( startpath+"/"+name+"/"+value.getName(), value ) + if isinstance( value, PrivateToolHandleArray): + for toolIndex,t in enumerate(value): + __add( startpath+"/"+name+"/"+t.getFullName(), t ) + __nestAlg( startpath+"/"+name+"/"+t.getName(), value[toolIndex] ) + + + def __nestSeq( startpath, seq ): + for c in seq.getChildren(): + if isSequence(c): + __nestSeq( startpath+"/"+c.getName(), c ) + else: # the algorithm or tool + __add( startpath+"/"+c.getFullName(), c ) + __nestAlg( startpath+"/"+c.getFullName(), c ) + + __nestSeq("", ca._sequence) + + + + + diff --git a/Control/AthenaMP/src/memory-monitor/rapidjson/document.h b/Control/AthenaMP/src/memory-monitor/rapidjson/document.h index 2dce56c1c99611048466be7bf846bf238e0c0491..68166df10e4e550c29d4885b97e774da9b75b8e9 100644 --- a/Control/AthenaMP/src/memory-monitor/rapidjson/document.h +++ b/Control/AthenaMP/src/memory-monitor/rapidjson/document.h @@ -325,6 +325,8 @@ struct GenericStringRef { GenericStringRef(const CharType* str, SizeType len) : s(str), length(len) { RAPIDJSON_ASSERT(s != NULL); } + GenericStringRef( const GenericStringRef& ) = default; + //! implicit conversion to plain CharType pointer operator const Ch *() const { return s; } diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx index 322d8255909c6d43284cf8990faa7b61b3990599..6672d035f77898ea14c8f68d13487b07e938702f 100755 --- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx @@ -9,6 +9,7 @@ // GeneratorObjectsAthenaPool includes #include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h" +#include "GeneratorObjects/McEventCollection.h" /////////////////////////////////////////////////////////////////// /// Public methods: @@ -24,7 +25,13 @@ void HepMcParticleLinkCnv_p1::persToTrans( const HepMcParticleLink_p1* persObj, MsgStream &/*msg*/ ) { EBC_EVCOLL evColl = EBC_MAINEVCOLL; - if (persObj->m_mcEvtIndex>0) evColl = EBC_FIRSTPUEVCOLL; // HACK + if (persObj->m_mcEvtIndex>0) { + // HACK + const CLID clid = ClassID_traits<McEventCollection>::ID(); + if (SG::CurrentEventStore::store()->proxy (clid, "TruthEvent_PU") != nullptr) { + evColl = EBC_FIRSTPUEVCOLL; + } + } transObj->setExtendedBarCode ( HepMcParticleLink::ExtendedBarCode( persObj->m_barcode, persObj->m_mcEvtIndex, diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h index 3d080a519b120768c7c84eebf4149823075b52f7..ec8c48f06842d38fe7e8b1339cac3c8b88dbec14 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h @@ -616,15 +616,15 @@ namespace InDetDD { // Directions of axes. These are true if the hit/simulation and reconstruction local frames are // in the same direction and false if they are opposite. - mutable std::atomic_bool m_depthDirection; // Direction of depth axis. + mutable bool m_depthDirection ATLAS_THREAD_SAFE; // Guarded by m_mutex // Direction of depth axis. // Also direction of readout implant (n+ for pixel, p+ for SCT). - mutable std::atomic_bool m_phiDirection; // - mutable std::atomic_bool m_etaDirection; // - + mutable bool m_phiDirection ATLAS_THREAD_SAFE; // + mutable bool m_etaDirection ATLAS_THREAD_SAFE; // + mutable std::atomic_bool m_cacheValid; // Alignment associated quatities. mutable std::atomic_bool m_firstTime; - mutable std::atomic_bool m_isStereo; - + mutable bool m_isStereo ATLAS_THREAD_SAFE; + mutable std::recursive_mutex m_mutex; mutable Amg::Transform3D m_transform ATLAS_THREAD_SAFE; // Guarded by m_mutex @@ -638,12 +638,12 @@ namespace InDetDD { mutable Amg::Vector3D m_center ATLAS_THREAD_SAFE; // Guarded by m_mutex mutable HepGeom::Vector3D<double> m_centerCLHEP ATLAS_THREAD_SAFE; // Guarded by m_mutex - mutable std::atomic<double> m_minZ; - mutable std::atomic<double> m_maxZ; - mutable std::atomic<double> m_minR; - mutable std::atomic<double> m_maxR; - mutable std::atomic<double> m_minPhi; - mutable std::atomic<double> m_maxPhi; + mutable double m_minZ ATLAS_THREAD_SAFE;// Guarded by m_mutex + mutable double m_maxZ ATLAS_THREAD_SAFE;// Guarded by m_mutex + mutable double m_minR ATLAS_THREAD_SAFE;// Guarded by m_mutex + mutable double m_maxR ATLAS_THREAD_SAFE;// Guarded by m_mutex + mutable double m_minPhi ATLAS_THREAD_SAFE;// Guarded by m_mutex + mutable double m_maxPhi ATLAS_THREAD_SAFE;// Guarded by m_mutex CxxUtils::CachedUniquePtr<Trk::Surface> m_surface; mutable std::vector<const Trk::Surface*> m_surfaces ATLAS_THREAD_SAFE; // Guarded by m_mutex diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx index bb597d1be11827dd18a6baa137ab4568ff81c42b..ded850688698d692dcd6c9defe01805c4bc8e405 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx @@ -331,14 +331,8 @@ SiDetectorElement::updateCache() const m_phiAxis = Amg::Vector3D(m_phiAxisCLHEP[0],m_phiAxisCLHEP[1],m_phiAxisCLHEP[2]); m_etaAxis = Amg::Vector3D(m_etaAxisCLHEP[0],m_etaAxisCLHEP[1],m_etaAxisCLHEP[2]); - double minR, maxR, minZ, maxZ, minPhi, maxPhi; - getExtent(minR, maxR, minZ, maxZ, minPhi, maxPhi); - m_minR = minR; - m_maxR = maxR; - m_minZ = minZ; - m_maxZ = maxZ; - m_minPhi = minPhi; - m_maxPhi = maxPhi; + getExtent(m_minR, m_maxR, m_minZ, m_maxZ, m_minPhi, m_maxPhi); + // Determin isStereo if (firstTimeTmp) { diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigFlags.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigFlags.py deleted file mode 100755 index baf5c4b5ef20fedcc036296c111ffb1f143c31bd..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigFlags.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Construct ConfigFlags Beam Conditions Monitor Digitization - -Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -""" -from AthenaConfiguration.AthConfigFlags import AthConfigFlags - -def createBCMCfgFlags(): - """Return an AthConfigFlags object with required flags""" - flags = AthConfigFlags() - # Run Inner Detector noise simulation? - flags.addFlag("Digitization.DoInnerDetectorNoise", True) - # Should pile-up digitization be done one bunch crossing at a time? - # Else all bunch crossings are provided at once. - flags.addFlag("Digitization.DoXingByXingPileUp", False) - # Name of MC EvtStore to overlay - flags.addFlag("Overlay.EventStore", "BkgEvent_0_SG") - # Name of the random number service to use - # of ("dSFMT", "Ranlux64", "Ranecu",) - flags.addFlag("Random.Engine", "dSFMT") - return flags - diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py index daf3af3ae99f74a6ed41bc345250477e0492a7e6..f79e4fb5b2dfdd1913a984e9061a1eb3eb186aec 100755 --- a/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py +++ b/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py @@ -28,8 +28,6 @@ ConfigFlags.join(createOverlayCfgFlags()) ConfigFlags.lock() # Construct our accumulator to run acc = MainServicesSerialCfg() -from StoreGate.StoreGateConf import StoreGateSvc # FIXME remove this once athena is fixed -acc.addService(StoreGateSvc("ConditionStore")) acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(InDetGMConfig(ConfigFlags)) # FIXME This sets up the whole ID geometry would be nicer just to set up min required for BCM # Add configuration to write HITS pool file diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py index ccc64194574754566c72a0e39a46c095e0204847..79733958750a3409beeaf142ca1968cb61376ee9 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py @@ -6,45 +6,35 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags # These lines were previously in SCT_Monitoring_ConditionsAccess.py ######################################################################## -doTriggger_InDetSCTHitsTool = False +tracksName = (InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks()) + +doTriggger = False TrigDecisionTool_InDetSCTHitsTool = "" if globalflags.DataSource == "data": from RecExConfig.RecFlags import rec if rec.doTrigger(): - doTriggger_InDetSCTHitsTool = True + doTriggger = True TrigDecisionTool_InDetSCTHitsTool = DQMonFlags.nameTrigDecTool() from SCT_Monitoring.SCT_MonitoringConf import SCTHitsNoiseMonTool -InDetSCTHitsTool = SCTHitsNoiseMonTool ( name = "InDetSCTHitsNoiseMonTool", - OutputLevel = 4, - doHitmapHistos = False, - CheckRate = 1000, - doPositiveEndcap = True, - doNegativeEndcap = True, - doTrigger = doTriggger_InDetSCTHitsTool, - TrigDecisionTool = TrigDecisionTool_InDetSCTHitsTool) - -InDetSCTHitsTool.tracksName = InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks() - -#ToolSvc += InDetSCTHitsTool +InDetSCTHitsTool = SCTHitsNoiseMonTool ( name = "InDetSCTHitsNoiseMonTool", + OutputLevel = 4, + doTrigger = doTriggger, + TrigDecisionTool = TrigDecisionTool_InDetSCTHitsTool, + tracksName = tracksName ) + if (InDetFlags.doPrintConfigurables()): print InDetSCTHitsTool from SCT_Monitoring.SCT_MonitoringConf import SCTTracksMonTool InDetSCTTracksMonTool = SCTTracksMonTool ( name = "InDetSCTTracksMonTool", OutputLevel = 4, - CheckRate = 1000, - doPositiveEndcap = True, - doNegativeEndcap = True, - doUnbiasedCalc = True, - doTrigger = globalflags.DataSource == "data") - -InDetSCTTracksMonTool.tracksName = InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks() + doTrigger = doTriggger, + tracksName = tracksName ) if jobproperties.Beam.beamType()=='collisions': from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool InDetSCTTracksMonTool.FilterTools += [GetFilledBunchFilterTool()] -#ToolSvc += InDetSCTTracksMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTTracksMonTool @@ -56,16 +46,12 @@ from SCT_Monitoring.SCT_MonitoringConf import SCTErrMonTool InDetSCTErrMonTool = SCTErrMonTool ( name = "InDetSCTErrMonTool", OutputLevel = 4, histoPathBase = "/stat", - CheckRate = 1000, - doPositiveEndcap = True, - doNegativeEndcap = True, SCT_DCSConditionsTool = sct_DCSConditionsToolSetup.getTool()) if jobproperties.Beam.beamType()=='collisions': from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool InDetSCTErrMonTool.FilterTools += [GetFilledBunchFilterTool()] -#ToolSvc += InDetSCTErrMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTErrMonTool @@ -84,32 +70,21 @@ SCT_BunchCrossingTool = BunchCrossingTool() from SCT_Monitoring.SCT_MonitoringConf import SCTHitEffMonTool InDetSCTHitEffMonTool = SCTHitEffMonTool(name = "InDetSCTHitEffMonTool", - DetectorMode = 3, OutputLevel = 4, IsCosmic = InDetFlags.doCosmics(), - UseMasks = False, - LookAtDatabase = False, - ChronoTime = False, HoleSearch = InDetHoleSearchTool, - IsSim = globalflags.DataSource != "data", + IsSim = (globalflags.DataSource != "data"), ROTCreator = SCT_ClusterOnTrackTool, - BunchCrossingTool = SCT_BunchCrossingTool) - -InDetSCTHitEffMonTool.TrackName = InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks() + BunchCrossingTool = SCT_BunchCrossingTool, + TrackName = tracksName) if jobproperties.Beam.beamType()=='collisions': from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool InDetSCTHitEffMonTool.FilterTools += [GetFilledBunchFilterTool()] -#ToolSvc += InDetSCTHitEffMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTHitEffMonTool -#from SCT_Monitoring.SCT_MonitoringConf import SCTTimeDependentMonTool -#SCTTimeDependentMonTool = SCTTimeDependentMonTool("SCTTimeDependentMonTool") -#ToolSvc+=SCTTimeDependentMonTool -#InDetSCTMonMan.AthenaMonTools += [SCTTimeDependentMonTool] - from SCT_Monitoring.SCT_MonitoringConf import SCTLorentzMonTool from BTagging.BTaggingConfiguration_CommonTools import toolAtlasExtrapolator atlasExtrapolator = toolAtlasExtrapolator('AtlasExtrapolator') @@ -117,31 +92,24 @@ options = {} options.setdefault('Extrapolator', atlasExtrapolator) from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex trackToVertex = Reco__TrackToVertex(**options) -InDetSCTLorentzMonTool = SCTLorentzMonTool ( name = "InDetSCTLorentzMonTool", TrackToVertexTool = trackToVertex, - OutputLevel = 4) - -InDetSCTLorentzMonTool.tracksName = InDetKeys.SCTTracks() if InDetFlags.doTrackSegmentsSCT() else InDetKeys.UnslimmedTracks() +InDetSCTLorentzMonTool = SCTLorentzMonTool ( name = "InDetSCTLorentzMonTool", + TrackToVertexTool = trackToVertex, + OutputLevel = 4, + tracksName = tracksName ) if jobproperties.Beam.beamType()=='collisions': from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool InDetSCTLorentzMonTool.FilterTools += [GetFilledBunchFilterTool()] -#ToolSvc += InDetSCTLorentzMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTLorentzMonTool from SCT_Monitoring.SCT_MonitoringConf import SCTRatioNoiseMonTool -InDetSCTRatioNoiseMonTool = SCTRatioNoiseMonTool ( name = "InDetSCTRatioNoiseMonTool", - OutputLevel = 4, - doTrigger = globalflags.DataSource == "data") - +InDetSCTRatioNoiseMonTool = SCTRatioNoiseMonTool ( name = "InDetSCTRatioNoiseMonTool", + OutputLevel = 4, + doTrigger = doTriggger ) -from RecExConfig.RecFlags import rec -if not rec.doTrigger(): - InDetSCTRatioNoiseMonTool.doTrigger=False - -#ToolSvc += InDetSCTRatioNoiseMonTool if (InDetFlags.doPrintConfigurables()): print InDetSCTRatioNoiseMonTool @@ -156,9 +124,12 @@ InDetSCTMonMan = AthenaMonManager("InDetSCTMonManager", Environment = DQMonFlags.monManEnvironment(), Run = DQMonFlags.monManRun(), LumiBlock = DQMonFlags.monManLumiBlock(), - - -AthenaMonTools = [ InDetSCTTracksMonTool, InDetSCTRatioNoiseMonTool, InDetSCTLorentzMonTool, InDetSCTHitEffMonTool, InDetSCTHitsTool, InDetSCTErrMonTool ] ) + AthenaMonTools = [ InDetSCTTracksMonTool, + InDetSCTRatioNoiseMonTool, + InDetSCTLorentzMonTool, + InDetSCTHitEffMonTool, + InDetSCTHitsTool, + InDetSCTErrMonTool ] ) topSequence += InDetSCTMonMan if (InDetFlags.doPrintConfigurables()): diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h index 5a4a65a4c6c8df9a353957ee490d66c907166126..e9b4d03f0a6ad64e0092941a8e2148aca84603e3 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h @@ -127,8 +127,8 @@ class SCTErrMonTool : public ManagedMonitorToolBase TH1I* m_nErrors; TH1I* m_nLinksWithErrors; - int* m_nErrors_buf; - int* m_nLinksWithErrors_buf; + std::vector<int> m_nErrors_buf; + std::vector<int> m_nLinksWithErrors_buf; int m_nErrors_pos; TH1I* m_MaskedAllLinks; // maskedLinks||maskedRODs @@ -158,7 +158,6 @@ class SCTErrMonTool : public ManagedMonitorToolBase // NOTE: The following is not the usual index order, which goes C, Barrel, A enum {iECm=0, iBARREL=1, iECp=2, iGEN=3 }; //iECp==EA, iECm==EC - std::string m_stream; std::string m_path; /// CheckHists() frequency int m_checkrate; @@ -187,7 +186,7 @@ class SCTErrMonTool : public ManagedMonitorToolBase //@{ /// Data object name: for the SCT this is "SCT_RDOs" - SG::ReadHandle<SCT_RDO_Container> m_dataObjectName; + SG::ReadHandleKey<SCT_RDO_Container> m_dataObjectName{this, "RDOKey", "SCT_RDOs"}; ///SCT Helper class const SCT_ID* m_pSCTHelper; @@ -289,7 +288,7 @@ class SCTErrMonTool : public ManagedMonitorToolBase float m_PSTripModules; - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey; + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo"}; }; #endif diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h index 13a9801d673a422772ca9faf223fa8fe90f87060..4ecddda09089d2b05ff36f6dd358d784588e27ad 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h @@ -117,12 +117,12 @@ private: Int_t nbinx, Double_t* xbins, Int_t nbiny, Double_t* ybins); - SG::ReadHandle<TrackCollection> m_TrackName; + SG::ReadHandleKey<TrackCollection> m_TrackName{this, "TrackName", "CombinedInDetTracks"}; IChronoStatSvc* m_chrono; const std::map < Identifier, unsigned int >* m_badChips; ServiceHandle<MagField::IMagFieldSvc> m_fieldServiceHandle; - ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool; + ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool{this, "BunchCrossingTool", "Trig::BunchCrossingTool/BunchCrossingTool"}; Int_t m_DetectorMode; @@ -141,7 +141,7 @@ private: UInt_t m_maxTracks; std::string m_path; - SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_sctContainerName; + SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_sctContainerName{this, "SCT_ClusterContainer", "SCT_Clusters"}; Bool_t m_insideOutOnly; @@ -159,11 +159,11 @@ private: Bool_t m_chronotime; Bool_t m_useIDGlobal; - ToolHandle < Trk::IResidualPullCalculator > m_residualPullCalculator; - ToolHandle < Trk::IRIO_OnTrackCreator > m_rotcreator; - ToolHandle < Trk::ITrackHoleSearchTool > m_holeSearchTool; + ToolHandle<Trk::IResidualPullCalculator> m_residualPullCalculator{this, "ResPullCalc", "Trk::ResidualPullCalculator/ResidualPullCalculator"}; + ToolHandle<Trk::IRIO_OnTrackCreator> m_rotcreator{this, "ROTCreator", "InDet::SCT_ClusterOnTrackTool/SCT_ClusterOnTrackTool"}; + ToolHandle<Trk::ITrackHoleSearchTool> m_holeSearchTool{this, "HoleSearch", "InDet::InDetTrackHoleSearchTool"}; - ToolHandle < ISCT_ConfigurationConditionsTool > m_configConditions{this, "ConfigConditions", + ToolHandle<ISCT_ConfigurationConditionsTool> m_configConditions{this, "ConfigConditions", "SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool", "Tool to retrieve SCT Configuration Tool"}; typedef std::array < TProfile*, SCT_Monitoring::N_REGIONS > TProfArray; @@ -285,8 +285,8 @@ private: const SCT_ID* m_sctId; const TRT_ID* m_trtId; - SG::ReadHandleKey<ComTime> m_comTimeName; - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey; + SG::ReadHandleKey<ComTime> m_comTimeName{this, "ComTimeKey", "TRT_Phase"}; + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo"}; SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; /**Convert a layer/disk number (0-21) to a bec index (0,1,2) according to position of that layer diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h index 722645b925c4dc0a0beeb310132753df80bf9476..ebe9c53a2ca8d84b5d735ac8d1ff2c25617e500c 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h @@ -60,7 +60,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ public: typedef unsigned int ChipNumberType; SCTHitsNoiseMonTool(const std::string& type, const std::string& name,const IInterface* parent); - ~SCTHitsNoiseMonTool(); + ~SCTHitsNoiseMonTool() = default; virtual StatusCode initialize() final; /** @name Book, fill & check (reimplemented from baseclass) */ //@{ @@ -114,17 +114,17 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ VecProf2_t m_pnoiseoccupancymapHistoVectorECmTrigger; TH1F* m_nSP; - int* m_nSP_buf; + std::vector<int> m_nSP_buf; int m_nSP_pos; TH1F* m_nHits; - int* m_nHits_buf; + std::vector<int> m_nHits_buf; int m_nHits_pos; TH1F* m_nmaxHits; - int* m_nmaxHits_buf; - Identifier* m_nmaxModule_buf; + std::vector<int> m_nmaxHits_buf; + std::vector<Identifier> m_nmaxModule_buf; TH1F* m_nminHits; - int* m_nminHits_buf; - Identifier* m_nminModule_buf; + std::vector<int> m_nminHits_buf; + std::vector<Identifier> m_nminModule_buf; //Histograms with hits per luminosity block H1_t m_numBarrelHitsPerLumiBlock; @@ -198,7 +198,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ H1_t m_hitsvsL1ID; /// Name of the Track collection to use - SG::ReadHandleKey<TrackCollection> m_tracksName; + SG::ReadHandleKey<TrackCollection> m_tracksName{this, "tracksName", "CombinedInDetTracks"}; /// Name of the L1 Type to use for filling the extra NO histograms std::string m_NOTrigger; @@ -300,7 +300,6 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ Prof_t m_tbinfracVsLB; Prof_t m_tbinfracVsLBECp; Prof_t m_tbinfracVsLBECm; - //std::string m_tracksName; bool m_initialize; //@name Histograms related methods @@ -337,7 +336,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ ///additional maps for track NO to compare with SP NO calc std::map<Identifier, int> m_RDOs; //CAM adds map for SP NO - SG::ReadHandle<SpacePointContainer> m_SCTSPContainerName; + SG::ReadHandleKey<SpacePointContainer> m_SCTSPContainerName{this, "SpacePointKey", "SCT_SpacePoints"}; std::map<Identifier, float> m_occSumUnbiased; std::map<Identifier, float> m_occSumUnbiasedTrigger; @@ -472,7 +471,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ //@{ /// Data object name: for the SCT this is "SCT_RDOs" - SG::ReadHandleKey<SCT_RDO_Container> m_dataObjectName; + SG::ReadHandleKey<SCT_RDO_Container> m_dataObjectName{this, "RDOKey", "SCT_RDOs"}; ///SCT Helper class const SCT_ID* m_pSCTHelper; @@ -513,8 +512,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ positionString(const Identifier& plane) const; //@} - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey; - SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_clusContainerKey; + SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_clusContainerKey{this, "ClusterKey", "SCT_Clusters"}; // For P->T converter of SCT_Clusters SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h index 2397e9675cf557e9efb68ab6d6bc09b1178ca111..a094358ac73787cdeb7a04bea4569f9d779e254f 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h @@ -80,7 +80,7 @@ private: //@{ //for Vertex and perigee - ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool; + ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool{this, "TrackToVertexTool", "Reco::TrackToVertex"}; /// Vector of pointers to profile histogram of local inc angle (phi) vs nStrips (one/layer) Prof_t m_phiVsNstrips[4]; @@ -91,11 +91,10 @@ private: Prof_t m_phiVsNstrips_Side_100[4][2]; Prof_t m_phiVsNstrips_Side_111[4][2]; - std::string m_stream; std::string m_path; //@} /// Name of the Track collection to use - SG::ReadHandleKey<TrackCollection> m_tracksName; + SG::ReadHandleKey<TrackCollection> m_tracksName{this, "tracksName", "CombinedInDetTracks"}; SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; //@name Service members diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h index 58fda516247331d76b33cac0292898dfbf538e41..7aaa508fc2248034912f6b4f7b28ebbc67f1c232 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h @@ -59,10 +59,11 @@ protected: bool m_doTrigger; /// Check if the event belongs to the SCTNoise Calibration Stream bool m_isStream; +protected: + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo", "Key of xAOD::EventInfo"}; private: std::bitset<N_TRIGGER_TYPES> m_firedTriggers; - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfoKey", "Key of xAOD::EventInfo"}; }; #endif diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h index f1232c2811b1d3ddfa69376e8044a08562d3922b..e14e0411115025aadb0d9fed1bfbfdb5e4e91e31 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h @@ -223,18 +223,14 @@ private: H1_t m_NZ1_vs_modnum; H1_t m_N11_vs_modnum; - std::string m_stream; std::string m_path; //@} - /// Name of the Track collection to use - std::string m_tracksName; std::string m_NOTrigger; //@name Service members //@{ /// Data object name: for the SCT this is "SCT_RDOs" - SG::ReadHandleKey<SCT_RDO_Container> m_dataObjectName; - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey; + SG::ReadHandleKey<SCT_RDO_Container> m_dataObjectName{this, "RDOKey", "SCT_RDOs"}; ///SCT Helper class const SCT_ID* m_pSCTHelper; ToolHandle<IInDetConditionsTool> m_pSummaryTool{this, "conditionsTol", diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h index 1fb76d94a26e473551344a4c7e7ffc5917d2a6d6..115fded36e7b5109cafe2ee4c62de0a724719de8 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h @@ -69,7 +69,7 @@ private: typedef std::vector<H2_t> VecH2_t; //@} TH1I* m_nTracks; - int* m_nTracks_buf; + std::vector<int> m_nTracks_buf; int m_nTracks_pos; TH1I* m_trackTrigger; TProfile* m_trackTriggerRate; @@ -144,7 +144,7 @@ private: bool m_useIDGlobal; //@} /// Name of the Track collection to use - SG::ReadHandleKey<TrackCollection> m_tracksName; + SG::ReadHandleKey<TrackCollection> m_tracksName{this, "tracksName", "CombinedInDetTracks"}; /// Cut on number of SCT hits on track int m_trackHitCut; /// CheckHists() frequency @@ -154,7 +154,7 @@ private: bool m_doPositiveEndcap; bool m_doNegativeEndcap; - ToolHandle < Trk::IResidualPullCalculator > m_residualPullCalculator; + ToolHandle<Trk::IResidualPullCalculator> m_residualPullCalculator{this, "ResPullCalc", "Trk::ResidualPullCalculator/ResidualPullCalculator"}; bool m_doUnbiasedCalc; diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx index 7be62108fb70fabab50acf904a65c3f9ada175bd..32ef5b6d786c62c469c95057ce8aebe80bca6115 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx @@ -133,7 +133,7 @@ namespace { // ==================================================================================================== SCTErrMonTool::SCTErrMonTool(const std::string& type, const std::string& name, const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), - m_firstHit{}, + m_firstHit{}, m_secondHit{}, m_allErrs{}, m_allErrsPerLumi{}, @@ -150,7 +150,7 @@ SCTErrMonTool::SCTErrMonTool(const std::string& type, const std::string& name, c m_nLinksWithErrors{}, m_nErrors_buf{}, m_nLinksWithErrors_buf{}, - m_nErrors_pos{}, + m_nErrors_pos{0}, m_MaskedAllLinks{}, m_numberOfEventsLumi{}, m_numberOfEvents{}, @@ -161,8 +161,7 @@ SCTErrMonTool::SCTErrMonTool(const std::string& type, const std::string& name, c m_current_lb{}, m_last_reset_lb{}, m_sctflag(false), - m_dataObjectName(std::string("SCT_RDOs")), - m_pSCTHelper{}, + m_pSCTHelper{nullptr}, m_Conf{}, m_ConfRN{}, m_ConfNew{}, @@ -182,8 +181,6 @@ SCTErrMonTool::SCTErrMonTool(const std::string& type, const std::string& name, c m_ConfNoiseOnlineRecent{}, m_DetailedConfiguration{}, m_thistSvc("THistSvc", name), - m_checkBadModules(true), - m_ignore_RDO_cut_online(true), m_geo{}, m_SCTHash{{}}, m_mapSCT{nullptr}, @@ -192,18 +189,7 @@ SCTErrMonTool::SCTErrMonTool(const std::string& type, const std::string& name, c m_nBinsPhi( 100 ), m_WafersThreshold( 3.0 ), m_detectorCoverageVsLbs{nullptr}, - m_PSTripModulesVsLbs{}, - m_eventInfoKey(std::string("EventInfo")) { - /** - * sroe 3 Sept 2015: - * histoPathBase is declared as a property in the base class, assigned to m_path - * with default as empty string. - * Declaring it here as well gives rise to compilation warning - * WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023 - * declareProperty("histoPathBase", m_stream = "/stat"); - **/ - - m_stream = "/stat"; + m_PSTripModulesVsLbs{} { declareProperty("CheckRate", m_checkrate = 1000); declareProperty("runOnline", m_runOnline = false); declareProperty("CheckRecent", m_checkrecent = 20); @@ -221,8 +207,8 @@ SCTErrMonTool::SCTErrMonTool(const std::string& type, const std::string& name, c declareProperty("DoPerLumiErrors", m_doPerLumiErrors = true); declareProperty("DoErr2DPerLumiHists", m_doErr2DPerLumiHists = false); - declareProperty("checkBadModules", m_checkBadModules); - declareProperty("IgnoreRDOCutOnline", m_ignore_RDO_cut_online); + declareProperty("checkBadModules", m_checkBadModules = true); + declareProperty("IgnoreRDOCutOnline", m_ignore_RDO_cut_online = true); //Detector Coverage Tool switch declareProperty("CoverageCheck",m_CoverageCheck= true); declareProperty("UseDCS", m_useDCS = true); @@ -270,15 +256,8 @@ SCTErrMonTool::~SCTErrMonTool() { if (m_allErrsPerLumi[errType][reg][layer])LWHist::safeDelete(m_allErrsPerLumi[errType][reg][layer]); if (m_pallErrsPerLumi[errType][reg][layer])LWHist::safeDelete(m_pallErrsPerLumi[errType][reg][layer]); } - // for (int errType(0); errType != CategoryErrors::N_ERRCATEGORY; ++errType) { - // if (m_allErrsCatePerLumi[errType][reg][layer])LWHist::safeDelete(m_allErrsCatePerLumi[errType][reg][layer]); - // if (m_pallErrsCatePerLumi[errType][reg][layer])LWHist::safeDelete(m_pallErrsCatePerLumi[errType][reg][layer]); - // } } } - - free(m_nErrors_buf); - free(m_nLinksWithErrors_buf); } // ==================================================================================================== @@ -527,7 +506,6 @@ StatusCode SCTErrMonTool::bookHistogramsRecurrent() StatusCode SCTErrMonTool::fillHistograms() { - typedef SCT_RDORawData SCTRawDataType; SG::ReadHandle<xAOD::EventInfo> pEvent(m_eventInfoKey); if (not pEvent.isValid()) { ATH_MSG_WARNING("Could not retrieve event info!"); @@ -562,25 +540,21 @@ SCTErrMonTool::fillHistograms() { int numFirstHit_ECm = 0, numSecondHit_ECm = 0, numSCTRDOs_ECm = 0; int count_SCT_RDO = 0; - // Use new IDC - SCT_RDO_Container::const_iterator lastCol = p_rdocontainer->end(); - for (SCT_RDO_Container::const_iterator col_it = p_rdocontainer->begin(); col_it != lastCol; ++col_it) { - const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection(*col_it); - if (!SCT_Collection) continue; // select only SCT RDOs - - DataVector<SCTRawDataType>::const_iterator p_rdo_end = SCT_Collection->end(); + for (const InDetRawDataCollection<SCT_RDORawData>*SCT_Collection: *p_rdocontainer) { + if (SCT_Collection==nullptr) continue; // select only SCT RDOs - Identifier SCT_Identifier = SCT_Collection->identify(); - for (DataVector<SCTRawDataType>::const_iterator p_rdo = SCT_Collection->begin(); p_rdo != p_rdo_end; ++p_rdo) { + for (const SCT_RDORawData* rdo: *SCT_Collection) { count_SCT_RDO++; - const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData*>(*p_rdo); - SCT_Identifier = (*p_rdo)->identify(); + const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData*>(rdo); + if (rdo3==nullptr) continue; + + Identifier SCT_Identifier = rdo3->identify(); int barrel_ec = m_pSCTHelper->barrel_ec(SCT_Identifier); if (barrel_ec == BARREL) ++numSCTRDOs; if (barrel_ec == ENDCAP_A && m_doPositiveEndcap) ++numSCTRDOs_ECp; if (barrel_ec == ENDCAP_C && m_doNegativeEndcap) ++numSCTRDOs_ECm; - if ( !(SCT_Identifier.is_valid())) { + if (not SCT_Identifier.is_valid()) { ATH_MSG_ERROR("The SCT identifier is not valid."); return StatusCode::RECOVERABLE; } @@ -603,19 +577,19 @@ SCTErrMonTool::fillHistograms() { }// end for (SCT_RDO_Container... if (numSCTRDOs != 0) { - double scale = 100. / double(numSCTRDOs); - m_firstHit[iBARREL]->Fill(double(numFirstHit)*scale, 1.); - m_secondHit[iBARREL]->Fill(double(numSecondHit)*scale, 1.); + double scale = 100. / static_cast<double>(numSCTRDOs); + m_firstHit[iBARREL]->Fill(static_cast<double>(numFirstHit)*scale, 1.); + m_secondHit[iBARREL]->Fill(static_cast<double>(numSecondHit)*scale, 1.); } if (numSCTRDOs_ECp != 0 && m_doPositiveEndcap) { - double scale = 100. / double(numSCTRDOs_ECp); - m_firstHit[iECp]->Fill(double(numFirstHit_ECp)*scale, 1.); - m_secondHit[iECp]->Fill(double(numSecondHit_ECp)*scale, 1.); + double scale = 100. / static_cast<double>(numSCTRDOs_ECp); + m_firstHit[iECp]->Fill(static_cast<double>(numFirstHit_ECp)*scale, 1.); + m_secondHit[iECp]->Fill(static_cast<double>(numSecondHit_ECp)*scale, 1.); } if (numSCTRDOs_ECm != 0 && m_doNegativeEndcap) { - double scale = 100. / double(numSCTRDOs_ECm); - m_firstHit[iECm]->Fill(double(numFirstHit_ECm)*scale, 1.); - m_secondHit[iECm]->Fill(double(numSecondHit_ECm)*scale, 1.); + double scale = 100. / static_cast<double>(numSCTRDOs_ECm); + m_firstHit[iECm]->Fill(static_cast<double>(numFirstHit_ECm)*scale, 1.); + m_secondHit[iECm]->Fill(static_cast<double>(numSecondHit_ECm)*scale, 1.); } if (m_environment == AthenaMonManager::online) { if (m_numberOfEvents == 1 || (m_numberOfEvents > 1 && (m_numberOfEvents % m_checkrate) == 0)) { @@ -673,7 +647,7 @@ SCTErrMonTool::checkRateHists() { content = m_numErrorsPerLumi[reg]->GetBinContent(xb, yb); if (num_modules > 0) { m_rateErrorsPerLumi[reg]->Fill(cxb, cyb, 1, content); - m_rateErrorsPerLumi[reg]->Fill(cxb, cyb, 0, (evt_lumi * ((double) num_modules) - content)); + m_rateErrorsPerLumi[reg]->Fill(cxb, cyb, 0, (evt_lumi * (static_cast<double>(num_modules)) - content)); } } } @@ -799,14 +773,12 @@ SCTErrMonTool::fillByteStreamErrorsHelper(const std::set<IdentifierHash>* errors //--- Count BS errors int nerrors = 0; - std::set<IdentifierHash>::iterator fit = errors->begin(); - std::set<IdentifierHash>::iterator fitEnd = errors->end(); - for (; fit != fitEnd; ++fit) { + for (const IdentifierHash& hash: *errors) { nerrors++; - if (!(fit->is_valid())) continue; + if (not hash.is_valid()) continue; //--- FIll module information with BS error - Identifier fitId = m_pSCTHelper->wafer_id(*fit); + Identifier fitId = m_pSCTHelper->wafer_id(hash); int layer = m_pSCTHelper->layer_disk(fitId); int side = m_pSCTHelper->side(fitId); int barrel_ec = m_pSCTHelper->barrel_ec(fitId); @@ -857,7 +829,7 @@ SCTErrMonTool::fillByteStreamErrorsHelper(const std::set<IdentifierHash>* errors void SCTErrMonTool::numByteStreamErrors(const std::set<IdentifierHash>* errors, int& ntot, int& nbar, int& neca, int& necc) { - for (auto fit: *errors) { + for (const IdentifierHash& fit: *errors) { if (fit.is_valid()) { Identifier fitId = m_pSCTHelper->wafer_id(fit); int layer = m_pSCTHelper->layer_disk(fitId); @@ -900,8 +872,8 @@ SCTErrMonTool::fillByteStreamErrors() { bs_errs[iGEN],bs_errs[iBARREL],bs_errs[iECp],bs_errs[iECm]); // fill number of BS errors vs LBs for (int reg = 0; reg != NREGIONS_INC_GENERAL; ++reg) { - if (!m_sctflag) m_ByteStreamVsLB[errType][reg]->Fill(current_lb, double (bs_errs[reg])); - else m_ByteStreamWithSctFlagVsLB[errType][reg]->Fill(current_lb, double (bs_errs[reg])); + if (!m_sctflag) m_ByteStreamVsLB[errType][reg]->Fill(current_lb, static_cast<double>(bs_errs[reg])); + else m_ByteStreamWithSctFlagVsLB[errType][reg]->Fill(current_lb, static_cast<double>(bs_errs[reg])); } } @@ -1026,7 +998,7 @@ SCTErrMonTool::fillByteStreamErrors() { // below... if (m_numberOfEvents % m_checkrate == 0 && m_runOnline == true) { for (int errType(0); errType != CategoryErrors::N_ERRCATEGORY; ++errType) { - int content = (int) m_pallErrsCate[errType][reg][lyr]->GetBinContent(xb, yb); + int content = static_cast<int>(m_pallErrsCate[errType][reg][lyr]->GetBinContent(xb, yb)); int evt = m_numberOfEvents; m_allErrsCate[errType][reg][lyr]->Fill(cxb, cyb, 1, content); m_allErrsCate[errType][reg][lyr]->Fill(cxb, cyb, 0, evt - content); @@ -1051,12 +1023,12 @@ SCTErrMonTool::fillByteStreamErrors() { for (int reg = 0; reg != NREGIONS_INC_GENERAL; ++reg) { for (int errType(0); errType != CategoryErrors::N_ERRCATEGORY; ++errType) { - m_ByteStreamCategorisedVsLB[errType][reg]->Fill((int) current_lb, (bytestreamCate_errs[errType][reg])); - m_LinksWithCategorisedErrorsVsLB[errType][reg]->Fill((int) current_lb, (tot_mod_bytestreamCate_errs[errType][reg])); + m_ByteStreamCategorisedVsLB[errType][reg]->Fill(current_lb, (bytestreamCate_errs[errType][reg])); + m_LinksWithCategorisedErrorsVsLB[errType][reg]->Fill(current_lb, (tot_mod_bytestreamCate_errs[errType][reg])); if (reg==NREGIONS_INC_GENERAL-1)continue; int nLayers = n_layers[reg]*2; for (int lyr = 0; lyr != nLayers; ++lyr) { - m_LinksWithCategorisedErrorsVsLBLayer[errType][reg][lyr]->Fill((int) current_lb, + m_LinksWithCategorisedErrorsVsLBLayer[errType][reg][lyr]->Fill(current_lb, (tot_mod_bytestreamCate_errs_layer[errType][reg][lyr])); } } @@ -1209,8 +1181,8 @@ SCTErrMonTool::bookErrHistos(int reg=-1) { // reg = 0:EC, 1:B, 2:EA m_rateErrorsPerLumi[reg]->GetXaxis()->SetBinLabel(bin+1, SCT_ByteStreamErrors::errorTypesDescription[bin].c_str()); } for ( int bin(0); bin < nLayers; bin++) { - m_numErrorsPerLumi[reg]->GetYaxis()->SetBinLabel(bin+1, (std::to_string(int(bin/2)) +"_"+ std::to_string(int(bin%2))).c_str()); - m_rateErrorsPerLumi[reg]->GetYaxis()->SetBinLabel(bin+1, (std::to_string(int(bin/2)) +"_"+ std::to_string(int(bin%2))).c_str()); + m_numErrorsPerLumi[reg]->GetYaxis()->SetBinLabel(bin+1, (std::to_string(static_cast<int>(bin/2)) +"_"+ std::to_string(static_cast<int>(bin%2))).c_str()); + m_rateErrorsPerLumi[reg]->GetYaxis()->SetBinLabel(bin+1, (std::to_string(static_cast<int>(bin/2)) +"_"+ std::to_string(static_cast<int>(bin%2))).c_str()); } bool somethingFailed(false); if (m_doErr2DPerLumiHists) { @@ -1311,10 +1283,8 @@ SCTErrMonTool::bookErrHistosGen() { m_evtsbins, 1, m_evtsbins + 1); m_nLinksWithErrors->GetXaxis()->SetTitle("Event Number"); m_nLinksWithErrors->GetYaxis()->SetTitle("Num of Links with Errors"); - size_t nErrors_buf_size; - nErrors_buf_size = m_evtsbins * sizeof(int); - m_nErrors_buf = (int*) malloc(nErrors_buf_size); - m_nLinksWithErrors_buf = (int*) malloc(nErrors_buf_size); + m_nErrors_buf.reserve(m_evtsbins); + m_nLinksWithErrors_buf.reserve(m_evtsbins); m_nErrors_pos = 0; if (Errors.regHist(m_nErrors).isFailure()) { ATH_MSG_WARNING("Couldn't book nErrors vs event number hist"); @@ -1430,8 +1400,8 @@ SCTErrMonTool::bookConfMapsGen() { int nLayers = n_layers[reg]*2; for (int layer(0); layer != nLayers; ++layer) { m_LinksWithCategorisedErrorsVsLBLayer[errType][reg][layer] = - TProfile_LW::create("SCT_LinksWith" + errorsString(errType) + "VsLbs" + regLabel[reg] + "lyr" + std::to_string(int(layer/2)) + "_" + std::to_string(int(layer%2)), - "Ave. num of links with " + errorsString(errType) + " per LB in " + regTitle[reg] + " layer" + std::to_string(int(layer/2)) + "_" + std::to_string(int(layer%2)), + TProfile_LW::create("SCT_LinksWith" + errorsString(errType) + "VsLbs" + regLabel[reg] + "lyr" + std::to_string(static_cast<int>(layer/2)) + "_" + std::to_string(static_cast<int>(layer%2)), + "Ave. num of links with " + errorsString(errType) + " per LB in " + regTitle[reg] + " layer" + std::to_string(static_cast<int>(layer/2)) + "_" + std::to_string(static_cast<int>(layer%2)), NBINS_LBs, 0.5, NBINS_LBs + 0.5); m_LinksWithCategorisedErrorsVsLBLayer[errType][reg][layer]->GetXaxis()->SetTitle("LumiBlock"); } @@ -1503,7 +1473,7 @@ SCTErrMonTool::bookConfMapsGen() { int nLayers = n_layers[reg]*2; for (int layer(0); layer != nLayers; ++layer) { if (ConfHist[reg].regHist(m_LinksWithCategorisedErrorsVsLBLayer[errType][reg][layer]).isFailure()) { - ATH_MSG_WARNING("Cannot book Histogram:SCTLinksWith" + errorsString(errType) + "VsLbs" + regLabel[reg] + "lyr" + std::to_string(int(layer/2)) + "_" + std::to_string(int(layer%2)) << "with SCT flag"); + ATH_MSG_WARNING("Cannot book Histogram:SCTLinksWith" + errorsString(errType) + "VsLbs" + regLabel[reg] + "lyr" + std::to_string(static_cast<int>(layer/2)) + "_" + std::to_string(static_cast<int>(layer%2)) << "with SCT flag"); } } } @@ -1553,11 +1523,11 @@ SCTErrMonTool::bookConfMaps(int reg=-1) { // reg = 0:EC, 1:B, 2:EA MonGroup confMaps(this, ("SCT/"+regName+"/Conf").c_str(), ManagedMonitorToolBase::run, ATTRIB_UNMANAGED); m_p2DmapHistoVectorAll[reg].clear(); for (int layer(0); layer != nLayers; ++layer) { - std::string mapName = "modulemap" + std::string(subDetNameShort[reg].Data()) + std::to_string(int(layer/2)) + "_" + std::to_string(int(layer%2)); + std::string mapName = "modulemap" + std::string(subDetNameShort[reg].Data()) + std::to_string(static_cast<int>(layer/2)) + "_" + std::to_string(static_cast<int>(layer%2)); TH2F_LW* hitsHisto_tmp = TH2F_LW::create(TString(mapName.c_str()), TString(("Module Out of Configuration : "+std::string(subDetName[reg].Data())+", "+ - std::string(layerName[reg].Data())+" "+std::to_string(int(layer/2))+ - " side "+std::to_string(int(layer%2))).c_str()), + std::string(layerName[reg].Data())+" "+std::to_string(static_cast<int>(layer/2))+ + " side "+std::to_string(static_cast<int>(layer%2))).c_str()), n_etabins[reg], f_etabin[reg] - 0.5, l_etabin[reg] + 0.5, n_phibins[reg], f_phibin[reg] - 0.5, l_phibin[reg] + 0.5); hitsHisto_tmp->GetXaxis()->SetTitle("Index in the direction of #eta"); @@ -1583,8 +1553,8 @@ SCTErrMonTool::fillCondDBMaps() { 0 }; int MaskedAllLinks[4] = { - (int) m_MaskedAllLinks->GetBinContent(1), (int) m_MaskedAllLinks->GetBinContent(2), - (int) m_MaskedAllLinks->GetBinContent(3), (int) m_MaskedAllLinks->GetBinContent(4) + static_cast<int>(m_MaskedAllLinks->GetBinContent(1)), static_cast<int>(m_MaskedAllLinks->GetBinContent(2)), + static_cast<int>(m_MaskedAllLinks->GetBinContent(3)), static_cast<int>(m_MaskedAllLinks->GetBinContent(4)) }; int ModErr[4] = { 0 @@ -1609,7 +1579,6 @@ SCTErrMonTool::fillCondDBMaps() { std::string stem; SCT_ID::const_id_iterator planeIterator(m_pSCTHelper->wafer_begin()); SCT_ID::const_id_iterator planeEnd = m_pSCTHelper->wafer_end(); - for (; planeIterator not_eq planeEnd; ++planeIterator) { Identifier planeId(*planeIterator); int eta = m_pSCTHelper->eta_module(planeId); @@ -1693,38 +1662,38 @@ SCTErrMonTool::fillCondDBMaps() { if (m_makeConfHisto) { for (int reg = 0; reg <= 3; ++reg) { - m_Conf[reg]->Fill(0., double (MOut[reg])); - m_ConfRN[reg]->Fill(0., double (MOut[reg])); - m_ConfOutModules[reg]->Fill(0., double (MOut[reg])); - m_Conf[reg]->Fill(1., double (Flagged[reg])); - m_ConfRN[reg]->Fill(1., double (Flagged[reg])); - m_ConfNew[reg]->Fill(0., double (Flagged[reg])); - m_Conf[reg]->Fill(2., double (MaskedAllLinks[reg])); - m_ConfRN[reg]->Fill(2., double (MaskedAllLinks[reg])); - m_ConfNew[reg]->Fill(1., double (MaskedAllLinks[reg])); - m_Conf[reg]->Fill(3., double (ModErr[reg])); - m_ConfRN[reg]->Fill(3., double (ModErr[reg])); - m_ConfNew[reg]->Fill(2., double (ModErr[reg])); - m_Conf[reg]->Fill(4., double (InEffModules[reg])); - m_ConfRN[reg]->Fill(4., double (InEffModules[reg])); - m_ConfNew[reg]->Fill(3., double (InEffModules[reg])); - m_Conf[reg]->Fill(5., double (NoisyModules[reg])); - m_ConfRN[reg]->Fill(5., double (RNoisyModules[reg])); - m_ConfNew[reg]->Fill(4., double (NoisyModules[reg])); + m_Conf[reg]->Fill(0., static_cast<double>(MOut[reg])); + m_ConfRN[reg]->Fill(0., static_cast<double>(MOut[reg])); + m_ConfOutModules[reg]->Fill(0., static_cast<double>(MOut[reg])); + m_Conf[reg]->Fill(1., static_cast<double>(Flagged[reg])); + m_ConfRN[reg]->Fill(1., static_cast<double>(Flagged[reg])); + m_ConfNew[reg]->Fill(0., static_cast<double>(Flagged[reg])); + m_Conf[reg]->Fill(2., static_cast<double>(MaskedAllLinks[reg])); + m_ConfRN[reg]->Fill(2., static_cast<double>(MaskedAllLinks[reg])); + m_ConfNew[reg]->Fill(1., static_cast<double>(MaskedAllLinks[reg])); + m_Conf[reg]->Fill(3., static_cast<double>(ModErr[reg])); + m_ConfRN[reg]->Fill(3., static_cast<double>(ModErr[reg])); + m_ConfNew[reg]->Fill(2., static_cast<double>(ModErr[reg])); + m_Conf[reg]->Fill(4., static_cast<double>(InEffModules[reg])); + m_ConfRN[reg]->Fill(4., static_cast<double>(InEffModules[reg])); + m_ConfNew[reg]->Fill(3., static_cast<double>(InEffModules[reg])); + m_Conf[reg]->Fill(5., static_cast<double>(NoisyModules[reg])); + m_ConfRN[reg]->Fill(5., static_cast<double>(RNoisyModules[reg])); + m_ConfNew[reg]->Fill(4., static_cast<double>(NoisyModules[reg])); if (m_environment == AthenaMonManager::online) { - m_ConfOnline[reg]->Fill(0., double (MOut[reg])); - m_ConfOnline[reg]->Fill(1., double (Flagged[reg])); - m_ConfOnline[reg]->Fill(2., double (MaskedAllLinks[reg])); - m_ConfOnline[reg]->Fill(3., double (ModErr[reg])); + m_ConfOnline[reg]->Fill(0., static_cast<double>(MOut[reg])); + m_ConfOnline[reg]->Fill(1., static_cast<double>(Flagged[reg])); + m_ConfOnline[reg]->Fill(2., static_cast<double>(MaskedAllLinks[reg])); + m_ConfOnline[reg]->Fill(3., static_cast<double>(ModErr[reg])); } } if (m_environment == AthenaMonManager::online || testOffline) { m_ConfEffOnline->Reset("ICE"); for (int i(0); i != 4; ++i) { const float f(i); - m_ConfEffOnline->Fill(f, double (InEffModules[i])); - m_ConfNoiseOnline->Fill(f, double (NoisyModules[i])); - m_ConfNoiseOnlineRecent->Fill(f, double (NoisyModulesRecent[i])); + m_ConfEffOnline->Fill(f, static_cast<double>(InEffModules[i])); + m_ConfNoiseOnline->Fill(f, static_cast<double>(NoisyModules[i])); + m_ConfNoiseOnlineRecent->Fill(f, static_cast<double>(NoisyModulesRecent[i])); } } } @@ -1739,9 +1708,9 @@ StatusCode SCTErrMonTool::fillConfigurationDetails() { ATH_MSG_DEBUG("Inside fillConfigurationDetails()"); unsigned int nBadMods = m_ConfigurationTool->badModules()->size(); // bad modules - const std::map<IdentifierHash, std::pair<bool, bool> > *badLinks = m_ConfigurationTool->badLinks(); // bad links + const std::map<IdentifierHash, std::pair<bool, bool>> *badLinks = m_ConfigurationTool->badLinks(); // bad links unsigned int nBadLink0(0), nBadLink1(0), nBadLinkBoth(0); - for (auto link: *badLinks) { + for (const std::pair<IdentifierHash, std::pair<bool, bool>>& link: *badLinks) { std::pair<bool, bool> status = link.second; if (status.first == false && status.second == true) { ++nBadLink0; @@ -1756,7 +1725,7 @@ SCTErrMonTool::fillConfigurationDetails() { const std::map<Identifier, unsigned int>* badChips = m_ConfigurationTool->badChips(); // bad chips unsigned int nBadChips(0); - for (auto chip : *badChips) { + for (const std::pair<Identifier, unsigned int>& chip : *badChips) { unsigned int status = chip.second; for (unsigned int i(0); i != CHIPS_PER_MODULE; i++) { nBadChips += ((status & (1 << i)) == 0 ? 0 : 1); @@ -1773,16 +1742,16 @@ SCTErrMonTool::fillConfigurationDetails() { int nBadStripsExclusiveBEC[] = { 0, 0, 0 }; - for (auto strip: badStripsExclusive) { + for (const Identifier& strip: badStripsExclusive) { int bec(m_pSCTHelper->barrel_ec(strip)); nBadStripsExclusiveBEC[SCT_Monitoring::bec2Index(bec)] += 1; } - m_DetailedConfiguration->Fill(0., double (nBadMods)); - m_DetailedConfiguration->Fill(1., double (nBadLink0)); - m_DetailedConfiguration->Fill(2., double (nBadLink1)); - m_DetailedConfiguration->Fill(3., double (nBadChips)); - m_DetailedConfiguration->Fill(4., double (nBadStripsExclusive) / 100.); + m_DetailedConfiguration->Fill(0., static_cast<double>(nBadMods)); + m_DetailedConfiguration->Fill(1., static_cast<double>(nBadLink0)); + m_DetailedConfiguration->Fill(2., static_cast<double>(nBadLink1)); + m_DetailedConfiguration->Fill(3., static_cast<double>(nBadChips)); + m_DetailedConfiguration->Fill(4., static_cast<double>(nBadStripsExclusive) / 100.); ATH_MSG_DEBUG("-----------------------------------------------------------------------"); ATH_MSG_DEBUG("Number of bad modules = " << nBadMods); @@ -2131,6 +2100,6 @@ double SCTErrMonTool::calculateDetectorCoverage( const TH2F* histo ) } } } - detector_coverage = 100. * double( occupancy )/( double( m_nBinsEta ) * double ( m_nBinsPhi ) ); + detector_coverage = 100. * static_cast<double>( occupancy )/( static_cast<double>( m_nBinsEta ) * static_cast<double>( m_nBinsPhi ) ); return detector_coverage; } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx index 088d69aa7a9fcb5fd884a778343b5d36bd6e6bdf..53144e5a99f7b1e572fd002f0be5fd40a1793a32 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx @@ -43,12 +43,12 @@ #include "TGraphErrors.h" // std and STL includes -#include <cmath> -#include <sstream> -#include <limits> #include <algorithm> -#include <limits> // std::numeric_limits #include <array> +#include <cmath> +#include <limits> // std::numeric_limits +#include <memory> +#include <sstream> using namespace SCT_Monitoring; @@ -104,41 +104,9 @@ using std::string; // Constructor with parameters: SCTHitEffMonTool::SCTHitEffMonTool(const string& type, const string& name, const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), - m_TrackName(std::string("ResolvedSCTTracks")),// original track collection m_chrono(nullptr), m_badChips(nullptr), m_fieldServiceHandle("AtlasFieldSvc", name), - m_bunchCrossingTool("Trig::BunchCrossingTool/BunchCrossingTool", this), - m_DetectorMode(1), // Barrel = 1, endcap =2, both =3 - m_RunningMode(2), - m_minPixelHits(-1), - m_minTRTHits(-1), - m_minSCTHits(-1), // If all 3 of these -1, defaults depend on cosmic/not - m_minOtherHits(6), - m_maxPhiAngle(40.), // Degrees, 100 implies no cut. - m_maxChi2(3.), - m_maxD0(10.), // mm of D0 - m_minPt(1000.), // minimu pt in MeV/c - m_effdistcut(2.), - m_maxZ0sinTheta(0.), - m_maxTracks(500.), - m_insideOutOnly(false), - m_usemasks(true), - m_detailed(false), - m_superDetailed(false), - m_isCosmic(false), - m_isSim(false), - m_useTRTPhase(false), - m_useSCTorTRT(false), - m_requireEnclosingHits(false), - m_requireOtherFace(false), - m_requireGuardRing(false), // should be returned to true - m_vetoBadChips(true), - m_chronotime(false), - m_useIDGlobal(false), - m_residualPullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator", this), - m_rotcreator("InDet::SCT_ClusterOnTrackTool/SCT_ClusterOnTrackTool", this), - m_holeSearchTool("InDet::InDetTrackHoleSearchTool", this), m_Eff_Total(nullptr), m_Eff_TotalBCID(nullptr), m_Eff_hashCodeHisto(nullptr), @@ -164,48 +132,39 @@ SCTHitEffMonTool::SCTHitEffMonTool(const string& type, const string& name, const m_badModFineMap(nullptr), m_badModMap(nullptr), m_badChipMap(nullptr), + m_countEvent{0}, m_pixelId(nullptr), m_sctId(nullptr), - m_trtId(nullptr), - m_comTimeName(std::string("TRT_Phase")), - m_eventInfoKey(std::string("EventInfo")){ - declareProperty("TrackName", m_TrackName); - declareProperty("IsCosmic", m_isCosmic); - declareProperty("IsSim", m_isSim); - declareProperty("UseMasks", m_usemasks); - declareProperty("Detailed", m_detailed); - declareProperty("SuperDetailed", m_superDetailed); - declareProperty("UseTRTPhase", m_useTRTPhase); - declareProperty("MaxPhiAngle", m_maxPhiAngle); - declareProperty("MinTRTHits", m_minTRTHits); - declareProperty("MinSCTHits", m_minSCTHits); - declareProperty("MinPixelHits", m_minPixelHits); - declareProperty("UseSCTorTRT", m_useSCTorTRT); - declareProperty("MinOtherHits", m_minOtherHits); - declareProperty("InsideOutOnly", m_insideOutOnly); - declareProperty("MaxChi2", m_maxChi2); - declareProperty("Maxd0", m_maxD0); - declareProperty("MaxZ0sinTheta", m_maxZ0sinTheta); - declareProperty("MaxTracks", m_maxTracks); - declareProperty("MinPt", m_minPt); - declareProperty("RequireEnclosingHits", m_requireEnclosingHits); - declareProperty("RequireOtherFace", m_requireOtherFace); - declareProperty("RequireGuardRing", m_requireGuardRing); - declareProperty("VetoBadChips", m_vetoBadChips); - declareProperty("LookAtDatabase", m_usedatabase); - declareProperty("DetectorMode", m_DetectorMode); - declareProperty("RunningMode", m_RunningMode); - declareProperty("effDistanceCut", m_effdistcut); - declareProperty("ChronoTime", m_chronotime); - declareProperty("SCT_ClusterContainer", m_sctContainerName = std::string("SCT_Clusters")); - declareProperty("ROTCreator", m_rotcreator); - declareProperty("HoleSearch", m_holeSearchTool); - declareProperty("ResPullCalc", m_residualPullCalculator); - declareProperty("useIDGlobal", m_useIDGlobal); + m_trtId(nullptr) { + declareProperty("IsCosmic", m_isCosmic=false); + declareProperty("IsSim", m_isSim=false); + declareProperty("UseMasks", m_usemasks=false); + declareProperty("Detailed", m_detailed=false); + declareProperty("SuperDetailed", m_superDetailed=false); + declareProperty("UseTRTPhase", m_useTRTPhase=false); + declareProperty("MaxPhiAngle", m_maxPhiAngle=40., "Degrees, 100 implies no cut."); + declareProperty("MinTRTHits", m_minTRTHits=-1); + declareProperty("MinSCTHits", m_minSCTHits=-1, "If all 3 of these -1, defaults depend on cosmic/not"); + declareProperty("MinPixelHits", m_minPixelHits=-1); + declareProperty("UseSCTorTRT", m_useSCTorTRT=false); + declareProperty("MinOtherHits", m_minOtherHits=6); + declareProperty("InsideOutOnly", m_insideOutOnly=false); + declareProperty("MaxChi2", m_maxChi2=3.); + declareProperty("Maxd0", m_maxD0=10., "mm of D0"); + declareProperty("MaxZ0sinTheta", m_maxZ0sinTheta=0.); + declareProperty("MaxTracks", m_maxTracks=500.); + declareProperty("MinPt", m_minPt=1000., "minimu pt in MeV/c"); + declareProperty("RequireEnclosingHits", m_requireEnclosingHits=false); + declareProperty("RequireOtherFace", m_requireOtherFace=false); + declareProperty("RequireGuardRing", m_requireGuardRing=false, "should be returned to true"); + declareProperty("VetoBadChips", m_vetoBadChips=true); + declareProperty("LookAtDatabase", m_usedatabase=false); + declareProperty("DetectorMode", m_DetectorMode=3, "Barrel = 1, endcap =2, both =3"); + declareProperty("RunningMode", m_RunningMode=2); + declareProperty("effDistanceCut", m_effdistcut=2.); + declareProperty("ChronoTime", m_chronotime=false); + declareProperty("useIDGlobal", m_useIDGlobal=false); declareProperty("MagFieldSvc", m_fieldServiceHandle); - declareProperty("BunchCrossingTool", m_bunchCrossingTool); - - m_countEvent = 0; m_Eff_summaryHisto.fill(0); m_Eff_summaryHistoFirstBCID.fill(0); @@ -312,22 +271,22 @@ StatusCode SCTHitEffMonTool::initialize() { ATH_MSG_INFO("Initializing SCTHitEffMonTool"); - CHECK(detStore()->retrieve(m_sctId, "SCT_ID")); - CHECK(detStore()->retrieve(m_pixelId, "PixelID")); - CHECK(detStore()->retrieve(m_trtId, "TRT_ID")); + ATH_CHECK(detStore()->retrieve(m_sctId, "SCT_ID")); + ATH_CHECK(detStore()->retrieve(m_pixelId, "PixelID")); + ATH_CHECK(detStore()->retrieve(m_trtId, "TRT_ID")); if (m_chronotime) { - CHECK(service("ChronoStatSvc", m_chrono)); + ATH_CHECK(service("ChronoStatSvc", m_chrono)); } - CHECK(ManagedMonitorToolBase::initialize()); - CHECK(m_holeSearchTool.retrieve()); + ATH_CHECK(ManagedMonitorToolBase::initialize()); + ATH_CHECK(m_holeSearchTool.retrieve()); ATH_MSG_INFO("Retrieved hole search tool " << m_holeSearchTool); - CHECK(m_residualPullCalculator.retrieve()); + ATH_CHECK(m_residualPullCalculator.retrieve()); ATH_MSG_INFO("Retrieved pull calculator tool " << m_residualPullCalculator); - CHECK(m_rotcreator.retrieve()); + ATH_CHECK(m_rotcreator.retrieve()); ATH_MSG_INFO("Retrieved tool " << m_rotcreator); - CHECK(m_fieldServiceHandle.retrieve()); - CHECK(m_bunchCrossingTool.retrieve()); + ATH_CHECK(m_fieldServiceHandle.retrieve()); + ATH_CHECK(m_bunchCrossingTool.retrieve()); ATH_MSG_INFO("Retrieved BunchCrossing tool " << m_bunchCrossingTool); m_path = (m_useIDGlobal) ? ("/InDetGlobal/") : (""); @@ -373,9 +332,8 @@ SCTHitEffMonTool::bookHistograms() { if (newRunFlag()) { m_badChips = m_configConditions->badChips(); ATH_MSG_INFO("Found " << m_badChips->size() << " bad chips"); - for (std::map<Identifier, unsigned int>::const_iterator chip(m_badChips->begin()); chip != m_badChips->end(); - ++chip) { - ATH_MSG_VERBOSE("Module " << m_sctId->wafer_hash(chip->first) << ", chip " << chip->second); + for (const std::pair<Identifier, unsigned int>& chip: *m_badChips) { + ATH_MSG_VERBOSE("Module " << m_sctId->wafer_hash(chip.first) << ", chip " << chip.second); } std::array < MonGroup, N_REGIONS + 1 > histGroupE = {{ @@ -398,63 +356,63 @@ SCTHitEffMonTool::bookHistograms() { MonGroup(this, m_path + histogramPath[GENERAL_INDEX], run, ATTRIB_UNMANAGED) }}; - CHECK(bookEffHisto(m_Eff_Total, histGroupE[GENERAL_INDEX], "SctTotalEff", "SCT Total Efficiency", N_REGIONS, 0, + ATH_CHECK(bookEffHisto(m_Eff_Total, histGroupE[GENERAL_INDEX], "SctTotalEff", "SCT Total Efficiency", N_REGIONS, 0, N_REGIONS)); for (Int_t i(0); i != 3; ++i) { m_Eff_Total->GetXaxis()->SetBinLabel(i + 1, subDetName[i]); } - CHECK(bookEffHisto(m_Eff_TotalBCID, histGroupE[GENERAL_INDEX], "SctTotalEffBCID", + ATH_CHECK(bookEffHisto(m_Eff_TotalBCID, histGroupE[GENERAL_INDEX], "SctTotalEffBCID", "SCT Total Efficiency for First BCID", N_REGIONS, 0, N_REGIONS)); for (Int_t i(0); i != 3; ++i) { m_Eff_TotalBCID->GetXaxis()->SetBinLabel(i + 1, subDetName[i]); } - CHECK(bookEffHisto(m_Eff_hashCodeHisto, histGroupE[GENERAL_INDEX], "effHashCode", "Efficiency vs module Hash code", + ATH_CHECK(bookEffHisto(m_Eff_hashCodeHisto, histGroupE[GENERAL_INDEX], "effHashCode", "Efficiency vs module Hash code", n_mod[GENERAL_INDEX] * 2, -0.5, n_mod[GENERAL_INDEX] * 2 - 0.5)); m_Eff_hashCodeHisto->GetXaxis()->SetTitle("Module Hash Code"); m_Eff_hashCodeHisto->GetYaxis()->SetTitle("Efficiency"); - CHECK(bookEffHisto(m_Eff_LumiBlockHisto_Total, histGroupE[GENERAL_INDEX], "effLumiBlock", + ATH_CHECK(bookEffHisto(m_Eff_LumiBlockHisto_Total, histGroupE[GENERAL_INDEX], "effLumiBlock", "Efficiency vs Luminosity block", NBINS_LBs, 0.5, NBINS_LBs + 0.5)); m_Eff_LumiBlockHisto_Total->GetXaxis()->SetTitle("Luminosity block"); m_Eff_LumiBlockHisto_Total->GetYaxis()->SetTitle("Efficiency"); - CHECK(bookEffHisto(m_effdistribution, histGroupE[GENERAL_INDEX], "SctEffDistribution", + ATH_CHECK(bookEffHisto(m_effdistribution, histGroupE[GENERAL_INDEX], "SctEffDistribution", "SCT Efficiency Distribution", 500, 0, 1)); m_effdistribution->GetXaxis()->SetTitle("Efficiency"); m_effdistribution->GetYaxis()->SetTitle("Links"); if (m_detailed) { - CHECK(bookEffHisto(m_SCTNHitHisto, histGroupE[BARREL_INDEX], "SCTNHit", "Number of total SCT hits", 30, -0.5, + ATH_CHECK(bookEffHisto(m_SCTNHitHisto, histGroupE[BARREL_INDEX], "SCTNHit", "Number of total SCT hits", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_barrelNHitHisto, histGroupE[BARREL_INDEX], "barrelNHit", "Number of hits in B", 30, -0.5, + ATH_CHECK(bookEffHisto(m_barrelNHitHisto, histGroupE[BARREL_INDEX], "barrelNHit", "Number of hits in B", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_pNHitHisto, histGroupE[BARREL_INDEX], "pNHit", "Number of hits in EA", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_mNHitHisto, histGroupE[BARREL_INDEX], "mNHit", "Number of hits in EC", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_trtNHitHisto, histGroupE[BARREL_INDEX], "trtNHit", "Number of TRT hits", 140, -0.5, 139.5)); - CHECK(bookEffHisto(m_pixelNHitHisto, histGroupE[BARREL_INDEX], "pixelNHit", "Number of pixel hits", 30, -0.5, + ATH_CHECK(bookEffHisto(m_pNHitHisto, histGroupE[BARREL_INDEX], "pNHit", "Number of hits in EA", 30, -0.5, 29.5)); + ATH_CHECK(bookEffHisto(m_mNHitHisto, histGroupE[BARREL_INDEX], "mNHit", "Number of hits in EC", 30, -0.5, 29.5)); + ATH_CHECK(bookEffHisto(m_trtNHitHisto, histGroupE[BARREL_INDEX], "trtNHit", "Number of TRT hits", 140, -0.5, 139.5)); + ATH_CHECK(bookEffHisto(m_pixelNHitHisto, histGroupE[BARREL_INDEX], "pixelNHit", "Number of pixel hits", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_hashCodeHisto, histGroupE[BARREL_INDEX], "hashCode", "module Hash code", + ATH_CHECK(bookEffHisto(m_hashCodeHisto, histGroupE[BARREL_INDEX], "hashCode", "module Hash code", n_mod[GENERAL_INDEX] * 2, -0.5, n_mod[GENERAL_INDEX] * 2 - 0.5)); - CHECK(bookEffHisto(m_d0TkHisto, histGroupE[GENERAL], "D0Tk", "Track D0", 50, -500., 500.)); - CHECK(bookEffHisto(m_z0TkHisto, histGroupE[GENERAL], "Z0Tk", "Track Z0", 500, -500., 500.)); - CHECK(bookEffHisto(m_PtTkHisto, histGroupE[GENERAL], "PtTk", "log10 Track Pt", 40, 2., 6.)); - CHECK(bookEffHisto(m_nTrkHisto, histGroupE[GENERAL], "nTrk", "num Tracks", 400, -0.5, 399.5)); - CHECK(bookEffHisto(m_etaTkHisto, histGroupE[GENERAL], "EtaTk", "Track Eta", 100, -2.5, 2.5)); - CHECK(bookEffHisto(m_d0PrecTkHisto, histGroupE[GENERAL], "D0Tk-prec", "Track D0 prec", 100, -25., 25.)); - CHECK(bookEffHisto(m_nTrkParsHisto, histGroupE[GENERAL], "nTrk pars", "num Tracks pars", 400, -0.5, 399.5)); - CHECK(bookEffHisto(m_nTrkGoodHisto, histGroupE[GENERAL], "nTrk good", "num Tracks good", 400, -0.5, 399.5)); + ATH_CHECK(bookEffHisto(m_d0TkHisto, histGroupE[GENERAL], "D0Tk", "Track D0", 50, -500., 500.)); + ATH_CHECK(bookEffHisto(m_z0TkHisto, histGroupE[GENERAL], "Z0Tk", "Track Z0", 500, -500., 500.)); + ATH_CHECK(bookEffHisto(m_PtTkHisto, histGroupE[GENERAL], "PtTk", "log10 Track Pt", 40, 2., 6.)); + ATH_CHECK(bookEffHisto(m_nTrkHisto, histGroupE[GENERAL], "nTrk", "num Tracks", 400, -0.5, 399.5)); + ATH_CHECK(bookEffHisto(m_etaTkHisto, histGroupE[GENERAL], "EtaTk", "Track Eta", 100, -2.5, 2.5)); + ATH_CHECK(bookEffHisto(m_d0PrecTkHisto, histGroupE[GENERAL], "D0Tk-prec", "Track D0 prec", 100, -25., 25.)); + ATH_CHECK(bookEffHisto(m_nTrkParsHisto, histGroupE[GENERAL], "nTrk pars", "num Tracks pars", 400, -0.5, 399.5)); + ATH_CHECK(bookEffHisto(m_nTrkGoodHisto, histGroupE[GENERAL], "nTrk good", "num Tracks good", 400, -0.5, 399.5)); } if (m_superDetailed) { - CHECK(bookEffHisto(m_LumiBlock, histGroupE[GENERAL], "LumiBlocks", "Luminosity blocks", NBINS_LBs, 0.5, NBINS_LBs + 0.5)); - CHECK(bookEffHisto(m_effHashLumiB, histGroupE[GENERAL], "effHashCodeLumiBlock", + ATH_CHECK(bookEffHisto(m_LumiBlock, histGroupE[GENERAL], "LumiBlocks", "Luminosity blocks", NBINS_LBs, 0.5, NBINS_LBs + 0.5)); + ATH_CHECK(bookEffHisto(m_effHashLumiB, histGroupE[GENERAL], "effHashCodeLumiBlock", "Modules efficiencies vs. lumi. block", n_mod[GENERAL_INDEX] * 2, -0.5, n_mod[GENERAL_INDEX] * 2 - 0.5, NBINS_LBs, 0.5, NBINS_LBs + 0.5)); m_badModMap = new TGraphErrors(); m_badModMap->SetName("MapOfDisabledModules"); - CHECK(histGroupE[GENERAL].regGraph(m_badModMap)); + ATH_CHECK(histGroupE[GENERAL].regGraph(m_badModMap)); m_badChipMap = new TGraphErrors(); m_badChipMap->SetName("MapOfDisabledChips"); - CHECK(histGroupE[GENERAL].regGraph(m_badChipMap)); - CHECK(bookEffHisto(m_badModFineMap, histGroupE[GENERAL], "FineMapOfDisabledModules", "", 60, -3, 3, 64, -3.2, + ATH_CHECK(histGroupE[GENERAL].regGraph(m_badChipMap)); + ATH_CHECK(bookEffHisto(m_badModFineMap, histGroupE[GENERAL], "FineMapOfDisabledModules", "", 60, -3, 3, 64, -3.2, 3.2)); } // Booking efficiency maps @@ -497,7 +455,7 @@ SCTHitEffMonTool::bookHistograms() { } for (Long_t j(0); j != 2; ++j) { // book inefficiency histogram - CHECK(bookEffHisto(m_ineffMap[detIndex][j], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_ineffMap[detIndex][j], histGroupE[isub], ineffMapName[isub] + i + "_" + j, "Hit inefficiency of" + layerName[isub] + i + " / side " + j + " in " + subDetName[isub], n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, @@ -506,7 +464,7 @@ SCTHitEffMonTool::bookHistograms() { m_ineffMap[detIndex][j]->GetYaxis()->SetTitle("Index in the direction of #phi"); // - CHECK(bookEffHisto(m_effMap[detIndex][j], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_effMap[detIndex][j], histGroupE[isub], mapName[isub] + i + "_" + j, "Hit efficiency of" + layerName[isub] + i + " / side " + j + " in " + subDetName[isub], n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, @@ -514,7 +472,7 @@ SCTHitEffMonTool::bookHistograms() { m_effMap[detIndex][j]->GetXaxis()->SetTitle("Index in the direction of #eta"); m_effMap[detIndex][j]->GetYaxis()->SetTitle("Index in the direction of #phi"); - CHECK(bookEffHisto(m_effMapFirstBCID[detIndex][j], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_effMapFirstBCID[detIndex][j], histGroupE[isub], mapName[isub] + i + "_" + j + "_bcid", "Hit efficiency of" + layerName[isub] + i + " / side " + j + " in " + subDetName[isub] + " for first BCID", n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, @@ -522,7 +480,7 @@ SCTHitEffMonTool::bookHistograms() { m_effMapFirstBCID[detIndex][j]->GetXaxis()->SetTitle("Index in the direction of #eta"); m_effMapFirstBCID[detIndex][j]->GetYaxis()->SetTitle("Index in the direction of #phi"); - CHECK(bookEffHisto(m_effLumiBlock[detIndex][j], histGroupL[isub], + ATH_CHECK(bookEffHisto(m_effLumiBlock[detIndex][j], histGroupL[isub], effLumiName[isub] + i + "_" + j, "Efficiency vs LumiBlock of" + layerName[isub] + i + " / side " + j + " in " + subDetName[isub], @@ -532,36 +490,36 @@ SCTHitEffMonTool::bookHistograms() { } if (m_superDetailed) { - CHECK(bookEffHisto(m_accMap[detIndex], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_accMap[detIndex], histGroupE[isub], "nDisabledChips_" + subDetNameShort[isub] + "_" + i, "Map of the acceptance for" + layerName[isub] + i + " in " + subDetName[isub], n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, n_phibins[isub], f_phibin[isub] - .5, l_phibin[isub] + .5)); TString resid("xlResidual_"); - CHECK(bookEffHisto(m_xlResidualHisto[isub][i], histGroupE[isub], resid + i, resid + i, + ATH_CHECK(bookEffHisto(m_xlResidualHisto[isub][i], histGroupE[isub], resid + i, resid + i, 100, -30.5, 30.5, 100, -60., 60.)); - CHECK(bookEffHisto(m_xlResidualE0Histo[isub][i], histGroupE[isub], resid + "eta0_" + i, resid + "eta0_" + i, + ATH_CHECK(bookEffHisto(m_xlResidualE0Histo[isub][i], histGroupE[isub], resid + "eta0_" + i, resid + "eta0_" + i, 100, -30.5, 30.5, 100, -60., 60.)); - CHECK(bookEffHisto(m_xlResidualE1Histo[isub][i], histGroupE[isub], resid + "eta1_" + i, resid + "eta1_" + i, + ATH_CHECK(bookEffHisto(m_xlResidualE1Histo[isub][i], histGroupE[isub], resid + "eta1_" + i, resid + "eta1_" + i, 100, -30.5, 30.5, 100, -60., 60.)); - CHECK(bookEffHisto(m_xlResidualUnasHisto[isub][i], histGroupE[isub], resid + "unas_" + i, resid + "unas_" + i, + ATH_CHECK(bookEffHisto(m_xlResidualUnasHisto[isub][i], histGroupE[isub], resid + "unas_" + i, resid + "unas_" + i, 100, -30.5, 30.5, 100, -60., 60.)); - CHECK(bookEffHisto(m_layerResidualHistos[isub][2 * i], histGroupE[isub], TString("residlayer") + i, + ATH_CHECK(bookEffHisto(m_layerResidualHistos[isub][2 * i], histGroupE[isub], TString("residlayer") + i, TString("residlayer") + i, n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, n_phibins[isub], f_phibin[isub] - .5, l_phibin[isub] + .5)); - CHECK(bookEffHisto(m_layerResidualHistos[isub][2 * i + 1], histGroupE[isub], TString("residlayer") + i + ".5", + ATH_CHECK(bookEffHisto(m_layerResidualHistos[isub][2 * i + 1], histGroupE[isub], TString("residlayer") + i + ".5", TString("residlayer") + i + ".5", n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, n_phibins[isub], f_phibin[isub] - .5, l_phibin[isub] + .5)); } } - CHECK(bookEffHisto(m_Eff_summaryHisto[isub], histGroupShift[isub], sumeff[isub], sumefftitle[isub], + ATH_CHECK(bookEffHisto(m_Eff_summaryHisto[isub], histGroupShift[isub], sumeff[isub], sumefftitle[isub], 2 * n_layers[isub], 0., n_layers[isub])); - CHECK(bookEffHisto(m_Eff_summaryHistoFirstBCID[isub], histGroupShift[isub], sumeffBCID[isub], + ATH_CHECK(bookEffHisto(m_Eff_summaryHistoFirstBCID[isub], histGroupShift[isub], sumeffBCID[isub], sumefftitleBCID[isub], 2 * n_layers[isub], 0., n_layers[isub])); - CHECK(bookEffHisto(m_Eff_summaryHisto_old[isub], histGroupShift[isub], sumeff_old[isub], sumefftitle[isub], + ATH_CHECK(bookEffHisto(m_Eff_summaryHisto_old[isub], histGroupShift[isub], sumeff_old[isub], sumefftitle[isub], 2 * n_layers[isub], 0., n_layers[isub])); unsigned int limit[3] = { N_DISKSx2, N_BARRELSx2, N_DISKSx2 @@ -577,139 +535,139 @@ SCTHitEffMonTool::bookHistograms() { m_Eff_summaryHistoFirstBCID[isub]->GetYaxis()->SetTitle("Efficiency"); m_Eff_summaryHisto_old[isub]->GetYaxis()->SetTitle("Efficiency"); - CHECK(bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub], "effLumiBlock", + ATH_CHECK(bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub], "effLumiBlock", "Efficiency vs Luminosity block in " + subDetName[isub], NBINS_LBs, 0.5, NBINS_LBs + 0.5)); m_Eff_LumiBlockHisto[isub]->GetXaxis()->SetTitle("Luminosity block"); m_Eff_LumiBlockHisto[isub]->GetYaxis()->SetTitle("Efficiency"); if (m_detailed) { - CHECK(bookEffHisto(m_nTrkUsedHisto[isub], histGroupE[isub], "nTrk Used", "nTrk used", 50, -0.5, 49.5)); - CHECK(bookEffHisto(m_probEnclosedHisto[isub], histGroupE[isub], "probEnclosed", "Probability Enclosed", + ATH_CHECK(bookEffHisto(m_nTrkUsedHisto[isub], histGroupE[isub], "nTrk Used", "nTrk used", 50, -0.5, 49.5)); + ATH_CHECK(bookEffHisto(m_probEnclosedHisto[isub], histGroupE[isub], "probEnclosed", "Probability Enclosed", 2 * n_layers[isub], -.25, n_layers[isub] - .25)); - CHECK(bookEffHisto(m_EventHisto[isub], histGroupE[isub], "EventNo", "Event No", 800, 0., 40000000.)); - CHECK(bookEffHisto(m_Eff_EventHisto[isub], histGroupE[isub], "effEventNo", "Efficiency v Event no.", 800, 0., + ATH_CHECK(bookEffHisto(m_EventHisto[isub], histGroupE[isub], "EventNo", "Event No", 800, 0., 40000000.)); + ATH_CHECK(bookEffHisto(m_Eff_EventHisto[isub], histGroupE[isub], "effEventNo", "Efficiency v Event no.", 800, 0., 40000000.)); - CHECK(bookEffHisto(m_SelectionHisto[isub], histGroupE[isub], "selectionCuts", "Selection Cuts", 12, -0.5, + ATH_CHECK(bookEffHisto(m_SelectionHisto[isub], histGroupE[isub], "selectionCuts", "Selection Cuts", 12, -0.5, 11.5)); - CHECK(bookEffHisto(m_Eff_SelectionHisto[isub], histGroupE[isub], "effSelectionCuts", + ATH_CHECK(bookEffHisto(m_Eff_SelectionHisto[isub], histGroupE[isub], "effSelectionCuts", "Efficiency v Selection Cuts", 12, -0.5, 11.5)); for (Int_t bin(0); bin != 12; ++bin) { m_SelectionHisto[isub]->GetXaxis()->SetBinLabel(bin + 1, selecName[bin]); m_Eff_SelectionHisto[isub]->GetXaxis()->SetBinLabel(bin + 1, selecName[bin]); } - CHECK(bookEffHisto(m_ResidualHisto[isub], histGroupE[isub], "residuals", "Residuals", 2000, -10, 10)); - CHECK(bookEffHisto(m_ResidualUnasHisto[isub], histGroupE[isub], "residualsUnas", "Residuals Unassociated", 2000, + ATH_CHECK(bookEffHisto(m_ResidualHisto[isub], histGroupE[isub], "residuals", "Residuals", 2000, -10, 10)); + ATH_CHECK(bookEffHisto(m_ResidualUnasHisto[isub], histGroupE[isub], "residualsUnas", "Residuals Unassociated", 2000, -10, 10)); - CHECK(bookEffHisto(m_ResidualMissHisto[isub], histGroupE[isub], "residualsMiss", "Residuals Miss", 2000, -10, + ATH_CHECK(bookEffHisto(m_ResidualMissHisto[isub], histGroupE[isub], "residualsMiss", "Residuals Miss", 2000, -10, 10)); - CHECK(bookEffHisto(m_Unas_summaryHisto[isub], histGroupE[isub], "summaryunas", + ATH_CHECK(bookEffHisto(m_Unas_summaryHisto[isub], histGroupE[isub], "summaryunas", "Summary Module Unassociated Per Event", 2 * 9, 0., 9.)); - CHECK(bookEffHisto(m_chi2Histo[isub], histGroupE[isub], "chi2", "Chi2", 50, 0., 10.)); - CHECK(bookEffHisto(m_Eff_chi2Histo[isub], histGroupE[isub], "effChi2", "Efficiency v Chi2", 25, 0., 10.)); - CHECK(bookEffHisto(m_Eff_chi2HistoFinal[isub], histGroupE[isub], "effChi2Final", "Efficiency v Chi2, Final", 25, + ATH_CHECK(bookEffHisto(m_chi2Histo[isub], histGroupE[isub], "chi2", "Chi2", 50, 0., 10.)); + ATH_CHECK(bookEffHisto(m_Eff_chi2Histo[isub], histGroupE[isub], "effChi2", "Efficiency v Chi2", 25, 0., 10.)); + ATH_CHECK(bookEffHisto(m_Eff_chi2HistoFinal[isub], histGroupE[isub], "effChi2Final", "Efficiency v Chi2, Final", 25, 0., 10.)); - CHECK(bookEffHisto(m_localMissHisto[isub], histGroupE[isub], "localMiss", "local position, hole", 40, -40., 40., + ATH_CHECK(bookEffHisto(m_localMissHisto[isub], histGroupE[isub], "localMiss", "local position, hole", 40, -40., 40., 40, -80., 80.)); - CHECK(bookEffHisto(m_localUnasHisto[isub], histGroupE[isub], "localUnas", "local position, unassociated hit", + ATH_CHECK(bookEffHisto(m_localUnasHisto[isub], histGroupE[isub], "localUnas", "local position, unassociated hit", 40, -40., 40., 40, -80., 80.)); - CHECK(bookEffHisto(m_Eff_etaHisto[isub], histGroupE[isub], "effEta", "Efficiency versus track eta", 30, -2.8, + ATH_CHECK(bookEffHisto(m_Eff_etaHisto[isub], histGroupE[isub], "effEta", "Efficiency versus track eta", 30, -2.8, 2.8)); - CHECK(bookEffHisto(m_Eff_etaPhiCutHisto[isub], histGroupE[isub], "effEtaPhiCut", + ATH_CHECK(bookEffHisto(m_Eff_etaPhiCutHisto[isub], histGroupE[isub], "effEtaPhiCut", "Efficiency versus track eta, phi cut", 30, -2.8, 2.8)); - CHECK(bookEffHisto(m_Eff_otherFaceHisto[isub], histGroupE[isub], "effOtherFace", + ATH_CHECK(bookEffHisto(m_Eff_otherFaceHisto[isub], histGroupE[isub], "effOtherFace", "Efficiency versus other face hit y/n", 3, -1.5, 1.5)); - CHECK(bookEffHisto(m_Unas_otherFaceHisto[isub], histGroupE[isub], "effOtherFaceUnas", + ATH_CHECK(bookEffHisto(m_Unas_otherFaceHisto[isub], histGroupE[isub], "effOtherFaceUnas", "other face hit Unassociated per event", 3, -1.5, 1.5)); - CHECK(bookEffHisto(m_Eff_nSCTHisto[isub], histGroupE[isub], "effNSCT", "Efficiency versus Number of SCT hits", + ATH_CHECK(bookEffHisto(m_Eff_nSCTHisto[isub], histGroupE[isub], "effNSCT", "Efficiency versus Number of SCT hits", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_Eff_nTRTHisto[isub], histGroupE[isub], "effNTRT", "Efficiency versus Number of TRT hits", + ATH_CHECK(bookEffHisto(m_Eff_nTRTHisto[isub], histGroupE[isub], "effNTRT", "Efficiency versus Number of TRT hits", 70, -1, 139.)); - CHECK(bookEffHisto(m_Eff_nOtherHisto[isub], histGroupE[isub], "effNOther", + ATH_CHECK(bookEffHisto(m_Eff_nOtherHisto[isub], histGroupE[isub], "effNOther", "Efficiency versus Number of other SCT sides hit", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_nOtherHisto[isub], histGroupE[isub], "nOther", "Number of other SCT barrel sides hit", 30, + ATH_CHECK(bookEffHisto(m_nOtherHisto[isub], histGroupE[isub], "nOther", "Number of other SCT barrel sides hit", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_timecorHisto[isub], histGroupE[isub], "timecor", "TRT phase", 120, -50.5, 69.5)); - CHECK(bookEffHisto(m_Eff_timecorHisto[isub], histGroupE[isub], "effTimecor", "Efficiency vs TRT phase", 120, + ATH_CHECK(bookEffHisto(m_timecorHisto[isub], histGroupE[isub], "timecor", "TRT phase", 120, -50.5, 69.5)); + ATH_CHECK(bookEffHisto(m_Eff_timecorHisto[isub], histGroupE[isub], "effTimecor", "Efficiency vs TRT phase", 120, -50.5, 69.5)); - CHECK(bookEffHisto(m_Eff_xlocHisto[isub], histGroupE[isub], "effXloc", "Module Efficiency by x local", 32, -32., + ATH_CHECK(bookEffHisto(m_Eff_xlocHisto[isub], histGroupE[isub], "effXloc", "Module Efficiency by x local", 32, -32., 32.)); - CHECK(bookEffHisto(m_Eff_ylocHistos[isub], histGroupE[isub], "effYloc", "Module Efficiency by y local", 32, + ATH_CHECK(bookEffHisto(m_Eff_ylocHistos[isub], histGroupE[isub], "effYloc", "Module Efficiency by y local", 32, -64., 64.)); - CHECK(bookEffHisto(m_Unas_xlocHisto[isub], histGroupE[isub], "unasXloc", + ATH_CHECK(bookEffHisto(m_Unas_xlocHisto[isub], histGroupE[isub], "unasXloc", "Unassociated hit per event by x local", 32, -32., 32.)); - CHECK(bookEffHisto(m_Unas_ylocHisto[isub], histGroupE[isub], "unasYloc", + ATH_CHECK(bookEffHisto(m_Unas_ylocHisto[isub], histGroupE[isub], "unasYloc", "Unassociated hit per event by y local", 32, -64., 64.)); - CHECK(bookEffHisto(m_Eff_ptiHisto[isub], histGroupE[isub], "effPti", "Module Efficiency by q/p", 20, -0.002, + ATH_CHECK(bookEffHisto(m_Eff_ptiHisto[isub], histGroupE[isub], "effPti", "Module Efficiency by q/p", 20, -0.002, 0.002)); - CHECK(bookEffHisto(m_Eff_ptHisto[isub], histGroupE[isub], "effPt", "Module Efficiency by log10 |p|", 40, 2., + ATH_CHECK(bookEffHisto(m_Eff_ptHisto[isub], histGroupE[isub], "effPt", "Module Efficiency by log10 |p|", 40, 2., 6.)); - CHECK(bookEffHisto(m_Unas_ptiHisto[isub], histGroupE[isub], "unasPti", "Unassociated Hit per event by q/p", 20, + ATH_CHECK(bookEffHisto(m_Unas_ptiHisto[isub], histGroupE[isub], "unasPti", "Unassociated Hit per event by q/p", 20, -0.002, 0.002)); - CHECK(bookEffHisto(m_Unas_phiHisto[isub], histGroupE[isub], "unasPhi", + ATH_CHECK(bookEffHisto(m_Unas_phiHisto[isub], histGroupE[isub], "unasPhi", "Unassociated hit per event by phi local", 30, -90., 90.)); - CHECK(bookEffHisto(m_Eff_phiHisto[isub], histGroupE[isub], "effPhi", "Module Efficiency by Phi", 30, -90., + ATH_CHECK(bookEffHisto(m_Eff_phiHisto[isub], histGroupE[isub], "effPhi", "Module Efficiency by Phi", 30, -90., 90.)); - CHECK(bookEffHisto(m_Eff_phiEtaCutHisto[isub], histGroupE[isub], "effPhiEtaCut", + ATH_CHECK(bookEffHisto(m_Eff_phiEtaCutHisto[isub], histGroupE[isub], "effPhiEtaCut", "Module Efficiency by Phi, Eta cut", 30, -90., 90.)); - CHECK(bookEffHisto(m_Eff_phiHistoFinal[isub], histGroupE[isub], "effPhiFinal", "Module Efficiency by Phi Final", + ATH_CHECK(bookEffHisto(m_Eff_phiHistoFinal[isub], histGroupE[isub], "effPhiFinal", "Module Efficiency by Phi Final", 30, -90., 90.)); - CHECK(bookEffHisto(m_Eff_d0Histo[isub], histGroupE[isub], "effD0", "Module Efficiency by D0", 10, -500., 500.)); - CHECK(bookEffHisto(m_Eff_d0PrecHisto[isub], histGroupE[isub], "effD0Prec", "Module Efficiency by D0 prec", 25, + ATH_CHECK(bookEffHisto(m_Eff_d0Histo[isub], histGroupE[isub], "effD0", "Module Efficiency by D0", 10, -500., 500.)); + ATH_CHECK(bookEffHisto(m_Eff_d0PrecHisto[isub], histGroupE[isub], "effD0Prec", "Module Efficiency by D0 prec", 25, -25., 25.)); - CHECK(bookEffHisto(m_Eff_z0Histo[isub], histGroupE[isub], "effZ0", "Module Efficiency by Z0", 10, -1000., + ATH_CHECK(bookEffHisto(m_Eff_z0Histo[isub], histGroupE[isub], "effZ0", "Module Efficiency by Z0", 10, -1000., 1000.)); - CHECK(bookEffHisto(m_etaTkUsedHisto[isub], histGroupE[isub], "EtaTkUsed", "Used Track Eta", 100, -2.8, 2.8)); - CHECK(bookEffHisto(m_phiTkUsedHisto[isub], histGroupE[isub], "PhiTkUsed", "Used Track Phi", 50, -3.142, 3.142)); - CHECK(bookEffHisto(m_ptiTkUsedHisto[isub], histGroupE[isub], "PtiTkUsed", "Used Track q/p (MeV)", 50, -0.002, + ATH_CHECK(bookEffHisto(m_etaTkUsedHisto[isub], histGroupE[isub], "EtaTkUsed", "Used Track Eta", 100, -2.8, 2.8)); + ATH_CHECK(bookEffHisto(m_phiTkUsedHisto[isub], histGroupE[isub], "PhiTkUsed", "Used Track Phi", 50, -3.142, 3.142)); + ATH_CHECK(bookEffHisto(m_ptiTkUsedHisto[isub], histGroupE[isub], "PtiTkUsed", "Used Track q/p (MeV)", 50, -0.002, 0.002)); - CHECK(bookEffHisto(m_ptTkUsedHisto[isub], histGroupE[isub], "PtTkUsed", "Used Track log10|p| (MeV)", 40, 2.0, + ATH_CHECK(bookEffHisto(m_ptTkUsedHisto[isub], histGroupE[isub], "PtTkUsed", "Used Track log10|p| (MeV)", 40, 2.0, 6.)); - CHECK(bookEffHisto(m_d0TkUsedHisto[isub], histGroupE[isub], "D0TkUsed", "Used Track D0", 50, -500., 500.)); - CHECK(bookEffHisto(m_d0PrecTkUsedHisto[isub], histGroupE[isub], "D0PrecTkUsed", "Used Track D0 prec", 100, -25., + ATH_CHECK(bookEffHisto(m_d0TkUsedHisto[isub], histGroupE[isub], "D0TkUsed", "Used Track D0", 50, -500., 500.)); + ATH_CHECK(bookEffHisto(m_d0PrecTkUsedHisto[isub], histGroupE[isub], "D0PrecTkUsed", "Used Track D0 prec", 100, -25., 25.)); - CHECK(bookEffHisto(m_z0TkUsedHisto[isub], histGroupE[isub], "Z0TkUsed", "Used Track Z0", 50, -1000., 1000.)); - CHECK(bookEffHisto(m_localHitXHisto[isub], histGroupE[isub], "localHitX", "local x position, hit", 80, -40., + ATH_CHECK(bookEffHisto(m_z0TkUsedHisto[isub], histGroupE[isub], "Z0TkUsed", "Used Track Z0", 50, -1000., 1000.)); + ATH_CHECK(bookEffHisto(m_localHitXHisto[isub], histGroupE[isub], "localHitX", "local x position, hit", 80, -40., 40.)); - CHECK(bookEffHisto(m_localHitYHistos[isub], histGroupE[isub], "localHitY", "local y position, hit", 320, -80., + ATH_CHECK(bookEffHisto(m_localHitYHistos[isub], histGroupE[isub], "localHitY", "local y position, hit", 320, -80., 80.)); - CHECK(bookEffHisto(m_phiLocalHisto[isub], histGroupE[isub], "phiLocal", "local phi of tracks", 60, -90., 90.)); - CHECK(bookEffHisto(m_phiLocalCutHisto[isub], histGroupE[isub], "phiLocalCut", "local phi of low D0 tracks", 60, + ATH_CHECK(bookEffHisto(m_phiLocalHisto[isub], histGroupE[isub], "phiLocal", "local phi of tracks", 60, -90., 90.)); + ATH_CHECK(bookEffHisto(m_phiLocalCutHisto[isub], histGroupE[isub], "phiLocalCut", "local phi of low D0 tracks", 60, -90., 90.)); - CHECK(bookEffHisto(m_Eff_nTrk[isub], histGroupE[isub], "effTrk", "Efficiency versus number of tracks", 200, 0, + ATH_CHECK(bookEffHisto(m_Eff_nTrk[isub], histGroupE[isub], "effTrk", "Efficiency versus number of tracks", 200, 0, 400.)); - CHECK(bookEffHisto(m_Eff_nGoodTrk[isub], histGroupE[isub], "effGoodTrk", + ATH_CHECK(bookEffHisto(m_Eff_nGoodTrk[isub], histGroupE[isub], "effGoodTrk", "Efficiency versus number of good tracks", 200, 0, 400.)); } if (m_superDetailed) { // CHECK (bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub],"effLumiBlock", "Efficiency v Luminosity // block",1000,1,1001)); - CHECK(bookEffHisto(m_inEffStrip[isub], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_inEffStrip[isub], histGroupE[isub], "StripInEfficiency" + subDetNameShort[isub], "Strips inefficiencies in " + subDetName[isub], n_mod[isub] * 2, f_mod[isub] * 2 - 0.5, (f_mod[isub] + n_mod[isub]) * 2 - 0.5, N_STRIPS, FIRST_STRIP - 0.5, LAST_STRIP + 0.5)); - CHECK(bookEffHisto(m_inEffChip[isub], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_inEffChip[isub], histGroupE[isub], "ChipInEfficiency" + subDetNameShort[isub], "Chips ineficiencies in " + subDetName[isub], n_mod[isub] * 2, f_mod[isub] * 2 - 0.5, (f_mod[isub] + n_mod[isub]) * 2 - 0.5, N_CHIPS, FIRST_CHIP - 0.5, LAST_CHIP + 0.5)); - CHECK(bookEffHisto(m_badModPerSide[isub], histGroupE[isub], "badModPerSide", "Number of bad module per side", + ATH_CHECK(bookEffHisto(m_badModPerSide[isub], histGroupE[isub], "badModPerSide", "Number of bad module per side", 2 * n_layers[isub], 0., n_layers[isub])); - CHECK(bookEffHisto(m_holesPerTrackHisto[isub], histGroupE[isub], "holesPerTrack", "Number of holes per track", + ATH_CHECK(bookEffHisto(m_holesPerTrackHisto[isub], histGroupE[isub], "holesPerTrack", "Number of holes per track", 2 * n_layers[isub], 0, n_layers[isub])); - CHECK(bookEffHisto(m_holesDistPerTrackHisto[isub], histGroupE[isub], "holesDistPerTrack", + ATH_CHECK(bookEffHisto(m_holesDistPerTrackHisto[isub], histGroupE[isub], "holesDistPerTrack", "Number of holes per track", 2 * n_layers[isub], 0, n_layers[isub])); - CHECK(bookEffHisto(m_chi2vPhiHisto[isub], histGroupE[isub], "Chi2vPhi", "Chi2 v Phi", 30, -90., 90.)); - CHECK(bookEffHisto(m_localHitHisto[isub], histGroupE[isub], "localHit", "local position, hit", 40, -40., 40., + ATH_CHECK(bookEffHisto(m_chi2vPhiHisto[isub], histGroupE[isub], "Chi2vPhi", "Chi2 v Phi", 30, -90., 90.)); + ATH_CHECK(bookEffHisto(m_localHitHisto[isub], histGroupE[isub], "localHit", "local position, hit", 40, -40., 40., 40, -80., 80.)); - CHECK(bookEffHisto(m_localHitGHisto[isub], histGroupE[isub], "localHitG", "local position Guard, hit", 40, -40., + ATH_CHECK(bookEffHisto(m_localHitGHisto[isub], histGroupE[isub], "localHitG", "local position Guard, hit", 40, -40., 40., 40, -80., 80.)); - CHECK(bookEffHisto(m_TwoSidesResiduals[isub], histGroupE[isub], "TwoSidesResiduals", "Two Sides Residuals", 120, + ATH_CHECK(bookEffHisto(m_TwoSidesResiduals[isub], histGroupE[isub], "TwoSidesResiduals", "Two Sides Residuals", 120, -3., 3., 120, -3., 3.)); - CHECK(bookEffHisto(m_TwoSidesResidualsIneff[isub], histGroupE[isub], "TwoSidesResidualsIneff", + ATH_CHECK(bookEffHisto(m_TwoSidesResidualsIneff[isub], histGroupE[isub], "TwoSidesResidualsIneff", "Two Sides Residuals (Inefficient/Unas)", 120, -30., 30., 120, -30., 30.)); - CHECK(bookEffHisto(m_chi2ResidualHisto[isub], histGroupE[isub], "chi2Residual", "Chi2 v Residual", 200, -10., + ATH_CHECK(bookEffHisto(m_chi2ResidualHisto[isub], histGroupE[isub], "chi2Residual", "Chi2 v Residual", 200, -10., 10., 120, 0., 10.)); - CHECK(bookEffHisto(m_Eff_summaryIncBadMod[isub], histGroupE[isub], "summaryIncBadMod" + subDetNameShort[isub], + ATH_CHECK(bookEffHisto(m_Eff_summaryIncBadMod[isub], histGroupE[isub], "summaryIncBadMod" + subDetNameShort[isub], "Efficiency vs. layer including bad sensors", 2 * n_layers[isub], 0., n_layers[isub])); } @@ -730,9 +688,8 @@ SCTHitEffMonTool::bookHistogramsRecurrent() { if (newRunFlag()) { m_badChips = m_configConditions->badChips(); ATH_MSG_INFO("Found " << m_badChips->size() << " bad chips"); - for (std::map<Identifier, unsigned int>::const_iterator chip(m_badChips->begin()); chip != m_badChips->end(); - ++chip) { - ATH_MSG_VERBOSE("Module " << m_sctId->wafer_hash(chip->first) << ", chip " << chip->second); + for (const std::pair<Identifier, unsigned int>& chip: *m_badChips) { + ATH_MSG_VERBOSE("Module " << m_sctId->wafer_hash(chip.first) << ", chip " << chip.second); } std::array < MonGroup, N_REGIONS + 1 > histGroupE = {{ @@ -755,57 +712,57 @@ SCTHitEffMonTool::bookHistogramsRecurrent() { MonGroup(this, m_path + histogramPath[GENERAL_INDEX], run, ATTRIB_UNMANAGED) }}; - CHECK(bookEffHisto(m_Eff_Total, histGroupE[GENERAL_INDEX], "SctTotalEff", "SCT Total Efficiency", N_REGIONS, 0, + ATH_CHECK(bookEffHisto(m_Eff_Total, histGroupE[GENERAL_INDEX], "SctTotalEff", "SCT Total Efficiency", N_REGIONS, 0, N_REGIONS)); for (Int_t i(0); i != 3; ++i) { m_Eff_Total->GetXaxis()->SetBinLabel(i + 1, subDetName[i]); } - CHECK(bookEffHisto(m_Eff_TotalBCID, histGroupE[GENERAL_INDEX], "SctTotalEffBCID", + ATH_CHECK(bookEffHisto(m_Eff_TotalBCID, histGroupE[GENERAL_INDEX], "SctTotalEffBCID", "SCT Total Efficiency for First BCID", N_REGIONS, 0, N_REGIONS)); for (Int_t i(0); i != 3; ++i) { m_Eff_TotalBCID->GetXaxis()->SetBinLabel(i + 1, subDetName[i]); } - CHECK(bookEffHisto(m_Eff_hashCodeHisto, histGroupE[GENERAL_INDEX], "effHashCode", "Efficiency vs module Hash code", + ATH_CHECK(bookEffHisto(m_Eff_hashCodeHisto, histGroupE[GENERAL_INDEX], "effHashCode", "Efficiency vs module Hash code", n_mod[GENERAL_INDEX] * 2, -0.5, n_mod[GENERAL_INDEX] * 2 - 0.5)); m_Eff_hashCodeHisto->GetXaxis()->SetTitle("Module Hash Code"); m_Eff_hashCodeHisto->GetYaxis()->SetTitle("Efficiency"); - CHECK(bookEffHisto(m_Eff_LumiBlockHisto_Total, histGroupE[GENERAL_INDEX], "effLumiBlock", + ATH_CHECK(bookEffHisto(m_Eff_LumiBlockHisto_Total, histGroupE[GENERAL_INDEX], "effLumiBlock", "Efficiency vs Luminosity block", NBINS_LBs, 0.5, NBINS_LBs + 0.5)); if (m_detailed) { - CHECK(bookEffHisto(m_SCTNHitHisto, histGroupE[BARREL_INDEX], "SCTNHit", "Number of total SCT hits", 30, -0.5, + ATH_CHECK(bookEffHisto(m_SCTNHitHisto, histGroupE[BARREL_INDEX], "SCTNHit", "Number of total SCT hits", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_barrelNHitHisto, histGroupE[BARREL_INDEX], "barrelNHit", "Number of hits in B", 30, -0.5, + ATH_CHECK(bookEffHisto(m_barrelNHitHisto, histGroupE[BARREL_INDEX], "barrelNHit", "Number of hits in B", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_pNHitHisto, histGroupE[BARREL_INDEX], "pNHit", "Number of hits in EA", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_mNHitHisto, histGroupE[BARREL_INDEX], "mNHit", "Number of hits in EC", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_trtNHitHisto, histGroupE[BARREL_INDEX], "trtNHit", "Number of TRT hits", 140, -0.5, 139.5)); - CHECK(bookEffHisto(m_pixelNHitHisto, histGroupE[BARREL_INDEX], "pixelNHit", "Number of pixel hits", 30, -0.5, + ATH_CHECK(bookEffHisto(m_pNHitHisto, histGroupE[BARREL_INDEX], "pNHit", "Number of hits in EA", 30, -0.5, 29.5)); + ATH_CHECK(bookEffHisto(m_mNHitHisto, histGroupE[BARREL_INDEX], "mNHit", "Number of hits in EC", 30, -0.5, 29.5)); + ATH_CHECK(bookEffHisto(m_trtNHitHisto, histGroupE[BARREL_INDEX], "trtNHit", "Number of TRT hits", 140, -0.5, 139.5)); + ATH_CHECK(bookEffHisto(m_pixelNHitHisto, histGroupE[BARREL_INDEX], "pixelNHit", "Number of pixel hits", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_hashCodeHisto, histGroupE[BARREL_INDEX], "hashCode", "module Hash code", + ATH_CHECK(bookEffHisto(m_hashCodeHisto, histGroupE[BARREL_INDEX], "hashCode", "module Hash code", n_mod[GENERAL_INDEX] * 2, -0.5, n_mod[GENERAL_INDEX] * 2 - 0.5)); - CHECK(bookEffHisto(m_d0TkHisto, histGroupE[GENERAL], "D0Tk", "Track D0", 50, -500., 500.)); - CHECK(bookEffHisto(m_z0TkHisto, histGroupE[GENERAL], "Z0Tk", "Track Z0", 500, -500., 500.)); - CHECK(bookEffHisto(m_PtTkHisto, histGroupE[GENERAL], "PtTk", "log10 Track Pt", 40, 2., 6.)); - CHECK(bookEffHisto(m_nTrkHisto, histGroupE[GENERAL], "nTrk", "num Tracks", 400, -0.5, 399.5)); - CHECK(bookEffHisto(m_etaTkHisto, histGroupE[GENERAL], "EtaTk", "Track Eta", 100, -2.5, 2.5)); - CHECK(bookEffHisto(m_d0PrecTkHisto, histGroupE[GENERAL], "D0Tk-prec", "Track D0 prec", 100, -25., 25.)); - CHECK(bookEffHisto(m_nTrkParsHisto, histGroupE[GENERAL], "nTrk pars", "num Tracks pars", 400, -0.5, 399.5)); - CHECK(bookEffHisto(m_nTrkGoodHisto, histGroupE[GENERAL], "nTrk good", "num Tracks good", 400, -0.5, 399.5)); + ATH_CHECK(bookEffHisto(m_d0TkHisto, histGroupE[GENERAL], "D0Tk", "Track D0", 50, -500., 500.)); + ATH_CHECK(bookEffHisto(m_z0TkHisto, histGroupE[GENERAL], "Z0Tk", "Track Z0", 500, -500., 500.)); + ATH_CHECK(bookEffHisto(m_PtTkHisto, histGroupE[GENERAL], "PtTk", "log10 Track Pt", 40, 2., 6.)); + ATH_CHECK(bookEffHisto(m_nTrkHisto, histGroupE[GENERAL], "nTrk", "num Tracks", 400, -0.5, 399.5)); + ATH_CHECK(bookEffHisto(m_etaTkHisto, histGroupE[GENERAL], "EtaTk", "Track Eta", 100, -2.5, 2.5)); + ATH_CHECK(bookEffHisto(m_d0PrecTkHisto, histGroupE[GENERAL], "D0Tk-prec", "Track D0 prec", 100, -25., 25.)); + ATH_CHECK(bookEffHisto(m_nTrkParsHisto, histGroupE[GENERAL], "nTrk pars", "num Tracks pars", 400, -0.5, 399.5)); + ATH_CHECK(bookEffHisto(m_nTrkGoodHisto, histGroupE[GENERAL], "nTrk good", "num Tracks good", 400, -0.5, 399.5)); } if (m_superDetailed) { - CHECK(bookEffHisto(m_LumiBlock, histGroupE[GENERAL], "LumiBlocks", "Luminosity blocks", NBINS_LBs, 0.5, NBINS_LBs + 0.5)); - CHECK(bookEffHisto(m_effHashLumiB, histGroupE[GENERAL], "effHashCodeLumiBlock", + ATH_CHECK(bookEffHisto(m_LumiBlock, histGroupE[GENERAL], "LumiBlocks", "Luminosity blocks", NBINS_LBs, 0.5, NBINS_LBs + 0.5)); + ATH_CHECK(bookEffHisto(m_effHashLumiB, histGroupE[GENERAL], "effHashCodeLumiBlock", "Modules efficiencies vs. lumi. block", n_mod[GENERAL_INDEX] * 2, -0.5, n_mod[GENERAL_INDEX] * 2 - 0.5, NBINS_LBs, 0.5, NBINS_LBs + 0.5)); m_badModMap = new TGraphErrors(); m_badModMap->SetName("MapOfDisabledModules"); - CHECK(histGroupE[GENERAL].regGraph(m_badModMap)); + ATH_CHECK(histGroupE[GENERAL].regGraph(m_badModMap)); m_badChipMap = new TGraphErrors(); m_badChipMap->SetName("MapOfDisabledChips"); - CHECK(histGroupE[GENERAL].regGraph(m_badChipMap)); - CHECK(bookEffHisto(m_badModFineMap, histGroupE[GENERAL], "FineMapOfDisabledModules", "", 60, -3, 3, 64, -3.2, + ATH_CHECK(histGroupE[GENERAL].regGraph(m_badChipMap)); + ATH_CHECK(bookEffHisto(m_badModFineMap, histGroupE[GENERAL], "FineMapOfDisabledModules", "", 60, -3, 3, 64, -3.2, 3.2)); } // Booking efficiency maps @@ -849,7 +806,7 @@ SCTHitEffMonTool::bookHistogramsRecurrent() { } for (Long_t j(0); j != 2; ++j) { // book inefficiency histogram - CHECK(bookEffHisto(m_ineffMap[detIndex][j], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_ineffMap[detIndex][j], histGroupE[isub], ineffMapName[isub] + i + "_" + j, "Hit inefficiency of" + layerName[isub] + i + " / side " + j + " in " + subDetName[isub], n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, @@ -858,7 +815,7 @@ SCTHitEffMonTool::bookHistogramsRecurrent() { m_ineffMap[detIndex][j]->GetYaxis()->SetTitle("Index in the direction of #phi"); // - CHECK(bookEffHisto(m_effMap[detIndex][j], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_effMap[detIndex][j], histGroupE[isub], mapName[isub] + i + "_" + j, "Hit efficiency of" + layerName[isub] + i + " / side " + j + " in " + subDetName[isub], n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, @@ -866,7 +823,7 @@ SCTHitEffMonTool::bookHistogramsRecurrent() { m_effMap[detIndex][j]->GetXaxis()->SetTitle("Index in the direction of #eta"); m_effMap[detIndex][j]->GetYaxis()->SetTitle("Index in the direction of #phi"); - CHECK(bookEffHisto(m_effMapFirstBCID[detIndex][j], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_effMapFirstBCID[detIndex][j], histGroupE[isub], mapName[isub] + i + "_" + j + "_bcid", "Hit efficiency of" + layerName[isub] + i + " / side " + j + " in " + subDetName[isub] + " for first BCID", n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, @@ -874,7 +831,7 @@ SCTHitEffMonTool::bookHistogramsRecurrent() { m_effMapFirstBCID[detIndex][j]->GetXaxis()->SetTitle("Index in the direction of #eta"); m_effMapFirstBCID[detIndex][j]->GetYaxis()->SetTitle("Index in the direction of #phi"); - CHECK(bookEffHisto(m_effLumiBlock[detIndex][j], histGroupL[isub], + ATH_CHECK(bookEffHisto(m_effLumiBlock[detIndex][j], histGroupL[isub], effLumiName[isub] + i + "_" + j, "Efficiency vs LumiBlock" + layerName[isub] + i + " / side " + j + " in " + subDetName[isub], @@ -883,36 +840,36 @@ SCTHitEffMonTool::bookHistogramsRecurrent() { m_effLumiBlock[detIndex][j]->GetYaxis()->SetTitle("Efficiency"); } if (m_superDetailed) { - CHECK(bookEffHisto(m_accMap[detIndex], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_accMap[detIndex], histGroupE[isub], "nDisabledChips_" + subDetNameShort[isub] + "_" + i, "Map of the acceptance for" + layerName[isub] + i + " in " + subDetName[isub], n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, n_phibins[isub], f_phibin[isub] - .5, l_phibin[isub] + .5)); TString resid("xlResidual_"); - CHECK(bookEffHisto(m_xlResidualHisto[isub][i], histGroupE[isub], resid + i, resid + i, + ATH_CHECK(bookEffHisto(m_xlResidualHisto[isub][i], histGroupE[isub], resid + i, resid + i, 100, -30.5, 30.5, 100, -60., 60.)); - CHECK(bookEffHisto(m_xlResidualE0Histo[isub][i], histGroupE[isub], resid + "eta0_" + i, resid + "eta0_" + i, + ATH_CHECK(bookEffHisto(m_xlResidualE0Histo[isub][i], histGroupE[isub], resid + "eta0_" + i, resid + "eta0_" + i, 100, -30.5, 30.5, 100, -60., 60.)); - CHECK(bookEffHisto(m_xlResidualE1Histo[isub][i], histGroupE[isub], resid + "eta1_" + i, resid + "eta1_" + i, + ATH_CHECK(bookEffHisto(m_xlResidualE1Histo[isub][i], histGroupE[isub], resid + "eta1_" + i, resid + "eta1_" + i, 100, -30.5, 30.5, 100, -60., 60.)); - CHECK(bookEffHisto(m_xlResidualUnasHisto[isub][i], histGroupE[isub], resid + "unas_" + i, resid + "unas_" + i, + ATH_CHECK(bookEffHisto(m_xlResidualUnasHisto[isub][i], histGroupE[isub], resid + "unas_" + i, resid + "unas_" + i, 100, -30.5, 30.5, 100, -60., 60.)); - CHECK(bookEffHisto(m_layerResidualHistos[isub][2 * i], histGroupE[isub], TString("residlayer") + i, + ATH_CHECK(bookEffHisto(m_layerResidualHistos[isub][2 * i], histGroupE[isub], TString("residlayer") + i, TString("residlayer") + i, n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, n_phibins[isub], f_phibin[isub] - .5, l_phibin[isub] + .5)); - CHECK(bookEffHisto(m_layerResidualHistos[isub][2 * i + 1], histGroupE[isub], TString("residlayer") + i + ".5", + ATH_CHECK(bookEffHisto(m_layerResidualHistos[isub][2 * i + 1], histGroupE[isub], TString("residlayer") + i + ".5", TString("residlayer") + i + ".5", n_etabins[isub], f_etabin[isub] - .5, l_etabin[isub] + .5, n_phibins[isub], f_phibin[isub] - .5, l_phibin[isub] + .5)); } } - CHECK(bookEffHisto(m_Eff_summaryHisto[isub], histGroupShift[isub], sumeff[isub], sumefftitle[isub], + ATH_CHECK(bookEffHisto(m_Eff_summaryHisto[isub], histGroupShift[isub], sumeff[isub], sumefftitle[isub], 2 * n_layers[isub], 0., n_layers[isub])); - CHECK(bookEffHisto(m_Eff_summaryHistoFirstBCID[isub], histGroupShift[isub], sumeffBCID[isub], + ATH_CHECK(bookEffHisto(m_Eff_summaryHistoFirstBCID[isub], histGroupShift[isub], sumeffBCID[isub], sumefftitleBCID[isub], 2 * n_layers[isub], 0., n_layers[isub])); - CHECK(bookEffHisto(m_Eff_summaryHisto_old[isub], histGroupShift[isub], sumeff_old[isub], sumefftitle[isub], + ATH_CHECK(bookEffHisto(m_Eff_summaryHisto_old[isub], histGroupShift[isub], sumeff_old[isub], sumefftitle[isub], 2 * n_layers[isub], 0., n_layers[isub])); unsigned int limit[3] = { N_DISKSx2, N_BARRELSx2, N_DISKSx2 @@ -926,137 +883,137 @@ SCTHitEffMonTool::bookHistogramsRecurrent() { m_Eff_summaryHisto[isub]->GetYaxis()->SetTitle("Efficiency"); m_Eff_summaryHistoFirstBCID[isub]->GetYaxis()->SetTitle("Efficiency"); m_Eff_summaryHisto_old[isub]->GetYaxis()->SetTitle("Efficiency"); - CHECK(bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub], "effLumiBlock", + ATH_CHECK(bookEffHisto(m_Eff_LumiBlockHisto[isub], histGroupE[isub], "effLumiBlock", "Efficiency vs Luminosity block in " + subDetName[isub], NBINS_LBs, 0.5, NBINS_LBs + 0.5)); m_Eff_LumiBlockHisto[isub]->GetXaxis()->SetTitle("Luminosity block"); m_Eff_LumiBlockHisto[isub]->GetYaxis()->SetTitle("Efficiency"); if (m_detailed) { - CHECK(bookEffHisto(m_nTrkUsedHisto[isub], histGroupE[isub], "nTrk Used", "nTrk used", 50, -0.5, 49.5)); - CHECK(bookEffHisto(m_probEnclosedHisto[isub], histGroupE[isub], "probEnclosed", "Probability Enclosed", + ATH_CHECK(bookEffHisto(m_nTrkUsedHisto[isub], histGroupE[isub], "nTrk Used", "nTrk used", 50, -0.5, 49.5)); + ATH_CHECK(bookEffHisto(m_probEnclosedHisto[isub], histGroupE[isub], "probEnclosed", "Probability Enclosed", 2 * n_layers[isub], -.25, n_layers[isub] - .25)); - CHECK(bookEffHisto(m_EventHisto[isub], histGroupE[isub], "EventNo", "Event No", 800, 0., 40000000.)); - CHECK(bookEffHisto(m_Eff_EventHisto[isub], histGroupE[isub], "effEventNo", "Efficiency v Event no.", 800, 0., + ATH_CHECK(bookEffHisto(m_EventHisto[isub], histGroupE[isub], "EventNo", "Event No", 800, 0., 40000000.)); + ATH_CHECK(bookEffHisto(m_Eff_EventHisto[isub], histGroupE[isub], "effEventNo", "Efficiency v Event no.", 800, 0., 40000000.)); - CHECK(bookEffHisto(m_SelectionHisto[isub], histGroupE[isub], "selectionCuts", "Selection Cuts", 12, -0.5, + ATH_CHECK(bookEffHisto(m_SelectionHisto[isub], histGroupE[isub], "selectionCuts", "Selection Cuts", 12, -0.5, 11.5)); - CHECK(bookEffHisto(m_Eff_SelectionHisto[isub], histGroupE[isub], "effSelectionCuts", + ATH_CHECK(bookEffHisto(m_Eff_SelectionHisto[isub], histGroupE[isub], "effSelectionCuts", "Efficiency v Selection Cuts", 12, -0.5, 11.5)); for (Int_t bin(0); bin != 12; ++bin) { m_SelectionHisto[isub]->GetXaxis()->SetBinLabel(bin + 1, selecName[bin]); m_Eff_SelectionHisto[isub]->GetXaxis()->SetBinLabel(bin + 1, selecName[bin]); } - CHECK(bookEffHisto(m_ResidualHisto[isub], histGroupE[isub], "residuals", "Residuals", 2000, -10, 10)); - CHECK(bookEffHisto(m_ResidualUnasHisto[isub], histGroupE[isub], "residualsUnas", "Residuals Unassociated", 2000, + ATH_CHECK(bookEffHisto(m_ResidualHisto[isub], histGroupE[isub], "residuals", "Residuals", 2000, -10, 10)); + ATH_CHECK(bookEffHisto(m_ResidualUnasHisto[isub], histGroupE[isub], "residualsUnas", "Residuals Unassociated", 2000, -10, 10)); - CHECK(bookEffHisto(m_ResidualMissHisto[isub], histGroupE[isub], "residualsMiss", "Residuals Miss", 2000, -10, + ATH_CHECK(bookEffHisto(m_ResidualMissHisto[isub], histGroupE[isub], "residualsMiss", "Residuals Miss", 2000, -10, 10)); - CHECK(bookEffHisto(m_Unas_summaryHisto[isub], histGroupE[isub], "summaryunas", + ATH_CHECK(bookEffHisto(m_Unas_summaryHisto[isub], histGroupE[isub], "summaryunas", "Summary Module Unassociated Per Event", 2 * 9, 0., 9.)); - CHECK(bookEffHisto(m_chi2Histo[isub], histGroupE[isub], "chi2", "Chi2", 50, 0., 10.)); - CHECK(bookEffHisto(m_Eff_chi2Histo[isub], histGroupE[isub], "effChi2", "Efficiency v Chi2", 25, 0., 10.)); - CHECK(bookEffHisto(m_Eff_chi2HistoFinal[isub], histGroupE[isub], "effChi2Final", "Efficiency v Chi2, Final", 25, + ATH_CHECK(bookEffHisto(m_chi2Histo[isub], histGroupE[isub], "chi2", "Chi2", 50, 0., 10.)); + ATH_CHECK(bookEffHisto(m_Eff_chi2Histo[isub], histGroupE[isub], "effChi2", "Efficiency v Chi2", 25, 0., 10.)); + ATH_CHECK(bookEffHisto(m_Eff_chi2HistoFinal[isub], histGroupE[isub], "effChi2Final", "Efficiency v Chi2, Final", 25, 0., 10.)); - CHECK(bookEffHisto(m_localMissHisto[isub], histGroupE[isub], "localMiss", "local position, hole", 40, -40., 40., + ATH_CHECK(bookEffHisto(m_localMissHisto[isub], histGroupE[isub], "localMiss", "local position, hole", 40, -40., 40., 40, -80., 80.)); - CHECK(bookEffHisto(m_localUnasHisto[isub], histGroupE[isub], "localUnas", "local position, unassociated hit", + ATH_CHECK(bookEffHisto(m_localUnasHisto[isub], histGroupE[isub], "localUnas", "local position, unassociated hit", 40, -40., 40., 40, -80., 80.)); - CHECK(bookEffHisto(m_Eff_etaHisto[isub], histGroupE[isub], "effEta", "Efficiency versus track eta", 30, -2.8, + ATH_CHECK(bookEffHisto(m_Eff_etaHisto[isub], histGroupE[isub], "effEta", "Efficiency versus track eta", 30, -2.8, 2.8)); - CHECK(bookEffHisto(m_Eff_etaPhiCutHisto[isub], histGroupE[isub], "effEtaPhiCut", + ATH_CHECK(bookEffHisto(m_Eff_etaPhiCutHisto[isub], histGroupE[isub], "effEtaPhiCut", "Efficiency versus track eta, phi cut", 30, -2.8, 2.8)); - CHECK(bookEffHisto(m_Eff_otherFaceHisto[isub], histGroupE[isub], "effOtherFace", + ATH_CHECK(bookEffHisto(m_Eff_otherFaceHisto[isub], histGroupE[isub], "effOtherFace", "Efficiency versus other face hit y/n", 3, -1.5, 1.5)); - CHECK(bookEffHisto(m_Unas_otherFaceHisto[isub], histGroupE[isub], "effOtherFaceUnas", + ATH_CHECK(bookEffHisto(m_Unas_otherFaceHisto[isub], histGroupE[isub], "effOtherFaceUnas", "other face hit Unassociated per event", 3, -1.5, 1.5)); - CHECK(bookEffHisto(m_Eff_nSCTHisto[isub], histGroupE[isub], "effNSCT", "Efficiency versus Number of SCT hits", + ATH_CHECK(bookEffHisto(m_Eff_nSCTHisto[isub], histGroupE[isub], "effNSCT", "Efficiency versus Number of SCT hits", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_Eff_nTRTHisto[isub], histGroupE[isub], "effNTRT", "Efficiency versus Number of TRT hits", + ATH_CHECK(bookEffHisto(m_Eff_nTRTHisto[isub], histGroupE[isub], "effNTRT", "Efficiency versus Number of TRT hits", 70, -1, 139.)); - CHECK(bookEffHisto(m_Eff_nOtherHisto[isub], histGroupE[isub], "effNOther", + ATH_CHECK(bookEffHisto(m_Eff_nOtherHisto[isub], histGroupE[isub], "effNOther", "Efficiency versus Number of other SCT sides hit", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_nOtherHisto[isub], histGroupE[isub], "nOther", "Number of other SCT barrel sides hit", 30, + ATH_CHECK(bookEffHisto(m_nOtherHisto[isub], histGroupE[isub], "nOther", "Number of other SCT barrel sides hit", 30, -0.5, 29.5)); - CHECK(bookEffHisto(m_timecorHisto[isub], histGroupE[isub], "timecor", "TRT phase", 120, -50.5, 69.5)); - CHECK(bookEffHisto(m_Eff_timecorHisto[isub], histGroupE[isub], "effTimecor", "Efficiency vs TRT phase", 120, + ATH_CHECK(bookEffHisto(m_timecorHisto[isub], histGroupE[isub], "timecor", "TRT phase", 120, -50.5, 69.5)); + ATH_CHECK(bookEffHisto(m_Eff_timecorHisto[isub], histGroupE[isub], "effTimecor", "Efficiency vs TRT phase", 120, -50.5, 69.5)); - CHECK(bookEffHisto(m_Eff_xlocHisto[isub], histGroupE[isub], "effXloc", "Module Efficiency by x local", 32, -32., + ATH_CHECK(bookEffHisto(m_Eff_xlocHisto[isub], histGroupE[isub], "effXloc", "Module Efficiency by x local", 32, -32., 32.)); - CHECK(bookEffHisto(m_Eff_ylocHistos[isub], histGroupE[isub], "effYloc", "Module Efficiency by y local", 32, + ATH_CHECK(bookEffHisto(m_Eff_ylocHistos[isub], histGroupE[isub], "effYloc", "Module Efficiency by y local", 32, -64., 64.)); - CHECK(bookEffHisto(m_Unas_xlocHisto[isub], histGroupE[isub], "unasXloc", + ATH_CHECK(bookEffHisto(m_Unas_xlocHisto[isub], histGroupE[isub], "unasXloc", "Unassociated hit per event by x local", 32, -32., 32.)); - CHECK(bookEffHisto(m_Unas_ylocHisto[isub], histGroupE[isub], "unasYloc", + ATH_CHECK(bookEffHisto(m_Unas_ylocHisto[isub], histGroupE[isub], "unasYloc", "Unassociated hit per event by y local", 32, -64., 64.)); - CHECK(bookEffHisto(m_Eff_ptiHisto[isub], histGroupE[isub], "effPti", "Module Efficiency by q/p", 20, -0.002, + ATH_CHECK(bookEffHisto(m_Eff_ptiHisto[isub], histGroupE[isub], "effPti", "Module Efficiency by q/p", 20, -0.002, 0.002)); - CHECK(bookEffHisto(m_Eff_ptHisto[isub], histGroupE[isub], "effPt", "Module Efficiency by log10 |p|", 40, 2., + ATH_CHECK(bookEffHisto(m_Eff_ptHisto[isub], histGroupE[isub], "effPt", "Module Efficiency by log10 |p|", 40, 2., 6.)); - CHECK(bookEffHisto(m_Unas_ptiHisto[isub], histGroupE[isub], "unasPti", "Unassociated Hit per event by q/p", 20, + ATH_CHECK(bookEffHisto(m_Unas_ptiHisto[isub], histGroupE[isub], "unasPti", "Unassociated Hit per event by q/p", 20, -0.002, 0.002)); - CHECK(bookEffHisto(m_Unas_phiHisto[isub], histGroupE[isub], "unasPhi", + ATH_CHECK(bookEffHisto(m_Unas_phiHisto[isub], histGroupE[isub], "unasPhi", "Unassociated hit per event by phi local", 30, -90., 90.)); - CHECK(bookEffHisto(m_Eff_phiHisto[isub], histGroupE[isub], "effPhi", "Module Efficiency by Phi", 30, -90., + ATH_CHECK(bookEffHisto(m_Eff_phiHisto[isub], histGroupE[isub], "effPhi", "Module Efficiency by Phi", 30, -90., 90.)); - CHECK(bookEffHisto(m_Eff_phiEtaCutHisto[isub], histGroupE[isub], "effPhiEtaCut", + ATH_CHECK(bookEffHisto(m_Eff_phiEtaCutHisto[isub], histGroupE[isub], "effPhiEtaCut", "Module Efficiency by Phi, Eta cut", 30, -90., 90.)); - CHECK(bookEffHisto(m_Eff_phiHistoFinal[isub], histGroupE[isub], "effPhiFinal", "Module Efficiency by Phi Final", + ATH_CHECK(bookEffHisto(m_Eff_phiHistoFinal[isub], histGroupE[isub], "effPhiFinal", "Module Efficiency by Phi Final", 30, -90., 90.)); - CHECK(bookEffHisto(m_Eff_d0Histo[isub], histGroupE[isub], "effD0", "Module Efficiency by D0", 10, -500., 500.)); - CHECK(bookEffHisto(m_Eff_d0PrecHisto[isub], histGroupE[isub], "effD0Prec", "Module Efficiency by D0 prec", 25, + ATH_CHECK(bookEffHisto(m_Eff_d0Histo[isub], histGroupE[isub], "effD0", "Module Efficiency by D0", 10, -500., 500.)); + ATH_CHECK(bookEffHisto(m_Eff_d0PrecHisto[isub], histGroupE[isub], "effD0Prec", "Module Efficiency by D0 prec", 25, -25., 25.)); - CHECK(bookEffHisto(m_Eff_z0Histo[isub], histGroupE[isub], "effZ0", "Module Efficiency by Z0", 10, -1000., + ATH_CHECK(bookEffHisto(m_Eff_z0Histo[isub], histGroupE[isub], "effZ0", "Module Efficiency by Z0", 10, -1000., 1000.)); - CHECK(bookEffHisto(m_etaTkUsedHisto[isub], histGroupE[isub], "EtaTkUsed", "Used Track Eta", 100, -2.8, 2.8)); - CHECK(bookEffHisto(m_phiTkUsedHisto[isub], histGroupE[isub], "PhiTkUsed", "Used Track Phi", 50, -3.142, 3.142)); - CHECK(bookEffHisto(m_ptiTkUsedHisto[isub], histGroupE[isub], "PtiTkUsed", "Used Track q/p (MeV)", 50, -0.002, + ATH_CHECK(bookEffHisto(m_etaTkUsedHisto[isub], histGroupE[isub], "EtaTkUsed", "Used Track Eta", 100, -2.8, 2.8)); + ATH_CHECK(bookEffHisto(m_phiTkUsedHisto[isub], histGroupE[isub], "PhiTkUsed", "Used Track Phi", 50, -3.142, 3.142)); + ATH_CHECK(bookEffHisto(m_ptiTkUsedHisto[isub], histGroupE[isub], "PtiTkUsed", "Used Track q/p (MeV)", 50, -0.002, 0.002)); - CHECK(bookEffHisto(m_ptTkUsedHisto[isub], histGroupE[isub], "PtTkUsed", "Used Track log10|p| (MeV)", 40, 2.0, + ATH_CHECK(bookEffHisto(m_ptTkUsedHisto[isub], histGroupE[isub], "PtTkUsed", "Used Track log10|p| (MeV)", 40, 2.0, 6.)); - CHECK(bookEffHisto(m_d0TkUsedHisto[isub], histGroupE[isub], "D0TkUsed", "Used Track D0", 50, -500., 500.)); - CHECK(bookEffHisto(m_d0PrecTkUsedHisto[isub], histGroupE[isub], "D0PrecTkUsed", "Used Track D0 prec", 100, -25., + ATH_CHECK(bookEffHisto(m_d0TkUsedHisto[isub], histGroupE[isub], "D0TkUsed", "Used Track D0", 50, -500., 500.)); + ATH_CHECK(bookEffHisto(m_d0PrecTkUsedHisto[isub], histGroupE[isub], "D0PrecTkUsed", "Used Track D0 prec", 100, -25., 25.)); - CHECK(bookEffHisto(m_z0TkUsedHisto[isub], histGroupE[isub], "Z0TkUsed", "Used Track Z0", 50, -1000., 1000.)); - CHECK(bookEffHisto(m_localHitXHisto[isub], histGroupE[isub], "localHitX", "local x position, hit", 80, -40., + ATH_CHECK(bookEffHisto(m_z0TkUsedHisto[isub], histGroupE[isub], "Z0TkUsed", "Used Track Z0", 50, -1000., 1000.)); + ATH_CHECK(bookEffHisto(m_localHitXHisto[isub], histGroupE[isub], "localHitX", "local x position, hit", 80, -40., 40.)); - CHECK(bookEffHisto(m_localHitYHistos[isub], histGroupE[isub], "localHitY", "local y position, hit", 320, -80., + ATH_CHECK(bookEffHisto(m_localHitYHistos[isub], histGroupE[isub], "localHitY", "local y position, hit", 320, -80., 80.)); - CHECK(bookEffHisto(m_phiLocalHisto[isub], histGroupE[isub], "phiLocal", "local phi of tracks", 60, -90., 90.)); - CHECK(bookEffHisto(m_phiLocalCutHisto[isub], histGroupE[isub], "phiLocalCut", "local phi of low D0 tracks", 60, + ATH_CHECK(bookEffHisto(m_phiLocalHisto[isub], histGroupE[isub], "phiLocal", "local phi of tracks", 60, -90., 90.)); + ATH_CHECK(bookEffHisto(m_phiLocalCutHisto[isub], histGroupE[isub], "phiLocalCut", "local phi of low D0 tracks", 60, -90., 90.)); - CHECK(bookEffHisto(m_Eff_nTrk[isub], histGroupE[isub], "effTrk", "Efficiency versus number of tracks", 200, 0, + ATH_CHECK(bookEffHisto(m_Eff_nTrk[isub], histGroupE[isub], "effTrk", "Efficiency versus number of tracks", 200, 0, 400.)); - CHECK(bookEffHisto(m_Eff_nGoodTrk[isub], histGroupE[isub], "effGoodTrk", + ATH_CHECK(bookEffHisto(m_Eff_nGoodTrk[isub], histGroupE[isub], "effGoodTrk", "Efficiency versus number of good tracks", 200, 0, 400.)); } if (m_superDetailed) { - CHECK(bookEffHisto(m_inEffStrip[isub], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_inEffStrip[isub], histGroupE[isub], "StripInEfficiency" + subDetNameShort[isub], "Strips inefficiencies in " + subDetName[isub], n_mod[isub] * 2, f_mod[isub] * 2 - 0.5, (f_mod[isub] + n_mod[isub]) * 2 - 0.5, N_STRIPS, FIRST_STRIP - 0.5, LAST_STRIP + 0.5)); - CHECK(bookEffHisto(m_inEffChip[isub], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_inEffChip[isub], histGroupE[isub], "ChipInEfficiency" + subDetNameShort[isub], "Chips ineficiencies in " + subDetName[isub], n_mod[isub] * 2, f_mod[isub] * 2 - 0.5, (f_mod[isub] + n_mod[isub]) * 2 - 0.5, N_CHIPS, FIRST_CHIP - 0.5, LAST_CHIP + 0.5)); - CHECK(bookEffHisto(m_badModPerSide[isub], histGroupE[isub], "badModPerSide", "Number of bad module per side", + ATH_CHECK(bookEffHisto(m_badModPerSide[isub], histGroupE[isub], "badModPerSide", "Number of bad module per side", 2 * n_layers[isub], 0., n_layers[isub])); - CHECK(bookEffHisto(m_holesPerTrackHisto[isub], histGroupE[isub], "holesPerTrack", "Number of holes per track", + ATH_CHECK(bookEffHisto(m_holesPerTrackHisto[isub], histGroupE[isub], "holesPerTrack", "Number of holes per track", 2 * n_layers[isub], 0, n_layers[isub])); - CHECK(bookEffHisto(m_holesDistPerTrackHisto[isub], histGroupE[isub], "holesDistPerTrack", + ATH_CHECK(bookEffHisto(m_holesDistPerTrackHisto[isub], histGroupE[isub], "holesDistPerTrack", "Number of holes per track", 2 * n_layers[isub], 0, n_layers[isub])); - CHECK(bookEffHisto(m_chi2vPhiHisto[isub], histGroupE[isub], "Chi2vPhi", "Chi2 v Phi", 30, -90., 90.)); - CHECK(bookEffHisto(m_localHitHisto[isub], histGroupE[isub], "localHit", "local position, hit", 40, -40., 40., + ATH_CHECK(bookEffHisto(m_chi2vPhiHisto[isub], histGroupE[isub], "Chi2vPhi", "Chi2 v Phi", 30, -90., 90.)); + ATH_CHECK(bookEffHisto(m_localHitHisto[isub], histGroupE[isub], "localHit", "local position, hit", 40, -40., 40., 40, -80., 80.)); - CHECK(bookEffHisto(m_localHitGHisto[isub], histGroupE[isub], "localHitG", "local position Guard, hit", 40, -40., + ATH_CHECK(bookEffHisto(m_localHitGHisto[isub], histGroupE[isub], "localHitG", "local position Guard, hit", 40, -40., 40., 40, -80., 80.)); - CHECK(bookEffHisto(m_TwoSidesResiduals[isub], histGroupE[isub], "TwoSidesResiduals", "Two Sides Residuals", 120, + ATH_CHECK(bookEffHisto(m_TwoSidesResiduals[isub], histGroupE[isub], "TwoSidesResiduals", "Two Sides Residuals", 120, -3., 3., 120, -3., 3.)); - CHECK(bookEffHisto(m_TwoSidesResidualsIneff[isub], histGroupE[isub], "TwoSidesResidualsIneff", + ATH_CHECK(bookEffHisto(m_TwoSidesResidualsIneff[isub], histGroupE[isub], "TwoSidesResidualsIneff", "Two Sides Residuals (Inefficient/Unas)", 120, -30., 30., 120, -30., 30.)); - CHECK(bookEffHisto(m_chi2ResidualHisto[isub], histGroupE[isub], "chi2Residual", "Chi2 v Residual", 200, -10., + ATH_CHECK(bookEffHisto(m_chi2ResidualHisto[isub], histGroupE[isub], "chi2Residual", "Chi2 v Residual", 200, -10., 10., 120, 0., 10.)); - CHECK(bookEffHisto(m_Eff_summaryIncBadMod[isub], histGroupE[isub], "summaryIncBadMod" + subDetNameShort[isub], + ATH_CHECK(bookEffHisto(m_Eff_summaryIncBadMod[isub], histGroupE[isub], "summaryIncBadMod" + subDetNameShort[isub], "Efficiency vs. layer including bad sensors", 2 * n_layers[isub], 0., n_layers[isub])); } @@ -1091,7 +1048,6 @@ SCTHitEffMonTool::fillHistograms() { } unsigned BCID = pEvent->bcid(); int BCIDpos = m_bunchCrossingTool->distanceFromFront(BCID); - //bool InTrain = m_bunchCrossingTool->isInTrain(BCID); if (m_chronotime) { m_chrono->chronoStart("SCTHitEff"); @@ -1138,11 +1094,9 @@ SCTHitEffMonTool::fillHistograms() { Int_t nTrk(0), nTrkPars(0), nTrkGood(0); // Loop over track collection to count tracks - const TrackCollection::const_iterator endOfTracks(tracks->end()); - for (TrackCollection::const_iterator itr(tracks->begin()); itr != endOfTracks; ++itr) { + for (const Trk::Track* pthisTrack: *tracks) { nTrk++; - const Trk::Track* pthisTrack(*itr); - if (not pthisTrack) { + if (pthisTrack==nullptr) { continue; } if (failCut(pthisTrack and pthisTrack->trackParameters() and pthisTrack->trackParameters()->size(), @@ -1177,11 +1131,9 @@ SCTHitEffMonTool::fillHistograms() { } // Loop over original track collection - // const TrackCollection::const_iterator endOfTracks(tracks->end()); - for (TrackCollection::const_iterator itr(tracks->begin()); itr != endOfTracks; ++itr) { + for (const Trk::Track* pthisTrack: *tracks) { ATH_MSG_VERBOSE("Starting new track"); - const Trk::Track* pthisTrack(*itr); - if (not pthisTrack) { + if (pthisTrack==nullptr) { continue; } if (failCut(pthisTrack and pthisTrack->trackParameters() and pthisTrack->trackParameters()->size(), @@ -1225,16 +1177,12 @@ SCTHitEffMonTool::fillHistograms() { continue; } - const Trk::Track* trackWithHoles = m_holeSearchTool->getTrackWithHoles(*pthisTrack); + std::unique_ptr<const Trk::Track> trackWithHoles(m_holeSearchTool->getTrackWithHoles(*pthisTrack)); if (not trackWithHoles) { ATH_MSG_WARNING("trackWithHoles pointer is invalid"); continue; } ATH_MSG_VERBOSE("Found " << trackWithHoles->trackStateOnSurfaces()->size() << " states on track"); - // loop over all hits on track - DataVector<const Trk::TrackStateOnSurface>::const_iterator TSOSItr = - trackWithHoles->trackStateOnSurfaces()->begin(); - DataVector<const Trk::TrackStateOnSurface>::const_iterator TSOSItrE = trackWithHoles->trackStateOnSurfaces()->end(); Int_t NHits[3] = { 0, 0, 0 @@ -1250,13 +1198,14 @@ SCTHitEffMonTool::fillHistograms() { Float_t max_layerSide(-1); Identifier surfaceID; - for (; TSOSItr != TSOSItrE; ++TSOSItr) { - surfaceID = surfaceOnTrackIdentifier(*TSOSItr); + // loop over all hits on track + for (const Trk::TrackStateOnSurface* tsos: *(trackWithHoles->trackStateOnSurfaces())) { + surfaceID = surfaceOnTrackIdentifier(tsos); if (!surfaceID.is_valid()) { continue; } - if ((*TSOSItr)->type(Trk::TrackStateOnSurface::Measurement) or(*TSOSItr)->type(Trk::TrackStateOnSurface::Outlier)) + if (tsos->type(Trk::TrackStateOnSurface::Measurement) or tsos->type(Trk::TrackStateOnSurface::Outlier)) { if (m_pixelId->is_pixel(surfaceID)) { pixelNHits++; @@ -1266,15 +1215,15 @@ SCTHitEffMonTool::fillHistograms() { } if (m_sctId->is_sct(surfaceID)) { NHits[bec2Index(m_sctId->barrel_ec(surfaceID))]++; - mapOfTrackHitResiduals[surfaceID] = getResidual(surfaceID, (*TSOSItr)->trackParameters(), &*p_sctclcontainer); + mapOfTrackHitResiduals[surfaceID] = getResidual(surfaceID, tsos->trackParameters(), &*p_sctclcontainer); } } - if ((*TSOSItr)->type(Trk::TrackStateOnSurface::Measurement)) { // Determine zmin and zmax taking multiple + if (tsos->type(Trk::TrackStateOnSurface::Measurement)) { // Determine zmin and zmax taking multiple // hits/side into account if (m_isCosmic) { // If this is cosmics use z, bad method but ok... - if ((*TSOSItr)->trackParameters()) { - zpos = (*TSOSItr)->trackParameters()->position().z(); + if (tsos->trackParameters()) { + zpos = tsos->trackParameters()->position().z(); zmax = std::max(zpos, zmax); zmin = std::min(zpos, zmin); }else { @@ -1283,7 +1232,7 @@ SCTHitEffMonTool::fillHistograms() { }else { // else use layer/side number : better but does not work for cosmics if (m_sctId->is_sct(surfaceID)) { layerSide = (m_sctId->barrel_ec(surfaceID) != 0) * N_BARRELS + - float(m_sctId->layer_disk(surfaceID)) + (float(m_sctId->side(surfaceID)) == 0) * 0.5; + static_cast<float>(m_sctId->layer_disk(surfaceID)) + (static_cast<float>(m_sctId->side(surfaceID)) == 0) * 0.5; min_layerSide = std::min(min_layerSide, layerSide); max_layerSide = std::max(max_layerSide, layerSide); }else if (m_pixelId->is_pixel(surfaceID)) { @@ -1305,9 +1254,9 @@ SCTHitEffMonTool::fillHistograms() { layersCrossedByTrack[i].resize(n_layers[i] * 2, false); } - for (TSOSItr = trackWithHoles->trackStateOnSurfaces()->begin(); TSOSItr != TSOSItrE; ++TSOSItr) { + for (const Trk::TrackStateOnSurface* tsos: *(trackWithHoles->trackStateOnSurfaces())) { ATH_MSG_VERBOSE("Starting new hit"); - surfaceID = surfaceOnTrackIdentifier(*TSOSItr); + surfaceID = surfaceOnTrackIdentifier(tsos); if (failCut(m_sctId->is_sct(surfaceID), "hit cut: is in SCT")) { continue; @@ -1330,18 +1279,18 @@ SCTHitEffMonTool::fillHistograms() { Int_t eff(0), unas(0); IdentifierHash sideHash(m_sctId->wafer_hash(surfaceID)); Identifier module_id(m_sctId->module_id(surfaceID)); - Float_t layerPlusHalfSide(float(layer) + float(side) * 0.5); - Float_t dedicated_layerPlusHalfSide(float(layer) + float((side + 1) % 2) * 0.5); - const Trk::TrackParameters* trkParamOnSurface((*TSOSItr)->trackParameters()); + Float_t layerPlusHalfSide(static_cast<float>(layer) + static_cast<float>(side) * 0.5); + Float_t dedicated_layerPlusHalfSide(static_cast<float>(layer) + static_cast<float>((side + 1) % 2) * 0.5); + const Trk::TrackParameters* trkParamOnSurface(tsos->trackParameters()); Double_t trackHitResidual(getResidual(surfaceID, trkParamOnSurface, &*p_sctclcontainer)); Float_t distCut(m_effdistcut); - if ((*TSOSItr)->type(Trk::TrackStateOnSurface::Measurement) or(*TSOSItr)->type(Trk::TrackStateOnSurface::Outlier)) + if (tsos->type(Trk::TrackStateOnSurface::Measurement) or tsos->type(Trk::TrackStateOnSurface::Outlier)) { eff = 1; - } else if ((*TSOSItr)->type(Trk::TrackStateOnSurface::Hole) and fabs(trackHitResidual) < distCut) { + } else if (tsos->type(Trk::TrackStateOnSurface::Hole) and fabs(trackHitResidual) < distCut) { eff = 1; unas = 1; } @@ -1360,10 +1309,9 @@ SCTHitEffMonTool::fillHistograms() { m_sctId->get_other_side(sideHash, otherSideHash); m_sctId->get_id(otherSideHash, otherSideSurfaceID, &context); otherFaceFound = mapOfTrackHitResiduals.find(otherSideSurfaceID) != mapOfTrackHitResiduals.end(); - // (std::find(TrackSurfaceID.begin(), TrackSurfaceID.end(), otherSideSurfaceID) != TrackSurfaceID.end()); Int_t nOther(sctNHits); - if ((*TSOSItr)->type(Trk::TrackStateOnSurface::Measurement) or(*TSOSItr)->type(Trk::TrackStateOnSurface::Outlier)) + if (tsos->type(Trk::TrackStateOnSurface::Measurement) or tsos->type(Trk::TrackStateOnSurface::Outlier)) { --nOther; } @@ -1475,8 +1423,8 @@ SCTHitEffMonTool::fillHistograms() { Bool_t enclosingHits(true); if (m_isCosmic) { - if ((*TSOSItr)->trackParameters()) { - zpos = (*TSOSItr)->trackParameters()->position().z(); + if (tsos->trackParameters()) { + zpos = tsos->trackParameters()->position().z(); enclosingHits = (zpos > zmin)and(zpos < zmax); }else { ATH_MSG_WARNING("No track parameters found. Cannot determine whether it is an enclosed hit."); @@ -1485,12 +1433,12 @@ SCTHitEffMonTool::fillHistograms() { }else { layerSide = (m_sctId->barrel_ec(surfaceID) != - 0) * N_BARRELS + float(m_sctId->layer_disk(surfaceID)) + (float(m_sctId->side(surfaceID)) == 0) * 0.5; + 0) * N_BARRELS + static_cast<float>(m_sctId->layer_disk(surfaceID)) + (static_cast<float>(m_sctId->side(surfaceID)) == 0) * 0.5; enclosingHits = layerSide > min_layerSide and layerSide < max_layerSide; } if (m_detailed) { - m_probEnclosedHisto[isub]->Fill(layerPlusHalfSide, Int_t(enclosingHits)); + m_probEnclosedHisto[isub]->Fill(layerPlusHalfSide, static_cast<Int_t>(enclosingHits)); } if (m_requireEnclosingHits and not (layerPlusHalfSide == .5)and not (isub == 1 and layerPlusHalfSide == @@ -1701,8 +1649,8 @@ SCTHitEffMonTool::fillHistograms() { } if (m_superDetailed) { chipPos = (side == 1) ? 11 - chipPos : chipPos; - m_inEffChip[isub]->Fill(sideHash, chipPos, int(eff == 0)); - m_inEffStrip[isub]->Fill(sideHash, xl / 79.95e-3 + 768. / 2., int(eff == 0)); + m_inEffChip[isub]->Fill(sideHash, chipPos, static_cast<int>(eff == 0)); + m_inEffStrip[isub]->Fill(sideHash, xl / 79.95e-3 + 768. / 2., static_cast<int>(eff == 0)); // Find the opposite side of this module, if (side == 0) { Double_t trackHitResidual2(999); @@ -1715,10 +1663,10 @@ SCTHitEffMonTool::fillHistograms() { m_TwoSidesResidualsIneff[isub]->Fill(trackHitResidual, trackHitResidual2); } } - const int layerSideIndex = int(layerPlusHalfSide * 2); + const int layerSideIndex = static_cast<int>(layerPlusHalfSide * 2); layersCrossedByTrack[isub][layerSideIndex] = true; - nHolesDistOnLayer[isub][layerSideIndex] += int(eff == 0); - nHolesOnLayer[isub][layerSideIndex] += int((*TSOSItr)->type(Trk::TrackStateOnSurface::Hole)); + nHolesDistOnLayer[isub][layerSideIndex] += static_cast<int>(eff == 0); + nHolesOnLayer[isub][layerSideIndex] += static_cast<int>(tsos->type(Trk::TrackStateOnSurface::Hole)); if (fabs(trackHitResidual) < 65) { m_layerResidualHistos[isub][layerSideIndex]->Fill(m_sctId->eta_module(surfaceID), m_sctId->phi_module(surfaceID), trackHitResidual); @@ -1773,16 +1721,14 @@ SCTHitEffMonTool::fillHistograms() { for (Int_t isub(0); isub != N_REGIONS; ++isub) { for (Int_t i(0); i != n_layers[isub] * 2; ++i) { if (layersCrossedByTrack[isub][i]) { - m_holesPerTrackHisto[isub]->Fill(float(i) / 2, nHolesOnLayer[isub][i]); - m_holesDistPerTrackHisto[isub]->Fill(float(i) / 2, nHolesOnLayer[isub][i]); + m_holesPerTrackHisto[isub]->Fill(static_cast<float>(i) / 2, nHolesOnLayer[isub][i]); + m_holesDistPerTrackHisto[isub]->Fill(static_cast<float>(i) / 2, nHolesOnLayer[isub][i]); } } } } - delete trackWithHoles; - trackWithHoles = 0; } - ATH_MSG_VERBOSE("finished loop over tracks = " << (*tracks).size()); + ATH_MSG_VERBOSE("finished loop over tracks = " << tracks->size()); if (m_detailed) { m_nTrkHisto->Fill(nTrk); m_nTrkParsHisto->Fill(nTrkPars); @@ -1852,7 +1798,7 @@ SCTHitEffMonTool::procHistograms() { unsigned int status((*badChip).second); for (Int_t i(0); i < 2 * N_CHIPS; ++i) { if ((status & (1 << i)) != 0) { - accSide[int(i >= N_CHIPS)] -= 1. / N_CHIPS; + accSide[static_cast<int>(i >= N_CHIPS)] -= 1. / N_CHIPS; } } eff = (accSide[0] + accSide[1]) / 2; @@ -1910,7 +1856,7 @@ SCTHitEffMonTool::procHistograms() { ATH_MSG_WARNING("Barrel-or-endcap index is invalid"); return StatusCode::FAILURE; } - CHECK(bookEffHisto(m_accPhysMap[histnumber], histGroupE[isub], + ATH_CHECK(bookEffHisto(m_accPhysMap[histnumber], histGroupE[isub], "nDisabledChipsPhys_" + subDetNameShort[isub] + "_" + i, "", etabins[isub][i].size() - 1, &etabins[isub][i][0], phibins[isub][i].size() - 1, &phibins[isub][i][0])); @@ -1932,8 +1878,8 @@ SCTHitEffMonTool::procHistograms() { } } } - for (std::map< Identifier, Float_t >::const_iterator bMod(mapOfInEff.begin()); bMod != mapOfInEff.end(); ++bMod) { - Identifier surfaceID(bMod->first); + for (const std::pair<Identifier, Float_t> bMod: mapOfInEff) { + Identifier surfaceID(bMod.first); Int_t histnumber(becIdxLayer2Index(bec2Index(m_sctId->barrel_ec(surfaceID)), m_sctId->layer_disk(surfaceID))); if (histnumber < 0) { ATH_MSG_WARNING("Barrel-or-endcap index is invalid"); @@ -1942,7 +1888,7 @@ SCTHitEffMonTool::procHistograms() { IdentifierHash waferHash = m_sctId->wafer_hash(surfaceID); const InDetDD::SiDetectorElement* element = elements->getDetectorElement(waferHash); const Amg::Vector3D position = element->center(); - m_accPhysMap[histnumber]->Fill(amgPseudoRapidity(position), position.phi(), (1. - bMod->second) * N_CHIPS * 2); + m_accPhysMap[histnumber]->Fill(amgPseudoRapidity(position), position.phi(), (1. - bMod.second) * N_CHIPS * 2); } } @@ -1983,7 +1929,7 @@ SCTHitEffMonTool::previousChip(Double_t xl, Int_t side, bool swap) { Float_t stripWidth(79.95e-3); Float_t nChips(6.); Float_t xLeftEdge(xl + nStrips / 2. * stripWidth); // xl defined wrt center of module, convert to edge of module - Int_t chipPos(int(xLeftEdge / (stripWidth * nStrips) * nChips)); + Int_t chipPos(static_cast<int>(xLeftEdge / (stripWidth * nStrips) * nChips)); if (side == 0) { chipPos = swap ? 5 - chipPos : chipPos; @@ -2027,7 +1973,7 @@ template <class T> StatusCode SCTHitEffMonTool::bookEffHisto(T*& histo, MonGroup& MG, TString name, TString title, Int_t nbin, Double_t x1, Double_t x2) { histo = new T(name, title, nbin, x1, x2); - CHECK(MG.regHist(histo)); + ATH_CHECK(MG.regHist(histo)); ATH_MSG_VERBOSE("Registered " << name << " at " << histo); return StatusCode::SUCCESS; } @@ -2037,7 +1983,7 @@ SCTHitEffMonTool::bookEffHisto(T*& histo, MonGroup& MG, TString name, TString ti Int_t nbinx, Double_t x1, Double_t x2, Int_t nbiny, Double_t y1, Double_t y2) { histo = new T(name, title, nbinx, x1, x2, nbiny, y1, y2); - CHECK(MG.regHist(histo)); + ATH_CHECK(MG.regHist(histo)); ATH_MSG_VERBOSE("Registered " << name << " at " << histo); return StatusCode::SUCCESS; } @@ -2046,7 +1992,7 @@ template <class T> StatusCode SCTHitEffMonTool::bookEffHisto(T*& histo, MonGroup& MG, TString name, TString title, Int_t nbinx, Double_t* xbins, Int_t nbiny, Double_t* ybins) { histo = new T(name, title, nbinx, xbins, nbiny, ybins); - CHECK(MG.regHist(histo)); + ATH_CHECK(MG.regHist(histo)); ATH_MSG_VERBOSE("Registered " << name << " at " << histo); return StatusCode::SUCCESS; } @@ -2064,28 +2010,23 @@ SCTHitEffMonTool::getResidual(const Identifier& surfaceID, const Trk::TrackParam IdentifierHash idh(m_sctId->wafer_hash(surfaceID)); InDet::SCT_ClusterContainer::const_iterator containerIterator(p_sctclcontainer->indexFind(idh)); InDet::SCT_ClusterContainer::const_iterator containerEnd(p_sctclcontainer->end()); - for (; containerIterator != containerEnd; ++containerIterator) { - for (InDet::SCT_ClusterCollection::const_iterator rioIterator((*containerIterator)->begin()); - rioIterator != (*containerIterator)->end(); ++rioIterator) { - if (not (*rioIterator) or not (*rioIterator)->detectorElement()) { + if (containerIterator != containerEnd) { + for (const InDet::SCT_Cluster* cluster: **containerIterator) { + if ((cluster==nullptr) or (cluster->detectorElement()==nullptr)) { ATH_MSG_WARNING("nullptr to RIO or detElement"); continue; } - if (m_sctId->wafer_id(surfaceID) == m_sctId->wafer_id(((*rioIterator)->detectorElement())->identify())) { - const Trk::PrepRawData* rioo(dynamic_cast<const Trk::PrepRawData *>(*rioIterator)); - const Trk::RIO_OnTrack* rio(m_rotcreator->correct(*rioo, *trkParam)); + if (m_sctId->wafer_id(surfaceID) == m_sctId->wafer_id(cluster->detectorElement()->identify())) { + const Trk::PrepRawData* rioo(dynamic_cast<const Trk::PrepRawData *>(cluster)); + std::unique_ptr<const Trk::RIO_OnTrack> rio(m_rotcreator->correct(*rioo, *trkParam)); if (!m_residualPullCalculator.empty()) { - const Trk::ResidualPull* residualPull(m_residualPullCalculator->residualPull(rio, trkParam, - Trk::ResidualPull::Unbiased)); - if (residualPull == 0) { - continue; - } + std::unique_ptr<const Trk::ResidualPull> residualPull(m_residualPullCalculator->residualPull(rio.get(), trkParam, + Trk::ResidualPull::Unbiased)); + if (not residualPull) continue; if (fabs(residualPull->residual()[Trk::loc1]) < fabs(trackHitResidual)) { trackHitResidual = residualPull->residual()[Trk::loc1]; } - delete residualPull; } - delete rio; } } } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx index 0fdd7ad6cc72407ac8dbf53ee6fda107f739ba93..9e73a88557d4f239bb8c15bbe1ffb583f1ed861a 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx @@ -13,7 +13,6 @@ #include "SCT_Monitoring/SCTHitsNoiseMonTool.h" -#include "cArrayUtilities.h" #include "SCT_NameFormatter.h" #include "AthContainers/DataVector.h" @@ -135,17 +134,17 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, const IInterface* parent) : SCTMotherTrigMonTool(type, name, parent), m_nSP(nullptr), - m_nSP_buf(nullptr), + m_nSP_buf{}, m_nSP_pos(0), m_nHits(nullptr), - m_nHits_buf(nullptr), + m_nHits_buf{}, m_nHits_pos(0), m_nmaxHits(nullptr), - m_nmaxHits_buf(nullptr), - m_nmaxModule_buf(nullptr), + m_nmaxHits_buf{}, + m_nmaxModule_buf{}, m_nminHits(nullptr), - m_nminHits_buf(nullptr), - m_nminModule_buf(nullptr), + m_nminHits_buf{}, + m_nminModule_buf{}, m_numBarrelHitsPerLumiBlock(nullptr), m_numHitsPerLumiBlockECp(nullptr), m_numHitsPerLumiBlockECm(nullptr), @@ -153,7 +152,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, m_numSPPerLumiBlockECp(nullptr), m_numSPPerLumiBlockECm(nullptr), m_rioMap(nullptr), - // m_BARNO(nullptr), m_BARNOTrigger(nullptr), m_ECmNO(nullptr), @@ -162,7 +160,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, m_ECpNOTrigger(nullptr), m_SCTNO(nullptr), m_SCTNOTrigger(nullptr), - // m_NallHitsBAR_vsLB(nullptr), m_NSPHitsBAR_vsLB(nullptr), m_NallHitsECm_vsLB(nullptr), @@ -176,7 +173,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, m_NoisyModules100_vsLB(nullptr), m_NoisyModules1000_vsLB(nullptr), m_NoisyModules10000_vsLB(nullptr), - // m_NallHitsTriggerBAR_vsLB(nullptr), m_NSPHitsTriggerBAR_vsLB(nullptr), m_NallHitsTriggerECm_vsLB(nullptr), @@ -190,7 +186,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, m_NoisyModulesTrigger100_vsLB(nullptr), m_NoisyModulesTrigger1000_vsLB(nullptr), m_NoisyModulesTrigger10000_vsLB(nullptr), - // m_MaxOccupancyStripHist(nullptr), m_MinOccupancyStripHist(nullptr), m_clusize(nullptr), @@ -199,11 +194,11 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, m_hitsvsL1ID(nullptr), m_ncluHisto(nullptr), m_coincidenceHist(nullptr), + m_stream{"/stat"}, m_numberOfEvents(0), m_numberOfEventsTrigger(0), m_numberOfEventsRecent(0), m_skipEvents(0), - m_booltxscan(false), m_current_lb(0), m_last_reset_lb(0), m_tbinHisto(nullptr), @@ -212,12 +207,17 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, m_tbinHistoRecent(nullptr), m_tbinHistoRecentECp(nullptr), m_tbinHistoRecentECm(nullptr), + m_tbinfrac{}, + m_tbinfracECp{}, + m_tbinfracECm{}, + m_clusizedist{}, + m_clusizedistECp{}, + m_clusizedistECm{}, m_tbinfracall(nullptr), m_tbinfracVsLB(nullptr), m_tbinfracVsLBECp(nullptr), m_tbinfracVsLBECm(nullptr), m_initialize(false), - m_SCTSPContainerName(std::string("SCT_SpacePoints")), m_noisyM100{}, m_noisyM1000{}, m_noisyM10000{}, @@ -268,7 +268,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, m_NoisyModulesWithHOTrigger100_vsLB(nullptr), m_NoisyModulesWithHOTrigger1000_vsLB(nullptr), m_NoisyModulesWithHOTrigger10000_vsLB(nullptr), - // m_noisyMWithHO100{}, m_noisyMWithHO1000{}, m_noisyMWithHO10000{}, @@ -283,25 +282,12 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, m_hitoccTriggerBAR_lb{}, m_hitoccTriggerECp_lb{}, m_hitoccTriggerECm_lb{}, - // - m_dataObjectName(std::string("SCT_RDOs")), - m_pSCTHelper(nullptr), - m_eventInfoKey(std::string("EventInfo")), - m_clusContainerKey("SCT_Clusters") { - /** sroe 3 Sept 2015: - histoPathBase is declared as a property in the base class, assigned to m_path - with default as empty string. - Declaring it here as well gives rise to compilation warning - WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023 - - declareProperty("histoPathBase", m_stream = "/stat"); **/ - m_stream = "/stat"; + m_pSCTHelper(nullptr) { declareProperty("localSummary", m_localSummary = 0); - declareProperty("doHitmapHistos", m_boolhitmaps = true); + declareProperty("doHitmapHistos", m_boolhitmaps = false); declareProperty("doTXScan", m_booltxscan = false); declareProperty("CheckRate", m_checkrate = 1000); declareProperty("CheckRecent", m_checkrecent = 30); - declareProperty("tracksName", m_tracksName = "Combined_Tracks"); declareProperty("NOTrigger", m_NOTrigger = "L1_RD0_EMPTY"); declareProperty("numberOfSigma", m_numSigma = 3); declareProperty("EvtsBins", m_evtsbins = 5000); @@ -313,24 +299,6 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type, declareProperty("doTrackHits", m_doTrackHits = true); declareProperty("MaxTracks", m_maxTracks = 1000); declareProperty("doLogXNoise", m_doLogXNoise = true); - - clear1D(m_tbinfrac); - clear1D(m_tbinfracECp); - clear1D(m_tbinfracECm); - clear1D(m_clusizedist); - clear1D(m_clusizedistECp); - clear1D(m_clusizedistECm); - } - -// ==================================================================================================== -// ==================================================================================================== -SCTHitsNoiseMonTool::~SCTHitsNoiseMonTool() { - free(m_nSP_buf); - free(m_nmaxHits_buf); - free(m_nminHits_buf); - free(m_nmaxModule_buf); - free(m_nminModule_buf); - free(m_nHits_buf); } // ==================================================================================================== @@ -340,7 +308,6 @@ StatusCode SCTHitsNoiseMonTool::initialize() { ATH_CHECK(m_SCTSPContainerName.initialize()); ATH_CHECK(m_dataObjectName.initialize()); - ATH_CHECK(m_eventInfoKey.initialize()); ATH_CHECK(m_clusContainerKey.initialize()); ATH_CHECK(m_tracksName.initialize()); @@ -767,7 +734,6 @@ SCTHitsNoiseMonTool::checkHists(bool /*fromFinalize*/) { // ==================================================================================================== StatusCode SCTHitsNoiseMonTool::generalHistsandNoise() { - typedef SCT_RDORawData SCTRawDataType; SG::ReadHandle<SCT_RDO_Container> p_rdocontainer(m_dataObjectName); SG::ReadHandle<xAOD::EventInfo> pEvent(m_eventInfoKey); if (not pEvent.isValid()) { @@ -785,8 +751,6 @@ SCTHitsNoiseMonTool::generalHistsandNoise() { } Identifier SCT_Identifier; // Use new IDC - SCT_RDO_Container::const_iterator col_it = p_rdocontainer->begin(); - SCT_RDO_Container::const_iterator lastCol = p_rdocontainer->end(); int local_tothits = 0; int totalmodules = 0; int meanhits = 0; @@ -831,65 +795,56 @@ SCTHitsNoiseMonTool::generalHistsandNoise() { const bool doThisSubsystem[3] = { m_doNegativeEndcap, true, m_doPositiveEndcap }; - // - // Define some iterators over the SP container - SpacePointContainer::const_iterator spContainerIterator = sctContainer->begin(); - SpacePointContainer::const_iterator spContainerIteratorEnd = sctContainer->end(); // Outer Loop on RDO Collection - for (; col_it != lastCol; ++col_it) { - const InDetRawDataCollection<SCTRawDataType>* SCT_Collection(*col_it); - if (!SCT_Collection) { + for (const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection: *p_rdocontainer) { + if (SCT_Collection==nullptr) { continue; // select only SCT RDOs } // MJW new code- try getting the ID of the collection using the identify() method Identifier tempID = SCT_Collection->identify(); Identifier theWaferIdentifierOfTheRDOCollection = tempID; Identifier theModuleIdentifierOfTheRDOCollection = m_pSCTHelper->module_id(tempID); + IdentifierHash theModuleHash0 = m_pSCTHelper->wafer_hash(theModuleIdentifierOfTheRDOCollection); + IdentifierHash theModuleHash1; + m_pSCTHelper->get_other_side(theModuleHash0, theModuleHash1); int Bec = m_pSCTHelper->barrel_ec(tempID); int numberOfHitsFromSPs = 0; int numberOfHitsFromAllRDOs = 0; // Now we want the space point container for this module // We have to compare module IDs- the SP collection is defined for the 'normal' (i.e. no stereo) module side // Define a set of spIDs - set<Identifier>mySetOfSPIds; - for (; spContainerIterator != spContainerIteratorEnd; ++spContainerIterator) { + set<Identifier> mySetOfSPIds; + for (unsigned int side{0}; side<2; side++) { + SpacePointContainer::const_iterator spContainerIterator = sctContainer->indexFind(side==0 ? theModuleHash0 : theModuleHash1); + if (spContainerIterator==sctContainer->end()) continue; Identifier tempSPID = (*spContainerIterator)->identify(); Identifier theModuleIdentifierOfTheSPCollection = m_pSCTHelper->module_id(tempSPID); - if (theModuleIdentifierOfTheSPCollection > theModuleIdentifierOfTheRDOCollection) { - break; - } if (theModuleIdentifierOfTheRDOCollection == theModuleIdentifierOfTheSPCollection) { - DataVector<Trk::SpacePoint>::const_iterator nextSpacePoint = (*spContainerIterator)->begin(); - DataVector<Trk::SpacePoint>::const_iterator nextSpacePointEnd = (*spContainerIterator)->end(); - for (; nextSpacePoint != nextSpacePointEnd; ++nextSpacePoint) { - const Trk::SpacePoint& sp = **nextSpacePoint; + for (const Trk::SpacePoint* sp: **spContainerIterator) { // the following is nasty; the 'normal' sides (where the sp is defined) swap from layer to layer. To be safe, // we get both sides - const VecId_t& rdoList0 = sp.clusterList().first->rdoList(); - const VecId_t& rdoList1 = sp.clusterList().second->rdoList(); + const VecId_t& rdoList0 = sp->clusterList().first->rdoList(); + const VecId_t& rdoList1 = sp->clusterList().second->rdoList(); // copy to mySetOfSPIds. Use inserter(set, iterator_hint) for a set, or back_inserter(vec) for vector... copy(rdoList0.begin(), rdoList0.end(), inserter(mySetOfSPIds, mySetOfSPIds.end())); copy(rdoList1.begin(), rdoList1.end(), inserter(mySetOfSPIds, mySetOfSPIds.end())); } - break; + } else { + ATH_MSG_ERROR("Module identifiers are different. indexFind gives a wrong collection??"); } } totalmodules++; maxrodhits = 0; // Now we loop over the RDOs in the RDO collection, and add to the NO vector any that are in the mySetOfSPIds - DataVector<SCTRawDataType>::const_iterator p_rdo = SCT_Collection->begin(); - DataVector<SCTRawDataType>::const_iterator end_rdo = SCT_Collection->end(); - for (; p_rdo != end_rdo; ++p_rdo) { - const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData*>(*p_rdo); - int tbin;// = (*p_rdo)->getTimeBin(); - if (rdo3 != 0) { - tbin = (rdo3)->getTimeBin(); - }else { - tbin = 3; - } - SCT_Identifier = (*p_rdo)->identify(); + for (const SCT_RDORawData* rdo: *SCT_Collection) { + const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData*>(rdo); + int tbin = 3; + if (rdo3) { + tbin = rdo3->getTimeBin(); + } + SCT_Identifier = rdo->identify(); const unsigned int firstStrip(m_pSCTHelper->strip(SCT_Identifier)); - const unsigned int numberOfStrips((*p_rdo)->getGroupSize()); + const unsigned int numberOfStrips(rdo->getGroupSize()); int thisBec = m_pSCTHelper->barrel_ec(SCT_Identifier); int thisLayerDisk = m_pSCTHelper->layer_disk(SCT_Identifier); int thisPhi = m_pSCTHelper->phi_module(SCT_Identifier); @@ -1227,20 +1182,10 @@ SCTHitsNoiseMonTool::generalHistsandNoise() { if (not p_clucontainer.isValid()) { ATH_MSG_WARNING("Couldn't retrieve clusters"); } - InDet::SCT_ClusterContainer::const_iterator clucol_it = p_clucontainer->begin(); - InDet::SCT_ClusterContainer::const_iterator lastcluCol = p_clucontainer->end(); - for (; clucol_it != lastcluCol; ++clucol_it) { - const InDet::SCT_ClusterCollection* SCT_Collection(*clucol_it); - if (!SCT_Collection) { - continue; // select only SCT RDOs - } - // Middle Loop on SCT Clusters only - DataVector<InDet::SCT_Cluster>::const_iterator p_clu(SCT_Collection->begin()); - DataVector<InDet::SCT_Cluster>::const_iterator clus_end = SCT_Collection->end(); - for (; p_clu != clus_end; ++p_clu) { - Identifier cluId = (*p_clu)->identify(); - const InDet::SCT_Cluster& cluster = **p_clu; - int GroupSize = cluster.rdoList().size(); + for (const InDet::SCT_ClusterCollection* SCT_Collection: *p_clucontainer) { + for (const InDet::SCT_Cluster* cluster: *SCT_Collection) { + Identifier cluId = cluster->identify(); + int GroupSize = cluster->rdoList().size(); // Fill Cluster Size histogram int elementIndex = 2 * m_pSCTHelper->layer_disk(cluId) + m_pSCTHelper->side(cluId); int thisPhi = m_pSCTHelper->phi_module(cluId); @@ -1940,10 +1885,10 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) { } } if (m_occSumUnbiased.size() && m_numberOfEvents) { - for (std::map<Identifier, float>::iterator it = m_occSumUnbiased.begin(); it != m_occSumUnbiased.end(); it++) { - Identifier wafer_id = it->first; + for (std::pair<const Identifier, float>& val: m_occSumUnbiased) { + Identifier wafer_id = val.first; int element = 2 * m_pSCTHelper->layer_disk(wafer_id) + m_pSCTHelper->side(wafer_id); - float occ = (m_numberOfEvents > 0) ? it->second / (m_numberOfEvents) : it->second; + float occ = (m_numberOfEvents > 0) ? val.second / (m_numberOfEvents) : val.second; int eta = m_pSCTHelper->eta_module(wafer_id); int phi = m_pSCTHelper->phi_module(wafer_id); int barrel_ec = m_pSCTHelper->barrel_ec(wafer_id); @@ -1966,11 +1911,10 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) { } if (m_environment == AthenaMonManager::online) { if (m_occSumUnbiasedRecent.size() && m_numberOfEventsRecent) { - for (std::map<Identifier, float>::iterator it = m_occSumUnbiasedRecent.begin(); - it != m_occSumUnbiasedRecent.end(); it++) { - Identifier wafer_id = it->first; + for (std::pair<const Identifier, float>& val: m_occSumUnbiasedRecent) { + Identifier wafer_id = val.first; int element = 2 * m_pSCTHelper->layer_disk(wafer_id) + m_pSCTHelper->side(wafer_id); - float occ = (m_numberOfEventsRecent > 0) ? it->second / (m_numberOfEventsRecent) : it->second; + float occ = (m_numberOfEventsRecent > 0) ? val.second / (m_numberOfEventsRecent) : val.second; int eta = m_pSCTHelper->eta_module(wafer_id); int phi = m_pSCTHelper->phi_module(wafer_id); int barrel_ec = m_pSCTHelper->barrel_ec(wafer_id); @@ -1988,11 +1932,10 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) { } } if (m_occSumUnbiasedTrigger.size() && m_numberOfEventsTrigger) { - for (std::map<Identifier, float>::iterator it = m_occSumUnbiasedTrigger.begin(); - it != m_occSumUnbiasedTrigger.end(); it++) { - Identifier wafer_id = it->first; + for (std::pair<const Identifier, float>&val: m_occSumUnbiasedTrigger) { + Identifier wafer_id = val.first; int element = 2 * m_pSCTHelper->layer_disk(wafer_id) + m_pSCTHelper->side(wafer_id); - float occ = (m_numberOfEventsTrigger > 0) ? it->second / (m_numberOfEventsTrigger) : it->second; + float occ = (m_numberOfEventsTrigger > 0) ? val.second / (m_numberOfEventsTrigger) : val.second; int eta = m_pSCTHelper->eta_module(wafer_id); int phi = m_pSCTHelper->phi_module(wafer_id); int barrel_ec = m_pSCTHelper->barrel_ec(wafer_id); @@ -2015,11 +1958,10 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) { } if (m_hitoccSumUnbiased.size() && m_numberOfEvents) { - for (std::map<Identifier, float>::iterator it = m_hitoccSumUnbiased.begin(); it != m_hitoccSumUnbiased.end(); - it++) { - Identifier wafer_id = it->first; + for (std::pair<const Identifier, float>& val: m_hitoccSumUnbiased) { + Identifier wafer_id = val.first; int element = 2 * m_pSCTHelper->layer_disk(wafer_id) + m_pSCTHelper->side(wafer_id); - float hitocc = (m_numberOfEvents > 0) ? it->second / (m_numberOfEvents) : it->second; + float hitocc = (m_numberOfEvents > 0) ? val.second / (m_numberOfEvents) : val.second; int eta = m_pSCTHelper->eta_module(wafer_id); int phi = m_pSCTHelper->phi_module(wafer_id); int barrel_ec = m_pSCTHelper->barrel_ec(wafer_id); @@ -2042,11 +1984,10 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) { } if (m_environment == AthenaMonManager::online) { if (m_hitoccSumUnbiasedRecent.size() && m_numberOfEventsRecent) { - for (std::map<Identifier, float>::iterator it = m_hitoccSumUnbiasedRecent.begin(); - it != m_hitoccSumUnbiasedRecent.end(); it++) { - Identifier wafer_id = it->first; + for (std::pair<const Identifier, float>& val: m_hitoccSumUnbiasedRecent) { + Identifier wafer_id = val.first; int element = 2 * m_pSCTHelper->layer_disk(wafer_id) + m_pSCTHelper->side(wafer_id); - float hitocc = (m_numberOfEventsRecent > 0) ? it->second / (m_numberOfEventsRecent) : it->second; + float hitocc = (m_numberOfEventsRecent > 0) ? val.second / (m_numberOfEventsRecent) : val.second; int eta = m_pSCTHelper->eta_module(wafer_id); int phi = m_pSCTHelper->phi_module(wafer_id); int barrel_ec = m_pSCTHelper->barrel_ec(wafer_id); @@ -2064,11 +2005,10 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) { } } if (m_hitoccSumUnbiasedTrigger.size() && m_numberOfEventsTrigger) { - for (std::map<Identifier, float>::iterator it = m_hitoccSumUnbiasedTrigger.begin(); - it != m_hitoccSumUnbiasedTrigger.end(); it++) { - Identifier wafer_id = it->first; + for (std::pair<const Identifier, float>& val: m_hitoccSumUnbiasedTrigger) { + Identifier wafer_id = val.first; int element = 2 * m_pSCTHelper->layer_disk(wafer_id) + m_pSCTHelper->side(wafer_id); - float hitocc = (m_numberOfEventsTrigger > 0) ? it->second / (m_numberOfEventsTrigger) : it->second; + float hitocc = (m_numberOfEventsTrigger > 0) ? val.second / (m_numberOfEventsTrigger) : val.second; int eta = m_pSCTHelper->eta_module(wafer_id); int phi = m_pSCTHelper->phi_module(wafer_id); int barrel_ec = m_pSCTHelper->barrel_ec(wafer_id); @@ -2487,13 +2427,11 @@ SCTHitsNoiseMonTool::resetNoiseMapHists() { // ==================================================================================================== StatusCode SCTHitsNoiseMonTool::resetNoiseMapsRecent() { - for (std::map<Identifier, float>::iterator it = m_occSumUnbiasedRecent.begin(); it != m_occSumUnbiasedRecent.end(); - ++it) { - it->second = 0.0; + for (std::pair<const Identifier, float>& val: m_occSumUnbiasedRecent) { + val.second = 0.0; } - for (std::map<Identifier, float>::iterator it = m_hitoccSumUnbiasedRecent.begin(); - it != m_hitoccSumUnbiasedRecent.end(); ++it) { - it->second = 0.0; + for (std::pair<const Identifier, float>& val: m_hitoccSumUnbiasedRecent) { + val.second = 0.0; } return StatusCode::SUCCESS; } @@ -2942,53 +2880,35 @@ SCTHitsNoiseMonTool::bookNoiseDistributions() { StatusCode SCTHitsNoiseMonTool::bookSPvsEventNumber() { if (newRunFlag()) { - free(m_nSP_buf); - free(m_nHits_buf); - free(m_nmaxHits_buf); - free(m_nminHits_buf); - free(m_nmaxModule_buf); - free(m_nminModule_buf); MonGroup BarrelSPHist(this, "SCT/GENERAL/hits", ManagedMonitorToolBase::run, ATTRIB_UNMANAGED); // Book a histogram m_nSP = th1Factory("sct_sp_vs_en", "Number of Spacepoints vs Event Number", BarrelSPHist, 1, m_evtsbins + 1, m_evtsbins); m_nSP->GetXaxis()->SetTitle("Event Number"); m_nSP->GetYaxis()->SetTitle("Num of Spacepoints"); - size_t nSP_buf_size; - nSP_buf_size = m_evtsbins * sizeof(int); - m_nSP_buf = (int*) malloc(nSP_buf_size); + m_nSP_buf.reserve(m_evtsbins); m_nSP_pos = 0; m_nHits = th1Factory("sct_av_hits_vs_en", "Number of Average Hits vs Event Number", BarrelSPHist, 1, m_evtsbins + 1, m_evtsbins); m_nHits->GetXaxis()->SetTitle("Event Number"); m_nHits->GetYaxis()->SetTitle("Num of Average Hits"); - size_t nHits_buf_size; - nHits_buf_size = m_evtsbins * sizeof(int); - m_nHits_buf = (int*) malloc(nHits_buf_size); + m_nHits_buf.reserve(m_evtsbins); m_nHits_pos = 0; m_nmaxHits = th1Factory("sct_max_hits_vs_en", "Max Number of Hits vs Event Number", BarrelSPHist, 1, m_evtsbins + 1, m_evtsbins); m_nmaxHits->GetXaxis()->SetTitle("Event Number"); m_nmaxHits->GetYaxis()->SetTitle("Num of Max Hits"); - size_t nmaxHits_buf_size; - nmaxHits_buf_size = m_evtsbins * sizeof(int); - m_nmaxHits_buf = (int*) malloc(nmaxHits_buf_size); - size_t nmaxModule_buf_size; - nmaxModule_buf_size = m_evtsbins * sizeof(Identifier); - m_nmaxModule_buf = (Identifier*) malloc(nmaxModule_buf_size); + m_nmaxHits_buf.reserve(m_evtsbins); + m_nmaxModule_buf.reserve(m_evtsbins); m_nminHits = th1Factory("sct_min_hits_vs_en", "Min Number of Hits vs Event Number", BarrelSPHist, 1, m_evtsbins + 1, m_evtsbins); m_nminHits->GetXaxis()->SetTitle("Event Number"); m_nminHits->GetYaxis()->SetTitle("Num of Min Hits"); - size_t nminHits_buf_size; - nminHits_buf_size = m_evtsbins * sizeof(int); - m_nminHits_buf = (int*) malloc(nminHits_buf_size); - size_t nminModule_buf_size; - nminModule_buf_size = m_evtsbins * sizeof(Identifier); - m_nminModule_buf = (Identifier*) malloc(nminModule_buf_size); + m_nminHits_buf.reserve(m_evtsbins); + m_nminModule_buf.reserve(m_evtsbins); } return StatusCode::SUCCESS; } @@ -3008,11 +2928,8 @@ SCTHitsNoiseMonTool::makeSPvsEventNumber() { } int sct_nspacepoints(0); // loop over SCT space points collections - SpacePointContainer::const_iterator it = SCT_spcontainer->begin(); - SpacePointContainer::const_iterator endit = SCT_spcontainer->end(); - for (; it != endit; ++it) { - const SpacePointCollection* colNext = &(**it); - if (!colNext) { + for (const SpacePointCollection* colNext: *SCT_spcontainer) { + if (colNext==nullptr) { continue; } // Identify the spacepoint collection and gets its barrel_ec to update the num SP histogram @@ -3027,7 +2944,7 @@ SCTHitsNoiseMonTool::makeSPvsEventNumber() { if (thisBec == 2) { m_numSPPerLumiBlockECp->Fill(thisLayerDisk, colNext->size()); } - sct_nspacepoints += (int) colNext->size(); + sct_nspacepoints += static_cast<int>(colNext->size()); } if (m_environment == AthenaMonManager::online) { @@ -3098,7 +3015,7 @@ SCTHitsNoiseMonTool::makeVectorOfTrackRDOIdentifiers() { return StatusCode::SUCCESS; } // assemble list of rdo ids associated with tracks - for (int i = 0; i < (int) tracks->size(); i++) { + for (int i = 0; i < static_cast<int>(tracks->size()); i++) { const Trk::Track* track = (*tracks)[i]; if (track == 0) { ATH_MSG_WARNING("no pointer to track!!!"); @@ -3109,11 +3026,10 @@ SCTHitsNoiseMonTool::makeVectorOfTrackRDOIdentifiers() { if (trackStates == 0) { ATH_MSG_WARNING("for current track is TrackStateOnSurfaces == Null, no data will be written for this track"); }else {// Loop over all track states on surfaces - for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it = trackStates->begin(); - it != trackStates->end(); it++) { + for (const Trk::TrackStateOnSurface* TSOS: *trackStates) { // Get pointer to RIO of right type const InDet::SiClusterOnTrack* clus = - dynamic_cast<const InDet::SiClusterOnTrack*>((*it)->measurementOnTrack()); + dynamic_cast<const InDet::SiClusterOnTrack*>(TSOS->measurementOnTrack()); if (clus) { // Get Pointer to prepRawDataObject const InDet::SiCluster* RawDataClus = dynamic_cast<const InDet::SiCluster*>(clus->prepRawData()); diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx index f01a5b140c3f598d2444e7fe83ef19ea1785052f..4b445177caf96aa1d69842cc98c9ca4a0bd4cee7 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx @@ -46,25 +46,15 @@ using namespace SCT_Monitoring; // ==================================================================================================== SCTLorentzMonTool::SCTLorentzMonTool(const string& type, const string& name, const IInterface* parent) : SCTMotherTrigMonTool(type, name, parent), - m_trackToVertexTool("Reco::TrackToVertex", this), // for TrackToVertexTool + m_numberOfEvents{0}, m_phiVsNstrips{}, m_phiVsNstrips_100{}, m_phiVsNstrips_111{}, m_phiVsNstrips_Side{}, m_phiVsNstrips_Side_100{}, m_phiVsNstrips_Side_111{}, + m_path{""}, m_pSCTHelper(nullptr) { - /** sroe 3 Sept 2015: - histoPathBase is declared as a property in the base class, assigned to m_path - with default as empty string. - Declaring it here as well gives rise to compilation warning - WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023 - - declareProperty("histoPathBase", m_stream = "/stat"); **/ - m_stream = "/stat"; - declareProperty("tracksName", m_tracksName = std::string("CombinedInDetTracks")); // this recommended - declareProperty("TrackToVertexTool", m_trackToVertexTool); // for TrackToVertexTool - m_numberOfEvents = 0; } // ==================================================================================================== @@ -160,13 +150,9 @@ SCTLorentzMonTool::fillHistograms() { ATH_MSG_WARNING(" TrackCollection not found: Exit SCTLorentzTool" << m_tracksName.key()); return StatusCode::SUCCESS; } - TrackCollection::const_iterator trkitr = tracks->begin(); - TrackCollection::const_iterator trkend = tracks->end(); - for (; trkitr != trkend; ++trkitr) { - // Get track - const Trk::Track* track = (*trkitr); - if (not track) { + for (const Trk::Track* track: *tracks) { + if (track==nullptr) { ATH_MSG_ERROR("no pointer to track!!!"); continue; } @@ -184,11 +170,10 @@ SCTLorentzMonTool::fillHistograms() { continue; } - DataVector<const Trk::TrackStateOnSurface>::const_iterator endit = trackStates->end(); - for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it = trackStates->begin(); it != endit; ++it) { - if ((*it)->type(Trk::TrackStateOnSurface::Measurement)) { + for (const Trk::TrackStateOnSurface* tsos: *trackStates) { + if (tsos->type(Trk::TrackStateOnSurface::Measurement)) { const InDet::SiClusterOnTrack* clus = - dynamic_cast<const InDet::SiClusterOnTrack*>((*it)->measurementOnTrack()); + dynamic_cast<const InDet::SiClusterOnTrack*>(tsos->measurementOnTrack()); if (clus) { // Is it a SiCluster? If yes... const InDet::SiCluster* RawDataClus = dynamic_cast<const InDet::SiCluster*>(clus->prepRawData()); if (not RawDataClus) { @@ -216,7 +201,7 @@ SCTLorentzMonTool::fillHistograms() { // find cluster size const std::vector<Identifier>& rdoList = RawDataClus->rdoList(); int nStrip = rdoList.size(); - const Trk::TrackParameters* trkp = dynamic_cast<const Trk::TrackParameters*>((*it)->trackParameters()); + const Trk::TrackParameters* trkp = dynamic_cast<const Trk::TrackParameters*>(tsos->trackParameters()); if (not trkp) { ATH_MSG_WARNING(" Null pointer to MeasuredTrackParameters"); continue; @@ -273,10 +258,9 @@ SCTLorentzMonTool::fillHistograms() { } }// end if passesCuts }// end if mtrkp - // delete perigee;perigee = 0; } // end if SCT.. } // end if (clus) - } // if ((*it)->type(Trk::TrackStateOnSurface::Measurement)){ + } // if (tsos->type(Trk::TrackStateOnSurface::Measurement)){ }// end of loop on TrackStatesonSurface (they can be SiClusters, TRTHits,..) } // end of loop on tracks diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx index b882276e2f16630e38f25ce2b335c7a66dc9890b..bf1c06182b3a6d83a317cf9356e6e216ec3fefc0 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx @@ -22,10 +22,9 @@ const std::string SCTMotherTrigMonTool::m_triggerNames[] = { SCTMotherTrigMonTool::SCTMotherTrigMonTool(const std::string& type, const std::string& name, const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), - m_doTrigger(true), m_isStream(false), m_firedTriggers(0) { - declareProperty("doTrigger", m_doTrigger); + declareProperty("doTrigger", m_doTrigger=true); } StatusCode diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx index 3674db6db4c86000466816a4eb4ebd85b9007377..2cad34ca67f12738a85c2ef79c7cf5b7e619b44f 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx @@ -108,7 +108,6 @@ SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string& type, m_nOneSideEndcapC_ev{}, m_nTwoSideEndcapC_ev{}, m_nNonGoodModulesEndcapC_ev{}, - // m_pnoiseoccupancymapHistoVectorECC{}, m_pnoiseoccupancymapHistoVectorECCSide0{}, m_pnoiseoccupancymapHistoVectorECCSide1{}, @@ -118,7 +117,6 @@ SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string& type, m_pnoiseoccupancymapHistoVectorECA{}, m_pnoiseoccupancymapHistoVectorECASide0{}, m_pnoiseoccupancymapHistoVectorECASide1{}, - // m_d1(0), m_n1(0), m_n1Barrel{}, @@ -127,28 +125,21 @@ SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string& type, m_d1Barrel{}, m_d1EndcapA{}, m_d1EndcapC{}, - // m_noSidesHit(false), m_oneSideHit(false), m_twoSidesHit(false), m_correct_TimeBin(false), - // m_nNoSides{}, m_nOneSide{}, m_nOneSide0{}, m_nOneSide1{}, m_nTwoSide{}, - // m_nLink0{}, m_nLink1{}, - /** goodModules init in ctor body **/ - // m_nLayer{}, m_nEta{}, m_nPhi{}, m_nNonGoodModule{}, - // - m_checkrecent(1), m_current_lb(0), m_last_reset_lb(0), m_set_timebin(-1), @@ -172,25 +163,21 @@ SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string& type, m_NZ1(nullptr), m_N11(nullptr), m_N21(nullptr), - // m_NZ1BAR{}, m_N11BAR{}, m_N21BAR{}, m_NZ1BAR_vsLB{}, m_N11BAR_vsLB{}, - // m_NZ1ECC{}, m_N11ECC{}, m_N21ECC{}, m_NZ1ECC_vsLB{}, m_N11ECC_vsLB{}, - // m_NZ1ECA{}, m_N11ECA{}, m_N21ECA{}, m_NZ1ECA_vsLB{}, m_N11ECA_vsLB{}, - // m_NO(nullptr), m_NOSide(nullptr), m_NO_vsLB(nullptr), @@ -212,33 +199,17 @@ SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string& type, m_NOECA_disk{}, m_NOECA_disk_vsLB{}, m_numberHitsinBarrel{}, - // m_NZ1_vs_modnum(nullptr), m_N11_vs_modnum(nullptr), - // - m_stream("/stat"), m_path(""), - m_tracksName(""), // never used? - m_NOTrigger("L1_RD0_EMPTY"), - m_dataObjectName(std::string("SCT_RDOs")), - m_eventInfoKey(std::string("EventInfo")), - m_pSCTHelper(nullptr), - m_checkBadModules(true), - m_ignore_RDO_cut_online(true) { - /** sroe 3 Sept 2015: - histoPathBase is declared as a property in the base class, assigned to m_path - with default as empty string. - Declaring it here as well gives rise to compilation warning - WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023 - declareProperty("histoPathBase", m_stream = "/stat"); **/ - m_stream = "/stat"; - declareProperty("checkBadModules", m_checkBadModules); + m_pSCTHelper(nullptr) { + declareProperty("checkBadModules", m_checkBadModules=true); declareProperty("CheckRate", m_checkrate = 1000); declareProperty("CheckRecent", m_checkrecent = 1); declareProperty("NOTrigger", m_NOTrigger = "L1_RD0_EMPTY"); - declareProperty("IgnoreRDOCutOnline", m_ignore_RDO_cut_online); + declareProperty("IgnoreRDOCutOnline", m_ignore_RDO_cut_online=true); - for (auto& i:m_goodModules) { + for (bool& i: m_goodModules) { i = true; } } @@ -249,7 +220,6 @@ StatusCode SCTRatioNoiseMonTool::initialize() { ATH_CHECK( SCTMotherTrigMonTool::initialize() ); ATH_CHECK( m_dataObjectName.initialize() ); - ATH_CHECK( m_eventInfoKey.initialize() ); return StatusCode::SUCCESS; } @@ -309,16 +279,12 @@ StatusCode SCTRatioNoiseMonTool::fillHistograms() { ATH_MSG_DEBUG("enters fillHistograms"); // lets get the raw hit container - typedef SCT_RDORawData SCTRawDataType; SG::ReadHandle<SCT_RDO_Container> p_rdocontainer(m_dataObjectName); if (not p_rdocontainer.isValid()) { return StatusCode::FAILURE; } Identifier SCT_Identifier; - // Use new IDC - SCT_RDO_Container::const_iterator col_it = p_rdocontainer->begin(); - SCT_RDO_Container::const_iterator lastCol = p_rdocontainer->end(); // Declare Time Bin m_set_timebin = 4; @@ -354,7 +320,8 @@ SCTRatioNoiseMonTool::fillHistograms() { SG::ReadHandle<xAOD::EventInfo> pEvent(m_eventInfoKey); if (not pEvent.isValid()) { - return ERROR("Could not find event pointer"), StatusCode::FAILURE; + ATH_MSG_ERROR("Could not find event pointer"); + return StatusCode::FAILURE; } const bool isSelectedTrigger = true; @@ -368,15 +335,13 @@ SCTRatioNoiseMonTool::fillHistograms() { m_current_lb = tmplb; int count_SCT_RDO = 0; if (isSelectedTrigger == true) { - for (; col_it != lastCol; ++col_it) { + for (const InDetRawDataCollection<SCT_RDORawData>* rd: *p_rdocontainer) { m_correct_TimeBin = false; - const InDetRawDataCollection<SCTRawDataType>* SCT_Collection(*col_it); - if (!SCT_Collection) { + if (rd==nullptr) { continue; // select only SCT RDOs } - const InDetRawDataCollection<SCT_RDORawData>* rd(*col_it); - Identifier SCT_Identifier = SCT_Collection->identify(); + Identifier SCT_Identifier = rd->identify(); int thisBec = m_pSCTHelper->barrel_ec(SCT_Identifier); int thisLayerDisk = m_pSCTHelper->layer_disk(SCT_Identifier); int thisPhi = m_pSCTHelper->phi_module(SCT_Identifier); @@ -393,11 +358,10 @@ SCTRatioNoiseMonTool::fillHistograms() { m_nNonGoodModule[m_modNum] = 1; } - DataVector<SCTRawDataType>::const_iterator p_rdo_end = SCT_Collection->end(); - for (DataVector<SCTRawDataType>::const_iterator p_rdo = SCT_Collection->begin(); p_rdo != p_rdo_end; ++p_rdo) { + for (const SCT_RDORawData* rdo: *rd) { count_SCT_RDO++; - const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData *>(*p_rdo); - if (rdo3 != 0) { + const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData*>(rdo); + if (rdo3) { m_tbin = (rdo3)->getTimeBin(); } if (timeBinInPattern(m_tbin, XIX) && goodModule) { diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx index af5c55d06ec04e8bcbca46ca852d951a5c3af998..830b748cdfff8394df1bbd3bed2bb1bd8a7450d3 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx @@ -70,6 +70,8 @@ SCTTracksMonTool::SCTTracksMonTool(const string& type, const IInterface* parent) : SCTMotherTrigMonTool(type, name, parent), m_nTracks(nullptr), + m_nTracks_buf{}, + m_nTracks_pos{0}, m_trackTrigger(nullptr), m_trackTriggerRate(nullptr), m_totalBarrelResidual(nullptr), @@ -114,29 +116,16 @@ SCTTracksMonTool::SCTTracksMonTool(const string& type, m_psctpulls_summaryHistoVector{}, m_psctpulls_summaryHistoVectorECp{}, m_psctpulls_summaryHistoVectorECm{}, - m_path(""), - m_useIDGlobal(false), - m_residualPullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator", this), + m_stream{"/stat"}, + m_path{""}, m_pSCTHelper(nullptr) { - /** sroe 3 Sept 2015: - histoPathBase is declared as a property in the base class, assigned to m_path - with default as empty string. - Declaring it here as well gives rise to compilation warning - WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023 - - declareProperty("histoPathBase", m_stream = "/stat"); **/ - m_stream = "/stat"; - declareProperty("tracksName", m_tracksName = std::string("SCT_Cosmic_Tracks")); // "ExtendedTracks"); declareProperty("trackHitCut", m_trackHitCut = 3); declareProperty("CheckRate", m_checkrate = 1000); declareProperty("doPositiveEndcap", m_doPositiveEndcap = true); - declareProperty("doNegativeEndcap", m_doNegativeEndcap = false); - declareProperty("ResPullCalc", m_residualPullCalculator); + declareProperty("doNegativeEndcap", m_doNegativeEndcap = true); declareProperty("useIDGlobal", m_useIDGlobal = false); declareProperty("doUnbiasedCalc", m_doUnbiasedCalc = true); declareProperty("EvtsBins", m_evtsbins = 5000); - m_nTracks_buf = nullptr; - m_nTracks_pos = 0; } // ==================================================================================================== @@ -145,7 +134,7 @@ StatusCode SCTTracksMonTool::initialize() { ATH_CHECK( SCTMotherTrigMonTool::initialize() ); ATH_CHECK( m_tracksName.initialize() ); - CHECK(m_residualPullCalculator.retrieve()); + ATH_CHECK(m_residualPullCalculator.retrieve()); return StatusCode::SUCCESS; } @@ -159,12 +148,12 @@ SCTTracksMonTool::bookHistogramsRecurrent() { if (newRunFlag()) { m_numberOfEvents = 0; } - CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); + ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); if (m_doUnbiasedCalc) { - CHECK(m_updator.retrieve()); + ATH_CHECK(m_updator.retrieve()); } // Booking Track related Histograms - CHECK(bookGeneralHistos()); + ATH_CHECK(bookGeneralHistos()); const bool doThisSubsystem[N_REGIONS] = { m_doNegativeEndcap, true, m_doPositiveEndcap }; @@ -190,12 +179,12 @@ SCTTracksMonTool::bookHistograms() { if (newRunFlag()) { m_numberOfEvents = 0; } - CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); + ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); if (m_doUnbiasedCalc) { - CHECK(m_updator.retrieve()); + ATH_CHECK(m_updator.retrieve()); } // Booking Track related Histograms - CHECK(bookGeneralHistos()); + ATH_CHECK(bookGeneralHistos()); const bool doThisSubsystem[N_REGIONS] = { m_doNegativeEndcap, true, m_doPositiveEndcap }; @@ -272,9 +261,7 @@ SCTTracksMonTool::fillHistograms() { return StatusCode::SUCCESS; } int local_tot_trkhits(0); - TrackCollection::const_iterator trkend(tracks->end()); - TrackCollection::const_iterator trkbegin(tracks->begin()); - if (trkend == trkbegin) { + if (tracks->size()==0) { if (m_doTrigger) { for (int trig(0); trig != N_TRIGGER_TYPES; ++trig) { m_trackTriggerRate->Fill(trig, 0); @@ -286,13 +273,12 @@ SCTTracksMonTool::fillHistograms() { } int goodTrks_N = 0; ATH_MSG_DEBUG("Begin loop over " << tracks->size() << " tracks"); - for (TrackCollection::const_iterator trkitr(tracks->begin()); trkitr != trkend; ++trkitr) { - int local_scthits = 0; - const Trk::Track* track = (*trkitr); + for (const Trk::Track* track: *tracks) { if (not track) { ATH_MSG_ERROR("No pointer to track"); break; } + int local_scthits = 0; int scthits_on_trk(0); // Breaks out of loop if track has less than 3 sct hits const Trk::TrackSummary* trkSum(track->trackSummary()); if (trkSum) { @@ -365,9 +351,9 @@ SCTTracksMonTool::fillHistograms() { H1_t residualsSummaryHistogram(0); H1_t pullsSummaryHistogram(0); DataVector<const Trk::TrackStateOnSurface>::const_iterator endit(trackStates->end()); - for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it(trackStates->begin()); it != endit; ++it) { - if ((*it)->type(Trk::TrackStateOnSurface::Measurement)) { - const InDet::SiClusterOnTrack* clus(dynamic_cast<const InDet::SiClusterOnTrack*>((*it)->measurementOnTrack())); + for (const Trk::TrackStateOnSurface* tsos: *trackStates) { + if (tsos->type(Trk::TrackStateOnSurface::Measurement)) { + const InDet::SiClusterOnTrack* clus(dynamic_cast<const InDet::SiClusterOnTrack*>(tsos->measurementOnTrack())); if (clus) { // Is it a SiCluster? If yes... const InDet::SiCluster* RawDataClus(dynamic_cast<const InDet::SiCluster*>(clus->prepRawData())); if (not RawDataClus) { @@ -384,14 +370,14 @@ SCTTracksMonTool::fillHistograms() { const bool doThisDetector(doThisSubsystem[subsystemIndex]); hasHits[subsystemIndex] = true; const Trk::TrackParameters* trkParameters(0); - const Trk::RIO_OnTrack* rio(dynamic_cast<const Trk::RIO_OnTrack*>((*it)->measurementOnTrack())); + const Trk::RIO_OnTrack* rio(dynamic_cast<const Trk::RIO_OnTrack*>(tsos->measurementOnTrack())); bool updateSucceeds(true); if (rio) { #ifndef NDEBUG ATH_MSG_DEBUG("if rio"); #endif if (m_doUnbiasedCalc) { - const Trk::TrackParameters* trkParam((*it)->trackParameters()); + const Trk::TrackParameters* trkParam(tsos->trackParameters()); if (trkParam) { trkParameters = m_updator->removeFromState(*trkParam, rio->localParameters(), rio->localCovariance()); updateSucceeds = (trkParameters != 0); @@ -401,7 +387,7 @@ SCTTracksMonTool::fillHistograms() { ATH_MSG_DEBUG("not rio"); } if (!trkParameters) { - trkParameters = (*it)->trackParameters(); + trkParameters = tsos->trackParameters(); } if (trkParameters) { const AmgVector(5) LocalTrackParameters(trkParameters->parameters()); @@ -410,11 +396,11 @@ SCTTracksMonTool::fillHistograms() { ATH_MSG_DEBUG("Cluster Position Phi= " << clus->localParameters()[Trk::locX]); #endif if (!m_residualPullCalculator.empty()) { - const Trk::ResidualPull* residualPull(m_residualPullCalculator->residualPull(rio, trkParameters, - m_doUnbiasedCalc ? Trk::ResidualPull::Unbiased : Trk::ResidualPull::Biased)); + std::unique_ptr<const Trk::ResidualPull> residualPull(m_residualPullCalculator->residualPull(rio, trkParameters, + m_doUnbiasedCalc ? Trk::ResidualPull::Unbiased : Trk::ResidualPull::Biased)); if (!residualPull) { ATH_MSG_WARNING("Residual Pull Calculator did not succeed!"); - return StatusCode::FAILURE; + return StatusCode::SUCCESS; } else { float local_residual(residualPull->residual()[Trk::locX]); float local_pull(residualPull->pull()[Trk::locX]); @@ -454,8 +440,6 @@ SCTTracksMonTool::fillHistograms() { } } } - delete residualPull; - residualPull = 0; } } else { // no measured local parameters, pull won't be calculated ATH_MSG_WARNING("No measured local parameters, pull won't be calculated"); @@ -519,7 +503,7 @@ SCTTracksMonTool::fillHistograms() { } } // end if SCT.. } // end if (clus) - } // if ((*it)->type(Trk::TrackStateOnSurface::Measurement)) + } // if (tsos->type(Trk::TrackStateOnSurface::Measurement)) }// end of loop on TrackStatesonSurface (they can be SiClusters, TRTHits,..) m_trk_ncluHisto->Fill(local_scthits, 1.); // We now know whether this particular track had hits in the barrel or endcaps- update the profile histogram @@ -538,7 +522,7 @@ SCTTracksMonTool::fillHistograms() { } } // Time Dependent SP plots only online - m_nTracks_buf[m_nTracks_pos] = (int) (m_trk_chi2->GetEntries()); + m_nTracks_buf[m_nTracks_pos] = static_cast<int>(m_trk_chi2->GetEntries()); m_nTracks_pos++; if (m_nTracks_pos == m_evtsbins) { m_nTracks_pos = 0; @@ -652,16 +636,15 @@ SCTTracksMonTool::checkHists(bool /*fromFinalize*/) { } // (*residualsRms[0])[0]->GetXaxis()->SetTitle("Index in the direction of #eta"); } - // Now checking RMS and Means of Pulls 1D Histos + // Now checking RMS and Means of Pulls 1D Histos TF1 pullgaus("pullgaus", "gaus"); pullgaus.SetParameter(1, 0.); pullgaus.SetParameter(2, 1.); if (not m_psctpulls_summaryHistoVector.empty()) { - VecH1_t::const_iterator endit(m_psctpulls_summaryHistoVector.end()); - for (VecH1_t::const_iterator it(m_psctpulls_summaryHistoVector.begin()); it != endit; ++it) { - if ((*it)->GetEntries() > 2) {// only fit if #entries > 1, otherwise root crashes - ATH_MSG_DEBUG("GetEntries = " << (*it)->GetEntries()); - (*it)->Fit("pullgaus", "Q", "", -2., 2.); // Fit Pulls with a gaussian, Quiet mode ; adding 'N' would aslo do no + for (const H1_t h1: m_psctpulls_summaryHistoVector) { + if (h1->GetEntries() > 2) {// only fit if #entries > 1, otherwise root crashes + ATH_MSG_DEBUG("GetEntries = " << h1->GetEntries()); + h1->Fit("pullgaus", "Q", "", -2., 2.); // Fit Pulls with a gaussian, Quiet mode ; adding 'N' would aslo do no // drawing of the fitted function: the increase in speed is small, // though. double par[3], epar[3]; @@ -670,10 +653,10 @@ SCTTracksMonTool::checkHists(bool /*fromFinalize*/) { epar[i] = pullgaus.GetParError(i); // error on the params } if (abs(par[1]) > 5. * epar[1]) { - (*it)->SetLineColor(2); + h1->SetLineColor(2); } if ((par[2] - 5. * epar[2]) > 2.) { - (*it)->SetLineColor(2); + h1->SetLineColor(2); } } } @@ -689,7 +672,7 @@ SCTTracksMonTool::checkHists(bool /*fromFinalize*/) { // use kalman updator to get unbiased states IAlgTool* algTool; ListItem ltool("Trk::KalmanUpdator/TrkKalmanUpdator"); - CHECK(toolSvc()->retrieveTool(ltool.type(), ltool.name(), algTool)); + ATH_CHECK(toolSvc()->retrieveTool(ltool.type(), ltool.name(), algTool)); m_updator = dynamic_cast<Trk::IUpdator*>(algTool); if (not m_updator ) { ATH_MSG_FATAL("Could not get KalmanUpdator for unbiased track states"); @@ -727,28 +710,28 @@ SCTTracksMonTool::bookGeneralHistos() { m_tracksPerRegion->GetXaxis()->SetBinLabel(1, "EndCapC"); m_tracksPerRegion->GetXaxis()->SetBinLabel(2, "Barrel"); m_tracksPerRegion->GetXaxis()->SetBinLabel(3, "EndCapA"); - CHECK(Tracks.regHist(m_tracksPerRegion)); + ATH_CHECK(Tracks.regHist(m_tracksPerRegion)); m_totalBarrelResidual = new TH1F("totalBarrelResidual", "Overall Residual Distribution for the Barrel", 100, -0.5, 0.5); m_totalBarrelResidual->GetXaxis()->SetTitle("Residual [mm]"); - CHECK(Tracks.regHist(m_totalBarrelResidual)); + ATH_CHECK(Tracks.regHist(m_totalBarrelResidual)); m_totalEndCapAResidual = new TH1F("totalEndCapAResidual", "Overall Residual Distribution for the EndCapA", 100, -0.5, 0.5); m_totalEndCapAResidual->GetXaxis()->SetTitle("Residual [mm]"); - CHECK(Tracks.regHist(m_totalEndCapAResidual)); + ATH_CHECK(Tracks.regHist(m_totalEndCapAResidual)); m_totalEndCapCResidual = new TH1F("totalEndCapCResidual", "Overall Residual Distribution for the EndCapC", 100, -0.5, 0.5); m_totalEndCapCResidual->GetXaxis()->SetTitle("Residual [mm]"); - CHECK(Tracks.regHist(m_totalEndCapCResidual)); + ATH_CHECK(Tracks.regHist(m_totalEndCapCResidual)); m_totalBarrelPull = new TH1F("totalBarrelPull", "Overall Pull Distribution for the Barrel", 100, -5, 5); m_totalBarrelPull->GetXaxis()->SetTitle("Pull"); - CHECK(Tracks.regHist(m_totalBarrelPull)); + ATH_CHECK(Tracks.regHist(m_totalBarrelPull)); m_totalEndCapAPull = new TH1F("totalEndCapAPull", "Overall Pull Distribution for the EndCapA", 100, -5, 5); m_totalEndCapAPull->GetXaxis()->SetTitle("Pull"); - CHECK(Tracks.regHist(m_totalEndCapAPull)); + ATH_CHECK(Tracks.regHist(m_totalEndCapAPull)); m_totalEndCapCPull = new TH1F("totalEndCapCPull", "Overall Pull Distribution for the EndCapC", 100, -5, 5); m_totalEndCapCPull->GetXaxis()->SetTitle("Pull"); - CHECK(Tracks.regHist(m_totalEndCapCPull)); + ATH_CHECK(Tracks.regHist(m_totalEndCapCPull)); if (m_doTrigger == true) { m_trackTrigger = new TH1I("trackTriggers", "Tracks for different trigger types", N_TRIGGER_TYPES, -0.5, 7.5); // @@ -762,8 +745,8 @@ SCTTracksMonTool::bookGeneralHistos() { m_trackTrigger->GetXaxis()->SetBinLabel(trig + 1, SCTMotherTrigMonTool::m_triggerNames[trig].c_str()); m_trackTriggerRate->GetXaxis()->SetBinLabel(trig + 1, SCTMotherTrigMonTool::m_triggerNames[trig].c_str()); } - CHECK(Tracks.regHist(m_trackTrigger)); - CHECK(Tracks.regHist(m_trackTriggerRate)); + ATH_CHECK(Tracks.regHist(m_trackTrigger)); + ATH_CHECK(Tracks.regHist(m_trackTriggerRate)); } // Book histogram of track rate for different regions of the detector m_trackRate = new TProfile("SCTTrackRate", "Track per event for SCT regions", 3, 0.0, 3.0); @@ -771,56 +754,54 @@ SCTTracksMonTool::bookGeneralHistos() { m_trackRate->GetXaxis()->SetBinLabel(2, "Barrel"); m_trackRate->GetXaxis()->SetBinLabel(3, "EndcapA"); - CHECK(Tracks.regHist(m_trackRate)); + ATH_CHECK(Tracks.regHist(m_trackRate)); // m_trk_ncluHisto = new TH1F("trk_sct_hits", "SCT HITS per single Track", N_HIT_BINS, FIRST_HIT_BIN, LAST_HIT_BIN); m_trk_ncluHisto->GetXaxis()->SetTitle("Num of Hits"); - CHECK(Tracks.regHist(m_trk_ncluHisto)); + ATH_CHECK(Tracks.regHist(m_trk_ncluHisto)); m_trk_nclu_totHisto = new TH1F("sct_hits_onall_tracks", "SCT HITS on all event Tracks", N_HIT_BINS, FIRST_HIT_BIN, LAST_HIT_BIN); m_trk_nclu_totHisto->GetXaxis()->SetTitle("Num of SCT Hits"); m_trk_nclu_totHisto->GetYaxis()->SetTitle("Num of Events"); - CHECK(Tracks.regHist(m_trk_nclu_totHisto)); + ATH_CHECK(Tracks.regHist(m_trk_nclu_totHisto)); m_trk_chi2 = new TH1F("trk_chi2", "Track #chi^{2} div ndf", 150, 0., 150.); m_trk_chi2->GetXaxis()->SetTitle("Number of track #chi^{2}/NDF"); - CHECK(Tracks.regHist(m_trk_chi2)); + ATH_CHECK(Tracks.regHist(m_trk_chi2)); m_trk_N = new TH1F("trk_N", "Number of tracks", 400, 0, 4000); m_trk_N->GetXaxis()->SetTitle("Number of tracks"); - CHECK(Tracks.regHist(m_trk_N)); + ATH_CHECK(Tracks.regHist(m_trk_N)); m_trk_pt = new TH1F("trk_pt", "Track P_{T}", 150, 0., 150.); m_trk_pt->GetXaxis()->SetTitle("P_{T} [GeV]"); - CHECK(Tracks.regHist(m_trk_pt)); + ATH_CHECK(Tracks.regHist(m_trk_pt)); m_trk_d0 = new TH1F("trk_d0", "Track d0", 160, -40., 40.); m_trk_d0->GetXaxis()->SetTitle("d0 [mm]"); - CHECK(Tracks.regHist(m_trk_d0)); + ATH_CHECK(Tracks.regHist(m_trk_d0)); m_trk_z0 = new TH1F("trk_z0", "Track z0", 200, -200., 200.); m_trk_z0->GetXaxis()->SetTitle("z0 [mm]"); - CHECK(Tracks.regHist(m_trk_z0)); + ATH_CHECK(Tracks.regHist(m_trk_z0)); m_trk_phi = new TH1F("trk_phi", "Track Phi", 160, -4, 4.); m_trk_phi->GetXaxis()->SetTitle("#phi [rad]"); - CHECK(Tracks.regHist(m_trk_phi)); + ATH_CHECK(Tracks.regHist(m_trk_phi)); m_trk_eta = new TH1F("trk_eta", "Track Eta", 160, -4., 4.); m_trk_eta->GetXaxis()->SetTitle("#eta"); - CHECK(Tracks.regHist(m_trk_eta)); + ATH_CHECK(Tracks.regHist(m_trk_eta)); if (m_environment == AthenaMonManager::online) { m_nTracks = new TH1I("sct_tracks_vs_en", "Number of Tracks vs Event Number", m_evtsbins, 1, m_evtsbins + 1); m_nTracks->GetXaxis()->SetTitle("Event Number"); m_nTracks->GetYaxis()->SetTitle("Num of Tracks"); - size_t nTracks_buf_size; - nTracks_buf_size = m_evtsbins * sizeof(int); - m_nTracks_buf = (int*) malloc(nTracks_buf_size); + m_nTracks_buf.reserve(m_evtsbins); m_nTracks_pos = 0; - CHECK(Tracks.regHist(m_nTracks)); + ATH_CHECK(Tracks.regHist(m_nTracks)); } } return StatusCode::SUCCESS; @@ -884,9 +865,9 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) { string streamPull(string("pulls") + abbreviation + streamDelimiter + layerSide.name()); string titleResidual(string("SCT Residuals for ") + polarityString + ": " + layerSide.title()); string titlePull(string("SCT Pulls: ") + layerSide.title()); - CHECK(h1Factory(streamResidual + "_summary", "Summary " + titleResidual, 0.5, endCapTracksResi, + ATH_CHECK(h1Factory(streamResidual + "_summary", "Summary " + titleResidual, 0.5, endCapTracksResi, *p_residualsSummary)); - CHECK(h1Factory(streamPull + "_summary", "Summary " + titlePull, 5., endCapTracksPull, *p_pullsSummary)); + ATH_CHECK(h1Factory(streamPull + "_summary", "Summary " + titlePull, 5., endCapTracksPull, *p_pullsSummary)); } @@ -922,8 +903,8 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) { string titleResidual(string("SCT Residuals for ") + polarityString + ": " + layerSide.title()); string titlePull(string("SCT Pulls: ") + layerSide.title()); - CHECK(p2Factory(streamResidual, titleResidual, becVal, endCapTracksResi, *p_residuals)); - CHECK(p2Factory(streamPull, titlePull, becVal, endCapTracksPull, *p_pulls)); + ATH_CHECK(p2Factory(streamResidual, titleResidual, becVal, endCapTracksResi, *p_residuals)); + ATH_CHECK(p2Factory(streamPull, titlePull, becVal, endCapTracksPull, *p_pulls)); } for (unsigned int i(0); i != limit; ++i) { @@ -935,8 +916,8 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) { string streamPull("pullsRMS" + abbreviation + streamDelimiter + layerString + streamDelimiter + sideString); string titleResidual("SCT Residuals RMS for " + polarityString + ": " + layerSide.title()); string titlePull(string("SCT Pulls RMS for ") + polarityString + ": " + layerSide.title()); - CHECK(h2Factory(streamResidual, titleResidual, becVal, endCapTracksResi, *p_residualsRms)); - CHECK(h2Factory(streamPull, titlePull, becVal, endCapTracksPull, *p_pullsRms)); + ATH_CHECK(h2Factory(streamResidual, titleResidual, becVal, endCapTracksResi, *p_residualsRms)); + ATH_CHECK(h2Factory(streamPull, titlePull, becVal, endCapTracksPull, *p_pullsRms)); } } @@ -959,7 +940,7 @@ SCTTracksMonTool::h2Factory(const std::string& name, const std::string& title, } H2_t tmp = new TH2F(TString(name), TString( title), nEta, firstEta - 0.5, lastEta + 0.5, nPhi, firstPhi - 0.5, lastPhi + 0.5); - CHECK(registry.regHist(tmp)); + ATH_CHECK(registry.regHist(tmp)); storageVector.push_back(tmp); return StatusCode::SUCCESS; } @@ -980,7 +961,7 @@ SCTTracksMonTool::p2Factory(const std::string& name, const std::string& title, } Prof2_t tmp = new TProfile2D(TString(name), TString( title), nEta, firstEta - 0.5, lastEta + 0.5, nPhi, firstPhi - 0.5, lastPhi + 0.5, "s"); - CHECK(registry.regHist(tmp)); + ATH_CHECK(registry.regHist(tmp)); storageVector.push_back(tmp); return StatusCode::SUCCESS; } @@ -992,7 +973,7 @@ SCTTracksMonTool::h1Factory(const std::string& name, const std::string& title, c const float lo(-extent), hi(extent); H1_t tmp = new TH1F(TString(name), TString(title), nbins, lo, hi); - CHECK(registry.regHist(tmp)); + ATH_CHECK(registry.regHist(tmp)); storageVector.push_back(tmp); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/cArrayUtilities.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/cArrayUtilities.h deleted file mode 100644 index d94e20aaf96c556c1861c840eeb0bea1067729e8..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/cArrayUtilities.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef SCT_MonitoringcArrayUtilities_h -#define SCT_MonitoringcArrayUtilities_h - -/** @file cArrayUtilities.cxx - * - * - * @author Shaun Roe - * Header amnd implementation for utiities dealing with - * C-style arrays - */ - - -namespace SCT_Monitoring { - // give the total size of a 3D C-style array - template<class T, int Size1, int Size2, int Size3> - int - extent(T (&/*parray*/)[Size1][Size2][Size3]) { - return Size1 * Size2 * Size3; - } - - // give the total size of a 2D C-style array - template<class T, int Size1, int Size2> - int - extent(T (&/*parray*/)[Size1][Size2]) { - return Size1 * Size2; - } - - // give beyond-the-end pointer for 2D C-style array - template<class T, int Size1, int Size2> - T * - endof(T (&parray)[Size1][Size2]) { - return &(parray[0][0]) + extent(parray); - } - - // give the byte size of a 3D C-style array - template<class T, int Size1, int Size2, int Size3> - int - byte_extent3D(T (&)[Size1][Size2][Size3]) { - return Size1 * Size2 * Size3 * sizeof(T); - } - - // give the byte size of a 2D C-style array - template<class T, int Size1, int Size2> - int - byte_extent(T (&)[Size1][Size2]) { - return Size1 * Size2 * sizeof(T); - } - - // give the byte size of a 1D C-style array - template<class T, int Size1> - int - byte_extent1D(T (&)[Size1]) { - return Size1 * sizeof(T); - } - - template <class T, int Size1, int Size2, int Size3> - void - clear3D(T (&parray)[Size1][Size2][Size3]) { - memset(parray, 0, byte_extent3D(parray)); - } - - template <class T, int Size1, int Size2> - void - clear(T (&parray)[Size1][Size2]) { - memset(parray, 0, byte_extent(parray)); - } - - // for 1-D arrays - template <class T, int Size1> - void - clear1D(T (&parray)[Size1]) { - memset(parray, 0, byte_extent1D(parray)); - } -} -#endif diff --git a/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlID_Exception.h b/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlID_Exception.h index 30f467e4c8434da9ca704a313a3b978dc6e69d06..b7dbe3cc109ee4f220b6d0862b0a20e3ba269c99 100755 --- a/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlID_Exception.h +++ b/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlID_Exception.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef LARHARDWAREID_EXCEPTION_H @@ -24,12 +24,12 @@ public: /** * constructor to be used */ - LArOnlID_Exception(std::string l_message , int l_code) : m_message ( l_message ) , m_code ( l_code ) { } + LArOnlID_Exception(const std::string& l_message , int l_code) : m_message ( l_message ) , m_code ( l_code ) { } /** * set error message */ - void message(std::string l_message) { m_message = l_message ;} + void message(const std::string& l_message) { m_message = l_message ;} /** * return error message <br> diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.cxx b/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.cxx index ba1cd2df8a6b3730065ab9636da4c87c56a19473..9bf38bb166c3c2e76ebd91cc51f0efec2d13b152 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.cxx +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.cxx @@ -63,6 +63,7 @@ StatusCode MuonCacheCreator::execute (const EventContext& ctx) const { // Create the CSC cache container ATH_CHECK(createContainer(m_CscCacheKey, m_cscIdHelper->module_hash_max(), ctx)); // Create the RPC cache container + // Max should match 600 (hardcoded in RPC_RawDataProviderTool) ATH_CHECK(createContainer(m_RpcCacheKey, m_rpcIdHelper->module_hash_max(), ctx)); // Create the TGC cache container ATH_CHECK(createContainer(m_TgcCacheKey, m_tgcIdHelper->module_hash_max(), ctx)); diff --git a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RPC_RawDataProviderTool.cxx b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RPC_RawDataProviderTool.cxx index 7cc1e4841c91dc4bb35c753667c7eaf257d09999..402ed5c8dd1b14ec45cbef46c2c02853f9047f69 100644 --- a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RPC_RawDataProviderTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RPC_RawDataProviderTool.cxx @@ -33,10 +33,13 @@ Muon::RPC_RawDataProviderTool::RPC_RawDataProviderTool( AthAlgTool(t, n, p), m_decoder("Muon::RpcROD_Decoder/RpcROD_Decoder", this), m_AllowCreation(false), - m_robDataProvider ("ROBDataProviderSvc",n) + m_robDataProvider ("ROBDataProviderSvc",n), + m_WriteOutRpcSectorLogic(true) { declareInterface<IMuonRawDataProviderTool>(this); declareProperty("Decoder", m_decoder); + declareProperty("RpcContainerCacheKey", m_rdoContainerCacheKey, "Optional external cache for the RPC container"); + declareProperty("WriteOutRpcSectorLogic", m_WriteOutRpcSectorLogic, "Turn on/off RpcSectorLogic writing"); } @@ -50,11 +53,20 @@ StatusCode Muon::RPC_RawDataProviderTool::initialize() StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; - sc = service("ActiveStoreSvc", m_activeStore); - if ( !sc.isSuccess() ) { - ATH_MSG_FATAL( "Could not get active store service" ); - return sc; - } + sc = service("ActiveStoreSvc", m_activeStore); + if ( !sc.isSuccess() ) { + ATH_MSG_FATAL( "Could not get active store service" ); + return sc; + } + + ATH_CHECK( m_rdoContainerCacheKey.initialize( !m_rdoContainerCacheKey.key().empty() ) ); + + // We should only turn off the sector logic when running with cached data a la trigger mode + if(!m_rdoContainerCacheKey.key().empty() && m_WriteOutRpcSectorLogic){ + ATH_MSG_FATAL("Cannot write out RpcSectorLogic while running with cached RpcPad containers" + " as the RpcSectorLogic is not cached at the same time and the written containers will desync." + " Please turn off RpcSectorLogic writing when running with cached bytestream container"); + } if (m_decoder.retrieve().isFailure()) { @@ -64,7 +76,6 @@ StatusCode Muon::RPC_RawDataProviderTool::initialize() else ATH_MSG_INFO( "Retrieved tool " << m_decoder ); - //m_hashfunc = new RpcPadIdHash(); // get cabling svc @@ -152,15 +163,10 @@ StatusCode Muon::RPC_RawDataProviderTool::initialize() } } else has_bytestream = true; - //{ - // msg(MSG::FATAL) << "Cannot get the job configuration" << endmsg; - //return StatusCode::FAILURE; - //} - // register the container only when the imput from ByteStream is set up m_activeStore->setStore( &*evtStore() ); - if( has_bytestream || m_RpcPadC.key() != "RPCPAD" ) + if( has_bytestream || m_containerKey.key() != "RPCPAD" ) { m_AllowCreation= true; } @@ -171,7 +177,7 @@ StatusCode Muon::RPC_RawDataProviderTool::initialize() ATH_MSG_INFO( "initialize() successful in " << name()); - ATH_CHECK( m_RpcPadC.initialize() ); + ATH_CHECK( m_containerKey.initialize() ); ATH_CHECK( m_sec.initialize() ); return StatusCode::SUCCESS; @@ -230,62 +236,86 @@ StatusCode Muon::RPC_RawDataProviderTool::convert(const std::vector<IdentifierHa } // the old one StatusCode Muon::RPC_RawDataProviderTool::convert(const ROBFragmentList& vecRobs, - const std::vector<IdentifierHash>& collections) + const std::vector<IdentifierHash>& collections) { //CALLGRIND_START_INSTRUMENTATION // retrieve the container through the MuonRdoContainerManager becasue // if the MuonByteStream CNV has to be used, the container must have been // registered there! - m_activeStore->setStore( &*evtStore() ); - - if(m_AllowCreation == false) - { - ATH_MSG_WARNING( "Container create disabled due to byte stream"); - + m_activeStore->setStore( &*evtStore() ); + + if(m_AllowCreation == false) + { + ATH_MSG_WARNING( "Container create disabled due to byte stream"); + return StatusCode::SUCCESS; // Maybe it should be false to stop the job // because the convert method should not // have been called .... but this depends // on the user experience - } + } - SG::WriteHandle<RpcPadContainer> padHandle(m_RpcPadC); - if (padHandle.isPresent()) - return StatusCode::SUCCESS; - auto pad = std::make_unique<RpcPadContainer> (padMaxIndex); - - SG::WriteHandle<RpcSectorLogicContainer> logicHandle(m_sec); - auto logic = std::make_unique<RpcSectorLogicContainer>(); - - for (ROBFragmentList::const_iterator itFrag = vecRobs.begin(); itFrag != vecRobs.end(); itFrag++) + SG::WriteHandle<RpcPadContainer> rdoContainerHandle(m_containerKey); + if (rdoContainerHandle.isPresent()) + return StatusCode::SUCCESS; + + + // Split the methods to have one where we use the cache and one where we just setup the container + const bool externalCacheRDO = !m_rdoContainerCacheKey.key().empty(); + if(!externalCacheRDO){ + ATH_CHECK( rdoContainerHandle.record(std::make_unique<RpcPadContainer> (padMaxIndex) ) ); + ATH_MSG_DEBUG( "Created RpcPadContainer" ); + } + else{ + SG::UpdateHandle<RpcPad_Cache> update(m_rdoContainerCacheKey); + ATH_CHECK(update.isValid()); + ATH_CHECK(rdoContainerHandle.record (std::make_unique<RpcPadContainer>( update.ptr() ))); + ATH_MSG_DEBUG("Created container using cache for " << m_rdoContainerCacheKey.key()); + } + + RpcPadContainer* pad = rdoContainerHandle.ptr(); + + SG::WriteHandle<RpcSectorLogicContainer> logicHandle(m_sec); + auto logic = std::make_unique<RpcSectorLogicContainer>(); + + // Reset to a nullptr (logic.get() will pass this through to decoder) + if(!m_WriteOutRpcSectorLogic) logic.reset(); + + for (ROBFragmentList::const_iterator itFrag = vecRobs.begin(); itFrag != vecRobs.end(); itFrag++) + { + //convert only if data payload is delivered + if ( (**itFrag).rod_ndata()!=0 ) { - //convert only if data payload is delivered - if ( (**itFrag).rod_ndata()!=0 ) - { - std::vector<IdentifierHash> coll = - to_be_converted(**itFrag,collections); - - if (m_decoder->fillCollections(**itFrag, *pad, coll, logic.get()).isFailure()) - { - // store the error conditions into the StatusCode and continue - } - } - else - { - if(msgLvl(MSG::DEBUG)) - { - uint32_t sourceId= (**itFrag).source_id(); - msg(MSG::DEBUG) << " ROB " << MSG::hex << sourceId + std::vector<IdentifierHash> coll = to_be_converted(**itFrag,collections); + + if (m_decoder->fillCollections(**itFrag, *pad, coll, logic.get()).isFailure()) + { + // store the error conditions into the StatusCode and continue + } + } + else + { + if(msgLvl(MSG::DEBUG)) + { + uint32_t sourceId= (**itFrag).source_id(); + msg(MSG::DEBUG) << " ROB " << MSG::hex << sourceId << " is delivered with an empty payload" << MSG::dec << endmsg; - } - // store the error condition into the StatusCode and continue - } + } + // store the error condition into the StatusCode and continue } - ATH_CHECK( padHandle.record (std::move (pad)) ); + } + + ATH_MSG_DEBUG("After processing, number of collections in container : " << pad-> numberOfCollections() ); + + // Only write out the RpcSectorLogigContainer if we activate the flag + if(m_WriteOutRpcSectorLogic){ + ATH_MSG_DEBUG("Writing out RpcSectorLogicContainer"); ATH_CHECK( logicHandle.record (std::move (logic)) ); - //in presence of errors return FAILURE -//CALLGRIND_STOP_INSTRUMENTATION - return StatusCode::SUCCESS; + } + + //in presence of errors return FAILURE + //CALLGRIND_STOP_INSTRUMENTATION + return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RPC_RawDataProviderTool.h b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RPC_RawDataProviderTool.h index c1a2778c582a6b99f696a755317fb56474494cb0..5c0bcf1405505b48bbdff4060aee8fd67ac41a10 100644 --- a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RPC_RawDataProviderTool.h +++ b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RPC_RawDataProviderTool.h @@ -9,6 +9,7 @@ #include "GaudiKernel/ToolHandle.h" #include "MuonCnvToolInterfaces/IMuonRawDataProviderTool.h" #include "MuonRDO/RpcPadContainer.h" +#include "MuonRDO/RpcPad_Cache.h" #include "MuonRDO/RpcSectorLogicContainer.h" class StoreGateSvc; @@ -54,7 +55,7 @@ private: // ServiceHandle<StoreGateSvc> m_eventStore; ToolHandle<IRpcROD_Decoder> m_decoder; // std::string m_rdoContainerKey; - SG::WriteHandleKey<RpcPadContainer> m_RpcPadC { + SG::WriteHandleKey<RpcPadContainer> m_containerKey { this, "RdoLocation", "RPCPAD", "Name of the RPCPAD produced by RawDataProvider"}; SG::WriteHandleKey<RpcSectorLogicContainer> m_sec{ this, "RPCSec", "RPC_SECTORLOGIC", "Name of the RPC_SECTORLOGIC produced by RawDataProvider"}; @@ -68,6 +69,12 @@ private: const IRPCcablingSvc *m_rpcCabling; // Rob Data Provider handle ServiceHandle<IROBDataProviderSvc> m_robDataProvider; + + /// RPC container cache key + SG::UpdateHandleKey<RpcPad_Cache> m_rdoContainerCacheKey ; + /// Turn on/off RpcSectorConfig writing + bool m_WriteOutRpcSectorLogic; + }; diff --git a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.cxx b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.cxx index 892c4619d5d92369408c248e425f18ba4e837606..eedd0ab1794f31dc06eac223ca3dfbb61a62a79f 100755 --- a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.cxx +++ b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.cxx @@ -38,7 +38,7 @@ Muon::RpcROD_Decoder::RpcROD_Decoder ( const std::string& type, const std::strin m_decodeSL(false), //m_byteStreamErrSvc("RPC_ByteStreamErrorSvc",name), m_cabling(0), - m_pRpcIdHelper(0) //,m_bench("RpcROD_Decoder") + m_pRpcIdHelper(0) //,m_bench("RpcROD_Decoder"), { declareInterface< IRpcROD_Decoder >( this ); declareProperty("SpecialROBNumber",m_specialROBNumber=-1); @@ -54,58 +54,49 @@ Muon::RpcROD_Decoder::~RpcROD_Decoder() { } StatusCode Muon::RpcROD_Decoder::initialize() { - - ServiceHandle<IRPCcablingServerSvc> rpc_server("RPCcablingServerSvc", name()); if (rpc_server.retrieve().isFailure()) { - msg(MSG::FATAL) << " Can't get RPCcablingServerSvc " << endmsg; - return StatusCode::FAILURE; - } + ATH_MSG_FATAL("Can't get RPCcablingServerSvc" ); + return StatusCode::FAILURE; + } - if (StatusCode::SUCCESS != rpc_server->giveCabling(m_cabling)) { - msg(MSG::FATAL) << " Can't get RPCcablingSvc from Server" << endmsg; - return StatusCode::FAILURE; - } + if (StatusCode::SUCCESS != rpc_server->giveCabling(m_cabling)) { + ATH_MSG_FATAL("Can't get RPCcablingSvc from Server"); + return StatusCode::FAILURE; + } - StatusCode status=StatusCode::SUCCESS; + StatusCode status=StatusCode::SUCCESS; // Get the RPC id helper from the detector store - status = detStore()->retrieve(m_pRpcIdHelper, "RPCIDHELPER"); - if (status.isFailure()) { - msg(MSG::FATAL) << "Could not get RpcIdHelper !" << endmsg; - return StatusCode::FAILURE; - } - else { - msg(MSG::VERBOSE) << " Found the RpcIdHelper. " << endmsg; - } - - //m_hashfunc = new RpcPadIdHash(); - - if (m_specialROBNumber>0) { - msg(MSG::DEBUG) << "Setting the special ROB Number to: 0x" << MSG::hex << m_specialROBNumber - << MSG::dec <<endmsg; - } - - //==LBTAG initialize vector and variables for format failure check - for(int i=0; i<13; i++) m_RPCcheckfail[i]=0; - m_previous=0; - m_printerror=0; - - return StatusCode::SUCCESS; - + status = detStore()->retrieve(m_pRpcIdHelper, "RPCIDHELPER"); + if (status.isFailure()) { + ATH_MSG_FATAL("Could not get RpcIdHelper !"); + return StatusCode::FAILURE; + } + else { + ATH_MSG_VERBOSE("Found the RpcIdHelper."); + } + + if (m_specialROBNumber>0) { + ATH_MSG_DEBUG("Setting the special ROB Number to: 0x" << MSG::hex << m_specialROBNumber << MSG::dec ); + } + + //==LBTAG initialize vector and variables for format failure check + for(int i=0; i<13; i++) m_RPCcheckfail[i]=0; + m_previous=0; + m_printerror=0; + + return StatusCode::SUCCESS; } StatusCode Muon::RpcROD_Decoder::finalize() { - //if(m_hashfunc) delete m_hashfunc; - //==LBTAG print format failure final statistics printcheckformat(); - - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.h b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.h index fa594a3cf2765cb9c8f722194662c786f2a6f02f..93842df2fa9a4e745e136215356273f988701922 100755 --- a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.h +++ b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder.h @@ -388,6 +388,7 @@ namespace Muon RpcPadContainer& rdoIdc, const std::vector<IdentifierHash> &collections, RpcSectorLogicContainer* RPC_SECTORLOGIC) const { + try { robFrag.check (); @@ -395,10 +396,13 @@ namespace Muon catch (eformat::Issue &ex) { - if(msgLvl(MSG::VERBOSE)) msg() << ex.what () << endmsg; + ATH_MSG_VERBOSE(ex.what()); return StatusCode::FAILURE; // error in fragment } + if(RPC_SECTORLOGIC == nullptr){ + ATH_MSG_DEBUG("RPC_SECTORLOGIC is null, so we will skip decoding the sector logic information"); + } // get the pointer to the data BS data; @@ -411,13 +415,11 @@ namespace Muon uint32_t rod_sourceId= robFrag.rod_source_id(); uint16_t subDetector=(sourceId & 0xff0000)>>16; - - if(msgLvl(MSG::VERBOSE)) msg() << "ROD version: " << MSG::hex << version + ATH_MSG_VERBOSE("ROD version: " << MSG::hex << version << MSG::dec << " ROB source ID: " << MSG::hex << sourceId << MSG::dec << " ROD source ID: " << MSG::hex << rod_sourceId << MSG::dec << " Subdetector: " << MSG::hex << subDetector - << MSG::dec << endmsg; - + << MSG::dec); // chose the right decoding routine @@ -456,7 +458,7 @@ namespace Muon StatusCode cnv_sc; - + /* // unpack the 32 bits words into 16 bits // no ROD header and footer @@ -505,77 +507,98 @@ namespace Muon // here optimize decoding of ROB fragment (for data only type==3) if (type==3) - { - std::map<Identifier,RpcPad*> mapOfCollections; - std::vector<IdentifierHash>::const_iterator it = collections.begin(); - for( ; it!=collections.end(); ++it) - { - RpcPadContainer::const_iterator itColl = rdoIdc.indexFind(*it); - if (itColl == rdoIdc.end()) - { - if(msgLvl(MSG::VERBOSE) ) msg(MSG::VERBOSE) << " Created new Pad Collection Hash ID = " - << static_cast<unsigned int>(*it) << endmsg; + { + std::map<Identifier,RpcPad*> mapOfCollections; + // Request to update to range-based for-loop + for(const IdentifierHash& it : collections){ + + // Normally, we would get a write handle and put a lock, but we do not process the decoding in this loop + // Therefore, we just query the cache via the container and process the hashes which have not been decoded yet + // Note that this means different threads may decode the same data if processing simultaneously + // However, only one will be written to the cache using the lock + + bool alreadyPresent = rdoIdc.tryFetch( it ); - // create new collection - RpcPad* coll = new RpcPad((m_cabling->padHashFunction())->identifier(*it), *it); - mapOfCollections[coll->identify()]=coll; + if(alreadyPresent){ + ATH_MSG_DEBUG ( "RPC RDO collection already exist with collection hash = " << static_cast<unsigned int>(it) << " converting is skipped!"); + } + else{ + ATH_MSG_DEBUG ( "Created new Pad Collection Hash ID = " << static_cast<unsigned int>(it) ); + + // create new collection - I should be doing this with unique_ptr but it requires changing downstream functions + RpcPad* coll = new RpcPad((m_cabling->padHashFunction())->identifier(it), it); + mapOfCollections[coll->identify()]=coll; + }// endif collection not found in the container - }//end loop over vector of hash id + }//end loop over vector of hash id - if (mapOfCollections.empty()) { - ATH_MSG_VERBOSE("mapOfCollections is empty; fillCollectionsFromRob_v302 will not be called"); - cnv_sc = StatusCode::SUCCESS; - return cnv_sc; - } - - cnv_sc = fillCollectionsFromRob_v302(data,robFrag.rod_ndata(),mapOfCollections,rod_sourceId, RPC_SECTORLOGIC); - if (cnv_sc!=StatusCode::SUCCESS) - { + if (mapOfCollections.empty()) { + ATH_MSG_VERBOSE("mapOfCollections is empty; fillCollectionsFromRob_v302 will not be called"); + cnv_sc = StatusCode::SUCCESS; + return cnv_sc; + } + + // RpcPadCollections not decoded and in container are identified and passed explicitly to decoder + cnv_sc = fillCollectionsFromRob_v302(data,robFrag.rod_ndata(),mapOfCollections,rod_sourceId, RPC_SECTORLOGIC); + if (cnv_sc!=StatusCode::SUCCESS) + { if (cnv_sc==StatusCode::RECOVERABLE) { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Decoding errors found "<<endmsg; + ATH_MSG_DEBUG("Decoding errors found "); } - else return cnv_sc; // exit if failure - } - for (std::map<Identifier,RpcPad*>::const_iterator it=mapOfCollections.begin(); it!=mapOfCollections.end(); ++it) - { - // add collection into IDC - RpcPadContainer::const_iterator itColl = rdoIdc.indexFind(((*it).second)->identifyHash()); - if (itColl == rdoIdc.end()) - { - if (rdoIdc.addCollection((*it).second, ((*it).second)->identifyHash()).isFailure()) - { - msg(MSG::ERROR) << "Failed to add RPC PAD collection to container" - << endmsg; - //report the error condition - } - else ATH_MSG_DEBUG("Adding RpcPad collection with hash "<<(int)((*it).second)->identifyHash()<<" to the RpcPad Container | size = "<<((*it).second)->size()); - } - } - return cnv_sc; - }//endif (type==3) + else + return cnv_sc; // exit if failure + } + + // All un-decoded collections were decoded successfully, so they are passed back to the IDC + // Request to update to range-based for-loop + for(const std::map<Identifier, RpcPad*>::value_type& it : mapOfCollections){ + // Get the WriteHandle for this hash but we need to then check if it has already been decoded and + // added to the event cache for this hash in a different view + RpcPadContainer::IDC_WriteHandle lock = rdoIdc.getWriteHandle( (it.second)->identifyHash() ); + + if(lock.alreadyPresent()){ + ATH_MSG_DEBUG("RpcPad collection with hash " << (int)(it.second)->identifyHash() << " was already decoded in a parallel view"); + } + else{ + // Take the pointer and pass ownership to unique_ptr and pass to the IDC_WriteHandle + StatusCode status_lock = lock.addOrDelete( std::move( std::unique_ptr<RpcPad>(it.second) ) ); + + if(status_lock != StatusCode::SUCCESS) + { + ATH_MSG_ERROR("Failed to add RPC PAD collection to container with hash " << (int)(it.second)->identifyHash() ); + } + else{ + ATH_MSG_DEBUG("Adding RpcPad collection with hash "<<(int)(it.second)->identifyHash()<<" to the RpcPad Container | size = "<<(it.second)->size()); + } + } + } + return cnv_sc; + }//endif (type==3) - std::vector<IdentifierHash>::const_iterator it = collections.begin(); - for( ; it!=collections.end(); ++it) - { - RpcPadContainer::const_iterator itColl = rdoIdc.indexFind(*it); - if (itColl == rdoIdc.end()) - { - if(msgLvl(MSG::VERBOSE) ) msg(MSG::VERBOSE) << " Created new Pad Collection Hash ID = " - << static_cast<unsigned int>(*it) << endmsg; - - // create new collection - RpcPad* coll = new RpcPad((m_cabling->padHashFunction())->identifier(*it), *it); + // Request to update to range-based for-loop + for(const IdentifierHash& it : collections){ + // IDC_WriteHandle + RpcPadContainer::IDC_WriteHandle lock = rdoIdc.getWriteHandle( it ); + + if(lock.alreadyPresent() ){ + ATH_MSG_DEBUG ( "RPC RDO collection already exist with collection hash = " << static_cast<unsigned int>(it) << " converting is skipped!"); + } + else{ + ATH_MSG_VERBOSE(" Created new Pad Collection Hash ID = " << static_cast<unsigned int>(it) ); + + // create new collection - I should be doing this with unique_ptr but it requires changing downstream functions + RpcPad* coll = new RpcPad((m_cabling->padHashFunction())->identifier(it), it); - //convert collection + //convert collection - note case3 will never be used due to statement above switch(type) { case 0: cnv_sc = fillCollection_v240(data,robFrag.rod_ndata(),*coll); break; case 1: cnv_sc = fillCollection_v300(data,robFrag.rod_ndata(),*coll,subDetector, RPC_SECTORLOGIC); break; case 2: cnv_sc = fillCollection_v301(data,robFrag.rod_ndata(),*coll,subDetector, RPC_SECTORLOGIC ); break; - case 3: cnv_sc = fillCollection_v302(data,robFrag.rod_ndata(),*coll,sourceId, RPC_SECTORLOGIC); break; - //case 3: cnv_sc = fillCollection_v302new(data,robFrag.rod_ndata(),*coll,sourceId); break; - + case 3: cnv_sc = fillCollection_v302(data,robFrag.rod_ndata(),*coll,sourceId, RPC_SECTORLOGIC); break; + //case 3: cnv_sc = fillCollection_v302new(data,robFrag.rod_ndata(),*coll,sourceId); break; + default: fillCollection_v240(data,robFrag.rod_ndata(),*coll); break; } @@ -584,20 +607,22 @@ namespace Muon ATH_MSG_VERBOSE("Error into the RPC fillCollections decoding"); } + // Here need to implement writing for all the other fill methods + // Take the pointer and pass ownership to unique_ptr and pass to the IDC_WriteHandle + StatusCode status_lock = lock.addOrDelete( std::move( std::unique_ptr<RpcPad>( coll ) ) ); + // add collection into IDC - if (rdoIdc.addCollection(coll, *it).isFailure()) + if(status_lock != StatusCode::SUCCESS) { - msg(MSG::ERROR) << "Failed to add RPC PAD collection to container" - << endmsg; + ATH_MSG_ERROR("Failed to add RPC PAD collection to container"); //report the error condition } - else ATH_MSG_DEBUG("Adding RpcPad collection with hash "<<(int)(*it)<<" to the RpcPad Container | size = "<<coll->size()); - + else + ATH_MSG_DEBUG("Adding RpcPad collection with hash "<<(int)(it)<<" to the RpcPad Container | size = " << coll->size()); } } - return cnv_sc; - } + } // end fillCollections // ---- Implement the template method: @@ -609,6 +634,10 @@ namespace Muon RpcROD_Decoder::fillCollection_v302(BS data, const uint32_t data_size, RpcPad& v, const uint32_t& sourceId, RpcSectorLogicContainer* sectorLogicContainer ) const { + bool skipSectorLogicDecoding = (sectorLogicContainer == nullptr); + if(skipSectorLogicDecoding) + ATH_MSG_DEBUG("Skip SectorLogic decoding, so SLROC.decodeFragment is not being processed"); + /* for (unsigned int i = 0; i<1000; ++i) { */ /* //std::cout<<" aaa "<<std::endl; */ @@ -748,14 +777,16 @@ namespace Muon isPadPreFooter=false; isPadFooter =false; isSLHeader =false; - isSLSubHeader =false; + isSLSubHeader =false; isSLFooter =false; uint32_t currentWord = p[i]; RXROS.decodeFragment(currentWord,recField); PDROS.decodeFragment(currentWord,recField); - SLROS.decodeFragment(currentWord,recField); + if(!skipSectorLogicDecoding){ + SLROS.decodeFragment(currentWord,recField); + } if (RXROS.isHeader()) { isRXHeader=true; @@ -782,6 +813,14 @@ namespace Muon } else if (SLROS.isSubHeader() && isSLFragment) { isSLSubHeader=true; } + + // The SLROS functions still return values (based on default values) + if(skipSectorLogicDecoding){ + isSLHeader = false; + isSLSubHeader = false; + isSLFragment = false; + isSLFooter = false; + } if (msgLvl(MSG::VERBOSE) ) { @@ -1199,7 +1238,7 @@ namespace Muon uint16_t channel = matrixROS.channel(); firedChan = new RpcFiredChannel(bcid,time,ijk,channel); - ATH_MSG_VERBOSE ( + ATH_MSG_VERBOSE ( "Adding a fired channel, bcid=" << bcid << " time=" << " ijk=" << ijk << " channel=" << channel); @@ -1248,7 +1287,10 @@ namespace Muon RpcROD_Decoder::fillCollection_v301(BS data, const uint32_t data_size, RpcPad& v, const uint16_t& subDetector, RpcSectorLogicContainer* sectorLogicContainer ) const { - + bool skipSectorLogicDecoding = (sectorLogicContainer == nullptr); + if(skipSectorLogicDecoding) + ATH_MSG_DEBUG("Skip SectorLogic decoding, so SLROC.decodeFragment is not being processed"); + // unpack the 32 bits words into 16 bits // no ROD header and footer std::vector<uint16_t> p = get16bits_v301(data,data_size,0,0); @@ -1281,8 +1323,7 @@ namespace Muon bool foundPad=false; - if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "The offline ID request for conversion is " - << m_pRpcIdHelper->show_to_string(thisPadOfflineId) << endmsg; + ATH_MSG_VERBOSE( "The offline ID request for conversion is " << m_pRpcIdHelper->show_to_string(thisPadOfflineId) ); bool isSLHeader =false; @@ -1334,7 +1375,9 @@ namespace Muon RXROS.decodeFragment(currentWord,recField); PDROS.decodeFragment(currentWord,recField); - SLROS.decodeFragment(currentWord,recField); + if(!skipSectorLogicDecoding){ + SLROS.decodeFragment(currentWord,recField); + } if (RXROS.isHeader() && !isSLFragment) isRXHeader=true; else if (RXROS.isFooter() && !isSLFragment) isRXFooter=true; @@ -1344,26 +1387,33 @@ namespace Muon else if (PDROS.isFooter() && !isSLFragment) isPadFooter=true; else if (SLROS.isHeader()) isSLHeader=true; else if (SLROS.isFooter()) isSLFooter=true; + + // The SLROS functions still return values (based on default values) + if(skipSectorLogicDecoding){ + isSLHeader = false; + isSLFragment = false; + isSLFooter = false; + } //#ifndef NVERBOSE if (msgLvl(MSG::VERBOSE)) - { - msg(MSG::VERBOSE) <<" RX Header: "<<isRXHeader - <<" RX Footer: "<<isRXFooter - <<endmsg; - msg(MSG::VERBOSE) <<" Pad Header: "<<isPadHeader - <<" Pad SubHeader: "<<isPadSubHeader - <<" Pad PreFooter: "<<isPadPreFooter - <<" Pad Footer: "<<isPadFooter - <<endmsg; - msg(MSG::VERBOSE) <<" isPADFragment: "<<isPADFragment - <<endmsg; - msg(MSG::VERBOSE) <<" SL Header: "<<isSLHeader - <<" SL Footer: "<<isSLFooter - <<endmsg; - msg(MSG::VERBOSE) <<" isSLFragment: "<<isSLFragment - <<endmsg; - } + { + msg(MSG::VERBOSE) <<" RX Header: "<<isRXHeader + <<" RX Footer: "<<isRXFooter + <<endmsg; + msg(MSG::VERBOSE) <<" Pad Header: "<<isPadHeader + <<" Pad SubHeader: "<<isPadSubHeader + <<" Pad PreFooter: "<<isPadPreFooter + <<" Pad Footer: "<<isPadFooter + <<endmsg; + msg(MSG::VERBOSE) <<" isPADFragment: "<<isPADFragment + <<endmsg; + msg(MSG::VERBOSE) <<" SL Header: "<<isSLHeader + <<" SL Footer: "<<isSLFooter + <<endmsg; + msg(MSG::VERBOSE) <<" isSLFragment: "<<isSLFragment + <<endmsg; + } //#endif if(isRXHeader) { @@ -1388,39 +1438,39 @@ namespace Muon // Check the Sector Logic Fragment if(foundSL && msgLvl(MSG::VERBOSE)) - { + { //#ifndef NVERBOSE msg(MSG::VERBOSE) <<"SectorLogicReadOut checkFragment: " << myRPC.SLFragment()->checkFragment()<<endmsg; msg(MSG::VERBOSE) << myRPC.SLFragment()<<endmsg; //#endif - } + } if(isSLHeader) SLBodyWords=0; // Decode the sector logic footer else if(isSLFooter ) { - + //#ifndef NVERBOSE if (SLindex>1) { msg(MSG::ERROR) << "More than 2 SL fragments in sector " << sector << endmsg; } //#endif - if (msgLvl(MSG::VERBOSE)) - { - //#ifndef NVERBOSE - msg(MSG::VERBOSE) <<" Number of data words in SectorLogicReadOut= " - <<SLBodyWords<<endmsg; - msg(MSG::VERBOSE) <<" TEST SL: "<<foundSL<<endmsg; - //#endif - - //#ifndef NVERBOSE - // Print out a raw dump of the SL fragment - for(unsigned short j=0; j<SLBodyWords; j++) { - msg(MSG::VERBOSE) <<" SL data word "<<j<<" : "<<std::hex<<SLBuff[j]<<MSG::dec<<endmsg; - } - } + if (msgLvl(MSG::VERBOSE)) + { + //#ifndef NVERBOSE + msg(MSG::VERBOSE) <<" Number of data words in SectorLogicReadOut= " + <<SLBodyWords<<endmsg; + msg(MSG::VERBOSE) <<" TEST SL: "<<foundSL<<endmsg; + //#endif + + //#ifndef NVERBOSE + // Print out a raw dump of the SL fragment + for(unsigned short j=0; j<SLBodyWords; j++) { + msg(MSG::VERBOSE) <<" SL data word "<<j<<" : "<<std::hex<<SLBuff[j]<<MSG::dec<<endmsg; + } + } //#endif // Found the sector logic footer, the sector logic fragment @@ -1455,12 +1505,12 @@ namespace Muon uint16_t ptid = sectorLogic->ptid(ilink,igate); //#ifndef NVERBOSE ATH_MSG_VERBOSE ("SL: pt for link=" << ilink - << " gate=" << igate << " is: " << ptid); + << " gate=" << igate << " is: " << ptid); //#endif if (ptid != 0) { //#ifndef NVERBOSE ATH_MSG_VERBOSE ("SL: found an hit for link=" << ilink - << " gate=" << igate); + << " gate=" << igate); //#endif uint16_t cmadd = sectorLogic->cmadd(ilink,igate); @@ -1485,9 +1535,9 @@ namespace Muon } - if (msgLvl(MSG::VERBOSE)){ - msg(MSG::VERBOSE) << "Size of sector 55: " << sl2->size() << endmsg; - msg(MSG::VERBOSE) << "Size of sector 56: " << sl1->size() << endmsg; + if (msgLvl(MSG::VERBOSE)){ + msg(MSG::VERBOSE) << "Size of sector 55: " << sl2->size() << endmsg; + msg(MSG::VERBOSE) << "Size of sector 56: " << sl1->size() << endmsg; } // flag the two sectors as decoded //bool setSector1 = sectorLogicContainer->setSector(56,0); @@ -1633,12 +1683,12 @@ namespace Muon isPadFooter ? isPADFragment=false : isPADFragment=true; //#ifndef NVERBOSE - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) <<" current word "<<std::hex<<currentWord<<MSG::dec<<endmsg; - - msg(MSG::VERBOSE) <<" ==isPADFragment= "<<isPADFragment<<endmsg; - msg(MSG::VERBOSE) <<" calling pushword: "<<std::hex<<currentWord<<MSG::dec<<endmsg; - } + if (msgLvl(MSG::VERBOSE)) { + msg(MSG::VERBOSE) <<" current word "<<std::hex<<currentWord<<MSG::dec<<endmsg; + + msg(MSG::VERBOSE) <<" ==isPADFragment= "<<isPADFragment<<endmsg; + msg(MSG::VERBOSE) <<" calling pushword: "<<std::hex<<currentWord<<MSG::dec<<endmsg; + } //#endif int foundCM = 0; @@ -1687,7 +1737,7 @@ namespace Muon firedChan = new RpcFiredChannel(bcid,time,ijk,channel); //#ifndef NVERBOSE ATH_MSG_VERBOSE ("Adding a fired channel, bcid=" << bcid << " time=" - << " ijk=" << ijk << " channel=" << channel); + << " ijk=" << ijk << " channel=" << channel); //#endif // add the fired channel to the matrix @@ -1699,8 +1749,8 @@ namespace Muon firedChan = new RpcFiredChannel(bcid,time,ijk,threshold,overlap); //#ifndef NVERBOSE ATH_MSG_VERBOSE ("Adding a fired channel, bcid=" << bcid << " time=" - << " ijk=" << ijk << " overlap=" << overlap - << " threshold=" << threshold); + << " ijk=" << ijk << " overlap=" << overlap + << " threshold=" << threshold); //#endif // add the fired channel to the matrix @@ -1731,16 +1781,19 @@ namespace Muon RpcROD_Decoder::fillCollection_v300(BS data, const uint32_t data_size, RpcPad& v, const uint16_t& subDetector, RpcSectorLogicContainer* sectorLogicContainer ) const { - + bool skipSectorLogicDecoding = (sectorLogicContainer == nullptr); + if(skipSectorLogicDecoding) + ATH_MSG_DEBUG("Skip SectorLogic decoding, so SLROC.decodeFragment is not being processed"); + //#ifndef NVERBOSE if (msgLvl(MSG::VERBOSE)) { msg(MSG::VERBOSE) << "**********Decoder dumping the words******** " << endmsg; if (data_size > 0 ) { - msg(MSG::VERBOSE) << "The size of this ROD-read is " << data_size << endmsg; - for (unsigned int i=0; i < data_size; i++) - msg(MSG::VERBOSE) << "word " << i << " = " << MSG::hex << data[i] << MSG::dec << endmsg; - } - } + msg(MSG::VERBOSE) << "The size of this ROD-read is " << data_size << endmsg; + for (unsigned int i=0; i < data_size; i++) + msg(MSG::VERBOSE) << "word " << i << " = " << MSG::hex << data[i] << MSG::dec << endmsg; + } + } //#endif uint16_t side = (subDetector == eformat::MUON_RPC_BARREL_A_SIDE) ? 1:0; @@ -1819,6 +1872,13 @@ namespace Muon else if (SLROS.isHeader()) isSLHeader=true; else if (SLROS.isFooter()) isSLFooter=true; + // The SLROS functions still return values (based on default values) + if(skipSectorLogicDecoding){ + isSLHeader = false; + isSLFragment = false; + isSLFooter = false; + } + //#ifndef NVERBOSE if (msgLvl(MSG::VERBOSE)) { msg(MSG::VERBOSE) <<" RX Header: "<<isRXHeader diff --git a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder_v302.C b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder_v302.C index ab999037e72157dd1214a0c2668c9c70e9202676..255acd06daa06f458a25aa552971bdf72b53aadd 100644 --- a/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder_v302.C +++ b/MuonSpectrometer/MuonCnv/MuonRPC_CnvTools/src/RpcROD_Decoder_v302.C @@ -23,6 +23,10 @@ StatusCode Muon::RpcROD_Decoder::fillCollectionsFromRob_v302(BS data, const uint RpcSectorLogicContainer* sectorLogicContainer ) const { + bool skipSectorLogicDecoding = (sectorLogicContainer == nullptr); + if(skipSectorLogicDecoding) + ATH_MSG_DEBUG("Skip SectorLogic decoding, so SLROC.decodeFragment is not being processed"); + /* for (unsigned int i = 0; i<1000; ++i) { */ /* //std::cout<<" aaa "<<std::endl; */ /* msg(MSG::VERBOSE) << "try to increase cpu time "<<log(pow(((double)i+1.)/999.,3))<<endmsg; */ @@ -229,7 +233,9 @@ StatusCode Muon::RpcROD_Decoder::fillCollectionsFromRob_v302(BS data, const uint RXROS.decodeFragment(currentWord,recFieldROS); PDROS.decodeFragment(currentWord,recFieldPAD); - SLROS.decodeFragment(currentWord,recFieldSL); + if(!skipSectorLogicDecoding){ + SLROS.decodeFragment(currentWord,recFieldSL); + } if (RXROS.isHeader()) { isRXHeader=true; @@ -256,7 +262,26 @@ StatusCode Muon::RpcROD_Decoder::fillCollectionsFromRob_v302(BS data, const uint } else if (SLROS.isSubHeader() && isSLFragment) { isSLSubHeader=true; } + + // The SLROS functions still return values (based on default values) + if(skipSectorLogicDecoding){ + isSLHeader = false; + isSLSubHeader = false; + isSLFragment = false; + isSLFooter = false; + } + ATH_MSG_VERBOSE("\n isRXHeader " << isRXHeader << + "\n isRXFooter " << isRXFooter << + "\n isPadHeader " << isPadHeader << + "\n isPadSubHeader " << isPadSubHeader << + "\n isPADFragment " << isPADFragment << + "\n isPadPreFooter " << isPadPreFooter << + "\n isPadFooter " << isPadFooter << + "\n isSLHeader " << isSLHeader << + "\n isSLSubHeader " << isSLSubHeader << + "\n isSLFragment " << isSLFragment << + "\n isSLFooter " << isSLFooter ); @@ -297,27 +322,26 @@ StatusCode Muon::RpcROD_Decoder::fillCollectionsFromRob_v302(BS data, const uint //we must start with an RX Header: if (i==0 && (!isRXHeader)) - { - ATH_MSG_WARNING("Bad data from RPC ROD 0x" << MSG::hex << rodId << MSG::dec - << ". RX header not found at ROB fragment begin. Skipping this ROB fragment."); - return StatusCode::SUCCESS; //continue decoding data from other ROBs - //bsErrCheck_errorInRXHeader = true; - } + { + ATH_MSG_WARNING("Bad data from RPC ROD 0x" << MSG::hex << rodId << MSG::dec + << ". RX header not found at ROB fragment begin. Skipping this ROB fragment."); + return StatusCode::SUCCESS; //continue decoding data from other ROBs + //bsErrCheck_errorInRXHeader = true; + } if(isRXHeader) { - //bsErrCheck_errorInRXHeader = false; - //bsErrCheck_InRX = true; - // bsErrCheck_InSL = false; - // bsErrCheck_InPD = false; - // bsErrCheck_InCM = false; + //bsErrCheck_errorInRXHeader = false; + //bsErrCheck_InRX = true; + // bsErrCheck_InSL = false; + // bsErrCheck_InPD = false; + // bsErrCheck_InCM = false; - if (msgLvl(MSG::VERBOSE) ) - { - msg(MSG::VERBOSE) << " this is a RX Header " << endmsg; - msg(MSG::VERBOSE) <<" Sector ID=" <<RXROS.RXid()<<endmsg; - } + if (msgLvl(MSG::VERBOSE) ){ + msg(MSG::VERBOSE) << " this is a RX Header " << endmsg; + msg(MSG::VERBOSE) << " Sector ID=" <<RXROS.RXid()<<endmsg; + } // get the sector id according to the new format // not yet implemented in the readout classes @@ -327,7 +351,7 @@ StatusCode Muon::RpcROD_Decoder::fillCollectionsFromRob_v302(BS data, const uint uint16_t rxid = RXROS.RXid(); // range (presumably) 0-1 sectorForCabling = 2*rodId+rxid; // range 0-31 sector = side*32+sectorForCabling; // range 0-63 //side = 1 for side A or 0 for side C // side 1 corresponds to subDetID=65 (side 0 for subDetID=66) - if (msgLvl(MSG::VERBOSE) ) msg(MSG::VERBOSE) << "RXid, sectorForCabling, sector = "<<rxid<<" "<<sectorForCabling<<" "<<sector<<std::endl; + if (msgLvl(MSG::VERBOSE) ) msg(MSG::VERBOSE) << "RXid, sectorForCabling, sector = "<<rxid<<" "<<sectorForCabling<<" "<<sector<<std::endl; //fix for M3 if ((rodId==3 || rodId==1) && (m_specialROBNumber > 0) ) { diff --git a/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py b/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py index 14e4ea9065fbc934b044ee52f53cdffa3e5673bb..c81299b4f0c1a60bef5b696db38245ddd2abee8a 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py @@ -55,6 +55,11 @@ def RpcBytestreamDecodeCfg(flags, forTrigger=False): from MuonRPC_CnvTools.MuonRPC_CnvToolsConf import Muon__RPC_RawDataProviderTool MuonRpcRawDataProviderTool = Muon__RPC_RawDataProviderTool(name = "RPC_RawDataProviderTool", Decoder = RPCRodDecoder ) + if forTrigger: + MuonRpcRawDataProviderTool.RpcContainerCacheKey = MuonCacheNames.RpcCache + MuonRpcRawDataProviderTool.WriteOutRpcSectorLogic = False + MuonRpcRawDataProviderTool.OutputLevel = DEBUG + acc.addPublicTool( MuonRpcRawDataProviderTool ) # This should be removed, but now defined as PublicTool at MuFastSteering # Setup the RAW data provider algorithm @@ -67,6 +72,7 @@ def RpcBytestreamDecodeCfg(flags, forTrigger=False): RpcRawDataProvider.DoSeededDecoding = True RpcRawDataProvider.RoIs = "MURoIs" # Maybe we don't want to hard code this? + return acc, RpcRawDataProvider def TgcBytestreamDecodeCfg(flags, forTrigger=False): @@ -118,7 +124,7 @@ def MdtBytestreamDecodeCfg(flags, forTrigger=False): # Setup the MDT ROD decoder from MuonMDT_CnvTools.MuonMDT_CnvToolsConf import MdtROD_Decoder - MDTRodDecoder = MdtROD_Decoder(name = "MdtROD_Decoder" ) + MDTRodDecoder = MdtROD_Decoder(name = "MdtROD_Decoder") # RAW data provider tool needs ROB data provider service (should be another Config function?) from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ROBDataProviderSvc @@ -129,6 +135,7 @@ def MdtBytestreamDecodeCfg(flags, forTrigger=False): from MuonMDT_CnvTools.MuonMDT_CnvToolsConf import Muon__MDT_RawDataProviderTool MuonMdtRawDataProviderTool = Muon__MDT_RawDataProviderTool(name = "MDT_RawDataProviderTool", Decoder = MDTRodDecoder) + if forTrigger: # tell the raw data provider tool to use the cache MuonMdtRawDataProviderTool.CsmContainerCacheKey = MuonCacheNames.MdtCsmCache @@ -197,7 +204,7 @@ if __name__=="__main__": ConfigFlags.lock() ConfigFlags.dump() - from AthenaCommon.Logging import log + from AthenaCommon.Logging import log log.setLevel(DEBUG) log.info('About to setup Rpc Raw data decoding') @@ -219,12 +226,12 @@ if __name__=="__main__": cfg.addEventAlgo( tgcdecodingAlg ) # Schedule Mdt data decoding - once mergeAll is working can simplify these lines - mdtdecodingAcc, mdtdecodingAlg = MdtBytestreamDecodeCfg( ConfigFlags , True) + mdtdecodingAcc, mdtdecodingAlg = MdtBytestreamDecodeCfg( ConfigFlags ) cfg.merge( mdtdecodingAcc ) cfg.addEventAlgo( mdtdecodingAlg ) # Schedule Csc data decoding - once mergeAll is working can simplify these lines - cscdecodingAcc, cscdecodingAlg = CscBytestreamDecodeCfg( ConfigFlags , True) + cscdecodingAcc, cscdecodingAlg = CscBytestreamDecodeCfg( ConfigFlags ) cfg.merge( cscdecodingAcc ) cfg.addEventAlgo( cscdecodingAlg ) diff --git a/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py b/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py index 1398b7bf5cafe9b2db943bbbb066e2b52685c87b..2dd797cbcca278bfc20caabcadad6bef26006bb5 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py @@ -167,10 +167,9 @@ def muonRdoDecodeTestData( forTrigger = False ): log.setLevel(DEBUG) log.info('About to setup Rpc Raw data decoding') - + cfg=ComponentAccumulator() - # Seem to need this to read BS properly from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg cfg.merge(TrigBSReadCfg(ConfigFlags )) @@ -182,7 +181,11 @@ def muonRdoDecodeTestData( forTrigger = False ): # Schedule Rpc bytestream data decoding - once mergeAll is working can simplify these lines from MuonConfig.MuonBytestreamDecodeConfig import RpcBytestreamDecodeCfg - rpcdecodingAcc, rpcdecodingAlg = RpcBytestreamDecodeCfg( ConfigFlags ) + rpcdecodingAcc, rpcdecodingAlg = RpcBytestreamDecodeCfg( ConfigFlags, forTrigger ) + # Put into a verbose logging mode to check the caching + if forTrigger: + rpcdecodingAlg.ProviderTool.OutputLevel = DEBUG + cfg.merge( rpcdecodingAcc ) cfg.addEventAlgo( rpcdecodingAlg ) @@ -229,7 +232,6 @@ def muonRdoDecodeTestData( forTrigger = False ): cfg.merge(cscbuildingAcc) cfg.addEventAlgo(cscbuildingAlg) - # Need to add POOL converter - may be a better way of doing this? from AthenaCommon import CfgMgr cfg.addService( CfgMgr.AthenaPoolCnvSvc() ) diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref index d12fb28dab1d5cc27b1bdece65987d061b065fde..c8d0b78f3731ee0097938dbcc38eb42cfa12d6f5 100644 --- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref +++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref @@ -676,9 +676,11 @@ Py:ConfigurableDb DEBUG -loading [/afs/cern.ch/user/s/shhayash/workspace/Deve Py:ConfigurableDb DEBUG -loading [/afs/cern.ch/user/s/shhayash/workspace/Development/GIT2019-03-20/build/x86_64-slc6-gcc8-opt/lib/WorkDir.confdb]... Py:ConfigurableDb DEBUG -loading [/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-18T2151/GAUDI/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/lib/Gaudi.confdb]... Py:ConfigurableDb DEBUG -loading [/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-18T2151/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/lib/Athena.confdb]... +Py:ConfigurableDb DEBUG -loading [/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-19T2153/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/lib/Athena.confdb]... +Py:ConfigurableDb DEBUG -loading [/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-19T2153/GAUDI/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/lib/Gaudi.confdb]... Py:ConfigurableDb DEBUG loading confDb files... [DONE] -Py:ConfigurableDb DEBUG loaded 1102 confDb packages -Py:ConfigurableDb INFO Read module info for 5447 configurables from 5 genConfDb files +Py:ConfigurableDb DEBUG loaded 1103 confDb packages +Py:ConfigurableDb INFO Read module info for 5465 configurables from 7 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Py:ConfigurableDb DEBUG : Found configurable <class 'GaudiCoreSvc.GaudiCoreSvcConf.MessageSvc'> in module GaudiCoreSvc.GaudiCoreSvcConf Py:loadBasicAthenaPool DEBUG Loading basic services for AthenaPool... @@ -1454,24 +1456,24 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** |-AuditStop = False |-Cardinality = 0 |-ContinueEventloopOnFPE = False -|-DetStore @0x7f4d61983f10 = ServiceHandle('StoreGateSvc/DetectorStore') +|-DetStore @0x7fa4cd101f10 = ServiceHandle('StoreGateSvc/DetectorStore') |-Enable = True |-ErrorCounter = 0 |-ErrorMax = 1 -|-EvtStore @0x7f4d61983e90 = ServiceHandle('StoreGateSvc') -|-ExtraInputs @0x7f4d5ff68170 = [] (default: []) -|-ExtraOutputs @0x7f4d5ff680e0 = [] (default: []) +|-EvtStore @0x7fa4cd101e90 = ServiceHandle('StoreGateSvc') +|-ExtraInputs @0x7fa4cb5dd878 = [] (default: []) +|-ExtraOutputs @0x7fa4cb5dd908 = [] (default: []) |-FilterCircularDependencies = True |-IgnoreFilterPassed = False |-IsIOBound = False -|-Members @0x7f4d5fed0fc8 = ['Muon::RpcRawDataProvider/RpcRawDataProvider', 'Muon::TgcRawDataProvider/TgcRawDataProvider', 'Muon::MdtRawDataProvider/MdtRawDataProvider', 'Muon::CscRawDataProvider/CscRawDataProvider', 'RpcRdoToRpcPrepData/RpcRdoToRpcPrepData', 'TgcRdoToTgcPrepData/TgcRdoToTgcPrepData', 'MdtRdoToMdtPrepData/MdtRdoToMdtPrepData', 'CscRdoToCscPrepData/CscRdoToCscPrepData', 'CscThresholdClusterBuilder/CscThesholdClusterBuilder'] +|-Members @0x7fa4cb5dd518 = ['Muon::RpcRawDataProvider/RpcRawDataProvider', 'Muon::TgcRawDataProvider/TgcRawDataProvider', 'Muon::MdtRawDataProvider/MdtRawDataProvider', 'Muon::CscRawDataProvider/CscRawDataProvider', 'RpcRdoToRpcPrepData/RpcRdoToRpcPrepData', 'TgcRdoToTgcPrepData/TgcRdoToTgcPrepData', 'MdtRdoToMdtPrepData/MdtRdoToMdtPrepData', 'CscRdoToCscPrepData/CscRdoToCscPrepData', 'CscThresholdClusterBuilder/CscThesholdClusterBuilder'] | (default: []) |-ModeOR = False |-MonitorService = 'MonitorSvc' -|-NeededResources @0x7f4d5fed0e18 = [] (default: []) +|-NeededResources @0x7fa4cb5dd758 = [] (default: []) |-OutputLevel = 0 |-RegisterForContextService = False -|-Sequential @0x7f4d63a90b00 = True (default: False) +|-Sequential @0x7fa4cf20eb00 = True (default: False) |-StopOverride = False |-TimeOut = 0.0 |-Timeline = True @@ -1487,22 +1489,22 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d60562c50 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbce0cd0 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d60562bd0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff68128 = [] (default: []) -| |-ExtraOutputs @0x7f4d5fed0ef0 = [] (default: []) +| |-EvtStore @0x7fa4cbce0c50 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cb5dd9e0 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5dd998 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff681b8 = [] (default: []) +| |-NeededResources @0x7fa4cb5dd950 = [] (default: []) | |-OutputLevel = 0 -| |-ProviderTool @0x7f4d6088a718 = PrivateToolHandle('Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool') +| |-ProviderTool @0x7fa4cc008718 = PrivateToolHandle('Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool') | | (default: 'Muon::RPC_RawDataProviderTool/RpcRawDataProviderTool') -| |-RegionSelectionSvc @0x7f4d60562cd0 = ServiceHandle('RegSelSvc') +| |-RegionSelectionSvc @0x7fa4cbce0d50 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Timeline = True @@ -1514,11 +1516,11 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-AuditStart = False | | |-AuditStop = False | | |-AuditTools = False -| | |-Decoder @0x7f4d6088a810 = PrivateToolHandle('Muon::RpcROD_Decoder/RpcROD_Decoder') -| | |-DetStore @0x7f4d604d0a90 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d604d0ad0 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d6054e908 = [] (default: []) -| | |-ExtraOutputs @0x7f4d6054e680 = [] (default: []) +| | |-Decoder @0x7fa4cc008810 = PrivateToolHandle('Muon::RpcROD_Decoder/RpcROD_Decoder') +| | |-DetStore @0x7fa4cbc4eb10 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cbc4eb50 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cbccb908 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cbccb680 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputLevel = 0 | | |-RPCSec = 'StoreGateSvc+RPC_SECTORLOGIC' @@ -1532,10 +1534,10 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | | |-AuditStop = False | | | |-AuditTools = False | | | |-DataErrorPrintLimit = 1000 -| | | |-DetStore @0x7f4d604d0b90 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d604d0bd0 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d6054e7a0 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d6054e758 = [] (default: []) +| | | |-DetStore @0x7fa4cbc4ec10 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cbc4ec50 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cbccb7a0 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cbccb758 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | |-Sector13Data = False @@ -1555,19 +1557,19 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d604b3c10 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbc31c90 = ServiceHandle('StoreGateSvc/DetectorStore') | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d604b3b90 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff68050 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68200 = [] (default: []) +| |-EvtStore @0x7fa4cbc31c10 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cb5ddc20 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5ddcf8 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68290 = [] (default: []) +| |-NeededResources @0x7fa4cb5ddc68 = [] (default: []) | |-OutputLevel = 0 -| |-ProviderTool @0x7f4d6173c8c0 = PrivateToolHandle('Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool') +| |-ProviderTool @0x7fa4cceba8c0 = PrivateToolHandle('Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool') | | (default: 'Muon::TGC_RawDataProviderTool/TgcRawDataProviderTool') | |-RegisterForContextService = False | |-Timeline = True @@ -1579,12 +1581,12 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-AuditStart = False | | |-AuditStop = False | | |-AuditTools = False -| | |-Decoder @0x7f4d6173c9b0 = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') +| | |-Decoder @0x7fa4cceba9b0 = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') | | | (default: 'Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout') -| | |-DetStore @0x7f4d60434110 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d60434150 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d604fd908 = [] (default: []) -| | |-ExtraOutputs @0x7f4d604fd758 = [] (default: []) +| | |-DetStore @0x7fa4cbbb2190 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cbbb21d0 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cbc7b908 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cbc7b758 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputLevel = 0 | | |-RdoLocation = 'StoreGateSvc+TGCRDO' @@ -1596,10 +1598,10 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d60434210 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d60434250 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d604fd5a8 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d604fd710 = [] (default: []) +| | | |-DetStore @0x7fa4cbbb2290 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cbbb22d0 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cbc7b5a8 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cbc7b710 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | |-ShowStatusWords = False @@ -1619,19 +1621,19 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d6052ee50 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbc9bed0 = ServiceHandle('StoreGateSvc/DetectorStore') | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d6052edd0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff682d8 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68368 = [] (default: []) +| |-EvtStore @0x7fa4cbc9be50 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cb5ddd40 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5dddd0 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68320 = [] (default: []) +| |-NeededResources @0x7fa4cb5ddcb0 = [] (default: []) | |-OutputLevel = 0 -| |-ProviderTool @0x7f4d6063bd50 = PrivateToolHandle('Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool') +| |-ProviderTool @0x7fa4cbdbae50 = PrivateToolHandle('Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool') | | (default: 'Muon::MDT_RawDataProviderTool/MdtRawDataProviderTool') | |-RegisterForContextService = False | |-Timeline = True @@ -1644,11 +1646,11 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-AuditStop = False | | |-AuditTools = False | | |-CsmContainerCacheKey = 'StoreGateSvc+' -| | |-Decoder @0x7f4d6173cc80 = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') -| | |-DetStore @0x7f4d5fff0b10 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d5fff0b50 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d60061bd8 = [] (default: []) -| | |-ExtraOutputs @0x7f4d60061a70 = [] (default: []) +| | |-Decoder @0x7fa4ccebac80 = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') +| | |-DetStore @0x7fa4cb6b6410 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cb6b6450 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb7dfcf8 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb7dfb90 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputLevel = 0 | | |-RdoLocation = 'StoreGateSvc+MDTCSM' @@ -1661,10 +1663,10 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d5fff0c10 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5fff0c50 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d60061b00 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d60061ab8 = [] (default: []) +| | | |-DetStore @0x7fa4cb6b6510 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb6b6550 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cb7dfc20 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cb7dfbd8 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | |-ReadKey = 'ConditionStore+MuonMDT_CablingMap' @@ -1684,19 +1686,19 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d6054cd90 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbcc7e10 = ServiceHandle('StoreGateSvc/DetectorStore') | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d6054cd10 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff683b0 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68440 = [] (default: []) +| |-EvtStore @0x7fa4cbcc7d90 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cb5dde18 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5dde60 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68248 = [] (default: []) +| |-NeededResources @0x7fa4cb5dd7a0 = [] (default: []) | |-OutputLevel = 0 -| |-ProviderTool @0x7f4d6002f050 = PrivateToolHandle('Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool') +| |-ProviderTool @0x7fa4cb6cd150 = PrivateToolHandle('Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool') | | (default: 'Muon::CSC_RawDataProviderTool/CscRawDataProviderTool') | |-RegisterForContextService = False | |-Timeline = True @@ -1709,12 +1711,12 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-AuditStop = False | | |-AuditTools = False | | |-CscContainerCacheKey = 'StoreGateSvc+' -| | |-Decoder @0x7f4d6173ce60 = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') -| | |-DetStore @0x7f4d5ffb29d0 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-Decoder @0x7fa4ccebae60 = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') +| | |-DetStore @0x7fa4cb6772d0 = ServiceHandle('StoreGateSvc/DetectorStore') | | |-EventInfoKey = 'StoreGateSvc+EventInfo' -| | |-EvtStore @0x7f4d5ffb2a10 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ffb0b48 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ffb0dd0 = [] (default: []) +| | |-EvtStore @0x7fa4cb677310 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb66fc68 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb66fef0 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputLevel = 0 | | |-RdoLocation = 'StoreGateSvc+CSCRDO' @@ -1726,10 +1728,10 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d5ffb2ad0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5ffb2b10 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d5ffb0cb0 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d5ffb0c68 = [] (default: []) +| | | |-DetStore @0x7fa4cb6773d0 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb677410 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cb66fdd0 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cb66fd88 = [] (default: []) | | | |-IsCosmics = False | | | |-IsOldCosmics = False | | | |-MonitorService = 'MonitorSvc' @@ -1749,25 +1751,25 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DecodingTool @0x7f4d607a3d20 = PrivateToolHandle('Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool') +| |-DecodingTool @0x7fa4cbf21d20 = PrivateToolHandle('Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool') | | (default: 'Muon::RpcRdoToPrepDataTool/RpcRdoToPrepDataTool') -| |-DetStore @0x7f4d5ffea490 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cb6a3d50 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ffea410 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff685a8 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68518 = [] (default: []) +| |-EvtStore @0x7fa4cb6a3cd0 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe42050 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5ddf38 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff683f8 = [] (default: []) +| |-NeededResources @0x7fa4cb5ddf80 = [] (default: []) | |-OutputCollection = 'StoreGateSvc+RPC_Measurements' | |-OutputLevel = 0 | |-PrintInputRdo = False -| |-PrintPrepData @0x7f4d63a90b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4d5ffea510 = ServiceHandle('RegSelSvc') +| |-PrintPrepData @0x7fa4cf20eb20 = False (default: False) +| |-RegionSelectionSvc @0x7fa4cb6a3dd0 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Timeline = True @@ -1780,16 +1782,16 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-AuditStop = False | | |-AuditTools = False | | |-DecodeData = True -| | |-DetStore @0x7f4d5ff57650 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d5ff576d0 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ffc2758 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ffc2878 = [] (default: []) +| | |-DetStore @0x7fa4cb611f10 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cb611f90 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb680ea8 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb680908 = [] (default: []) | | |-InputCollection = 'StoreGateSvc+RPC_triggerHits' | | |-MonitorService = 'MonitorSvc' | | |-OutputCollection = 'StoreGateSvc+RPCPAD' | | |-OutputLevel = 0 | | |-RPCInfoFromDb = False -| | |-RdoDecoderTool @0x7f4d604054b0 = PrivateToolHandle('Muon::RpcRDO_Decoder/Muon::RpcRDO_Decoder') +| | |-RdoDecoderTool @0x7fa4cbb834b0 = PrivateToolHandle('Muon::RpcRDO_Decoder/Muon::RpcRDO_Decoder') | | | (default: 'Muon::RpcRDO_Decoder') | | |-TriggerOutputCollection = 'StoreGateSvc+RPC_Measurements' | | |-etaphi_coincidenceTime = 20.0 @@ -1807,10 +1809,10 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d5ff57750 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5ff57790 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d5ffc2ab8 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d5ffc2cf8 = [] (default: []) +| | | |-DetStore @0x7fa4cb61d050 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb61d090 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cb680680 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cb6805f0 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | \----- (End of Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder) ----- @@ -1828,25 +1830,25 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DecodingTool @0x7f4d61bdfe90 = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') +| |-DecodingTool @0x7fa4cd35de90 = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') | | (default: 'Muon::TgcRdoToPrepDataTool/TgcPrepDataProviderTool') -| |-DetStore @0x7f4d5ff43390 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cb5fcc50 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ff43310 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff684d0 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff685f0 = [] (default: []) +| |-EvtStore @0x7fa4cb5fcbd0 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe42128 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5ddd88 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68488 = [] (default: []) +| |-NeededResources @0x7fa4cbe420e0 = [] (default: []) | |-OutputCollection = 'StoreGateSvc+TGC_Measurements' | |-OutputLevel = 0 | |-PrintInputRdo = False -| |-PrintPrepData @0x7f4d63a90b20 = False (default: False) -| |-RegionSelectorSvc @0x7f4d5ff43410 = ServiceHandle('RegSelSvc') +| |-PrintPrepData @0x7fa4cf20eb20 = False (default: False) +| |-RegionSelectorSvc @0x7fa4cb5fccd0 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Setting = 0 @@ -1860,10 +1862,10 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-AuditStop = False | | |-AuditTools = False | | |-DecodeData = True -| | |-DetStore @0x7f4d5ff578d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d5ff57990 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ff62e60 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ff62e18 = [] (default: []) +| | |-DetStore @0x7fa4cb61d1d0 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cb61d290 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb625128 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb625098 = [] (default: []) | | |-FillCoinData = True | | |-MonitorService = 'MonitorSvc' | | |-OutputCoinCollection = 'TrigT1CoinDataCollection' @@ -1872,9 +1874,9 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-RDOContainer = 'StoreGateSvc+TGCRDO' | | |-TGCHashIdOffset = 26000 | | |-dropPrdsWithZeroWidth = True -| | |-outputCoinKey @0x7f4d5ff628c0 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] +| | |-outputCoinKey @0x7fa4cb624a70 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] | | | (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy']) -| | |-prepDataKeys @0x7f4d5ff62ef0 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] +| | |-prepDataKeys @0x7fa4cb6250e0 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] | | | (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy']) | | |-show_warning_level_invalid_A09_SSW6_hit = False | | \----- (End of Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool) ----- @@ -1891,25 +1893,25 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DecodingTool @0x7f4d63b369f0 = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') +| |-DecodingTool @0x7fa4cf2b4b50 = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') | | (default: 'Muon::MdtRdoToPrepDataTool/MdtPrepDataProviderTool') -| |-DetStore @0x7f4d5ffd8350 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cb691c10 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ffd82d0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff68758 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68560 = [] (default: []) +| |-EvtStore @0x7fa4cb691b90 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe42200 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5dda28 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff686c8 = [] (default: []) +| |-NeededResources @0x7fa4cb5ddef0 = [] (default: []) | |-OutputCollection = 'StoreGateSvc+MDT_DriftCircles' | |-OutputLevel = 0 | |-PrintInputRdo = False -| |-PrintPrepData @0x7f4d63a90b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4d5ffd83d0 = ServiceHandle('RegSelSvc') +| |-PrintPrepData @0x7fa4cf20eb20 = False (default: False) +| |-RegionSelectionSvc @0x7fa4cb691c90 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Timeline = True @@ -1923,13 +1925,13 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-AuditTools = False | | |-CalibratePrepData = True | | |-DecodeData = True -| | |-DetStore @0x7f4d5ff57bd0 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-DetStore @0x7fa4cb61d110 = ServiceHandle('StoreGateSvc/DetectorStore') | | |-DiscardSecondaryHitTwin = False | | |-DoPropagationCorrection = False | | |-DoTofCorrection = True -| | |-EvtStore @0x7f4d5ff57690 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ff61dd0 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ff61f38 = [] (default: []) +| | |-EvtStore @0x7fa4cb61d390 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb624128 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb624878 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputCollection = 'StoreGateSvc+MDT_DriftCircles' | | |-OutputLevel = 0 @@ -1957,25 +1959,25 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-CscRdoToCscPrepDataTool @0x7f4d605cd380 = PrivateToolHandle('Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool') +| |-CscRdoToCscPrepDataTool @0x7fa4cbd4b380 = PrivateToolHandle('Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool') | | (default: 'Muon::CscRdoToCscPrepDataTool/CscRdoToPrepDataTool') -| |-DetStore @0x7f4d5ffb2fd0 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cb677950 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ffb2f50 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff68830 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68680 = [] (default: []) +| |-EvtStore @0x7fa4cb6778d0 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe422d8 = [] (default: []) +| |-ExtraOutputs @0x7fa4cbe42098 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff687a0 = [] (default: []) +| |-NeededResources @0x7fa4cbe42248 = [] (default: []) | |-OutputCollection = 'StoreGateSvc+CSC_Measurements' | |-OutputLevel = 0 | |-PrintInputRdo = False -| |-PrintPrepData @0x7f4d63a90b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4d5ff7d710 = ServiceHandle('RegSelSvc') +| |-PrintPrepData @0x7fa4cf20eb20 = False (default: False) +| |-RegionSelectionSvc @0x7fa4cb6779d0 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Timeline = True @@ -1988,13 +1990,13 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | |-AuditStop = False | | |-AuditTools = False | | |-CSCHashIdOffset = 22000 -| | |-CscCalibTool @0x7f4d63b3a860 = PrivateToolHandle('CscCalibTool/CscCalibTool') -| | |-CscRdoDecoderTool @0x7f4d5ff715c0 = PrivateToolHandle('Muon::CscRDO_Decoder/CscRDO_Decoder') +| | |-CscCalibTool @0x7fa4cf2b8860 = PrivateToolHandle('CscCalibTool/CscCalibTool') +| | |-CscRdoDecoderTool @0x7fa4cb622d00 = PrivateToolHandle('Muon::CscRDO_Decoder/CscRDO_Decoder') | | |-DecodeData = True -| | |-DetStore @0x7f4d5ff57b50 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d5ff57a10 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ff878c0 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ff87f80 = [] (default: []) +| | |-DetStore @0x7fa4cb61d550 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cb61d210 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cbe38f80 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cbe38b48 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputCollection = 'StoreGateSvc+CSC_Measurements' | | |-OutputLevel = 0 @@ -2007,10 +2009,10 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d5ff57d10 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5ff57d50 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d5ff87320 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d5ff87368 = [] (default: []) +| | | |-DetStore @0x7fa4cb61d350 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb61d3d0 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cbe38950 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cbe38170 = [] (default: []) | | | |-IsOnline = True | | | |-Latency = 100.0 | | | |-MonitorService = 'MonitorSvc' @@ -2037,11 +2039,11 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-CscCalibTool @0x7f4d5ff57a50 = PublicToolHandle('CscCalibTool') -| | | |-DetStore @0x7f4d5ff57910 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5ff57ad0 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d5ff87200 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d5ff87248 = [] (default: []) +| | | |-CscCalibTool @0x7fa4cb61d250 = PublicToolHandle('CscCalibTool') +| | | |-DetStore @0x7fa4cb61d490 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb61d0d0 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cbe38368 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cbe38320 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | \----- (End of Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder) ----- @@ -2059,21 +2061,21 @@ Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ******** | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d5ff9b210 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbe57a90 = ServiceHandle('StoreGateSvc/DetectorStore') | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ff9b190 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff687e8 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68638 = [] (default: []) +| |-EvtStore @0x7fa4cbe57a10 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe42290 = [] (default: []) +| |-ExtraOutputs @0x7fa4cbe42170 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68878 = [] (default: []) +| |-NeededResources @0x7fa4cbe42320 = [] (default: []) | |-OutputLevel = 0 | |-RegisterForContextService = False | |-Timeline = True -| |-cluster_builder @0x7f4d5fecfb10 = PublicToolHandle('CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool') +| |-cluster_builder @0x7fa4cb5d5410 = PublicToolHandle('CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool') | | (default: 'CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool') | \----- (End of Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder) --------------------- \----- (End of Algorithm AthSequencer/AthAlgSeq) --------------------------------------------------- @@ -2116,24 +2118,24 @@ Py:Athena INFO Save Config |-AuditStop = False |-Cardinality = 0 |-ContinueEventloopOnFPE = False -|-DetStore @0x7f4d61983f10 = ServiceHandle('StoreGateSvc/DetectorStore') +|-DetStore @0x7fa4cd101f10 = ServiceHandle('StoreGateSvc/DetectorStore') |-Enable = True |-ErrorCounter = 0 |-ErrorMax = 1 -|-EvtStore @0x7f4d61983e90 = ServiceHandle('StoreGateSvc') -|-ExtraInputs @0x7f4d5ff68170 = [] (default: []) -|-ExtraOutputs @0x7f4d5ff680e0 = [] (default: []) +|-EvtStore @0x7fa4cd101e90 = ServiceHandle('StoreGateSvc') +|-ExtraInputs @0x7fa4cb5dd878 = [] (default: []) +|-ExtraOutputs @0x7fa4cb5dd908 = [] (default: []) |-FilterCircularDependencies = True |-IgnoreFilterPassed = False |-IsIOBound = False -|-Members @0x7f4d5ff64bd8 = ['Muon::RpcRawDataProvider/RpcRawDataProvider', 'Muon::TgcRawDataProvider/TgcRawDataProvider', 'Muon::MdtRawDataProvider/MdtRawDataProvider', 'Muon::CscRawDataProvider/CscRawDataProvider', 'RpcRdoToRpcPrepData/RpcRdoToRpcPrepData', 'TgcRdoToTgcPrepData/TgcRdoToTgcPrepData', 'MdtRdoToMdtPrepData/MdtRdoToMdtPrepData', 'CscRdoToCscPrepData/CscRdoToCscPrepData', 'CscThresholdClusterBuilder/CscThesholdClusterBuilder'] +|-Members @0x7fa4cb5dd488 = ['Muon::RpcRawDataProvider/RpcRawDataProvider', 'Muon::TgcRawDataProvider/TgcRawDataProvider', 'Muon::MdtRawDataProvider/MdtRawDataProvider', 'Muon::CscRawDataProvider/CscRawDataProvider', 'RpcRdoToRpcPrepData/RpcRdoToRpcPrepData', 'TgcRdoToTgcPrepData/TgcRdoToTgcPrepData', 'MdtRdoToMdtPrepData/MdtRdoToMdtPrepData', 'CscRdoToCscPrepData/CscRdoToCscPrepData', 'CscThresholdClusterBuilder/CscThesholdClusterBuilder'] | (default: []) |-ModeOR = False |-MonitorService = 'MonitorSvc' -|-NeededResources @0x7f4d5fed0e18 = [] (default: []) +|-NeededResources @0x7fa4cb5dd758 = [] (default: []) |-OutputLevel = 0 |-RegisterForContextService = False -|-Sequential @0x7f4d63a90b00 = True (default: False) +|-Sequential @0x7fa4cf20eb00 = True (default: False) |-StopOverride = False |-TimeOut = 0.0 |-Timeline = True @@ -2149,22 +2151,22 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d60562c50 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbce0cd0 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d60562bd0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff68128 = [] (default: []) -| |-ExtraOutputs @0x7f4d5fed0ef0 = [] (default: []) +| |-EvtStore @0x7fa4cbce0c50 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cb5dd9e0 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5dd998 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff681b8 = [] (default: []) +| |-NeededResources @0x7fa4cb5dd950 = [] (default: []) | |-OutputLevel = 0 -| |-ProviderTool @0x7f4d6088a718 = PrivateToolHandle('Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool') +| |-ProviderTool @0x7fa4cc008718 = PrivateToolHandle('Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool') | | (default: 'Muon::RPC_RawDataProviderTool/RpcRawDataProviderTool') -| |-RegionSelectionSvc @0x7f4d60562cd0 = ServiceHandle('RegSelSvc') +| |-RegionSelectionSvc @0x7fa4cbce0d50 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Timeline = True @@ -2176,11 +2178,11 @@ Py:Athena INFO Save Config | | |-AuditStart = False | | |-AuditStop = False | | |-AuditTools = False -| | |-Decoder @0x7f4d6088a810 = PrivateToolHandle('Muon::RpcROD_Decoder/RpcROD_Decoder') -| | |-DetStore @0x7f4d604d0a90 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d604d0ad0 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d6054e908 = [] (default: []) -| | |-ExtraOutputs @0x7f4d6054e680 = [] (default: []) +| | |-Decoder @0x7fa4cc008810 = PrivateToolHandle('Muon::RpcROD_Decoder/RpcROD_Decoder') +| | |-DetStore @0x7fa4cbc4eb10 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cbc4eb50 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cbccb908 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cbccb680 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputLevel = 0 | | |-RPCSec = 'StoreGateSvc+RPC_SECTORLOGIC' @@ -2194,10 +2196,10 @@ Py:Athena INFO Save Config | | | |-AuditStop = False | | | |-AuditTools = False | | | |-DataErrorPrintLimit = 1000 -| | | |-DetStore @0x7f4d604d0b90 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d604d0bd0 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d6054e7a0 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d6054e758 = [] (default: []) +| | | |-DetStore @0x7fa4cbc4ec10 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cbc4ec50 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cbccb7a0 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cbccb758 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | |-Sector13Data = False @@ -2217,19 +2219,19 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d604b3c10 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbc31c90 = ServiceHandle('StoreGateSvc/DetectorStore') | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d604b3b90 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff68050 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68200 = [] (default: []) +| |-EvtStore @0x7fa4cbc31c10 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cb5ddc20 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5ddcf8 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68290 = [] (default: []) +| |-NeededResources @0x7fa4cb5ddc68 = [] (default: []) | |-OutputLevel = 0 -| |-ProviderTool @0x7f4d6173c8c0 = PrivateToolHandle('Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool') +| |-ProviderTool @0x7fa4cceba8c0 = PrivateToolHandle('Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool') | | (default: 'Muon::TGC_RawDataProviderTool/TgcRawDataProviderTool') | |-RegisterForContextService = False | |-Timeline = True @@ -2241,12 +2243,12 @@ Py:Athena INFO Save Config | | |-AuditStart = False | | |-AuditStop = False | | |-AuditTools = False -| | |-Decoder @0x7f4d6173c9b0 = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') +| | |-Decoder @0x7fa4cceba9b0 = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') | | | (default: 'Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout') -| | |-DetStore @0x7f4d60434110 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d60434150 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d604fd908 = [] (default: []) -| | |-ExtraOutputs @0x7f4d604fd758 = [] (default: []) +| | |-DetStore @0x7fa4cbbb2190 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cbbb21d0 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cbc7b908 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cbc7b758 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputLevel = 0 | | |-RdoLocation = 'StoreGateSvc+TGCRDO' @@ -2258,10 +2260,10 @@ Py:Athena INFO Save Config | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d60434210 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d60434250 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d604fd5a8 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d604fd710 = [] (default: []) +| | | |-DetStore @0x7fa4cbbb2290 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cbbb22d0 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cbc7b5a8 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cbc7b710 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | |-ShowStatusWords = False @@ -2281,19 +2283,19 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d6052ee50 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbc9bed0 = ServiceHandle('StoreGateSvc/DetectorStore') | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d6052edd0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff682d8 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68368 = [] (default: []) +| |-EvtStore @0x7fa4cbc9be50 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cb5ddd40 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5dddd0 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68320 = [] (default: []) +| |-NeededResources @0x7fa4cb5ddcb0 = [] (default: []) | |-OutputLevel = 0 -| |-ProviderTool @0x7f4d6063bd50 = PrivateToolHandle('Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool') +| |-ProviderTool @0x7fa4cbdbae50 = PrivateToolHandle('Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool') | | (default: 'Muon::MDT_RawDataProviderTool/MdtRawDataProviderTool') | |-RegisterForContextService = False | |-Timeline = True @@ -2306,11 +2308,11 @@ Py:Athena INFO Save Config | | |-AuditStop = False | | |-AuditTools = False | | |-CsmContainerCacheKey = 'StoreGateSvc+' -| | |-Decoder @0x7f4d6173cc80 = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') -| | |-DetStore @0x7f4d5fff0b10 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d5fff0b50 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d60061bd8 = [] (default: []) -| | |-ExtraOutputs @0x7f4d60061a70 = [] (default: []) +| | |-Decoder @0x7fa4ccebac80 = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') +| | |-DetStore @0x7fa4cb6b6410 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cb6b6450 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb7dfcf8 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb7dfb90 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputLevel = 0 | | |-RdoLocation = 'StoreGateSvc+MDTCSM' @@ -2323,10 +2325,10 @@ Py:Athena INFO Save Config | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d5fff0c10 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5fff0c50 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d60061b00 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d60061ab8 = [] (default: []) +| | | |-DetStore @0x7fa4cb6b6510 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb6b6550 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cb7dfc20 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cb7dfbd8 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | |-ReadKey = 'ConditionStore+MuonMDT_CablingMap' @@ -2346,19 +2348,19 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d6054cd90 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbcc7e10 = ServiceHandle('StoreGateSvc/DetectorStore') | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d6054cd10 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff683b0 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68440 = [] (default: []) +| |-EvtStore @0x7fa4cbcc7d90 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cb5dde18 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5dde60 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68248 = [] (default: []) +| |-NeededResources @0x7fa4cb5dd7a0 = [] (default: []) | |-OutputLevel = 0 -| |-ProviderTool @0x7f4d6002f050 = PrivateToolHandle('Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool') +| |-ProviderTool @0x7fa4cb6cd150 = PrivateToolHandle('Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool') | | (default: 'Muon::CSC_RawDataProviderTool/CscRawDataProviderTool') | |-RegisterForContextService = False | |-Timeline = True @@ -2371,12 +2373,12 @@ Py:Athena INFO Save Config | | |-AuditStop = False | | |-AuditTools = False | | |-CscContainerCacheKey = 'StoreGateSvc+' -| | |-Decoder @0x7f4d6173ce60 = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') -| | |-DetStore @0x7f4d5ffb29d0 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-Decoder @0x7fa4ccebae60 = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') +| | |-DetStore @0x7fa4cb6772d0 = ServiceHandle('StoreGateSvc/DetectorStore') | | |-EventInfoKey = 'StoreGateSvc+EventInfo' -| | |-EvtStore @0x7f4d5ffb2a10 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ffb0b48 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ffb0dd0 = [] (default: []) +| | |-EvtStore @0x7fa4cb677310 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb66fc68 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb66fef0 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputLevel = 0 | | |-RdoLocation = 'StoreGateSvc+CSCRDO' @@ -2388,10 +2390,10 @@ Py:Athena INFO Save Config | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d5ffb2ad0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5ffb2b10 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d5ffb0cb0 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d5ffb0c68 = [] (default: []) +| | | |-DetStore @0x7fa4cb6773d0 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb677410 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cb66fdd0 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cb66fd88 = [] (default: []) | | | |-IsCosmics = False | | | |-IsOldCosmics = False | | | |-MonitorService = 'MonitorSvc' @@ -2411,25 +2413,25 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DecodingTool @0x7f4d607a3d20 = PrivateToolHandle('Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool') +| |-DecodingTool @0x7fa4cbf21d20 = PrivateToolHandle('Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool') | | (default: 'Muon::RpcRdoToPrepDataTool/RpcRdoToPrepDataTool') -| |-DetStore @0x7f4d5ffea490 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cb6a3d50 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ffea410 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff685a8 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68518 = [] (default: []) +| |-EvtStore @0x7fa4cb6a3cd0 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe42050 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5ddf38 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff683f8 = [] (default: []) +| |-NeededResources @0x7fa4cb5ddf80 = [] (default: []) | |-OutputCollection = 'StoreGateSvc+RPC_Measurements' | |-OutputLevel = 0 | |-PrintInputRdo = False -| |-PrintPrepData @0x7f4d63a90b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4d5ffea510 = ServiceHandle('RegSelSvc') +| |-PrintPrepData @0x7fa4cf20eb20 = False (default: False) +| |-RegionSelectionSvc @0x7fa4cb6a3dd0 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Timeline = True @@ -2442,16 +2444,16 @@ Py:Athena INFO Save Config | | |-AuditStop = False | | |-AuditTools = False | | |-DecodeData = True -| | |-DetStore @0x7f4d5ff57650 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d5ff576d0 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ffc2758 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ffc2878 = [] (default: []) +| | |-DetStore @0x7fa4cb611f10 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cb611f90 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb680ea8 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb680908 = [] (default: []) | | |-InputCollection = 'StoreGateSvc+RPC_triggerHits' | | |-MonitorService = 'MonitorSvc' | | |-OutputCollection = 'StoreGateSvc+RPCPAD' | | |-OutputLevel = 0 | | |-RPCInfoFromDb = False -| | |-RdoDecoderTool @0x7f4d604054b0 = PrivateToolHandle('Muon::RpcRDO_Decoder/Muon::RpcRDO_Decoder') +| | |-RdoDecoderTool @0x7fa4cbb834b0 = PrivateToolHandle('Muon::RpcRDO_Decoder/Muon::RpcRDO_Decoder') | | | (default: 'Muon::RpcRDO_Decoder') | | |-TriggerOutputCollection = 'StoreGateSvc+RPC_Measurements' | | |-etaphi_coincidenceTime = 20.0 @@ -2469,10 +2471,10 @@ Py:Athena INFO Save Config | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d5ff57750 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5ff57790 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d5ffc2ab8 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d5ffc2cf8 = [] (default: []) +| | | |-DetStore @0x7fa4cb61d050 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb61d090 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cb680680 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cb6805f0 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | \----- (End of Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder) ----- @@ -2490,25 +2492,25 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DecodingTool @0x7f4d61bdfe90 = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') +| |-DecodingTool @0x7fa4cd35de90 = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') | | (default: 'Muon::TgcRdoToPrepDataTool/TgcPrepDataProviderTool') -| |-DetStore @0x7f4d5ff43390 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cb5fcc50 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ff43310 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff684d0 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff685f0 = [] (default: []) +| |-EvtStore @0x7fa4cb5fcbd0 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe42128 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5ddd88 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68488 = [] (default: []) +| |-NeededResources @0x7fa4cbe420e0 = [] (default: []) | |-OutputCollection = 'StoreGateSvc+TGC_Measurements' | |-OutputLevel = 0 | |-PrintInputRdo = False -| |-PrintPrepData @0x7f4d63a90b20 = False (default: False) -| |-RegionSelectorSvc @0x7f4d5ff43410 = ServiceHandle('RegSelSvc') +| |-PrintPrepData @0x7fa4cf20eb20 = False (default: False) +| |-RegionSelectorSvc @0x7fa4cb5fccd0 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Setting = 0 @@ -2522,10 +2524,10 @@ Py:Athena INFO Save Config | | |-AuditStop = False | | |-AuditTools = False | | |-DecodeData = True -| | |-DetStore @0x7f4d5ff578d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d5ff57990 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ff62e60 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ff62e18 = [] (default: []) +| | |-DetStore @0x7fa4cb61d1d0 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cb61d290 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb625128 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb625098 = [] (default: []) | | |-FillCoinData = True | | |-MonitorService = 'MonitorSvc' | | |-OutputCoinCollection = 'TrigT1CoinDataCollection' @@ -2534,9 +2536,9 @@ Py:Athena INFO Save Config | | |-RDOContainer = 'StoreGateSvc+TGCRDO' | | |-TGCHashIdOffset = 26000 | | |-dropPrdsWithZeroWidth = True -| | |-outputCoinKey @0x7f4d5ff628c0 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] +| | |-outputCoinKey @0x7fa4cb624a70 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] | | | (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy']) -| | |-prepDataKeys @0x7f4d5ff62ef0 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] +| | |-prepDataKeys @0x7fa4cb6250e0 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] | | | (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy']) | | |-show_warning_level_invalid_A09_SSW6_hit = False | | \----- (End of Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool) ----- @@ -2553,25 +2555,25 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DecodingTool @0x7f4d63b369f0 = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') +| |-DecodingTool @0x7fa4cf2b4b50 = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') | | (default: 'Muon::MdtRdoToPrepDataTool/MdtPrepDataProviderTool') -| |-DetStore @0x7f4d5ffd8350 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cb691c10 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ffd82d0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff68758 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68560 = [] (default: []) +| |-EvtStore @0x7fa4cb691b90 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe42200 = [] (default: []) +| |-ExtraOutputs @0x7fa4cb5dda28 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff686c8 = [] (default: []) +| |-NeededResources @0x7fa4cb5ddef0 = [] (default: []) | |-OutputCollection = 'StoreGateSvc+MDT_DriftCircles' | |-OutputLevel = 0 | |-PrintInputRdo = False -| |-PrintPrepData @0x7f4d63a90b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4d5ffd83d0 = ServiceHandle('RegSelSvc') +| |-PrintPrepData @0x7fa4cf20eb20 = False (default: False) +| |-RegionSelectionSvc @0x7fa4cb691c90 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Timeline = True @@ -2585,13 +2587,13 @@ Py:Athena INFO Save Config | | |-AuditTools = False | | |-CalibratePrepData = True | | |-DecodeData = True -| | |-DetStore @0x7f4d5ff57bd0 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-DetStore @0x7fa4cb61d110 = ServiceHandle('StoreGateSvc/DetectorStore') | | |-DiscardSecondaryHitTwin = False | | |-DoPropagationCorrection = False | | |-DoTofCorrection = True -| | |-EvtStore @0x7f4d5ff57690 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ff61dd0 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ff61f38 = [] (default: []) +| | |-EvtStore @0x7fa4cb61d390 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cb624128 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cb624878 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputCollection = 'StoreGateSvc+MDT_DriftCircles' | | |-OutputLevel = 0 @@ -2619,25 +2621,25 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-CscRdoToCscPrepDataTool @0x7f4d605cd380 = PrivateToolHandle('Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool') +| |-CscRdoToCscPrepDataTool @0x7fa4cbd4b380 = PrivateToolHandle('Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool') | | (default: 'Muon::CscRdoToCscPrepDataTool/CscRdoToPrepDataTool') -| |-DetStore @0x7f4d5ffb2fd0 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cb677950 = ServiceHandle('StoreGateSvc/DetectorStore') | |-DoSeededDecoding = False | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ffb2f50 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff68830 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68680 = [] (default: []) +| |-EvtStore @0x7fa4cb6778d0 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe422d8 = [] (default: []) +| |-ExtraOutputs @0x7fa4cbe42098 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff687a0 = [] (default: []) +| |-NeededResources @0x7fa4cbe42248 = [] (default: []) | |-OutputCollection = 'StoreGateSvc+CSC_Measurements' | |-OutputLevel = 0 | |-PrintInputRdo = False -| |-PrintPrepData @0x7f4d63a90b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4d5ff7d710 = ServiceHandle('RegSelSvc') +| |-PrintPrepData @0x7fa4cf20eb20 = False (default: False) +| |-RegionSelectionSvc @0x7fa4cb6779d0 = ServiceHandle('RegSelSvc') | |-RegisterForContextService = False | |-RoIs = 'StoreGateSvc+OutputRoIs' | |-Timeline = True @@ -2650,13 +2652,13 @@ Py:Athena INFO Save Config | | |-AuditStop = False | | |-AuditTools = False | | |-CSCHashIdOffset = 22000 -| | |-CscCalibTool @0x7f4d63b3a860 = PrivateToolHandle('CscCalibTool/CscCalibTool') -| | |-CscRdoDecoderTool @0x7f4d5ff715c0 = PrivateToolHandle('Muon::CscRDO_Decoder/CscRDO_Decoder') +| | |-CscCalibTool @0x7fa4cf2b8860 = PrivateToolHandle('CscCalibTool/CscCalibTool') +| | |-CscRdoDecoderTool @0x7fa4cb622d00 = PrivateToolHandle('Muon::CscRDO_Decoder/CscRDO_Decoder') | | |-DecodeData = True -| | |-DetStore @0x7f4d5ff57b50 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4d5ff57a10 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4d5ff878c0 = [] (default: []) -| | |-ExtraOutputs @0x7f4d5ff87f80 = [] (default: []) +| | |-DetStore @0x7fa4cb61d550 = ServiceHandle('StoreGateSvc/DetectorStore') +| | |-EvtStore @0x7fa4cb61d210 = ServiceHandle('StoreGateSvc') +| | |-ExtraInputs @0x7fa4cbe38f80 = [] (default: []) +| | |-ExtraOutputs @0x7fa4cbe38b48 = [] (default: []) | | |-MonitorService = 'MonitorSvc' | | |-OutputCollection = 'StoreGateSvc+CSC_Measurements' | | |-OutputLevel = 0 @@ -2669,10 +2671,10 @@ Py:Athena INFO Save Config | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-DetStore @0x7f4d5ff57d10 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5ff57d50 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d5ff87320 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d5ff87368 = [] (default: []) +| | | |-DetStore @0x7fa4cb61d350 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb61d3d0 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cbe38950 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cbe38170 = [] (default: []) | | | |-IsOnline = True | | | |-Latency = 100.0 | | | |-MonitorService = 'MonitorSvc' @@ -2699,11 +2701,11 @@ Py:Athena INFO Save Config | | | |-AuditStart = False | | | |-AuditStop = False | | | |-AuditTools = False -| | | |-CscCalibTool @0x7f4d5ff57a50 = PublicToolHandle('CscCalibTool') -| | | |-DetStore @0x7f4d5ff57910 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4d5ff57ad0 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4d5ff87200 = [] (default: []) -| | | |-ExtraOutputs @0x7f4d5ff87248 = [] (default: []) +| | | |-CscCalibTool @0x7fa4cb61d250 = PublicToolHandle('CscCalibTool') +| | | |-DetStore @0x7fa4cb61d490 = ServiceHandle('StoreGateSvc/DetectorStore') +| | | |-EvtStore @0x7fa4cb61d0d0 = ServiceHandle('StoreGateSvc') +| | | |-ExtraInputs @0x7fa4cbe38368 = [] (default: []) +| | | |-ExtraOutputs @0x7fa4cbe38320 = [] (default: []) | | | |-MonitorService = 'MonitorSvc' | | | |-OutputLevel = 0 | | | \----- (End of Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder) ----- @@ -2721,28 +2723,28 @@ Py:Athena INFO Save Config | |-AuditStart = False | |-AuditStop = False | |-Cardinality = 1 -| |-DetStore @0x7f4d5ff9b210 = ServiceHandle('StoreGateSvc/DetectorStore') +| |-DetStore @0x7fa4cbe57a90 = ServiceHandle('StoreGateSvc/DetectorStore') | |-Enable = True | |-ErrorCounter = 0 | |-ErrorMax = 1 -| |-EvtStore @0x7f4d5ff9b190 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4d5ff687e8 = [] (default: []) -| |-ExtraOutputs @0x7f4d5ff68638 = [] (default: []) +| |-EvtStore @0x7fa4cbe57a10 = ServiceHandle('StoreGateSvc') +| |-ExtraInputs @0x7fa4cbe42290 = [] (default: []) +| |-ExtraOutputs @0x7fa4cbe42170 = [] (default: []) | |-FilterCircularDependencies = True | |-IsIOBound = False | |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4d5ff68878 = [] (default: []) +| |-NeededResources @0x7fa4cbe42320 = [] (default: []) | |-OutputLevel = 0 | |-RegisterForContextService = False | |-Timeline = True -| |-cluster_builder @0x7f4d5fecfb10 = PublicToolHandle('CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool') +| |-cluster_builder @0x7fa4cb5d5410 = PublicToolHandle('CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool') | | (default: 'CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool') | \----- (End of Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder) --------------------- \----- (End of Algorithm AthSequencer/AthAlgSeq) --------------------------------------------------- JOs reading stage finished, launching Athena from pickle file -Thu Mar 21 07:02:40 CET 2019 +Thu Mar 21 08:20:39 CET 2019 Preloading tcmalloc_minimal.so Py:Athena INFO using release [AthenaExternals-22.0.1] [x86_64-slc6-gcc8-opt] [2.0.26/d4d5e51] -- built on [2019-03-18T2110] Py:Athena INFO including file "AthenaCommon/Preparation.py" @@ -2752,13 +2754,13 @@ Py:Athena INFO configuring AthenaHive with [1] concurrent threads and Py:AlgScheduler INFO setting up AvalancheSchedulerSvc/AvalancheSchedulerSvc with 1 threads Py:Athena INFO including file "AthenaCommon/Execution.py" Py:Athena INFO now loading MuonRdoDecode.pkl ... -Py:ConfigurableDb INFO Read module info for 5447 configurables from 5 genConfDb files +Py:ConfigurableDb INFO Read module info for 5465 configurables from 7 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! [?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v31r0) - running on lxplus047.cern.ch on Thu Mar 21 07:02:56 2019 + running on lxplus047.cern.ch on Thu Mar 21 08:20:56 2019 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 @@ -2786,7 +2788,7 @@ PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.x PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-18T2151/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-19T2153/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config DBReplicaSvc INFO Total of 10 servers found for host lxplus047.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] DBReplicaSvc INFO COOL SQLite replicas will be excluded if matching pattern /DBRelease/ PoolSvc INFO Successfully setup replica sorting algorithm @@ -3069,7 +3071,7 @@ MuGM:MuonFactory INFO ***************************************************** MGM::MuonDetect... INFO Init A/B Line Containers - done - size is respectively 1758/0 MGM::MuonDetect... INFO No Aline for CSC wire layers loaded -GeoModelSvc INFO GeoModelSvc.MuonDetectorTool SZ= 42840Kb Time = 0.78S +GeoModelSvc INFO GeoModelSvc.MuonDetectorTool SZ= 42840Kb Time = 0.88S GeoModelSvc.Muo... INFO CondAttrListCollection not found in the DetectorStore GeoModelSvc.Muo... INFO Unable to register callback on CondAttrListCollection for any folder in the list GeoModelSvc.Muo... INFO This is OK unless you expect to read alignment and deformations from COOL @@ -3118,7 +3120,7 @@ TgcRawDataProvi... INFO Tool = TgcRawDataProvider.TGC_RawDataProviderTool is MuonTGC_CablingSvc INFO for 1/12 sector initialize ToolSvc.TGCCabl... INFO initialize ClassIDSvc INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonTGC_CablingSvc[0x1b0f2c00]+219 bound to CondAttrListCollection[/TGC/CABLING/MAP_SCHEMA] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonTGC_CablingSvc[0x16680100]+219 bound to CondAttrListCollection[/TGC/CABLING/MAP_SCHEMA] TgcRawDataProvi... INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderTool MdtRawDataProvider INFO MdtRawDataProvider::initialize ClassIDSvc INFO getRegistryEntries: read 922 CLIDRegistry entries for module ALL @@ -3168,14 +3170,14 @@ ClassIDSvc INFO getRegistryEntries: read 60 CLIDRegistry entries for CscRdoToCscPrep... INFO The Geometry version is MuonSpectrometer-R.08.01 MuonCalib::CscC... INFO Initializing CscCoolStrSvc ClassIDSvc INFO getRegistryEntries: read 181 CLIDRegistry entries for module ALL -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1b215a00]+259 bound to CondAttrListCollection[CSC_PED] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1b215a00]+259 bound to CondAttrListCollection[CSC_NOISE] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1b215a00]+259 bound to CondAttrListCollection[CSC_PSLOPE] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1b215a00]+259 bound to CondAttrListCollection[CSC_STAT] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1b215a00]+259 bound to CondAttrListCollection[CSC_RMS] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1b215a00]+259 bound to CondAttrListCollection[CSC_FTHOLD] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1b215a00]+259 bound to CondAttrListCollection[CSC_T0BASE] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1b215a00]+259 bound to CondAttrListCollection[CSC_T0PHASE] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bcc1a00]+259 bound to CondAttrListCollection[CSC_PED] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bcc1a00]+259 bound to CondAttrListCollection[CSC_NOISE] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bcc1a00]+259 bound to CondAttrListCollection[CSC_PSLOPE] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bcc1a00]+259 bound to CondAttrListCollection[CSC_STAT] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bcc1a00]+259 bound to CondAttrListCollection[CSC_RMS] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bcc1a00]+259 bound to CondAttrListCollection[CSC_FTHOLD] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bcc1a00]+259 bound to CondAttrListCollection[CSC_T0BASE] +IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bcc1a00]+259 bound to CondAttrListCollection[CSC_T0PHASE] CscRdoToCscPrep... INFO Retrieved CscRdoToCscPrepDataTool = PrivateToolHandle('Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool') HistogramPersis...WARNING Histograms saving not required. EventSelector INFO Initializing EventSelector - package version ByteStreamCnvSvc-00-00-00 @@ -3378,34 +3380,34 @@ IncidentProcAlg2 INFO Finalize AtlasFieldSvc INFO finalize() successful EventInfoByteSt... INFO finalize IdDictDetDescrCnv INFO in finalize -IOVDbFolder INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/2 objs/chan/bytes 4/4/20 (( 0.23 ))s -IOVDbFolder INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/1 objs/chan/bytes 3/3/202 (( 0.19 ))s -IOVDbFolder INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 (( 2.02 ))s -IOVDbFolder INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 (( 0.06 ))s -IOVDbFolder INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 (( 1.69 ))s -IOVDbFolder INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 (( 0.13 ))s -IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/222235 (( 1.02 ))s -IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/29402 (( 0.04 ))s -IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/1 objs/chan/bytes 1613/1613/7562651 (( 0.24 ))s -IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/1 objs/chan/bytes 1612/1612/8096306 (( 0.27 ))s -IOVDbFolder INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/3704 (( 0.97 ))s -IOVDbFolder INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 (( 0.21 ))s +IOVDbFolder INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/2 objs/chan/bytes 4/4/20 (( 0.20 ))s +IOVDbFolder INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/1 objs/chan/bytes 3/3/202 (( 0.93 ))s +IOVDbFolder INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 (( 0.32 ))s +IOVDbFolder INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 (( 0.79 ))s +IOVDbFolder INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 (( 0.29 ))s +IOVDbFolder INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 (( 1.03 ))s +IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/222235 (( 0.15 ))s +IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/29402 (( 0.80 ))s +IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/1 objs/chan/bytes 1613/1613/7562651 (( 1.17 ))s +IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/1 objs/chan/bytes 1612/1612/8096306 (( 0.30 ))s +IOVDbFolder INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/3704 (( 0.07 ))s +IOVDbFolder INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 (( 1.08 ))s IOVDbFolder INFO Folder /CSC/NOISE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/350062 (( 0.13 ))s -IOVDbFolder INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 (( 0.88 ))s -IOVDbFolder INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 (( 0.91 ))s -IOVDbFolder INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 (( 0.91 ))s -IOVDbFolder INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 (( 0.13 ))s -IOVDbFolder INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 (( 1.25 ))s -IOVDbFolder INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 (( 0.04 ))s -IOVDbSvc INFO bytes in (( 11.31 ))s +IOVDbFolder INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 (( 0.77 ))s +IOVDbFolder INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 (( 0.13 ))s +IOVDbFolder INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 (( 0.94 ))s +IOVDbFolder INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 (( 0.94 ))s +IOVDbFolder INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 (( 0.14 ))s +IOVDbFolder INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 (( 0.76 ))s +IOVDbSvc INFO bytes in (( 10.93 ))s IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=CONDBR2 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 2.08 ))s -IOVDbSvc INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: (( 1.57 ))s -IOVDbSvc INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 1.82 ))s -IOVDbSvc INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: (( 4.46 ))s -IOVDbSvc INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.19 ))s -IOVDbSvc INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.97 ))s -IOVDbSvc INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.23 ))s +IOVDbSvc INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 1.11 ))s +IOVDbSvc INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: (( 2.41 ))s +IOVDbSvc INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 1.32 ))s +IOVDbSvc INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: (( 4.89 ))s +IOVDbSvc INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.93 ))s +IOVDbSvc INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.07 ))s +IOVDbSvc INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.20 ))s AthDictLoaderSvc INFO in finalize... ToolSvc INFO Removing all tools created by ToolSvc ToolSvc.ByteStr... INFO in finalize() @@ -3430,7 +3432,7 @@ ToolSvc.TGCCabl... INFO finalize *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** cObj_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 20 -ChronoStatSvc INFO Time User : Tot= 10 [s] #= 1 +ChronoStatSvc INFO Time User : Tot= 9.85 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref index c4f3156346a59899fe156d1e712a89f9b2830d37..bd2f1d9b430e72e754a85d5f91b8bb967a183a4c 100644 --- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref +++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref @@ -274,4428 +274,13 @@ Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool Py:ComponentAccumulator DEBUG Adding component ROBDataProviderSvc/ROBDataProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component RPCcablingServerSvc/RPCcablingServerSvc to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonRPC_CablingSvc/MuonRPC_CablingSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ROBDataProviderSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component RPCCablingDbTool/RPCCablingDbTool to the job -Py:ComponentAccumulator DEBUG Adding component Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component LVL1TGC::TGCRecRoiSvc/LVL1TGC::TGCRecRoiSvc to the job -Py:ComponentAccumulator DEBUG Adding component TGCcablingServerSvc/TGCcablingServerSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component LVL1TGC::TGCRecRoiSvc/LVL1TGC::TGCRecRoiSvc to the job -Py:ComponentAccumulator DEBUG Adding component TGCcablingServerSvc/TGCcablingServerSvc to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component ROBDataProviderSvc/ROBDataProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component LVL1TGC::TGCRecRoiSvc/LVL1TGC::TGCRecRoiSvc to the job -Py:ComponentAccumulator DEBUG Adding component TGCcablingServerSvc/TGCcablingServerSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ROBDataProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingAlg/MuonMDT_CablingAlg to the job -Py:ComponentAccumulator DEBUG Adding component MDTCablingDbTool/MDTCablingDbTool to the job -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingSvc/MuonMDT_CablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingAlg/MuonMDT_CablingAlg to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingSvc/MuonMDT_CablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component MDTCablingDbTool/MDTCablingDbTool to the job -Py:Athena INFO Importing MuonCnvExample.MuonCnvUtils -Py:Athena INFO Importing MagFieldServices.MagFieldServicesConfig -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component MagField::AtlasFieldSvc/AtlasFieldSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component MagField::AtlasFieldSvc/AtlasFieldSvc to the job -dynamically loading the flag Muon -Flag Name : Value -Beam.BunchSpacing : 25 -Beam.Energy : [function] -Beam.NumberOfCollisions : [function] -Beam.Type : [function] -Beam.estimatedLuminosity : [function] -Calo.Cell.doLArHVCorr : False -Calo.Noise.fixedLumiForNoise : -1 -Calo.Noise.useCaloNoiseLumi : True -Calo.TopoCluster.doTopoClusterLocalCalib : True -Calo.TopoCluster.doTreatEnergyCutAsAbsol : False -Calo.TopoCluster.doTwoGaussianNoise : True -Common.Project : 'Athena' -Common.isOnline : False -Concurrency.NumConcurrentEvents : 0 -Concurrency.NumProcs : 0 -Concurrency.NumThreads : 0 -Detector.Geometry : [function] -Detector.GeometryAFP : False -Detector.GeometryALFA : False -Detector.GeometryBCM : False -Detector.GeometryBpipe : False -Detector.GeometryCSC : False -Detector.GeometryCalo : [function] -Detector.GeometryCavern : False -Detector.GeometryDBM : False -Detector.GeometryForward : [function] -Detector.GeometryFwdRegion : False -Detector.GeometryID : [function] -Detector.GeometryLAr : False -Detector.GeometryLucid : False -Detector.GeometryMDT : False -Detector.GeometryMM : False -Detector.GeometryMuon : [function] -Detector.GeometryPixel : False -Detector.GeometryRPC : False -Detector.GeometrySCT : False -Detector.GeometryTGC : False -Detector.GeometryTRT : False -Detector.GeometryTile : False -Detector.GeometryZDC : False -Detector.GeometrysTGC : False -Detector.Overlay : [function] -Detector.OverlayBCM : False -Detector.OverlayCSC : False -Detector.OverlayCalo : [function] -Detector.OverlayDBM : False -Detector.OverlayID : [function] -Detector.OverlayLAr : False -Detector.OverlayMDT : False -Detector.OverlayMM : False -Detector.OverlayMuon : [function] -Detector.OverlayPixel : False -Detector.OverlayRPC : False -Detector.OverlaySCT : False -Detector.OverlayTGC : False -Detector.OverlayTRT : False -Detector.OverlayTile : False -Detector.OverlaysTGC : False -Detector.Simulate : False -Detector.SimulateAFP : False -Detector.SimulateALFA : False -Detector.SimulateBCM : False -Detector.SimulateBpipe : False -Detector.SimulateCSC : False -Detector.SimulateCalo : False -Detector.SimulateCavern : False -Detector.SimulateDBM : False -Detector.SimulateForward : False -Detector.SimulateFwdRegion : False -Detector.SimulateHGTD : False -Detector.SimulateID : False -Detector.SimulateLAr : False -Detector.SimulateLucid : False -Detector.SimulateMDT : False -Detector.SimulateMM : False -Detector.SimulateMuon : False -Detector.SimulatePixel : False -Detector.SimulateRPC : False -Detector.SimulateSCT : False -Detector.SimulateTGC : False -Detector.SimulateTRT : False -Detector.SimulateTile : False -Detector.SimulateZDC : False -Detector.SimulatesTGC : False -GeoModel.Align.Dynamic : [function] -GeoModel.AtlasVersion : 'ATLAS-R2-2016-01-00-01' -GeoModel.IBLLayout : 'UNDEFINED' -GeoModel.Layout : 'atlas' -GeoModel.Run : 'RUN2' -GeoModel.StripGeoType : 'GMX' -GeoModel.Type : 'UNDEFINED' -IOVDb.DatabaseInstance : 'CONDBR2' -IOVDb.GlobalTag : 'CONDBR2-BLKPA-2018-13' -Input.Files : ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1'] -Input.ProjectName : 'data17_13TeV' -Input.RunNumber : [function] -Input.isMC : False -Muon.Align.UseALines : False -Muon.Align.UseAsBuilt : False -Muon.Align.UseBLines : 'none' -Muon.Align.UseILines : False -Muon.Calib.CscF001FromLocalFile : False -Muon.Calib.CscNoiseFromLocalFile : False -Muon.Calib.CscPSlopeFromLocalFile : False -Muon.Calib.CscPedFromLocalFile : False -Muon.Calib.CscRmsFromLocalFile : False -Muon.Calib.CscStatusFromLocalFile : False -Muon.Calib.CscT0BaseFromLocalFile : False -Muon.Calib.CscT0PhaseFromLocalFile : False -Muon.Calib.EventTag : 'MoMu' -Muon.Calib.applyRtScaling : True -Muon.Calib.correctMdtRtForBField : False -Muon.Calib.correctMdtRtForTimeSlewing : False -Muon.Calib.correctMdtRtWireSag : False -Muon.Calib.mdtCalibrationSource : 'MDT' -Muon.Calib.mdtMode : 'ntuple' -Muon.Calib.mdtPropagationSpeedBeta : 0.85 -Muon.Calib.readMDTCalibFromBlob : True -Muon.Calib.useMLRt : True -Muon.Chi2NDofCut : 20.0 -Muon.createTrackParticles : True -Muon.doCSCs : True -Muon.doDigitization : True -Muon.doFastDigitization : False -Muon.doMDTs : True -Muon.doMSVertex : False -Muon.doMicromegas : False -Muon.doPseudoTracking : False -Muon.doRPCClusterSegmentFinding : False -Muon.doRPCs : True -Muon.doSegmentT0Fit : False -Muon.doTGCClusterSegmentFinding : False -Muon.doTGCs : True -Muon.dosTGCs : False -Muon.enableCurvedSegmentFinding : False -Muon.enableErrorTuning : False -Muon.optimiseMomentumResolutionUsingChi2 : False -Muon.patternsOnly : False -Muon.prdToxAOD : False -Muon.printSummary : False -Muon.refinementTool : 'Moore' -Muon.rpcRawToxAOD : False -Muon.segmentOrigin : 'Muon' -Muon.straightLineFitMomentum : 2000.0 -Muon.strategy : [] -Muon.trackBuilder : 'Moore' -Muon.updateSegmentSecondCoordinate : [function] -Muon.useAlignmentCorrections : False -Muon.useLooseErrorTuning : False -Muon.useSegmentMatching : [function] -Muon.useTGCPriorNextBC : False -Muon.useTrackSegmentMatching : True -Muon.useWireSagCorrections : False -Output.AODFileName : 'myAOD.pool.root' -Output.ESDFileName : 'myESD.pool.root' -Output.EVNTFileName : 'myEVNT.pool.root' -Output.HISTFileName : 'myHIST.root' -Output.HITSFileName : 'myHITS.pool.root' -Output.RDOFileName : 'myROD.pool.root' -Output.doESD : False -Random.Engine : 'dSFMT' -Scheduler.CheckDependencies : True -Scheduler.ShowControlFlow : True -Scheduler.ShowDataDeps : True -Scheduler.ShowDataFlow : True -Flag categories that can be loaded dynamically -Category : Generator name : Defined in -DQ : __dq : AthenaConfiguration/AllConfigFlags.py -Egamma : __egamma : AthenaConfiguration/AllConfigFlags.py -LAr : __lar : AthenaConfiguration/AllConfigFlags.py -Sim : __simulation : AthenaConfiguration/AllConfigFlags.py -Trigger : __trigger : AthenaConfiguration/AllConfigFlags.py -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:IOVDbSvc.CondDB DEBUG Loading basic services for CondDBSetup... -Py:ConfigurableDb DEBUG loading confDb files... -Py:ConfigurableDb DEBUG -loading [/afs/cern.ch/user/s/shhayash/workspace/Development/GIT2019-03-20/build/x86_64-slc6-gcc8-opt/lib/libTrigUpgradeTest.confdb]... -Py:ConfigurableDb DEBUG -loading [/afs/cern.ch/user/s/shhayash/workspace/Development/GIT2019-03-20/build/x86_64-slc6-gcc8-opt/lib/libTrigL2MuonSA.confdb]... -Py:ConfigurableDb DEBUG -loading [/afs/cern.ch/user/s/shhayash/workspace/Development/GIT2019-03-20/build/x86_64-slc6-gcc8-opt/lib/WorkDir.confdb]... -Py:ConfigurableDb DEBUG -loading [/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-18T2151/GAUDI/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/lib/Gaudi.confdb]... -Py:ConfigurableDb DEBUG -loading [/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-18T2151/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/lib/Athena.confdb]... -Py:ConfigurableDb DEBUG loading confDb files... [DONE] -Py:ConfigurableDb DEBUG loaded 1102 confDb packages -Py:ConfigurableDb INFO Read module info for 5447 configurables from 5 genConfDb files -Py:ConfigurableDb INFO No duplicates have been found: that's good ! -Py:ConfigurableDb DEBUG : Found configurable <class 'GaudiCoreSvc.GaudiCoreSvcConf.MessageSvc'> in module GaudiCoreSvc.GaudiCoreSvcConf -Py:loadBasicAthenaPool DEBUG Loading basic services for AthenaPool... -Py:ConfigurableDb DEBUG : Found configurable <class 'PoolSvc.PoolSvcConf.PoolSvc'> in module PoolSvc.PoolSvcConf -Py:ConfigurableDb DEBUG : Found configurable <class 'AthenaPoolCnvSvc.AthenaPoolCnvSvcConf.AthenaPoolCnvSvc'> in module AthenaPoolCnvSvc.AthenaPoolCnvSvcConf -Py:ConfigurableDb DEBUG : Found configurable <class 'SGComps.SGCompsConf.ProxyProviderSvc'> in module SGComps.SGCompsConf -Py:ConfigurableDb DEBUG : Found configurable <class 'AthenaServices.AthenaServicesConf.MetaDataSvc'> in module AthenaServices.AthenaServicesConf -Py:ConfigurableDb DEBUG : Found configurable <class 'StoreGate.StoreGateConf.StoreGateSvc'> in module StoreGate.StoreGateConf -Py:loadBasicAthenaPool DEBUG Loading basic services for AthenaPool... [DONE] -Py:loadBasicIOVDb DEBUG Loading basic services for IOVDbSvc... -Py:ConfigurableDb DEBUG : Found configurable <class 'SGComps.SGCompsConf.ProxyProviderSvc'> in module SGComps.SGCompsConf -Py:Configurable ERROR attempt to add a duplicate (ServiceManager.ProxyProviderSvc) ... dupe ignored -Py:loadBasicEventInfoMgt DEBUG Loading basic services for EventInfoMgt... -EventInfoMgtInit: Got release version Athena-22.0.1 -Py:Configurable ERROR attempt to add a duplicate (ServiceManager.EventPersistencySvc) ... dupe ignored -Py:ConfigurableDb DEBUG : Found configurable <class 'SGComps.SGCompsConf.ProxyProviderSvc'> in module SGComps.SGCompsConf -Py:Configurable ERROR attempt to add a duplicate (ServiceManager.ProxyProviderSvc) ... dupe ignored -Py:loadBasicEventInfoMgt DEBUG Loading basic services for EventInfoMgt... [DONE] -Py:loadBasicIOVDb DEBUG Loading basic services for IOVDb... [DONE] -Py:IOVDbSvc.CondDB INFO Setting up conditions DB access to instance OFLP200 -Py:Configurable ERROR attempt to add a duplicate (ServiceManager.PoolSvc) ... dupe ignored -Py:IOVDbSvc.CondDB DEBUG Loading basic services for CondDBSetup... [DONE] -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationDbSvc/MdtCalibrationDbSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationDbSvc/MdtCalibrationDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationSvc/MdtCalibrationSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component AthenaPoolCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component MagField::AtlasFieldSvc/AtlasFieldSvc to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationDbSvc/MdtCalibrationDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationSvc/MdtCalibrationSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component ROBDataProviderSvc/ROBDataProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingAlg/MuonMDT_CablingAlg to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingSvc/MuonMDT_CablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component MagField::AtlasFieldSvc/AtlasFieldSvc to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationDbSvc/MdtCalibrationDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationSvc/MdtCalibrationSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ROBDataProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component MDTCablingDbTool/MDTCablingDbTool to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component CSCcablingSvc/CSCcablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component CSCcablingSvc/CSCcablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component ROBDataProviderSvc/ROBDataProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component CSCcablingSvc/CSCcablingSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ROBDataProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component RPCcablingServerSvc/RPCcablingServerSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component RPCCablingDbTool/RPCCablingDbTool to the job -Py:ComponentAccumulator DEBUG Adding component MuonRPC_CablingSvc/MuonRPC_CablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component RPCcablingServerSvc/RPCcablingServerSvc to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonRPC_CablingSvc/MuonRPC_CablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component RPCCablingDbTool/RPCCablingDbTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ConfigurableDb DEBUG : Found configurable <class 'MuonRPC_CnvTools.MuonRPC_CnvToolsConf.Muon__RpcRDO_Decoder'> in module MuonRPC_CnvTools.MuonRPC_CnvToolsConf -Py:ComponentAccumulator DEBUG Adding component Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component RPCcablingServerSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component MuonRPC_CablingSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.RPCCablingDbTool -Py:ComponentAccumulator DEBUG Adding component Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component LVL1TGC::TGCRecRoiSvc/LVL1TGC::TGCRecRoiSvc to the job -Py:ComponentAccumulator DEBUG Adding component TGCcablingServerSvc/TGCcablingServerSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component LVL1TGC::TGCRecRoiSvc/LVL1TGC::TGCRecRoiSvc to the job -Py:ComponentAccumulator DEBUG Adding component TGCcablingServerSvc/TGCcablingServerSvc to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component LVL1TGC::TGCRecRoiSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TGCcablingServerSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingAlg/MuonMDT_CablingAlg to the job -Py:ComponentAccumulator DEBUG Adding component MDTCablingDbTool/MDTCablingDbTool to the job -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingSvc/MuonMDT_CablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingAlg/MuonMDT_CablingAlg to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonMDT_CablingSvc/MuonMDT_CablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component MDTCablingDbTool/MDTCablingDbTool to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component MagField::AtlasFieldSvc/AtlasFieldSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component AthenaPoolCnvSvc/AthenaPoolCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component MagField::AtlasFieldSvc/AtlasFieldSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationDbSvc/MdtCalibrationDbSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationDbSvc/MdtCalibrationDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationSvc/MdtCalibrationSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component AthenaPoolCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component MagField::AtlasFieldSvc/AtlasFieldSvc to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationDbSvc/MdtCalibrationDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component MdtCalibrationSvc/MdtCalibrationSvc to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component MuonMDT_CablingAlg -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component AthenaPoolCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component MuonMDT_CablingSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component AtlasFieldSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component MdtCalibrationDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component MdtCalibrationSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.MDTCablingDbTool -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.MdtCalibDbTool -Py:ComponentAccumulator DEBUG Adding component Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component CSCcablingSvc/CSCcablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component CSCcablingSvc/CSCcablingSvc to the job -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::CscCoolStrSvc/MuonCalib::CscCoolStrSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Adding component CondInputLoader/CondInputLoader to the job -Py:ComponentAccumulator DEBUG Adding component MuonCalib::CscCoolStrSvc/MuonCalib::CscCoolStrSvc to the job -Py:ComponentAccumulator DEBUG Adding component IOVDbSvc/IOVDbSvc to the job -Py:ComponentAccumulator DEBUG Adding component PoolSvc/PoolSvc to the job -Py:ComponentAccumulator DEBUG Adding component CondSvc/CondSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Adding component DBReplicaSvc/DBReplicaSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Adding component GeoModelSvc/GeoModelSvc to the job -Py:ComponentAccumulator DEBUG Adding component DetDescrCnvSvc/DetDescrCnvSvc to the job -Py:ComponentAccumulator DEBUG Adding component EvtPersistencySvc/EventPersistencySvc to the job -Py:ComponentAccumulator DEBUG Adding component TagInfoMgr/TagInfoMgr to the job -Py:ComponentAccumulator DEBUG Adding component ProxyProviderSvc/ProxyProviderSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Adding component Muon::MuonIdHelperTool/Muon::MuonIdHelperTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ConfigurableDb DEBUG : Found configurable <class 'MuonCSC_CnvTools.MuonCSC_CnvToolsConf.Muon__CscRDO_Decoder'> in module MuonCSC_CnvTools.MuonCSC_CnvToolsConf -Py:ConfigurableDb DEBUG : Found configurable <class 'CscCalibTools.CscCalibToolsConf.CscCalibTool'> in module CscCalibTools.CscCalibToolsConf -Py:ComponentAccumulator DEBUG Adding component Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondInputLoader -Py:ComponentAccumulator DEBUG Reconciled configuration of component GeoModelSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DetDescrCnvSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component EventPersistencySvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component TagInfoMgr -Py:ComponentAccumulator DEBUG Reconciled configuration of component ProxyProviderSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CSCcablingSvc -Py:ComponentAccumulator DEBUG Adding component MuonCalib::CscCoolStrSvc/MuonCalib::CscCoolStrSvc to the job -Py:ComponentAccumulator DEBUG Reconciled configuration of component IOVDbSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component PoolSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component CondSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component DBReplicaSvc -Py:ComponentAccumulator DEBUG Reconciled configuration of component ToolSvc.Muon::MuonIdHelperTool -Py:ComponentAccumulator DEBUG Adding component Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool to the job -Py:ComponentAccumulator DEBUG Adding component CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool to the job -Py:ComponentAccumulator DEBUG Adding component CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool to the job -Py:ConfigurableDb DEBUG : Found configurable <class 'AthenaPoolCnvSvc.AthenaPoolCnvSvcConf.AthenaPoolCnvSvc'> in module AthenaPoolCnvSvc.AthenaPoolCnvSvcConf -Py:ComponentAccumulator DEBUG Reconciled configuration of component AthenaPoolCnvSvc -Py:Athena INFO Print Config -Py:ComponentAccumulator INFO Event Inputs -Py:ComponentAccumulator INFO set([]) -Py:ComponentAccumulator INFO Event Algorithm Sequences -Py:ComponentAccumulator INFO /***** Algorithm AthSequencer/AthAlgSeq ************************************************************ -|-Atomic = False -|-AuditAlgorithms = False -|-AuditBeginRun = False -|-AuditEndRun = False -|-AuditExecute = False -|-AuditFinalize = False -|-AuditInitialize = False -|-AuditReinitialize = False -|-AuditRestart = False -|-AuditStart = False -|-AuditStop = False -|-Cardinality = 0 -|-ContinueEventloopOnFPE = False -|-DetStore @0x7f4688998ed0 = ServiceHandle('StoreGateSvc/DetectorStore') -|-Enable = True -|-ErrorCounter = 0 -|-ErrorMax = 1 -|-EvtStore @0x7f4688998e50 = ServiceHandle('StoreGateSvc') -|-ExtraInputs @0x7f4686f2fa70 = [] (default: []) -|-ExtraOutputs @0x7f4686f2fb00 = [] (default: []) -|-FilterCircularDependencies = True -|-IgnoreFilterPassed = False -|-IsIOBound = False -|-Members @0x7f4686f2f710 = ['MuonCacheCreator/MuonCacheCreator', 'Muon::RpcRawDataProvider/RpcRawDataProvider', 'Muon::TgcRawDataProvider/TgcRawDataProvider', 'Muon::MdtRawDataProvider/MdtRawDataProvider', 'Muon::CscRawDataProvider/CscRawDataProvider', 'RpcRdoToRpcPrepData/RpcRdoToRpcPrepData', 'TgcRdoToTgcPrepData/TgcRdoToTgcPrepData', 'MdtRdoToMdtPrepData/MdtRdoToMdtPrepData', 'CscRdoToCscPrepData/CscRdoToCscPrepData', 'CscThresholdClusterBuilder/CscThesholdClusterBuilder'] -| (default: []) -|-ModeOR = False -|-MonitorService = 'MonitorSvc' -|-NeededResources @0x7f4686f2f950 = [] (default: []) -|-OutputLevel = 0 -|-RegisterForContextService = False -|-Sequential @0x7f468aaa5b00 = True (default: False) -|-StopOverride = False -|-TimeOut = 0.0 -|-Timeline = True -|=/***** Algorithm MuonCacheCreator/MuonCacheCreator ************************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 0 -| |-CscCacheKey @0x7f46878c1840 = 'CscCache' (default: 'StoreGateSvc+') -| |-DetStore @0x7f46877860d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DisableViewWarning = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4687786050 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f2fb48 = [] (default: []) -| |-ExtraOutputs @0x7f4686f2f998 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MdtCsmCacheKey @0x7f46878c13f0 = 'MdtCsmCache' (default: 'StoreGateSvc+') -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f2fb90 = [] (default: []) -| |-OutputLevel = 0 -| |-RegisterForContextService = False -| |-RpcCacheKey @0x7f46878c1450 = 'RpcCache' (default: 'StoreGateSvc+') -| |-TgcCacheKey @0x7f46878c1480 = 'TgcCache' (default: 'StoreGateSvc+') -| |-Timeline = True -| \----- (End of Algorithm MuonCacheCreator/MuonCacheCreator) ---------------------------------------- -|=/***** Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider *************************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f46877ec310 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f46877ec290 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f2f830 = [] (default: []) -| |-ExtraOutputs @0x7f4686f2fcb0 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f2fcf8 = [] (default: []) -| |-OutputLevel = 0 -| |-ProviderTool @0x7f468789f718 = PrivateToolHandle('Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool') -| | (default: 'Muon::RPC_RawDataProviderTool/RpcRawDataProviderTool') -| |-RegionSelectionSvc @0x7f46877ec390 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Timeline = True -| |=/***** Private AlgTool Muon::RPC_RawDataProviderTool/RpcRawDataProvider.RPC_RawDataProviderTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-Decoder @0x7f468789f810 = PrivateToolHandle('Muon::RpcROD_Decoder/RpcROD_Decoder') -| | |-DetStore @0x7f4687528a50 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4687528a90 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4687524d88 = [] (default: []) -| | |-ExtraOutputs @0x7f468750d050 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputLevel = 0 -| | |-RPCSec = 'StoreGateSvc+RPC_SECTORLOGIC' -| | |-RdoLocation = 'StoreGateSvc+RPCPAD' -| | |=/***** Private AlgTool Muon::RpcROD_Decoder/RpcRawDataProvider.RPC_RawDataProviderTool.RpcROD_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DataErrorPrintLimit = 1000 -| | | |-DetStore @0x7f4687528b50 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4687528b90 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4687524f38 = [] (default: []) -| | | |-ExtraOutputs @0x7f4687524ef0 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | |-Sector13Data = False -| | | |-SpecialROBNumber = -1 -| | | \----- (End of Private AlgTool Muon::RpcROD_Decoder/RpcRawDataProvider.RPC_RawDataProviderTool.RpcROD_Decoder) ----- -| | \----- (End of Private AlgTool Muon::RPC_RawDataProviderTool/RpcRawDataProvider.RPC_RawDataProviderTool) ----- -| \----- (End of Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider) ------------------------------ -|=/***** Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider *************************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f46877fb2d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f46877fb250 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33050 = [] (default: []) -| |-ExtraOutputs @0x7f4686f2fc20 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f2ff38 = [] (default: []) -| |-OutputLevel = 0 -| |-ProviderTool @0x7f46887508c0 = PrivateToolHandle('Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool') -| | (default: 'Muon::TGC_RawDataProviderTool/TgcRawDataProviderTool') -| |-RegisterForContextService = False -| |-Timeline = True -| |=/***** Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-Decoder @0x7f46887509b0 = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') -| | | (default: 'Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout') -| | |-DetStore @0x7f46874920d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4687492110 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4687550a70 = [] (default: []) -| | |-ExtraOutputs @0x7f46875508c0 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputLevel = 0 -| | |-RdoLocation = 'StoreGateSvc+TGCRDO' -| | |=/***** Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f46874921d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4687492210 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4687550710 = [] (default: []) -| | | |-ExtraOutputs @0x7f4687550878 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | |-ShowStatusWords = False -| | | |-SkipCoincidence = False -| | | \----- (End of Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder) ----- -| | \----- (End of Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool) ----- -| \----- (End of Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider) ------------------------------ -|=/***** Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider *************************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f46877df510 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f46877df490 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33098 = [] (default: []) -| |-ExtraOutputs @0x7f4686f2fd40 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33128 = [] (default: []) -| |-OutputLevel = 0 -| |-ProviderTool @0x7f4687651d50 = PrivateToolHandle('Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool') -| | (default: 'Muon::MDT_RawDataProviderTool/MdtRawDataProviderTool') -| |-RegisterForContextService = False -| |-Timeline = True -| |=/***** Private AlgTool Muon::MDT_RawDataProviderTool/MdtRawDataProvider.MDT_RawDataProviderTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-CsmContainerCacheKey @0x7f46878c13f0 = 'MdtCsmCache' (default: 'StoreGateSvc+') -| | |-Decoder @0x7f4688750c80 = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') -| | |-DetStore @0x7f4687046ad0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4687046b10 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f46870b4d40 = [] (default: []) -| | |-ExtraOutputs @0x7f46870b4bd8 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputLevel @ 0x247a1d8 = 1 (default: 0) -| | |-RdoLocation = 'StoreGateSvc+MDTCSM' -| | |-ReadKey = 'ConditionStore+MuonMDT_CablingMap' -| | |=/***** Private AlgTool MdtROD_Decoder/MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f4687046bd0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4687046c10 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f46870b4c68 = [] (default: []) -| | | |-ExtraOutputs @0x7f46870b4c20 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | |-ReadKey = 'ConditionStore+MuonMDT_CablingMap' -| | | |-SpecialROBNumber = -1 -| | | \----- (End of Private AlgTool MdtROD_Decoder/MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder) ----- -| | \----- (End of Private AlgTool Muon::MDT_RawDataProviderTool/MdtRawDataProvider.MDT_RawDataProviderTool) ----- -| \----- (End of Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider) ------------------------------ -|=/***** Algorithm Muon::CscRawDataProvider/CscRawDataProvider *************************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f46877dea10 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f46877de950 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f330e0 = [] (default: []) -| |-ExtraOutputs @0x7f4686f33248 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33200 = [] (default: []) -| |-OutputLevel = 0 -| |-ProviderTool @0x7f4687061050 = PrivateToolHandle('Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool') -| | (default: 'Muon::CSC_RawDataProviderTool/CscRawDataProviderTool') -| |-RegisterForContextService = False -| |-Timeline = True -| |=/***** Private AlgTool Muon::CSC_RawDataProviderTool/CscRawDataProvider.CSC_RawDataProviderTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-CscContainerCacheKey @0x7f46878c1840 = 'CscCache' (default: 'StoreGateSvc+') -| | |-Decoder @0x7f4688750e60 = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') -| | |-DetStore @0x7f4687007990 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EventInfoKey = 'StoreGateSvc+EventInfo' -| | |-EvtStore @0x7f46870079d0 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4687062050 = [] (default: []) -| | |-ExtraOutputs @0x7f4687062128 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputLevel @ 0x247a1d8 = 1 (default: 0) -| | |-RdoLocation = 'StoreGateSvc+CSCRDO' -| | |=/***** Private AlgTool Muon::CscROD_Decoder/CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f4687007a90 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4687007ad0 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4687004ef0 = [] (default: []) -| | | |-ExtraOutputs @0x7f4687004ea8 = [] (default: []) -| | | |-IsCosmics = False -| | | |-IsOldCosmics = False -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | \----- (End of Private AlgTool Muon::CscROD_Decoder/CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder) ----- -| | \----- (End of Private AlgTool Muon::CSC_RawDataProviderTool/CscRawDataProvider.CSC_RawDataProviderTool) ----- -| \----- (End of Algorithm Muon::CscRawDataProvider/CscRawDataProvider) ------------------------------ -|=/***** Algorithm RpcRdoToRpcPrepData/RpcRdoToRpcPrepData ******************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DecodingTool @0x7f468773ad20 = PrivateToolHandle('Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool') -| | (default: 'Muon::RpcRdoToPrepDataTool/RpcRdoToPrepDataTool') -| |-DetStore @0x7f468703f450 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f468703f3d0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33368 = [] (default: []) -| |-ExtraOutputs @0x7f4686f332d8 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33290 = [] (default: []) -| |-OutputCollection = 'StoreGateSvc+RPC_Measurements' -| |-OutputLevel = 0 -| |-PrintInputRdo = False -| |-PrintPrepData @0x7f468aaa5b20 = False (default: False) -| |-RegionSelectionSvc @0x7f468703f4d0 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Timeline = True -| |=/***** Private AlgTool Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool ****** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-DecodeData = True -| | |-DetStore @0x7f4686fac610 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4686fac690 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f46870177e8 = [] (default: []) -| | |-ExtraOutputs @0x7f46870177a0 = [] (default: []) -| | |-InputCollection = 'StoreGateSvc+RPC_triggerHits' -| | |-MonitorService = 'MonitorSvc' -| | |-OutputCollection = 'StoreGateSvc+RPCPAD' -| | |-OutputLevel = 0 -| | |-RPCInfoFromDb = False -| | |-RdoDecoderTool @0x7f468745b4b0 = PrivateToolHandle('Muon::RpcRDO_Decoder/Muon::RpcRDO_Decoder') -| | | (default: 'Muon::RpcRDO_Decoder') -| | |-TriggerOutputCollection = 'StoreGateSvc+RPC_Measurements' -| | |-etaphi_coincidenceTime = 20.0 -| | |-overlap_timeTolerance = 10.0 -| | |-processingData = False -| | |-produceRpcCoinDatafromTriggerWords = True -| | |-reduceCablingOverlap = True -| | |-solvePhiAmbiguities = True -| | |-timeShift = -12.5 -| | |=/***** Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f4686fac710 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4686fac750 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4687017200 = [] (default: []) -| | | |-ExtraOutputs @0x7f4687017128 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | \----- (End of Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder) ----- -| | \----- (End of Private AlgTool Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool) ----- -| \----- (End of Algorithm RpcRdoToRpcPrepData/RpcRdoToRpcPrepData) ---------------------------------- -|=/***** Algorithm TgcRdoToTgcPrepData/TgcRdoToTgcPrepData ******************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DecodingTool @0x7f4688bf6e90 = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') -| | (default: 'Muon::TgcRdoToPrepDataTool/TgcPrepDataProviderTool') -| |-DetStore @0x7f4686f97350 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4686f972d0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33170 = [] (default: []) -| |-ExtraOutputs @0x7f4686f333b0 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f331b8 = [] (default: []) -| |-OutputCollection = 'StoreGateSvc+TGC_Measurements' -| |-OutputLevel = 0 -| |-PrintInputRdo = False -| |-PrintPrepData @0x7f468aaa5b20 = False (default: False) -| |-RegionSelectorSvc @0x7f4686f973d0 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Setting = 0 -| |-Timeline = True -| |=/***** Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool ****** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-DecodeData = True -| | |-DetStore @0x7f4686fac890 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4686fac950 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4686fb8248 = [] (default: []) -| | |-ExtraOutputs @0x7f4686fb8128 = [] (default: []) -| | |-FillCoinData = True -| | |-MonitorService = 'MonitorSvc' -| | |-OutputCoinCollection = 'TrigT1CoinDataCollection' -| | |-OutputCollection = 'TGC_Measurements' -| | |-OutputLevel = 0 -| | |-RDOContainer = 'StoreGateSvc+TGCRDO' -| | |-TGCHashIdOffset = 26000 -| | |-dropPrdsWithZeroWidth = True -| | |-outputCoinKey @0x7f4686fb8170 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] -| | | (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy']) -| | |-prepDataKeys @0x7f4686fb82d8 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] -| | | (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy']) -| | |-show_warning_level_invalid_A09_SSW6_hit = False -| | \----- (End of Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool) ----- -| \----- (End of Algorithm TgcRdoToTgcPrepData/TgcRdoToTgcPrepData) ---------------------------------- -|=/***** Algorithm MdtRdoToMdtPrepData/MdtRdoToMdtPrepData ******************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DecodingTool @0x7f468ab4b9f0 = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') -| | (default: 'Muon::MdtRdoToPrepDataTool/MdtPrepDataProviderTool') -| |-DetStore @0x7f4687030310 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4687030290 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33518 = [] (default: []) -| |-ExtraOutputs @0x7f4686f33320 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33488 = [] (default: []) -| |-OutputCollection = 'StoreGateSvc+MDT_DriftCircles' -| |-OutputLevel = 0 -| |-PrintInputRdo = False -| |-PrintPrepData @0x7f468aaa5b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4687030390 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Timeline = True -| |=/***** Private AlgTool Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool ****** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-CalibratePrepData = True -| | |-DecodeData = True -| | |-DetStore @0x7f4686fac510 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-DiscardSecondaryHitTwin = False -| | |-DoPropagationCorrection = False -| | |-DoTofCorrection = True -| | |-EvtStore @0x7f4686fac790 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4686fb73b0 = [] (default: []) -| | |-ExtraOutputs @0x7f4686fb7a70 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputCollection = 'StoreGateSvc+MDT_DriftCircles' -| | |-OutputLevel = 0 -| | |-RDOContainer = 'StoreGateSvc+MDTCSM' -| | |-ReadKey = 'ConditionStore+MuonMDT_CablingMap' -| | |-SortPrepData = False -| | |-TimeWindowLowerBound = -1000000.0 -| | |-TimeWindowSetting = 2 -| | |-TimeWindowUpperBound = -1000000.0 -| | |-TwinCorrectSlewing = False -| | |-Use1DPrepDataTwin = False -| | |-UseAllBOLTwin = False -| | |-UseTwin = True -| | \----- (End of Private AlgTool Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool) ----- -| \----- (End of Algorithm MdtRdoToMdtPrepData/MdtRdoToMdtPrepData) ---------------------------------- -|=/***** Algorithm CscRdoToCscPrepData/CscRdoToCscPrepData ******************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-CscRdoToCscPrepDataTool @0x7f46875e3380 = PrivateToolHandle('Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool') -| | (default: 'Muon::CscRdoToCscPrepDataTool/CscRdoToPrepDataTool') -| |-DetStore @0x7f4686fd1710 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4687007f90 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f335f0 = [] (default: []) -| |-ExtraOutputs @0x7f4686f33440 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33560 = [] (default: []) -| |-OutputCollection = 'StoreGateSvc+CSC_Measurements' -| |-OutputLevel = 0 -| |-PrintInputRdo = False -| |-PrintPrepData @0x7f468aaa5b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4686fd17d0 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Timeline = True -| |=/***** Private AlgTool Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-CSCHashIdOffset = 22000 -| | |-CscCalibTool @0x7f468ab4f860 = PrivateToolHandle('CscCalibTool/CscCalibTool') -| | |-CscRdoDecoderTool @0x7f4686fb2d00 = PrivateToolHandle('Muon::CscRDO_Decoder/CscRDO_Decoder') -| | |-DecodeData = True -| | |-DetStore @0x7f4686fac650 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4686faca50 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4686fc8fc8 = [] (default: []) -| | |-ExtraOutputs @0x7f4686fc8d40 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputCollection = 'StoreGateSvc+CSC_Measurements' -| | |-OutputLevel = 0 -| | |-RDOContainer = 'StoreGateSvc+CSCRDO' -| | |=/***** Private AlgTool CscCalibTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscCalibTool ******* -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f4686fac8d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4686faca10 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4686fc85a8 = [] (default: []) -| | | |-ExtraOutputs @0x7f4686fc8cb0 = [] (default: []) -| | | |-IsOnline = True -| | | |-Latency = 100.0 -| | | |-MonitorService = 'MonitorSvc' -| | | |-NSamples = 4 -| | | |-Noise = 3.5 -| | | |-OutputLevel = 0 -| | | |-Pedestal = 2048.0 -| | | |-ReadFromDatabase = True -| | | |-Slope = 0.19 -| | | |-SlopeFromDatabase = False -| | | |-TimeOffsetRange = 1.0 -| | | |-Use2Samples = False -| | | |-integrationNumber = 12.0 -| | | |-integrationNumber2 = 11.66 -| | | |-samplingTime = 50.0 -| | | |-signalWidth = 14.4092 -| | | |-timeOffset = 46.825 -| | | \----- (End of Private AlgTool CscCalibTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscCalibTool) ----- -| | |=/***** Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-CscCalibTool @0x7f4686fac7d0 = PublicToolHandle('CscCalibTool') -| | | |-DetStore @0x7f4686fac550 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4686facb10 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4686fc8ab8 = [] (default: []) -| | | |-ExtraOutputs @0x7f4686fc8a28 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | \----- (End of Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder) ----- -| | \----- (End of Private AlgTool Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool) ----- -| \----- (End of Algorithm CscRdoToCscPrepData/CscRdoToCscPrepData) ---------------------------------- -|=/***** Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder ****************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f4686fed1d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4686fed150 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f335a8 = [] (default: []) -| |-ExtraOutputs @0x7f4686f333f8 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33638 = [] (default: []) -| |-OutputLevel = 0 -| |-RegisterForContextService = False -| |-Timeline = True -| |-cluster_builder @0x7f4686f22b10 = PublicToolHandle('CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool') -| | (default: 'CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool') -| \----- (End of Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder) --------------------- -\----- (End of Algorithm AthSequencer/AthAlgSeq) --------------------------------------------------- -Py:ComponentAccumulator INFO Condition Algorithms -Py:ComponentAccumulator INFO ['CondInputLoader', 'MuonMDT_CablingAlg'] -Py:ComponentAccumulator INFO Services -Py:ComponentAccumulator INFO ['EventSelector', 'ByteStreamInputSvc', 'EventPersistencySvc', 'ByteStreamCnvSvc', 'ROBDataProviderSvc', 'ByteStreamAddressProviderSvc', 'MetaDataStore', 'InputMetaDataStore', 'MetaDataSvc', 'ProxyProviderSvc', 'ByteStreamAttListMetadataSvc', 'GeoModelSvc', 'DetDescrCnvSvc', 'TagInfoMgr', 'RPCcablingServerSvc', 'IOVDbSvc', 'PoolSvc', 'CondSvc', 'DBReplicaSvc', 'MuonRPC_CablingSvc', 'LVL1TGC::TGCRecRoiSvc', 'TGCcablingServerSvc', 'AthenaPoolCnvSvc', 'MuonMDT_CablingSvc', 'AtlasFieldSvc', 'MdtCalibrationDbSvc', 'MdtCalibrationSvc', 'CSCcablingSvc', 'MuonCalib::CscCoolStrSvc'] -Py:ComponentAccumulator INFO Outputs -Py:ComponentAccumulator INFO {} -Py:ComponentAccumulator INFO Public Tools -Py:ComponentAccumulator INFO [ -Py:ComponentAccumulator INFO IOVDbMetaDataTool/IOVDbMetaDataTool, -Py:ComponentAccumulator INFO ByteStreamMetadataTool/ByteStreamMetadataTool, -Py:ComponentAccumulator INFO Muon::MuonIdHelperTool/Muon::MuonIdHelperTool, -Py:ComponentAccumulator INFO RPCCablingDbTool/RPCCablingDbTool, -Py:ComponentAccumulator INFO Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool, -Py:ComponentAccumulator INFO Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool, -Py:ComponentAccumulator INFO MDTCablingDbTool/MDTCablingDbTool, -Py:ComponentAccumulator INFO MuonCalib::MdtCalibDbCoolStrTool/MdtCalibDbTool, -Py:ComponentAccumulator INFO Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool, -Py:ComponentAccumulator INFO Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool, -Py:ComponentAccumulator INFO Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool, -Py:ComponentAccumulator INFO Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool, -Py:ComponentAccumulator INFO Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool, -Py:ComponentAccumulator INFO Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool, -Py:ComponentAccumulator INFO CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool, -Py:ComponentAccumulator INFO ] -Py:Athena INFO Save Config -/***** Algorithm AthSequencer/AthAlgSeq ************************************************************ -|-Atomic = False -|-AuditAlgorithms = False -|-AuditBeginRun = False -|-AuditEndRun = False -|-AuditExecute = False -|-AuditFinalize = False -|-AuditInitialize = False -|-AuditReinitialize = False -|-AuditRestart = False -|-AuditStart = False -|-AuditStop = False -|-Cardinality = 0 -|-ContinueEventloopOnFPE = False -|-DetStore @0x7f4688998ed0 = ServiceHandle('StoreGateSvc/DetectorStore') -|-Enable = True -|-ErrorCounter = 0 -|-ErrorMax = 1 -|-EvtStore @0x7f4688998e50 = ServiceHandle('StoreGateSvc') -|-ExtraInputs @0x7f4686f2fa70 = [] (default: []) -|-ExtraOutputs @0x7f4686f2fb00 = [] (default: []) -|-FilterCircularDependencies = True -|-IgnoreFilterPassed = False -|-IsIOBound = False -|-Members @0x7f4686f2f680 = ['MuonCacheCreator/MuonCacheCreator', 'Muon::RpcRawDataProvider/RpcRawDataProvider', 'Muon::TgcRawDataProvider/TgcRawDataProvider', 'Muon::MdtRawDataProvider/MdtRawDataProvider', 'Muon::CscRawDataProvider/CscRawDataProvider', 'RpcRdoToRpcPrepData/RpcRdoToRpcPrepData', 'TgcRdoToTgcPrepData/TgcRdoToTgcPrepData', 'MdtRdoToMdtPrepData/MdtRdoToMdtPrepData', 'CscRdoToCscPrepData/CscRdoToCscPrepData', 'CscThresholdClusterBuilder/CscThesholdClusterBuilder'] -| (default: []) -|-ModeOR = False -|-MonitorService = 'MonitorSvc' -|-NeededResources @0x7f4686f2f950 = [] (default: []) -|-OutputLevel = 0 -|-RegisterForContextService = False -|-Sequential @0x7f468aaa5b00 = True (default: False) -|-StopOverride = False -|-TimeOut = 0.0 -|-Timeline = True -|=/***** Algorithm MuonCacheCreator/MuonCacheCreator ************************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 0 -| |-CscCacheKey @0x7f46878c1840 = 'CscCache' (default: 'StoreGateSvc+') -| |-DetStore @0x7f46877860d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DisableViewWarning = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4687786050 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f2fb48 = [] (default: []) -| |-ExtraOutputs @0x7f4686f2f998 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MdtCsmCacheKey @0x7f46878c13f0 = 'MdtCsmCache' (default: 'StoreGateSvc+') -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f2fb90 = [] (default: []) -| |-OutputLevel = 0 -| |-RegisterForContextService = False -| |-RpcCacheKey @0x7f46878c1450 = 'RpcCache' (default: 'StoreGateSvc+') -| |-TgcCacheKey @0x7f46878c1480 = 'TgcCache' (default: 'StoreGateSvc+') -| |-Timeline = True -| \----- (End of Algorithm MuonCacheCreator/MuonCacheCreator) ---------------------------------------- -|=/***** Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider *************************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f46877ec310 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f46877ec290 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f2f830 = [] (default: []) -| |-ExtraOutputs @0x7f4686f2fcb0 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f2fcf8 = [] (default: []) -| |-OutputLevel = 0 -| |-ProviderTool @0x7f468789f718 = PrivateToolHandle('Muon::RPC_RawDataProviderTool/RPC_RawDataProviderTool') -| | (default: 'Muon::RPC_RawDataProviderTool/RpcRawDataProviderTool') -| |-RegionSelectionSvc @0x7f46877ec390 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Timeline = True -| |=/***** Private AlgTool Muon::RPC_RawDataProviderTool/RpcRawDataProvider.RPC_RawDataProviderTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-Decoder @0x7f468789f810 = PrivateToolHandle('Muon::RpcROD_Decoder/RpcROD_Decoder') -| | |-DetStore @0x7f4687528a50 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4687528a90 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4687524d88 = [] (default: []) -| | |-ExtraOutputs @0x7f468750d050 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputLevel = 0 -| | |-RPCSec = 'StoreGateSvc+RPC_SECTORLOGIC' -| | |-RdoLocation = 'StoreGateSvc+RPCPAD' -| | |=/***** Private AlgTool Muon::RpcROD_Decoder/RpcRawDataProvider.RPC_RawDataProviderTool.RpcROD_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DataErrorPrintLimit = 1000 -| | | |-DetStore @0x7f4687528b50 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4687528b90 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4687524f38 = [] (default: []) -| | | |-ExtraOutputs @0x7f4687524ef0 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | |-Sector13Data = False -| | | |-SpecialROBNumber = -1 -| | | \----- (End of Private AlgTool Muon::RpcROD_Decoder/RpcRawDataProvider.RPC_RawDataProviderTool.RpcROD_Decoder) ----- -| | \----- (End of Private AlgTool Muon::RPC_RawDataProviderTool/RpcRawDataProvider.RPC_RawDataProviderTool) ----- -| \----- (End of Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider) ------------------------------ -|=/***** Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider *************************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f46877fb2d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f46877fb250 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33050 = [] (default: []) -| |-ExtraOutputs @0x7f4686f2fc20 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f2ff38 = [] (default: []) -| |-OutputLevel = 0 -| |-ProviderTool @0x7f46887508c0 = PrivateToolHandle('Muon::TGC_RawDataProviderTool/TGC_RawDataProviderTool') -| | (default: 'Muon::TGC_RawDataProviderTool/TgcRawDataProviderTool') -| |-RegisterForContextService = False -| |-Timeline = True -| |=/***** Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-Decoder @0x7f46887509b0 = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') -| | | (default: 'Muon::TGC_RodDecoderReadout/TGC_RodDecoderReadout') -| | |-DetStore @0x7f46874920d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4687492110 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4687550a70 = [] (default: []) -| | |-ExtraOutputs @0x7f46875508c0 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputLevel = 0 -| | |-RdoLocation = 'StoreGateSvc+TGCRDO' -| | |=/***** Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f46874921d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4687492210 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4687550710 = [] (default: []) -| | | |-ExtraOutputs @0x7f4687550878 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | |-ShowStatusWords = False -| | | |-SkipCoincidence = False -| | | \----- (End of Private AlgTool Muon::TGC_RodDecoderReadout/TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder) ----- -| | \----- (End of Private AlgTool Muon::TGC_RawDataProviderTool/TgcRawDataProvider.TGC_RawDataProviderTool) ----- -| \----- (End of Algorithm Muon::TgcRawDataProvider/TgcRawDataProvider) ------------------------------ -|=/***** Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider *************************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f46877df510 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f46877df490 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33098 = [] (default: []) -| |-ExtraOutputs @0x7f4686f2fd40 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33128 = [] (default: []) -| |-OutputLevel = 0 -| |-ProviderTool @0x7f4687651d50 = PrivateToolHandle('Muon::MDT_RawDataProviderTool/MDT_RawDataProviderTool') -| | (default: 'Muon::MDT_RawDataProviderTool/MdtRawDataProviderTool') -| |-RegisterForContextService = False -| |-Timeline = True -| |=/***** Private AlgTool Muon::MDT_RawDataProviderTool/MdtRawDataProvider.MDT_RawDataProviderTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-CsmContainerCacheKey @0x7f46878c13f0 = 'MdtCsmCache' (default: 'StoreGateSvc+') -| | |-Decoder @0x7f4688750c80 = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') -| | |-DetStore @0x7f4687046ad0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4687046b10 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f46870b4d40 = [] (default: []) -| | |-ExtraOutputs @0x7f46870b4bd8 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputLevel @ 0x247a1d8 = 1 (default: 0) -| | |-RdoLocation = 'StoreGateSvc+MDTCSM' -| | |-ReadKey = 'ConditionStore+MuonMDT_CablingMap' -| | |=/***** Private AlgTool MdtROD_Decoder/MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f4687046bd0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4687046c10 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f46870b4c68 = [] (default: []) -| | | |-ExtraOutputs @0x7f46870b4c20 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | |-ReadKey = 'ConditionStore+MuonMDT_CablingMap' -| | | |-SpecialROBNumber = -1 -| | | \----- (End of Private AlgTool MdtROD_Decoder/MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder) ----- -| | \----- (End of Private AlgTool Muon::MDT_RawDataProviderTool/MdtRawDataProvider.MDT_RawDataProviderTool) ----- -| \----- (End of Algorithm Muon::MdtRawDataProvider/MdtRawDataProvider) ------------------------------ -|=/***** Algorithm Muon::CscRawDataProvider/CscRawDataProvider *************************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f46877dea10 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f46877de950 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f330e0 = [] (default: []) -| |-ExtraOutputs @0x7f4686f33248 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33200 = [] (default: []) -| |-OutputLevel = 0 -| |-ProviderTool @0x7f4687061050 = PrivateToolHandle('Muon::CSC_RawDataProviderTool/CSC_RawDataProviderTool') -| | (default: 'Muon::CSC_RawDataProviderTool/CscRawDataProviderTool') -| |-RegisterForContextService = False -| |-Timeline = True -| |=/***** Private AlgTool Muon::CSC_RawDataProviderTool/CscRawDataProvider.CSC_RawDataProviderTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-CscContainerCacheKey @0x7f46878c1840 = 'CscCache' (default: 'StoreGateSvc+') -| | |-Decoder @0x7f4688750e60 = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') -| | |-DetStore @0x7f4687007990 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EventInfoKey = 'StoreGateSvc+EventInfo' -| | |-EvtStore @0x7f46870079d0 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4687062050 = [] (default: []) -| | |-ExtraOutputs @0x7f4687062128 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputLevel @ 0x247a1d8 = 1 (default: 0) -| | |-RdoLocation = 'StoreGateSvc+CSCRDO' -| | |=/***** Private AlgTool Muon::CscROD_Decoder/CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f4687007a90 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4687007ad0 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4687004ef0 = [] (default: []) -| | | |-ExtraOutputs @0x7f4687004ea8 = [] (default: []) -| | | |-IsCosmics = False -| | | |-IsOldCosmics = False -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | \----- (End of Private AlgTool Muon::CscROD_Decoder/CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder) ----- -| | \----- (End of Private AlgTool Muon::CSC_RawDataProviderTool/CscRawDataProvider.CSC_RawDataProviderTool) ----- -| \----- (End of Algorithm Muon::CscRawDataProvider/CscRawDataProvider) ------------------------------ -|=/***** Algorithm RpcRdoToRpcPrepData/RpcRdoToRpcPrepData ******************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DecodingTool @0x7f468773ad20 = PrivateToolHandle('Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool') -| | (default: 'Muon::RpcRdoToPrepDataTool/RpcRdoToPrepDataTool') -| |-DetStore @0x7f468703f450 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f468703f3d0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33368 = [] (default: []) -| |-ExtraOutputs @0x7f4686f332d8 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33290 = [] (default: []) -| |-OutputCollection = 'StoreGateSvc+RPC_Measurements' -| |-OutputLevel = 0 -| |-PrintInputRdo = False -| |-PrintPrepData @0x7f468aaa5b20 = False (default: False) -| |-RegionSelectionSvc @0x7f468703f4d0 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Timeline = True -| |=/***** Private AlgTool Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool ****** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-DecodeData = True -| | |-DetStore @0x7f4686fac610 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4686fac690 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f46870177e8 = [] (default: []) -| | |-ExtraOutputs @0x7f46870177a0 = [] (default: []) -| | |-InputCollection = 'StoreGateSvc+RPC_triggerHits' -| | |-MonitorService = 'MonitorSvc' -| | |-OutputCollection = 'StoreGateSvc+RPCPAD' -| | |-OutputLevel = 0 -| | |-RPCInfoFromDb = False -| | |-RdoDecoderTool @0x7f468745b4b0 = PrivateToolHandle('Muon::RpcRDO_Decoder/Muon::RpcRDO_Decoder') -| | | (default: 'Muon::RpcRDO_Decoder') -| | |-TriggerOutputCollection = 'StoreGateSvc+RPC_Measurements' -| | |-etaphi_coincidenceTime = 20.0 -| | |-overlap_timeTolerance = 10.0 -| | |-processingData = False -| | |-produceRpcCoinDatafromTriggerWords = True -| | |-reduceCablingOverlap = True -| | |-solvePhiAmbiguities = True -| | |-timeShift = -12.5 -| | |=/***** Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f4686fac710 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4686fac750 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4687017200 = [] (default: []) -| | | |-ExtraOutputs @0x7f4687017128 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | \----- (End of Private AlgTool Muon::RpcRDO_Decoder/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool.Muon::RpcRDO_Decoder) ----- -| | \----- (End of Private AlgTool Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepData.RpcRdoToRpcPrepDataTool) ----- -| \----- (End of Algorithm RpcRdoToRpcPrepData/RpcRdoToRpcPrepData) ---------------------------------- -|=/***** Algorithm TgcRdoToTgcPrepData/TgcRdoToTgcPrepData ******************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DecodingTool @0x7f4688bf6e90 = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') -| | (default: 'Muon::TgcRdoToPrepDataTool/TgcPrepDataProviderTool') -| |-DetStore @0x7f4686f97350 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4686f972d0 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33170 = [] (default: []) -| |-ExtraOutputs @0x7f4686f333b0 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f331b8 = [] (default: []) -| |-OutputCollection = 'StoreGateSvc+TGC_Measurements' -| |-OutputLevel = 0 -| |-PrintInputRdo = False -| |-PrintPrepData @0x7f468aaa5b20 = False (default: False) -| |-RegionSelectorSvc @0x7f4686f973d0 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Setting = 0 -| |-Timeline = True -| |=/***** Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool ****** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-DecodeData = True -| | |-DetStore @0x7f4686fac890 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4686fac950 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4686fb8248 = [] (default: []) -| | |-ExtraOutputs @0x7f4686fb8128 = [] (default: []) -| | |-FillCoinData = True -| | |-MonitorService = 'MonitorSvc' -| | |-OutputCoinCollection = 'TrigT1CoinDataCollection' -| | |-OutputCollection = 'TGC_Measurements' -| | |-OutputLevel = 0 -| | |-RDOContainer = 'StoreGateSvc+TGCRDO' -| | |-TGCHashIdOffset = 26000 -| | |-dropPrdsWithZeroWidth = True -| | |-outputCoinKey @0x7f4686fb8170 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] -| | | (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy']) -| | |-prepDataKeys @0x7f4686fb82d8 = ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy'] -| | | (default: ['StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy', 'StoreGateSvc+dummy']) -| | |-show_warning_level_invalid_A09_SSW6_hit = False -| | \----- (End of Private AlgTool Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool) ----- -| \----- (End of Algorithm TgcRdoToTgcPrepData/TgcRdoToTgcPrepData) ---------------------------------- -|=/***** Algorithm MdtRdoToMdtPrepData/MdtRdoToMdtPrepData ******************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DecodingTool @0x7f468ab4b9f0 = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') -| | (default: 'Muon::MdtRdoToPrepDataTool/MdtPrepDataProviderTool') -| |-DetStore @0x7f4687030310 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4687030290 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f33518 = [] (default: []) -| |-ExtraOutputs @0x7f4686f33320 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33488 = [] (default: []) -| |-OutputCollection = 'StoreGateSvc+MDT_DriftCircles' -| |-OutputLevel = 0 -| |-PrintInputRdo = False -| |-PrintPrepData @0x7f468aaa5b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4687030390 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Timeline = True -| |=/***** Private AlgTool Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool ****** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-CalibratePrepData = True -| | |-DecodeData = True -| | |-DetStore @0x7f4686fac510 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-DiscardSecondaryHitTwin = False -| | |-DoPropagationCorrection = False -| | |-DoTofCorrection = True -| | |-EvtStore @0x7f4686fac790 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4686fb73b0 = [] (default: []) -| | |-ExtraOutputs @0x7f4686fb7a70 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputCollection = 'StoreGateSvc+MDT_DriftCircles' -| | |-OutputLevel = 0 -| | |-RDOContainer = 'StoreGateSvc+MDTCSM' -| | |-ReadKey = 'ConditionStore+MuonMDT_CablingMap' -| | |-SortPrepData = False -| | |-TimeWindowLowerBound = -1000000.0 -| | |-TimeWindowSetting = 2 -| | |-TimeWindowUpperBound = -1000000.0 -| | |-TwinCorrectSlewing = False -| | |-Use1DPrepDataTwin = False -| | |-UseAllBOLTwin = False -| | |-UseTwin = True -| | \----- (End of Private AlgTool Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool) ----- -| \----- (End of Algorithm MdtRdoToMdtPrepData/MdtRdoToMdtPrepData) ---------------------------------- -|=/***** Algorithm CscRdoToCscPrepData/CscRdoToCscPrepData ******************************************* -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-CscRdoToCscPrepDataTool @0x7f46875e3380 = PrivateToolHandle('Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool') -| | (default: 'Muon::CscRdoToCscPrepDataTool/CscRdoToPrepDataTool') -| |-DetStore @0x7f4686fd1710 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-DoSeededDecoding = False -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4687007f90 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f335f0 = [] (default: []) -| |-ExtraOutputs @0x7f4686f33440 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33560 = [] (default: []) -| |-OutputCollection = 'StoreGateSvc+CSC_Measurements' -| |-OutputLevel = 0 -| |-PrintInputRdo = False -| |-PrintPrepData @0x7f468aaa5b20 = False (default: False) -| |-RegionSelectionSvc @0x7f4686fd17d0 = ServiceHandle('RegSelSvc') -| |-RegisterForContextService = False -| |-RoIs = 'StoreGateSvc+OutputRoIs' -| |-Timeline = True -| |=/***** Private AlgTool Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool ***** -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-AuditTools = False -| | |-CSCHashIdOffset = 22000 -| | |-CscCalibTool @0x7f468ab4f860 = PrivateToolHandle('CscCalibTool/CscCalibTool') -| | |-CscRdoDecoderTool @0x7f4686fb2d00 = PrivateToolHandle('Muon::CscRDO_Decoder/CscRDO_Decoder') -| | |-DecodeData = True -| | |-DetStore @0x7f4686fac650 = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-EvtStore @0x7f4686faca50 = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs @0x7f4686fc8fc8 = [] (default: []) -| | |-ExtraOutputs @0x7f4686fc8d40 = [] (default: []) -| | |-MonitorService = 'MonitorSvc' -| | |-OutputCollection = 'StoreGateSvc+CSC_Measurements' -| | |-OutputLevel = 0 -| | |-RDOContainer = 'StoreGateSvc+CSCRDO' -| | |=/***** Private AlgTool CscCalibTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscCalibTool ******* -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-DetStore @0x7f4686fac8d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4686faca10 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4686fc85a8 = [] (default: []) -| | | |-ExtraOutputs @0x7f4686fc8cb0 = [] (default: []) -| | | |-IsOnline = True -| | | |-Latency = 100.0 -| | | |-MonitorService = 'MonitorSvc' -| | | |-NSamples = 4 -| | | |-Noise = 3.5 -| | | |-OutputLevel = 0 -| | | |-Pedestal = 2048.0 -| | | |-ReadFromDatabase = True -| | | |-Slope = 0.19 -| | | |-SlopeFromDatabase = False -| | | |-TimeOffsetRange = 1.0 -| | | |-Use2Samples = False -| | | |-integrationNumber = 12.0 -| | | |-integrationNumber2 = 11.66 -| | | |-samplingTime = 50.0 -| | | |-signalWidth = 14.4092 -| | | |-timeOffset = 46.825 -| | | \----- (End of Private AlgTool CscCalibTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscCalibTool) ----- -| | |=/***** Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder ***** -| | | |-AuditFinalize = False -| | | |-AuditInitialize = False -| | | |-AuditReinitialize = False -| | | |-AuditRestart = False -| | | |-AuditStart = False -| | | |-AuditStop = False -| | | |-AuditTools = False -| | | |-CscCalibTool @0x7f4686fac7d0 = PublicToolHandle('CscCalibTool') -| | | |-DetStore @0x7f4686fac550 = ServiceHandle('StoreGateSvc/DetectorStore') -| | | |-EvtStore @0x7f4686facb10 = ServiceHandle('StoreGateSvc') -| | | |-ExtraInputs @0x7f4686fc8ab8 = [] (default: []) -| | | |-ExtraOutputs @0x7f4686fc8a28 = [] (default: []) -| | | |-MonitorService = 'MonitorSvc' -| | | |-OutputLevel = 0 -| | | \----- (End of Private AlgTool Muon::CscRDO_Decoder/CscRdoToCscPrepData.CscRdoToCscPrepDataTool.CscRDO_Decoder) ----- -| | \----- (End of Private AlgTool Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepData.CscRdoToCscPrepDataTool) ----- -| \----- (End of Algorithm CscRdoToCscPrepData/CscRdoToCscPrepData) ---------------------------------- -|=/***** Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder ****************************** -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-DetStore @0x7f4686fed1d0 = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore @0x7f4686fed150 = ServiceHandle('StoreGateSvc') -| |-ExtraInputs @0x7f4686f335a8 = [] (default: []) -| |-ExtraOutputs @0x7f4686f333f8 = [] (default: []) -| |-FilterCircularDependencies = True -| |-IsIOBound = False -| |-MonitorService = 'MonitorSvc' -| |-NeededResources @0x7f4686f33638 = [] (default: []) -| |-OutputLevel = 0 -| |-RegisterForContextService = False -| |-Timeline = True -| |-cluster_builder @0x7f4686f22b10 = PublicToolHandle('CscThresholdClusterBuilderTool/CscThesholdClusterBuilderTool') -| | (default: 'CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool') -| \----- (End of Algorithm CscThresholdClusterBuilder/CscThesholdClusterBuilder) --------------------- -\----- (End of Algorithm AthSequencer/AthAlgSeq) --------------------------------------------------- - -JOs reading stage finished, launching Athena from pickle file - -Thu Mar 21 07:09:56 CET 2019 -Preloading tcmalloc_minimal.so -Py:Athena INFO using release [AthenaExternals-22.0.1] [x86_64-slc6-gcc8-opt] [2.0.26/d4d5e51] -- built on [2019-03-18T2110] -Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" -Py:Athena INFO executing ROOT6Setup -Py:Athena INFO configuring AthenaHive with [1] concurrent threads and [1] concurrent events -Py:AlgScheduler INFO setting up AvalancheSchedulerSvc/AvalancheSchedulerSvc with 1 threads -Py:Athena INFO including file "AthenaCommon/Execution.py" -Py:Athena INFO now loading MuonRdoDecode_Cache.pkl ... -Py:ConfigurableDb INFO Read module info for 5447 configurables from 5 genConfDb files -Py:ConfigurableDb INFO No duplicates have been found: that's good ! -[?1034hApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr SUCCESS -==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v31r0) - running on lxplus047.cern.ch on Thu Mar 21 07:10:12 2019 -==================================================================================================================================== -ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -Py:Athena INFO including file "AthenaCommon/runbatch.py" -StatusCodeSvc INFO initialize -AthDictLoaderSvc INFO in initialize... -AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3440 CLIDRegistry entries for module ALL -CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) -CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) -ByteStreamAddre... INFO Initializing ByteStreamAddressProviderSvc - package version ByteStreamCnvSvcBase-00-00-00 -ROBDataProviderSvc INFO Initializing ROBDataProviderSvc - package version ByteStreamCnvSvcBase-00-00-00 -ROBDataProviderSvc INFO ---> Filter out empty ROB fragments = 'filterEmptyROB':False -ROBDataProviderSvc INFO ---> Filter out specific ROBs by Status Code: # ROBs = 0 -ROBDataProviderSvc INFO ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0 -ByteStreamAddre... INFO initialized -ByteStreamAddre... INFO -- Module IDs for: -ByteStreamAddre... INFO CTP = 0x1 -ByteStreamAddre... INFO muCTPi = 0x1 -ByteStreamAddre... INFO Calorimeter Cluster Processor RoI = 0xa8, 0xa9, 0xaa, 0xab -ByteStreamAddre... INFO Calorimeter Jet/Energy Processor RoI = 0xac, 0xad -ByteStreamAddre... INFO Topo Processor RoI = 0x81, 0x91 -ByteStreamAddre... INFO -- Will fill Store with id = 0 -PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] -PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled -PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-18T2151/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus047.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] -DBReplicaSvc INFO COOL SQLite replicas will be excluded if matching pattern /DBRelease/ -PoolSvc INFO Successfully setup replica sorting algorithm -PoolSvc INFO Setting up APR FileCatalog and Streams -PoolSvc INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml -PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml -DbSession INFO Open DbSession -Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] -IOVDbSvc INFO Opened read transaction for POOL PersistencySvc -IOVDbSvc INFO Only 5 POOL conditions files will be open at once -IOVDbSvc INFO Cache alignment will be done in 3 slices -IOVDbSvc INFO Global tag: CONDBR2-BLKPA-2018-13 set from joboptions -IOVDbFolder INFO Inputfile tag override disabled for /GLOBAL/BField/Maps -IOVDbSvc INFO Folder /GLOBAL/BField/Maps will be written to file metadata -IOVDbSvc INFO Initialised with 8 connections and 19 folders -IOVDbSvc INFO Service IOVDbSvc initialised successfully -MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 -AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 -ToolSvc.ByteStr... INFO Initializing ToolSvc.ByteStreamMetadataTool - package version ByteStreamCnvSvc-00-00-00 -MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool/IOVDbMetaDataTool','ByteStreamMetadataTool/ByteStreamMetadataTool']) -IOVDbSvc INFO Opening COOL connection for COOLONL_MDT/CONDBR2 -ClassIDSvc INFO getRegistryEntries: read 3314 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 163 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 4046 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 129 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 3110 CLIDRegistry entries for module ALL -IOVSvc INFO No IOVSvcTool associated with store "StoreGateSvc" -IOVSvcTool INFO IOVRanges will be checked at every Event -IOVDbSvc INFO Opening COOL connection for COOLONL_RPC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_RPC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_CSC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_CSC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_TGC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_TGC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA -IOVDbSvc INFO Added taginfo remove for /GLOBAL/BField/Maps -IOVDbSvc INFO Added taginfo remove for /MDT/CABLING/MAP_SCHEMA -IOVDbSvc INFO Added taginfo remove for /MDT/CABLING/MEZZANINE_SCHEMA -IOVDbSvc INFO Added taginfo remove for /MDT/RTBLOB -IOVDbSvc INFO Added taginfo remove for /MDT/T0BLOB -IOVDbSvc INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA -IOVDbSvc INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA_CORR -IOVDbSvc INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_ETA -IOVDbSvc INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_PHI -IOVDbSvc INFO Added taginfo remove for /TGC/CABLING/MAP_SCHEMA -IOVDbSvc INFO Added taginfo remove for /CSC/FTHOLD -IOVDbSvc INFO Added taginfo remove for /CSC/NOISE -IOVDbSvc INFO Added taginfo remove for /CSC/PED -IOVDbSvc INFO Added taginfo remove for /CSC/PSLOPE -IOVDbSvc INFO Added taginfo remove for /CSC/RMS -IOVDbSvc INFO Added taginfo remove for /CSC/STAT -IOVDbSvc INFO Added taginfo remove for /CSC/T0BASE -IOVDbSvc INFO Added taginfo remove for /CSC/T0PHASE -DetDescrCnvSvc INFO initializing -DetDescrCnvSvc INFO Found DetectorStore service -DetDescrCnvSvc INFO filling proxies for detector managers -DetDescrCnvSvc INFO filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for IdDict with CLID 2411 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for AtlasID with CLID 164875623 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for PixelID with CLID 2516 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for SCT_ID with CLID 2517 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TRT_ID with CLID 2518 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for SiliconID with CLID 129452393 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileID with CLID 2901 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileHWID with CLID 2902 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileTBID with CLID 2903 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for STGCIDHELPER with CLID 4174 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for MMIDHELPER with CLID 4175 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for ZdcID with CLID 190591643 and storage type 68 to detector store -GeoModelSvc.Muo... INFO Initializing ... -GeoModelSvc::RD...WARNING Getting PixTBMatComponents with default tag -GeoModelSvc::RD...WARNING Getting PixTBMaterials with default tag -GeoModelSvc::RD...WARNING Getting InDetMatComponents with default tag -GeoModelSvc::RD...WARNING Getting InDetMaterials with default tag -GeoModelSvc.Muo... INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00 -GeoModelSvc.Muo... INFO (from GeoModelSvc) AtlasVersion = <ATLAS-R2-2016-01-00-01> MuonVersion = <> -GeoModelSvc.Muo... INFO Keys for Muon Switches are (key) ATLAS-R2-2016-01-00-01 (node) ATLAS -GeoModelSvc.Muo... INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01> default MuonVersion is <MuonSpectrometer-R.08.01> -GeoModelSvc.Muo... INFO Properties have been set as follows: -GeoModelSvc.Muo... INFO LayoutName R -GeoModelSvc.Muo... INFO IncludeCutouts 0 -GeoModelSvc.Muo... INFO IncludeCutoutsBog 0 -GeoModelSvc.Muo... INFO IncludeCtbBis 0 -GeoModelSvc.Muo... INFO ControlAlines 111111 -GeoModelSvc.Muo... INFO MinimalGeoFlag 0 -GeoModelSvc.Muo... INFO EnableCscIntAlignment 0 -GeoModelSvc.Muo... INFO EnableCscIntAlignmentFromGM 1 -GeoModelSvc.Muo... INFO ControlCscIntAlines reset to 0 -GeoModelSvc.Muo... INFO EnableMdtDeformations 0 -GeoModelSvc.Muo... INFO EnableMdtAsBuiltParameters 0 -MuonGeoModel INFO MuonDetectorFactory - constructor MuonSystem OuterRadius 13000 Length 22030 -MuGM:MuonFactory INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures -MuGM:MuonFactory INFO BOG cutouts are activated 1 , all other cutouts are disabled 1 -MuGM:MuonFactory INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuonGeoModel_MYSQL INFO GeometryVersion set to <R.08.01> -MuGM:MuonFactory INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -EventPersistenc... INFO Added successfully Conversion service:ByteStreamCnvSvc -EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc -EventPersistenc... INFO Added successfully Conversion service:DetDescrCnvSvc -MDT_IDDetDescrCnv INFO in createObj: creating a MdtIdHelper object in the detector store -IdDictDetDescrCnv INFO in initialize -IdDictDetDescrCnv INFO in createObj: creating a IdDictManager object in the detector store -IdDictDetDescrCnv INFO IdDictName: IdDictParser/ATLAS_IDS.xml -IdDictDetDescrCnv INFO Reading InnerDetector IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml -IdDictDetDescrCnv INFO Reading LArCalorimeter IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml -IdDictDetDescrCnv INFO Reading TileCalorimeter IdDict file IdDictParser/IdDictTileCalorimeter.xml -IdDictDetDescrCnv INFO Reading Calorimeter IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml -IdDictDetDescrCnv INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml -IdDictDetDescrCnv INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml -IdDictDetDescrCnv INFO Found id dicts: -IdDictDetDescrCnv INFO Using dictionary tag: null -IdDictDetDescrCnv INFO Dictionary ATLAS version default DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary Calorimeter version default DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml -IdDictDetDescrCnv INFO Dictionary ForwardDetectors version default DetDescr tag ForDetIdentifier-01 file IdDictParser/IdDictForwardDetectors_2010.xml -IdDictDetDescrCnv INFO Dictionary InnerDetector version IBL-DBM DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml -IdDictDetDescrCnv INFO Dictionary LArCalorimeter version fullAtlas DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml -IdDictDetDescrCnv INFO Dictionary LArElectrode version fullAtlas DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary LArHighVoltage version fullAtlas DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary MuonSpectrometer version R.03 DetDescr tag MuonIdentifier-08 file IdDictParser/IdDictMuonSpectrometer_R.03.xml -IdDictDetDescrCnv INFO Dictionary TileCalorimeter version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00 file IdDictParser/IdDictTileCalorimeter.xml -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -MdtIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -MdtIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 241 -MdtIdHelper INFO MultiRange built successfully to tube: MultiRange size is 241 -MdtIdHelper INFO Initializing MDT hash indices ... -MdtIdHelper INFO The element hash max is 1188 -MdtIdHelper INFO The detector element hash max is 2328 -MdtIdHelper INFO Initializing MDT hash indices for finding neighbors ... -MuGM:MuonFactory INFO MDTIDHELPER retrieved from DetStore -RPC_IDDetDescrCnv INFO in createObj: creating a RpcIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 241 -RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 241 -RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 241 -RpcIdHelper INFO Initializing RPC hash indices ... -RpcIdHelper INFO The element hash max is 600 -RpcIdHelper INFO The detector element hash max is 1122 -RpcIdHelper INFO Initializing RPC hash indices for finding neighbors ... -MuGM:MuonFactory INFO RPCIDHELPER retrieved from DetStore -TGC_IDDetDescrCnv INFO in createObj: creating a TgcIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 210 -TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 241 -TgcIdHelper INFO Initializing TGC hash indices ... -TgcIdHelper INFO The element hash max is 1578 -TgcIdHelper INFO The detector element hash max is 1578 -TgcIdHelper INFO Initializing TGC hash indices for finding neighbors ... -MuGM:MuonFactory INFO TGCIDHELPER retrieved from DetStore -CSC_IDDetDescrCnv INFO in createObj: creating a CcscIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -CscIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -CscIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 237 -CscIdHelper INFO MultiRange built successfully to cscStrip: MultiRange size is 241 -CscIdHelper INFO Initializing CSC hash indices ... -CscIdHelper INFO The element hash max is 32 -CscIdHelper INFO The detector element hash max is 64 -CscIdHelper INFO The channel hash max is 61440 -CscIdHelper INFO Initializing CSC hash indices for finding neighbors ... -MuGM:MuonFactory INFO CSCIDHELPER retrieved from DetStore -sTGC_IDDetDescrCnv INFO in createObj: creating a sTgcIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -MuGM:MuonFactory INFO STGCIDHELPER retrieved from DetStore -MM_IDDetDescrCnv INFO in createObj: creating a MmIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -MuGM:MuonFactory INFO MMIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 ************************ -MuGM:MuonFactory INFO *** Start building the Muon Geometry Tree ********************** -MuGM:RDBReadAtlas INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS> -RDBAccessSvc WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO After getQuery XtomoData -In DblQ00Xtomo(data) -No XtomoData table in the MuonDD Database -MuGM:RDBReadAtlas INFO After new DblQ00Xtomo -MuGM:RDBReadAtlas INFO After m_dhxtomo.data() -MuGM:RDBReadAtlas INFO No Ascii aszt input found: looking for A-lines in ORACLE -MuGM:RDBReadAtlas INFO ASZT table found in Oracle -MuGM:RDBReadAtlas INFO ASZT size is 32 -MuGM:RDBReadAtlas INFO No Ascii iacsc input found: looking for A-lines in ORACLE -RDBAccessSvc WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO No ISZT table in Oracle -MuGM:RDBReadAtlas INFO Access granted for all dbObjects needed by muon detectors -MuonGeoModel_MYSQL INFO LayoutName (from DBAM) set to <R.08> -- relevant for CTB2004 -MuGM:ProcStations INFO Processing Stations and Components -MuGM:ProcStations INFO Processing Stations and Components DONE -MuGM:ProcTechnol.s INFO nMDT 13 nCSC 2 nTGC 22 nRPC 25 -MuGM:ProcTechnol.s INFO nDED 2 nSUP 4 nSPA 2 -MuGM:ProcTechnol.s INFO nCHV 7 nCRO 7 nCMI 6 nLBI 6 -MuGM:ProcPosition INFO *** N. of stations positioned in the setup 234 -MuGM:ProcPosition INFO *** N. of stations described in mysql 234 -MuGM:ProcPosition INFO *** N. of types 32 size of jtypvec 32 -MuGM:ProcPosition INFO *** : 234 kinds of stations (type*sub_type) -MuGM:ProcPosition INFO *** : 1758 physical stations in space - according to the MuonDD DataBase -MuGM:ProcCutouts INFO Processing Cutouts for geometry layout R.08 -MuGM:ProcCutouts INFO Processing Cutouts DONE -MuGM:RDBReadAtlas INFO ProcessTGCreadout - version 7 wirespacing 1.8 -MuGM:RDBReadAtlas INFO Intermediate Objects built from primary numbers -MuGM:MuonFactory INFO theMaterialManager retrieven successfully from the DetStore -MuGM:MuonFactory INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS> -MuGM:MuonFactory INFO TreeTop added to the Manager -MuGM:MuonFactory INFO Muon Layout R.08.01 -MuGM:MuonFactory INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction) -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 **************************** -MuGM:MuonFactory INFO *** The Muon Chamber Geometry Tree is built with -MuGM:MuonFactory INFO *** 1758 child volumes -MuGM:MuonFactory INFO *** 1839 independent elements and -MuGM:MuonFactory INFO *** 11473 elements cloned or shared -MuGM:MuonFactory INFO *** 234 kinds of stations -MuGM:MuonFactory INFO *** 1758 stations with alignable transforms -MuGM:MuonFactory INFO *** 148 stations are described as Assemblies -MuGM:MuonFactory INFO *** 1758 MuonStations -MuGM:MuonFactory INFO *** 2324 MDT Readout Elements 1186 MDT Detector Elements -MuGM:MuonFactory INFO *** 32 CSC Readout Elements 32 CSC Detector Elements -MuGM:MuonFactory INFO *** 1122 RPC Readout Elements 600 RPC Detector Elements -MuGM:MuonFactory INFO *** 1578 TGC Readout Elements 1578 TGC Detector Elements -MuGM:MuonFactory INFO ******************************************************************** -MuGM:MuonFactory INFO *** Inert Material built according to DB switches and config. ****** -MuGM:MuonFactory INFO *** The Muon Geometry Tree has 1758 child vol.s in total ******** -MuGM:MuonFactory INFO ******************************************************************** - -MGM::MuonDetect... INFO Init A/B Line Containers - done - size is respectively 1758/0 -MGM::MuonDetect... INFO No Aline for CSC wire layers loaded -GeoModelSvc INFO GeoModelSvc.MuonDetectorTool SZ= 42840Kb Time = 0.8S -GeoModelSvc.Muo... INFO CondAttrListCollection not found in the DetectorStore -GeoModelSvc.Muo... INFO Unable to register callback on CondAttrListCollection for any folder in the list -GeoModelSvc.Muo... INFO This is OK unless you expect to read alignment and deformations from COOL -ClassIDSvc INFO getRegistryEntries: read 1455 CLIDRegistry entries for module ALL -AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 1794 CLIDRegistry entries for module ALL -CondInputLoader INFO Initializing CondInputLoader... -CondInputLoader INFO Adding base classes: - + ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) -> -CondInputLoader INFO Will create WriteCondHandle dependencies for the following DataObjects: - + ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) -ClassIDSvc INFO getRegistryEntries: read 1370 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 743 CLIDRegistry entries for module ALL -RpcRawDataProvider INFO RpcRawDataProvider::initialize -RpcRawDataProvider INFO 'DoSeededDecoding':False -ClassIDSvc INFO getRegistryEntries: read 1699 CLIDRegistry entries for module ALL -MuonRPC_CablingSvc INFO Initializing MuonRPC_CablingSvc - package version MuonRPC_Cabling-00-00-00 -ToolSvc.RPCCabl... INFO Initializing - folders names are: conf /RPC/CABLING/MAP_SCHEMA / corr /RPC/CABLING/MAP_SCHEMA_CORR -MuonRPC_CablingSvc INFO RPCCablingDbTool retrieved with statusCode = SUCCESS with handle TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool') -MuonRPC_CablingSvc INFO Register call-back against 2 folders listed below -MuonRPC_CablingSvc INFO Folder n. 1 </RPC/CABLING/MAP_SCHEMA> found in the DetStore -ClassIDSvc INFO getRegistryEntries: read 501 CLIDRegistry entries for module ALL -MuonRPC_CablingSvc INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA> -MuonRPC_CablingSvc INFO Folder n. 2 </RPC/CABLING/MAP_SCHEMA_CORR> found in the DetStore -MuonRPC_CablingSvc INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA_CORR> -MuonRPC_CablingSvc INFO RPCTriggerDbTool retrieved with statusCode = SUCCESS pointer = TheRpcTriggerDbTool = PublicToolHandle('RPCTriggerDbTool') -MuonRPC_CablingSvc INFO Register call-back against 2 folders listed below -MuonRPC_CablingSvc INFO Folder n. 1 </RPC/TRIGGER/CM_THR_ETA> found in the DetStore -MuonRPC_CablingSvc INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_ETA> -MuonRPC_CablingSvc INFO Folder n. 2 </RPC/TRIGGER/CM_THR_PHI> found in the DetStore -MuonRPC_CablingSvc INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_PHI> -RpcRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('Muon::RpcROD_Decoder/RpcROD_Decoder') -RpcRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') -RpcRawDataProvi... INFO Tool = RpcRawDataProvider.RPC_RawDataProviderTool is connected to JobOptionsSvc Service = JobOptionsSvc -RpcRawDataProvi... INFO initialize() successful in RpcRawDataProvider.RPC_RawDataProviderTool -TgcRawDataProvider INFO TgcRawDataProvider::initialize -ClassIDSvc INFO getRegistryEntries: read 878 CLIDRegistry entries for module ALL -TgcRawDataProvi... INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderTool.TgcROD_Decoder -TgcRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') -TgcRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') -TgcRawDataProvi... INFO Tool = TgcRawDataProvider.TGC_RawDataProviderTool is connected to JobOptionsSvc Service = JobOptionsSvc -MuonTGC_CablingSvc INFO for 1/12 sector initialize -ToolSvc.TGCCabl... INFO initialize -ClassIDSvc INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonTGC_CablingSvc[0x1be9ac00]+219 bound to CondAttrListCollection[/TGC/CABLING/MAP_SCHEMA] -TgcRawDataProvi... INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderTool -MdtRawDataProvider INFO MdtRawDataProvider::initialize -ClassIDSvc INFO getRegistryEntries: read 922 CLIDRegistry entries for module ALL -MdtRawDataProvi... DEBUG Property update for OutputLevel : new value = 1 -MdtRawDataProvi...VERBOSE Starting init -MdtRawDataProvi...VERBOSE Getting m_robDataProvider -MdtRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') -MdtRawDataProvi...VERBOSE Getting MuonDetectorManager -MdtRawDataProvi...VERBOSE Getting m_decoder -MdtRawDataProvi... DEBUG Property update for OutputLevel : new value = 1 -MdtRawDataProvi... INFO Processing configuration for layouts with BME chambers. -MdtRawDataProvi... INFO Processing configuration for layouts with BMG chambers. -MdtRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') -MdtRawDataProvi... INFO Tool = MdtRawDataProvider.MDT_RawDataProviderTool is connected to JobOptionsSvc Service = JobOptionsSvc -MdtRawDataProvi... DEBUG Could not find TrigConf::HLTJobOptionsSvc -MdtRawDataProvi... INFO initialize() successful in MdtRawDataProvider.MDT_RawDataProviderTool -MdtRawDataProvi... DEBUG Adding private ToolHandle tool MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder (MdtROD_Decoder) -ClassIDSvc INFO getRegistryEntries: read 658 CLIDRegistry entries for module ALL -CscRawDataProvi... DEBUG Property update for OutputLevel : new value = 1 -CscRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') -CscRawDataProvi...VERBOSE ServiceLocatorHelper::service: found service JobOptionsSvc -CscRawDataProvi... INFO Tool = CscRawDataProvider.CSC_RawDataProviderTool is connected to JobOptionsSvc Service = JobOptionsSvc -CscRawDataProvi... DEBUG Could not find TrigConf::HLTJobOptionsSvc -CscRawDataProvi... DEBUG Property update for OutputLevel : new value = 1 -CscRawDataProvi... DEBUG Found the CscIdHelper. -CscRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') -CscRawDataProvi... INFO The Muon Geometry version is R.08.01 -CscRawDataProvi... INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderTool -CscRawDataProvi... DEBUG Adding private ToolHandle tool CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder (Muon::CscROD_Decoder) -ClassIDSvc INFO getRegistryEntries: read 53 CLIDRegistry entries for module ALL -RpcRdoToRpcPrep... INFO package version = MuonRPC_CnvTools-00-00-00 -RpcRdoToRpcPrep... INFO properties are -RpcRdoToRpcPrep... INFO processingData 0 -RpcRdoToRpcPrep... INFO produceRpcCoinDatafromTriggerWords 1 -RpcRdoToRpcPrep... INFO reduceCablingOverlap 1 -RpcRdoToRpcPrep... INFO solvePhiAmbiguities 1 -RpcRdoToRpcPrep... INFO timeShift -12.5 -RpcRdoToRpcPrep... INFO etaphi_coincidenceTime 20 -RpcRdoToRpcPrep... INFO overlap_timeTolerance 10 -RpcRdoToRpcPrep... INFO Correct prd time from cool db 0 -RpcRdoToRpcPrep... INFO Rpc Cabling Svc name is dataLike -RpcRdoToRpcPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::RpcRdoToPrepDataTool/RpcRdoToRpcPrepDataTool') -TgcRdoToTgcPrep... INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool -TgcRdoToTgcPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataTool/TgcRdoToTgcPrepDataTool') -MdtCalibrationSvc INFO Processing configuration for layouts with BMG chambers. -ClassIDSvc INFO getRegistryEntries: read 196 CLIDRegistry entries for module ALL -ToolSvc.MuonCal... INFO Retrieved IdHelpers: (muon, mdt, csc, rpc and tgc) -ToolSvc.MdtCali... INFO Creating new MdtTubeCalibContainerCollection -ToolSvc.MdtCali... INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML -6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1 -ToolSvc.MdtCali... INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML stationEta 6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1 -AtlasFieldSvc INFO initialize() ... -AtlasFieldSvc INFO maps will be chosen reading COOL folder /GLOBAL/BField/Maps -ClassIDSvc INFO getRegistryEntries: read 372 CLIDRegistry entries for module ALL -AtlasFieldSvc INFO magnet currents will be read from COOL folder /EXT/DCS/MAGNETS/SENSORDATA -AtlasFieldSvc INFO Booked callback for /EXT/DCS/MAGNETS/SENSORDATA -AtlasFieldSvc INFO initialize() successful -MdtRdoToMdtPrep... INFO Processing configuration for layouts with BME chambers. -MdtRdoToMdtPrep... INFO Processing configuration for layouts with BMG chambers. -MdtRdoToMdtPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataTool/MdtRdoToMdtPrepDataTool') -ClassIDSvc INFO getRegistryEntries: read 60 CLIDRegistry entries for module ALL -CscRdoToCscPrep... INFO The Geometry version is MuonSpectrometer-R.08.01 -MuonCalib::CscC... INFO Initializing CscCoolStrSvc -ClassIDSvc INFO getRegistryEntries: read 181 CLIDRegistry entries for module ALL -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bf83a00]+259 bound to CondAttrListCollection[CSC_PED] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bf83a00]+259 bound to CondAttrListCollection[CSC_NOISE] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bf83a00]+259 bound to CondAttrListCollection[CSC_PSLOPE] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bf83a00]+259 bound to CondAttrListCollection[CSC_STAT] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bf83a00]+259 bound to CondAttrListCollection[CSC_RMS] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bf83a00]+259 bound to CondAttrListCollection[CSC_FTHOLD] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bf83a00]+259 bound to CondAttrListCollection[CSC_T0BASE] -IOVSvcTool INFO Still in initialize phase, not tiggering callback for MuonCalib::CscCoolStrSvc[0x1bf83a00]+259 bound to CondAttrListCollection[CSC_T0PHASE] -CscRdoToCscPrep... INFO Retrieved CscRdoToCscPrepDataTool = PrivateToolHandle('Muon::CscRdoToCscPrepDataTool/CscRdoToCscPrepDataTool') -HistogramPersis...WARNING Histograms saving not required. -EventSelector INFO Initializing EventSelector - package version ByteStreamCnvSvc-00-00-00 -EventSelector WARNING InputCollections not properly set, checking EventStorageInputSvc properties -EventSelector INFO Retrieved StoreGateSvc name of '':StoreGateSvc -EventSelector INFO reinitialization... -ClassIDSvc INFO getRegistryEntries: read 1126 CLIDRegistry entries for module ALL -ToolSvc.Luminos... INFO LuminosityTool::initialize() registering -ToolSvc.Luminos... INFO LumiFolderName is empty, skipping -ToolSvc.Luminos... INFO OnlineLumiCalibrationTool.empty() is TRUE, skipping... -ToolSvc.Luminos... INFO FillParamsTool.empty() is TRUE, skipping... -ToolSvc.Luminos... INFO BunchLumisTool.empty() is TRUE, skipping... -ToolSvc.Luminos... INFO BunchGroupTool.empty() is TRUE, skipping... -ToolSvc.Luminos... INFO LBLBFolderName is empty, skipping... -EventSelector INFO Retrieved InputCollections from InputSvc -ByteStreamInputSvc INFO Initializing ByteStreamInputSvc - package version ByteStreamCnvSvc-00-00-00 -EventSelector INFO reinitialization... -AthenaEventLoopMgr INFO Setup EventSelector service EventSelector -ApplicationMgr INFO Application Manager Initialized successfully -ByteStreamInputSvc INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' -ApplicationMgr INFO Application Manager Started successfully -EventInfoByteSt... INFO UserType : RawEvent -EventInfoByteSt... INFO IsSimulation : 0 -EventInfoByteSt... INFO IsTestbeam : 0 -EventInfoByteSt... INFO IsCalibration : 0 -EventInfoByteSt... INFO EventContext not valid -AthenaEventLoopMgr INFO ===>>> start of run 327265 <<<=== -EventPersistenc... INFO Added successfully Conversion service:TagInfoMgr -IOVDbSvc INFO Opening COOL connection for COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to BFieldMap-Run1-14m-v01 for folder /GLOBAL/BField/Maps -IOVDbSvc INFO Disconnecting from COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_MDT/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTRT-RUN2-UPD4-21 for folder /MDT/RTBLOB -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTT0-RUN2-UPD4-21 for folder /MDT/T0BLOB -IOVDbSvc INFO Disconnecting from COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_RPC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchema_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchemaCorr_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA_CORR -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrEta_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_ETA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrPhi_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_PHI -IOVDbSvc INFO Disconnecting from COOLONL_RPC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_TGC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to TgcCablingMapschema-RUN2-20100908-ASD2PPONL for folder /TGC/CABLING/MAP_SCHEMA -IOVDbSvc INFO Disconnecting from COOLONL_TGC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_CSC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscFthold-RUN2-BLK-UPD1-007-00 for folder /CSC/FTHOLD -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscNoise-RUN2-BLK-UPD1-007-00 for folder /CSC/NOISE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPed-RUN2-BLK-UPD1-007-00 for folder /CSC/PED -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPslope-RUN2-BLK-UPD1-000-00 for folder /CSC/PSLOPE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscRms-RUN2-BLK-UPD1-003-00 for folder /CSC/RMS -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscStat-RUN2-BLK-UPD1-008-00 for folder /CSC/STAT -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0base-RUN2-BLK-UPD1-001-00 for folder /CSC/T0BASE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0phase-RUN2-BLK-UPD2-001-00 for folder /CSC/T0PHASE -IOVDbSvc INFO Disconnecting from COOLOFL_CSC/CONDBR2 -MuonRPC_CablingSvc INFO initMappingModel has been called -MuonRPC_CablingSvc INFO ToolHandle in initMappingModel - <TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')> -MuonRPC_CablingSvc INFO Retrieving cabling singleton; to create an empty one or to get the existing one -RPCcabling INFO CablingRPC---singleton constructor ---- this must be executed just once -RPCcabling INFO CablingRPC---The singleton will fill the maps from the COOL streams -RPCcabling INFO CablingRPC---InitMaps from COOL cannot be executed NOW: empty string -RPCcabling INFO CablingRPC---The singleton is created here -RPCcabling INFO CablingRPC--- cacheCleared: s_status = 0 -MuonRPC_CablingSvc INFO Cabling singleton cache has been cleared -MuonRPC_CablingSvc INFO Trigger roads will be loaded from COOL -ToolSvc.RPCCabl... INFO LoadParameters /RPC/CABLING/MAP_SCHEMA I=2 -ToolSvc.RPCCabl... INFO loadRPCMap --- Load Map from DB -ToolSvc.RPCCabl... INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA> -ToolSvc.RPCCabl... INFO CondAttrListCollection from DB folder have been obtained with size 1 -ToolSvc.RPCCabl... INFO Loop over CondAttrListCollection ic = 1 -ToolSvc.RPCCabl... INFO After Reading folder, Configuration string size is 222202 -ToolSvc.RPCCabl... INFO LoadParameters /RPC/CABLING/MAP_SCHEMA_CORR I=2 -ToolSvc.RPCCabl... INFO loadRPCCorr --- Load Corrections from DB -ToolSvc.RPCCabl... INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA_CORR> -ToolSvc.RPCCabl... INFO CondAttrListCollection from DB folder have been obtained with size 1 -ToolSvc.RPCCabl... INFO After Reading folder, Correction string size is 29369 -MuonRPC_CablingSvc INFO InitMappingModel: Trigger roads not yet loaded from COOL - postpone cabling initialization -MuonRPC_CablingSvc INFO initTrigRoadsModel has been called -MuonRPC_CablingSvc INFO Trigger roads will be loaded from COOL -MuonRPC_CablingSvc INFO Retrieve the pointer to the cabling singleton -RPCcabling INFO CablingRPC--- cacheCleared: s_status = 0 -MuonRPC_CablingSvc INFO Cabling singleton cache has been cleared -ToolSvc.RPCTrig... INFO LoadParameters /RPC/TRIGGER/CM_THR_ETA I=2 -ToolSvc.RPCTrig... INFO LoadParameters /RPC/TRIGGER/CM_THR_PHI I=2 -MuonRPC_CablingSvc INFO ======== RPC Trigger Roads from COOL - Header infos ======== -MuonRPC_CablingSvc INFO -RPC LVL1 Configuration 10.6 with roads from Feb 2012 -L1 THRESHOLDS: MU4 MU6 MU10 MU11 MU15 MU20 -Road version: "road_files_120209" -CMA th0 th1 th2 -eta low-pt mu4 mu6 mu10 -phi low-pt mu4 mu6 mu10 -eta high-pt mu11 mu15 mu20 -phi high-pt mu11 mu15 mu15 - - -RPCcabling INFO CablingRPC---InitMaps from COOL: going to read configuration -RPCcabling INFO CablingRPC--->> RPC cabling map from COOL << -RPCcabling INFO CablingRPC--- ReadConf: map has size 222202 -RPCcabling INFO CablingRPC--- ReadConf: map n. of lines read is 924 -RPCcabling INFO CablingRPC--- ReadConf: version is 5.0 Atlas R_07_03_RUN2ver104 -RPCcabling INFO CablingRPC--- buildRDOmap -RPCcabling INFO CablingRPC---InitMaps from COOL: going to read corrections to configuration -RPCcabling INFO CablingRPC--->> RPC cabling corrections from COOL << -RPCcabling INFO CablingRPC--- ReadCorr: CorrMap has size 29369 -RPCcabling INFO CablingRPC--- ReadConf: CorrMap n. of lines read is 743 -RPCcabling INFO CablingRPC---InitMaps from COOL - maps have been parsed -MuonRPC_CablingSvc INFO InitTrigRoadsModel: RPC cabling model is loaded! -Level-1 configuration database version 5.0 Atlas R_07_03_RUN2ver104 read. -Contains 26 Trigger Sector Types: -negative sectors 0 - 15 ==> 18 2 24 3 19 2 24 4 20 2 24 1 18 5 25 6 -negative sectors 16 - 31 ==> 21 13 26 6 21 7 16 8 14 7 16 6 21 13 26 1 -positive sectors 32 - 47 ==> 9 24 2 22 9 24 2 23 10 24 2 18 1 25 5 18 -positive sectors 48 - 63 ==> 1 26 13 21 6 17 12 15 11 17 12 21 6 26 13 22 - -MuonRPC_CablingSvc INFO buildOfflineOnlineMap -MuonRPC_CablingSvc INFO Applying FeetPadThresholds : 0,2,5 -MuonRPC_CablingSvc INFO MuonRPC_CablingSvc initialized succesfully -MuonTGC_CablingSvc INFO updateCableASDToPP called -ToolSvc.TGCCabl... INFO loadTGCMap from DB -ToolSvc.TGCCabl... INFO CondAttrListCollection from DB folder have been obtained with size 1 -ToolSvc.TGCCabl... INFO giveASD2PP_DIFF_12 (m_ASD2PP_DIFF_12 is not NULL) -ToolSvc.MdtCali... INFO Creating new MdtTubeCalibContainerCollection -ToolSvc.MdtCali... INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML -6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1 -ToolSvc.MdtCali... INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML stationEta 6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1 -ToolSvc.MdtCali... INFO MdtCalibDbCoolStrTool::loadRt Read 1188RTs from COOL -AtlasFieldSvc INFO reading magnetic field map filenames from COOL -AtlasFieldSvc INFO found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root) -AtlasFieldSvc INFO found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root) -AtlasFieldSvc INFO found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root) -AtlasFieldSvc INFO no need to update map set -AtlasFieldSvc INFO Attempt 1 at reading currents from DCS (using channel name) -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7 -AtlasFieldSvc INFO Currents read from DCS: solenoid 7729.99 toroid 20399.9 -AtlasFieldSvc INFO Initializing the field map (solenoidCurrent=7729.99 toroidCurrent=20399.9) -AtlasFieldSvc INFO reading the map from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/atlas/offline/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldSvc INFO Initialized the field map from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/atlas/offline/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -ClassIDSvc INFO getRegistryEntries: read 672 CLIDRegistry entries for module ALL -AthenaEventLoopMgr INFO ===>>> start processing event #186525031, run #327265 0 events processed so far <<<=== -IOVDbSvc INFO Opening COOL connection for COOLONL_MDT/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMapSchema_BMG_01 for folder /MDT/CABLING/MAP_SCHEMA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMezzanineSchema_M5-RUN2 for folder /MDT/CABLING/MEZZANINE_SCHEMA -IOVDbSvc INFO Disconnecting from COOLONL_MDT/CONDBR2 -MuonMDT_CablingAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) readCdoMez->size()= 24 -MuonMDT_CablingAlg INFO Range of input is {[0,l:0] - [INVALID]} -MuonMDT_CablingAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) readCdoMap->size()= 2312 -MuonMDT_CablingAlg INFO Range of input is {[327264,l:4294640031] - [327265,l:4294640030]} -MuonMDT_CablingAlg INFO recorded new MuonMDT_CablingMap with range {[327264,l:4294640031] - [327265,l:4294640030]} into Conditions Store -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG fillCollection: starting -MdtRawDataProvi... DEBUG **********Decoder dumping the words******** -MdtRawDataProvi... DEBUG The size of this ROD-read is -MdtRawDataProvi... DEBUG word 0 = 8003e994 -MdtRawDataProvi... DEBUG word 1 = 81040007 -MdtRawDataProvi... DEBUG word 2 = 18030370 -MdtRawDataProvi... DEBUG word 3 = 890003ff -MdtRawDataProvi... DEBUG word 4 = a3994153 -MdtRawDataProvi... DEBUG word 5 = 30a403c0 -MdtRawDataProvi... DEBUG word 6 = 30a004ce -MdtRawDataProvi... DEBUG word 7 = 8a994005 -MdtRawDataProvi... DEBUG word 8 = 8104000d -MdtRawDataProvi... DEBUG word 9 = 18030371 -MdtRawDataProvi... DEBUG word 10 = 89000fff -MdtRawDataProvi... DEBUG word 11 = a2994153 -MdtRawDataProvi... DEBUG word 12 = 306c0472 -MdtRawDataProvi... DEBUG word 13 = 306804d5 -MdtRawDataProvi... DEBUG word 14 = a3994153 -MdtRawDataProvi... DEBUG word 15 = 20080000 -MdtRawDataProvi... DEBUG word 16 = a4994153 -MdtRawDataProvi... DEBUG word 17 = 301c0504 -MdtRawDataProvi... DEBUG word 18 = 30180562 -MdtRawDataProvi... DEBUG word 19 = 20000010 -MdtRawDataProvi... DEBUG word 20 = 8a99400b -MdtRawDataProvi... DEBUG word 21 = 81040006 -MdtRawDataProvi... DEBUG word 22 = 18030372 -MdtRawDataProvi... DEBUG word 23 = 89003fff -MdtRawDataProvi... DEBUG word 24 = a6994153 -MdtRawDataProvi... DEBUG word 25 = 20008000 -MdtRawDataProvi... DEBUG word 26 = 8a994004 -MdtRawDataProvi... DEBUG word 27 = 8104000f -MdtRawDataProvi... DEBUG word 28 = 18030373 -MdtRawDataProvi... DEBUG word 29 = 89003fff -MdtRawDataProvi... DEBUG word 30 = a0994153 -MdtRawDataProvi... DEBUG word 31 = 3034054a -MdtRawDataProvi... DEBUG word 32 = 303005c2 -MdtRawDataProvi... DEBUG word 33 = a7994153 -MdtRawDataProvi... DEBUG word 34 = 3084023a -MdtRawDataProvi... DEBUG word 35 = 3080029e -MdtRawDataProvi... DEBUG word 36 = a8994153 -MdtRawDataProvi... DEBUG word 37 = 307c03f6 -MdtRawDataProvi... DEBUG word 38 = 30ac03f8 -MdtRawDataProvi... DEBUG word 39 = 307804c4 -MdtRawDataProvi... DEBUG word 40 = 30a804cb -MdtRawDataProvi... DEBUG word 41 = 8a99400d -MdtRawDataProvi... DEBUG word 42 = 81040008 -MdtRawDataProvi... DEBUG word 43 = 18030374 -MdtRawDataProvi... DEBUG word 44 = 8903ffff -MdtRawDataProvi... DEBUG word 45 = af994153 -MdtRawDataProvi... DEBUG word 46 = 302c05c7 -MdtRawDataProvi... DEBUG word 47 = 30280664 -MdtRawDataProvi... DEBUG word 48 = 305c0673 -MdtRawDataProvi... DEBUG word 49 = 8a994006 -MdtRawDataProvi... DEBUG word 50 = 81040031 -MdtRawDataProvi... DEBUG word 51 = 18030375 -MdtRawDataProvi... DEBUG word 52 = 8903ffff -MdtRawDataProvi... DEBUG word 53 = a0994153 -MdtRawDataProvi... DEBUG word 54 = 3054055c -MdtRawDataProvi... DEBUG word 55 = 305005fb -MdtRawDataProvi... DEBUG word 56 = a2994153 -MdtRawDataProvi... DEBUG word 57 = 20010000 -MdtRawDataProvi... DEBUG word 58 = a8994153 -MdtRawDataProvi... DEBUG word 59 = 306c034f -MdtRawDataProvi... DEBUG word 60 = 309c0349 -MdtRawDataProvi... DEBUG word 61 = 308c0394 -MdtRawDataProvi... DEBUG word 62 = 309803d9 -MdtRawDataProvi... DEBUG word 63 = 304c03f8 -MdtRawDataProvi... DEBUG word 64 = 30680422 -MdtRawDataProvi... DEBUG word 65 = 30880439 -MdtRawDataProvi... DEBUG word 66 = 30bc03f3 -MdtRawDataProvi... DEBUG word 67 = 3048049a -MdtRawDataProvi... DEBUG word 68 = 30b80479 -MdtRawDataProvi... DEBUG word 69 = 305c05e9 -MdtRawDataProvi... DEBUG word 70 = 30580652 -MdtRawDataProvi... DEBUG word 71 = af994153 -MdtRawDataProvi... DEBUG word 72 = 30940521 -MdtRawDataProvi... DEBUG word 73 = 30840583 -MdtRawDataProvi... DEBUG word 74 = 308c0583 -MdtRawDataProvi... DEBUG word 75 = 309c0585 -MdtRawDataProvi... DEBUG word 76 = 308005e7 -MdtRawDataProvi... DEBUG word 77 = 308805f5 -MdtRawDataProvi... DEBUG word 78 = 3090061d -MdtRawDataProvi... DEBUG word 79 = 309805f1 -MdtRawDataProvi... DEBUG word 80 = 30a40587 -MdtRawDataProvi... DEBUG word 81 = 30ac0588 -MdtRawDataProvi... DEBUG word 82 = 30b40589 -MdtRawDataProvi... DEBUG word 83 = 30bc058d -MdtRawDataProvi... DEBUG word 84 = 30a005fc -MdtRawDataProvi... DEBUG word 85 = 30a805f2 -MdtRawDataProvi... DEBUG word 86 = 30b005e7 -MdtRawDataProvi... DEBUG word 87 = 30b805d8 -MdtRawDataProvi... DEBUG word 88 = b0994153 -MdtRawDataProvi... DEBUG word 89 = 306c0082 -MdtRawDataProvi... DEBUG word 90 = 3068012b -MdtRawDataProvi... DEBUG word 91 = 303c01ed -MdtRawDataProvi... DEBUG word 92 = 30380250 -MdtRawDataProvi... DEBUG word 93 = 306c0556 -MdtRawDataProvi... DEBUG word 94 = 306805a3 -MdtRawDataProvi... DEBUG word 95 = 20004000 -MdtRawDataProvi... DEBUG word 96 = b1994153 -MdtRawDataProvi... DEBUG word 97 = 20010000 -MdtRawDataProvi... DEBUG word 98 = 8a99402f -MdtRawDataProvi... DEBUG word 99 = f0000064 -MdtRawDataProvi... DEBUG Found the beginning of buffer -MdtRawDataProvi... DEBUG Level 1 Id : 256404 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 0 csmId : 0 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 0 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 1 -MdtRawDataProvi... DEBUG Collection ID = 0x6048000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 3 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 0 csmId : 1 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 0 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi... DEBUG Phi : 1 -MdtRawDataProvi... DEBUG Collection ID = 0x6050000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 2 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 3 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 4 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 0 csmId : 2 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 2 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 1 -MdtRawDataProvi... DEBUG Collection ID = 0x6248000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 6 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 0 csmId : 3 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 2 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi... DEBUG Phi : 1 -MdtRawDataProvi... DEBUG Collection ID = 0x6250000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 0 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 7 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 8 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 0 csmId : 4 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 4 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 1 -MdtRawDataProvi... DEBUG Collection ID = 0x6448000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 15 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 0 csmId : 5 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 4 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi... DEBUG Phi : 1 -MdtRawDataProvi... DEBUG Collection ID = 0x6450000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 0 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 2 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 8 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 15 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 16 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 17 -MdtRawDataProvi... DEBUG fillCollection: starting -MdtRawDataProvi... DEBUG **********Decoder dumping the words******** -MdtRawDataProvi... DEBUG The size of this ROD-read is -MdtRawDataProvi... DEBUG word 0 = 8003e994 -MdtRawDataProvi... DEBUG word 1 = 81040004 -MdtRawDataProvi... DEBUG word 2 = 18030210 -MdtRawDataProvi... DEBUG word 3 = 890003ff -MdtRawDataProvi... DEBUG word 4 = 8a994002 -MdtRawDataProvi... DEBUG word 5 = 81040014 -MdtRawDataProvi... DEBUG word 6 = 18030211 -MdtRawDataProvi... DEBUG word 7 = 89000fff -MdtRawDataProvi... DEBUG word 8 = a1994153 -MdtRawDataProvi... DEBUG word 9 = 20000500 -MdtRawDataProvi... DEBUG word 10 = a3994153 -MdtRawDataProvi... DEBUG word 11 = 20000028 -MdtRawDataProvi... DEBUG word 12 = aa994153 -MdtRawDataProvi... DEBUG word 13 = 303c0116 -MdtRawDataProvi... DEBUG word 14 = 3038016f -MdtRawDataProvi... DEBUG word 15 = 308c0202 -MdtRawDataProvi... DEBUG word 16 = 3088026b -MdtRawDataProvi... DEBUG word 17 = 20100000 -MdtRawDataProvi... DEBUG word 18 = ab994153 -MdtRawDataProvi... DEBUG word 19 = 3074012d -MdtRawDataProvi... DEBUG word 20 = 30700187 -MdtRawDataProvi... DEBUG word 21 = 3084015b -MdtRawDataProvi... DEBUG word 22 = 308001ca -MdtRawDataProvi... DEBUG word 23 = 20140150 -MdtRawDataProvi... DEBUG word 24 = 8a994012 -MdtRawDataProvi... DEBUG word 25 = 81040007 -MdtRawDataProvi... DEBUG word 26 = 18030212 -MdtRawDataProvi... DEBUG word 27 = 89003fff -MdtRawDataProvi... DEBUG word 28 = a3994153 -MdtRawDataProvi... DEBUG word 29 = 307c0071 -MdtRawDataProvi... DEBUG word 30 = 30780094 -MdtRawDataProvi... DEBUG word 31 = 8a994005 -MdtRawDataProvi... DEBUG word 32 = 81040014 -MdtRawDataProvi... DEBUG word 33 = 18030213 -MdtRawDataProvi... DEBUG word 34 = 89003fff -MdtRawDataProvi... DEBUG word 35 = a3994153 -MdtRawDataProvi... DEBUG word 36 = 30b401cb -MdtRawDataProvi... DEBUG word 37 = 30bc0213 -MdtRawDataProvi... DEBUG word 38 = 30b00256 -MdtRawDataProvi... DEBUG word 39 = 30b802c7 -MdtRawDataProvi... DEBUG word 40 = 307c032d -MdtRawDataProvi... DEBUG word 41 = 30840397 -MdtRawDataProvi... DEBUG word 42 = 307803e7 -MdtRawDataProvi... DEBUG word 43 = 308003f1 -MdtRawDataProvi... DEBUG word 44 = a6994153 -MdtRawDataProvi... DEBUG word 45 = 30b40533 -MdtRawDataProvi... DEBUG word 46 = 30740552 -MdtRawDataProvi... DEBUG word 47 = 30a40588 -MdtRawDataProvi... DEBUG word 48 = 307005cb -MdtRawDataProvi... DEBUG word 49 = 30a00611 -MdtRawDataProvi... DEBUG word 50 = 30b0063b -MdtRawDataProvi... DEBUG word 51 = 8a994012 -MdtRawDataProvi... DEBUG word 52 = 8104001c -MdtRawDataProvi... DEBUG word 53 = 18030214 -MdtRawDataProvi... DEBUG word 54 = 8903ffff -MdtRawDataProvi... DEBUG word 55 = a2994153 -MdtRawDataProvi... DEBUG word 56 = 30b0002f -MdtRawDataProvi... DEBUG word 57 = 3084019b -MdtRawDataProvi... DEBUG word 58 = 30800237 -MdtRawDataProvi... DEBUG word 59 = 20540100 -MdtRawDataProvi... DEBUG word 60 = a4994153 -MdtRawDataProvi... DEBUG word 61 = 306c019f -MdtRawDataProvi... DEBUG word 62 = 30680214 -MdtRawDataProvi... DEBUG word 63 = 30140429 -MdtRawDataProvi... DEBUG word 64 = 30100474 -MdtRawDataProvi... DEBUG word 65 = 20000ad4 -MdtRawDataProvi... DEBUG word 66 = a5994153 -MdtRawDataProvi... DEBUG word 67 = 30bc0362 -MdtRawDataProvi... DEBUG word 68 = 30b80481 -MdtRawDataProvi... DEBUG word 69 = a6994153 -MdtRawDataProvi... DEBUG word 70 = 20004000 -MdtRawDataProvi... DEBUG word 71 = a8994153 -MdtRawDataProvi... DEBUG word 72 = 20000820 -MdtRawDataProvi... DEBUG word 73 = aa994153 -MdtRawDataProvi... DEBUG word 74 = 20000002 -MdtRawDataProvi... DEBUG word 75 = ae994153 -MdtRawDataProvi... DEBUG word 76 = 20000080 -MdtRawDataProvi... DEBUG word 77 = b0994153 -MdtRawDataProvi... DEBUG word 78 = 20000200 -MdtRawDataProvi... DEBUG word 79 = 8a99401a -MdtRawDataProvi... DEBUG word 80 = 81040025 -MdtRawDataProvi... DEBUG word 81 = 18030215 -MdtRawDataProvi... DEBUG word 82 = 8903ffff -MdtRawDataProvi... DEBUG word 83 = a5994153 -MdtRawDataProvi... DEBUG word 84 = 304c054e -MdtRawDataProvi... DEBUG word 85 = 304805fd -MdtRawDataProvi... DEBUG word 86 = a6994153 -MdtRawDataProvi... DEBUG word 87 = 20000040 -MdtRawDataProvi... DEBUG word 88 = a8994153 -MdtRawDataProvi... DEBUG word 89 = 306c0098 -MdtRawDataProvi... DEBUG word 90 = 30bc0093 -MdtRawDataProvi... DEBUG word 91 = 308400fd -MdtRawDataProvi... DEBUG word 92 = 308c00fe -MdtRawDataProvi... DEBUG word 93 = 309400fb -MdtRawDataProvi... DEBUG word 94 = 309c00fd -MdtRawDataProvi... DEBUG word 95 = 30a400f9 -MdtRawDataProvi... DEBUG word 96 = 30ac00fc -MdtRawDataProvi... DEBUG word 97 = 30b400f9 -MdtRawDataProvi... DEBUG word 98 = 302c0185 -MdtRawDataProvi... DEBUG word 99 = 306801a0 -MdtRawDataProvi... DEBUG word 100 = 30800148 -MdtRawDataProvi... DEBUG word 101 = 30880147 -MdtRawDataProvi... DEBUG word 102 = 30900149 -MdtRawDataProvi... DEBUG word 103 = 30980168 -MdtRawDataProvi... DEBUG word 104 = 30a00169 -MdtRawDataProvi... DEBUG word 105 = 30a80163 -MdtRawDataProvi... DEBUG word 106 = 30b00161 -MdtRawDataProvi... DEBUG word 107 = 30b801a3 -MdtRawDataProvi... DEBUG word 108 = 30280271 -MdtRawDataProvi... DEBUG word 109 = a9994153 -MdtRawDataProvi... DEBUG word 110 = 301c00b6 -MdtRawDataProvi... DEBUG word 111 = 309c00d1 -MdtRawDataProvi... DEBUG word 112 = 301801bc -MdtRawDataProvi... DEBUG word 113 = 309801b9 -MdtRawDataProvi... DEBUG word 114 = 305c01f8 -MdtRawDataProvi... DEBUG word 115 = 305802ec -MdtRawDataProvi... DEBUG word 116 = 8a994023 -MdtRawDataProvi... DEBUG word 117 = f0000076 -MdtRawDataProvi... DEBUG Found the beginning of buffer -MdtRawDataProvi... DEBUG Level 1 Id : 256404 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 1 csmId : 0 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 0 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 2 -MdtRawDataProvi... DEBUG Collection ID = 0x6049000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 1 csmId : 1 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 0 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi... DEBUG Phi : 2 -MdtRawDataProvi... DEBUG Collection ID = 0x6051000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 1 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 3 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 10 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 11 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 1 csmId : 2 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 2 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 2 -MdtRawDataProvi... DEBUG Collection ID = 0x6249000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 3 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 1 csmId : 3 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 2 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi... DEBUG Phi : 2 -MdtRawDataProvi... DEBUG Collection ID = 0x6251000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 3 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 6 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 1 csmId : 4 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 4 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 2 -MdtRawDataProvi... DEBUG Collection ID = 0x6449000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 2 -MdtRawDataProvi... DEBUG Error: corresponding leading edge not found for the trailing edge tdc: 2 chan: 22 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 4 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 5 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 6 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 8 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 10 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 14 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 16 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 1 csmId : 5 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 4 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi... DEBUG Phi : 2 -MdtRawDataProvi... DEBUG Collection ID = 0x6451000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 5 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 6 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 8 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 9 -MdtRawDataProvi... DEBUG fillCollection: starting -MdtRawDataProvi... DEBUG **********Decoder dumping the words******** -MdtRawDataProvi... DEBUG The size of this ROD-read is -MdtRawDataProvi... DEBUG word 0 = 8003e994 -MdtRawDataProvi... DEBUG word 1 = 81040004 -MdtRawDataProvi... DEBUG word 2 = 180300d0 -MdtRawDataProvi... DEBUG word 3 = 890003ff -MdtRawDataProvi... DEBUG word 4 = 8a994002 -MdtRawDataProvi... DEBUG word 5 = 81040004 -MdtRawDataProvi... DEBUG word 6 = 180300d1 -MdtRawDataProvi... DEBUG word 7 = 89000fff -MdtRawDataProvi... DEBUG word 8 = 8a994002 -MdtRawDataProvi... DEBUG word 9 = 8104000e -MdtRawDataProvi... DEBUG word 10 = 180300d2 -MdtRawDataProvi... DEBUG word 11 = 89000fff -MdtRawDataProvi... DEBUG word 12 = a0994153 -MdtRawDataProvi... DEBUG word 13 = 30a00056 -MdtRawDataProvi... DEBUG word 14 = 20105050 -MdtRawDataProvi... DEBUG word 15 = a1994153 -MdtRawDataProvi... DEBUG word 16 = 30b40578 -MdtRawDataProvi... DEBUG word 17 = 30b0060a -MdtRawDataProvi... DEBUG word 18 = a8994153 -MdtRawDataProvi... DEBUG word 19 = 20000400 -MdtRawDataProvi... DEBUG word 20 = a9994153 -MdtRawDataProvi... DEBUG word 21 = 307c067b -MdtRawDataProvi... DEBUG word 22 = 8a99400c -MdtRawDataProvi... DEBUG word 23 = 81040011 -MdtRawDataProvi... DEBUG word 24 = 180300d3 -MdtRawDataProvi... DEBUG word 25 = 89003fff -MdtRawDataProvi... DEBUG word 26 = a5994153 -MdtRawDataProvi... DEBUG word 27 = 308c0359 -MdtRawDataProvi... DEBUG word 28 = 30880397 -MdtRawDataProvi... DEBUG word 29 = 20020000 -MdtRawDataProvi... DEBUG word 30 = a7994153 -MdtRawDataProvi... DEBUG word 31 = 30600040 -MdtRawDataProvi... DEBUG word 32 = 20001000 -MdtRawDataProvi... DEBUG word 33 = a8994153 -MdtRawDataProvi... DEBUG word 34 = 302403a8 -MdtRawDataProvi... DEBUG word 35 = 3020040f -MdtRawDataProvi... DEBUG word 36 = a9994153 -MdtRawDataProvi... DEBUG word 37 = 309c0635 -MdtRawDataProvi... DEBUG word 38 = 308c0671 -MdtRawDataProvi... DEBUG word 39 = 8a99400f -MdtRawDataProvi... DEBUG word 40 = 81040017 -MdtRawDataProvi... DEBUG word 41 = 180300d4 -MdtRawDataProvi... DEBUG word 42 = 8900ffff -MdtRawDataProvi... DEBUG word 43 = a1994153 -MdtRawDataProvi... DEBUG word 44 = 304c0488 -MdtRawDataProvi... DEBUG word 45 = 308c0498 -MdtRawDataProvi... DEBUG word 46 = 302c0500 -MdtRawDataProvi... DEBUG word 47 = 30280581 -MdtRawDataProvi... DEBUG word 48 = 3048052d -MdtRawDataProvi... DEBUG word 49 = 3088056a -MdtRawDataProvi... DEBUG word 50 = 301c05a2 -MdtRawDataProvi... DEBUG word 51 = 30180610 -MdtRawDataProvi... DEBUG word 52 = 309c0646 -MdtRawDataProvi... DEBUG word 53 = a4994153 -MdtRawDataProvi... DEBUG word 54 = 30640517 -MdtRawDataProvi... DEBUG word 55 = 306005a2 -MdtRawDataProvi... DEBUG word 56 = 302405e1 -MdtRawDataProvi... DEBUG word 57 = 30200624 -MdtRawDataProvi... DEBUG word 58 = a9994153 -MdtRawDataProvi... DEBUG word 59 = 200000a0 -MdtRawDataProvi... DEBUG word 60 = ab994153 -MdtRawDataProvi... DEBUG word 61 = 20041100 -MdtRawDataProvi... DEBUG word 62 = 8a994015 -MdtRawDataProvi... DEBUG word 63 = 8104001c -MdtRawDataProvi... DEBUG word 64 = 180300d5 -MdtRawDataProvi... DEBUG word 65 = 8903ffff -MdtRawDataProvi... DEBUG word 66 = a0994153 -MdtRawDataProvi... DEBUG word 67 = 3014000e -MdtRawDataProvi... DEBUG word 68 = 30100032 -MdtRawDataProvi... DEBUG word 69 = 30940069 -MdtRawDataProvi... DEBUG word 70 = 3090008d -MdtRawDataProvi... DEBUG word 71 = 20000400 -MdtRawDataProvi... DEBUG word 72 = a1994153 -MdtRawDataProvi... DEBUG word 73 = 3070001a -MdtRawDataProvi... DEBUG word 74 = 30040377 -MdtRawDataProvi... DEBUG word 75 = 30000398 -MdtRawDataProvi... DEBUG word 76 = 20014001 -MdtRawDataProvi... DEBUG word 77 = a2994153 -MdtRawDataProvi... DEBUG word 78 = 20000020 -MdtRawDataProvi... DEBUG word 79 = a3994153 -MdtRawDataProvi... DEBUG word 80 = 20000040 -MdtRawDataProvi... DEBUG word 81 = a9994153 -MdtRawDataProvi... DEBUG word 82 = 30a40400 -MdtRawDataProvi... DEBUG word 83 = 30a00424 -MdtRawDataProvi... DEBUG word 84 = aa994153 -MdtRawDataProvi... DEBUG word 85 = 20008000 -MdtRawDataProvi... DEBUG word 86 = ab994153 -MdtRawDataProvi... DEBUG word 87 = 20080000 -MdtRawDataProvi... DEBUG word 88 = b0994153 -MdtRawDataProvi... DEBUG word 89 = 20080000 -MdtRawDataProvi... DEBUG word 90 = 8a99401a -MdtRawDataProvi... DEBUG word 91 = f000005c -MdtRawDataProvi... DEBUG Found the beginning of buffer -MdtRawDataProvi... DEBUG Level 1 Id : 256404 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 2 csmId : 0 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 0 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 3 -MdtRawDataProvi... DEBUG Collection ID = 0x604a000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 2 csmId : 1 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 0 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi... DEBUG Phi : 3 -MdtRawDataProvi... DEBUG Collection ID = 0x6052000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 2 csmId : 2 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 2 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 3 -MdtRawDataProvi... DEBUG Collection ID = 0x624a000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 0 -MdtRawDataProvi... DEBUG Error: corresponding leading edge not found for the trailing edge tdc: 0 chan: 20 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 1 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 8 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 9 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 2 csmId : 3 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 2 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi... DEBUG Phi : 3 -MdtRawDataProvi... DEBUG Collection ID = 0x6252000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 5 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 7 -MdtRawDataProvi... DEBUG Error: corresponding leading edge not found for the trailing edge tdc: 7 chan: 12 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 8 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 9 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 2 csmId : 4 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 4 -MdtRawDataProvi... DEBUG Eta : 1 -MdtRawDataProvi... DEBUG Phi : 3 -MdtRawDataProvi... DEBUG Collection ID = 0x644a000000000000 does not exist, create it -MdtRawDataProvi... DEBUG Decoding data from TDC number : 1 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 4 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 9 -MdtRawDataProvi... DEBUG Decoding data from TDC number : 11 -MdtRawDataProvi... DEBUG Found the Beginnning of Link -MdtRawDataProvi... DEBUG subdetId : 97 mrodId : 2 csmId : 5 -MdtRawDataProvi... DEBUG getOfflineIdfromOnlineID result: -MdtRawDataProvi... DEBUG Name : 4 -MdtRawDataProvi... DEBUG Eta : 2 -MdtRawDataProvi...WARNING DEBUG message limit (500) reached for MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder. Suppressing further output. -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x80 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x80 24 8 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 8 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 112 -CscRawDataProvi... DEBUG RPU Header word 0x5000070 -CscRawDataProvi... DEBUG RPU ID original = 5 -CscRawDataProvi... DEBUG RPU ID Updated = 5 -CscRawDataProvi... DEBUG RPU size = 112 -CscRawDataProvi... DEBUG SCA Address = 724315438 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x20202 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 2 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 2 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 2 -CscRawDataProvi... DEBUG Second cluster word 0x600006c -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 6 -CscRawDataProvi... DEBUG Cluster Data Words = 108 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 12 -CscRawDataProvi... DEBUG cluster location word 0x10a2d -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 46 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 31725 6 51 :: measphi0 L2 strId 46 nStr 4 T0 nSampWords 8 [7.51.-1.1.1.2.2.0.46] -CscRawDataProvi... DEBUG cluster location word 0x10a35 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 54 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 31733 6 51 :: measphi0 L2 strId 54 nStr 3 T0 nSampWords 6 [7.51.-1.1.1.2.2.0.54] -CscRawDataProvi... DEBUG cluster location word 0x10c2c -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 45 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 31916 7 51 :: measphi0 L3 strId 45 nStr 5 T0 nSampWords 10 [7.51.-1.1.1.2.3.0.45] -CscRawDataProvi... DEBUG cluster location word 0x10c37 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 56 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 31927 7 51 :: measphi0 L3 strId 56 nStr 4 T0 nSampWords 8 [7.51.-1.1.1.2.3.0.56] -CscRawDataProvi... DEBUG cluster location word 0x10e2d -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 46 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 32109 8 51 :: measphi0 L4 strId 46 nStr 3 T0 nSampWords 6 [7.51.-1.1.1.2.4.0.46] -CscRawDataProvi... DEBUG cluster location word 0x10e39 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 58 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 32121 8 51 :: measphi0 L4 strId 58 nStr 3 T0 nSampWords 6 [7.51.-1.1.1.2.4.0.58] -CscRawDataProvi... DEBUG cluster location word 0x10903 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 4 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 55491 9 51 :: measphi1 L1 strId 4 nStr 3 T0 nSampWords 6 [7.51.-1.1.1.2.1.1.4] -CscRawDataProvi... DEBUG cluster location word 0x10b08 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 9 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 55544 9 51 :: measphi1 L2 strId 9 nStr 3 T0 nSampWords 6 [7.51.-1.1.1.2.2.1.9] -CscRawDataProvi... DEBUG cluster location word 0x10b1e -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 31 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 55566 9 51 :: measphi1 L2 strId 31 nStr 3 T0 nSampWords 6 [7.51.-1.1.1.2.2.1.31] -CscRawDataProvi... DEBUG cluster location word 0x10d07 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 8 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 55591 9 51 :: measphi1 L3 strId 8 nStr 5 T0 nSampWords 10 [7.51.-1.1.1.2.3.1.8] -CscRawDataProvi... DEBUG cluster location word 0x10d1e -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 31 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 55614 9 51 :: measphi1 L3 strId 31 nStr 3 T0 nSampWords 6 [7.51.-1.1.1.2.3.1.31] -CscRawDataProvi... DEBUG cluster location word 0x10f08 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 9 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 8 55640 9 51 :: measphi1 L4 strId 9 nStr 3 T0 nSampWords 6 [7.51.-1.1.1.2.4.1.9] -CscRawDataProvi... DEBUG ****Total Cluster count = 12 for RPU ID 5 -CscRawDataProvi... DEBUG end of CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x81 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x81 16 0 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 0 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 122 -CscRawDataProvi... DEBUG RPU Header word 0xd00007a -CscRawDataProvi... DEBUG RPU ID original = 13 -CscRawDataProvi... DEBUG RPU ID Updated = 11 -CscRawDataProvi... DEBUG RPU size = 122 -CscRawDataProvi... DEBUG SCA Address = 2358087311 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x2000002 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 2 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 2 -CscRawDataProvi... DEBUG Second cluster word 0x7000076 -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 7 -CscRawDataProvi... DEBUG Cluster Data Words = 118 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 11 -CscRawDataProvi... DEBUG cluster location word 0x810 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 17 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 784 0 50 :: measphi0 L1 strId 17 nStr 4 T0 nSampWords 8 [7.50.-1.1.1.2.1.0.17] -CscRawDataProvi... DEBUG cluster location word 0x868 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000007 105 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 872 0 50 :: measphi0 L1 strId 105 nStr 7 T0 nSampWords 14 [7.50.-1.1.1.2.1.0.105] -CscRawDataProvi... DEBUG cluster location word 0xe11 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x1000000a 18 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 1361 3 50 :: measphi0 L4 strId 18 nStr 10 T0 nSampWords 20 [7.50.-1.1.1.2.4.0.18] -CscRawDataProvi... DEBUG cluster location word 0xe41 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 66 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 1409 3 50 :: measphi0 L4 strId 66 nStr 4 T0 nSampWords 8 [7.50.-1.1.1.2.4.0.66] -CscRawDataProvi... DEBUG cluster location word 0x916 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 23 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 24790 4 50 :: measphi1 L1 strId 23 nStr 5 T0 nSampWords 10 [7.50.-1.1.1.2.1.1.23] -CscRawDataProvi... DEBUG cluster location word 0xb16 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 23 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 24838 4 50 :: measphi1 L2 strId 23 nStr 3 T0 nSampWords 6 [7.50.-1.1.1.2.2.1.23] -CscRawDataProvi... DEBUG cluster location word 0xd03 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 4 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 24867 4 50 :: measphi1 L3 strId 4 nStr 3 T0 nSampWords 6 [7.50.-1.1.1.2.3.1.4] -CscRawDataProvi... DEBUG cluster location word 0xd15 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 22 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 24885 4 50 :: measphi1 L3 strId 22 nStr 3 T0 nSampWords 6 [7.50.-1.1.1.2.3.1.22] -CscRawDataProvi... DEBUG cluster location word 0xd2d -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 46 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 24909 4 50 :: measphi1 L3 strId 46 nStr 3 T0 nSampWords 6 [7.50.-1.1.1.2.3.1.46] -CscRawDataProvi... DEBUG cluster location word 0xf15 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 22 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 24933 4 50 :: measphi1 L4 strId 22 nStr 3 T0 nSampWords 6 [7.50.-1.1.1.2.4.1.22] -CscRawDataProvi... DEBUG cluster location word 0xf1e -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 31 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 0 24942 4 50 :: measphi1 L4 strId 31 nStr 3 T0 nSampWords 6 [7.50.-1.1.1.2.4.1.31] -CscRawDataProvi... DEBUG ****Total Cluster count = 11 for RPU ID 11 -CscRawDataProvi... DEBUG end of CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x82 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x82 25 9 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 9 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 50 -CscRawDataProvi... DEBUG RPU Header word 0x5000032 -CscRawDataProvi... DEBUG RPU ID original = 5 -CscRawDataProvi... DEBUG RPU ID Updated = 5 -CscRawDataProvi... DEBUG RPU size = 50 -CscRawDataProvi... DEBUG SCA Address = 269554195 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x102 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 1 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 2 -CscRawDataProvi... DEBUG Second cluster word 0x200002e -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 2 -CscRawDataProvi... DEBUG Cluster Data Words = 46 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 5 -CscRawDataProvi... DEBUG cluster location word 0x12c17 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 24 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 9 33431 7 51 :: measphi0 L3 strId 24 nStr 5 T0 nSampWords 10 [7.51.-1.2.1.2.3.0.24] -CscRawDataProvi... DEBUG cluster location word 0x12e16 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 23 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 9 33622 8 51 :: measphi0 L4 strId 23 nStr 3 T0 nSampWords 6 [7.51.-1.2.1.2.4.0.23] -CscRawDataProvi... DEBUG cluster location word 0x12e1a -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 27 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 9 33626 8 51 :: measphi0 L4 strId 27 nStr 3 T0 nSampWords 6 [7.51.-1.2.1.2.4.0.27] -CscRawDataProvi... DEBUG cluster location word 0x12d24 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 37 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 9 56004 9 51 :: measphi1 L3 strId 37 nStr 4 T0 nSampWords 8 [7.51.-1.2.1.2.3.1.37] -CscRawDataProvi... DEBUG cluster location word 0x12f24 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 37 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 9 56052 9 51 :: measphi1 L4 strId 37 nStr 3 T0 nSampWords 6 [7.51.-1.2.1.2.4.1.37] -CscRawDataProvi... DEBUG ****Total Cluster count = 5 for RPU ID 5 -CscRawDataProvi... DEBUG end of CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x83 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x83 17 1 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 1 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 116 -CscRawDataProvi... DEBUG RPU Header word 0xd000074 -CscRawDataProvi... DEBUG RPU ID original = 13 -CscRawDataProvi... DEBUG RPU ID Updated = 11 -CscRawDataProvi... DEBUG RPU size = 116 -CscRawDataProvi... DEBUG SCA Address = 1920169077 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x1010102 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 1 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 1 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 1 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 2 -CscRawDataProvi... DEBUG Second cluster word 0x6000070 -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 6 -CscRawDataProvi... DEBUG Cluster Data Words = 112 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 11 -CscRawDataProvi... DEBUG cluster location word 0x2818 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 25 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 2328 0 50 :: measphi0 L1 strId 25 nStr 4 T0 nSampWords 8 [7.50.-1.2.1.2.1.0.25] -CscRawDataProvi... DEBUG cluster location word 0x2a17 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000006 24 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 2519 1 50 :: measphi0 L2 strId 24 nStr 6 T0 nSampWords 12 [7.50.-1.2.1.2.2.0.24] -CscRawDataProvi... DEBUG cluster location word 0x2c17 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 24 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 2711 2 50 :: measphi0 L3 strId 24 nStr 5 T0 nSampWords 10 [7.50.-1.2.1.2.3.0.24] -CscRawDataProvi... DEBUG cluster location word 0x2e18 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 25 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 2904 3 50 :: measphi0 L4 strId 25 nStr 4 T0 nSampWords 8 [7.50.-1.2.1.2.4.0.25] -CscRawDataProvi... DEBUG cluster location word 0x2ebc -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 189 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 3068 3 50 :: measphi0 L4 strId 189 nStr 3 T0 nSampWords 6 [7.50.-1.2.1.2.4.0.189] -CscRawDataProvi... DEBUG cluster location word 0x2909 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 10 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 25161 4 50 :: measphi1 L1 strId 10 nStr 4 T0 nSampWords 8 [7.50.-1.2.1.2.1.1.10] -CscRawDataProvi... DEBUG cluster location word 0x2b09 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 10 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 25209 4 50 :: measphi1 L2 strId 10 nStr 5 T0 nSampWords 10 [7.50.-1.2.1.2.2.1.10] -CscRawDataProvi... DEBUG cluster location word 0x2d09 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 10 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 25257 4 50 :: measphi1 L3 strId 10 nStr 4 T0 nSampWords 8 [7.50.-1.2.1.2.3.1.10] -CscRawDataProvi... DEBUG cluster location word 0x2d16 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 23 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 25270 4 50 :: measphi1 L3 strId 23 nStr 3 T0 nSampWords 6 [7.50.-1.2.1.2.3.1.23] -CscRawDataProvi... DEBUG cluster location word 0x2f09 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 10 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 25305 4 50 :: measphi1 L4 strId 10 nStr 4 T0 nSampWords 8 [7.50.-1.2.1.2.4.1.10] -CscRawDataProvi... DEBUG cluster location word 0x2f28 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 41 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 1 25336 4 50 :: measphi1 L4 strId 41 nStr 3 T0 nSampWords 6 [7.50.-1.2.1.2.4.1.41] -CscRawDataProvi... DEBUG ****Total Cluster count = 11 for RPU ID 11 -CscRawDataProvi... DEBUG end of CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x84 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x84 26 10 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 10 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 114 -CscRawDataProvi... DEBUG RPU Header word 0x5000072 -CscRawDataProvi... DEBUG RPU ID original = 5 -CscRawDataProvi... DEBUG RPU ID Updated = 5 -CscRawDataProvi... DEBUG RPU size = 114 -CscRawDataProvi... DEBUG SCA Address = 1414878807 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x200 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 2 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 0 -CscRawDataProvi... DEBUG Second cluster word 0x400006e -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 4 -CscRawDataProvi... DEBUG Cluster Data Words = 110 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 6 -CscRawDataProvi... DEBUG cluster location word 0x14c03 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 4 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 10 34947 7 51 :: measphi0 L3 strId 4 nStr 5 T0 nSampWords 10 [7.51.-1.3.1.2.3.0.4] -CscRawDataProvi... DEBUG cluster location word 0x14c66 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000013 103 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 10 35046 7 51 :: measphi0 L3 strId 103 nStr 19 T0 nSampWords 38 [7.51.-1.3.1.2.3.0.103] -CscRawDataProvi... DEBUG cluster location word 0x1491b -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 28 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 10 56283 9 51 :: measphi1 L1 strId 28 nStr 3 T0 nSampWords 6 [7.51.-1.3.1.2.1.1.28] -CscRawDataProvi... DEBUG cluster location word 0x14d09 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000006 10 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 10 56361 9 51 :: measphi1 L3 strId 10 nStr 6 T0 nSampWords 12 [7.51.-1.3.1.2.3.1.10] -CscRawDataProvi... DEBUG cluster location word 0x14d1f -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 32 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 10 56383 9 51 :: measphi1 L3 strId 32 nStr 3 T0 nSampWords 6 [7.51.-1.3.1.2.3.1.32] -CscRawDataProvi... DEBUG cluster location word 0x14d23 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x1000000d 36 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 10 56387 9 51 :: measphi1 L3 strId 36 nStr 13 T0 nSampWords 26 [7.51.-1.3.1.2.3.1.36] -CscRawDataProvi... DEBUG ****Total Cluster count = 6 for RPU ID 5 -CscRawDataProvi... DEBUG end of CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x85 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x85 18 2 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 2 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 90 -CscRawDataProvi... DEBUG RPU Header word 0xd00005a -CscRawDataProvi... DEBUG RPU ID original = 13 -CscRawDataProvi... DEBUG RPU ID Updated = 11 -CscRawDataProvi... DEBUG RPU size = 90 -CscRawDataProvi... DEBUG SCA Address = 1482250843 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x20100 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 2 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 1 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 0 -CscRawDataProvi... DEBUG Second cluster word 0x4000056 -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 4 -CscRawDataProvi... DEBUG Cluster Data Words = 86 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 7 -CscRawDataProvi... DEBUG cluster location word 0x4a18 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000008 25 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 2 4056 1 50 :: measphi0 L2 strId 25 nStr 8 T0 nSampWords 16 [7.50.-1.3.1.2.2.0.25] -CscRawDataProvi... DEBUG cluster location word 0x4a3a -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 59 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 2 4090 1 50 :: measphi0 L2 strId 59 nStr 4 T0 nSampWords 8 [7.50.-1.3.1.2.2.0.59] -CscRawDataProvi... DEBUG cluster location word 0x4c1a -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000006 27 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 2 4250 2 50 :: measphi0 L3 strId 27 nStr 6 T0 nSampWords 12 [7.50.-1.3.1.2.3.0.27] -CscRawDataProvi... DEBUG cluster location word 0x4b11 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 18 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 2 25601 4 50 :: measphi1 L2 strId 18 nStr 3 T0 nSampWords 6 [7.50.-1.3.1.2.2.1.18] -CscRawDataProvi... DEBUG cluster location word 0x4b18 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 25 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 2 25608 4 50 :: measphi1 L2 strId 25 nStr 5 T0 nSampWords 10 [7.50.-1.3.1.2.2.1.25] -CscRawDataProvi... DEBUG cluster location word 0x4b1e -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 31 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 2 25614 4 50 :: measphi1 L2 strId 31 nStr 5 T0 nSampWords 10 [7.50.-1.3.1.2.2.1.31] -CscRawDataProvi... DEBUG cluster location word 0x4d14 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 21 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 2 25652 4 50 :: measphi1 L3 strId 21 nStr 5 T0 nSampWords 10 [7.50.-1.3.1.2.3.1.21] -CscRawDataProvi... DEBUG ****Total Cluster count = 7 for RPU ID 11 -CscRawDataProvi... DEBUG end of CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x86 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x86 27 11 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 11 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 58 -CscRawDataProvi... DEBUG RPU Header word 0x500003a -CscRawDataProvi... DEBUG RPU ID original = 5 -CscRawDataProvi... DEBUG RPU ID Updated = 5 -CscRawDataProvi... DEBUG RPU size = 58 -CscRawDataProvi... DEBUG SCA Address = 151653132 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x201 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 2 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 1 -CscRawDataProvi... DEBUG Second cluster word 0x1000036 -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 1 -CscRawDataProvi... DEBUG Cluster Data Words = 54 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 4 -CscRawDataProvi... DEBUG cluster location word 0x16c2f -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 48 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 11 36527 7 51 :: measphi0 L3 strId 48 nStr 3 T0 nSampWords 6 [7.51.-1.4.1.2.3.0.48] -CscRawDataProvi... DEBUG cluster location word 0x16c56 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000008 87 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 11 36566 7 51 :: measphi0 L3 strId 87 nStr 8 T0 nSampWords 16 [7.51.-1.4.1.2.3.0.87] -CscRawDataProvi... DEBUG cluster location word 0x16e57 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000007 88 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 11 36759 8 51 :: measphi0 L4 strId 88 nStr 7 T0 nSampWords 14 [7.51.-1.4.1.2.4.0.88] -CscRawDataProvi... DEBUG cluster location word 0x16f04 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 5 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 11 56788 9 51 :: measphi1 L4 strId 5 nStr 5 T0 nSampWords 10 [7.51.-1.4.1.2.4.1.5] -CscRawDataProvi... DEBUG ****Total Cluster count = 4 for RPU ID 5 -CscRawDataProvi... DEBUG end of CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x87 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x87 19 3 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 3 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 92 -CscRawDataProvi... DEBUG RPU Header word 0xd00005c -CscRawDataProvi... DEBUG RPU ID original = 13 -CscRawDataProvi... DEBUG RPU ID Updated = 11 -CscRawDataProvi... DEBUG RPU size = 92 -CscRawDataProvi... DEBUG SCA Address = 404298267 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x1010101 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 1 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 1 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 1 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 1 -CscRawDataProvi... DEBUG Second cluster word 0x6000058 -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 6 -CscRawDataProvi... DEBUG Cluster Data Words = 88 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 10 -CscRawDataProvi... DEBUG cluster location word 0x6855 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 86 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 5461 0 50 :: measphi0 L1 strId 86 nStr 4 T0 nSampWords 8 [7.50.-1.4.1.2.1.0.86] -CscRawDataProvi... DEBUG cluster location word 0x6a7c -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 125 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 5692 1 50 :: measphi0 L2 strId 125 nStr 3 T0 nSampWords 6 [7.50.-1.4.1.2.2.0.125] -CscRawDataProvi... DEBUG cluster location word 0x6c77 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 120 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 5879 2 50 :: measphi0 L3 strId 120 nStr 5 T0 nSampWords 10 [7.50.-1.4.1.2.3.0.120] -CscRawDataProvi... DEBUG cluster location word 0x6e71 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 114 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 6065 3 50 :: measphi0 L4 strId 114 nStr 3 T0 nSampWords 6 [7.50.-1.4.1.2.4.0.114] -CscRawDataProvi... DEBUG cluster location word 0x691b -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 28 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 25947 4 50 :: measphi1 L1 strId 28 nStr 3 T0 nSampWords 6 [7.50.-1.4.1.2.1.1.28] -CscRawDataProvi... DEBUG cluster location word 0x691f -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 32 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 25951 4 50 :: measphi1 L1 strId 32 nStr 3 T0 nSampWords 6 [7.50.-1.4.1.2.1.1.32] -CscRawDataProvi... DEBUG cluster location word 0x6924 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 37 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 25956 4 50 :: measphi1 L1 strId 37 nStr 3 T0 nSampWords 6 [7.50.-1.4.1.2.1.1.37] -CscRawDataProvi... DEBUG cluster location word 0x6b17 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 24 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 25991 4 50 :: measphi1 L2 strId 24 nStr 3 T0 nSampWords 6 [7.50.-1.4.1.2.2.1.24] -CscRawDataProvi... DEBUG cluster location word 0x6d17 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000004 24 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 26039 4 50 :: measphi1 L3 strId 24 nStr 4 T0 nSampWords 8 [7.50.-1.4.1.2.3.1.24] -CscRawDataProvi... DEBUG cluster location word 0x6f2a -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 43 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 3 26106 4 50 :: measphi1 L4 strId 43 nStr 3 T0 nSampWords 6 [7.50.-1.4.1.2.4.1.43] -CscRawDataProvi... DEBUG ****Total Cluster count = 10 for RPU ID 11 -CscRawDataProvi... DEBUG end of CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() -CscRawDataProvi... DEBUG in CscROD_Decoder::fillCollection :ROD version 401 -CscRawDataProvi... DEBUG -CscRawDataProvi... DEBUG =================================================== -CscRawDataProvi... DEBUG in CscROD_Decode::fillCollection() - ROD version 2 -CscRawDataProvi... DEBUG DetDescr tag = ATLAS-R2-2016-01-00-01 -CscRawDataProvi... DEBUG Online ROD id is 0x88 -CscRawDataProvi... DEBUG Online ROD / ROD / collection / subDetector IDs are 0x88 28 12 106 -CscRawDataProvi... DEBUG CSC RDO collection does not exist - creating a new one with hash = 12 -CscRawDataProvi... DEBUG Event Type: 5407e04 -CscRawDataProvi... DEBUG Sampling Time: 50 Number of Samples: 4 -CscRawDataProvi... DEBUG Is Calibration Enabled?: 0 Calibration Amplitude: 5 -CscRawDataProvi... DEBUG Calibration Layer: 0 Latency: 126 -CscRawDataProvi... DEBUG Is neutron rejection ON?: 0 Is sparsified data?: 1 -CscRawDataProvi... DEBUG CscROD_Decoder Total words received = 74 -CscRawDataProvi... DEBUG RPU Header word 0x500004a -CscRawDataProvi... DEBUG RPU ID original = 5 -CscRawDataProvi... DEBUG RPU ID Updated = 5 -CscRawDataProvi... DEBUG RPU size = 74 -CscRawDataProvi... DEBUG SCA Address = 1499093852 -CscRawDataProvi... DEBUG Number of Precision Cluster word 0x2000001 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 0 Cluster Counts = 2 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 1 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 2 Cluster Counts = 0 -CscRawDataProvi... DEBUG Number of precision Cluster Counts - Layer Index = 3 Cluster Counts = 1 -CscRawDataProvi... DEBUG Second cluster word 0x5000046 -CscRawDataProvi... DEBUG Summed Number of Clusters for non-precision layers 5 -CscRawDataProvi... DEBUG Cluster Data Words = 70 -CscRawDataProvi... DEBUG Total summed Cluster Count for precision and non-precision layers = 8 -CscRawDataProvi... DEBUG cluster location word 0x18831 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 50 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 12 37681 5 51 :: measphi0 L1 strId 50 nStr 3 T0 nSampWords 6 [7.51.-1.5.1.2.1.0.50] -CscRawDataProvi... DEBUG cluster location word 0x188ab -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 172 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 12 37803 5 51 :: measphi0 L1 strId 172 nStr 3 T0 nSampWords 6 [7.51.-1.5.1.2.1.0.172] -CscRawDataProvi... DEBUG cluster location word 0x18e03 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000005 4 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 12 38211 8 51 :: measphi0 L4 strId 4 nStr 5 T0 nSampWords 10 [7.51.-1.5.1.2.4.0.4] -CscRawDataProvi... DEBUG cluster location word 0x18908 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 9 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 12 57032 9 51 :: measphi1 L1 strId 9 nStr 3 T0 nSampWords 6 [7.51.-1.5.1.2.1.1.9] -CscRawDataProvi... DEBUG cluster location word 0x1892e -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000002 47 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 12 57070 9 51 :: measphi1 L1 strId 47 nStr 2 T0 nSampWords 4 [7.51.-1.5.1.2.1.1.47] -CscRawDataProvi... DEBUG cluster location word 0x18b00 -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000002 1 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 12 57072 9 51 :: measphi1 L2 strId 1 nStr 2 T0 nSampWords 4 [7.51.-1.5.1.2.2.1.1] -CscRawDataProvi... DEBUG cluster location word 0x18d0d -CscRawDataProvi... DEBUG cluster time size word : stripId (CscIdHelper) 0x10000003 14 -CscRawDataProvi... DEBUG idColl clusHashid spuID stationId :: 12 57133 9 51 :: measphi1 L3 strId 14 nStr 3 T0 nSampWords 6 [7.51.-1.5.1.2.3.1.14] -CscRawDataProvi... DEBUG cluster location word 0x18f1c -CscRawDataProvi...WARNING DEBUG message limit (500) reached for CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder. Suppressing further output. -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186525031, run #327265 1 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186524665, run #327265 1 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186524665, run #327265 2 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186542447, run #327265 2 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186542447, run #327265 3 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186543405, run #327265 3 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186543405, run #327265 4 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186548387, run #327265 4 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186548387, run #327265 5 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186515186, run #327265 5 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186515186, run #327265 6 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186556019, run #327265 6 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186556019, run #327265 7 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186542866, run #327265 7 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186542866, run #327265 8 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186537901, run #327265 8 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186537901, run #327265 9 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186517811, run #327265 9 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186517811, run #327265 10 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186534221, run #327265 10 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186534221, run #327265 11 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186540986, run #327265 11 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186540986, run #327265 12 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186535104, run #327265 12 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186535104, run #327265 13 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186539903, run #327265 13 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186539903, run #327265 14 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186552713, run #327265 14 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186552713, run #327265 15 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186524730, run #327265 15 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186524730, run #327265 16 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186547632, run #327265 16 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186547632, run #327265 17 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186555621, run #327265 17 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186555621, run #327265 18 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186568452, run #327265 18 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186568452, run #327265 19 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186580451, run #327265 19 events processed so far <<<=== -MdtRawDataProvi...VERBOSE convert(): 264 ROBFragments. -MdtRawDataProvi... DEBUG Created container using cache for MdtCsmCache -MdtRawDataProvi... DEBUG After processing numColls=1136 -CscRawDataProvi...VERBOSE Number of ROB ids 32 -CscRawDataProvi...VERBOSE Number of ROB fragments 32 -CscRawDataProvi... DEBUG Created container using cache for CscCache -CscRawDataProvi... DEBUG Before processing numColls=0 -CscRawDataProvi... DEBUG vector of ROB ID to decode: size = 32 -CscRawDataProvi... DEBUG After processing numColls=32 -AthenaEventLoopMgr INFO ===>>> done processing event #186580451, run #327265 20 events processed so far <<<=== -Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] -ApplicationMgr INFO Application Manager Stopped successfully -IncidentProcAlg1 INFO Finalize -CondInputLoader INFO Finalizing CondInputLoader... -IncidentProcAlg2 INFO Finalize -AtlasFieldSvc INFO finalize() successful -EventInfoByteSt... INFO finalize -IdDictDetDescrCnv INFO in finalize -IOVDbFolder INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/2 objs/chan/bytes 4/4/20 (( 0.26 ))s -IOVDbFolder INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/1 objs/chan/bytes 3/3/202 (( 0.88 ))s -IOVDbFolder INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 (( 1.40 ))s -IOVDbFolder INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 (( 1.72 ))s -IOVDbFolder INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 (( 0.24 ))s -IOVDbFolder INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 (( 1.17 ))s -IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/222235 (( 0.12 ))s -IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/29402 (( 0.76 ))s -IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/1 objs/chan/bytes 1613/1613/7562651 (( 1.18 ))s -IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/1 objs/chan/bytes 1612/1612/8096306 (( 1.24 ))s -IOVDbFolder INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/3704 (( 0.03 ))s -IOVDbFolder INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 (( 0.94 ))s -IOVDbFolder INFO Folder /CSC/NOISE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/350062 (( 0.63 ))s -IOVDbFolder INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 (( 0.11 ))s -IOVDbFolder INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 (( 5.80 ))s -IOVDbFolder INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 (( 0.14 ))s -IOVDbFolder INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 (( 0.71 ))s -IOVDbFolder INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 (( 0.03 ))s -IOVDbFolder INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 (( 0.03 ))s -IOVDbSvc INFO bytes in (( 17.38 ))s -IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=CONDBR2 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 3.11 ))s -IOVDbSvc INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: (( 3.30 ))s -IOVDbSvc INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 1.41 ))s -IOVDbSvc INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: (( 8.38 ))s -IOVDbSvc INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.88 ))s -IOVDbSvc INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.03 ))s -IOVDbSvc INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.26 ))s -AthDictLoaderSvc INFO in finalize... -ToolSvc INFO Removing all tools created by ToolSvc -ToolSvc.ByteStr... INFO in finalize() -TgcRdoToTgcPrep... INFO finalize(): input RDOs->output PRDs [Hit: 6807->6807, Tracklet: 28->28, TrackletEIFI: 692->692, HiPt: 4031->4031, SL: 3->3] -RpcROD_Decoder:... INFO ============ FINAL RPC DATA FORMAT STAT. =========== -RpcROD_Decoder:... INFO RX Header Errors.............0 -RpcROD_Decoder:... INFO RX SubHeader Errors..........0 -RpcROD_Decoder:... INFO PAD Header Errors............0 -RpcROD_Decoder:... INFO PAD/SL SubHeader Errors......0 -RpcROD_Decoder:... INFO CM Header Errors.............0 -RpcROD_Decoder:... INFO CM SubHeader Errors..........0 -RpcROD_Decoder:... INFO CM Footer Errors.............0 -RpcROD_Decoder:... INFO PAD PreFooter Errors.........0 -RpcROD_Decoder:... INFO PAD Footer Errors............0 -RpcROD_Decoder:... INFO SL Header Errors.............0 -RpcROD_Decoder:... INFO SL Footer Errors.............0 -RpcROD_Decoder:... INFO RX Footer Errors.............0 -RpcROD_Decoder:... INFO CRC8 check Failures..........0 -RpcROD_Decoder:... INFO ==================================================== -ToolSvc.TGCCabl... INFO finalize -*****Chrono***** INFO **************************************************************************************************** -*****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) -*****Chrono***** INFO **************************************************************************************************** -cObj_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 20 -ChronoStatSvc INFO Time User : Tot= 10.5 [s] #= 1 -*****Chrono***** INFO **************************************************************************************************** -ChronoStatSvc.f... INFO Service finalized successfully -ApplicationMgr INFO Application Manager Finalized successfully -ApplicationMgr INFO Application Manager Terminated successfully -Listing sources of suppressed message: -===================================================== - Message Source | Level | Count ------------------------------+---------+------------- - CscRawDataProvider.CSC_RawDataProviderTool.CscROD_Decoder| DEBUG | 35169 - MdtRawDataProvider.MDT_RawDataProviderTool.MdtROD_Decoder| DEBUG | 854603 -===================================================== -Py:Athena INFO leaving with code 0: "successful run" +Traceback (most recent call last): + File "<string>", line 1, in <module> + File "/afs/cern.ch/user/s/shhayash/workspace/Development/GIT2019-03-20/build/x86_64-slc6-gcc8-opt/python/MuonConfig/MuonRdoDecodeConfig.py", line 184, in muonRdoDecodeTestData + rpcdecodingAcc, rpcdecodingAlg = RpcBytestreamDecodeCfg( ConfigFlags, forTrigger ) + File "/afs/cern.ch/user/s/shhayash/workspace/Development/GIT2019-03-20/build/x86_64-slc6-gcc8-opt/python/MuonConfig/MuonBytestreamDecodeConfig.py", line 59, in RpcBytestreamDecodeCfg + MuonRpcRawDataProviderTool.RpcContainerCacheKey = MuonCacheNames.RpcCache +AttributeError: 'Muon__RPC_RawDataProviderTool' object has no attribute 'RpcContainerCacheKey' +Exception RuntimeError: RuntimeError('ComponentAccumulator was not merged!',) in <bound method ComponentAccumulator.__del__ of <AthenaConfiguration.ComponentAccumulator.ComponentAccumulator object at 0x7f7b09b83e50>> ignored +Exception RuntimeError: RuntimeError('ComponentAccumulator was not merged!',) in <bound method ComponentAccumulator.__del__ of <AthenaConfiguration.ComponentAccumulator.ComponentAccumulator object at 0x7f7b0a9f1b50>> ignored +ERROR in configuration generation stage, stopping diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx index b13fb68c449880fc74f145ede820f391b27d1fc7..23dcd75650eb2e1c506b927da1a2695e95688c56 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx @@ -528,15 +528,13 @@ StatusCode sTgcDigitizationTool::doDigitization() { sTgcDigitCollection* digitCollection = 0; //output digits ATH_MSG_DEBUG("create PRD container of size " << m_idHelper->detectorElement_hash_max()); - + IdContext tgcContext = m_idHelper->module_context(); float earliestEventTime = 9999; // nextDetectorElement-->sets an iterator range with the hits of current detector element , returns a bool when done while(m_thpcsTGC->nextDetectorElement(i, e)) { -// std::map< Identifier, std::pair< std::pair<double, Amg::Vector3D>, const sTGCSimHit*> > merged_SimHit; - std::map< const sTGCSimHit*, int > SimHits; //std::map container to associate if this hit came from the signal (0) or pileup (!0) simEvent int nhits = 0; ATH_MSG_VERBOSE("Next Detector Element"); while(i != e){ //loop through the hits on this Detector Element @@ -567,7 +565,6 @@ StatusCode sTgcDigitizationTool::doDigitization() { int eventId = phit.eventId(); std::string stationName= m_idHelper->stationNameString(m_idHelper->stationName(layid)); int isSmall = stationName[2] == 'S'; -// int multiPlet = m_idHelper->multilayer(layid); int gasGap = m_idHelper->gasGap(layid); ATH_MSG_VERBOSE("Gas Gap " << gasGap ); @@ -628,45 +625,24 @@ StatusCode sTgcDigitizationTool::doDigitization() { ATH_MSG_VERBOSE("Local Hit on Wire Surface " << HITONSURFACE_WIRE ); ATH_MSG_VERBOSE("Global Hit on Wire Surface " << G_HITONSURFACE_WIRE ); - sTGCSimHit* wireHit = new sTGCSimHit(idHit, (hit.globalTime() + eventTime), G_HITONSURFACE_WIRE, hit.particleEncoding(), hit.globalDirection(), hit.depositEnergy() , hit.trackNumber() ); - SimHits[wireHit] = eventId; //Associate the sub event the hit came from - ATH_MSG_VERBOSE("Put hit number " << nhits << " into the map with eventID " << eventId ); - } // end of while(i != e) - - - ATH_MSG_DEBUG("sTgcDigitizationTool::doDigitization hits mapped"); + ATH_MSG_DEBUG("sTgcDigitizationTool::doDigitization hits mapped"); - // Loop over the hits: - int hitNum = 0; - typedef std::map< const sTGCSimHit*, int >::iterator it_SimHits; - - ATH_MSG_VERBOSE("Digitizing " << SimHits.size() << " hits."); - - for(it_SimHits it_SimHit = SimHits.begin(); it_SimHit!=SimHits.end(); it_SimHit++ ) { - hitNum++; - double depositEnergy = it_SimHit->first->depositEnergy(); - if(depositEnergy<0) { - msg(MSG::ERROR) << "Invalid depositEnergy value " << depositEnergy <<endmsg; - continue; - } - const sTGCSimHit temp_hit = *(it_SimHit->first); - - const sTGCSimHit hit(temp_hit.sTGCId(), temp_hit.globalTime(), - temp_hit.globalPosition(), - temp_hit.particleEncoding(), - temp_hit.globalDirection(), - depositEnergy, - temp_hit.particleLink() + const sTGCSimHit temp_hit(hit.sTGCId(), hit.globalTime(), + G_HITONSURFACE_WIRE, + hit.particleEncoding(), + hit.globalDirection(), + hit.depositEnergy(), + hit.particleLink() ); - float globalHitTime = hit.globalTime(); - float tof = hit.globalPosition().mag()/CLHEP::c_light; + float globalHitTime = temp_hit.globalTime() + eventTime; + float tof = temp_hit.globalPosition().mag()/CLHEP::c_light; float bunchTime = globalHitTime - tof; sTgcDigitCollection* digiHits = 0; - - digiHits = m_digitizer->executeDigi(&hit, globalHitTime); //Create all the digits for this particular Sim Hit + + digiHits = m_digitizer->executeDigi(&temp_hit, globalHitTime); //Create all the digits for this particular Sim Hit if(!digiHits) continue; @@ -709,10 +685,11 @@ StatusCode sTgcDigitizationTool::doDigitization() { bool isDead = 0; bool isPileup = 0; - ATH_MSG_VERBOSE("SimHits map second: " << it_SimHit->second << " newTime: " << newTime); - if(it_SimHit->second!= 0) //hit not from the main signal subevent + ATH_MSG_VERBOSE("Hit is from the main signal subevent if eventId is zero, eventId = " << eventId << " newTime: " << newTime); + if(eventId != 0) //hit not from the main signal subevent isPileup = 1; + ATH_MSG_VERBOSE("...Check time 5: " << newTime ); // Create a new digit with updated time and BCTag sTgcDigit* newDigit = new sTgcDigit(newDigitId, newBcTag, newTime, newCharge, isDead, isPileup); IdentifierHash coll_hash; //Hash defining the detector element @@ -750,9 +727,8 @@ StatusCode sTgcDigitizationTool::doDigitization() { } // end of loop digiHits delete digiHits; digiHits = 0; - }// end of loop(merged_SimHit) - SimHits.clear(); - }//while(m_thpcsTGC->nextDetectorElement(i, e)) + } // end of while(i != e) + } //end of while(m_thpcsTGC->nextDetectorElement(i, e)) /********************* * Process Pad Digits * diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx index b840fc19287f06f7eb5872d2af1ef97ea8f89504..37e317f134bec1c67183592a50c45f3e6d63c484 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx @@ -173,7 +173,11 @@ StatusCode RoIBResultToxAOD::createEmTauRoI( const ROIB::RoIBResult& result, xAOD::CPMTowerMap_t cpmtowers; if( m_emTauTool.isEnabled() && ( ! m_cpmTowerKey.key().empty() ) ) { auto cpmTower = SG::makeHandle( m_cpmTowerKey, ctx ); - m_emTauTool->mapTowers( cpmTower.cptr(), &cpmtowers ); + if (cpmTower.isValid()) { + m_emTauTool->mapTowers( cpmTower.cptr(), &cpmtowers ); + } else { + ATH_MSG_DEBUG( "No CPMTowerCollection found at " << m_cpmTowerKey.key() ); + } } // reconstruct ROI @@ -324,7 +328,11 @@ RoIBResultToxAOD::createJetEnergyRoI( const ROIB::RoIBResult& result, std::map< int, LVL1::JetInput* > jetInputs; if( m_jetTool.isEnabled() && ( ! m_jetElementKey.key().empty() ) ) { auto jetElement = SG::makeHandle( m_jetElementKey, ctx ); - m_jetTool->mapJetInputs( jetElement.cptr(), &jetInputs ); + if (jetElement.isValid()) { + m_jetTool->mapJetInputs( jetElement.cptr(), &jetInputs ); + } else { + ATH_MSG_DEBUG( "No JetElementContainer found at " << m_jetElementKey.key() ); + } } std::vector< std::unique_ptr< LVL1::JetInput > > jetInputsHolder; for( auto pair : jetInputs ) { diff --git a/Reconstruction/egamma/egammaTools/src/ConvVxSorter.h b/Reconstruction/egamma/egammaTools/src/ConvVxSorter.h deleted file mode 100644 index 5ebdd018edcb22d171fe3f92fe00358740b16c71..0000000000000000000000000000000000000000 --- a/Reconstruction/egamma/egammaTools/src/ConvVxSorter.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef EGAMMATOOLS_CONVVXSORTER_H -#define EGAMMATOOLS_CONVVXSORTER_H - -#include "xAODTracking/Vertex.h" -#include "xAODEgamma/EgammaxAODHelpers.h" - -/** Sort conversion vertices according to the following criteria: - - Vertices with more Si tracks have priority - - Vertices with more tracks have priority - - Vertices with smaller radii have priority - - OLD SCHEME: - - Vertices with 2 tracks have priority over the ones with 1 track - - Vertices with Si + Si tracks have priority (if m_preferSi > 0) - - Vertices with Si + TRT or TRT + TRT depending on m_preferSi - - Vertices with smaller radii have priority - **/ -class ConvVxSorter -: public std::binary_function<xAOD::Vertex&, xAOD::Vertex&, bool> { - public: - bool operator()(const xAOD::Vertex& vx1, const xAOD::Vertex& vx2) const - { - xAOD::EgammaParameters::ConversionType convType1, convType2; - convType1 = xAOD::EgammaHelpers::conversionType(&vx1); - convType2 = xAOD::EgammaHelpers::conversionType(&vx2); - - if (convType1 != convType2) - { - // Different conversion type, preference to vertices with Si tracks - int nSi1 = xAOD::EgammaHelpers::numberOfSiTracks(convType1); - int nSi2 = xAOD::EgammaHelpers::numberOfSiTracks(convType2); - if (nSi1 != nSi2) return nSi1 > nSi2; - - // Same number of Si tracks: either 0 or 1 (Si+TRT vs. Si single) - // For 1 Si track, preference to Si+TRT - if (nSi1 != 0) return convType1 == xAOD::EgammaParameters::doubleSiTRT; - - // No Si track, preference to doubleTRT over single TRT - return convType1 == xAOD::EgammaParameters::doubleTRT; - } - - // Same conversion type, preference to lower radius - return (vx1.position().perp() < vx2.position().perp()); - } - -}; - -#endif diff --git a/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx index 6c5b126f056763ce9fed537d9eba4b5b472f2553..1351946c5017bdc104c600f261421196cc951318 100644 --- a/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx +++ b/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -18,17 +18,57 @@ PURPOSE: subAlgorithm which creates an EMConversion object. // INCLUDE HEADER FILES: #include "EMConversionBuilder.h" -#include "ConvVxSorter.h" #include "xAODTracking/VertexContainer.h" #include "egammaRecEvent/egammaRecContainer.h" #include "egammaRecEvent/egammaRec.h" #include "FourMomUtils/P4Helpers.h" #include "StoreGate/ReadHandle.h" #include "GaudiKernel/EventContext.h" +#include "xAODTracking/Vertex.h" +#include "xAODEgamma/EgammaxAODHelpers.h" + // END OF HEADER FILES INCLUDE ///////////////////////////////////////////////////////////////// +namespace { + /** Sort conversion vertices according to the following criteria: + - Vertices with more Si tracks have priority + - Vertices with more tracks have priority + - Vertices with smaller radii have priority + + OLD SCHEME: + - Vertices with 2 tracks have priority over the ones with 1 track + - Vertices with Si + Si tracks have priority (if m_preferSi > 0) + - Vertices with Si + TRT or TRT + TRT depending on m_preferSi + - Vertices with smaller radii have priority + **/ + bool ConvVxSorter (const xAOD::Vertex& vx1, const xAOD::Vertex& vx2) + { + xAOD::EgammaParameters::ConversionType convType1, convType2; + convType1 = xAOD::EgammaHelpers::conversionType(&vx1); + convType2 = xAOD::EgammaHelpers::conversionType(&vx2); + + if (convType1 != convType2) + { + // Different conversion type, preference to vertices with Si tracks + int nSi1 = xAOD::EgammaHelpers::numberOfSiTracks(convType1); + int nSi2 = xAOD::EgammaHelpers::numberOfSiTracks(convType2); + if (nSi1 != nSi2) return nSi1 > nSi2; + + // Same number of Si tracks: either 0 or 1 (Si+TRT vs. Si single) + // For 1 Si track, preference to Si+TRT + if (nSi1 != 0) return convType1 == xAOD::EgammaParameters::doubleSiTRT; + + // No Si track, preference to doubleTRT over single TRT + return convType1 == xAOD::EgammaParameters::doubleTRT; + } + + // Same conversion type, preference to lower radius + return (vx1.position().perp() < vx2.position().perp()); + } +} // end of namespace + using namespace xAOD::EgammaParameters; EMConversionBuilder::EMConversionBuilder(const std::string& type, @@ -125,7 +165,7 @@ StatusCode EMConversionBuilder::vertexExecute(egammaRec* egRec, const xAOD::Vert const ElementLink< xAOD::VertexContainer > vertexLink( *conversions, iVtx ); // If this is the best (or the first) vertex, push front and keep deltaEta, deltaPhi - if (!egRec->getNumberOfVertices() || ConvVxSorter()(*vertex, *egRec->vertex())){ + if (!egRec->getNumberOfVertices() || ConvVxSorter(*vertex, *egRec->vertex())){ egRec->pushFrontVertex( vertexLink ); egRec->setDeltaEtaVtx( cluster->etaBE(2) - etaAtCalo ); egRec->setDeltaPhiVtx( P4Helpers::deltaPhi(cluster->phiBE(2), phiAtCalo) ); diff --git a/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.cxx index 0a6ed6213fc2312f5867ec4557220e77a2ddaad2..105114f834b2c7187cbccfc4a9ddc7e8b8cb75e5 100644 --- a/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.cxx +++ b/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // INCLUDE HEADER FILES: @@ -151,7 +151,7 @@ StatusCode EMTrackMatchBuilder::trackExecute(const EventContext& ctx, egammaRec* if(trkMatches.size()>0) { //sort the track matches - std::sort(trkMatches.begin(), trkMatches.end(), TrackMatchSorter()); + std::sort(trkMatches.begin(), trkMatches.end(), TrackMatchSorter); //set the matching values @@ -502,5 +502,28 @@ EMTrackMatchBuilder::isCandidateMatch(const xAOD::CaloCluster* cluster, return true; } +bool EMTrackMatchBuilder::TrackMatchSorter(const EMTrackMatchBuilder::TrackMatch& match1, + const EMTrackMatchBuilder::TrackMatch& match2) +{ + + if(match1.score!= match2.score) {//Higher score + return match1.score>match2.score; + } + //sqrt(0.025**2)*sqrt(2)/sqrt(12) ~ 0.01 + if(fabs(match1.dR-match2.dR)<1e-02) { + + if(fabs(match1.seconddR-match2.seconddR)>1e-02 ){ //Can the second distance separate them? + return match1.seconddR < match2.seconddR ; + } + + if((match1.hitsScore!= match2.hitsScore)){ //use the one with more pixel + return match1.hitsScore>match2.hitsScore; + } + + } + + //closest DR + return match1.dR < match2.dR ; +} diff --git a/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.h b/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.h index 46fcd9c570fa7a9c04a437f47fa069d15f5fbfe0..aeddafe3bcfd7f2e918d54c525f993c4293c2ed3 100644 --- a/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.h +++ b/Reconstruction/egamma/egammaTools/src/EMTrackMatchBuilder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef EGAMMATOOLS_EMTRACKMATCHBUILDER_H @@ -19,7 +19,6 @@ The matching of a track to a cluster is driven by the EMTrackMatchBuilder tool l #include "AthenaBaseComps/AthAlgTool.h" #include "egammaInterfaces/IEMTrackMatchBuilder.h" #include "egammaInterfaces/IEMExtrapolationTools.h" -#include "TrackMatchSorter.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/EventContext.h" @@ -54,6 +53,25 @@ class EMTrackMatchBuilder : public AthAlgTool, virtual public IEMTrackMatchBuild private: + /** @brief A structure for keeping track match information */ + struct TrackMatch + { + public: + int trackNumber; + double dR; + double seconddR; + bool isTRT; + int score; + int hitsScore; + double deltaPhiLast; + double deltaEta[4]; + double deltaPhi[4]; + double deltaPhiRescaled[4]; + }; + + /** @brief function to sort track matches based on quality */ + static bool TrackMatchSorter(const TrackMatch& match1, const TrackMatch& match2); + /** @brief Compute for tracks passing the loose matching the distance between track extrapolated to 2nd sampling and cluster */ bool inBroadWindow(const EventContext& ctx, diff --git a/Reconstruction/egamma/egammaTools/src/TrackMatchSorter.h b/Reconstruction/egamma/egammaTools/src/TrackMatchSorter.h deleted file mode 100644 index b4da016a9b0ba355d2b69463790aeb28226f6569..0000000000000000000000000000000000000000 --- a/Reconstruction/egamma/egammaTools/src/TrackMatchSorter.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef EGAMMATOOLS_TRACKMATCHSORTER_H -#define EGAMMATOOLS_TRACKMATCHSORTER_H -class egammaRec; - -struct TrackMatch -{ - public: - int trackNumber; - double dR; - double seconddR; - bool isTRT; - int score; - int hitsScore; - double deltaPhiLast; - double deltaEta[4]; - double deltaPhi[4]; - double deltaPhiRescaled[4]; - -}; - -class TrackMatchSorter -: public std::binary_function<TrackMatch, TrackMatch, bool> { - public: - bool operator()(const TrackMatch& match1, const TrackMatch& match2) const - { - - if(match1.score!= match2.score) {//Higher score - return match1.score>match2.score; - } - //sqrt(0.025**2)*sqrt(2)/sqrt(12) ~ 0.01 - if(fabs(match1.dR-match2.dR)<1e-02) { - - if(fabs(match1.seconddR-match2.seconddR)>1e-02 ){ //Can the second distance separate them? - return match1.seconddR < match2.seconddR ; - } - - if((match1.hitsScore!= match2.hitsScore)){ //use the one with more pixel - return match1.hitsScore>match2.hitsScore; - } - - } - - //closest DR - return match1.dR < match2.dR ; - } -}; - -#endif diff --git a/Simulation/BeamEffects/python/SimulationFlags.py b/Simulation/BeamEffects/python/SimulationFlags.py index 0a3fef6231ffb9ae6d0875eb10fe298ae184b225..ac6263f012fe86d8752b9a52deb7bd66bc849987 100644 --- a/Simulation/BeamEffects/python/SimulationFlags.py +++ b/Simulation/BeamEffects/python/SimulationFlags.py @@ -11,10 +11,6 @@ def _createCfgFlags(): # e.g. 'CondDB', 'VertexOverrideEventFile.txt', 'VertexOverride.txt',"LongBeamspot" acf.addFlag('Vertex.Source', 'CondDB' ) - # Name of the random number service to use - # of ("dSFMT", "Ranlux64", "Ranecu",) - acf.addFlag("Random.Engine", "dSFMT") - return acf diff --git a/Simulation/FastShower/FastCaloSim/CMakeLists.txt b/Simulation/FastShower/FastCaloSim/CMakeLists.txt index 1d727ea72394b787da1d491e9af12e9c8f5ffa5c..e8da8b3bd1a93648232f65afbceda3ace80ad106 100644 --- a/Simulation/FastShower/FastCaloSim/CMakeLists.txt +++ b/Simulation/FastShower/FastCaloSim/CMakeLists.txt @@ -64,6 +64,7 @@ atlas_add_root_dictionary( FastCaloSimLib EXTERNAL_PACKAGES ROOT HepPDT CLHEP HepMC Eigen ) atlas_add_library( FastCaloSimLib + src/CaloCellContainerFCSFinalizerTool.cxx src/AddNoiseCellBuilderTool.cxx src/BasicCellBuilderTool.cxx src/EmptyCellBuilderTool.cxx diff --git a/Simulation/FastShower/FastCaloSim/FastCaloSim/CaloCellContainerFCSFinalizerTool.h b/Simulation/FastShower/FastCaloSim/FastCaloSim/CaloCellContainerFCSFinalizerTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e5cfecc4f49d855c7d4b61db09bc8fac2644a04a --- /dev/null +++ b/Simulation/FastShower/FastCaloSim/FastCaloSim/CaloCellContainerFCSFinalizerTool.h @@ -0,0 +1,37 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. + +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + + +#ifndef CALOCELLCONTAINERFCSFINALIZERTOOL_H +#define CALOCELLCONTAINERFCSFINALIZERTOOL_H + +#include "AthenaBaseComps/AthAlgTool.h" + +#include "CaloInterface/ICaloCellMakerTool.h" +#include "CaloInterface/ICaloConstCellMakerTool.h" + +class CaloCellContainerFCSFinalizerTool + : public extends<AthAlgTool, ICaloCellMakerTool, ICaloConstCellMakerTool> +{ +public: + CaloCellContainerFCSFinalizerTool(const std::string& type, + const std::string& name, + const IInterface* parent) ; + + + // update theCellContainer + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; + virtual StatusCode process (CaloConstCellContainer* theCellContainer, + const EventContext& ctx) const override; + +private: + template <class CONTAINER> + StatusCode doProcess (CONTAINER* theCellContainer) const; +}; + +#endif + diff --git a/Simulation/FastShower/FastCaloSim/src/CaloCellContainerFCSFinalizerTool.cxx b/Simulation/FastShower/FastCaloSim/src/CaloCellContainerFCSFinalizerTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2a9507522c5624c6dbad3c2a2a79b6c7b5e3c0d8 --- /dev/null +++ b/Simulation/FastShower/FastCaloSim/src/CaloCellContainerFCSFinalizerTool.cxx @@ -0,0 +1,72 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +/******************************************************************** + +NAME: CaloCellContainerFCSFinalizerTool +PACKAGE: athena/Simulation/FastShower/FastCaloSim + +AUTHORS: David Rousseau (modified by Xiaozhong Huang) +CREATED: Jan 25,2019 + +PURPOSE: Apply necessary finalising operation to CaloCellContainer + Remove any checks since the CaloCellContainer is complete + and ordered from the beginning +********************************************************************/ + +#include "FastCaloSim/CaloCellContainerFCSFinalizerTool.h" + +#include "GaudiKernel/Service.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/Property.h" +#include "GaudiKernel/ListItem.h" + +#include "StoreGate/StoreGateSvc.h" + + +#include "CaloEvent/CaloCellContainer.h" +#include "CaloEvent/CaloConstCellContainer.h" +#include "CaloDetDescr/CaloDetDescrManager.h" +#include "CaloIdentifier/CaloCell_ID.h" + + +///////////////////////////////////////////////////////////////////// +// CONSTRUCTOR: +///////////////////////////////////////////////////////////////////// + +CaloCellContainerFCSFinalizerTool::CaloCellContainerFCSFinalizerTool( + const std::string& type, + const std::string& name, + const IInterface* parent) + :base_class(type, name, parent) +{ +} + + +template <class CONTAINER> +StatusCode CaloCellContainerFCSFinalizerTool::doProcess(CONTAINER* theCont ) const +{ + + theCont->updateCaloIterators(); + + return StatusCode::SUCCESS; +} + + +StatusCode +CaloCellContainerFCSFinalizerTool::process (CaloCellContainer * theCont, + const EventContext& /*ctx*/) const +{ + CHECK( doProcess (theCont) ); + return StatusCode::SUCCESS; +} + + +StatusCode +CaloCellContainerFCSFinalizerTool::process (CaloConstCellContainer * theCont, + const EventContext& /*ctx*/) const +{ + // Container will automatically be locked when recorded. + return doProcess (theCont); +} diff --git a/Simulation/FastShower/FastCaloSim/src/EmptyCellBuilderTool.cxx b/Simulation/FastShower/FastCaloSim/src/EmptyCellBuilderTool.cxx index 44d894db31e943f195b558dde2c98496bd3bb142..095d86fcb9f80d77c23c2a53b620418b4a30830b 100755 --- a/Simulation/FastShower/FastCaloSim/src/EmptyCellBuilderTool.cxx +++ b/Simulation/FastShower/FastCaloSim/src/EmptyCellBuilderTool.cxx @@ -121,7 +121,42 @@ void EmptyCellBuilderTool::create_empty_calo(const EventContext& ctx, } log << MSG::DEBUG << ncreate<<" cells created, "<<nfound<<" cells already found: size="<<theCellContainer->size()<<" e="<<E_tot<<" ; et="<<Et_tot<<". Now initialize and order calo..." << endmsg; - theCellContainer->order(); + + // check whether has max hash id size + const CaloCell_ID * theCaloCCIDM = m_caloDDM->getCaloCell_ID() ; + unsigned int hashMax=theCaloCCIDM->calo_cell_hash_max(); + if (theCellContainer->size()<hashMax) { + ATH_MSG_DEBUG("CaloCellContainer size " << theCellContainer->size() << " smaller than hashMax: " << hashMax); + } + else if (theCellContainer->size()==hashMax) { + ATH_MSG_DEBUG("CaloCellContainer size " << theCellContainer->size() << " correspond to hashMax : " << hashMax); + theCellContainer->setHasTotalSize(true); + } + else { + ATH_MSG_WARNING("CaloCellContainer size " << theCellContainer->size() + << " larger than hashMax ! Too many cells ! " << hashMax); + + } + + // check whether in order and complete + if (theCellContainer->checkOrderedAndComplete()){ + ATH_MSG_DEBUG("CaloCellContainer ordered and complete"); + theCellContainer->setIsOrderedAndComplete(true); + theCellContainer->setIsOrdered(true); + } else { + ATH_MSG_DEBUG("CaloCellContainer not ordered or incomplete"); + theCellContainer->setIsOrderedAndComplete(false); + // check whether in order + if (theCellContainer->checkOrdered()){ + ATH_MSG_DEBUG("CaloCellContainer ordered"); + theCellContainer->setIsOrdered(true); + } else { + ATH_MSG_DEBUG("CaloCellContainer not ordered"); + theCellContainer->setIsOrdered(false); + } + } + + if (!theCellContainer->isOrdered()) theCellContainer->order(); #if FastCaloSim_project_release_v1 == 12 #else diff --git a/Simulation/FastShower/FastCaloSim/src/components/FastCaloSim_entries.cxx b/Simulation/FastShower/FastCaloSim/src/components/FastCaloSim_entries.cxx index 777746598016a4af86f0a38cabd872cb86151c0f..01ab2c3c2b9a8be5e8554a0897957de67794e902 100644 --- a/Simulation/FastShower/FastCaloSim/src/components/FastCaloSim_entries.cxx +++ b/Simulation/FastShower/FastCaloSim/src/components/FastCaloSim_entries.cxx @@ -2,6 +2,7 @@ #include "FastCaloSim/EmptyCellBuilderTool.h" #include "FastCaloSim/AddNoiseCellBuilderTool.h" #include "FastCaloSim/FSStoregateClean.h" +#include "FastCaloSim/CaloCellContainerFCSFinalizerTool.h" //#include "FastCaloSim/FSRedoCBNT.h" //#include "FastCaloSim/CBNTAA_DetailedCellInfo.h" @@ -11,5 +12,6 @@ DECLARE_COMPONENT( FastCaloSim::FSStoregateClean ) DECLARE_COMPONENT( FastShowerCellBuilderTool ) DECLARE_COMPONENT( EmptyCellBuilderTool ) DECLARE_COMPONENT( AddNoiseCellBuilderTool ) +DECLARE_COMPONENT( CaloCellContainerFCSFinalizerTool ) //DECLARE_COMPONENT( CBNTAA_DetailedCellInfo ) diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfig.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfig.py index 99b8dd896dbf67d99e49cf5416407dd2f7870b5d..7f6dfb730a4ae47e2ee7a87ed876c9fefb50a7d5 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfig.py +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfig.py @@ -860,6 +860,10 @@ def getCaloCellContainerFinalizerTool(name="ISF_CaloCellContainerFinalizerTool", from CaloRec.CaloRecConf import CaloCellContainerFinalizerTool return CaloCellContainerFinalizerTool(name, **kwargs ) +def getCaloCellContainerFCSFinalizerTool(name="ISF_CaloCellContainerFCSFinalizerTool", **kwargs): + from FastCaloSim.FastCaloSimConf import CaloCellContainerFCSFinalizerTool + return CaloCellContainerFCSFinalizerTool(name, **kwargs ) + def getFastHitConvAlg(name="ISF_FastHitConvAlg", **kwargs): from ISF_FastCaloSimServices.ISF_FastCaloSimJobProperties import ISF_FastCaloSimFlags kwargs.setdefault("CaloCellsInputName" , ISF_FastCaloSimFlags.CaloCellsName() ) diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfig.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfig.py index 5c476d2d9a0f9fb1da5610053fbdefc4d33c3142..2cfc640f05f499f1d3961aa8759a748d1673d3e4 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfig.py +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfig.py @@ -27,7 +27,7 @@ def getLegacyAFIIFastCaloSimSvc(name="ISF_LegacyAFIIFastCaloSimSvc", **kwargs): def getFastHitConvAlgFastCaloSimSvc(name="ISF_FastHitConvAlgFastCaloSimSvc",**kwargs): kwargs.setdefault("CaloCellMakerTools_release", [ #'ISF_AddNoiseCellBuilderTool', - 'ISF_CaloCellContainerFinalizerTool' + 'ISF_CaloCellContainerFCSFinalizerTool' ] ) # setup FastCaloSim hit converter and add it to the alg sequence: # -> creates HITS from reco cells @@ -57,7 +57,7 @@ def getFastCaloSimPileupOTSvc(name="ISF_FastCaloSimPileupOTSvc", **kwargs): kwargs.setdefault("CaloCellMakerTools_setup" , [ 'ISF_EmptyCellBuilderTool' ] ) kwargs.setdefault("CaloCellMakerTools_simulate" , [ 'ISF_FastShowerCellBuilderTool' ]) kwargs.setdefault("CaloCellMakerTools_release" , [ #'ISF_AddNoiseCellBuilderTool', - 'ISF_CaloCellContainerFinalizerTool', + 'ISF_CaloCellContainerFCSFinalizerTool', 'ISF_FastHitConvertTool' ]) kwargs.setdefault("Extrapolator" , 'ISF_NITimedExtrapolator') # register the FastCaloSim random number streams @@ -72,7 +72,7 @@ def getFastCaloSimSvcV2(name="ISF_FastCaloSimSvcV2", **kwargs): kwargs.setdefault("CaloCellsOutputName" , ISF_FastCaloSimFlags.CaloCellsName() ) kwargs.setdefault("CaloCellMakerTools_setup" , [ 'ISF_EmptyCellBuilderTool' ] ) - kwargs.setdefault("CaloCellMakerTools_release" , [ 'ISF_CaloCellContainerFinalizerTool', + kwargs.setdefault("CaloCellMakerTools_release" , [ 'ISF_CaloCellContainerFCSFinalizerTool', 'ISF_FastHitConvertTool' ]) kwargs.setdefault("ParamsInputFilename" , ISF_FastCaloSimFlags.ParamsInputFilename()) kwargs.setdefault("ParamsInputObject" , 'SelPDGID') diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfigDb.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfigDb.py index ef876dd16d2e6f4cc8808d7fa1b58b639d5df4c6..a7300b00f6d72f513689a8d11607e05dc7b55905 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfigDb.py +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfigDb.py @@ -19,6 +19,7 @@ addTool("ISF_FastCaloSimServices.AdditionalConfig.getPileupFastShowerCellBuilder addTool("ISF_FastCaloSimServices.AdditionalConfig.getCaloNoiseTool", "ISF_FCS_CaloNoiseTool") addTool("ISF_FastCaloSimServices.AdditionalConfig.getAddNoiseCellBuilderTool", "ISF_AddNoiseCellBuilderTool") addTool("ISF_FastCaloSimServices.AdditionalConfig.getCaloCellContainerFinalizerTool", "ISF_CaloCellContainerFinalizerTool") +addTool("ISF_FastCaloSimServices.AdditionalConfig.getCaloCellContainerFCSFinalizerTool", "ISF_CaloCellContainerFCSFinalizerTool") addTool("ISF_FastCaloSimServices.AdditionalConfig.getFastHitConvertTool", "ISF_FastHitConvertTool") addTool("ISF_FastCaloSimServices.AdditionalConfig.getFastCaloTool", "ISF_FastCaloTool") diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py index 5b686b1ad2cf673707c0f7c731608f891c3f97bf..a6123bd0a9386b700b5a888338b0a2a7fe0d258b 100644 --- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py +++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py @@ -37,8 +37,6 @@ def load_files_for_qball_scenario(MASS, CHARGE): del BLINE1 del BLINE2 -assert "MASS" in simdict -assert "CHARGE" in simdict doG4SimConfig = True from AthenaCommon.AthenaCommonFlags import athenaCommonFlags import PyUtils.AthFile as af @@ -52,13 +50,16 @@ try: else: from G4AtlasApps.SimFlags import simFlags if not "InteractingPDGCodes" in simFlags.specialConfiguration.get_Value(): - CODE=10000000+int(float(simdict["CHARGE"])*100) + assert "CHARGE" in simFlags.specialConfiguration.get_Value() + CODE=10000000+int(float(simFlags.specialConfiguration.get_Value()["CHARGE"])*100) simFlags.specialConfiguration.get_Value()['InteractingPDGCodes'] = str([CODE,-1*CODE]) simdict = simFlags.specialConfiguration.get_Value() except: from G4AtlasApps.SimFlags import simFlags simdict = simFlags.specialConfiguration.get_Value() +assert "MASS" in simdict +assert "CHARGE" in simdict load_files_for_qball_scenario(simdict["MASS"], simdict["CHARGE"]) if doG4SimConfig: diff --git a/TestBeam/TBRec/src/TBECLArRawChannelBuilder.h b/TestBeam/TBRec/src/TBECLArRawChannelBuilder.h index 71af529c7844be2bef52effe6b2f77944f5e4b70..0d304e86e255b0644b94d9ebcf4429ab4c888f38 100644 --- a/TestBeam/TBRec/src/TBECLArRawChannelBuilder.h +++ b/TestBeam/TBRec/src/TBECLArRawChannelBuilder.h @@ -9,7 +9,6 @@ #include "GaudiKernel/ToolHandle.h" #include "LArElecCalib/ILArOFCTool.h" #include "LArElecCalib/ILArADC2MeVTool.h" -#include "LArElecCalib/ILArHVCorrTool.h" // sandrine //#include "CaloIdentifier/LArEM_ID.h" diff --git a/TileCalorimeter/TileEvent/TileEvent/TileBeamElemCollection.h b/TileCalorimeter/TileEvent/TileEvent/TileBeamElemCollection.h index 353d4998ba78b3875294f88d1949402eecd94bfe..e828ce9b8c473a8e1a7a1abb139c641a44720113 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileBeamElemCollection.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileBeamElemCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TileBeamElemCollection_H @@ -29,6 +29,14 @@ public: */ TileBeamElemCollection (const TileBeamElemCollection& other); + /** + * @brief Move constructor. + * @param other Collection to move. + * Move the contents from other collection. + */ + TileBeamElemCollection(TileBeamElemCollection&& other) = default; + + ~TileBeamElemCollection() { } }; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileDigitsCollection.h b/TileCalorimeter/TileEvent/TileEvent/TileDigitsCollection.h index 438793223cde1240be35c4bd69fe662228ca8a74..302003f1df835507a72aa1b7dd54342b314389f9 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileDigitsCollection.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileDigitsCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TileDigitsCollection_H @@ -38,6 +38,13 @@ public: */ TileDigitsCollection (const TileDigitsCollection& other); + /** + * @brief Move constructor. + * @param other Collection to move. + * Move the contents from other collection. + */ + TileDigitsCollection(TileDigitsCollection&& other) = default; + ~TileDigitsCollection() { } /** @@ -66,10 +73,12 @@ public: */ void setFragExtraWords(const std::vector<uint32_t> & extra) { m_FragExtraWords = extra; - if (extra.size() < 2) m_FragExtraWords.resize(2); } + if (extra.size() < 2) m_FragExtraWords.resize(2); + } void setFragExtraWords(std::vector<uint32_t> && extra) { m_FragExtraWords = std::move(extra); - if (extra.size() < 2) m_FragExtraWords.resize(2); } + if (m_FragExtraWords.size() < 2) m_FragExtraWords.resize(2); + } /** * Get Frag extra words for this collection * @return vector with all words diff --git a/TileCalorimeter/TileEvent/TileEvent/TileHitCollection.h b/TileCalorimeter/TileEvent/TileEvent/TileHitCollection.h index 9411ad69dc61ad7143acff556ce308a89485f24f..66dd08838a27f876604ba6b48601c3f9b303b17f 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileHitCollection.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileHitCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TileHitCollection_H @@ -30,6 +30,13 @@ public: */ TileHitCollection (const TileHitCollection& other); + /** + * @brief Move constructor. + * @param other Collection to move. + * Move the contents from other collection. + */ + TileHitCollection(TileHitCollection&& other) = default; + ~TileHitCollection() { } }; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileRawChannelCollection.h b/TileCalorimeter/TileEvent/TileEvent/TileRawChannelCollection.h index 48880bda9653f0398f95113b4ee9d505fe6678bc..f809980e2a2c8dbaf1de1aa11e316ba4b1cd7005 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileRawChannelCollection.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileRawChannelCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TileRawChannelCollection_H @@ -60,6 +60,14 @@ public: */ TileRawChannelCollection (const TileRawChannelCollection& other); + /** + * @brief Move constructor. + * @param other Collection to move. + * Move the contents from other collection. + */ + TileRawChannelCollection(TileRawChannelCollection&& other) = default; + + ~TileRawChannelCollection() { } /** diff --git a/TileCalorimeter/TileEvent/TileEvent/TileRawDataCollection.h b/TileCalorimeter/TileEvent/TileEvent/TileRawDataCollection.h index 69bcb22ebd44c0d58be3d4473df67bb2f91c1a6d..315c1af28cc68ec86e796a090b8d8e78459c110b 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileRawDataCollection.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileRawDataCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //******************************************************************** @@ -53,6 +53,9 @@ template <typename TELEMENT> class TileRawDataCollection : DataVector < TELEMENT > (ownPolicy), m_id(0), m_lvl1Id(0), m_lvl1Type(0), m_detEvType(0), m_rodBCID(0) { this->reserve(48); } + TileRawDataCollection<TELEMENT> (const TileRawDataCollection<TELEMENT>& rhs) = default; + TileRawDataCollection<TELEMENT> (TileRawDataCollection<TELEMENT>&& rhs) = default; + // destructor virtual ~TileRawDataCollection<TELEMENT> () = default; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileRawDataContainer.h b/TileCalorimeter/TileEvent/TileEvent/TileRawDataContainer.h index b24a91400d4344f3652be349ff26841be425f3da..b342641de83602eca9ca7cef8bc86af178fcf628 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileRawDataContainer.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileRawDataContainer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //******************************************************************** @@ -59,10 +59,6 @@ public: // clear all collections void clear(); - // insert a TileRawData element into a collection. - // this is only to be used by Algorithm-builder - void add (TElement* rc, bool createColl=false, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS); - inline void push_back(TElement* rc) { add(rc,true); } inline TYPE get_hashType() const { return this->m_hashFunc.type(); } inline UNIT get_unit() const { return this->m_unit; } inline void set_unit(UNIT unit) { m_unit=unit; } diff --git a/TileCalorimeter/TileEvent/TileEvent/TileRawDataContainer.icc b/TileCalorimeter/TileEvent/TileEvent/TileRawDataContainer.icc index 9bd9a4088287fa687a399354a0598ae71ec31ca6..52d4b4a1c27cb84f94b7d9f406361de1dc6662a0 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileRawDataContainer.icc +++ b/TileCalorimeter/TileEvent/TileEvent/TileRawDataContainer.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // implementation of TileRawDataContainer @@ -90,82 +90,6 @@ void TileRawDataContainer<TCOLLECTION>::clear() return; } -template <typename TCOLLECTION> -void TileRawDataContainer<TCOLLECTION>::add(TElement* rc, bool createColl, - SG::OwnershipPolicy ownPolicy) -{ - if (this->m_hashFunc.max() == 0 && TileCablingService::getInstance()->getTileHWID() != 0) { - // not initialized yet - initialize hash function - initialize(false,m_type); - } - - //if (isLocked()) { - // std::cout << " Can not change TileRawDataContainer anymore, It is locked"<<std::endl; - // return ; - //} - - TCOLLECTION * coll; - - int frag = rc->frag_ID(); - IdentifierHash fragHash = static_cast<IdentifierHash>(m_hashFunc(frag)); - - TContainer_const_iterator it = MyBase::indexFind(fragHash); - - if( it == MyBase::end() ){ // collection doesn't exist - - // do not create collection, because it'll not work anyhow: - // the fact that collection doesn't exist cashed already - // waitng for update of core package - // createColl = false; - - if (createColl) { - - coll = new TCOLLECTION(frag,ownPolicy); - StatusCode sc = this->addCollection(coll,fragHash); - if (sc.isFailure() ) { - - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IMessageSvc* msgSvc; - sc = svcLoc->service( "MessageSvc", msgSvc ); - if ( sc.isFailure() ) { - std::cout << "TileRawDataContainer ERROR Can not retrieve MessageSvc" << std::endl; - std::cout << "TileRawDataContainer ERROR Can not create collection for frag 0x" << std::hex << frag - << " in container with CLID " << std::dec << this->clID() << std::endl; - } else { - MsgStream log(msgSvc, "TileRawDataContainer"); - log << MSG::ERROR <<" Can not create collection for frag 0x" << MSG::hex << frag - << " in container with CLID " << MSG::dec << this->clID() << endmsg; - } - return ; - } - - } else { - - ISvcLocator* svcLoc = Gaudi::svcLocator( ); - IMessageSvc* msgSvc; - StatusCode sc = svcLoc->service( "MessageSvc", msgSvc ); - if ( sc.isFailure() ) { - std::cout << "TileRawDataContainer ERROR Can not retrieve MessageSvc" << std::endl; - std::cout << "TileRawDataContainer ERROR Collection for frag 0x" << std::hex << frag - << " in container with CLID " << std::dec << this->clID() - << " does not exist " << std::endl; - } else { - MsgStream log(msgSvc, "TileRawDataContainer"); - log << MSG::ERROR <<" Collection for frag 0x" << MSG::hex << frag - << " in container with CLID " << MSG::dec << this->clID() - << " does not exist " << endmsg; - } - return ; - } - } else { // collection exists - - const TCOLLECTION * const_coll = *it; - coll = const_cast<TCOLLECTION *>(const_coll); - } - - coll->push_back(rc); - return ; -} template <typename TCOLLECTION> void TileRawDataContainer<TCOLLECTION>::print() const diff --git a/TileCalorimeter/TileRecAlgs/share/TileDigitsThresholdFilter_test.ref b/TileCalorimeter/TileRecAlgs/share/TileDigitsThresholdFilter_test.ref index 4b32e718f1b4b83665e87e280427c54316d7304b..06d5f0d24bd635331e46620a9570835dabceea11 100644 --- a/TileCalorimeter/TileRecAlgs/share/TileDigitsThresholdFilter_test.ref +++ b/TileCalorimeter/TileRecAlgs/share/TileDigitsThresholdFilter_test.ref @@ -4,12 +4,12 @@ Initializing Gaudi ApplicationMgr using job opts ./TileDigitsThresholdFilter_tes JobOptionsSvc INFO Job options successfully read in from ./TileDigitsThresholdFilter_test_generated.txt ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) - running on karma on Fri Jul 20 15:32:00 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v31r0) + running on pcatl12 on Mon Mar 18 19:21:10 2019 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : StoreGate ApplicationMgr INFO Application Manager Configured successfully -ClassIDSvc INFO getRegistryEntries: read 8597 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 5499 CLIDRegistry entries for module ALL StoreGateSvc DEBUG Property update for OutputLevel : new value = 2 StoreGateSvc DEBUG Service base class initialized successfully StoreGateSvc DEBUG trying to create store SGImplSvc/StoreGateSvc_Impl @@ -54,7 +54,3 @@ TILE => 5/0/1/2/1/1 TILE => 5/0/1/2/2/1 TILE => 5/0/1/2/3/1 TILE => 5/0/1/2/4/1 -StoreGateSvc DEBUG Recorded object @0x1c23240 with key TileDigitsCnt of type TileDigitsContainer(CLID 2925) - in DataObject @0x16cea90 - object not modifiable when retrieved -StoreGateSvc DEBUG Retrieved const pointer to object TileDigitsFiltered of type TileDigitsContainer(CLID 2925) diff --git a/TileCalorimeter/TileRecAlgs/test/TileDigitsThresholdFilter_test.cxx b/TileCalorimeter/TileRecAlgs/test/TileDigitsThresholdFilter_test.cxx index d8708224432eb88233c53a97ccd657bd6d855525..4ceb5db626fdc60894447c154ad8f025ebf8069f 100644 --- a/TileCalorimeter/TileRecAlgs/test/TileDigitsThresholdFilter_test.cxx +++ b/TileCalorimeter/TileRecAlgs/test/TileDigitsThresholdFilter_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #undef NDEBUG @@ -7,6 +7,7 @@ #include "../src/TileDigitsThresholdFilter.h" #include "TileConditions/ITileCondToolDspThreshold.h" #include "TileEvent/TileDigitsContainer.h" +#include "TileEvent/TileMutableDigitsContainer.h" #include "TileIdentifier/TileHWID.h" #include "TileConditions/TileCablingService.h" @@ -19,6 +20,8 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "StoreGate/StoreGateSvc.h" #include "StoreGate/setupStoreGate.h" +#include "StoreGate/WriteHandle.h" +#include "StoreGate/ReadHandle.h" // ATLAS C++ #include "CxxUtils/make_unique.h" @@ -128,46 +131,37 @@ void test1() { assert( (alg->setProperty("TileCondToolDspThreshold", "TileCondToolDspThresholdMock/TileCondToolDspThresholdMock")).isSuccess() ); assert( (alg->initialize()).isSuccess() ); - - TileDigitsContainer* inputContainer = new TileDigitsContainer(true); - - inputContainer->set_unit(TileRawChannelUnit::OnlineADCcounts); - inputContainer->set_type(TileFragHash::Beam); - inputContainer->set_bsflags(3); - - unsigned int ros = 1; - unsigned int drawer = 1; - for (unsigned int adc = 0; adc < 2; ++adc) { - unsigned int channel = 0; - for (const std::vector<float>& digits : TESTDIGITS) { - HWIdentifier id = tileHWID->adc_id(ros, drawer, channel, adc); - inputContainer->push_back(new TileDigits(id, digits)); - ++channel; - std::cout << ((tileHWID->is_tile(id) ? "TILE" : "NOT TILE")) << " => " << tileHWID->to_string(id) << std::endl; + { + auto digitsContainer = std::make_unique<TileMutableDigitsContainer>(true); + + digitsContainer->set_unit(TileRawChannelUnit::OnlineADCcounts); + digitsContainer->set_type(TileFragHash::Beam); + digitsContainer->set_bsflags(3); + + unsigned int ros = 1; + unsigned int drawer = 1; + for (unsigned int adc = 0; adc < 2; ++adc) { + unsigned int channel = 0; + for (const std::vector<float>& digits : TESTDIGITS) { + HWIdentifier id = tileHWID->adc_id(ros, drawer, channel, adc); + digitsContainer->push_back(new TileDigits(id, digits)); + ++channel; + std::cout << ((tileHWID->is_tile(id) ? "TILE" : "NOT TILE")) << " => " << tileHWID->to_string(id) << std::endl; + } + ++drawer; } - ++drawer; - } - /* - for (const TileDigitsCollection* constInputCollection : *inputContainer) { - if (constInputCollection->identify() == 0x101) { - TileDigitsCollection* inputCollection = const_cast<TileDigitsCollection*>(constInputCollection); - inputCollection->setLvl1Id(10100); - inputCollection->setLvl1Type(10101); - inputCollection->setDetEvType(10102); - inputCollection->setRODBCID(10103); - } + SG::WriteHandle<TileDigitsContainer> digitsCnt("TileDigitsCnt"); + assert(digitsCnt.record(std::move(digitsContainer)).isSuccess()); } - */ - - assert( evtStore->record(inputContainer, "TileDigitsCnt", false).isSuccess() ); - assert( (alg->execute()).isSuccess() ); + SG::ReadHandle<TileDigitsContainer> inputContainer("TileDigitsCnt"); + assert( inputContainer.isValid() ); - const TileDigitsContainer* outputContainer; - assert( evtStore->retrieve(outputContainer, "TileDigitsFiltered").isSuccess() ); + SG::ReadHandle<TileDigitsContainer> outputContainer("TileDigitsFiltered"); + assert( outputContainer.isValid() ); assert( inputContainer->get_unit() == outputContainer->get_unit() ); assert( inputContainer->get_type() == outputContainer->get_type() ); @@ -180,25 +174,6 @@ void test1() { unsigned int drawer = (fragId & 0x3F); unsigned int ros = fragId >> 8; - /* - IdentifierHash fragHash = (inputContainer->hashFunc())(fragId); - const TileDigitsCollection* inputCollection = *(inputContainer->indexFind(fragHash)); - - - assert( inputCollection->getLvl1Id() == outputCollection->getLvl1Id() ); - assert( inputCollection->getLvl1Type() == outputCollection->getLvl1Type() ); - assert( inputCollection->getDetEvType() == outputCollection->getDetEvType() ); - assert( inputCollection->getRODBCID() == outputCollection->getRODBCID() ); - - assert( inputCollection->getFragSize() == outputCollection->getFragSize() ); - assert( inputCollection->getFragExtraWords() == outputCollection->getFragExtraWords() ); - assert( inputCollection->getFragBCID() == outputCollection->getFragBCID() ); - assert( inputCollection->getFragChipHeaderWords() == outputCollection->getFragChipHeaderWords() ); - assert( inputCollection->getFragChipHeaderWordsHigh() == outputCollection->getFragChipHeaderWordsHigh() ); - assert( inputCollection->getFragChipCRCWords() == outputCollection->getFragChipCRCWords() ); - assert( inputCollection->getFragChipCRCWordsHigh() == outputCollection->getFragChipCRCWordsHigh() ); - */ - for (const TileDigits* digits : *outputCollection) { ++nTileDigitsPassedFitler; HWIdentifier adc_id = digits->adc_HWID(); diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h index 98332371654122c9cf3693c441f4379711c71c43..5a4e3c764fb414e524b585c911adf08981960819 100644 --- a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h +++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // T_TilePoolContainerCnv.h @@ -15,6 +15,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" #include "EventContainers/SelectAllObject.h" #include "TileEvent/TileRawDataContainer.h" +#include "TileEvent/TileMutableDataContainer.h" #include <vector> #include <inttypes.h> @@ -26,6 +27,7 @@ public: typedef typename PERS::ElemVector pers_ElemVector; typedef typename PERS::const_iterator pers_const_iterator; typedef typename SelectAllObject<TRANS>::const_iterator trans_const_iterator; + using Collection = typename TRANS::IDENTIFIABLE; T_TilePoolContainerCnv() : m_elementCnv() {} @@ -52,7 +54,6 @@ public: << " - " << bsflags << " " << unit << " " << type << " " << hashType << MSG::dec << " Nelements= " << vec.size() << endmsg; - //trans->clear(); // only remove elements trans->cleanup(); // remove all collections if ( abs(trans->get_hashType()-hashType) > 0xF) { @@ -67,11 +68,27 @@ public: trans->set_type((TileFragHash::TYPE)type); trans->set_bsflags(bsflags); - for( pers_const_iterator it = vec.begin(), - iEnd = vec.end(); - it != iEnd; ++it) { - trans->push_back( m_elementCnv.createTransient(&(*it), log) ); + + auto mutableContainer = std::make_unique<TileMutableDataContainer<TRANS>>(); + if (mutableContainer->status().isFailure()) { + throw std::runtime_error("Failed to initialize Tile mutable Container"); + } + + for( pers_const_iterator it = vec.begin(), iEnd = vec.end(); it != iEnd; ++it) { + if (mutableContainer->push_back(m_elementCnv.createTransient(&(*it), log)).isFailure()) { + throw std::runtime_error("Failed to add Tile element to Collection"); + } } + + std::vector<IdentifierHash> hashes = mutableContainer->GetAllCurrentHashes(); + for (const IdentifierHash hash : hashes) { + Collection* coll = mutableContainer->indexFindPtr(hash); + auto newColl = std::make_unique<Collection>(std::move(*coll)); + if (trans->addOrDelete(std::move(newColl), hash).isFailure()) { + throw std::runtime_error("Failed to add Tile collection to Identifiable Container"); + } + } + } /** Converts vector of TRANS::value_type objects to vector of PERS::value_type objects, diff --git a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMerged.cxx b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMerged.cxx index 0be526b23a842078199a30e732c4e06e61a73d35..eec555821d96af31cb0bb5e19cd3e5df98cd970e 100755 --- a/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMerged.cxx +++ b/Trigger/TrigAlgorithms/TrigTauRec/src/TrigTauRecMerged.cxx @@ -1036,15 +1036,15 @@ HLT::ErrorCode TrigTauRecMerged::hltExecute(const HLT::TriggerElement* inputTE, if(pContainer->size()==0) return HLT::OK; - static SG::AuxElement::Accessor< xAOD::TauJet::JetLink_t > jetAcc( "jetLink" ); + static const SG::AuxElement::Accessor< xAOD::TauJet::JetLink_t > jetAcc( "jetLink" ); jetAcc( *p_tau ).toPersistent(); - static SG::AuxElement::Accessor< xAOD::TauJet::VertexLink_t > vertexAcc( "vertexLink" ); + static const SG::AuxElement::Accessor< xAOD::TauJet::VertexLink_t > vertexAcc( "vertexLink" ); vertexAcc( *p_tau ).toPersistent(); xAOD::TauJet::TauTrackLinks_t new_tauTrackLinks; - static SG::AuxElement::Accessor< xAOD::TauJet::TauTrackLinks_t > tauTrackAcc( "tauTrackLinks" ); - static SG::AuxElement::Accessor< xAOD::TauTrack::TrackParticleLinks_t > trackAcc( "trackLinks" ); + static const SG::AuxElement::Accessor< xAOD::TauJet::TauTrackLinks_t > tauTrackAcc( "tauTrackLinks" ); + static const SG::AuxElement::Accessor< xAOD::TauTrack::TrackParticleLinks_t > trackAcc( "trackLinks" ); for( ElementLink< xAOD::TauTrackContainer > tautrack_link : tauTrackAcc( *p_tau ) ) { diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/CMakeLists.txt b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/CMakeLists.txt index 8bff1abe2b008b5b2e8fa9204eb8294652bf1076..78261fb99f5604de87c60b2095d54a74cfa5ff58 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/CMakeLists.txt +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/CMakeLists.txt @@ -6,37 +6,38 @@ atlas_subdir( TrigEgammaAnalysisTools ) # Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthToolSupport/AsgTools - Event/xAOD/xAODCaloEvent - Event/xAOD/xAODEgamma - Event/xAOD/xAODEventInfo - Event/xAOD/xAODJet - Event/xAOD/xAODTracking - Event/xAOD/xAODTrigCalo - Event/xAOD/xAODTrigEgamma - Event/xAOD/xAODTrigRinger - Event/xAOD/xAODTrigger - Event/xAOD/xAODTruth - LumiBlock/LumiBlockComps - PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces - Reconstruction/RecoTools/RecoToolInterfaces - PhysicsAnalysis/ElectronPhotonID/egammaMVACalibAnalysis - Trigger/TrigAnalysis/TrigDecisionTool - Trigger/TrigAnalysis/TrigEgammaMatchingTool - Trigger/TrigAnalysis/TrigEgammaEmulationTool - Trigger/TrigConfiguration/TrigConfHLTData - Trigger/TrigEvent/TrigSteeringEvent - Trigger/TrigMonitoring/TrigHLTMonitoring - PhysicsAnalysis/AnalysisCommon/PATCore - PRIVATE - Control/AthenaBaseComps - Control/AthenaMonitoring - Control/StoreGate - GaudiKernel - Trigger/TrigConfiguration/TrigConfxAOD ) - +atlas_depends_on_subdirs( PUBLIC + Control/AthToolSupport/AsgTools + Event/xAOD/xAODCaloEvent + Event/xAOD/xAODEgamma + Event/xAOD/xAODEventInfo + Event/xAOD/xAODJet + Event/xAOD/xAODPrimitives + Event/xAOD/xAODTracking + Event/xAOD/xAODTrigCalo + Event/xAOD/xAODTrigEgamma + Event/xAOD/xAODTrigRinger + Event/xAOD/xAODTrigger + Event/xAOD/xAODTruth + Event/xAOD/xAODMissingET + Event/xAOD/xAODCaloRings + LumiBlock/LumiBlockComps + PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools + Reconstruction/RecoTools/RecoToolInterfaces + Reconstruction/egamma/egammaMVACalib + Trigger/TrigAnalysis/TrigDecisionTool + Trigger/TrigAnalysis/TrigEgammaMatchingTool + Trigger/TrigAnalysis/TrigEgammaEmulationTool + Trigger/TrigConfiguration/TrigConfHLTData + Trigger/TrigEvent/TrigSteeringEvent + Trigger/TrigMonitoring/TrigHLTMonitoring + PhysicsAnalysis/AnalysisCommon/PATCore + PRIVATE + Control/AthenaBaseComps + Control/AthenaMonitoring + Control/StoreGate + GaudiKernel + Trigger/TrigConfiguration/TrigConfxAOD ) # External dependencies: find_package( Boost ) find_package( ROOT COMPONENTS Core Hist Tree ) @@ -48,20 +49,25 @@ atlas_add_library( TrigEgammaAnalysisToolsLib INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODCaloEvent xAODEgamma - xAODEventInfo xAODJet xAODTracking xAODTrigCalo xAODTrigEgamma xAODTrigRinger - xAODTrigger xAODTruth LumiBlockCompsLib EgammaAnalysisInterfacesLib + xAODEventInfo xAODJet xAODTracking xAODTrigCalo xAODTrigEgamma xAODTrigRinger xAODMissingET + xAODTrigger xAODCaloRings xAODTruth LumiBlockCompsLib EgammaAnalysisInterfacesLib RecoToolInterfaces egammaMVACalibAnalysisLib TrigDecisionToolLib TrigEgammaMatchingToolLib TrigEgammaEmulationToolLib TrigConfHLTData TrigSteeringEvent TrigHLTMonitoringLib PATCoreLib PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} TrigConfxAODLib ) atlas_add_component( TrigEgammaAnalysisTools - src/*.h src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel AsgTools TrigHLTMonitoringLib - AthenaMonitoringLib TrigDecisionToolLib TrigEgammaMatchingToolLib xAODEgamma - TrigEgammaAnalysisToolsLib ) + src/*.h + src/*.cxx + Root/*.cxx + src/components/*.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} AsgTools xAODCaloEvent xAODMissingET xAODEgamma xAODEventInfo xAODJet xAODTracking xAODTrigCalo xAODTrigEgamma xAODTrigRinger xAODCaloRings xAODTrigger xAODTruth LumiBlockCompsLib ElectronPhotonSelectorToolsLib egammaMVACalibLib TrigDecisionToolLib TrigEgammaMatchingToolLib TrigEgammaEmulationTool TrigConfHLTData TrigSteeringEvent TrigHLTMonitoringLib AthenaBaseComps AthenaMonitoringLib StoreGateLib SGtests GaudiKernel PATCoreLib ) # Install files from the package: atlas_install_python_modules( python/TrigEgamma*.py ) atlas_install_joboptions( share/test*.py ) -atlas_install_scripts( share/trigEgammaDQ.py share/get_trigEgammaDQ.sh ) +atlas_install_generic( share/trigEgammaDQ.py share/get_trigEgammaDQ.sh + DESTINATION share + EXECUTABLE ) + diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/EfficiencyTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/EfficiencyTool.cxx index 073cef0276a1524ce30569e4a3048f1111ecd69a..f4baf74a26da1601a7ba15c8803bd889da15222a 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/EfficiencyTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/EfficiencyTool.cxx @@ -50,26 +50,25 @@ bool EfficiencyTool::analyseIsEMLH(const xAOD::Electron *eg, const std::string p const std::string ineff = "Ineff" + pidword; bool failIsEMLH = true; - unsigned int isem = 9999; try{ - ATH_MSG_DEBUG("Running selectionisEM("<<pidword<<")"); - isem = eg->selectionisEM(pidword); - - failIsEMLH = false; - for (int ii = 0; ii < 11; ii++) { - if ((isem >> ii) & 0x1) { - failIsEMLH = true; - hist1(fail)->Fill(ii + 0.5); - hist1(ineff)->Fill(ii + 3.5, 1); + ATH_MSG_DEBUG("Running selectionisEM("<<pidword<<")"); + unsigned int isem = eg->selectionisEM(pidword); + + failIsEMLH = false; + for (int ii = 0; ii < 11; ii++) { + if ((isem >> ii) & 0x1) { + failIsEMLH = true; + hist1(fail)->Fill(ii + 0.5); + hist1(ineff)->Fill(ii + 3.5, 1); + } } - } } catch (const ValidationException &e) { - ATH_MSG_WARNING("Exception thrown: " << e.msg() ); - ATH_MSG_WARNING("Is " << pidword << " is a valid one? returning failed...."); - failIsEMLH = true; + ATH_MSG_WARNING("Exception thrown: " << e.msg() ); + ATH_MSG_WARNING("Is " << pidword << " is a valid one? returning failed...."); + failIsEMLH = true; } catch(...) { - ATH_MSG_WARNING("Unknown exception caught in analyseIsEMLH ... Is " << pidword << " is a valid one? returning failed...."); - failIsEMLH = true; + ATH_MSG_WARNING("Unknown exception caught in analyseIsEMLH ... Is " << pidword << " is a valid one? returning failed...."); + failIsEMLH = true; } return failIsEMLH; @@ -90,18 +89,7 @@ bool EfficiencyTool::analyseIsEM(const xAOD::Electron *eg, const std::string pid bool failtrt = false; bool failisem = false; - unsigned int isem = 9999; - try{ - isem = eg->selectionisEM(pidword); - } catch (const ValidationException &eg) { - ATH_MSG_WARNING("Exception thrown: " << eg.msg() ); - ATH_MSG_WARNING("Is " << pidword << " is a valid one? returning failed...."); - return(true); - } catch(...) { - ATH_MSG_WARNING("Unknown exception caught in analyseIsEMLH ... Is " << pidword << " is a valid one? returning failed...."); - return(true); - } - + unsigned int isem = eg->selectionisEM(pidword); for (int ii = 0; ii < 29; ii++) { if ((isem >> ii) & 0x1) { @@ -255,8 +243,7 @@ void EfficiencyTool::fillInefficiency(const std::string& pid, const std::string hist1(ineff)->Fill(lastbin - 4, 1); hist1(ineff)->Fill(sumbin, 1); } - else { - hist1(ineff)->Fill(lastbin - 3, 1); + else{ hist1(ineff)->Fill(sumbin, 1); } diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx index fcd2a4aee400191fe2a3e27520bf5c87ecf1eac5..7909da2527e71ad979297000184fe3d58b9ae106 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx @@ -66,6 +66,7 @@ TrigEgammaAnalysisBaseTool( const std::string& myname ) declareProperty("TPTrigger",m_tp=false)->declareUpdateHandler(&TrigEgammaAnalysisBaseTool::updateTP,this); declareProperty("isEMResultNames",m_isemname,"isEM"); declareProperty("LHResultNames",m_lhname,"LH"); + declareProperty("ForceTrigAttachment", m_forceTrigAttachment=false); m_storeGate = nullptr; m_histsvc = nullptr; @@ -85,6 +86,9 @@ TrigEgammaAnalysisBaseTool( const std::string& myname ) m_nPVertex=0; m_offmu=0.; m_onlmu=0.; + m_sgContainsRnn=false; + m_sgContainsTrigPhoton=false; + m_forceTrigEmulation=false; } void TrigEgammaAnalysisBaseTool::updateDetail(Property& /*p*/){ @@ -101,14 +105,14 @@ void TrigEgammaAnalysisBaseTool::updateAltBinning(Property& /*p*/){ void TrigEgammaAnalysisBaseTool::updateTP(Property& /*p*/){ plot()->setTP(m_tp); - for( auto& tool : m_tools) { + for( const auto& tool : m_tools) { tool->setTP(m_tp); } } void TrigEgammaAnalysisBaseTool::updateEmulation(Property& /*p*/){ plot()->setEmulation(m_doEmulation); - for( auto& tool : m_tools) { + for( const auto& tool : m_tools) { tool->setEmulation(m_doEmulation); ATH_MSG_INFO("updateEmulation() property for tool with name: " << tool->name()); tool->setEmulationTool(m_emulationTool); @@ -175,7 +179,7 @@ StatusCode TrigEgammaAnalysisBaseTool::initialize() { // propagate the emulation tool for all tools if( m_doEmulation ){ - for( auto& tool : m_tools) { + for( const auto& tool : m_tools) { ATH_MSG_INFO("Propagate emulation tool handler to: " << tool->name() ); tool->setEmulationTool(m_emulationTool); } @@ -351,8 +355,10 @@ void TrigEgammaAnalysisBaseTool::setTrigInfo(const std::string trigger){ if(isL1) etthr=l1thr; // Should be handled elsewhere - TrigInfo info{trigger,type,l1item,l1type,pidname,decorator,isL1,perf,etcut,etthr,l1thr}; + TrigInfo info{trigger,type,l1item,l1type,pidname,decorator,isL1,perf,etcut,etthr,l1thr,m_forceTrigEmulation}; m_trigInfo[trigger] = info; + + m_forceTrigEmulation=false; //hack disable } // return the TrigInfo from trigger name @@ -557,6 +563,7 @@ bool TrigEgammaAnalysisBaseTool::isPrescaled(const std::string trigger){ asg::AcceptData TrigEgammaAnalysisBaseTool::setAccept(const HLT::TriggerElement *te,const TrigInfo info){ + ATH_MSG_DEBUG("setAccept"); asg::AcceptData acceptData (&m_accept); bool passedL1Calo=false; @@ -571,6 +578,16 @@ TrigEgammaAnalysisBaseTool::setAccept(const HLT::TriggerElement *te,const TrigIn if(getFeature<xAOD::TrigRNNOutput>(te)){ hasRnn=true; } + + ATH_MSG_DEBUG("Rnn container " << getSGContainsRnn()); + ATH_MSG_DEBUG("TrigPhotonContainer " << getSGContainsTrigPhoton()); + + if(getSGContainsRnn()){ + if(getFeature<xAOD::TrigRNNOutput>(te)){ + hasRnn=true; + } + } + if(!info.trigL1){ // HLT item get full decision ATH_MSG_DEBUG("Check for active features: TrigEMCluster,CaloClusterContainer"); @@ -594,7 +611,9 @@ TrigEgammaAnalysisBaseTool::setAccept(const HLT::TriggerElement *te,const TrigIn } else if(info.trigType == "photon"){ ATH_MSG_DEBUG("Check for active features: TrigPhoton, PhotonContainer"); - passedL2=ancestorPassed<xAOD::TrigPhotonContainer>(te); + if(getSGContainsTrigPhoton()){ + passedL2=ancestorPassed<xAOD::TrigPhotonContainer>(te); + } passedEF = ancestorPassed<xAOD::PhotonContainer>(te); passedEFTrk=true;// Assume true for photons } @@ -930,7 +949,7 @@ GETTER(pixeldEdx) GETTER(deltaPhiRescaled3) #undef GETTER - std::string TrigEgammaAnalysisBaseTool::getProbePid(const std::string pidtype){ +std::string TrigEgammaAnalysisBaseTool::getProbePid(const std::string pidtype){ static std::map<std::string,std::string> PidMap; //no longer class member but static // Note vloose/lhvloose trigger mapped to Loose/LHLoose offline PID if(PidMap.empty()){ @@ -992,43 +1011,56 @@ bool TrigEgammaAnalysisBaseTool::getTrigCaloRings( const xAOD::TrigEMCluster *em return false; } -bool TrigEgammaAnalysisBaseTool::getCaloRings( const xAOD::Electron * /*el*/, std::vector<float> & /*ringsE*/ ){ +bool TrigEgammaAnalysisBaseTool::getCaloRings( const xAOD::Electron * el, std::vector<float> &ringsE ){ - /* + if(!el) return false; ringsE.clear(); - - auto m_ringsELReader = xAOD::getCaloRingsReader(); + auto ringsELReader = xAOD::getCaloRingsReader(); // First, check if we can retrieve decoration: const xAOD::CaloRingsLinks *caloRingsLinks(nullptr); try { - caloRingsLinks = &(m_ringsELReader->operator()(*el)); + ATH_MSG_DEBUG("getCaloRingsReader->operator()(*el)"); + caloRingsLinks = &(ringsELReader->operator()(*el)); } catch ( const std::exception &e) { ATH_MSG_WARNING("Couldn't retrieve CaloRingsELVec. Reason: " << e.what()); return false; } - if ( caloRingsLinks->empty() ){ - ATH_MSG_WARNING("Particle does not have CaloRings decoratorion."); - return false; - } + if( caloRingsLinks ){ + if ( caloRingsLinks->empty() ){ + ATH_MSG_WARNING("Particle does not have CaloRings decoratorion."); + return false; + } + const xAOD::CaloRings *clrings=nullptr; + try { + // For now, we are using only the first cluster + clrings = *(caloRingsLinks->at(0)); + } catch(const std::exception &e){ + ATH_MSG_WARNING("Couldn't retrieve CaloRings. Reason: " << e.what()); + return false; + } + // For now, we are using only the first cluster + if(clrings) { + ATH_MSG_DEBUG("exportRingsTo..."); + clrings->exportRingsTo(ringsE); + }else{ + ATH_MSG_WARNING("There is a problem when try to attack the rings vector using exportRigsTo() method."); + return false; + } - // For now, we are using only the first cluster - const xAOD::CaloRings *clrings = *(caloRingsLinks->at(0)); - // For now, we are using only the first cluster - - if(clrings) clrings->exportRingsTo(ringsE); - else{ - ATH_MSG_WARNING("There is a problem when try to attack the rings vector using exportRigsTo() method."); + }else{ + ATH_MSG_WARNING("CaloRingsLinks in a nullptr..."); return false; } - */ + return true; } + void TrigEgammaAnalysisBaseTool::calculatePileupPrimaryVertex(){ // pileup calculation m_nGoodVertex = 0.0; m_nPVertex = 0.0; @@ -1050,8 +1082,6 @@ void TrigEgammaAnalysisBaseTool::calculatePileupPrimaryVertex(){ } - - MonteCarlo::PDGID TrigEgammaAnalysisBaseTool::pdgid(const xAOD::Egamma *eg, const xAOD::TruthParticleContainer* truthContainer, const xAOD::TruthParticle *&mc_match ) { diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx index 95ec6a52b47ee4b6a6dad33f3b025e77a0229636..de83d7d794ca60614295a02ab112a9a8c97cba34 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx @@ -144,13 +144,14 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i const auto* obj = getFeature<xAOD::TrigEMCluster>(feat.te()); // Only consider passing objects if(!obj) continue; - if(!ancestorPassed<xAOD::TrigEMCluster>(feat.te())) continue; cd(dir+"HLT"); - hist1("rejection")->Fill("L2Calo",1); + if(ancestorPassed<xAOD::TrigEMCluster>(feat.te())) + hist1("rejection")->Fill("L2Calo",1); fillL2Calo(dir+"L2Calo",obj); // Fill HLT shower shapes - if(boost::contains(info.trigName,"ringer") || info.trigEtcut || info.trigPerf) - fillRinger(dir+"L2Calo",obj); // Fill HLT shower shapes } + + + const auto vec_clus = fc.get<xAOD::CaloClusterContainer>("TrigEFCaloCalibFex",TrigDefs::alsoDeactivateTEs); for(const auto feat : vec_clus){ if(feat.te()==nullptr) continue; @@ -244,7 +245,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i return StatusCode::SUCCESS; } -void TrigEgammaDistTool::fillL1Calo(const std::string dir, const xAOD::EmTauRoI *l1){ +void TrigEgammaDistTool::fillL1Calo(const std::string &dir, const xAOD::EmTauRoI *l1){ cd(dir); ATH_MSG_DEBUG("Fill L1Calo distributions" << dir); hist1("eta")->Fill(l1->eta()); @@ -258,7 +259,7 @@ void TrigEgammaDistTool::fillL1Calo(const std::string dir, const xAOD::EmTauRoI hist2("emClusVsHadCore")->Fill(l1->hadCore()*0.001, l1->emClus()*0.001); } -void TrigEgammaDistTool::fillEFCalo(const std::string dir, const xAOD::CaloCluster *clus){ +void TrigEgammaDistTool::fillEFCalo(const std::string &dir, const xAOD::CaloCluster *clus){ cd(dir); ATH_MSG_DEBUG("Fill EFCalo distributions" << dir); ATH_MSG_DEBUG("Energy " << clus->e()/1.e3); @@ -286,7 +287,7 @@ void TrigEgammaDistTool::fillEFCalo(const std::string dir, const xAOD::CaloClust hist1("phi_calo")->Fill(tmpphi); } -void TrigEgammaDistTool::fillL2Electron(const std::string dir, const xAOD::TrigElectron *el){ +void TrigEgammaDistTool::fillL2Electron(const std::string &dir, const xAOD::TrigElectron *el){ cd(dir); if(!el) ATH_MSG_DEBUG("TrigElectron nullptr"); else { @@ -297,7 +298,7 @@ void TrigEgammaDistTool::fillL2Electron(const std::string dir, const xAOD::TrigE } -void TrigEgammaDistTool::fillL2Calo(const std::string dir, const xAOD::TrigEMCluster *emCluster){ +void TrigEgammaDistTool::fillL2Calo(const std::string &dir, const xAOD::TrigEMCluster *emCluster){ cd(dir); if(!emCluster) ATH_MSG_DEBUG("Online pointer fails"); else{ @@ -309,33 +310,9 @@ void TrigEgammaDistTool::fillL2Calo(const std::string dir, const xAOD::TrigEMClu } } -void TrigEgammaDistTool::fillRinger(const std::string dir, const xAOD::TrigEMCluster *emCluster){ - cd(dir); - if(!emCluster) ATH_MSG_DEBUG("Online pointer fails"); - else{ - bool hasRings = false; - std::vector<float> ringsE; - hasRings = getTrigCaloRings(emCluster, ringsE ); - if(hasRings){ - hist2("ringer_etVsEta")->Fill(emCluster->eta(), emCluster->et()/1.e3); - ///Fill rings pdf for each ring - if(m_detailedHists){ - for(unsigned layer =0; layer < 7; ++layer){ - unsigned minRing, maxRing; std::string strLayer; - parseCaloRingsLayers( layer, minRing, maxRing, strLayer ); - cd(dir+"/rings_"+strLayer); - for(unsigned r=minRing; r<=maxRing; ++r){ - std::stringstream ss; - ss << "ringer_ring#" << r; - hist1(ss.str())->Fill( ringsE.at(r) ); - }///loop into rings - }///loop for each calo layer - } - } - } -} -void TrigEgammaDistTool::fillShowerShapes(const std::string dir,const xAOD::Egamma *eg){ + +void TrigEgammaDistTool::fillShowerShapes(const std::string &dir,const xAOD::Egamma *eg){ cd(dir); ATH_MSG_DEBUG("Fill SS distributions " << dir); if(!eg) ATH_MSG_WARNING("Egamma pointer fails"); @@ -362,13 +339,16 @@ void TrigEgammaDistTool::fillShowerShapes(const std::string dir,const xAOD::Egam hist1("eta")->Fill(eg->eta()); hist1("phi")->Fill(eg->phi()); hist1("topoetcone20")->Fill(getIsolation_topoetcone20(eg)/1e3); - if (eg->pt() > 0) + hist1("topoetcone40_shift")->Fill((getIsolation_topoetcone40(eg)-2450)/1e3); + if (eg->pt() > 0) { hist1("topoetcone20_rel")->Fill(getIsolation_topoetcone20(eg)/eg->pt()); + hist1("topoetcone40_shift_rel")->Fill((getIsolation_topoetcone40(eg)-2450)/eg->pt()); + } } } -void TrigEgammaDistTool::fillTracking(const std::string dir, const xAOD::Electron *eg){ +void TrigEgammaDistTool::fillTracking(const std::string &dir, const xAOD::Electron *eg){ cd(dir); ATH_MSG_DEBUG("Fill tracking"); if(!eg) ATH_MSG_WARNING("Electron pointer fails"); diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bf313f2bde985292a10927d26d04d19ff8279c8c --- /dev/null +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx @@ -0,0 +1,1206 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +/********************************************************************** + * AsgTool: TrigEgammaEventSelection + * Authors: + * Ryan Mackenzie White <ryan.white@cern.ch> + * Denis Damazio <denis.damazio@cern.ch> + * Contributors: + * Joao Victor da Fonseca Pinto <joao.victor.da.fonseca.pinto@cern.ch> + * Date: Mar 2015 + * Description: + * Derived class for dumping the probe information into a ttree. + * + **********************************************************************/ + +#include "TrigEgammaAnalysisTools/TrigEgammaEventSelection.h" +#include "GaudiKernel/SystemOfUnits.h" +using namespace std; + +TrigEgammaEventSelection::TrigEgammaEventSelection( const std::string& myname ): + TrigEgammaNavTPBaseTool(myname) , TrigEgammaPhysValBase() +{ + m_eventCounter = 0; + declareProperty("CutLabels" , m_cutlabels ); + declareProperty("Analysis" , m_anatype="EventSelection"); + declareProperty("SelectionZ" , m_selectionZ=true ); + declareProperty("SelectionFakes" , m_selectionFakes=false ); + declareProperty("SelectionMC" , m_selectionMC=false ); + declareProperty("SelectionW" , m_selectionW=false ); + declareProperty("SelectionJpsi" , m_selectionJpsi=false ); + declareProperty("DumpTags" , m_dumpTags=false ); + declareProperty("DetailedDataLevel" , m_detailedDataLevel=0 ); + declareProperty("ElectronLHVLooseTool" , m_electronLHVLooseTool ); + + + declareProperty("HLTElectronLikelihoodSelector" , m_HLTElectronLHSelectors ); + declareProperty("EFCaloElectronLikelihoodSelector" , m_EFCaloElectronLHSelectors ); + declareProperty("EFCaloElectronIsEMSelector" , m_EFCaloElectronIsEMSelectors ); + declareProperty("HLTElectronIsEMSelector" , m_HLTElectronIsEMSelectors ); + + m_doCaloRings=false; +} + +StatusCode TrigEgammaEventSelection::childInitialize(){ + + if ( (m_electronLHVLooseTool.retrieve()).isFailure() ){ + ATH_MSG_ERROR( "Could not retrieve VeryLoose LH Selector Tool! Can't work"); + return StatusCode::FAILURE; + } + + if ( (m_EFCaloElectronLHSelectors.retrieve()).isFailure() ){ + ATH_MSG_ERROR( "Could not retrieve EFCalo LH Selector Tool! Can't work"); + return StatusCode::FAILURE; + } + + if ( (m_EFCaloElectronIsEMSelectors.retrieve()).isFailure() ){ + ATH_MSG_ERROR( "Could not retrieve EFCalo IsEM Selector Tool! Can't work"); + return StatusCode::FAILURE; + } + if ( (m_HLTElectronLHSelectors.retrieve()).isFailure() ){ + ATH_MSG_ERROR( "Could not retrieve HLT LH Selector Tool! Can't work"); + return StatusCode::FAILURE; + } + if ( (m_HLTElectronIsEMSelectors.retrieve()).isFailure() ){ + ATH_MSG_ERROR( "Could not retrieve HLT IsEM Selector Tool! Can't work"); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + + +StatusCode TrigEgammaEventSelection::childBook(){ + + ATH_MSG_DEBUG("Now configuring chains for analysis"); + //Set the base directory from the plot() + m_dir=plot()->getBasePath(); + std::vector<std::string> chains = tdt()->getListOfTriggers("HLT_e.*, L1_EM.*, HLT_g.*"); + + TrigEgammaAnalysisBaseTool::write_trigger_list(chains); + + if(!getEmulation()){ + ATH_MSG_ERROR("Emulation tool was not set. This tool use the emulation to retrievea all support objects. Please, enable this!"); + return StatusCode::FAILURE; + } + + + for(const auto trigName:m_trigInputList){ + if (std::find(chains.begin(), chains.end(), trigName) != chains.end()){ + if(plot()->getTrigInfoMap().count(trigName) != 0) + ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName); + else{ + m_trigList.push_back(trigName); + setTrigInfo(trigName); + } + }else if(getEmulation() && m_forceTrigAttachment){// + ATH_MSG_DEBUG("Trigger doesn't exist in menu. Attach to emulate."); + if(plot()->getTrigInfoMap().count(trigName) == 0){ + std::string parent; + m_trigList.push_back(trigName); + setTrigEmulation(); + setTrigInfo(trigName); + } + }// emulation + } + + // set the correct schema level to save + /* 0 is very slim schema + * 1 is slim + * 2 is full */ + if(m_detailedDataLevel > 0 ){ + m_doL2Detailed=true; + m_doL2CaloDetailed=true; + } + if(m_detailedDataLevel > 1){ + m_doRecoDetailed=true; + m_doMCDetailed=true; + } + + + // Book histograms for average efficiencies and counters + //const int nTrigger = (int) m_trigList.size(); + addDirectory(m_dir+"/Expert/Event"); + std::string histname=m_anatype+"_ProbeCutCounter"; + addHistogram(new TH1F(histname.c_str(), "Number of Probes; Cut ; Count", 12, 0., 12)); + histname=m_anatype+"_TagCutCounter"; + addHistogram(new TH1F(histname.c_str(), "Number of Tags; Cut ; Count", 10, 0., 10)); + histname=m_anatype+"_Mee"; + addHistogram(new TH1F(histname.c_str(), "Offline M(ee); m_ee [GeV] ; Count", 50, m_ZeeMassMin, m_ZeeMassMax)); + histname=m_anatype+"_CutCounter"; + addHistogram(new TH1I(histname.c_str(), "Event Selection; Cut ; Count", 6, 0., 6)); + setLabels(hist1(histname),m_cutlabels); + + + addDirectory(m_dir+"/Egamma"); + + // create the TDT metadata for future access + TTree *tdtMetadata = new TTree("tdt", "Trigger metadata navigation"); + createTDTMetadata( tdtMetadata, m_trigList ); + addTree(tdtMetadata, m_dir+"/Egamma"); + + if(m_selectionZ){ + if(m_dumpTags){ + TTree *tag = new TTree( "tags", "tree of Offline Zee tags"); + bookEventBranches( tag ); + bookElectronBranches( tag ); + bookTriggerBranches( tag ); + bookTDTBranches( tag ); + bookMonteCarloBranches( tag ); + addTree(tag, m_dir+"/Egamma"); + } + TTree *probe = new TTree( "probes", "tree of Zee probes"); + bookEventBranches( probe ); + bookElectronBranches( probe ); + bookTriggerBranches( probe ); + bookTDTBranches( probe ); + bookMonteCarloBranches( probe ); + + addTree(probe, m_dir+"/Egamma"); + } + + if(m_selectionFakes){ + TTree *fakes = new TTree( "fakes", "tree of Fakes"); + bookEventBranches( fakes ); + bookElectronBranches( fakes ); + bookTriggerBranches( fakes ); + bookTDTBranches( fakes ); + bookMonteCarloBranches( fakes ); + addTree(fakes, m_dir+"/Egamma"); + } + + + + // Check for Rnn container in SG + if(m_storeGate->contains<xAOD::TrigRNNOutputContainer>("HLT_xAOD__TrigRNNOutputContainer_TrigRingerNeuralFex")){ + ATH_MSG_DEBUG("Rnn container in SG "); + setSGContainsRnn(true); + } + + + if(m_storeGate->contains<xAOD::CaloRingsContainer>("ElectronCaloRings")){ + ATH_MSG_DEBUG("Offline electron calo rings in SG"); + m_doCaloRings=true; + } + + + ///Alloc pointers + alloc_space(); + return StatusCode::SUCCESS; +} + +StatusCode TrigEgammaEventSelection::childExecute(){ + + m_eventCounter++; + + cd(m_dir+"/Expert/Event"); + + // Event Wise Selection (independent of the required signatures) + if ( !TrigEgammaNavTPBaseTool::EventWiseSelection() ) return StatusCode::SUCCESS; + + // Pass by errors in EventInfo + if( !TrigEgammaNavTPBaseTool::passesEventCleaning() ) return StatusCode::SUCCESS; + + // nvtx > 0 + if( getNPVtx() <= 0 ) return StatusCode::SUCCESS; + + if(m_selectionZ) + EventSelectionZ(); + + if(m_selectionFakes) + EventSelectionFakes(); + + + return StatusCode::SUCCESS; +} + +bool TrigEgammaEventSelection::EventSelectionZ(){ + + ATH_MSG_INFO("In EventSelectonZ..."); + // execute the standard tag and probe method + TrigEgammaNavTPBaseTool::executeTandP(); + cd(m_dir+"/Egamma"); + + for(auto Z : m_Z){ + const xAOD::Electron *elTag = m_offElectrons->at(Z.first); + const xAOD::Electron *elProbe = m_offElectrons->at(Z.second); + if(m_dumpTags) + fill( tree("tags" , m_dir+"/Egamma") , elTag ); + fill( tree("probes", m_dir+"/Egamma") , elProbe ); + + }// Loop over pairs + + return true; +} + +bool TrigEgammaEventSelection::EventSelectionFakes(){ + + + ATH_MSG_INFO("In EventSelectonFakes..."); + + for(const auto& elTag : *m_offElectrons){ + + // Remove electrons from Z or W if this is Monte Carlo + if(m_selectionMC && !isTruthElectronAny( elTag )) continue; + + if (!elTag->isGoodOQ(xAOD::EgammaParameters::BADCLUSELECTRON)) continue; + + if(!elTag->trackParticle()) continue; + + // Default is 4 GeV + if( !(elTag->e()/cosh(elTag->trackParticle()->eta()) > m_probeMinEt*Gaudi::Units::GeV) ) continue; + + //fiducial detector acceptance region + float absEta = fabs(elTag->caloCluster()->etaBE(2)); + if (absEta > 2.47) continue; + + if( !(getWTransverseMass(elTag) < 40000) ) continue; + + bool passesZveto=true; + + // If we can find any pair that falls in the Zmass window we fail the passesZveto cut + for(const auto& elProbe : *m_offElectrons){ + + if(elTag == elProbe) continue; + + if(!elProbe->isGoodOQ(xAOD::EgammaParameters::BADCLUSELECTRON)) continue; + + if(!elProbe->trackParticle()) continue; + + // Must be higher than 4 GeV + if( (getEt(elProbe)) < 4*Gaudi::Units::GeV) continue; + + if(!TrigEgammaNavTPBaseTool::ApplyElectronPid(elProbe,"LHMedium")) continue; + + //Must be an easy way with IParticle + TLorentzVector el1; + TLorentzVector el2; + el1.SetPtEtaPhiE(elTag->pt(), elTag->trackParticle()->eta(), elTag->trackParticle()->phi(), elTag->e()); + el2.SetPtEtaPhiE(elProbe->pt(), elProbe->trackParticle()->eta(), elProbe->trackParticle()->phi(), elProbe->e()); + float tpPairMass = (el1 + el2).M(); + if( !((tpPairMass > m_ZeeMassMin*Gaudi::Units::GeV) && (tpPairMass < m_ZeeMassMax*Gaudi::Units::GeV))){ + ATH_MSG_DEBUG("tag and probe pair not in Z mass window"); + continue; + }else{ + ATH_MSG_INFO("tag and probe pain in Z mass window. Regect the electron..."); + passesZveto=false; + break; + } + }// Loop over probes electrons + + if(!passesZveto) continue; + + ATH_MSG_INFO("Appling Fire trigger..."); + if(!ApplyFireTriggers( elTag )) continue; + + if(TrigEgammaNavTPBaseTool::ApplyElectronPid(elTag,"LHTight")) continue; + + ATH_MSG_INFO("Fill electron..."); + fill( tree("fakes" , m_dir+"/Egamma") , elTag ); + + + }// Loop over electrons + + return true; +} + + + +bool TrigEgammaEventSelection::fill( TTree *t, const xAOD::Electron *el){ + + + linkEventBranches(t); + linkElectronBranches(t); + linkTriggerBranches(t); + linkMonteCarloBranches(t); + + const HLT::TriggerElement* feat=nullptr; + + if(getEmulation()) + emulation()->match( el, feat ); + else{ + ATH_MSG_ERROR("Emulation tool was not configurated. Impossible to match! Please, see your python config."); + return false; + } + + if(feat){ + clear(); + fillEvent(); + fillElectron( el ); + + if(!fillMonteCarlo( el ) ){ + ATH_MSG_WARNING("Cound not found any TruthParticle for this Electron"); + } + + ///Start trigger analisys... + const xAOD::EmTauRoI *emTauRoI = getFeature<xAOD::EmTauRoI>(feat); + if(emTauRoI){ + fillEmTauRoI( emTauRoI ); + }else{ + ATH_MSG_WARNING("Cound not found EmTauRoI in this TriggerElement.."); + } + + const xAOD::TrigEMCluster *emCluster = getFeature<xAOD::TrigEMCluster>(feat); + if(emCluster){ + if(!fillTrigEMCluster( emCluster )){ + ATH_MSG_WARNING("Cound not attach the trigEMCluster information into the tree."); + } + + if(!fillTrigCaloRings( feat )){ + ATH_MSG_WARNING("Cound not attach the TrigRingerRings information into the tree."); + } + }///cluster protection + + + const xAOD::TrigElectronContainer *trigElCont = getFeature<xAOD::TrigElectronContainer>(feat); + // Level 2 ID+Calo + if(trigElCont){ + for(const auto& trigEl : *trigElCont){ + if(!fillTrigElectron(trigEl)) { + ATH_MSG_WARNING("Cound not attach the trigElectron information into the tree."); + } + }// loop over all trigElectrons for this feat + } + + const xAOD::CaloClusterContainer *caloCont = getFeature<xAOD::CaloClusterContainer>(feat); + if(caloCont){ + for(const auto& cl : *caloCont){ + if(!fillCaloCluster(cl)){ + ATH_MSG_WARNING("Cound not attach the CaloCluster information into the tree."); + } + }// loop over calo cluster + } + + + const xAOD::ElectronContainer *elCont = getFeature<xAOD::ElectronContainer>(feat); + + if(elCont){ + for(const auto& hlt_el : *elCont){ + if(!fillHLTElectron(hlt_el)) + ATH_MSG_WARNING("Cound not attach the HLT Electron information into the tree."); + } + } + + + fillTDT( el, feat ); + + + ATH_MSG_INFO("recording trigger information into the file."); + t->Fill(); + }//loop over trigger objects + + return true; +} + + +bool TrigEgammaEventSelection::fillTDT(const xAOD::Electron *el , const HLT::TriggerElement *te){ + + ATH_MSG_DEBUG("FillTDT..."); + for(auto& trigItem : m_trigList){ + + const HLT::TriggerElement* feat=nullptr; + match()->match(el, trigItem, feat); + if(feat){ + asg::AcceptData acceptData = setAccept(feat, getTrigInfo(trigItem)); + bool passedL1Calo = acceptData.getCutResult("L1Calo"); + bool passedL2Calo = acceptData.getCutResult("L2Calo"); + bool passedL2 = acceptData.getCutResult("L2"); + bool passedEFCalo = acceptData.getCutResult("EFCalo"); + bool passedHLT = acceptData.getCutResult("HLT"); + m_trig_tdt_L1_calo_accept->push_back( int(passedL1Calo) ); + m_trig_tdt_L2_calo_accept->push_back( int(passedL2Calo) ); + m_trig_tdt_L2_el_accept->push_back( int(passedL2) ); + m_trig_tdt_EF_calo_accept->push_back( int(passedEFCalo) ); + m_trig_tdt_EF_el_accept->push_back( int(passedHLT) ); + //m_trig_tdt_emu_decision_mask + count("tdt_"+trigItem+"_total"); + if(passedL1Calo) count("tdt_"+trigItem+"_L1Calo"); + if(passedL2Calo) count("tdt_"+trigItem+"_L2Calo"); + if(passedL2) count("tdt_"+trigItem+"_L2" ); + if(passedEFCalo) count("tdt_"+trigItem+"_EFCalo"); + if(passedHLT) count("tdt_"+trigItem+"_HLT" ); + + }else{ + m_trig_tdt_L1_calo_accept->push_back( -1 ); + m_trig_tdt_L2_calo_accept->push_back( -1 ); + m_trig_tdt_L2_el_accept->push_back( -1 ); + m_trig_tdt_EF_calo_accept->push_back( -1 ); + m_trig_tdt_EF_el_accept->push_back( -1 ); + } + + if(te && getEmulation()){ + asg::AcceptData acceptData = emulation()->executeTool(te, trigItem); + bool passedL1Calo = acceptData.getCutResult("L1Calo"); + bool passedL2Calo = acceptData.getCutResult("L2Calo"); + bool passedL2 = acceptData.getCutResult("L2"); + bool passedEFCalo = acceptData.getCutResult("EFCalo"); + bool passedHLT = acceptData.getCutResult("HLT"); + m_trig_tdt_emu_L1_calo_accept->push_back( int(passedL1Calo) ); + m_trig_tdt_emu_L2_calo_accept->push_back( int(passedL2Calo) ); + m_trig_tdt_emu_L2_el_accept->push_back( int(passedL2) ); + m_trig_tdt_emu_EF_calo_accept->push_back( int(passedEFCalo) ); + m_trig_tdt_emu_EF_el_accept->push_back( int(passedHLT) ); + //m_trig_tdt_emu_decision_mask + count("emu_"+trigItem+"_total"); + if(passedL1Calo) count("emu_"+trigItem+"_L1Calo"); + if(passedL2Calo) count("emu_"+trigItem+"_L2Calo"); + if(passedL2) count("emu_"+trigItem+"_L2" ); + if(passedEFCalo) count("emu_"+trigItem+"_EFCalo"); + if(passedHLT) count("emu_"+trigItem+"_HLT" ); + }else{ + m_trig_tdt_emu_L1_calo_accept->push_back( -1 ); + m_trig_tdt_emu_L2_calo_accept->push_back( -1 ); + m_trig_tdt_emu_L2_el_accept->push_back( -1 ); + m_trig_tdt_emu_EF_calo_accept->push_back( -1 ); + m_trig_tdt_emu_EF_el_accept->push_back( -1 ); + } + + + }// Loop over triggers + + + return true; + +} + + + +bool TrigEgammaEventSelection::fillTrigCaloRings( const HLT::TriggerElement *feat ){ + + ATH_MSG_DEBUG("FillTrigCaloRings..."); + /* try to get the calo rings energy for this TE!*/ + const xAOD::TrigRingerRings *ringer = getFeature<xAOD::TrigRingerRings>(feat); + if(ringer){// from this TE + for(unsigned r=0; r<ringer->size(); ++r){ + m_trig_L2_calo_rings->push_back(ringer->rings()[r]); + } + }else{// from others TEs + const xAOD::TrigEMCluster *emCluster = getFeature<xAOD::TrigEMCluster>(feat); + if(emCluster){ + // try to match without any other cluster. + TrigEgammaAnalysisBaseTool::getTrigCaloRings(emCluster, *m_trig_L2_calo_rings); + }else{ + return false; + } + } + + if(getSGContainsRnn()){ + /* try to retrieve the NN output from this TE*/ + const xAOD::TrigRNNOutput *rnn = getFeature<xAOD::TrigRNNOutput>(feat); + if(rnn){ + for(unsigned o=0; o<rnn->rnnDecision().size(); ++o) + m_trig_L2_calo_rnnOutput->push_back(rnn->rnnDecision()[o]); + }else{ + ATH_MSG_WARNING("Cound not attach the TrigRNNOutput information into the tree."); + } + } + return true; +} + + + + +bool TrigEgammaEventSelection::ApplyFireTriggers( const xAOD::Electron *el){ + + float et = getEt(el); + + std::string trigger=""; + + if(et < 5*Gaudi::Units::GeV){ + return false; + }else if(et >= 5*Gaudi::Units::GeV && et < 10*Gaudi::Units::GeV){ + trigger = "HLT_e5_etcut"; + }else if(et >= 10*Gaudi::Units::GeV && et < 15*Gaudi::Units::GeV){ + trigger = "HLT_e10_etcut_L1EM7"; + }else if(et >= 15*Gaudi::Units::GeV && et < 20*Gaudi::Units::GeV){ + trigger = "HLT_e15_etcut_L1EM7"; + }else if(et >= 20*Gaudi::Units::GeV && et < 25*Gaudi::Units::GeV){ + trigger = "HLT_e20_etcut_L1EM12"; + }else if(et >= 25*Gaudi::Units::GeV && et < 30*Gaudi::Units::GeV){ + trigger = "HLT_e25_etcut_L1EM15"; + }else if(et >= 30*Gaudi::Units::GeV && et < 40*Gaudi::Units::GeV){ + trigger = "HLT_e30_etcut_L1EM15"; + }else if(et >= 40*Gaudi::Units::GeV && et < 50*Gaudi::Units::GeV){ + trigger = "HLT_e40_etcut_L1EM15"; + }else if(et >= 50*Gaudi::Units::GeV && et < 60*Gaudi::Units::GeV){ + trigger = "HLT_e50_etcut_L1EM15"; + }else if(et >= 50*Gaudi::Units::GeV && et < 60*Gaudi::Units::GeV){ + trigger = "HLT_e60_etcut"; + }else if(et >= 60*Gaudi::Units::GeV && et < 70*Gaudi::Units::GeV){ + trigger = "HLT_e70_etcut"; + }else if(et >= 70*Gaudi::Units::GeV && et < 80*Gaudi::Units::GeV){ + trigger = "HLT_e80_etcut"; + }else if(et >= 80*Gaudi::Units::GeV && et < 100*Gaudi::Units::GeV){ + trigger = "HLT_e100_etcut"; + }else if(et >= 100*Gaudi::Units::GeV && et < 120*Gaudi::Units::GeV){ + trigger = "HLT_e120_etcut"; + }else{ + return true; + } + + const HLT::TriggerElement *te; + match()->match(el,trigger,te); + bool passedHLT = ancestorPassed<xAOD::ElectronContainer>(te); + + if(!passedHLT) return false; + + return true; +} + + + +StatusCode TrigEgammaEventSelection::childFinalize(){ + + for(auto& trigItem : m_trigList){ + ATH_MSG_DEBUG("From TDT tool:"); + ATH_MSG_DEBUG(trigItem << " total = " << m_countMap["tdt_"+trigItem+"_total"] ); + ATH_MSG_DEBUG(trigItem << " L1Calo = " << m_countMap["tdt_"+trigItem+"_L1Calo"]); + ATH_MSG_DEBUG(trigItem << " L2Calo = " << m_countMap["tdt_"+trigItem+"_L2Calo"]); + ATH_MSG_DEBUG(trigItem << " L2 = " << m_countMap["tdt_"+trigItem+"_L2"] ); + ATH_MSG_DEBUG(trigItem << " EFCalo = " << m_countMap["tdt_"+trigItem+"_EFCalo"]); + ATH_MSG_DEBUG(trigItem << " HLT = " << m_countMap["tdt_"+trigItem+"_HLT"] ); + ATH_MSG_DEBUG("From emulation tool:"); + ATH_MSG_DEBUG(trigItem << " total = " << m_countMap["emu_"+trigItem+"_total"] ); + ATH_MSG_DEBUG(trigItem << " L1Calo = " << m_countMap["emu_"+trigItem+"_L1Calo"]); + ATH_MSG_DEBUG(trigItem << " L2Calo = " << m_countMap["emu_"+trigItem+"_L2Calo"]); + ATH_MSG_DEBUG(trigItem << " L2 = " << m_countMap["emu_"+trigItem+"_L2"] ); + ATH_MSG_DEBUG(trigItem << " EFCalo = " << m_countMap["emu_"+trigItem+"_EFCalo"]); + ATH_MSG_DEBUG(trigItem << " HLT = " << m_countMap["emu_"+trigItem+"_HLT"] ); + } + return StatusCode::SUCCESS; +} + + +bool TrigEgammaEventSelection::fillEmTauRoI( const xAOD::EmTauRoI *emTauRoI ){ + + ATH_MSG_DEBUG("FillEmTauRoI..."); + m_trig_L1_eta = emTauRoI->eta(); + m_trig_L1_phi = emTauRoI->phi(); + m_trig_L1_emClus = emTauRoI->emClus(); + m_trig_L1_tauClus = emTauRoI->tauClus(); + m_trig_L1_emIsol = emTauRoI->emIsol(); + m_trig_L1_hadIsol = emTauRoI->hadIsol(); + m_trig_L1_hadCore = emTauRoI->hadCore(); + return true; +} + +bool TrigEgammaEventSelection::fillTrigEMCluster( const xAOD::TrigEMCluster *emCluster ){ + + ATH_MSG_DEBUG("FillTrigEMCluster..."); + m_trig_L2_calo_et = emCluster->et(); + m_trig_L2_calo_eta = emCluster->eta(); + m_trig_L2_calo_phi = emCluster->phi(); + m_trig_L2_calo_emaxs1 = emCluster->emaxs1(); + m_trig_L2_calo_e2tsts1 = emCluster->e2tsts1(); + m_trig_L2_calo_e237 = emCluster->e237(); + m_trig_L2_calo_e277 = emCluster->e277(); + m_trig_L2_calo_ehad1 = emCluster->ehad1(); + m_trig_L2_calo_weta2 = emCluster->weta2(); + m_trig_L2_calo_wstot = emCluster->wstot(); + m_trig_L2_calo_fracs1 = emCluster->fracs1(); + for(unsigned i=0; i<emCluster->energySample().size(); ++i){ + m_trig_L2_calo_energySample->push_back( emCluster->energySample().at(i)); + } + + return true; +} + + +bool TrigEgammaEventSelection::fillTrigElectron( const xAOD::TrigElectron *trigEl ){ + ATH_MSG_DEBUG("FillTrigElectron..."); + //const xAOD::TrackParticle* trkIter = trigEl->trackParticle(); + //if (trkIter==nullptr) return false; // disconsider candidates without track + //int algoId = 0; + //if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::FastTrackFinderSeed] ) algoId=9; + //if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyA] ) algoId=5; + //if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyB] ) algoId=6; + //if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyC] ) algoId=7; + + //m_trig_L2_el_trackAlgID ->push_back(algoId); + m_trig_L2_el_caloEta ->push_back(trigEl->caloEta()); + m_trig_L2_el_trkClusDphi ->push_back(trigEl->trkClusDphi()); + m_trig_L2_el_trkClusDeta ->push_back(trigEl->trkClusDeta()); + m_trig_L2_el_pt ->push_back(trigEl->pt()); + m_trig_L2_el_phi ->push_back(trigEl->phi()); + m_trig_L2_el_eta ->push_back(trigEl->eta()); + m_trig_L2_el_etOverPt ->push_back(trigEl->etOverPt()); + m_trig_L2_el_nTRTHits ->push_back(trigEl->nTRTHits()); + m_trig_L2_el_nTRTHiThresholdHits->push_back(trigEl->nTRTHiThresholdHits()); + m_trig_L2_el_charge ->push_back(trigEl->charge()); + return true; +} + + +bool TrigEgammaEventSelection::fillCaloCluster( const xAOD::CaloCluster *cluster){ + + ATH_MSG_DEBUG("FillCaloCluster..."); + m_trig_EF_calo_et->push_back(cluster->et()); + m_trig_EF_calo_eta->push_back(cluster->eta()); + m_trig_EF_calo_phi->push_back(cluster->phi()); + m_trig_EF_calo_etaBE2->push_back(cluster->etaBE(2)); + m_trig_EF_calo_e->push_back(cluster->e()); + + return true; +} + +bool TrigEgammaEventSelection::fillEvent(){ + ///Event information + ATH_MSG_DEBUG("FillEvent..."); + m_runNumber = m_eventInfo->runNumber(); + m_eventNumber = m_eventInfo->eventNumber(); + m_lumiBlock = m_eventInfo->lumiBlock(); + m_avgmu=getAvgMu(); + return true; +} + +bool TrigEgammaEventSelection::fillElectron( const xAOD::Electron *el ){ + + ATH_MSG_DEBUG("FillElectron..."); + ///Cluster information + uint8_t nblayerhits(0); + uint8_t nblayerolhits(0); + uint8_t npixhits(0); + uint8_t npixolhits(0); + uint8_t nscthits(0); + uint8_t nsctolhits(0); + uint8_t ntrthighthreshits(0); + uint8_t ntrthighthresolhits(0); + uint8_t ntrthits(0); + uint8_t ntrtolhits(0); + uint8_t ntrtxenonhits(0); + uint8_t npixdeadsensors(0); + uint8_t nsctdeadsensors(0); + uint8_t expectblayerhit(true); + uint8_t expectNextToInnerMostLayer(true); + uint8_t nNextToInnerMostLayerHits(0); + uint8_t nNextToInnerMostLayerOutliers(0); + float val(0); + bool hasCalo(false); + bool hasTrack(false); + + + + m_el_e = el->e(); + m_el_et = el->pt(); + m_el_eta = el->eta(); + m_el_phi = el->phi(); + + el->showerShapeValue( m_el_ethad1 , xAOD::EgammaParameters::ShowerShapeType::ethad1 ); + el->showerShapeValue( m_el_ehad1 , xAOD::EgammaParameters::ShowerShapeType::ehad1 ); + el->showerShapeValue( m_el_f1 , xAOD::EgammaParameters::ShowerShapeType::f1 ); // LH + el->showerShapeValue( m_el_f3 , xAOD::EgammaParameters::ShowerShapeType::f3 ); // LH + el->showerShapeValue( m_el_f1core , xAOD::EgammaParameters::ShowerShapeType::f1core ); + el->showerShapeValue( m_el_f3core , xAOD::EgammaParameters::ShowerShapeType::f3core ); + el->showerShapeValue( m_el_weta1 , xAOD::EgammaParameters::ShowerShapeType::weta1 ); // LH (new) + el->showerShapeValue( m_el_weta2 , xAOD::EgammaParameters::ShowerShapeType::weta2 ); // LH + el->showerShapeValue( m_el_wtots1 , xAOD::EgammaParameters::ShowerShapeType::wtots1 ); + el->showerShapeValue( m_el_fracs1 , xAOD::EgammaParameters::ShowerShapeType::fracs1 ); + el->showerShapeValue( m_el_Reta , xAOD::EgammaParameters::ShowerShapeType::Reta ); // LH + el->showerShapeValue( m_el_Rphi , xAOD::EgammaParameters::ShowerShapeType::Rphi ); // LH + el->showerShapeValue( m_el_Eratio , xAOD::EgammaParameters::ShowerShapeType::Eratio ); // LH + el->showerShapeValue( m_el_Rhad , xAOD::EgammaParameters::ShowerShapeType::Rhad ); // LH + el->showerShapeValue( m_el_Rhad1 , xAOD::EgammaParameters::ShowerShapeType::Rhad1 ); // LH + el->showerShapeValue( m_el_deltaE , xAOD::EgammaParameters::ShowerShapeType::DeltaE ); // LH + el->showerShapeValue( m_el_e277 , xAOD::EgammaParameters::ShowerShapeType::e277 ); // LH + ///Combined track/Cluter information + el->trackCaloMatchValue( m_el_deta2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaEta2 ); + el->trackCaloMatchValue( m_el_dphi2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhi2 ); + el->trackCaloMatchValue( m_el_dphiresc , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhiRescaled0 ); + m_el_deltaPhiRescaled2 = get_el_deltaPhiRescaled2(el); // LH + m_el_deltaEta1 = get_el_deltaEta1(el); // LH + + if(el->caloCluster()){ + hasCalo=true; + m_el_calo_et = getCluster_et( el ); + m_el_calo_eta = getCluster_eta( el ); + m_el_calo_phi = getCluster_phi( el ); + m_el_calo_etaBE2 = el->caloCluster()->etaBE(2); // LH + m_el_calo_e = el->caloCluster()->e(); // LH + } + + ///Track particle information + const xAOD::TrackParticle *track = el->trackParticle(); + if(track){ + hasTrack=true; + track->summaryValue( nblayerhits , xAOD::SummaryType::numberOfBLayerHits ); + track->summaryValue( nblayerolhits , xAOD::SummaryType::numberOfBLayerOutliers ); + track->summaryValue( npixhits , xAOD::SummaryType::numberOfPixelHits ); + track->summaryValue( npixolhits , xAOD::SummaryType::numberOfPixelOutliers ); + track->summaryValue( npixdeadsensors , xAOD::SummaryType::numberOfPixelDeadSensors); + track->summaryValue( nscthits , xAOD::SummaryType::numberOfSCTHits ); + track->summaryValue( nsctolhits , xAOD::SummaryType::numberOfSCTOutliers ); + track->summaryValue( nsctdeadsensors , xAOD::SummaryType::numberOfSCTDeadSensors); + track->summaryValue( ntrthits , xAOD::SummaryType::numberOfTRTHits); + track->summaryValue( ntrtolhits , xAOD::SummaryType::numberOfTRTOutliers ); + track->summaryValue( ntrthighthreshits , xAOD::SummaryType::numberOfTRTHighThresholdHits ); + track->summaryValue( ntrthighthresolhits , xAOD::SummaryType::numberOfTRTHighThresholdOutliers ); + track->summaryValue( ntrtxenonhits , xAOD::SummaryType::numberOfTRTXenonHits ); + track->summaryValue( expectblayerhit , xAOD::SummaryType::expectBLayerHit ); + track->summaryValue( expectNextToInnerMostLayer , xAOD::expectNextToInnermostPixelLayerHit); + track->summaryValue( nNextToInnerMostLayerHits , xAOD::numberOfNextToInnermostPixelLayerHits); + track->summaryValue( nNextToInnerMostLayerOutliers, xAOD::numberOfNextToInnermostPixelLayerOutliers); + + m_el_trk_pt = track->pt(); + m_el_trk_eta = track->eta(); + m_el_trk_charge = track->charge(); // LH + m_el_trk_qOverP = track->qOverP(); // LH + m_el_trk_sigd0 = get_el_sigd0(el); // LH + m_el_trk_d0 = get_el_d0(el); // LH + m_el_trk_eProbabilityHT = get_el_eProbabilityHT(el); // LH + m_el_trk_transformed_eProbabilityHT=get_el_transformed_eProbabilityHT(el); // LH + m_el_trk_d0significance = get_el_d0significance(el); + m_el_trk_deltaPOverP = get_el_DeltaPOverP(el); // LH + + } + + ///Extra information about pileup + m_el_nGoodVtx = getNGoodVertex(); + m_el_nPileupPrimaryVtx = getNPVtx(); + + auto ctx = Gaudi::Hive::currentContext() ; + // rerun Likelihood Veryloose selector tool + bool accept=(bool)m_electronLHVLooseTool->accept(ctx,el, getAvgMu()); + m_el_lhVLoose = accept; + m_el_loose = ApplyElectronPid(el, "Loose"); + m_el_medium = ApplyElectronPid(el, "Medium"); + m_el_tight = ApplyElectronPid(el, "Tight"); + m_el_lhLoose = ApplyElectronPid(el, "LHLoose"); + m_el_lhMedium = ApplyElectronPid(el, "LHMedium"); + m_el_lhTight = ApplyElectronPid(el, "LHTight"); + + + // Do not change this order! + m_el_trk_summaryValues->push_back( nblayerhits ); + m_el_trk_summaryValues->push_back( nblayerolhits ); + m_el_trk_summaryValues->push_back( npixhits ); + m_el_trk_summaryValues->push_back( npixolhits ); + m_el_trk_summaryValues->push_back( npixdeadsensors ); + m_el_trk_summaryValues->push_back( nscthits ); + m_el_trk_summaryValues->push_back( nsctolhits ); + m_el_trk_summaryValues->push_back( nsctdeadsensors ); + m_el_trk_summaryValues->push_back( ntrthits ); + m_el_trk_summaryValues->push_back( ntrtolhits ); + m_el_trk_summaryValues->push_back( ntrthighthreshits ); + m_el_trk_summaryValues->push_back( ntrthighthresolhits ); + m_el_trk_summaryValues->push_back( ntrtxenonhits ); + m_el_trk_summaryValues->push_back( expectblayerhit ); + m_el_trk_summaryValues->push_back( expectNextToInnerMostLayer ); + m_el_trk_summaryValues->push_back( nNextToInnerMostLayerHits ); + m_el_trk_summaryValues->push_back( nNextToInnerMostLayerOutliers ); + + //Add isolations values + el->isolationValue(val,xAOD::Iso::etcone20); + m_el_etCone->push_back(val); + el->isolationValue(val,xAOD::Iso::etcone30); + m_el_etCone->push_back(val); + el->isolationValue(val,xAOD::Iso::etcone40); + m_el_etCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptcone20); + m_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptcone30); + m_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptcone40); + m_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptvarcone20); + m_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptvarcone30); + m_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptvarcone40); + m_el_ptCone->push_back(val); + + m_el_hasCalo=hasCalo; + m_el_hasTrack=hasTrack; + + + if(m_doCaloRings){ + ATH_MSG_DEBUG("Fill Electron calo rings..."); + if(!TrigEgammaAnalysisBaseTool::getCaloRings( el , *m_el_ringsE)){ + ATH_MSG_WARNING("Could not attach the calorRings information."); + } + } + + + + return true; +} + + +bool TrigEgammaEventSelection::fillHLTElectron( const xAOD::Electron *el ){ + + ATH_MSG_DEBUG("FillHLTElectron..."); + float calo_e(0); + float calo_et(0); + float calo_eta(0); + float calo_phi(0); + float calo_etaBE2(0); + float eta(0); + float et(0); + //float eta2(0); + float phi(0); + float pt(0); + float trk_eta(0); + float ethad1(0); + float ehad1(0); + float f1(0); + float f3(0); + float f1core(0); + float f3core(0); + float weta1(0); + float weta2(0); + float wtots1(0); + float fracs1(0); + float Reta(0); + float Rphi(0); + float Eratio(0); + float Rhad(0); + float Rhad1(0); + float deta1(0); + float deta2(0); + float dphi2(0); + float dphiresc(0); + float charge(0); + float qOverP(0); + float sigd0(0); + float d0(0); + //float eprobht(0); + float eProbabilityHT(0); + float transformed_eProbabilityHT(0); + float d0significance(0); + float deltaPhiRescaled2(0); + float deltaPOverP(0); + float e(0); + float e277(0); + float deltaE(0); + uint8_t nblayerhits(0); + uint8_t nblayerolhits(0); + uint8_t npixhits(0); + uint8_t npixolhits(0); + uint8_t nscthits(0); + uint8_t nsctolhits(0); + uint8_t ntrthighthreshits(0); + uint8_t ntrthighthresolhits(0); + uint8_t ntrthits(0); + uint8_t ntrtolhits(0); + uint8_t ntrtxenonhits(0); + uint8_t npixdeadsensors(0); + uint8_t nsctdeadsensors(0); + uint8_t expectblayerhit(true); + uint8_t expectNextToInnerMostLayer(true); + uint8_t nNextToInnerMostLayerHits(0); + uint8_t nNextToInnerMostLayerOutliers(0); + float val(0) ; + + bool hasCalo(false); + bool hasTrack(false); + + + ATH_MSG_DEBUG("FillElectron..."); + + ///Cluster information + e = el->e(); + et = el->pt(); + eta = el->eta(); + phi = el->phi(); + + el->showerShapeValue( ethad1 , xAOD::EgammaParameters::ShowerShapeType::ethad1 ); + el->showerShapeValue( ehad1 , xAOD::EgammaParameters::ShowerShapeType::ehad1 ); + el->showerShapeValue( f1 , xAOD::EgammaParameters::ShowerShapeType::f1 ); // LH, isEM + el->showerShapeValue( f3 , xAOD::EgammaParameters::ShowerShapeType::f3 ); // LH, isEM + el->showerShapeValue( f1core , xAOD::EgammaParameters::ShowerShapeType::f1core ); + el->showerShapeValue( f3core , xAOD::EgammaParameters::ShowerShapeType::f3core ); // isEM + el->showerShapeValue( weta1 , xAOD::EgammaParameters::ShowerShapeType::weta1 ); // LH, isEM (new) + el->showerShapeValue( weta2 , xAOD::EgammaParameters::ShowerShapeType::weta2 ); // LH, isEM + el->showerShapeValue( wtots1 , xAOD::EgammaParameters::ShowerShapeType::wtots1 ); // LH, isEM + el->showerShapeValue( fracs1 , xAOD::EgammaParameters::ShowerShapeType::fracs1 ); // isEM + el->showerShapeValue( Reta , xAOD::EgammaParameters::ShowerShapeType::Reta ); // LH, isEM + el->showerShapeValue( Rphi , xAOD::EgammaParameters::ShowerShapeType::Rphi ); // LH, isEM + el->showerShapeValue( Eratio , xAOD::EgammaParameters::ShowerShapeType::Eratio ); // LH, isEM + el->showerShapeValue( Rhad , xAOD::EgammaParameters::ShowerShapeType::Rhad ); // LH, isEM + el->showerShapeValue( Rhad1 , xAOD::EgammaParameters::ShowerShapeType::Rhad1 ); // LH, isEM + el->showerShapeValue( e277 , xAOD::EgammaParameters::e277 ); // isEM (new) + el->showerShapeValue( deltaE , xAOD::EgammaParameters::DeltaE ); // isEM (new) + + ///Combined track/Cluter information + el->trackCaloMatchValue( deta2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaEta2 ); + el->trackCaloMatchValue( dphi2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhi2 ); + el->trackCaloMatchValue( dphiresc , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhiRescaled0 ); + deltaPhiRescaled2 = get_el_deltaPhiRescaled2(el); // LH + deta1 = get_el_deltaEta1(el); // LH + + if(el->caloCluster()){ + hasCalo=true; + calo_et = getCluster_et( el ); + calo_eta = getCluster_eta( el ); + calo_phi = getCluster_phi( el ); + calo_etaBE2 = el->caloCluster()->etaBE(2); // LH + calo_e = el->caloCluster()->e(); // LH + } + + + + ///Track particle information + const xAOD::TrackParticle *track = el->trackParticle(); + if(track){ + hasTrack=true; + // track->summaryValue( eprobht , xAOD::SummaryType::eProbabilityHT ); // LH + track->summaryValue( nblayerhits , xAOD::SummaryType::numberOfBLayerHits ); // LH, isEM + track->summaryValue( nblayerolhits , xAOD::SummaryType::numberOfBLayerOutliers ); // LH, isEM + track->summaryValue( npixhits , xAOD::SummaryType::numberOfPixelHits ); // LH, isEM + track->summaryValue( npixolhits , xAOD::SummaryType::numberOfPixelOutliers ); // isEM + track->summaryValue( npixdeadsensors , xAOD::SummaryType::numberOfPixelDeadSensors); // LH, isEM + track->summaryValue( nscthits , xAOD::SummaryType::numberOfSCTHits ); // LH, isEM + track->summaryValue( nsctolhits , xAOD::SummaryType::numberOfSCTOutliers ); // isEM + track->summaryValue( nsctdeadsensors , xAOD::SummaryType::numberOfSCTDeadSensors); // isEM + track->summaryValue( ntrthits , xAOD::SummaryType::numberOfTRTHits); // isEM + track->summaryValue( ntrtolhits , xAOD::SummaryType::numberOfTRTOutliers ); // isEM + track->summaryValue( ntrthighthreshits , xAOD::SummaryType::numberOfTRTHighThresholdHits ); // isEM + track->summaryValue( ntrthighthresolhits , xAOD::SummaryType::numberOfTRTHighThresholdOutliers ); // isEM + track->summaryValue( ntrtxenonhits , xAOD::SummaryType::numberOfTRTXenonHits ); // isEM + track->summaryValue( expectblayerhit , xAOD::SummaryType::expectBLayerHit ); // LH, isEM + track->summaryValue( expectNextToInnerMostLayer , xAOD::expectNextToInnermostPixelLayerHit); // LH, isEM + track->summaryValue( nNextToInnerMostLayerHits , xAOD::numberOfNextToInnermostPixelLayerHits); // LH, isEM + track->summaryValue( nNextToInnerMostLayerOutliers, xAOD::numberOfNextToInnermostPixelLayerOutliers); // LH, isEM + + pt = track->pt(); + trk_eta = track->eta(); // LH + charge = track->charge(); // LH + qOverP = track->qOverP(); // LH, isEM + sigd0 = get_el_sigd0(el); // LH + d0 = get_el_d0(el); // LH, isEM + eProbabilityHT = get_el_eProbabilityHT(el); // LH, isEM + transformed_eProbabilityHT=get_el_transformed_eProbabilityHT(el); // LH + d0significance = get_el_d0significance(el); + deltaPOverP = get_el_DeltaPOverP(el); // LH + } + + auto avgmu=getAvgMu(); + + m_trig_EF_el_hasCalo ->push_back( hasCalo ); + m_trig_EF_el_hasTrack ->push_back( hasTrack ); + + auto ctx = Gaudi::Hive::currentContext(); + m_trig_EF_calo_tight ->push_back((bool)(m_EFCaloElectronIsEMSelectors[0]->accept(ctx,el))); + m_trig_EF_calo_medium ->push_back((bool)(m_EFCaloElectronIsEMSelectors[1]->accept(ctx,el))); + m_trig_EF_calo_loose ->push_back((bool)(m_EFCaloElectronIsEMSelectors[2]->accept(ctx,el))); + m_trig_EF_calo_lhtight ->push_back((bool)(m_EFCaloElectronLHSelectors[0]->accept(ctx,el,avgmu))); + m_trig_EF_calo_lhmedium ->push_back((bool)(m_EFCaloElectronLHSelectors[1]->accept(ctx,el,avgmu))); + m_trig_EF_calo_lhloose ->push_back((bool)(m_EFCaloElectronLHSelectors[2]->accept(ctx,el,avgmu))); + m_trig_EF_calo_lhvloose ->push_back((bool)(m_EFCaloElectronLHSelectors[3]->accept(ctx,el,avgmu))); + + m_trig_EF_el_tight ->push_back((bool)(m_HLTElectronIsEMSelectors[0]->accept(ctx,el))); + m_trig_EF_el_medium ->push_back((bool)(m_HLTElectronIsEMSelectors[1]->accept(ctx,el))); + m_trig_EF_el_loose ->push_back((bool)(m_HLTElectronIsEMSelectors[2]->accept(ctx,el))); + m_trig_EF_el_lhtight ->push_back((bool)(m_HLTElectronLHSelectors[0]->accept(ctx,el,avgmu))); + m_trig_EF_el_lhmedium ->push_back((bool)(m_HLTElectronLHSelectors[1]->accept(ctx,el,avgmu))); + m_trig_EF_el_lhloose ->push_back((bool)(m_HLTElectronLHSelectors[2]->accept(ctx,el,avgmu))); + m_trig_EF_el_lhvloose ->push_back((bool)(m_HLTElectronLHSelectors[3]->accept(ctx,el,avgmu))); + + m_trig_EF_el_calo_et ->push_back( calo_et); + m_trig_EF_el_calo_eta ->push_back( calo_eta ); + m_trig_EF_el_calo_phi ->push_back( calo_phi ); + m_trig_EF_el_calo_etaBE2 ->push_back( calo_etaBE2 ); + m_trig_EF_el_calo_e ->push_back( calo_e ); + + m_trig_EF_el_et ->push_back( et ); + m_trig_EF_el_eta ->push_back( eta ); + m_trig_EF_el_phi ->push_back( phi ); + m_trig_EF_el_e ->push_back( e ); + m_trig_EF_el_e277 ->push_back( e277 ); + m_trig_EF_el_deltaE ->push_back( deltaE ); + m_trig_EF_el_ethad1 ->push_back( ethad1 ); + m_trig_EF_el_ehad1 ->push_back( ehad1 ); + m_trig_EF_el_f1 ->push_back( f1 ); + m_trig_EF_el_f3 ->push_back( f3 ); + m_trig_EF_el_f1core ->push_back( f1core ); + m_trig_EF_el_f3core ->push_back( f3core ); + m_trig_EF_el_weta1 ->push_back( weta1 ); + m_trig_EF_el_weta2 ->push_back( weta2 ); + m_trig_EF_el_wtots1 ->push_back( wtots1 ); + m_trig_EF_el_fracs1 ->push_back( fracs1 ); + m_trig_EF_el_Reta ->push_back( Reta ); + m_trig_EF_el_Rphi ->push_back( Rphi ); + m_trig_EF_el_Eratio ->push_back( Eratio ); + m_trig_EF_el_Rhad ->push_back( Rhad ); + m_trig_EF_el_Rhad1 ->push_back( Rhad1 ); + m_trig_EF_el_deta2 ->push_back( deta2 ); + m_trig_EF_el_dphi2 ->push_back( dphi2 ); + m_trig_EF_el_dphiresc ->push_back( dphiresc ); + m_trig_EF_el_deltaEta1 ->push_back( deta1 ); + m_trig_EF_el_deltaPhiRescaled2 ->push_back( deltaPhiRescaled2 ); + + m_trig_EF_el_trk_pt ->push_back( pt ); + m_trig_EF_el_trk_eta ->push_back( trk_eta ); + m_trig_EF_el_trk_charge ->push_back( charge ); + m_trig_EF_el_trk_qOverP ->push_back( qOverP ); + m_trig_EF_el_trk_sigd0 ->push_back( sigd0 ); + m_trig_EF_el_trk_d0 ->push_back( d0 ); + m_trig_EF_el_trk_eProbabilityHT ->push_back( eProbabilityHT ); + m_trig_EF_el_trk_transformed_eProbabilityHT ->push_back( transformed_eProbabilityHT ); + m_trig_EF_el_trk_d0significance ->push_back( d0significance ); + m_trig_EF_el_trk_deltaPOverP ->push_back( deltaPOverP ); + + + m_trig_EF_el_trk_summaryValues->push_back( nblayerhits ); + m_trig_EF_el_trk_summaryValues->push_back( nblayerolhits ); + m_trig_EF_el_trk_summaryValues->push_back( npixhits ); + m_trig_EF_el_trk_summaryValues->push_back( npixolhits ); + m_trig_EF_el_trk_summaryValues->push_back( npixdeadsensors ); + m_trig_EF_el_trk_summaryValues->push_back( nscthits ); + m_trig_EF_el_trk_summaryValues->push_back( nsctolhits ); + m_trig_EF_el_trk_summaryValues->push_back( nsctdeadsensors ); + m_trig_EF_el_trk_summaryValues->push_back( ntrthits ); + m_trig_EF_el_trk_summaryValues->push_back( ntrtolhits ); + m_trig_EF_el_trk_summaryValues->push_back( ntrthighthreshits ); + m_trig_EF_el_trk_summaryValues->push_back( ntrthighthresolhits ); + m_trig_EF_el_trk_summaryValues->push_back( ntrtxenonhits ); + m_trig_EF_el_trk_summaryValues->push_back( expectblayerhit ); + m_trig_EF_el_trk_summaryValues->push_back( expectNextToInnerMostLayer ); + m_trig_EF_el_trk_summaryValues->push_back( nNextToInnerMostLayerHits ); + m_trig_EF_el_trk_summaryValues->push_back( nNextToInnerMostLayerOutliers ); + + //Add isolations values + el->isolationValue(val,xAOD::Iso::etcone20); + m_trig_EF_el_etCone->push_back(val); + el->isolationValue(val,xAOD::Iso::etcone30); + m_trig_EF_el_etCone->push_back(val); + el->isolationValue(val,xAOD::Iso::etcone40); + m_trig_EF_el_etCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptcone20); + m_trig_EF_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptcone30); + m_trig_EF_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptcone40); + m_trig_EF_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptvarcone20); + m_trig_EF_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptvarcone30); + m_trig_EF_el_ptCone->push_back(val); + el->isolationValue(val,xAOD::Iso::ptvarcone40); + m_trig_EF_el_ptCone->push_back(val); + + + return true; +} + + + +// if true: is Z or W Or not MC if false: not electron or not Z||W mother +bool TrigEgammaEventSelection::isTruthElectronAny(const xAOD::Egamma *eg ){ + if(m_truthContainer){ + const xAOD::TruthParticle *mc=nullptr; + MonteCarlo::PDGID pdg = pdgid(eg, m_truthContainer,mc); + if(mc){ + bool Z,W,e; + Z=W=e=false; + if(pdg == MonteCarlo::PDGID::ZMother) Z = true; + if(pdg == MonteCarlo::PDGID::WMother) W = true; + if(mc->isElectron()) e=true; + return !(e && (Z||W)); + } + } + return true; +} + + +bool TrigEgammaEventSelection::fillMonteCarlo(const xAOD::Egamma *eg){ + + if(m_truthContainer){ + const xAOD::TruthParticle *mc=nullptr; + MonteCarlo::PDGID pdg = pdgid(eg, m_truthContainer,mc); + if(mc){ + m_mc_hasMC = true; + m_mc_pt = mc->pt(); + m_mc_eta = mc->eta(); + m_mc_phi = mc->phi(); + m_mc_isTop = mc->isTop(); + m_mc_isQuark = mc->isQuark(); + m_mc_isParton = mc->isParton(); + m_mc_isMeson = mc->isMeson(); + m_mc_isTau = mc->isTau(); + m_mc_isMuon = mc->isMuon(); + m_mc_isPhoton = mc->isPhoton(); + m_mc_isElectron = mc->isElectron(); + if(pdg == MonteCarlo::PDGID::ZMother) m_mc_hasZMother = true; + if(pdg == MonteCarlo::PDGID::WMother) m_mc_hasWMother = true; + return true; + }//has match + }//has truth container + return false; +} + + +bool TrigEgammaEventSelection::fillCaloRings( const xAOD::Electron *el ){ + return TrigEgammaAnalysisBaseTool::getCaloRings(el, *m_el_ringsE ); +} + + +//! ============================================================================================================ + + +double TrigEgammaEventSelection::get_el_sigd0(const xAOD::Electron *el){ + float vard0 = el->trackParticle()->definingParametersCovMatrix()(0,0); // Cov matrix in vector form + if(vard0>0.0) + return sqrt(vard0); // variance of d0 + return 0.0; +} + +double TrigEgammaEventSelection::get_el_d0(const xAOD::Electron *el){ + return el->trackParticle()->d0(); +} + + +double TrigEgammaEventSelection::get_el_eProbabilityHT(const xAOD::Electron *el){ + float TRT_PID = 0; + el->trackParticle()->summaryValue(TRT_PID, xAOD::eProbabilityHT); + return TRT_PID; +} + + +double TrigEgammaEventSelection::get_el_transformed_eProbabilityHT(const xAOD::Electron *el){ + double TRT_PID = get_el_eProbabilityHT(el); + double epsilon = 1e-30; + if(TRT_PID >= 1.0) TRT_PID = 1.0 - 1.e-15; + else if(TRT_PID <= epsilon) TRT_PID = epsilon; + double tau = 15.0; + TRT_PID = -(1/tau) * log( (1.0/TRT_PID) - 1.0); + return TRT_PID; +} + + +double TrigEgammaEventSelection::get_el_d0significance(const xAOD::Electron *el){ + double d0 = get_el_d0(el); + double sigd0 = get_el_sigd0(el); + return (sigd0 != 0) ? fabs(d0/sigd0) : 0; +} + +double TrigEgammaEventSelection::get_el_deltaPhiRescaled2(const xAOD::Electron *el){ + float deltaPhiRescaled2 = 0; + el->trackCaloMatchValue(deltaPhiRescaled2, xAOD::EgammaParameters::deltaPhiRescaled2); + return deltaPhiRescaled2; +} + + +double TrigEgammaEventSelection::get_el_deltaEta1(const xAOD::Electron *el){ + float deltaEta1 = 0; + el->trackCaloMatchValue(deltaEta1, xAOD::EgammaParameters::deltaEta1); + return deltaEta1; +} + + +double TrigEgammaEventSelection::get_el_DeltaPOverP(const xAOD::Electron *el){ + unsigned int index; + if(el->trackParticle()->indexOfParameterAtPosition(index,xAOD::LastMeasurement)){ + double LMPX = el->trackParticle()->parameterPX(index); + double LMPY = el->trackParticle()->parameterPY(index); + double LMPZ = el->trackParticle()->parameterPZ(index); + double refittedTrack_LMP = sqrt(LMPX*LMPX + LMPY*LMPY + LMPZ*LMPZ); + double refittedTrack_LMqOverP = el->trackParticle()->charge() / refittedTrack_LMP; + double unrefittedTrack_qOverP = el->trackParticle()->qOverP(); + return 1 - (unrefittedTrack_qOverP / refittedTrack_LMqOverP); + } + else + return 0.0; +} + + diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx index 0c030885532abd2bc6681761433986678cc976d7..b071f53faa5365e5105c9582e00554a7d1e85d68 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx @@ -27,13 +27,25 @@ StatusCode TrigEgammaNavAnalysisTool::childBook(){ m_dir=plot()->getBasePath(); std::vector<std::string> chains = tdt()->getListOfTriggers("HLT_e.*, L1_EM.*, HLT_g.*"); - for(const auto trigName:m_trigInputList){ - if (std::find(chains.begin(), chains.end(), trigName) != chains.end()) { + for(const auto trigName:m_trigInputList){ + if (std::find(chains.begin(), chains.end(), trigName) != chains.end()){ if(plot()->getTrigInfoMap().count(trigName) != 0) ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName); - else + else { m_trigList.push_back(trigName); + setTrigInfo(trigName); + } } + // Special code to attach trigger without of the menu + else if(getEmulation() && m_forceTrigAttachment){// + ATH_MSG_INFO("Trigger doesn't exist in menu. Attach to emulate."); + if(plot()->getTrigInfoMap().count(trigName) == 0){ + m_trigList.push_back(trigName); + setTrigEmulation(); + setTrigInfo(trigName); + } + } + } // Container level kinematic histograms @@ -57,8 +69,6 @@ StatusCode TrigEgammaNavAnalysisTool::childBook(){ setLabels(plot()->hist1(m_anatype+"_trigger_counts"),m_trigList); } - for (const auto trigger: m_trigList) - setTrigInfo(trigger); plot()->setEmulation(getEmulation()); if(plot()->book(getTrigInfoMap()).isFailure()) { @@ -79,6 +89,21 @@ StatusCode TrigEgammaNavAnalysisTool::childExecute(){ ATH_MSG_DEBUG("Fails EventWise selection"); return StatusCode::SUCCESS; //return nicely } + // Check for Rnn container in SG + if(m_storeGate->contains<xAOD::TrigRNNOutputContainer>("HLT_xAOD__TrigRNNOutputContainer_TrigRingerNeuralFex")){ + ATH_MSG_DEBUG("Rnn container in SG "); + setSGContainsRnn(true); + } + if(m_storeGate->contains<xAOD::TrigPhotonContainer>("HLT_xAOD__TrigPhotonContainer_L2PhotonFex")){ + ATH_MSG_DEBUG("TrigPhotonContainer in SG "); + setSGContainsTrigPhoton(true); + } + ATH_MSG_DEBUG("Rnn container in SG " << getSGContainsRnn()); + ATH_MSG_DEBUG("TrigPhotonContainer in SG " << getSGContainsTrigPhoton()); + for( const auto& tool : m_tools) { + tool->setSGContainsRnn(getSGContainsRnn()); + tool->setSGContainsTrigPhoton(getSGContainsTrigPhoton()); + } // Check HLTResult if(tdt()->ExperimentalAndExpertMethods()->isHLTTruncated()){ diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx index 8ae71d4a14294113e1e0674b4cb7019fe87ff3ea..4f313a9690957b425f89db0e7ea46592ea14c0e6 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx @@ -13,11 +13,10 @@ * Description: * Inherits from TrigEgammaAnalysisBaseTool. **********************************************************************/ -#include "egammaMVACalibAnalysis/IegammaMVATool.h" #include "TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h" #include "TrigConfxAOD/xAODConfigTool.h" #include "PATCore/AcceptData.h" - +#include "GaudiKernel/SystemOfUnits.h" #include "string" #include <algorithm> #include "boost/algorithm/string.hpp" @@ -138,6 +137,7 @@ bool TrigEgammaNavBaseTool::EventWiseSelection( ){ //Calculate number of vertex TrigEgammaAnalysisBaseTool::calculatePileupPrimaryVertex(); + return true; } @@ -218,10 +218,10 @@ StatusCode TrigEgammaNavBaseTool::executeElectronNavigation( std::string trigIte if(m_forcePidSelection){///default is true if(!ApplyElectronPid(eg,pidname)){ - ATH_MSG_DEBUG("Fails ElectronID "<< pidname); - continue; - } - ATH_MSG_DEBUG("Passes ElectronID "<< pidname); + ATH_MSG_DEBUG("Fails ElectronID "<< pidname); + continue; + } + ATH_MSG_DEBUG("Passes ElectronID "<< pidname); } if (m_forceProbeIsolation) {///default is false @@ -239,15 +239,20 @@ StatusCode TrigEgammaNavBaseTool::executeElectronNavigation( std::string trigIte xAOD::Electron *el = new xAOD::Electron(*eg); el->auxdecor<bool>(decor)=static_cast<bool>(true); - - if (match()->match(el, trigItem, te)){ - std::pair< const xAOD::Electron*, const HLT::TriggerElement* > pair(el,te); - m_objTEList.push_back(pair); - } - else { - std::pair< const xAOD::Electron*, const HLT::TriggerElement* > pair(el,nullptr); - m_objTEList.push_back(pair); + bool isEmulation = getTrigInfo(trigItem).trigIsEmulation; + if(isEmulation && getEmulation()){ + emulation()->match(el,te); + std::pair< const xAOD::Electron*, const HLT::TriggerElement* > pair(el,te); + m_objTEList.push_back(pair); + }else{ + if (match()->match(el, trigItem, te)){ + std::pair< const xAOD::Electron*, const HLT::TriggerElement* > pair(el,te); + m_objTEList.push_back(pair); + }else { + std::pair< const xAOD::Electron*, const HLT::TriggerElement* > pair(el,nullptr); + m_objTEList.push_back(pair); + } } } @@ -269,7 +274,7 @@ StatusCode TrigEgammaNavBaseTool::executePhotonNavigation( std::string trigItem, ATH_MSG_DEBUG("No caloCluster"); continue; } - if( !(getCluster_et(eg) > (etthr-5.)*1.e3)) continue; //Take 2GeV above threshold + if( !(getCluster_et(eg) > (etthr-5.)*Gaudi::Units::GeV)) continue; //Take 2GeV above threshold if(!eg->passSelection(m_photonPid)) continue; if(m_doUnconverted){ if (eg->vertex()){ @@ -279,13 +284,19 @@ StatusCode TrigEgammaNavBaseTool::executePhotonNavigation( std::string trigItem, } xAOD::Photon *ph = new xAOD::Photon(*eg); ph->auxdecor<bool>(decor)=static_cast<bool>(true); - if ( match()->match(ph, trigItem, te)){ - std::pair< const xAOD::Photon*, const HLT::TriggerElement* > pair(ph,te); - m_objTEList.push_back(pair); - } - else { - std::pair< const xAOD::Photon*, const HLT::TriggerElement* > pair(ph,nullptr); - m_objTEList.push_back(pair); + bool isEmulation = getTrigInfo(trigItem).trigIsEmulation; + if(isEmulation && getEmulation()){ + emulation()->match(ph,te); + std::pair< const xAOD::Photon*, const HLT::TriggerElement* > pair(ph,te); + m_objTEList.push_back(pair); + }else{ + if (match()->match(ph, trigItem, te)){ + std::pair< const xAOD::Photon*, const HLT::TriggerElement* > pair(ph,te); + m_objTEList.push_back(pair); + }else { + std::pair< const xAOD::Photon*, const HLT::TriggerElement* > pair(ph,nullptr); + m_objTEList.push_back(pair); + } } } @@ -295,6 +306,9 @@ StatusCode TrigEgammaNavBaseTool::executePhotonNavigation( std::string trigItem, } void TrigEgammaNavBaseTool::clearList(){ + for( auto paitIt : m_objTEList ) + delete paitIt.first; + m_objTEList.clear(); } diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavNtuple.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavNtuple.cxx deleted file mode 100755 index a15b46ae14857468d84e882fb5460bfc613c8087..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavNtuple.cxx +++ /dev/null @@ -1,1138 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - - -#include "TrigEgammaAnalysisTools/TrigEgammaNavNtuple.h" -using namespace std; - -TrigEgammaNavNtuple::TrigEgammaNavNtuple( const std::string& myname ): TrigEgammaNavBaseTool(myname) -{ - declareProperty("Analysis", m_anatype="NavNtuple" ); - declareProperty("doOfflineDump", m_doOfflineDump=false ); - declareProperty("DoSupportTrigger", m_doSupport=true ); - declareProperty("ForceMCMatch", m_forceMCMatch=true ); - declareProperty("OfflineMinEtThreshold", m_minEt=-1 ); - - ///Set base tool configuration - m_forcePidSelection=false; - - m_el_ringsE=nullptr; - m_trig_L1_thrNames=nullptr; - m_trig_L2_calo_energySample=nullptr; - m_trig_L2_calo_rings=nullptr; - m_trig_L2_el_trackAlgID=nullptr; - m_trig_L2_el_pt=nullptr; - m_trig_L2_el_eta=nullptr; - m_trig_L2_el_caloEta=nullptr; - m_trig_L2_el_phi=nullptr; - m_trig_L2_el_charge=nullptr; - m_trig_L2_el_nTRTHits=nullptr; - m_trig_L2_el_nTRTHiThresholdHits=nullptr; - m_trig_L2_el_etOverPt=nullptr; - m_trig_L2_el_trkClusDeta=nullptr; - m_trig_L2_el_trkClusDphi=nullptr; - m_trig_EF_calo_et=nullptr; - m_trig_EF_calo_eta=nullptr; - -} - - -StatusCode TrigEgammaNavNtuple::childInitialize(){ - - return StatusCode::SUCCESS; -} - -StatusCode TrigEgammaNavNtuple::childBook(){ - - ATH_MSG_DEBUG("Now configuring chains for analysis"); - //Set the base directory from the plot() - m_dir=plot()->getBasePath(); - std::vector<std::string> chains = tdt()->getListOfTriggers("HLT_e.*, L1_EM.*, HLT_g.*"); - - TrigEgammaAnalysisBaseTool::write_trigger_list(chains); - - for(const auto trigName:m_trigInputList){ - if (std::find(chains.begin(), chains.end(), trigName) != chains.end()) { - if(plot()->getTrigInfoMap().count(trigName) != 0) - ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName); - else - m_trigList.push_back(trigName); - } - } - - - // Container level kinematic histograms - ATH_MSG_DEBUG("cd in: " << m_dir <<"/Expert/Event"); - addDirectory(m_dir+"/Expert/Event"); - const int nTrigger = (int) m_trigList.size(); - - std::string histname=m_anatype+"_electrons"; - addHistogram(new TH1F(histname.c_str(), "Offline Electrons; ; N_{electrons}", 6, 1., 6)); - std::vector<std::string> el_labels; - el_labels.push_back("loose"); - el_labels.push_back("medium"); - el_labels.push_back("tight"); - el_labels.push_back("lhloose"); - el_labels.push_back("lhmedium"); - el_labels.push_back("lhtight"); - setLabels(hist1(histname),el_labels); - - histname=m_anatype+"_trigger_counts"; - if(nTrigger>0) { - addHistogram(new TH1F(histname.c_str(), "Trigger Counts; Trigger ; Count", nTrigger, 1, nTrigger)); - setLabels(plot()->hist1(m_anatype+"_trigger_counts"),m_trigList); - } - - ///Only offline egamma ntuple - if(m_doOfflineDump){ - ATH_MSG_DEBUG("Now configuting only the egamma analysis"); - addDirectory(m_dir+"/Expert/Offline"); - TTree *t_el = new TTree("electron", "tree of egamma and monte carlo information"); - TTree *t_ph = new TTree("photons", "tree of egamma and monte carlo information"); - bookEventBranches( t_ph ); - //bookPhotonBranches( t_ph ); - bookMonteCarloBranches( t_ph ); - bookEventBranches( t_el ); - bookElectronBranches( t_el ); - bookMonteCarloBranches( t_el ); - addTree( t_el, m_dir+"/Expert/Offline" ); - addTree( t_ph, m_dir+"/Expert/Offline" ); - }else if(m_doSupport){// all support trigger in one - addDirectory(m_dir+"/Expert/support"); - TTree *t = new TTree( "trigger", "support trigger"); - bookEventBranches( t ); - bookElectronBranches( t ); - //bookPhotonBranches( t ); - bookTriggerBranches( t ); - bookMonteCarloBranches( t ); - for(auto& trigItem : m_trigList) - setTrigInfo(trigItem); - addTree(t, m_dir+"/Expert/support"); - }else{// each trigger - for (int i = 0; i < (int) m_trigList.size(); i++) { - std::string trigItem = m_trigList[i]; - addDirectory(m_dir+"/Expert/"+trigItem); - - TTree *t = new TTree( "trigger", "tree of trigger, egamma and monte carlo information"); - bookEventBranches( t ); - bookElectronBranches( t ); - //bookPhotonBranches( t ); - bookTriggerBranches( t ); - bookMonteCarloBranches( t ); - ATH_MSG_DEBUG("Already to attach the tree: " << trigItem); - setTrigInfo(trigItem); - addTree(t, m_dir+"/Expert/"+trigItem); - } - } - - // alloc memory to vector branchs - alloc_space(); - - return StatusCode::SUCCESS; -} - -StatusCode TrigEgammaNavNtuple::childExecute(){ - - m_eventCounter++; - - m_dir=plot()->getBasePath(); - - cd(m_dir+"/Expert/Event"); - if( !EventWiseSelection() ) { - ATH_MSG_DEBUG("Unable to retrieve offline containers"); - return StatusCode::FAILURE; - } - - cd(m_dir+"/Expert"); - - - /// Egamma ntuple mode - if(m_doOfflineDump){ - cd(m_dir+"/Expert/Offline"); - if(!executeElectronDump()) return StatusCode::FAILURE; - if(!executePhotonDump()) return StatusCode::FAILURE; - }else if(m_doSupport){ - if(!executeTrigSupportDump()) return StatusCode::FAILURE; - }else{ - if(!executeTrigItemDump()) return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; -} - - -StatusCode TrigEgammaNavNtuple::childFinalize(){ - //release_space(); - return StatusCode::SUCCESS; -} - - -bool TrigEgammaNavNtuple::executeElectronDump(){ - - ATH_MSG_DEBUG("TrigEgammaNavNtuple::executeEgammaDump()"); - - const xAOD::ElectronContainer* offElectrons = 0; - if ( (m_storeGate->retrieve(offElectrons,m_offElContKey)).isFailure() ){ - ATH_MSG_ERROR("Failed to retrieve offline Electrons "); - return false; - } - - TTree *t = tree( "electron" , m_dir+"/Expert/Offline" ); - if(!t){ - ATH_MSG_ERROR("Can no get the ttree pointer into the store."); - return false; - } - - linkEventBranches(t); - linkElectronBranches(t); - linkMonteCarloBranches(t); - - for (const auto &eg : *offElectrons){ - clear(); - if(!eg->trackParticle()){ - ATH_MSG_DEBUG("No track Particle"); - continue; - } - if(!eg->caloCluster()){ - ATH_MSG_DEBUG("No caloCluster"); - continue; - } - - if(m_rmCrack){///default is true - if ( (fabs(eg->eta())>1.37 && fabs(eg->eta())<1.52) || fabs(eg->eta())>2.47 ) continue; - } - - if (m_forceProbeIsolation) {///default is false - if (!isIsolated(eg, "Loose")) continue;///default is Loose - } - - if(m_forceMCEnhancedBias){///default is false - const xAOD::TruthParticle *mc=nullptr; - if( pdgid(eg,m_truthContainer,mc) != MonteCarlo::PDGID::EnhancedBias) continue; - } - - const xAOD::Electron* el =static_cast<const xAOD::Electron*> (el); - - fillEvent(); - fillElectron( eg ); - - if(!fillMonteCarlo( eg ) ){ - ATH_MSG_WARNING("Cound not found any TruthParticle for this Electron"); - } - - ATH_MSG_DEBUG("Record information into the ttree."); - t->Fill();// save information - } - - return true; -} - -bool TrigEgammaNavNtuple::executePhotonDump(){ - return true; -} - - -bool TrigEgammaNavNtuple::executeTrigItemDump(){ - - - for(unsigned int ilist = 0; ilist != m_trigList.size(); ilist++) { - - std::string trigItem = m_trigList.at(ilist); - const TrigInfo info = getTrigInfo(trigItem); - if ( executeNavigation(info).isFailure() ){ - ATH_MSG_DEBUG("executeNavigation failure! continue..."); - return false; - } - - TTree *t = tree( "trigger", m_dir+"/Expert/"+trigItem); - linkEventBranches(t); - linkElectronBranches(t); - //linkPhotonBranches(t); - linkTriggerBranches(t); - linkMonteCarloBranches(t); - ATH_MSG_DEBUG("ObjTEList size is: " << m_objTEList.size()); - for(unsigned int i = 0; i != m_objTEList.size(); ++i){ - - const xAOD::Electron* el =static_cast<const xAOD::Electron*> (m_objTEList[i].first); - //const xAOD::Photon* ph =static_cast<const xAOD::Photon*> (m_objTEList[i].first); - const HLT::TriggerElement *feat = m_objTEList[i].second; - if(feat == nullptr){ - ATH_MSG_WARNING("TriggerElement is nullptr"); - continue; - } - - clear(); - fillEvent(); - fillElectron( el ); - //fillPhoton( ph ); - - if(!fillMonteCarlo( el ) ){ - ATH_MSG_WARNING("Cound not found any TruthParticle for this Electron"); - } - - ///Start trigger analisys... - const xAOD::EmTauRoI *emTauRoI = getFeature<xAOD::EmTauRoI>(feat); - if(emTauRoI){ - fillEmTauRoI( emTauRoI ); - }else{ - ATH_MSG_WARNING("Cound not found EmTauRoI in this TriggerElement.."); - } - - const xAOD::TrigEMCluster *emCluster = getFeature<xAOD::TrigEMCluster>(feat); - if(emCluster){ - - if(!fillTrigEMCluster( emCluster )){ - ATH_MSG_WARNING("Cound not attach the trigEMCluster information into the tree."); - } - - //const xAOD::TrigRNNOutput *rnnOutput=getFeature<xAOD::TrigRNNOutput>(feat); - //if(rnnOutput) m_trig_L2_calo_rnnOutput = rnnOutput->rnnDecision().at(0); - - //if(TrigEgammaAnalysisBaseTool::getTrigCaloRings(emCluster, ringsContainer ,*m_trig_L2_calo_rings)){ - if(!fillTrigCaloRings( emCluster )){ - ATH_MSG_WARNING("Cound not attach the trigCaloRinger information into the tree."); - } - - }///cluster protection - - - const xAOD::TrigElectronContainer *trigElCont = getFeature<xAOD::TrigElectronContainer>(feat); - // Level 2 ID+Calo - if(trigElCont){ - for(const auto& trigEl : *trigElCont){ - if(!fillTrigElectron(trigEl)) { - ATH_MSG_WARNING("Cound not attach the trigElectron information into the tree."); - } - }// loop over all trigElectrons for this feat - } - - const xAOD::CaloClusterContainer *caloCont = getFeature<xAOD::CaloClusterContainer>(feat); - if(caloCont){ - for(const auto& cl : *caloCont){ - if(!fillCaloCluster(cl)){ - ATH_MSG_WARNING("Cound not attach the CaloCluster information into the tree."); - } - }// loop over calo cluster - } - - asg::AcceptData acceptData = setAccept(feat,info); - m_trig_L1_accept = acceptData.getCutResult("L1Calo"); - m_trig_L2_calo_accept = acceptData.getCutResult("L2Calo"); - m_trig_L2_el_accept = acceptData.getCutResult("L2"); - m_trig_EF_calo_accept = acceptData.getCutResult("EFCalo"); - m_trig_EF_el_accept = acceptData.getCutResult("HLT"); - - ATH_MSG_DEBUG("L1Calo: " << int(m_trig_L1_accept)); - ATH_MSG_DEBUG("L2Calo: " << int(m_trig_L2_calo_accept)); - ATH_MSG_DEBUG("L2 : " << int(m_trig_L2_el_accept)); - ATH_MSG_DEBUG("EFCalo: " << int(m_trig_EF_calo_accept)); - ATH_MSG_DEBUG("HLT : " << int(m_trig_EF_el_accept)); - - ATH_MSG_DEBUG("Record information into the ttree."); - t->Fill();// save information - }// loop - } // End loop over trigger - return true; -} - - -bool TrigEgammaNavNtuple::executeTrigSupportDump(){ - - double GeV=1000.; - // Just do this to retrieve all offline electrons, dummy trigItem! - const TrigInfo info = getTrigInfo(m_trigList[0]); - if ( executeNavigation(info).isFailure() ){ - ATH_MSG_DEBUG("executeNavigation failure! continue..."); - return false; - }//executeNavigation to collect electron - - std::vector<const HLT::TriggerElement *> vec_feat; - - - cd(m_dir+"/Expert/support"); - TTree *t = tree( "trigger", m_dir+"/Expert/support"); - linkEventBranches(t); - linkElectronBranches(t); - linkTriggerBranches(t); - linkMonteCarloBranches(t); - - // Loop over all good offline objects - for(const auto& eg : m_objTEList){ - - // Get the good electron - const xAOD::Electron* el =static_cast<const xAOD::Electron*> (eg.first); - // Force Et cut - if(m_minEt > 0.0){ - if( !( getEt(el) > (m_minEt)*GeV) ) continue; - } - // Clear the vector - vec_feat.clear(); - // Loop over support triggers - for(auto& trigItem : m_trigList){ - const HLT::TriggerElement *feat; - // Trigger match using Matching tool - match()->match(el, trigItem, feat); - if(feat){// If has a match! - for(unsigned i=0; i < vec_feat.size(); ++i){ - if(getFeature<xAOD::EmTauRoI>(vec_feat[i])->roiWord() == getFeature<xAOD::EmTauRoI>(feat)->roiWord()){ - if(count_HLT_objects(feat) > count_HLT_objects(vec_feat[i])){ - vec_feat.erase(vec_feat.begin() + i); // Erase the trigger element lowest than the new feature - vec_feat.push_back(feat); // attach the new trigger element - break; - } - }// The same region in L1Calo trigger - } - if(vec_feat.empty()) vec_feat.push_back(feat); - } - }// Loop over support trigger - - ATH_MSG_DEBUG("Attach " << vec_feat.size() << " features "); - for(auto& feat : vec_feat){ - - clear(); - fillEvent(); - fillElectron( el ); - - if(!fillMonteCarlo( el ) ){ - ATH_MSG_WARNING("Cound not found any TruthParticle for this Electron"); - if(m_forceMCMatch) continue; - } - - ///Start trigger analisys... - const xAOD::EmTauRoI *emTauRoI = getFeature<xAOD::EmTauRoI>(feat); - if(emTauRoI){ - fillEmTauRoI( emTauRoI ); - }else{ - ATH_MSG_WARNING("Cound not found EmTauRoI in this TriggerElement.."); - } - - const xAOD::TrigEMCluster *emCluster = getFeature<xAOD::TrigEMCluster>(feat); - if(emCluster){ - //ATH_MSG_INFO("AKI: Et = " << emCluster->et()*1e-3); - //if(emCluster->et()*1e-3 < 20){ - // continue; - //} - if(!fillTrigEMCluster( emCluster )){ - ATH_MSG_WARNING("Cound not attach the trigEMCluster information into the tree."); - } - - //if(TrigEgammaAnalysisBaseTool::getTrigCaloRings(emCluster, ringsContainer ,*m_trig_L2_calo_rings)){ - if(!fillTrigCaloRings( emCluster )){ - ATH_MSG_WARNING("Cound not attach the trigCaloRinger information into the tree."); - } - }///cluster protection - - - const xAOD::TrigElectronContainer *trigElCont = getFeature<xAOD::TrigElectronContainer>(feat); - // Level 2 ID+Calo - if(trigElCont){ - for(const auto& trigEl : *trigElCont){ - if(!fillTrigElectron(trigEl)) { - ATH_MSG_WARNING("Cound not attach the trigElectron information into the tree."); - } - }// loop over all trigElectrons for this feat - } - - const xAOD::CaloClusterContainer *caloCont = getFeature<xAOD::CaloClusterContainer>(feat); - if(caloCont){ - for(const auto& cl : *caloCont){ - if(!fillCaloCluster(cl)){ - ATH_MSG_WARNING("Cound not attach the CaloCluster information into the tree."); - } - }// loop over calo cluster - } - - ATH_MSG_DEBUG("record trigger information into the file."); - t->Fill(); - }//loop over trigger objects - - }// Loop over electrons - return true; -} - - - - - - - -bool TrigEgammaNavNtuple::fillEmTauRoI( const xAOD::EmTauRoI *emTauRoI ){ - - m_trig_L1_eta = emTauRoI->eta(); - m_trig_L1_phi = emTauRoI->phi(); - m_trig_L1_emClus = emTauRoI->emClus(); - m_trig_L1_tauClus = emTauRoI->tauClus(); - m_trig_L1_emIsol = emTauRoI->emIsol(); - m_trig_L1_hadIsol = emTauRoI->hadIsol(); - for(unsigned i=0; i < emTauRoI->thrNames().size();++i) m_trig_L1_thrNames->push_back(emTauRoI->thrNames().at(i)); - return true; -} - -bool TrigEgammaNavNtuple::fillCaloCluster( const xAOD::CaloCluster *cluster){ - - m_trig_EF_calo_et->push_back(cluster->et()); - m_trig_EF_calo_eta->push_back(cluster->eta()); - return true; -} - -bool TrigEgammaNavNtuple::fillTrigEMCluster( const xAOD::TrigEMCluster *emCluster ){ - - m_trig_L2_calo_et = emCluster->et(); - m_trig_L2_calo_eta = emCluster->eta(); - m_trig_L2_calo_phi = emCluster->phi(); - m_trig_L2_calo_e237 = emCluster->e237(); - m_trig_L2_calo_e277 = emCluster->e277(); - m_trig_L2_calo_fracs1 = emCluster->fracs1(); - m_trig_L2_calo_weta2 = emCluster->weta2(); - m_trig_L2_calo_ehad1 = emCluster->ehad1(); - m_trig_L2_calo_emaxs1 = emCluster->emaxs1(); - m_trig_L2_calo_e2tsts1 = emCluster->e2tsts1(); - m_trig_L2_calo_wstot = emCluster->wstot(); - for(unsigned i=0; i<emCluster->energySample().size(); ++i){ - m_trig_L2_calo_energySample->push_back( emCluster->energySample().at(i)); - } - - return true; -} - - -bool TrigEgammaNavNtuple::fillTrigElectron( const xAOD::TrigElectron *trigEl ){ - - const xAOD::TrackParticle* trkIter = trigEl->trackParticle(); - if (trkIter==nullptr) return false; // disconsider candidates without track - int algoId = 0; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::FastTrackFinderSeed] ) algoId=9; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyA] ) algoId=5; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyB] ) algoId=6; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyC] ) algoId=7; - - m_trig_L2_el_trackAlgID ->push_back(algoId); - m_trig_L2_el_caloEta ->push_back(trigEl->caloEta()); - m_trig_L2_el_trkClusDphi ->push_back(trigEl->trkClusDphi()); - m_trig_L2_el_trkClusDeta ->push_back(trigEl->trkClusDeta()); - m_trig_L2_el_pt ->push_back(trigEl->pt()); - m_trig_L2_el_phi ->push_back(trigEl->phi()); - m_trig_L2_el_eta ->push_back(trigEl->eta()); - m_trig_L2_el_etOverPt ->push_back(trigEl->etOverPt()); - m_trig_L2_el_nTRTHits ->push_back(trigEl->nTRTHits()); - m_trig_L2_el_nTRTHiThresholdHits->push_back(trigEl->nTRTHiThresholdHits()); - m_trig_L2_el_charge ->push_back(trigEl->charge()); - return true; -} - - - -bool TrigEgammaNavNtuple::fillEvent(){ - ///Event information - m_runNumber = m_eventInfo->runNumber(); - m_eventNumber = m_eventInfo->eventNumber(); - m_avgmu=getAvgMu(); - return true; -} - -bool TrigEgammaNavNtuple::fillElectron( const xAOD::Electron *el ){ - - ///Cluster information - m_el_et = el->pt(); - m_el_eta = el->eta(); - m_el_phi = el->phi(); - el->showerShapeValue( m_el_ethad1 , xAOD::EgammaParameters::ShowerShapeType::ethad1 ); - el->showerShapeValue( m_el_ehad1 , xAOD::EgammaParameters::ShowerShapeType::ehad1 ); - el->showerShapeValue( m_el_f1 , xAOD::EgammaParameters::ShowerShapeType::f1 ); - el->showerShapeValue( m_el_f3 , xAOD::EgammaParameters::ShowerShapeType::f3 ); - el->showerShapeValue( m_el_f1core , xAOD::EgammaParameters::ShowerShapeType::f1core ); - el->showerShapeValue( m_el_f3core , xAOD::EgammaParameters::ShowerShapeType::f3core ); - el->showerShapeValue( m_el_weta2 , xAOD::EgammaParameters::ShowerShapeType::weta2 ); - el->showerShapeValue( m_el_wtots1 , xAOD::EgammaParameters::ShowerShapeType::wtots1 ); - el->showerShapeValue( m_el_fracs1 , xAOD::EgammaParameters::ShowerShapeType::fracs1 ); - el->showerShapeValue( m_el_Reta , xAOD::EgammaParameters::ShowerShapeType::Reta ); - el->showerShapeValue( m_el_Rphi , xAOD::EgammaParameters::ShowerShapeType::Rphi ); - el->showerShapeValue( m_el_Eratio , xAOD::EgammaParameters::ShowerShapeType::Eratio ); - el->showerShapeValue( m_el_Rhad , xAOD::EgammaParameters::ShowerShapeType::Rhad ); - el->showerShapeValue( m_el_Rhad1 , xAOD::EgammaParameters::ShowerShapeType::Rhad1 ); - - ///Combined track/Cluter information - el->trackCaloMatchValue( m_el_deta1 , xAOD::EgammaParameters::TrackCaloMatchType::deltaEta1 ); - el->trackCaloMatchValue( m_el_deta2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaEta2 ); - el->trackCaloMatchValue( m_el_dphi2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhi2 ); - el->trackCaloMatchValue( m_el_dphiresc , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhiRescaled0 ); - el->trackCaloMatchValue( m_el_dphiresc2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhiRescaled2 ); - - - ///Track particle information - const xAOD::TrackParticle *track = el->trackParticle(); - if(track){ - m_el_pt = track->pt(); - m_el_d0 = fabsf(track->d0()); - m_el_charge = el->charge(); - - track->summaryValue( m_el_eprobht , xAOD::SummaryType::eProbabilityHT ); - track->summaryValue( m_el_nblayerhits , xAOD::SummaryType::numberOfInnermostPixelLayerHits ); - track->summaryValue( m_el_nblayerolhits , xAOD::SummaryType::numberOfInnermostPixelLayerOutliers ); - track->summaryValue( m_el_npixhits , xAOD::SummaryType::numberOfPixelHits ); - track->summaryValue( m_el_npixolhits , xAOD::SummaryType::numberOfPixelOutliers ); - track->summaryValue( m_el_nscthits , xAOD::SummaryType::numberOfSCTHits ); - track->summaryValue( m_el_nsctolhits , xAOD::SummaryType::numberOfSCTOutliers ); - track->summaryValue( m_el_ntrthightreshits , xAOD::SummaryType::numberOfTRTHighThresholdHits ); - track->summaryValue( m_el_ntrthits , xAOD::SummaryType::numberOfTRTHits); - track->summaryValue( m_el_ntrthighthresolhits, xAOD::SummaryType::numberOfTRTHighThresholdOutliers ); - track->summaryValue( m_el_ntrtolhits , xAOD::SummaryType::numberOfTRTOutliers ); - track->summaryValue( m_el_ntrtxenonhits , xAOD::SummaryType::numberOfTRTXenonHits ); - //track->summaryValue( m_el_expectblayerhit , xAOD::SummaryType::expectInnermostPixelLayerHit ); - track->summaryValue( m_el_npixdeadsensors , xAOD::SummaryType::numberOfPixelDeadSensors); - track->summaryValue( m_el_nsctdeadsensors , xAOD::SummaryType::numberOfSCTDeadSensors); - - m_el_nsideadsensors = m_el_npixdeadsensors + m_el_nsctdeadsensors; - m_el_nsihits = m_el_npixhits + m_el_nscthits; - } - - //m_el_loose = el->passSelection("Loose"); - //m_el_medium = el->passSelection("Medium"); - //m_el_tight = el->passSelection("Tight"); - //m_el_lhLoose = el->passSelection("LHLoose"); - //m_el_lhMedium = el->passSelection("LHMedium"); - //m_el_lhTight = el->passSelection("LHTight"); - //m_el_rgLoose = el->passSelection("RGLoose"); - //m_el_rgMedium = el->passSelection("RGMedium"); - //m_el_rgTight = el->passSelection("RGTight"); - //m_el_multiLepton = el->passSelection("MultiLepton"); - m_el_loose = ApplyElectronPid(el, "Loose"); - m_el_medium = ApplyElectronPid(el, "Medium"); - m_el_tight = ApplyElectronPid(el, "Tight"); - m_el_lhLoose = ApplyElectronPid(el, "LHLoose"); - m_el_lhMedium = ApplyElectronPid(el, "LHMedium"); - m_el_lhTight = ApplyElectronPid(el, "LHTight"); - //m_el_rgLoose = ApplyElectronPid(el, "RGLoose"); - //m_el_rgMedium = ApplyElectronPid(el, "RGMedium"); - //m_el_rgTight = ApplyElectronPid(el, "RGTight"); - - m_calo_et = getCluster_et( el ); - m_calo_eta = getCluster_eta( el ); - m_calo_phi = getCluster_phi( el ); - ///Extra information about pileup - m_el_nGoodVtx = getNGoodVertex(); - m_el_nPileupPrimaryVtx = getNPVtx(); - - - if(!fillCaloRings( el )){ - ATH_MSG_WARNING("Could not attach the calorRings information."); - } - - return true; -} - - -/*bool TrigEgammaNavNtuple::fillPhoton( const xAOD::Photon *ph ){ - return true; -}*/ - -bool TrigEgammaNavNtuple::fillMonteCarlo(const xAOD::Egamma *eg){ - - if(m_truthContainer){ - ATH_MSG_DEBUG("TruthParticle container size is: " << m_truthContainer->size()); - const xAOD::TruthParticle *mc=nullptr; - MonteCarlo::PDGID pdg = pdgid(eg, m_truthContainer,mc); - if(mc){ - m_mc_hasMC = true; - m_mc_pt = mc->pt(); - m_mc_eta = mc->eta(); - m_mc_phi = mc->phi(); - m_mc_isTop = mc->isTop(); - m_mc_isQuark = mc->isQuark(); - m_mc_isParton = mc->isParton(); - m_mc_isMeson = mc->isMeson(); - m_mc_isTau = mc->isTau(); - m_mc_isMuon = mc->isMuon(); - m_mc_isPhoton = mc->isPhoton(); - m_mc_isElectron = mc->isElectron(); - if(pdg == MonteCarlo::PDGID::ZMother) m_mc_hasZMother = true; - if(pdg == MonteCarlo::PDGID::WMother) m_mc_hasWMother = true; - return true; - }//has match - }//has truth container - return false; -} - - -bool TrigEgammaNavNtuple::fillTrigCaloRings( const xAOD::TrigEMCluster *emCluster ){ - return TrigEgammaAnalysisBaseTool::getTrigCaloRings(emCluster, *m_trig_L2_calo_rings); -} - - -bool TrigEgammaNavNtuple::fillCaloRings( const xAOD::Electron *el ){ - return TrigEgammaAnalysisBaseTool::getCaloRings(el, *m_el_ringsE ); -} - -/* - * book, link, clear, alloc and release method divide in: - * trigger, Egamma and MonteCarlo data base. - */ - -template <class T> -void TrigEgammaNavNtuple::InitBranch(TTree* fChain, std::string branch_name, T* param, bool message){ - - std::string bname = branch_name; - if (fChain->GetAlias(bname.c_str())) - bname = std::string(fChain->GetAlias(bname.c_str())); - - if (!fChain->FindBranch(bname.c_str()) && message) { - ATH_MSG_WARNING("unknown branch " << bname); - return; - } - fChain->SetBranchStatus(bname.c_str(), 1.); - fChain->SetBranchAddress(bname.c_str(), param); -} - -void TrigEgammaNavNtuple::bookEventBranches(TTree *t){ - - t->Branch("RunNumber", &m_runNumber); - t->Branch("EventNumber", &m_eventNumber); - t->Branch("avgmu", &m_avgmu); -} - -void TrigEgammaNavNtuple::bookTriggerBranches(TTree *t){ - - // Level L1 cluster - t->Branch( "trig_L1_eta", &m_trig_L1_eta); - t->Branch( "trig_L1_phi", &m_trig_L1_phi); - t->Branch( "trig_L1_emClus", &m_trig_L1_emClus); - t->Branch( "trig_L1_tauClus", &m_trig_L1_tauClus); - t->Branch( "trig_L1_emIsol", &m_trig_L1_emIsol); - t->Branch( "trig_L1_hadIsol", &m_trig_L1_hadIsol); - t->Branch( "trig_L1_thrNames", &m_trig_L1_thrNames); - t->Branch( "trig_L1_accept", &m_trig_L1_accept); - t->Branch( "trig_L2_calo_et", &m_trig_L2_calo_et); - t->Branch( "trig_L2_calo_eta", &m_trig_L2_calo_eta); - t->Branch( "trig_L2_calo_phi", &m_trig_L2_calo_phi); - t->Branch( "trig_L2_calo_e237", &m_trig_L2_calo_e237 ); - t->Branch( "trig_L2_calo_e277", &m_trig_L2_calo_e277 ); - t->Branch( "trig_L2_calo_fracs1", &m_trig_L2_calo_fracs1); - t->Branch( "trig_L2_calo_weta2", &m_trig_L2_calo_weta2); - t->Branch( "trig_L2_calo_ehad1", &m_trig_L2_calo_ehad1); - t->Branch( "trig_L2_calo_emaxs1", &m_trig_L2_calo_emaxs1); - t->Branch( "trig_L2_calo_e2tsts1", &m_trig_L2_calo_e2tsts1); - t->Branch( "trig_L2_calo_wstot", &m_trig_L2_calo_wstot); - t->Branch( "trig_L2_calo_energySample",&m_trig_L2_calo_energySample ); - t->Branch( "trig_L2_calo_rings", &m_trig_L2_calo_rings ); - t->Branch( "trig_L2_calo_rnnOutput", &m_trig_L2_calo_rnnOutput ); - t->Branch( "trig_L2_calo_accept", &m_trig_L2_calo_accept); - t->Branch( "trig_L2_el_trackAlgID" , &m_trig_L2_el_trackAlgID ); - t->Branch( "trig_L2_el_pt" , &m_trig_L2_el_pt ); - t->Branch( "trig_L2_el_eta", &m_trig_L2_el_eta); - t->Branch( "trig_L2_el_phi", &m_trig_L2_el_phi ); - t->Branch( "trig_L2_el_caloEta", &m_trig_L2_el_caloEta ); - t->Branch( "trig_L2_el_charge", &m_trig_L2_el_charge); - t->Branch( "trig_L2_el_nTRTHits", &m_trig_L2_el_nTRTHits); - t->Branch( "trig_L2_el_nTRTHiThresholdHits", &m_trig_L2_el_nTRTHiThresholdHits); - t->Branch( "trig_L2_el_etOverPt" , &m_trig_L2_el_etOverPt ); - t->Branch( "trig_L2_el_trkClusDeta" , &m_trig_L2_el_trkClusDeta ); - t->Branch( "trig_L2_el_trkClusDphi" , &m_trig_L2_el_trkClusDphi ); - t->Branch( "trig_L2_el_accept", &m_trig_L2_el_accept ); - t->Branch( "trig_EF_calo_accept", &m_trig_EF_calo_accept); - t->Branch( "trig_EF_calo_et", &m_trig_EF_calo_et); - t->Branch( "trig_EF_calo_eta", &m_trig_EF_calo_eta); - t->Branch( "trig_EF_el_accept", &m_trig_EF_el_accept); -} - -void TrigEgammaNavNtuple::bookElectronBranches(TTree *t){ - - t->Branch("el_et", &m_el_et); - t->Branch("el_pt", &m_el_pt); - t->Branch("el_eta", &m_el_eta); - t->Branch("el_phi", &m_el_phi); - t->Branch("el_ethad1", &m_el_ethad1); - t->Branch("el_ehad1", &m_el_ehad1); - t->Branch("el_f1", &m_el_f1); - t->Branch("el_f3", &m_el_f3); - t->Branch("el_f1core", &m_el_f1core); - t->Branch("el_f3core", &m_el_f3core); - t->Branch("el_weta2", &m_el_weta2); - t->Branch("el_d0", &m_el_d0); - t->Branch("el_wtots1", &m_el_wtots1); - t->Branch("el_fracs1", &m_el_fracs1); - t->Branch("el_Reta", &m_el_Reta); - t->Branch("el_Rphi", &m_el_Rphi); - t->Branch("el_Eratio", &m_el_Eratio); - t->Branch("el_Rhad", &m_el_Rhad); - t->Branch("el_Rhad1", &m_el_Rhad1); - t->Branch("el_deta1", &m_el_deta1); - t->Branch("el_deta2", &m_el_deta2); - t->Branch("el_dphi2", &m_el_dphi2); - t->Branch("el_dphiresc", &m_el_dphiresc); - t->Branch("el_dphiresc2", &m_el_dphiresc2); - t->Branch("el_eprobht", &m_el_eprobht); - t->Branch("el_charge", &m_el_charge); - t->Branch("el_nblayerhits", &m_el_nblayerhits); - t->Branch("el_nblayerolhits", &m_el_nblayerolhits); - t->Branch("el_npixhits", &m_el_npixhits); - t->Branch("el_npixolhits", &m_el_npixolhits); - t->Branch("el_nscthits", &m_el_nscthits); - t->Branch("el_nsctolhits", &m_el_nsctolhits); - t->Branch("el_ntrthightreshits", &m_el_ntrthightreshits); - t->Branch("el_ntrthits", &m_el_ntrthits); - t->Branch("el_ntrthighthresolhits", &m_el_ntrthighthresolhits); - t->Branch("el_ntrtolhits", &m_el_ntrtolhits); - t->Branch("el_ntrtxenonhits", &m_el_ntrtxenonhits); - t->Branch("el_expectblayerhit", &m_el_expectblayerhit); - t->Branch("el_nsihits", &m_el_nsihits ); - t->Branch("el_nsideadsensors", &m_el_nsideadsensors ); - t->Branch("el_npixdeadsensors", &m_el_npixdeadsensors ); - t->Branch("el_nsctdeadsensors", &m_el_nsctdeadsensors ); - t->Branch("el_ringsE", &m_el_ringsE ); - t->Branch("el_loose", &m_el_loose ); - t->Branch("el_medium", &m_el_medium ); - t->Branch("el_tight", &m_el_tight ); - t->Branch("el_lhLoose", &m_el_lhLoose ); - t->Branch("el_lhMedium", &m_el_lhMedium ); - t->Branch("el_lhTight", &m_el_lhTight ); - t->Branch("el_rgLoose", &m_el_rgLoose ); - t->Branch("el_rgMedium", &m_el_rgMedium ); - t->Branch("el_rgTight", &m_el_rgTight ); - t->Branch("el_multiLepton", &m_el_multiLepton); - t->Branch("el_nGoodVtx", &m_el_nGoodVtx); - t->Branch("el_nPileupPrimaryVtx", &m_el_nPileupPrimaryVtx); - t->Branch("calo_et", &m_calo_et); - t->Branch("calo_eta", &m_calo_eta); - t->Branch("calo_phi", &m_calo_phi); - -} - - -/*void TrigEgammaNavNtuple::bookPhotonBranches(TTree *t){ -} */ - -void TrigEgammaNavNtuple::bookMonteCarloBranches(TTree *t){ - // Monte Carlo - t->Branch("mc_hasMC", &m_mc_hasMC); - t->Branch("mc_pt", &m_mc_pt); - t->Branch("mc_eta", &m_mc_eta); - t->Branch("mc_phi", &m_mc_phi); - t->Branch("mc_isTop", &m_mc_isTop); - t->Branch("mc_isParton", &m_mc_isParton); - t->Branch("mc_isMeson", &m_mc_isMeson); - t->Branch("mc_isTau", &m_mc_isTau); - t->Branch("mc_isMuon", &m_mc_isMuon); - t->Branch("mc_isPhoton", &m_mc_isPhoton); - t->Branch("mc_isElectron", &m_mc_isElectron); - t->Branch("mc_hasZMother", &m_mc_hasZMother); - t->Branch("mc_hasWMother", &m_mc_hasWMother); -} - -void TrigEgammaNavNtuple::linkEventBranches(TTree *t){ - - InitBranch( t, "RunNumber", &m_runNumber); - InitBranch( t, "EventNumber", &m_eventNumber); - InitBranch( t, "avgmu", &m_avgmu); -} - -void TrigEgammaNavNtuple::linkElectronBranches( TTree *t ){ - - InitBranch( t, "el_et", &m_el_et); - InitBranch( t, "el_pt", &m_el_pt); - InitBranch( t, "el_eta", &m_el_eta); - InitBranch( t, "el_phi", &m_el_phi); - InitBranch( t, "el_ethad1", &m_el_ethad1); - InitBranch( t, "el_ehad1", &m_el_ehad1); - InitBranch( t, "el_f1", &m_el_f1); - InitBranch( t, "el_f3", &m_el_f3); - InitBranch( t, "el_f1core", &m_el_f1core); - InitBranch( t, "el_f3core", &m_el_f3core); - InitBranch( t, "el_weta2", &m_el_weta2); - InitBranch( t, "el_d0", &m_el_d0); - InitBranch( t, "el_wtots1", &m_el_wtots1); - InitBranch( t, "el_fracs1", &m_el_fracs1); - InitBranch( t, "el_Reta", &m_el_Reta); - InitBranch( t, "el_Rphi", &m_el_Rphi); - InitBranch( t, "el_Eratio", &m_el_Eratio); - InitBranch( t, "el_Rhad", &m_el_Rhad); - InitBranch( t, "el_Rhad1", &m_el_Rhad1); - InitBranch( t, "el_deta1", &m_el_deta1); - InitBranch( t, "el_deta2", &m_el_deta2); - InitBranch( t, "el_dphi2", &m_el_dphi2); - InitBranch( t, "el_dphiresc", &m_el_dphiresc); - InitBranch( t, "el_dphiresc2", &m_el_dphiresc2); - InitBranch( t, "el_eprobht", &m_el_eprobht); - InitBranch( t, "el_charge", &m_el_charge); - InitBranch( t, "el_nblayerhits", &m_el_nblayerhits); - InitBranch( t, "el_nblayerolhits", &m_el_nblayerolhits); - InitBranch( t, "el_npixhits", &m_el_npixhits); - InitBranch( t, "el_npixolhits", &m_el_npixolhits); - InitBranch( t, "el_nscthits", &m_el_nscthits); - InitBranch( t, "el_nsctolhits", &m_el_nsctolhits); - InitBranch( t, "el_ntrthightreshits", &m_el_ntrthightreshits); - InitBranch( t, "el_ntrthits", &m_el_ntrthits); - InitBranch( t, "el_ntrthighthresolhits", &m_el_ntrthighthresolhits); - InitBranch( t, "el_ntrtolhits", &m_el_ntrtolhits); - InitBranch( t, "el_ntrtxenonhits", &m_el_ntrtxenonhits); - InitBranch( t, "el_expectblayerhit", &m_el_expectblayerhit); - InitBranch( t, "el_nsihits", &m_el_nsihits ); - InitBranch( t, "el_nsideadsensors", &m_el_nsideadsensors ); - InitBranch( t, "el_npixdeadsensors", &m_el_npixdeadsensors ); - InitBranch( t, "el_nsctdeadsensors", &m_el_nsctdeadsensors ); - InitBranch( t, "el_ringsE", &m_el_ringsE ); - InitBranch( t, "el_loose", &m_el_loose ); - InitBranch( t, "el_medium", &m_el_medium ); - InitBranch( t, "el_tight", &m_el_tight ); - InitBranch( t, "el_lhLoose", &m_el_lhLoose ); - InitBranch( t, "el_lhMedium", &m_el_lhMedium ); - InitBranch( t, "el_lhTight", &m_el_lhTight ); - InitBranch( t, "el_rgLoose", &m_el_rgLoose ); - InitBranch( t, "el_rgMedium", &m_el_rgMedium ); - InitBranch( t, "el_rgTight", &m_el_rgTight ); - InitBranch( t, "el_multiLepton", &m_el_multiLepton); - InitBranch( t, "el_nGoodVtx", &m_el_nGoodVtx); - InitBranch( t, "el_nPileupPrimaryVtx", &m_el_nPileupPrimaryVtx); - InitBranch( t, "calo_et", &m_calo_et); - InitBranch( t, "calo_eta", &m_calo_eta); - InitBranch( t, "calo_phi", &m_calo_phi); - -} - - -/*void TrigEgammaNavNtuple::linkPhotonBranches( TTree *t ){ -}*/ - -void TrigEgammaNavNtuple::linkTriggerBranches( TTree *t ){ - - InitBranch(t, "trig_L1_eta", &m_trig_L1_eta); - InitBranch(t, "trig_L1_phi", &m_trig_L1_phi); - InitBranch(t, "trig_L1_emClus", &m_trig_L1_emClus); - InitBranch(t, "trig_L1_tauClus", &m_trig_L1_tauClus); - InitBranch(t, "trig_L1_emIsol", &m_trig_L1_emIsol); - InitBranch(t, "trig_L1_hadIsol", &m_trig_L1_hadIsol); - InitBranch(t, "trig_L1_thrNames", &m_trig_L1_thrNames); - InitBranch(t, "trig_L1_accept", &m_trig_L1_accept); - InitBranch(t, "trig_L2_calo_et", &m_trig_L2_calo_et); - InitBranch(t, "trig_L2_calo_eta", &m_trig_L2_calo_eta); - InitBranch(t, "trig_L2_calo_phi", &m_trig_L2_calo_phi); - InitBranch(t, "trig_L2_calo_e237", &m_trig_L2_calo_e237 ); - InitBranch(t, "trig_L2_calo_e277", &m_trig_L2_calo_e277 ); - InitBranch(t, "trig_L2_calo_fracs1", &m_trig_L2_calo_fracs1); - InitBranch(t, "trig_L2_calo_weta2", &m_trig_L2_calo_weta2); - InitBranch(t, "trig_L2_calo_ehad1", &m_trig_L2_calo_ehad1); - InitBranch(t, "trig_L2_calo_emaxs1", &m_trig_L2_calo_emaxs1); - InitBranch(t, "trig_L2_calo_e2tsts1", &m_trig_L2_calo_e2tsts1); - InitBranch(t, "trig_L2_calo_wstot", &m_trig_L2_calo_wstot); - InitBranch(t, "trig_L2_calo_rnnOutput", &m_trig_L2_calo_rnnOutput ); - InitBranch(t, "trig_L2_calo_rings", &m_trig_L2_calo_rings ); - InitBranch(t, "trig_L2_calo_energySample",&m_trig_L2_calo_energySample ); - InitBranch(t, "trig_L2_calo_accept", &m_trig_L2_calo_accept); - - InitBranch(t, "trig_L2_el_trackAlgID" , &m_trig_L2_el_trackAlgID ); - InitBranch(t, "trig_L2_el_pt" , &m_trig_L2_el_pt ); - InitBranch(t, "trig_L2_el_eta", &m_trig_L2_el_eta); - InitBranch(t, "trig_L2_el_phi", &m_trig_L2_el_phi ); - InitBranch(t, "trig_L2_el_caloEta", &m_trig_L2_el_caloEta ); - InitBranch(t, "trig_L2_el_charge", &m_trig_L2_el_charge); - InitBranch(t, "trig_L2_el_nTRTHits", &m_trig_L2_el_nTRTHits); - InitBranch(t, "trig_L2_el_nTRTHiThresholdHits", &m_trig_L2_el_nTRTHiThresholdHits); - InitBranch(t, "trig_L2_el_etOverPt" , &m_trig_L2_el_etOverPt ); - InitBranch(t, "trig_L2_el_trkClusDeta" , &m_trig_L2_el_trkClusDeta ); - InitBranch(t, "trig_L2_el_trkClusDphi" , &m_trig_L2_el_trkClusDphi ); - - InitBranch(t, "trig_L2_el_accept", &m_trig_L2_el_accept ); - InitBranch(t, "trig_EF_el_accept", &m_trig_EF_el_accept ); - InitBranch(t, "trig_EF_calo_accept", &m_trig_EF_calo_accept ); - InitBranch(t, "trig_EF_calo_et", &m_trig_EF_calo_et ); - InitBranch(t, "trig_EF_calo_eta", &m_trig_EF_calo_eta ); - -} - - -void TrigEgammaNavNtuple::linkMonteCarloBranches(TTree *t){ - - InitBranch(t, "mc_hasMC", &m_mc_hasMC); - InitBranch(t, "mc_pt", &m_mc_pt); - InitBranch(t, "mc_eta", &m_mc_eta); - InitBranch(t, "mc_phi", &m_mc_phi); - InitBranch(t, "mc_isTop", &m_mc_isTop); - InitBranch(t, "mc_isParton", &m_mc_isParton); - InitBranch(t, "mc_isMeson", &m_mc_isMeson); - InitBranch(t, "mc_isTau", &m_mc_isTau); - InitBranch(t, "mc_isMuon", &m_mc_isMuon); - InitBranch(t, "mc_isPhoton", &m_mc_isPhoton); - InitBranch(t, "mc_isElectron", &m_mc_isElectron); - InitBranch(t, "mc_hasZMother", &m_mc_hasZMother); - InitBranch(t, "mc_hasWMother", &m_mc_hasWMother); -} - - -void TrigEgammaNavNtuple::clear(){ - - ///EventInfo - m_runNumber = 0; - m_eventNumber = 0; - m_avgmu = 0; - ///Egamma - m_el_et = -1; - m_el_pt = -1; - m_el_eta = -1; - m_el_phi = -1; - m_el_ethad1 = -1; - m_el_ehad1 = -1; - m_el_f1 = -1; - m_el_f3 = -1; - m_el_f1core = -1; - m_el_f3core = -1; - m_el_weta2 = -1; - m_el_d0 = -1; - m_el_wtots1 = -1; - m_el_fracs1 = -1; - m_el_Reta = -1; - m_el_Rphi = -1; - m_el_Eratio = -1; - m_el_Rhad = -1; - m_el_Rhad1 = -1; - m_el_deta1 = -1; - m_el_deta2 = -1; - m_el_dphi2 = -1; - m_el_dphiresc = -1; - m_el_dphiresc2 = -1; - m_el_eprobht = -1; - m_el_charge = 0; - m_el_nblayerhits = 0; - m_el_nblayerolhits = 0; - m_el_npixhits = 0; - m_el_npixolhits = 0; - m_el_nscthits = 0; - m_el_nsctolhits = 0; - m_el_ntrthightreshits = 0; - m_el_ntrthits = 0; - m_el_ntrthighthresolhits= 0; - m_el_ntrtolhits = 0; - m_el_ntrtxenonhits = 0; - m_el_expectblayerhit = false; - m_el_nsihits = 0; - m_el_nsideadsensors = 0; - m_el_npixdeadsensors = 0; - m_el_nsctdeadsensors = 0; - m_el_loose = false; - m_el_medium = false; - m_el_tight = false; - m_el_lhLoose = false; - m_el_lhMedium = false; - m_el_lhTight = false; - m_el_rgLoose = false; - m_el_rgMedium = false; - m_el_rgTight = false; - m_el_multiLepton = false; - m_el_nGoodVtx = -1; - m_el_nPileupPrimaryVtx = -1; - m_calo_et = -1; - m_calo_eta = -1; - m_calo_phi = -1; - - ///Trigger - m_trig_L1_eta = -1; - m_trig_L1_phi = -1; - m_trig_L1_emClus = -1; - m_trig_L1_tauClus = -1; - m_trig_L1_emIsol = -1; - m_trig_L1_hadIsol = -1; - m_trig_L1_accept = false; - m_trig_L2_calo_et = -1; - m_trig_L2_calo_eta = -1; - m_trig_L2_calo_phi = -1; - m_trig_L2_calo_e237 = -1; - m_trig_L2_calo_e277 = -1; - m_trig_L2_calo_fracs1 = -1; - m_trig_L2_calo_weta2 = -1; - m_trig_L2_calo_ehad1 = -1; - m_trig_L2_calo_emaxs1 = -1; - m_trig_L2_calo_e2tsts1 = -1; - m_trig_L2_calo_wstot = -1; - m_trig_L2_calo_rnnOutput = 999; - - m_trig_L1_accept = false; - m_trig_L2_calo_accept = false; - m_trig_L2_el_accept = false; - m_trig_EF_calo_accept = false; - m_trig_EF_el_accept = false; - - ///Monte Carlo - m_mc_hasMC = false; - m_mc_pt = -1; - m_mc_eta = -1; - m_mc_phi = -1; - m_mc_isTop = false; - m_mc_isParton = false; - m_mc_isMeson = false; - m_mc_isTau = false; - m_mc_isMuon = false; - m_mc_isPhoton = false; - m_mc_isElectron = false; - m_mc_hasZMother = false; - m_mc_hasWMother = false; - - ///Some vectors - m_trig_L1_thrNames ->clear(); - m_trig_L2_calo_energySample ->clear(); - m_trig_L2_calo_rings ->clear(); - - m_trig_L2_el_trackAlgID ->clear(); - m_trig_L2_el_eta ->clear(); - m_trig_L2_el_phi ->clear(); - m_trig_L2_el_caloEta ->clear(); - m_trig_L2_el_trkClusDeta ->clear(); - m_trig_L2_el_trkClusDphi ->clear(); - m_trig_L2_el_pt ->clear(); - m_trig_L2_el_etOverPt ->clear(); - m_trig_L2_el_nTRTHits ->clear(); - m_trig_L2_el_nTRTHiThresholdHits ->clear(); - m_trig_L2_el_charge ->clear(); - m_trig_EF_calo_et ->clear(); -} - -void TrigEgammaNavNtuple::alloc_space(){ - - m_el_ringsE = new std::vector<float>(); - m_trig_L1_thrNames = new std::vector<std::string>(); - m_trig_L2_calo_energySample = new std::vector<float>(); - m_trig_L2_calo_rings = new std::vector<float>(); - m_trig_L2_el_trackAlgID = new std::vector<int>(); - m_trig_L2_el_eta = new std::vector<float>(); - m_trig_L2_el_phi = new std::vector<float>(); - m_trig_L2_el_caloEta = new std::vector<float>(); - m_trig_L2_el_trkClusDeta = new std::vector<float>(); - m_trig_L2_el_trkClusDphi = new std::vector<float>(); - m_trig_L2_el_pt = new std::vector<float>(); - m_trig_L2_el_etOverPt = new std::vector<float>(); - m_trig_L2_el_nTRTHits = new std::vector<float>(); - m_trig_L2_el_nTRTHiThresholdHits = new std::vector<float>(); - m_trig_L2_el_charge = new std::vector<float>(); - m_trig_EF_calo_et = new std::vector<float>(); - m_trig_EF_calo_eta = new std::vector<float>(); - -} - -void TrigEgammaNavNtuple::release_space(){ - delete m_el_ringsE ; - delete m_trig_L1_thrNames ; - delete m_trig_L2_calo_energySample; - delete m_trig_L2_calo_rings ; - delete m_trig_L2_el_trackAlgID ; - delete m_trig_L2_el_pt ; - delete m_trig_L2_el_eta ; - delete m_trig_L2_el_caloEta ; - delete m_trig_L2_el_phi ; - delete m_trig_L2_el_charge ; - delete m_trig_L2_el_nTRTHits ; - delete m_trig_L2_el_nTRTHiThresholdHits ; - delete m_trig_L2_el_etOverPt ; - delete m_trig_L2_el_trkClusDeta ; - delete m_trig_L2_el_trkClusDphi ; - delete m_trig_EF_calo_et ; - delete m_trig_EF_calo_eta ; -} - -unsigned TrigEgammaNavNtuple::count_HLT_objects( const HLT::TriggerElement *feat ) -{ - unsigned nobj=0; - if(getFeature<xAOD::ElectronContainer>(feat) ) nobj++; // HLT - if(getFeature<xAOD::CaloClusterContainer>(feat) ) nobj++; // EFCalo - if(getFeature<xAOD::TrigElectronContainer>(feat)) nobj++; // L2 - if(getFeature<xAOD::TrigEMCluster>(feat) ) nobj++; // L2Calo - ATH_MSG_DEBUG("Number of objects counted in this feature: " << nobj); - return nobj; -} diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPAnalysisTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPAnalysisTool.cxx index 57a1a2058f76f9e7f9fbca8b03424a9ad15f0f9e..c13b73ef8d1fbf887f923596d0735186e99d4c61 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPAnalysisTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPAnalysisTool.cxx @@ -48,9 +48,21 @@ StatusCode TrigEgammaNavTPAnalysisTool::childBook(){ if (std::find(chains.begin(), chains.end(), trigName) != chains.end()){ if(plot()->getTrigInfoMap().count(trigName) != 0) ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName); - else + else { m_trigList.push_back(trigName); + setTrigInfo(trigName); + } } + + // specail code to add trigger without the menu + else if(getEmulation() && m_forceTrigAttachment){// + ATH_MSG_INFO("Trigger doesn't exist in menu. Attach to emulate."); + if(plot()->getTrigInfoMap().count(trigName) == 0){ + m_trigList.push_back(trigName); + setTrigEmulation(); + setTrigInfo(trigName); + } + }// emulation } // Book histograms for average efficiencies and counters const int nTrigger = (int) m_trigList.size(); @@ -104,9 +116,6 @@ StatusCode TrigEgammaNavTPAnalysisTool::childBook(){ setLabels(hist1(m_anatype+"_EffHLT"),m_trigList); setLabels(hist1(m_anatype+"_CutCounter"),m_cutlabels); } - // Book the histograms per signature - for (int i = 0; i < (int) m_trigList.size(); i++) - setTrigInfo(m_trigList[i]); plot()->setEmulation(getEmulation()); if(plot()->book(getTrigInfoMap()).isFailure()){ @@ -136,6 +145,19 @@ StatusCode TrigEgammaNavTPAnalysisTool::childExecute() ATH_MSG_DEBUG("Fails EventWise selection"); return StatusCode::SUCCESS; } + // Check for Rnn container in SG + if(m_storeGate->contains<xAOD::TrigRNNOutputContainer>("HLT_xAOD__TrigRNNOutputContainer_TrigRingerNeuralFex")){ + setSGContainsRnn(true); + } + if(m_storeGate->contains<xAOD::TrigPhotonContainer>("HLT_xAOD__TrigPhotonContainer_L2PhotonFex")){ + setSGContainsTrigPhoton(true); + } + ATH_MSG_DEBUG("Rnn container in SG " << getSGContainsRnn()); + ATH_MSG_DEBUG("TrigPhotonContainer in SG " << getSGContainsTrigPhoton()); + for( const auto& tool : m_tools) { + tool->setSGContainsRnn(getSGContainsRnn()); + tool->setSGContainsTrigPhoton(getSGContainsTrigPhoton()); + } // Event Wise Selection (independent of the required signatures) hist1(m_anatype+"_CutCounter")->Fill("EventWise",1); // Select TP Pairs diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx index 4dac467c9006890f13a19afe2a7ef296c5b30d36..90610ba04a1ee451369de5d41458e18e498f3d2d 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx @@ -19,10 +19,10 @@ * All derived classes work with list of probes for a given trigger. * As input property, pass a list of triggers to study. **********************************************************************/ -#include "egammaMVACalibAnalysis/IegammaMVATool.h" #include "TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h" #include "TrigConfxAOD/xAODConfigTool.h" #include "xAODEventInfo/EventInfo.h" +#include "GaudiKernel/SystemOfUnits.h" #include "PATCore/AcceptData.h" #include "string" #include <algorithm> @@ -47,12 +47,14 @@ TrigEgammaNavTPBaseTool( const std::string& myname ) declareProperty("ForceProbePid", m_forceProbePid=false); // new declareProperty("OppositeCharge",m_oppositeCharge=true); declareProperty("OfflineTagMinEt",m_tagMinEt=25); + declareProperty("OfflineProbeMinEt",m_probeMinEt=4); declareProperty("TagTriggerList", m_tagTrigList); declareProperty("TriggerList",m_trigInputList); declareProperty("CategoryList",m_categories); declareProperty("RemoveCrack", m_rmCrack=true); //new declareProperty("OfflineProbeIsolation", m_offProbeIsolation="Loose"); declareProperty("ForceProbeIsolation", m_forceProbeIsolation=false); + declareProperty("ApplyMinimalTrigger", m_applyMinimalTrigger=true); // Maps should be static m_PidToolMap["Tight"]=0; @@ -64,9 +66,9 @@ TrigEgammaNavTPBaseTool( const std::string& myname ) m_jets=nullptr; m_eventInfo=nullptr; m_truthContainer=nullptr; + m_METContainer=nullptr; m_applyJetNearProbeSelection=true; - m_skipTrigger=false; - + m_skipTrigger=false; } //********************************************************************** @@ -81,7 +83,10 @@ StatusCode TrigEgammaNavTPBaseTool::childExecute() { StatusCode TrigEgammaNavTPBaseTool::childFinalize() { ATH_MSG_VERBOSE( "child Finalize tool " << name() ); + // delete electron pointers alloc in the tap execute method and + // clear the list of pairs clearProbeList(); + // clear the list of pairs clearPairList(); //m_offElectrons->clearDecorations(); @@ -104,9 +109,11 @@ TrigEgammaNavTPBaseTool::childInitialize() { return StatusCode::SUCCESS; } + StatusCode TrigEgammaNavTPBaseTool::childBook() { return StatusCode::SUCCESS; } + bool TrigEgammaNavTPBaseTool::EventWiseSelection(){ ATH_MSG_DEBUG("Apply EventWise selection"); @@ -122,7 +129,6 @@ bool TrigEgammaNavTPBaseTool::EventWiseSelection(){ m_offElectrons = 0; m_jets = 0; m_truthContainer=0; - if ( (m_storeGate->retrieve(m_eventInfo, "EventInfo")).isFailure() ){ ATH_MSG_WARNING("Failed to retrieve eventInfo "); @@ -136,6 +142,15 @@ bool TrigEgammaNavTPBaseTool::EventWiseSelection(){ } }// protection + if(m_storeGate->contains<xAOD::MissingETContainer>("MET_Reference_AntiKt4EMTopo")){ + if(m_storeGate->retrieve(m_METContainer,"MET_Reference_AntiKt4EMTopo").isFailure()){ + ATH_MSG_WARNING("Could not retrieve xAOD::MissingETContainer 'MET_Reference_AntiKt4EMTopo'"); + return false; + } + }// protection + + + if (m_eventInfo->errorState(xAOD::EventInfo::LAr) == xAOD::EventInfo::Error) { ATH_MSG_DEBUG("Event not passing LAr"); return false; @@ -173,9 +188,11 @@ bool TrigEgammaNavTPBaseTool::EventWiseSelection(){ // missing more selections // check Minimal Trigger Requirements - if ( !MinimalTriggerRequirement() ) return false; + if(m_applyMinimalTrigger) + if ( !MinimalTriggerRequirement() ) return false; hist1(m_anatype+"_CutCounter")->Fill("PassTrigger",1); + return true; } @@ -193,11 +210,18 @@ bool TrigEgammaNavTPBaseTool::MinimalTriggerRequirement(){ void TrigEgammaNavTPBaseTool::executeTandP(){ + // clear all Z index pairs + m_Z.clear(); + unsigned itag=0; + clearProbeList(); // Clear Probes after each trigger ATH_MSG_DEBUG("Execute TandP BaseTool " << m_offElectrons->size()); for(const auto& elTag : *m_offElectrons){ + itag++; if( ! isTagElectron(elTag) ) continue; + unsigned iprobe=0; for(const auto& elProbe : *m_offElectrons){ // Dress the probes with updated Pid decision + iprobe++; hist1(m_anatype+"_ProbeCutCounter")->Fill("Electrons",1); if(elProbe==elTag) continue; hist1(m_anatype+"_ProbeCutCounter")->Fill("NotTag",1); @@ -241,36 +265,56 @@ void TrigEgammaNavTPBaseTool::executeTandP(){ xAOD::Electron *selProbe = new xAOD::Electron(*elProbe); DressPid(selProbe); m_probeElectrons.push_back(selProbe); + m_Z.push_back( std::pair<unsigned,unsigned>(itag-1,iprobe-1) ); hist1(m_anatype+"_Mee")->Fill(tpPairMass/1.e3); } } // end of for in Probe } // end of for in Tags } + void TrigEgammaNavTPBaseTool::matchObjects(const std::string probeTrigItem){ clearPairList(); + bool isEmulation = getTrigInfo(probeTrigItem).trigIsEmulation; + + for(unsigned int i=0;i<m_probeElectrons.size();i++){ const HLT::TriggerElement *finalFC; - - // Use matching tool and create pair of offline probe and TE - if ( match()->match(m_probeElectrons[i], probeTrigItem, finalFC)){ - std::pair<const xAOD::Electron*,const HLT::TriggerElement*> pairProbe(m_probeElectrons[i],finalFC); - m_pairObj.push_back(pairProbe); - } // end of check Probe - else { - std::pair<const xAOD::Electron*,const HLT::TriggerElement*> pairProbe(m_probeElectrons[i],nullptr); - m_pairObj.push_back(pairProbe); - } // still include the probe + if(isEmulation && getEmulation()){ // Collect from support match + emulation()->match( m_probeElectrons[i], finalFC ); + std::pair<const xAOD::Electron*,const HLT::TriggerElement*> pairProbe(m_probeElectrons[i],finalFC); + m_pairObj.push_back(pairProbe); + }else{ + // Use matching tool and create pair of offline probe and TE + if ( match()->match(m_probeElectrons[i], probeTrigItem, finalFC)){ + std::pair<const xAOD::Electron*,const HLT::TriggerElement*> pairProbe(m_probeElectrons[i],finalFC); + m_pairObj.push_back(pairProbe); + } // end of check Probe + else { + std::pair<const xAOD::Electron*,const HLT::TriggerElement*> pairProbe(m_probeElectrons[i],nullptr); + m_pairObj.push_back(pairProbe); + } // still include the probe + } } } void TrigEgammaNavTPBaseTool::clearProbeList(){ + + ATH_MSG_DEBUG("Clear all Probes..."); + // this vector hold the Electron pointer and need to + // be deleted since we alloc such memory for than + for (auto it : m_probeElectrons) + delete it; m_probeElectrons.clear(); + m_probePhotons.clear(); } void TrigEgammaNavTPBaseTool::clearPairList(){ + + ATH_MSG_DEBUG("Clear all Pairs..."); + // this only hold < Electron * , TriggerElement * > m_pairObj.clear(); } @@ -285,7 +329,6 @@ bool TrigEgammaNavTPBaseTool::isTagElectron(const xAOD::Electron *el){ // Require offline tight electron // Match to e24_tight1_L1EM20V ATH_MSG_DEBUG("Selecting Tag Electron"); - double GeV = 1000.; //Check constituents const xAOD::TrackParticle *trk = el->trackParticle(); @@ -308,7 +351,7 @@ bool TrigEgammaNavTPBaseTool::isTagElectron(const xAOD::Electron *el){ hist1(m_anatype+"_TagCutCounter")->Fill("GoodPid",1); ATH_MSG_DEBUG("Selecting Tag Electron Et"); //Require Et > 25 GeV - if( !(el->e()/cosh(el->trackParticle()->eta()) > m_tagMinEt*GeV) ){ + if( !(el->e()/cosh(el->trackParticle()->eta()) > m_tagMinEt*Gaudi::Units::GeV) ){ return false; } hist1(m_anatype+"_TagCutCounter")->Fill("Et",1); @@ -375,13 +418,14 @@ bool TrigEgammaNavTPBaseTool::isTagElectron(const xAOD::Electron *el){ void TrigEgammaNavTPBaseTool::DressPid(const xAOD::Electron *eg){ + auto ctx = Gaudi::Hive::currentContext() ; for(int ipid=0;ipid<3;ipid++){ - bool accept = (bool) m_electronIsEMTool[ipid]->accept(eg); + bool accept = (bool) m_electronIsEMTool[ipid]->accept(ctx,eg); const std::string pidname="is"+m_isemname[ipid]; eg->auxdecor<bool>(pidname)=static_cast<bool>(accept); } for(int ipid=0;ipid<2;ipid++){ - bool accept = (bool) m_electronLHTool[ipid]->accept(eg); + bool accept = (bool) m_electronLHTool[ipid]->accept(ctx,eg); const std::string pidname="is"+m_lhname[ipid]; eg->auxdecor<bool>(pidname)=static_cast<bool>(accept); } @@ -389,34 +433,30 @@ void TrigEgammaNavTPBaseTool::DressPid(const xAOD::Electron *eg){ } bool TrigEgammaNavTPBaseTool::ApplyElectronPid(const xAOD::Electron *eg, const std::string pidname){ - + auto ctx = Gaudi::Hive::currentContext() ; if (pidname == "Tight"){ - bool accept = (bool) m_electronIsEMTool[0]->accept(eg); - return static_cast<bool>(accept); + return (bool) m_electronIsEMTool[0]->accept(ctx,eg); } else if (pidname == "Medium"){ - bool accept = (bool) m_electronIsEMTool[1]->accept(eg); - return static_cast<bool>(accept); + return (bool) m_electronIsEMTool[1]->accept(ctx,eg); } else if (pidname == "Loose"){ - bool accept = (bool) m_electronIsEMTool[2]->accept(eg); - return static_cast<bool>(accept); + return (bool) m_electronIsEMTool[2]->accept(ctx,eg); } else if (pidname == "LHTight"){ - bool accept = (bool) m_electronLHTool[0]->accept(eg); - return static_cast<bool>(accept); + return (bool) m_electronLHTool[0]->accept(ctx,eg); } else if (pidname == "LHMedium"){ - bool accept = (bool) m_electronLHTool[1]->accept(eg); - return static_cast<bool>(accept); + return (bool) m_electronLHTool[1]->accept(ctx,eg); } else if (pidname == "LHLoose"){ - bool accept = (bool) m_electronLHTool[2]->accept(eg); - return static_cast<bool>(accept); + return (bool) m_electronLHTool[2]->accept(ctx,eg); } else if (pidname == "LHMediumHI"){ - bool accept = (bool) m_electronLHTool[3]->accept(eg); - return static_cast<bool>(accept); + return (bool) m_electronLHTool[3]->accept(ctx,eg); + } + else if (pidname == "LHMediumHI"){ + return (bool) m_electronLHTool[3]->accept(ctx,eg); } else ATH_MSG_DEBUG("No Pid tool, continue without PID"); return false; @@ -424,7 +464,6 @@ bool TrigEgammaNavTPBaseTool::ApplyElectronPid(const xAOD::Electron *eg, const s bool TrigEgammaNavTPBaseTool::isGoodProbeElectron(const xAOD::Electron *el){ - double GeV = 1000.; //Check constituents if(!el->trackParticle()){ ATH_MSG_DEBUG("No track Particle"); @@ -444,7 +483,7 @@ bool TrigEgammaNavTPBaseTool::isGoodProbeElectron(const xAOD::Electron *el){ } } hist1(m_anatype+"_ProbeCutCounter")->Fill("Eta",1); - /*if( !(el->e()/cosh(el->trackParticle()->eta()) > (etthr-5.0)*GeV) ){ + /*if( !(el->e()/cosh(el->trackParticle()->eta()) > (etthr-5.0)*Gaudi::Units::GeV) ){ return false; } hist1("ProbeCutCounter")->Fill("Et",1);*/ @@ -461,7 +500,7 @@ bool TrigEgammaNavTPBaseTool::isGoodProbeElectron(const xAOD::Electron *el){ for(const auto &i_jet : *m_jets){ TLorentzVector jet; jet.SetPtEtaPhiE(i_jet->pt(), i_jet->eta(), i_jet->phi(), i_jet->e()); - if( (jet.Et() > 20*GeV) && (jet.DeltaR(probeCandidate) < 0.4)) jetsAroundProbeElectron++; + if( (jet.Et() > 20*Gaudi::Units::GeV) && (jet.DeltaR(probeCandidate) < 0.4)) jetsAroundProbeElectron++; } //reject if more than 1 jet close to the probe electron if ( jetsAroundProbeElectron >= 2 ) { @@ -529,3 +568,32 @@ double TrigEgammaNavTPBaseTool::simple_lxy(int flag, double d1, double d2, do else return (a+b)/c; } + + + +float TrigEgammaNavTPBaseTool::getWTransverseMass( const xAOD::Electron *el ){ + float transverseMass=0.0; + if(m_METContainer){ + TLorentzVector MET_4vec = TLorentzVector(getMET()->mpx(), getMET()->mpy(), 0, getMET()->met()); + TLorentzVector electron; + electron.SetPtEtaPhiE(el->pt(), 0, el->phi(), el->pt()); + transverseMass = (MET_4vec + electron).M(); + } + return transverseMass; + +} + +bool TrigEgammaNavTPBaseTool::passesEventCleaning() +{ + ATH_MSG_DEBUG("Appling Event Cleaning..."); + bool failsLAr = (m_eventInfo->errorState(xAOD::EventInfo::LAr) == xAOD::EventInfo::Error ); + bool failsTile = (m_eventInfo->errorState(xAOD::EventInfo::Tile) == xAOD::EventInfo::Error ); + bool failsSCT = (m_eventInfo->errorState(xAOD::EventInfo::SCT) == xAOD::EventInfo::Error ); + bool failsTTC = (m_eventInfo->isEventFlagBitSet(xAOD::EventInfo::Core, 18)); // timing, trigger, control failed => some eventinfo missing + bool pass = !(failsLAr || failsTile || failsSCT || failsTTC); + if(!pass) + ATH_MSG_DEBUG("Event not clear! "); + return pass; +} + + diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPNtuple.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPNtuple.cxx deleted file mode 100755 index 680e786f42f35dbe1fe6acb46eb52ff672b9c156..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPNtuple.cxx +++ /dev/null @@ -1,1066 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -/********************************************************************** - * AsgTool: TrigEgammaNavTPNtuple - * Authors: - * Ryan Mackenzie White <ryan.white@cern.ch> - * Denis Damazio <denis.damazio@cern.ch> - * Contributors: - * Joao Victor da Fonseca Pinto <joao.victor.da.fonseca.pinto@cern.ch> - * Date: Mar 2015 - * Description: - * Derived class for dumping the probe information into a ttree. - * - **********************************************************************/ - -#include "TrigEgammaAnalysisTools/TrigEgammaNavTPNtuple.h" - -using namespace std; - -TrigEgammaNavTPNtuple::TrigEgammaNavTPNtuple( const std::string& myname ): TrigEgammaNavTPBaseTool(myname) -{ - m_eventCounter = 0; - declareProperty("CutLabels", m_cutlabels ); - declareProperty("Analysis", m_anatype="NavTPNtuple" ); - declareProperty("doOfflineDump", m_doOfflineDump=false ); - declareProperty("DoSupportTrigger", m_doSupport=true ); - declareProperty("OfflineProbeMinEt", m_probeMinEt=-1 ); - - m_el_ringsE=nullptr; - m_trig_L1_thrNames=nullptr; - m_trig_L2_calo_energySample=nullptr; - m_trig_L2_calo_rings=nullptr; - m_trig_L2_el_trackAlgID=nullptr; - m_trig_L2_el_pt=nullptr; - m_trig_L2_el_eta=nullptr; - m_trig_L2_el_caloEta=nullptr; - m_trig_L2_el_phi=nullptr; - m_trig_L2_el_charge=nullptr; - m_trig_L2_el_nTRTHits=nullptr; - m_trig_L2_el_nTRTHiThresholdHits=nullptr; - m_trig_L2_el_etOverPt=nullptr; - m_trig_L2_el_trkClusDeta=nullptr; - m_trig_L2_el_trkClusDphi=nullptr; - m_trig_EF_calo_et=nullptr; - m_trig_EF_calo_eta=nullptr; -} - -StatusCode TrigEgammaNavTPNtuple::childInitialize(){ - return StatusCode::SUCCESS; -} - - -StatusCode TrigEgammaNavTPNtuple::childBook(){ - - ATH_MSG_DEBUG("Now configuring chains for analysis"); - //Set the base directory from the plot() - m_dir=plot()->getBasePath(); - std::vector<std::string> chains = tdt()->getListOfTriggers("HLT_e.*, L1_EM.*, HLT_g.*"); - - TrigEgammaAnalysisBaseTool::write_trigger_list(chains); - - for(const auto trigName:m_trigInputList){ - if (std::find(chains.begin(), chains.end(), trigName) != chains.end()) { - if(plot()->getTrigInfoMap().count(trigName) != 0) - ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName); - else - m_trigList.push_back(trigName); - } - } - - - - // Book histograms for average efficiencies and counters - //const int nTrigger = (int) m_trigList.size(); - addDirectory(m_dir+"/Expert/Event"); - std::string histname=m_anatype+"_ProbeCutCounter"; - addHistogram(new TH1F(histname.c_str(), "Number of Probes; Cut ; Count", 12, 0., 12)); - histname=m_anatype+"_TagCutCounter"; - addHistogram(new TH1F(histname.c_str(), "Number of Tags; Cut ; Count", 10, 0., 10)); - histname=m_anatype+"_Mee"; - addHistogram(new TH1F(histname.c_str(), "Offline M(ee); m_ee [GeV] ; Count", 50, m_ZeeMassMin, m_ZeeMassMax)); - histname=m_anatype+"_CutCounter"; - addHistogram(new TH1I(histname.c_str(), "Event Selection; Cut ; Count", 6, 0., 6)); - setLabels(hist1(histname),m_cutlabels); - - if(m_doOfflineDump){ - addDirectory(m_dir+"/Expert/Offline"); - TTree *t = new TTree( "probes", "tree of Offline Zee probes"); - bookEventBranches( t ); - bookElectronBranches( t ); - //bookPhotonBranches( t ); - bookMonteCarloBranches( t ); - addTree(t, m_dir+"/Expert/Offline"); - }else if (m_doSupport){ // All trigger in one - addDirectory(m_dir+"/Expert/support"); - TTree *t = new TTree( "probes", "tree of Zee probes"); - bookEventBranches( t ); - bookElectronBranches( t ); - //bookPhotonBranches( t ); - bookTriggerBranches( t ); - bookMonteCarloBranches( t ); - for(auto& trigItem : m_trigList) - setTrigInfo(trigItem); - addTree(t, m_dir+"/Expert/support"); - }else{// Each trigger - for (auto& trigItem : m_trigList) { - addDirectory(m_dir+"/Expert/"+trigItem); - TTree *t = new TTree( "probes", "tree of Zee probes"); - bookEventBranches( t ); - bookElectronBranches( t ); - //bookPhotonBranches( t ); - bookTriggerBranches( t ); - bookMonteCarloBranches( t ); - setTrigInfo(trigItem); - addTree(t, m_dir+"/Expert/"+trigItem); - }// Loop over triggers - } - - ///Alloc pointers - alloc_space(); - return StatusCode::SUCCESS; -} - -StatusCode TrigEgammaNavTPNtuple::childExecute(){ - - m_eventCounter++; - cd(m_dir+"/Expert/Event"); - // Event Wise Selection (independent of the required signatures) - if ( !TrigEgammaNavTPBaseTool::EventWiseSelection() ) return StatusCode::SUCCESS; - - if(m_doOfflineDump){ - if(!executeProbesDump()) return StatusCode::FAILURE; - }else if (m_doSupport){ - if(!executeProbesSupportDump()) return StatusCode::FAILURE; - }else{ - if(!executeProbesItemDump()) return StatusCode::FAILURE; - } - - return StatusCode::SUCCESS; -} - - - -bool TrigEgammaNavTPNtuple::executeProbesDump(){ - - // Select TP Pairs - executeTandP(); - - TTree *t = tree( "probes", m_dir+"/Expert/Offline"); - linkEventBranches(t); - linkElectronBranches(t); - linkMonteCarloBranches(t); - for(unsigned int iprobe = 0; iprobe != m_probeElectrons.size(); ++iprobe){ - const xAOD::Electron *el = static_cast<const xAOD::Electron *> (m_probeElectrons[iprobe]); - ATH_MSG_DEBUG("dumping probe electron information..."); - clear(); - fillEvent(); - fillElectron( el ); - if(!fillMonteCarlo( el ) ){ - ATH_MSG_WARNING("Cound not found any TruthParticle for this Electron"); - } - ATH_MSG_DEBUG("record probe information into the file."); - t->Fill(); - }// loop over offline probes - - return true; -} - - -bool TrigEgammaNavTPNtuple::executeProbesItemDump(){ - - executeTandP(); - - for(unsigned int ilist = 0; ilist != m_trigList.size(); ++ilist) { - - std::string trigItem = m_trigList.at(ilist); - const TrigInfo info = getTrigInfo(trigItem); - cd(m_dir+"/Expert/"+trigItem); - TTree *t = tree( "probes", m_dir+"/Expert/"+trigItem); - linkEventBranches(t); - linkElectronBranches(t); - linkTriggerBranches(t); - linkMonteCarloBranches(t); - //Try to find trigger objects - TrigEgammaNavTPBaseTool::matchObjects(trigItem); - - for(unsigned int iprobe = 0; iprobe != m_pairObj.size(); ++iprobe){ - - const xAOD::Electron *el = static_cast<const xAOD::Electron *> (m_pairObj[iprobe].first); - const HLT::TriggerElement *feat = m_pairObj[iprobe].second; - ATH_MSG_DEBUG("dumping probe electron information..."); - - clear(); - fillEvent(); - fillElectron( el ); - - if(!fillMonteCarlo( el ) ){ - ATH_MSG_WARNING("Cound not found any TruthParticle for this Electron"); - } - - if(feat){ - ///Start trigger analisys... - const xAOD::EmTauRoI *emTauRoI = getFeature<xAOD::EmTauRoI>(feat); - if(emTauRoI){ - fillEmTauRoI( emTauRoI ); - }else{ - ATH_MSG_WARNING("Cound not found EmTauRoI in this TriggerElement.."); - } - - const xAOD::TrigEMCluster *emCluster = getFeature<xAOD::TrigEMCluster>(feat); - if(emCluster){ - - if(!fillTrigEMCluster( emCluster )){ - ATH_MSG_WARNING("Cound not attach the trigEMCluster information into the tree."); - } - - //if(TrigEgammaAnalysisBaseTool::getTrigCaloRings(emCluster, ringsContainer ,*m_trig_L2_calo_rings)){ - if(!fillTrigCaloRings( emCluster )){ - ATH_MSG_WARNING("Cound not attach the trigCaloRinger information into the tree."); - } - }///cluster protection - - - const xAOD::TrigElectronContainer *trigElCont = getFeature<xAOD::TrigElectronContainer>(feat); - // Level 2 ID+Calo - if(trigElCont){ - for(const auto& trigEl : *trigElCont){ - if(!fillTrigElectron(trigEl)) { - ATH_MSG_WARNING("Cound not attach the trigElectron information into the tree."); - } - }// loop over all trigElectrons for this feat - } - - const xAOD::CaloClusterContainer *caloCont = getFeature<xAOD::CaloClusterContainer>(feat); - if(caloCont){ - for(const auto& cl : *caloCont){ - if(!fillCaloCluster(cl)){ - ATH_MSG_WARNING("Cound not attach the CaloCluster information into the tree."); - } - }// loop over calo cluster - } - - - asg::AcceptData acceptData = setAccept(feat,info); - m_trig_L1_accept = acceptData.getCutResult("L1Calo"); - m_trig_L2_calo_accept = acceptData.getCutResult("L2Calo"); - m_trig_L2_el_accept = acceptData.getCutResult("L2"); - m_trig_EF_calo_accept = acceptData.getCutResult("EFCalo"); - m_trig_EF_el_accept = acceptData.getCutResult("HLT"); - - ATH_MSG_DEBUG("L1Calo: " << int(m_trig_L1_accept)); - ATH_MSG_DEBUG("L2Calo: " << int(m_trig_L2_calo_accept)); - ATH_MSG_DEBUG("L2 : " << int(m_trig_L2_el_accept)); - ATH_MSG_DEBUG("EFCalo: " << int(m_trig_EF_calo_accept)); - ATH_MSG_DEBUG("HLT : " << int(m_trig_EF_el_accept)); - - }else{ - ATH_MSG_DEBUG("No TriggerElement for this probe!"); - } - ATH_MSG_DEBUG("record probe information into the file."); - t->Fill(); - }// loop over probes - } // End loop over trigger list - - return true; -} - - - -bool TrigEgammaNavTPNtuple::executeProbesSupportDump(){ - - double GeV=1000.; - std::vector<const HLT::TriggerElement *> vec_feat; - - // Tag and probe algorithm - executeTandP(); - - cd(m_dir+"/Expert/support"); - TTree *t = tree( "probes", m_dir+"/Expert/support"); - linkEventBranches(t); - linkElectronBranches(t); - linkMonteCarloBranches(t); - - for(const auto &eg : m_probeElectrons){ - // Get the good electron - const xAOD::Electron* el =static_cast<const xAOD::Electron*> (eg); - // Force Et cut - if(m_probeMinEt > 0.0){ - if( !( getEt(el) > (m_probeMinEt)*GeV) ) continue; - } - // Clear the vector - vec_feat.clear(); - // Loop over support triggers: Here, we will collect all good trigger elements to - // dump on the ttree. - for(auto& trigItem : m_trigList){ - - const HLT::TriggerElement *feat=nullptr; - // Trigger match using Matching tool - match()->match(el, trigItem, feat); - - if(feat){// If has a match! - for(unsigned i=0; i < vec_feat.size(); ++i){ - if(getFeature<xAOD::EmTauRoI>(vec_feat[i])->roiWord() == getFeature<xAOD::EmTauRoI>(feat)->roiWord()){ - if(count_HLT_objects(feat) > count_HLT_objects(vec_feat[i])){ - vec_feat.erase(vec_feat.begin() + i); // Erase the trigger element lowest than the new feature - vec_feat.push_back(feat); // attach the new trigger element - break; - } - }// The same region in L1Calo trigger - } - if(vec_feat.empty()) vec_feat.push_back(feat); - }else{ - ATH_MSG_DEBUG("There is no match for this probe."); - } - }// Loop over support triggers - - ATH_MSG_DEBUG("Attached " << vec_feat.size() << " features "); - for(auto& feat : vec_feat){ - clear(); - fillEvent(); - fillElectron( el ); - - if(!fillMonteCarlo( el ) ){ - ATH_MSG_WARNING("Cound not found any TruthParticle for this Electron"); - } - - ///Start trigger analisys... - const xAOD::EmTauRoI *emTauRoI = getFeature<xAOD::EmTauRoI>(feat); - if(emTauRoI){ - fillEmTauRoI( emTauRoI ); - }else{ - ATH_MSG_WARNING("Cound not found EmTauRoI in this TriggerElement.."); - } - - const xAOD::TrigEMCluster *emCluster = getFeature<xAOD::TrigEMCluster>(feat); - if(emCluster){ - - if(!fillTrigEMCluster( emCluster )){ - ATH_MSG_WARNING("Cound not attach the trigEMCluster information into the tree."); - } - - //if(TrigEgammaAnalysisBaseTool::getTrigCaloRings(emCluster, ringsContainer ,*m_trig_L2_calo_rings)){ - if(!fillTrigCaloRings( emCluster )){ - ATH_MSG_WARNING("Cound not attach the trigCaloRinger information into the tree."); - } - }///cluster protection - - - const xAOD::TrigElectronContainer *trigElCont = getFeature<xAOD::TrigElectronContainer>(feat); - // Level 2 ID+Calo - if(trigElCont){ - for(const auto& trigEl : *trigElCont){ - if(!fillTrigElectron(trigEl)) { - ATH_MSG_WARNING("Cound not attach the trigElectron information into the tree."); - } - }// loop over all trigElectrons for this feat - } - - const xAOD::CaloClusterContainer *caloCont = getFeature<xAOD::CaloClusterContainer>(feat); - if(caloCont){ - for(const auto& cl : *caloCont){ - if(!fillCaloCluster(cl)){ - ATH_MSG_WARNING("Cound not attach the CaloCluster information into the tree."); - } - }// loop over calo cluster - } - - ATH_MSG_DEBUG("record trigger information into the file."); - t->Fill(); - }//loop over trigger objects - - }// Loop over probes - return true; -} - - - -StatusCode TrigEgammaNavTPNtuple::childFinalize(){ - //release_space(); - return StatusCode::SUCCESS; -} - - - -bool TrigEgammaNavTPNtuple::fillEmTauRoI( const xAOD::EmTauRoI *emTauRoI ){ - - m_trig_L1_eta = emTauRoI->eta(); - m_trig_L1_phi = emTauRoI->phi(); - m_trig_L1_emClus = emTauRoI->emClus(); - m_trig_L1_tauClus = emTauRoI->tauClus(); - m_trig_L1_emIsol = emTauRoI->emIsol(); - m_trig_L1_hadIsol = emTauRoI->hadIsol(); - for(unsigned i=0; i < emTauRoI->thrNames().size();++i) m_trig_L1_thrNames->push_back(emTauRoI->thrNames().at(i)); - return true; -} - -bool TrigEgammaNavTPNtuple::fillTrigEMCluster( const xAOD::TrigEMCluster *emCluster ){ - - m_trig_L2_calo_et = emCluster->et(); - m_trig_L2_calo_eta = emCluster->eta(); - m_trig_L2_calo_phi = emCluster->phi(); - m_trig_L2_calo_e237 = emCluster->e237(); - m_trig_L2_calo_e277 = emCluster->e277(); - m_trig_L2_calo_fracs1 = emCluster->fracs1(); - m_trig_L2_calo_weta2 = emCluster->weta2(); - m_trig_L2_calo_ehad1 = emCluster->ehad1(); - m_trig_L2_calo_emaxs1 = emCluster->emaxs1(); - m_trig_L2_calo_e2tsts1 = emCluster->e2tsts1(); - m_trig_L2_calo_wstot = emCluster->wstot(); - for(unsigned i=0; i<emCluster->energySample().size(); ++i){ - m_trig_L2_calo_energySample->push_back( emCluster->energySample().at(i)); - } - - return true; -} - - -bool TrigEgammaNavTPNtuple::fillTrigElectron( const xAOD::TrigElectron *trigEl ){ - - const xAOD::TrackParticle* trkIter = trigEl->trackParticle(); - if (trkIter==nullptr) return false; // disconsider candidates without track - int algoId = 0; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::FastTrackFinderSeed] ) algoId=9; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyA] ) algoId=5; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyB] ) algoId=6; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyC] ) algoId=7; - - m_trig_L2_el_trackAlgID ->push_back(algoId); - m_trig_L2_el_caloEta ->push_back(trigEl->caloEta()); - m_trig_L2_el_trkClusDphi ->push_back(trigEl->trkClusDphi()); - m_trig_L2_el_trkClusDeta ->push_back(trigEl->trkClusDeta()); - m_trig_L2_el_pt ->push_back(trigEl->pt()); - m_trig_L2_el_phi ->push_back(trigEl->phi()); - m_trig_L2_el_eta ->push_back(trigEl->eta()); - m_trig_L2_el_etOverPt ->push_back(trigEl->etOverPt()); - m_trig_L2_el_nTRTHits ->push_back(trigEl->nTRTHits()); - m_trig_L2_el_nTRTHiThresholdHits->push_back(trigEl->nTRTHiThresholdHits()); - m_trig_L2_el_charge ->push_back(trigEl->charge()); - return true; -} - - -bool TrigEgammaNavTPNtuple::fillCaloCluster( const xAOD::CaloCluster *cluster){ - - m_trig_EF_calo_et->push_back(cluster->et()); - m_trig_EF_calo_eta->push_back(cluster->eta()); - return true; -} - -bool TrigEgammaNavTPNtuple::fillEvent(){ - ///Event information - m_runNumber = m_eventInfo->runNumber(); - m_eventNumber = m_eventInfo->eventNumber(); - m_avgmu=getAvgMu(); - return true; -} - -bool TrigEgammaNavTPNtuple::fillElectron( const xAOD::Electron *el ){ - - ///Cluster information - m_el_et = el->pt(); - m_el_eta = el->eta(); - m_el_phi = el->phi(); - el->showerShapeValue( m_el_ethad1 , xAOD::EgammaParameters::ShowerShapeType::ethad1 ); - el->showerShapeValue( m_el_ehad1 , xAOD::EgammaParameters::ShowerShapeType::ehad1 ); - el->showerShapeValue( m_el_f1 , xAOD::EgammaParameters::ShowerShapeType::f1 ); - el->showerShapeValue( m_el_f3 , xAOD::EgammaParameters::ShowerShapeType::f3 ); - el->showerShapeValue( m_el_f1core , xAOD::EgammaParameters::ShowerShapeType::f1core ); - el->showerShapeValue( m_el_f3core , xAOD::EgammaParameters::ShowerShapeType::f3core ); - el->showerShapeValue( m_el_weta2 , xAOD::EgammaParameters::ShowerShapeType::weta2 ); - el->showerShapeValue( m_el_wtots1 , xAOD::EgammaParameters::ShowerShapeType::wtots1 ); - el->showerShapeValue( m_el_fracs1 , xAOD::EgammaParameters::ShowerShapeType::fracs1 ); - el->showerShapeValue( m_el_Reta , xAOD::EgammaParameters::ShowerShapeType::Reta ); - el->showerShapeValue( m_el_Rphi , xAOD::EgammaParameters::ShowerShapeType::Rphi ); - el->showerShapeValue( m_el_Eratio , xAOD::EgammaParameters::ShowerShapeType::Eratio ); - el->showerShapeValue( m_el_Rhad , xAOD::EgammaParameters::ShowerShapeType::Rhad ); - el->showerShapeValue( m_el_Rhad1 , xAOD::EgammaParameters::ShowerShapeType::Rhad1 ); - - ///Combined track/Cluter information - el->trackCaloMatchValue( m_el_deta1 , xAOD::EgammaParameters::TrackCaloMatchType::deltaEta1 ); - el->trackCaloMatchValue( m_el_deta2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaEta2 ); - el->trackCaloMatchValue( m_el_dphi2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhi2 ); - el->trackCaloMatchValue( m_el_dphiresc , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhiRescaled0 ); - el->trackCaloMatchValue( m_el_dphiresc2 , xAOD::EgammaParameters::TrackCaloMatchType::deltaPhiRescaled2 ); - - - ///Track particle information - const xAOD::TrackParticle *track = el->trackParticle(); - if(track){ - m_el_pt = track->pt(); - m_el_d0 = fabsf(track->d0()); - m_el_charge = el->charge(); - - track->summaryValue( m_el_eprobht , xAOD::SummaryType::eProbabilityHT ); - track->summaryValue( m_el_nblayerhits , xAOD::SummaryType::numberOfInnermostPixelLayerHits ); - track->summaryValue( m_el_nblayerolhits , xAOD::SummaryType::numberOfInnermostPixelLayerOutliers ); - track->summaryValue( m_el_npixhits , xAOD::SummaryType::numberOfPixelHits ); - track->summaryValue( m_el_npixolhits , xAOD::SummaryType::numberOfPixelOutliers ); - track->summaryValue( m_el_nscthits , xAOD::SummaryType::numberOfSCTHits ); - track->summaryValue( m_el_nsctolhits , xAOD::SummaryType::numberOfSCTOutliers ); - track->summaryValue( m_el_ntrthightreshits , xAOD::SummaryType::numberOfTRTHighThresholdHits ); - track->summaryValue( m_el_ntrthits , xAOD::SummaryType::numberOfTRTHits); - track->summaryValue( m_el_ntrthighthresolhits, xAOD::SummaryType::numberOfTRTHighThresholdOutliers ); - track->summaryValue( m_el_ntrtolhits , xAOD::SummaryType::numberOfTRTOutliers ); - track->summaryValue( m_el_ntrtxenonhits , xAOD::SummaryType::numberOfTRTXenonHits ); - //track->summaryValue( m_el_expectblayerhit , xAOD::SummaryType::expectInnermostPixelLayerHit ); - track->summaryValue( m_el_npixdeadsensors , xAOD::SummaryType::numberOfPixelDeadSensors); - track->summaryValue( m_el_nsctdeadsensors , xAOD::SummaryType::numberOfSCTDeadSensors); - - m_el_nsideadsensors = m_el_npixdeadsensors + m_el_nsctdeadsensors; - m_el_nsihits = m_el_npixhits + m_el_nscthits; - } - - //m_el_loose = el->passSelection("Loose"); - //m_el_medium = el->passSelection("Medium"); - //m_el_tight = el->passSelection("Tight"); - //m_el_lhLoose = el->passSelection("LHLoose"); - //m_el_lhMedium = el->passSelection("LHMedium"); - //m_el_lhTight = el->passSelection("LHTight"); - //m_el_rgLoose = el->passSelection("RGLoose"); - //m_el_rgMedium = el->passSelection("RGMedium"); - //m_el_rgTight = el->passSelection("RGTight"); - //m_el_multiLepton = el->passSelection("MultiLepton"); - m_el_loose = ApplyElectronPid(el, "Loose"); - m_el_medium = ApplyElectronPid(el, "Medium"); - m_el_tight = ApplyElectronPid(el, "Tight"); - m_el_lhLoose = ApplyElectronPid(el, "LHLoose"); - m_el_lhMedium = ApplyElectronPid(el, "LHMedium"); - m_el_lhTight = ApplyElectronPid(el, "LHTight"); - //m_el_rgLoose = ApplyElectronPid(el, "RGLoose"); - //m_el_rgMedium = ApplyElectronPid(el, "RGMedium"); - //m_el_rgTight = ApplyElectronPid(el, "RGTight"); - - m_calo_et = getCluster_et( el ); - m_calo_eta = getCluster_eta( el ); - m_calo_phi = getCluster_phi( el ); - ///Extra information about pileup - m_el_nGoodVtx = getNGoodVertex(); - m_el_nPileupPrimaryVtx = getNPVtx(); - - - if(!fillCaloRings( el )){ - ATH_MSG_WARNING("Could not attach the calorRings information."); - } - - return true; -} - - -/*bool TrigEgammaNavTPNtuple::fillPhoton( const xAOD::Photon *ph ){ - return true; -}*/ - - -bool TrigEgammaNavTPNtuple::fillMonteCarlo(const xAOD::Egamma *eg){ - - if(m_truthContainer){ - const xAOD::TruthParticle *mc=nullptr; - MonteCarlo::PDGID pdg = pdgid(eg, m_truthContainer,mc); - if(mc){ - m_mc_hasMC = true; - m_mc_pt = mc->pt(); - m_mc_eta = mc->eta(); - m_mc_phi = mc->phi(); - m_mc_isTop = mc->isTop(); - m_mc_isQuark = mc->isQuark(); - m_mc_isParton = mc->isParton(); - m_mc_isMeson = mc->isMeson(); - m_mc_isTau = mc->isTau(); - m_mc_isMuon = mc->isMuon(); - m_mc_isPhoton = mc->isPhoton(); - m_mc_isElectron = mc->isElectron(); - if(pdg == MonteCarlo::PDGID::ZMother) m_mc_hasZMother = true; - if(pdg == MonteCarlo::PDGID::WMother) m_mc_hasWMother = true; - return true; - }//has match - }//has truth container - return false; -} - -bool TrigEgammaNavTPNtuple::fillTrigCaloRings( const xAOD::TrigEMCluster *emCluster ){ - return TrigEgammaAnalysisBaseTool::getTrigCaloRings(emCluster, *m_trig_L2_calo_rings); -} - - -bool TrigEgammaNavTPNtuple::fillCaloRings( const xAOD::Electron *el ){ - return TrigEgammaAnalysisBaseTool::getCaloRings(el, *m_el_ringsE ); -} - -/* - * book, link, clear, alloc and release method divide in: - * trigger, Egamma and MonteCarlo data base. - */ - -template <class T> -void TrigEgammaNavTPNtuple::InitBranch(TTree* fChain, std::string branch_name, T* param, bool message){ - - std::string bname = branch_name; - if (fChain->GetAlias(bname.c_str())) - bname = std::string(fChain->GetAlias(bname.c_str())); - - if (!fChain->FindBranch(bname.c_str()) && message) { - ATH_MSG_WARNING("unknown branch " << bname); - return; - } - fChain->SetBranchStatus(bname.c_str(), 1.); - fChain->SetBranchAddress(bname.c_str(), param); -} - -void TrigEgammaNavTPNtuple::bookEventBranches(TTree *t){ - - t->Branch("RunNumber", &m_runNumber); - t->Branch("EventNumber", &m_eventNumber); - t->Branch("avgmu", &m_avgmu); -} - -void TrigEgammaNavTPNtuple::bookTriggerBranches(TTree *t){ - - // Level L1 cluster - t->Branch( "trig_L1_eta", &m_trig_L1_eta); - t->Branch( "trig_L1_phi", &m_trig_L1_phi); - t->Branch( "trig_L1_emClus", &m_trig_L1_emClus); - t->Branch( "trig_L1_tauClus", &m_trig_L1_tauClus); - t->Branch( "trig_L1_emIsol", &m_trig_L1_emIsol); - t->Branch( "trig_L1_hadIsol", &m_trig_L1_hadIsol); - t->Branch( "trig_L1_thrNames", &m_trig_L1_thrNames); - t->Branch( "trig_L1_accept", &m_trig_L1_accept); - t->Branch( "trig_L2_calo_et", &m_trig_L2_calo_et); - t->Branch( "trig_L2_calo_eta", &m_trig_L2_calo_eta); - t->Branch( "trig_L2_calo_phi", &m_trig_L2_calo_phi); - t->Branch( "trig_L2_calo_e237", &m_trig_L2_calo_e237 ); - t->Branch( "trig_L2_calo_e277", &m_trig_L2_calo_e277 ); - t->Branch( "trig_L2_calo_fracs1", &m_trig_L2_calo_fracs1); - t->Branch( "trig_L2_calo_weta2", &m_trig_L2_calo_weta2); - t->Branch( "trig_L2_calo_ehad1", &m_trig_L2_calo_ehad1); - t->Branch( "trig_L2_calo_emaxs1", &m_trig_L2_calo_emaxs1); - t->Branch( "trig_L2_calo_e2tsts1", &m_trig_L2_calo_e2tsts1); - t->Branch( "trig_L2_calo_wstot", &m_trig_L2_calo_wstot); - t->Branch( "trig_L2_calo_energySample",&m_trig_L2_calo_energySample ); - t->Branch( "trig_L2_calo_rnnOutput", &m_trig_L2_calo_rnnOutput ); - t->Branch( "trig_L2_calo_rings", &m_trig_L2_calo_rings ); - t->Branch( "trig_L2_calo_accept", &m_trig_L2_calo_accept); - t->Branch( "trig_L2_el_trackAlgID" , &m_trig_L2_el_trackAlgID ); - t->Branch( "trig_L2_el_pt" , &m_trig_L2_el_pt ); - t->Branch( "trig_L2_el_eta", &m_trig_L2_el_eta); - t->Branch( "trig_L2_el_phi", &m_trig_L2_el_phi ); - t->Branch( "trig_L2_el_caloEta", &m_trig_L2_el_caloEta ); - t->Branch( "trig_L2_el_charge", &m_trig_L2_el_charge); - t->Branch( "trig_L2_el_nTRTHits", &m_trig_L2_el_nTRTHits); - t->Branch( "trig_L2_el_nTRTHiThresholdHits", &m_trig_L2_el_nTRTHiThresholdHits); - t->Branch( "trig_L2_el_etOverPt" , &m_trig_L2_el_etOverPt ); - t->Branch( "trig_L2_el_trkClusDeta" , &m_trig_L2_el_trkClusDeta ); - t->Branch( "trig_L2_el_trkClusDphi" , &m_trig_L2_el_trkClusDphi ); - t->Branch( "trig_L2_el_accept", &m_trig_L2_el_accept ); - t->Branch( "trig_EF_calo_accept", &m_trig_EF_calo_accept); - t->Branch( "trig_EF_calo_et", &m_trig_EF_calo_et); - t->Branch( "trig_EF_calo_eta", &m_trig_EF_calo_eta); - t->Branch( "trig_EF_el_accept", &m_trig_EF_el_accept); -} - -void TrigEgammaNavTPNtuple::bookElectronBranches(TTree *t){ - - t->Branch("el_et", &m_el_et); - t->Branch("el_pt", &m_el_pt); - t->Branch("el_eta", &m_el_eta); - t->Branch("el_phi", &m_el_phi); - t->Branch("el_ethad1", &m_el_ethad1); - t->Branch("el_ehad1", &m_el_ehad1); - t->Branch("el_f1", &m_el_f1); - t->Branch("el_f3", &m_el_f3); - t->Branch("el_f1core", &m_el_f1core); - t->Branch("el_f3core", &m_el_f3core); - t->Branch("el_weta2", &m_el_weta2); - t->Branch("el_d0", &m_el_d0); - t->Branch("el_wtots1", &m_el_wtots1); - t->Branch("el_fracs1", &m_el_fracs1); - t->Branch("el_Reta", &m_el_Reta); - t->Branch("el_Rphi", &m_el_Rphi); - t->Branch("el_Eratio", &m_el_Eratio); - t->Branch("el_Rhad", &m_el_Rhad); - t->Branch("el_Rhad1", &m_el_Rhad1); - t->Branch("el_deta1", &m_el_deta1); - t->Branch("el_deta2", &m_el_deta2); - t->Branch("el_dphi2", &m_el_dphi2); - t->Branch("el_dphiresc", &m_el_dphiresc); - t->Branch("el_dphiresc2", &m_el_dphiresc2); - t->Branch("el_eprobht", &m_el_eprobht); - t->Branch("el_charge", &m_el_charge); - t->Branch("el_nblayerhits", &m_el_nblayerhits); - t->Branch("el_nblayerolhits", &m_el_nblayerolhits); - t->Branch("el_npixhits", &m_el_npixhits); - t->Branch("el_npixolhits", &m_el_npixolhits); - t->Branch("el_nscthits", &m_el_nscthits); - t->Branch("el_nsctolhits", &m_el_nsctolhits); - t->Branch("el_ntrthightreshits", &m_el_ntrthightreshits); - t->Branch("el_ntrthits", &m_el_ntrthits); - t->Branch("el_ntrthighthresolhits", &m_el_ntrthighthresolhits); - t->Branch("el_ntrtolhits", &m_el_ntrtolhits); - t->Branch("el_ntrtxenonhits", &m_el_ntrtxenonhits); - t->Branch("el_expectblayerhit", &m_el_expectblayerhit); - t->Branch("el_nsihits", &m_el_nsihits ); - t->Branch("el_nsideadsensors", &m_el_nsideadsensors ); - t->Branch("el_npixdeadsensors", &m_el_npixdeadsensors ); - t->Branch("el_nsctdeadsensors", &m_el_nsctdeadsensors ); - t->Branch("el_ringsE", &m_el_ringsE ); - t->Branch("el_loose", &m_el_loose ); - t->Branch("el_medium", &m_el_medium ); - t->Branch("el_tight", &m_el_tight ); - t->Branch("el_lhLoose", &m_el_lhLoose ); - t->Branch("el_lhMedium", &m_el_lhMedium ); - t->Branch("el_lhTight", &m_el_lhTight ); - t->Branch("el_rgLoose", &m_el_rgLoose ); - t->Branch("el_rgMedium", &m_el_rgMedium ); - t->Branch("el_rgTight", &m_el_rgTight ); - t->Branch("el_multiLepton", &m_el_multiLepton); - t->Branch("el_nGoodVtx", &m_el_nGoodVtx); - t->Branch("el_nPileupPrimaryVtx", &m_el_nPileupPrimaryVtx); - t->Branch("calo_et", &m_calo_et); - t->Branch("calo_eta", &m_calo_eta); - t->Branch("calo_phi", &m_calo_phi); - -} - - -/*void TrigEgammaNavTPNtuple::bookPhotonBranches(TTree *t){ -} */ - -void TrigEgammaNavTPNtuple::bookMonteCarloBranches(TTree *t){ - // Monte Carlo - t->Branch("mc_hasMC", &m_mc_hasMC); - t->Branch("mc_pt", &m_mc_pt); - t->Branch("mc_eta", &m_mc_eta); - t->Branch("mc_phi", &m_mc_phi); - t->Branch("mc_isTop", &m_mc_isTop); - t->Branch("mc_isParton", &m_mc_isParton); - t->Branch("mc_isMeson", &m_mc_isMeson); - t->Branch("mc_isTau", &m_mc_isTau); - t->Branch("mc_isMuon", &m_mc_isMuon); - t->Branch("mc_isPhoton", &m_mc_isPhoton); - t->Branch("mc_isElectron", &m_mc_isElectron); - t->Branch("mc_hasZMother", &m_mc_hasZMother); - t->Branch("mc_hasWMother", &m_mc_hasWMother); -} - -void TrigEgammaNavTPNtuple::linkEventBranches(TTree *t){ - - InitBranch( t, "RunNumber", &m_runNumber); - InitBranch( t, "EventNumber", &m_eventNumber); - InitBranch( t, "avgmu", &m_avgmu); -} - -void TrigEgammaNavTPNtuple::linkElectronBranches( TTree *t ){ - - InitBranch( t, "el_et", &m_el_et); - InitBranch( t, "el_pt", &m_el_pt); - InitBranch( t, "el_eta", &m_el_eta); - InitBranch( t, "el_phi", &m_el_phi); - InitBranch( t, "el_ethad1", &m_el_ethad1); - InitBranch( t, "el_ehad1", &m_el_ehad1); - InitBranch( t, "el_f1", &m_el_f1); - InitBranch( t, "el_f3", &m_el_f3); - InitBranch( t, "el_f1core", &m_el_f1core); - InitBranch( t, "el_f3core", &m_el_f3core); - InitBranch( t, "el_weta2", &m_el_weta2); - InitBranch( t, "el_d0", &m_el_d0); - InitBranch( t, "el_wtots1", &m_el_wtots1); - InitBranch( t, "el_fracs1", &m_el_fracs1); - InitBranch( t, "el_Reta", &m_el_Reta); - InitBranch( t, "el_Rphi", &m_el_Rphi); - InitBranch( t, "el_Eratio", &m_el_Eratio); - InitBranch( t, "el_Rhad", &m_el_Rhad); - InitBranch( t, "el_Rhad1", &m_el_Rhad1); - InitBranch( t, "el_deta1", &m_el_deta1); - InitBranch( t, "el_deta2", &m_el_deta2); - InitBranch( t, "el_dphi2", &m_el_dphi2); - InitBranch( t, "el_dphiresc", &m_el_dphiresc); - InitBranch( t, "el_dphiresc2", &m_el_dphiresc2); - InitBranch( t, "el_eprobht", &m_el_eprobht); - InitBranch( t, "el_charge", &m_el_charge); - InitBranch( t, "el_nblayerhits", &m_el_nblayerhits); - InitBranch( t, "el_nblayerolhits", &m_el_nblayerolhits); - InitBranch( t, "el_npixhits", &m_el_npixhits); - InitBranch( t, "el_npixolhits", &m_el_npixolhits); - InitBranch( t, "el_nscthits", &m_el_nscthits); - InitBranch( t, "el_nsctolhits", &m_el_nsctolhits); - InitBranch( t, "el_ntrthightreshits", &m_el_ntrthightreshits); - InitBranch( t, "el_ntrthits", &m_el_ntrthits); - InitBranch( t, "el_ntrthighthresolhits", &m_el_ntrthighthresolhits); - InitBranch( t, "el_ntrtolhits", &m_el_ntrtolhits); - InitBranch( t, "el_ntrtxenonhits", &m_el_ntrtxenonhits); - InitBranch( t, "el_expectblayerhit", &m_el_expectblayerhit); - InitBranch( t, "el_nsihits", &m_el_nsihits ); - InitBranch( t, "el_nsideadsensors", &m_el_nsideadsensors ); - InitBranch( t, "el_npixdeadsensors", &m_el_npixdeadsensors ); - InitBranch( t, "el_nsctdeadsensors", &m_el_nsctdeadsensors ); - InitBranch( t, "el_ringsE", &m_el_ringsE ); - InitBranch( t, "el_loose", &m_el_loose ); - InitBranch( t, "el_medium", &m_el_medium ); - InitBranch( t, "el_tight", &m_el_tight ); - InitBranch( t, "el_lhLoose", &m_el_lhLoose ); - InitBranch( t, "el_lhMedium", &m_el_lhMedium ); - InitBranch( t, "el_lhTight", &m_el_lhTight ); - InitBranch( t, "el_rgLoose", &m_el_rgLoose ); - InitBranch( t, "el_rgMedium", &m_el_rgMedium ); - InitBranch( t, "el_rgTight", &m_el_rgTight ); - InitBranch( t, "el_multiLepton", &m_el_multiLepton); - InitBranch( t, "el_nGoodVtx", &m_el_nGoodVtx); - InitBranch( t, "el_nPileupPrimaryVtx", &m_el_nPileupPrimaryVtx); - InitBranch( t, "calo_et", &m_calo_et); - InitBranch( t, "calo_eta", &m_calo_eta); - InitBranch( t, "calo_phi", &m_calo_phi); - -} - - -/*void TrigEgammaNavTPNtuple::linkPhotonBranches( TTree *t ){ -}*/ - -void TrigEgammaNavTPNtuple::linkTriggerBranches( TTree *t ){ - - InitBranch(t, "trig_L1_eta", &m_trig_L1_eta); - InitBranch(t, "trig_L1_phi", &m_trig_L1_phi); - InitBranch(t, "trig_L1_emClus", &m_trig_L1_emClus); - InitBranch(t, "trig_L1_tauClus", &m_trig_L1_tauClus); - InitBranch(t, "trig_L1_emIsol", &m_trig_L1_emIsol); - InitBranch(t, "trig_L1_hadIsol", &m_trig_L1_hadIsol); - InitBranch(t, "trig_L1_thrNames", &m_trig_L1_thrNames); - InitBranch(t, "trig_L1_accept", &m_trig_L1_accept); - InitBranch(t, "trig_L2_calo_et", &m_trig_L2_calo_et); - InitBranch(t, "trig_L2_calo_eta", &m_trig_L2_calo_eta); - InitBranch(t, "trig_L2_calo_phi", &m_trig_L2_calo_phi); - InitBranch(t, "trig_L2_calo_e237", &m_trig_L2_calo_e237 ); - InitBranch(t, "trig_L2_calo_e277", &m_trig_L2_calo_e277 ); - InitBranch(t, "trig_L2_calo_fracs1", &m_trig_L2_calo_fracs1); - InitBranch(t, "trig_L2_calo_weta2", &m_trig_L2_calo_weta2); - InitBranch(t, "trig_L2_calo_ehad1", &m_trig_L2_calo_ehad1); - InitBranch(t, "trig_L2_calo_emaxs1", &m_trig_L2_calo_emaxs1); - InitBranch(t, "trig_L2_calo_e2tsts1", &m_trig_L2_calo_e2tsts1); - InitBranch(t, "trig_L2_calo_wstot", &m_trig_L2_calo_wstot); - InitBranch(t, "trig_L2_calo_rnnOutput", &m_trig_L2_calo_rnnOutput ); - InitBranch(t, "trig_L2_calo_rings", &m_trig_L2_calo_rings ); - InitBranch(t, "trig_L2_calo_energySample",&m_trig_L2_calo_energySample ); - InitBranch(t, "trig_L2_calo_accept", &m_trig_L2_calo_accept); - - InitBranch(t, "trig_L2_el_trackAlgID" , &m_trig_L2_el_trackAlgID ); - InitBranch(t, "trig_L2_el_pt" , &m_trig_L2_el_pt ); - InitBranch(t, "trig_L2_el_eta", &m_trig_L2_el_eta); - InitBranch(t, "trig_L2_el_phi", &m_trig_L2_el_phi ); - InitBranch(t, "trig_L2_el_caloEta", &m_trig_L2_el_caloEta ); - InitBranch(t, "trig_L2_el_charge", &m_trig_L2_el_charge); - InitBranch(t, "trig_L2_el_nTRTHits", &m_trig_L2_el_nTRTHits); - InitBranch(t, "trig_L2_el_nTRTHiThresholdHits", &m_trig_L2_el_nTRTHiThresholdHits); - InitBranch(t, "trig_L2_el_etOverPt" , &m_trig_L2_el_etOverPt ); - InitBranch(t, "trig_L2_el_trkClusDeta" , &m_trig_L2_el_trkClusDeta ); - InitBranch(t, "trig_L2_el_trkClusDphi" , &m_trig_L2_el_trkClusDphi ); - - InitBranch(t, "trig_L2_el_accept", &m_trig_L2_el_accept ); - InitBranch(t, "trig_EF_el_accept", &m_trig_EF_el_accept ); - InitBranch(t, "trig_EF_calo_accept", &m_trig_EF_calo_accept ); - InitBranch(t, "trig_EF_calo_et", &m_trig_EF_calo_et ); - InitBranch(t, "trig_EF_calo_eta", &m_trig_EF_calo_eta ); - -} - - -void TrigEgammaNavTPNtuple::linkMonteCarloBranches(TTree *t){ - - InitBranch(t, "mc_hasMC", &m_mc_hasMC); - InitBranch(t, "mc_pt", &m_mc_pt); - InitBranch(t, "mc_eta", &m_mc_eta); - InitBranch(t, "mc_phi", &m_mc_phi); - InitBranch(t, "mc_isTop", &m_mc_isTop); - InitBranch(t, "mc_isParton", &m_mc_isParton); - InitBranch(t, "mc_isMeson", &m_mc_isMeson); - InitBranch(t, "mc_isTau", &m_mc_isTau); - InitBranch(t, "mc_isMuon", &m_mc_isMuon); - InitBranch(t, "mc_isPhoton", &m_mc_isPhoton); - InitBranch(t, "mc_isElectron", &m_mc_isElectron); - InitBranch(t, "mc_hasZMother", &m_mc_hasZMother); - InitBranch(t, "mc_hasWMother", &m_mc_hasWMother); -} - -void TrigEgammaNavTPNtuple::clear(){ - - ///EventInfo - m_runNumber = 0; - m_eventNumber = 0; - m_avgmu = 0; - ///Egamma - m_el_et = -1; - m_el_pt = -1; - m_el_eta = -1; - m_el_phi = -1; - m_el_ethad1 = -1; - m_el_ehad1 = -1; - m_el_f1 = -1; - m_el_f3 = -1; - m_el_f1core = -1; - m_el_f3core = -1; - m_el_weta2 = -1; - m_el_d0 = -1; - m_el_wtots1 = -1; - m_el_fracs1 = -1; - m_el_Reta = -1; - m_el_Rphi = -1; - m_el_Eratio = -1; - m_el_Rhad = -1; - m_el_Rhad1 = -1; - m_el_deta1 = -1; - m_el_deta2 = -1; - m_el_dphi2 = -1; - m_el_dphiresc = -1; - m_el_dphiresc2 = -1; - m_el_eprobht = -1; - m_el_charge = 0; - m_el_nblayerhits = 0; - m_el_nblayerolhits = 0; - m_el_npixhits = 0; - m_el_npixolhits = 0; - m_el_nscthits = 0; - m_el_nsctolhits = 0; - m_el_ntrthightreshits = 0; - m_el_ntrthits = 0; - m_el_ntrthighthresolhits= 0; - m_el_ntrtolhits = 0; - m_el_ntrtxenonhits = 0; - m_el_expectblayerhit = false; - m_el_nsihits = 0; - m_el_nsideadsensors = 0; - m_el_npixdeadsensors = 0; - m_el_nsctdeadsensors = 0; - m_el_loose = false; - m_el_medium = false; - m_el_tight = false; - m_el_lhLoose = false; - m_el_lhMedium = false; - m_el_lhTight = false; - m_el_rgLoose = false; - m_el_rgMedium = false; - m_el_rgTight = false; - m_el_multiLepton = false; - m_el_nGoodVtx = -1; - m_el_nPileupPrimaryVtx = -1; - m_calo_et = -1; - m_calo_eta = -1; - m_calo_phi = -1; - - ///Trigger - m_trig_L1_eta = -1; - m_trig_L1_phi = -1; - m_trig_L1_emClus = -1; - m_trig_L1_tauClus = -1; - m_trig_L1_emIsol = -1; - m_trig_L1_hadIsol = -1; - m_trig_L1_accept = false; - m_trig_L2_calo_et = -1; - m_trig_L2_calo_eta = -1; - m_trig_L2_calo_phi = -1; - m_trig_L2_calo_e237 = -1; - m_trig_L2_calo_e277 = -1; - m_trig_L2_calo_fracs1 = -1; - m_trig_L2_calo_weta2 = -1; - m_trig_L2_calo_ehad1 = -1; - m_trig_L2_calo_emaxs1 = -1; - m_trig_L2_calo_e2tsts1 = -1; - m_trig_L2_calo_wstot = -1; - m_trig_L2_calo_rnnOutput = 999; - - m_trig_L1_accept = false; - m_trig_L2_calo_accept = false; - m_trig_L2_el_accept = false; - m_trig_EF_calo_accept = false; - m_trig_EF_el_accept = false; - - ///Monte Carlo - m_mc_hasMC = false; - m_mc_pt = -1; - m_mc_eta = -1; - m_mc_phi = -1; - m_mc_isTop = false; - m_mc_isParton = false; - m_mc_isMeson = false; - m_mc_isTau = false; - m_mc_isMuon = false; - m_mc_isPhoton = false; - m_mc_isElectron = false; - m_mc_hasZMother = false; - m_mc_hasWMother = false; - - ///Some vectors - m_trig_L1_thrNames ->clear(); - m_trig_L2_calo_energySample ->clear(); - m_trig_L2_calo_rings ->clear(); - - m_trig_L2_el_trackAlgID ->clear(); - m_trig_L2_el_eta ->clear(); - m_trig_L2_el_phi ->clear(); - m_trig_L2_el_caloEta ->clear(); - m_trig_L2_el_trkClusDeta ->clear(); - m_trig_L2_el_trkClusDphi ->clear(); - m_trig_L2_el_pt ->clear(); - m_trig_L2_el_etOverPt ->clear(); - m_trig_L2_el_nTRTHits ->clear(); - m_trig_L2_el_nTRTHiThresholdHits ->clear(); - m_trig_L2_el_charge ->clear(); - m_trig_EF_calo_et ->clear(); - m_trig_EF_calo_eta ->clear(); - - -} - -void TrigEgammaNavTPNtuple::alloc_space(){ - - m_el_ringsE = new std::vector<float>(); - m_trig_L1_thrNames = new std::vector<std::string>(); - m_trig_L2_calo_energySample = new std::vector<float>(); - m_trig_L2_calo_rings = new std::vector<float>(); - m_trig_L2_el_trackAlgID = new std::vector<int>(); - m_trig_L2_el_eta = new std::vector<float>(); - m_trig_L2_el_phi = new std::vector<float>(); - m_trig_L2_el_caloEta = new std::vector<float>(); - m_trig_L2_el_trkClusDeta = new std::vector<float>(); - m_trig_L2_el_trkClusDphi = new std::vector<float>(); - m_trig_L2_el_pt = new std::vector<float>(); - m_trig_L2_el_etOverPt = new std::vector<float>(); - m_trig_L2_el_nTRTHits = new std::vector<float>(); - m_trig_L2_el_nTRTHiThresholdHits = new std::vector<float>(); - m_trig_L2_el_charge = new std::vector<float>(); - m_trig_EF_calo_et = new std::vector<float>(); - m_trig_EF_calo_eta = new std::vector<float>(); - -} - - -void TrigEgammaNavTPNtuple::release_space(){ - delete m_el_ringsE ; - delete m_trig_L1_thrNames ; - delete m_trig_L2_calo_energySample; - delete m_trig_L2_calo_rings ; - delete m_trig_L2_el_trackAlgID ; - delete m_trig_L2_el_pt ; - delete m_trig_L2_el_eta ; - delete m_trig_L2_el_caloEta ; - delete m_trig_L2_el_phi ; - delete m_trig_L2_el_charge ; - delete m_trig_L2_el_nTRTHits ; - delete m_trig_L2_el_nTRTHiThresholdHits ; - delete m_trig_L2_el_etOverPt ; - delete m_trig_L2_el_trkClusDeta ; - delete m_trig_L2_el_trkClusDphi ; - delete m_trig_EF_calo_et ; - delete m_trig_EF_calo_eta ; -} - -unsigned TrigEgammaNavTPNtuple::count_HLT_objects( const HLT::TriggerElement *feat ) -{ - unsigned nobj=0; - if(getFeature<xAOD::ElectronContainer>(feat) ) nobj++; // HLT - if(getFeature<xAOD::CaloClusterContainer>(feat) ) nobj++; // EFCalo - if(getFeature<xAOD::TrigElectronContainer>(feat)) nobj++; // L2 - if(getFeature<xAOD::TrigEMCluster>(feat) ) nobj++; // L2Calo - ATH_MSG_DEBUG("Number of objects counted in this feature: " << nobj); - return nobj; -} diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPhysValBase.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPhysValBase.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c5c99d9f982b87994d37284f574100e4f1a8090a --- /dev/null +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPhysValBase.cxx @@ -0,0 +1,1005 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include <iostream> +#include "TrigEgammaAnalysisTools/TrigEgammaPhysValBase.h" +using namespace std; + +TrigEgammaPhysValBase::TrigEgammaPhysValBase(){ + + m_el_ringsE=nullptr; + m_trig_L1_thrNames=nullptr; + m_trig_L2_calo_energySample=nullptr; + m_trig_L2_calo_rings=nullptr; + m_trig_L2_el_trackAlgID=nullptr; + m_trig_L2_el_pt=nullptr; + m_trig_L2_el_eta=nullptr; + m_trig_L2_el_caloEta=nullptr; + m_trig_L2_el_phi=nullptr; + m_trig_L2_el_charge=nullptr; + m_trig_L2_el_nTRTHits=nullptr; + m_trig_L2_el_nTRTHiThresholdHits=nullptr; + m_trig_L2_el_etOverPt=nullptr; + m_trig_L2_el_trkClusDeta=nullptr; + m_trig_L2_el_trkClusDphi=nullptr; + m_trig_EF_calo_et=nullptr; + m_trig_EF_calo_eta=nullptr; + + m_doMCDetailed=false; + m_doL2Detailed=false; + m_doL2CaloDetailed=false; + m_doRecoDetailed=false; +} + +/* + * book, link, clear, alloc and release method divide in: + * trigger, Egamma and MonteCarlo data base. + */ +template <class T> +void TrigEgammaPhysValBase::InitBranch(TTree* fChain, std::string branch_name, T* param, bool message){ + + std::string bname = branch_name; + if (fChain->GetAlias(bname.c_str())) + bname = std::string(fChain->GetAlias(bname.c_str())); + + if (!fChain->FindBranch(bname.c_str()) && message) { + return; + } + fChain->SetBranchStatus(bname.c_str(), 1.); + fChain->SetBranchAddress(bname.c_str(), param); +} + +void TrigEgammaPhysValBase::bookEventBranches(TTree *t){ + + t->Branch("RunNumber", &m_runNumber); + t->Branch("EventNumber", &m_eventNumber); + t->Branch("LumiBlock", &m_lumiBlock); + t->Branch("avgmu", &m_avgmu); +} + +void TrigEgammaPhysValBase::bookTriggerBranches(TTree *t){ + + // Level L1 cluster + t->Branch( "trig_L1_eta", &m_trig_L1_eta); + t->Branch( "trig_L1_phi", &m_trig_L1_phi); + t->Branch( "trig_L1_emClus", &m_trig_L1_emClus); + t->Branch( "trig_L1_tauClus", &m_trig_L1_tauClus); + t->Branch( "trig_L1_emIsol", &m_trig_L1_emIsol); + t->Branch( "trig_L1_hadIsol", &m_trig_L1_hadIsol); + t->Branch( "trig_L1_hadCore", &m_trig_L1_hadCore); + t->Branch( "trig_L2_calo_et", &m_trig_L2_calo_et); + t->Branch( "trig_L2_calo_eta", &m_trig_L2_calo_eta); + t->Branch( "trig_L2_calo_phi", &m_trig_L2_calo_phi); + + if(m_doL2CaloDetailed){ + t->Branch( "trig_L2_calo_e237", &m_trig_L2_calo_e237 ); + t->Branch( "trig_L2_calo_e277", &m_trig_L2_calo_e277 ); + t->Branch( "trig_L2_calo_fracs1", &m_trig_L2_calo_fracs1); + t->Branch( "trig_L2_calo_weta2", &m_trig_L2_calo_weta2); + t->Branch( "trig_L2_calo_ehad1", &m_trig_L2_calo_ehad1); + t->Branch( "trig_L2_calo_emaxs1", &m_trig_L2_calo_emaxs1); + t->Branch( "trig_L2_calo_e2tsts1", &m_trig_L2_calo_e2tsts1); + t->Branch( "trig_L2_calo_wstot", &m_trig_L2_calo_wstot); + t->Branch( "trig_L2_calo_energySample",&m_trig_L2_calo_energySample); + } + + t->Branch( "trig_L2_calo_rings", &m_trig_L2_calo_rings ); + t->Branch( "trig_L2_calo_rnnOutput", &m_trig_L2_calo_rnnOutput ); + + + if(m_doL2Detailed){ + t->Branch( "trig_L2_el_pt" , &m_trig_L2_el_pt ); + t->Branch( "trig_L2_el_eta", &m_trig_L2_el_eta); + t->Branch( "trig_L2_el_phi", &m_trig_L2_el_phi ); + t->Branch( "trig_L2_el_caloEta", &m_trig_L2_el_caloEta ); + t->Branch( "trig_L2_el_charge", &m_trig_L2_el_charge); + t->Branch( "trig_L2_el_nTRTHits", &m_trig_L2_el_nTRTHits); + t->Branch( "trig_L2_el_nTRTHiThresholdHits", &m_trig_L2_el_nTRTHiThresholdHits); + t->Branch( "trig_L2_el_etOverPt" , &m_trig_L2_el_etOverPt ); + t->Branch( "trig_L2_el_trkClusDeta" , &m_trig_L2_el_trkClusDeta ); + t->Branch( "trig_L2_el_trkClusDphi" , &m_trig_L2_el_trkClusDphi ); + t->Branch( "trig_L2_el_trackAlgID" , &m_trig_L2_el_trackAlgID ); + } + + t->Branch( "trig_EF_calo_e", &m_trig_EF_calo_e ); + t->Branch( "trig_EF_calo_et", &m_trig_EF_calo_et ); + t->Branch( "trig_EF_calo_eta", &m_trig_EF_calo_eta ); + t->Branch( "trig_EF_calo_phi", &m_trig_EF_calo_phi ); + t->Branch( "trig_EF_calo_etaBE2", &m_trig_EF_calo_etaBE2 ); + +#define BRANCH(_name_) t->Branch( #_name_ , & m_##_name_ );\ + + BRANCH( trig_EF_calo_tight ); + BRANCH( trig_EF_calo_medium ); + BRANCH( trig_EF_calo_loose ); + BRANCH( trig_EF_calo_lhtight ); + BRANCH( trig_EF_calo_lhmedium ); + BRANCH( trig_EF_calo_lhloose ); + BRANCH( trig_EF_calo_lhvloose ); + + BRANCH( trig_EF_el_calo_e ); + BRANCH( trig_EF_el_calo_et ); + BRANCH( trig_EF_el_calo_eta ); + BRANCH( trig_EF_el_calo_phi ); + BRANCH( trig_EF_el_calo_etaBE2 ); + + BRANCH( trig_EF_el_hasCalo ); + BRANCH( trig_EF_el_hasTrack ); + BRANCH( trig_EF_el_e ); + BRANCH( trig_EF_el_et ); + BRANCH( trig_EF_el_eta ); + BRANCH( trig_EF_el_phi ); + BRANCH( trig_EF_el_e277 ); + BRANCH( trig_EF_el_ethad1 ); + BRANCH( trig_EF_el_ehad1 ); + BRANCH( trig_EF_el_f1 ); + BRANCH( trig_EF_el_f3 ); + BRANCH( trig_EF_el_f1core ); + BRANCH( trig_EF_el_f3core ); + BRANCH( trig_EF_el_weta1 ); + BRANCH( trig_EF_el_weta2 ); + BRANCH( trig_EF_el_wtots1 ); + BRANCH( trig_EF_el_fracs1 ); + BRANCH( trig_EF_el_Reta ); + BRANCH( trig_EF_el_Rphi ); + BRANCH( trig_EF_el_Eratio ); + BRANCH( trig_EF_el_Rhad ); + BRANCH( trig_EF_el_Rhad1 ); + BRANCH( trig_EF_el_deta2 ); + BRANCH( trig_EF_el_dphi2 ); + BRANCH( trig_EF_el_dphiresc ); + BRANCH( trig_EF_el_deltaPhiRescaled2 ); + BRANCH( trig_EF_el_deltaEta1 ); + BRANCH( trig_EF_el_deltaE ); + BRANCH( trig_EF_el_etCone ); + BRANCH( trig_EF_el_ptCone ); + + BRANCH( trig_EF_el_trk_pt ); + BRANCH( trig_EF_el_trk_eta ); + BRANCH( trig_EF_el_trk_charge ); + BRANCH( trig_EF_el_trk_qOverP ); + BRANCH( trig_EF_el_trk_sigd0 ); + BRANCH( trig_EF_el_trk_d0 ); + BRANCH( trig_EF_el_trk_eProbabilityHT ); + BRANCH( trig_EF_el_trk_transformed_eProbabilityHT ); + BRANCH( trig_EF_el_trk_d0significance ); + BRANCH( trig_EF_el_trk_deltaPOverP ); + BRANCH( trig_EF_el_trk_summaryValues ); + + BRANCH( trig_EF_el_tight ); + BRANCH( trig_EF_el_medium ); + BRANCH( trig_EF_el_loose ); + BRANCH( trig_EF_el_lhtight ); + BRANCH( trig_EF_el_lhmedium ); + BRANCH( trig_EF_el_lhloose ); + BRANCH( trig_EF_el_lhvloose ); + + + +#undef BRANCH + + + +} + + + +void TrigEgammaPhysValBase::bookElectronBranches(TTree *t){ + + t->Branch("el_calo_e", &m_el_calo_e); + t->Branch("el_calo_et", &m_el_calo_et); + t->Branch("el_calo_eta", &m_el_calo_eta); + t->Branch("el_calo_etaBE2", &m_el_calo_etaBE2); + t->Branch("el_calo_phi", &m_el_calo_phi); + + t->Branch("el_hasCalo", &m_el_hasCalo ); + t->Branch("el_hasTrack", &m_el_hasTrack ); + t->Branch("el_e", &m_el_e ); + t->Branch("el_et", &m_el_et ); + t->Branch("el_eta", &m_el_eta ); + t->Branch("el_phi", &m_el_phi ); + + if(m_doRecoDetailed){ + t->Branch("el_ethad1", &m_el_ethad1); + t->Branch("el_ehad1", &m_el_ehad1); + t->Branch("el_e277", &m_el_e277); + t->Branch("el_f1", &m_el_f1); + t->Branch("el_f3", &m_el_f3); + t->Branch("el_f1core", &m_el_f1core); + t->Branch("el_f3core", &m_el_f3core); + t->Branch("el_weta1", &m_el_weta1); + t->Branch("el_weta2", &m_el_weta2); + t->Branch("el_wtots1", &m_el_wtots1); + t->Branch("el_fracs1", &m_el_fracs1); + t->Branch("el_Reta", &m_el_Reta); + t->Branch("el_Rphi", &m_el_Rphi); + t->Branch("el_Eratio", &m_el_Eratio); + t->Branch("el_Rhad", &m_el_Rhad); + t->Branch("el_Rhad1", &m_el_Rhad1); + t->Branch("el_deta2", &m_el_deta2); + t->Branch("el_dphi2", &m_el_dphi2); + t->Branch("el_dphiresc", &m_el_dphiresc); + t->Branch("el_deltaPhiRescaled2" , &m_el_deltaPhiRescaled2 ); + t->Branch("el_deltaEta1" , &m_el_deltaEta1 ); + t->Branch("el_deltaE", &m_el_deltaE ); + t->Branch("el_etCone" , &m_el_etCone ); + t->Branch("el_ptCone" , &m_el_ptCone ); + + + t->Branch("el_trk_pt", &m_el_trk_pt ); + t->Branch("el_trk_eta", &m_el_trk_eta ); + t->Branch("el_trk_charge", &m_el_trk_charge); + t->Branch("el_trk_qOverP", &m_el_trk_qOverP); + t->Branch("el_trk_sigd0" , &m_el_trk_sigd0 ); + t->Branch("el_trk_d0" , &m_el_trk_d0 ); + t->Branch("el_trk_eProbabilityHT" , &m_el_trk_eProbabilityHT ); + t->Branch("el_trk_transformed_eProbabilityHT", &m_el_trk_transformed_eProbabilityHT); + t->Branch("el_trk_d0significance" , &m_el_trk_d0significance ); + t->Branch("el_trk_deltaPOverP" , &m_el_trk_deltaPOverP ); + t->Branch("el_trk_summaryValues" , &m_el_trk_summaryValues ); + } + + t->Branch("el_ringsE", &m_el_ringsE ); + t->Branch("el_nGoodVtx", &m_el_nGoodVtx); + t->Branch("el_nPileupPrimaryVtx", &m_el_nPileupPrimaryVtx); + + + t->Branch("el_loose", &m_el_loose ); + t->Branch("el_medium", &m_el_medium ); + t->Branch("el_tight", &m_el_tight ); + t->Branch("el_lhvloose", &m_el_lhVLoose ); + t->Branch("el_lhloose", &m_el_lhLoose ); + t->Branch("el_lhmedium", &m_el_lhMedium ); + t->Branch("el_lhtight", &m_el_lhTight ); + t->Branch("el_multiLepton", &m_el_multiLepton); + + + +} + + +void TrigEgammaPhysValBase::createTDTMetadata( TTree *t, std::vector<std::string> trigList ){ + + std::vector<std::string> *trig_tdt_triggerList; + t->Branch("trig_tdt_triggerList", &trig_tdt_triggerList ); + trig_tdt_triggerList = new std::vector<std::string>(); + for(auto& trigger : trigList ){ + trig_tdt_triggerList->push_back(trigger); + } + t->Fill(); + delete trig_tdt_triggerList; +} + + +void TrigEgammaPhysValBase::bookTDTBranches(TTree *t){ + + t->Branch("trig_tdt_L1_calo_accept", &m_trig_tdt_L1_calo_accept); + t->Branch("trig_tdt_L2_calo_accept", &m_trig_tdt_L2_calo_accept); + t->Branch("trig_tdt_L2_el_accept", &m_trig_tdt_L2_el_accept ); + t->Branch("trig_tdt_EF_calo_accept", &m_trig_tdt_EF_calo_accept); + t->Branch("trig_tdt_EF_el_accept", &m_trig_tdt_EF_el_accept ); + t->Branch("trig_tdt_emu_L1_calo_accept", &m_trig_tdt_emu_L1_calo_accept); + t->Branch("trig_tdt_emu_L2_calo_accept", &m_trig_tdt_emu_L2_calo_accept); + t->Branch("trig_tdt_emu_L2_el_accept", &m_trig_tdt_emu_L2_el_accept ); + t->Branch("trig_tdt_emu_EF_calo_accept", &m_trig_tdt_emu_EF_calo_accept); + t->Branch("trig_tdt_emu_EF_el_accept", &m_trig_tdt_emu_EF_el_accept ); + +} + + + +void TrigEgammaPhysValBase::bookMonteCarloBranches(TTree *t){ + // Monte Carlo + t->Branch("mc_hasMC", &m_mc_hasMC); + t->Branch("mc_pt", &m_mc_pt); + t->Branch("mc_eta", &m_mc_eta); + t->Branch("mc_phi", &m_mc_phi); + + if(m_doMCDetailed){ + t->Branch("mc_isTop", &m_mc_isTop); + t->Branch("mc_isParton", &m_mc_isParton); + t->Branch("mc_isMeson", &m_mc_isMeson); + t->Branch("mc_isTau", &m_mc_isTau); + t->Branch("mc_isMuon", &m_mc_isMuon); + } + + t->Branch("mc_isPhoton", &m_mc_isPhoton); + t->Branch("mc_isElectron", &m_mc_isElectron); + t->Branch("mc_hasZMother", &m_mc_hasZMother); + t->Branch("mc_hasWMother", &m_mc_hasWMother); +} + + +void TrigEgammaPhysValBase::linkTDTBranches(TTree *t){ + + InitBranch( t, "trig_tdt_L1_calo_accept", &m_trig_tdt_L1_calo_accept); + InitBranch( t, "trig_tdt_L2_calo_accept", &m_trig_tdt_L2_calo_accept); + InitBranch( t, "trig_tdt_L2_el_accept", &m_trig_tdt_L2_el_accept ); + InitBranch( t, "trig_tdt_EF_calo_accept", &m_trig_tdt_EF_calo_accept); + InitBranch( t, "trig_tdt_EF_el_accept", &m_trig_tdt_EF_el_accept ); + InitBranch( t, "trig_tdt_emu_L1_calo_accept", &m_trig_tdt_emu_L1_calo_accept); + InitBranch( t, "trig_tdt_emu_L2_calo_accept", &m_trig_tdt_emu_L2_calo_accept); + InitBranch( t, "trig_tdt_emu_L2_el_accept", &m_trig_tdt_emu_L2_el_accept ); + InitBranch( t, "trig_tdt_emu_EF_calo_accept", &m_trig_tdt_emu_EF_calo_accept); + InitBranch( t, "trig_tdt_emu_EF_el_accept", &m_trig_tdt_emu_EF_el_accept ); + +} + + + +void TrigEgammaPhysValBase::linkEventBranches(TTree *t){ + + InitBranch( t, "RunNumber", &m_runNumber); + InitBranch( t, "EventNumber", &m_eventNumber); + InitBranch( t, "LumiBlock", &m_lumiBlock); + InitBranch( t, "avgmu", &m_avgmu); +} + +void TrigEgammaPhysValBase::linkElectronBranches( TTree *t ){ + + InitBranch( t, "el_calo_e", &m_el_calo_e); + InitBranch( t, "el_calo_et", &m_el_calo_et); + InitBranch( t, "el_calo_eta", &m_el_calo_eta); + InitBranch( t, "el_calo_etaBE2", &m_el_calo_etaBE2); + InitBranch( t, "el_calo_phi", &m_el_calo_phi); + + InitBranch( t, "el_hasCalo", &m_el_hasCalo); + InitBranch( t, "el_hasTrack", &m_el_hasTrack); + InitBranch( t, "el_e", &m_el_e); + InitBranch( t, "el_et", &m_el_et); + InitBranch( t, "el_eta", &m_el_eta); + InitBranch( t, "el_phi", &m_el_phi); + + + if(m_doRecoDetailed){ + InitBranch( t, "el_ethad1", &m_el_ethad1); + InitBranch( t, "el_ehad1", &m_el_ehad1); + InitBranch( t, "el_f1", &m_el_f1); + InitBranch( t, "el_f3", &m_el_f3); + InitBranch( t, "el_f1core", &m_el_f1core); + InitBranch( t, "el_f3core", &m_el_f3core); + InitBranch( t, "el_weta1", &m_el_weta2); + InitBranch( t, "el_weta2", &m_el_weta2); + InitBranch( t, "el_wtots1", &m_el_wtots1); + InitBranch( t, "el_fracs1", &m_el_fracs1); + InitBranch( t, "el_Reta", &m_el_Reta); + InitBranch( t, "el_Rphi", &m_el_Rphi); + InitBranch( t, "el_Eratio", &m_el_Eratio); + InitBranch( t, "el_Rhad", &m_el_Rhad); + InitBranch( t, "el_Rhad1", &m_el_Rhad1); + InitBranch( t, "el_deta2", &m_el_deta2); + InitBranch( t, "el_dphi2", &m_el_dphi2); + InitBranch( t, "el_dphiresc", &m_el_dphiresc); + InitBranch( t, "el_deltaPhiRescaled2" , &m_el_deltaPhiRescaled2 ); + InitBranch( t, "el_e277" , &m_el_e277 ); + InitBranch( t, "el_deltaE" , &m_el_e277 ); + InitBranch( t, "el_deltaEta1" , &m_el_deltaEta1 ); + InitBranch( t, "el_etCone" , &m_el_etCone ); + InitBranch( t, "el_ptCone" , &m_el_ptCone ); + + InitBranch( t, "el_trk_pt", &m_el_trk_pt); + InitBranch( t, "el_trk_eta" , &m_el_trk_eta); + InitBranch( t, "el_trk_charge", &m_el_trk_charge); + InitBranch( t, "el_trk_qOverP", &m_el_trk_qOverP); + InitBranch( t, "el_trk_deltaPOverP" , &m_el_trk_deltaPOverP ); + InitBranch( t, "el_trk_sigd0" , &m_el_trk_sigd0 ); + InitBranch( t, "el_trk_d0" , &m_el_trk_d0 ); + InitBranch( t, "el_trk_eProbabilityHT" , &m_el_trk_eProbabilityHT ); + InitBranch( t, "el_trk_transformed_eProbabilityHT", &m_el_trk_transformed_eProbabilityHT); + InitBranch( t, "el_trk_d0significance" , &m_el_trk_d0significance ); + InitBranch( t, "el_trk_summaryValues" , &m_el_trk_summaryValues ); + + + } + + InitBranch( t, "el_nGoodVtx", &m_el_nGoodVtx); + InitBranch( t, "el_ringsE", &m_el_ringsE ); + InitBranch( t, "el_nPileupPrimaryVtx", &m_el_nPileupPrimaryVtx); + + InitBranch( t, "el_loose", &m_el_loose ); + InitBranch( t, "el_medium", &m_el_medium ); + InitBranch( t, "el_tight", &m_el_tight ); + InitBranch( t, "el_lhvloose", &m_el_lhVLoose ); + InitBranch( t, "el_lhloose", &m_el_lhLoose ); + InitBranch( t, "el_lhmedium", &m_el_lhMedium ); + InitBranch( t, "el_lhtight", &m_el_lhTight ); + InitBranch( t, "el_multiLepton", &m_el_multiLepton); +} + + + +void TrigEgammaPhysValBase::linkTriggerBranches( TTree *t ){ + + InitBranch(t, "trig_L1_eta", &m_trig_L1_eta); + InitBranch(t, "trig_L1_phi", &m_trig_L1_phi); + InitBranch(t, "trig_L1_emClus", &m_trig_L1_emClus); + InitBranch(t, "trig_L1_tauClus", &m_trig_L1_tauClus); + InitBranch(t, "trig_L1_emIsol", &m_trig_L1_emIsol); + InitBranch(t, "trig_L1_hadIsol", &m_trig_L1_hadIsol); + InitBranch(t, "trig_L1_hadCore", &m_trig_L1_hadCore); + InitBranch(t, "trig_L2_calo_et", &m_trig_L2_calo_et); + InitBranch(t, "trig_L2_calo_eta", &m_trig_L2_calo_eta); + InitBranch(t, "trig_L2_calo_phi", &m_trig_L2_calo_phi); + + if(m_doL2CaloDetailed){ + InitBranch(t, "trig_L2_calo_e237", &m_trig_L2_calo_e237 ); + InitBranch(t, "trig_L2_calo_e277", &m_trig_L2_calo_e277 ); + InitBranch(t, "trig_L2_calo_fracs1", &m_trig_L2_calo_fracs1); + InitBranch(t, "trig_L2_calo_weta2", &m_trig_L2_calo_weta2); + InitBranch(t, "trig_L2_calo_ehad1", &m_trig_L2_calo_ehad1); + InitBranch(t, "trig_L2_calo_emaxs1", &m_trig_L2_calo_emaxs1); + InitBranch(t, "trig_L2_calo_e2tsts1", &m_trig_L2_calo_e2tsts1); + InitBranch(t, "trig_L2_calo_wstot", &m_trig_L2_calo_wstot); + InitBranch(t, "trig_L2_calo_energySample", &m_trig_L2_calo_energySample); + } + + InitBranch(t, "trig_L2_calo_rings", &m_trig_L2_calo_rings ); + InitBranch(t, "trig_L2_calo_rnnOutput", &m_trig_L2_calo_rnnOutput); + + if(m_doL2Detailed){ + InitBranch(t, "trig_L2_el_trackAlgID" , &m_trig_L2_el_trackAlgID ); + InitBranch(t, "trig_L2_el_pt" , &m_trig_L2_el_pt ); + InitBranch(t, "trig_L2_el_eta", &m_trig_L2_el_eta); + InitBranch(t, "trig_L2_el_phi", &m_trig_L2_el_phi ); + InitBranch(t, "trig_L2_el_caloEta", &m_trig_L2_el_caloEta ); + InitBranch(t, "trig_L2_el_charge", &m_trig_L2_el_charge); + InitBranch(t, "trig_L2_el_nTRTHits", &m_trig_L2_el_nTRTHits); + InitBranch(t, "trig_L2_el_nTRTHiThresholdHits", &m_trig_L2_el_nTRTHiThresholdHits); + InitBranch(t, "trig_L2_el_etOverPt" , &m_trig_L2_el_etOverPt ); + InitBranch(t, "trig_L2_el_trkClusDeta" , &m_trig_L2_el_trkClusDeta ); + InitBranch(t, "trig_L2_el_trkClusDphi" , &m_trig_L2_el_trkClusDphi ); + + } + + + +#define INIT(_name_) TrigEgammaPhysValBase::InitBranch(t, #_name_, & m_##_name_);\ + + INIT( trig_EF_calo_et ); + INIT( trig_EF_calo_eta ); + INIT( trig_EF_calo_phi ); + INIT( trig_EF_calo_etaBE2 ); + INIT( trig_EF_calo_e ); + + INIT( trig_EF_el_calo_e ); + INIT( trig_EF_el_calo_et ); + INIT( trig_EF_el_calo_eta ); + INIT( trig_EF_el_calo_phi ); + INIT( trig_EF_el_calo_etaBE2 ); + + INIT( trig_EF_el_hasCalo ); + INIT( trig_EF_el_hasTrack ); + INIT( trig_EF_el_et ); + INIT( trig_EF_el_eta ); + INIT( trig_EF_el_phi ); + INIT( trig_EF_el_e ); + INIT( trig_EF_el_ethad1 ); + INIT( trig_EF_el_ehad1 ); + INIT( trig_EF_el_f1 ); + INIT( trig_EF_el_f3 ); + INIT( trig_EF_el_f1core ); + INIT( trig_EF_el_f3core ); + INIT( trig_EF_el_weta1 ); + INIT( trig_EF_el_weta2 ); + INIT( trig_EF_el_wtots1 ); + INIT( trig_EF_el_fracs1 ); + INIT( trig_EF_el_Reta ); + INIT( trig_EF_el_Rphi ); + INIT( trig_EF_el_Eratio ); + INIT( trig_EF_el_Rhad ); + INIT( trig_EF_el_Rhad1 ); + INIT( trig_EF_el_deta2 ); + INIT( trig_EF_el_dphi2 ); + INIT( trig_EF_el_e277 ); + INIT( trig_EF_el_deltaE ); + INIT( trig_EF_el_dphiresc ); + INIT( trig_EF_el_deltaPhiRescaled2 ); + INIT( trig_EF_el_deltaEta1 ); + INIT( trig_EF_el_etCone ); + INIT( trig_EF_el_ptCone ); + + INIT( trig_EF_el_trk_pt ); + INIT( trig_EF_el_trk_eta ); + INIT( trig_EF_el_trk_charge ); + INIT( trig_EF_el_trk_qOverP ); + INIT( trig_EF_el_trk_sigd0 ); + INIT( trig_EF_el_trk_d0 ); + INIT( trig_EF_el_trk_eProbabilityHT ); + INIT( trig_EF_el_trk_transformed_eProbabilityHT ); + INIT( trig_EF_el_trk_d0significance ); + INIT( trig_EF_el_trk_deltaPOverP ); + INIT( trig_EF_el_trk_summaryValues ); + + INIT( trig_EF_calo_tight ); + INIT( trig_EF_calo_medium ); + INIT( trig_EF_calo_loose ); + INIT( trig_EF_calo_lhtight ); + INIT( trig_EF_calo_lhmedium ); + INIT( trig_EF_calo_lhloose ); + INIT( trig_EF_calo_lhvloose ); + INIT( trig_EF_el_tight ); + INIT( trig_EF_el_medium ); + INIT( trig_EF_el_loose ); + INIT( trig_EF_el_lhtight ); + INIT( trig_EF_el_lhmedium ); + INIT( trig_EF_el_lhloose ); + INIT( trig_EF_el_lhvloose ); + + + +#undef INIT + + +} + + + +void TrigEgammaPhysValBase::linkMonteCarloBranches(TTree *t){ + + InitBranch(t, "mc_hasMC", &m_mc_hasMC); + InitBranch(t, "mc_pt", &m_mc_pt); + InitBranch(t, "mc_eta", &m_mc_eta); + InitBranch(t, "mc_phi", &m_mc_phi); + + if(m_doMCDetailed){ + InitBranch(t, "mc_isTop", &m_mc_isTop); + InitBranch(t, "mc_isParton", &m_mc_isParton); + InitBranch(t, "mc_isMeson", &m_mc_isMeson); + InitBranch(t, "mc_isTau", &m_mc_isTau); + InitBranch(t, "mc_isMuon", &m_mc_isMuon); + } + + InitBranch(t, "mc_isPhoton", &m_mc_isPhoton); + InitBranch(t, "mc_isElectron", &m_mc_isElectron); + InitBranch(t, "mc_hasZMother", &m_mc_hasZMother); + InitBranch(t, "mc_hasWMother", &m_mc_hasWMother); +} + + +void TrigEgammaPhysValBase::clear(){ + + ///EventInfo + m_runNumber = 0; + m_eventNumber = 0; + m_lumiBlock = 0; + m_avgmu = 0; + + ///Egamma + m_el_hasCalo = false; + m_el_hasTrack = false; + + + m_el_calo_e = 0; + m_el_calo_et = 0; + m_el_calo_eta = 0; + m_el_calo_phi = 0; + m_el_calo_etaBE2 = 0; + + m_el_e = 0; + m_el_et = 0; + m_el_eta = 0; + m_el_phi = 0; + m_el_ethad1 = 0; + m_el_ehad1 = 0; + m_el_f1 = 0; + m_el_f3 = 0; + m_el_f1core = 0; + m_el_f3core = 0; + m_el_weta1 = 0; + m_el_weta2 = 0; + m_el_wtots1 = 0; + m_el_fracs1 = 0; + m_el_e277 = 0; + m_el_Reta = 0; + m_el_Rphi = 0; + m_el_Eratio = 0; + m_el_Rhad = 0; + m_el_Rhad1 = 0; + m_el_deta2 = 0; + m_el_dphi2 = 0; + m_el_dphiresc = 0; + m_el_deltaPhiRescaled2 = 0; + m_el_deltaEta1 = 0; + m_el_deltaE = 0; + m_el_etCone ->clear(); + m_el_ptCone ->clear(); + + m_el_trk_pt = 0; + m_el_trk_eta = 0; + m_el_trk_charge = 0; + m_el_trk_sigd0 = 0; + m_el_trk_d0 = 0; + m_el_trk_eProbabilityHT = 0; + m_el_trk_transformed_eProbabilityHT=0; + m_el_trk_d0significance = 0; + m_el_trk_deltaPOverP = 0; + m_el_trk_qOverP = 0; + m_el_trk_summaryValues ->clear(); + + + + m_el_medium = false; + m_el_tight = false; + m_el_lhVLoose = false; + m_el_lhLoose = false; + m_el_lhMedium = false; + m_el_lhTight = false; + m_el_rgLoose = false; + m_el_rgMedium = false; + m_el_rgTight = false; + m_el_multiLepton = false; + + m_el_nGoodVtx = -1; + m_el_nPileupPrimaryVtx = -1; + m_el_ringsE ->clear(); + + // Trigger L1 + m_trig_L1_eta = 0; + m_trig_L1_phi = 0; + m_trig_L1_emClus = 0; + m_trig_L1_tauClus = 0; + m_trig_L1_emIsol = 0; + m_trig_L1_hadIsol = 0; + m_trig_L1_hadCore = 0; + + // Trigger L2 Calo + m_trig_L2_calo_et = 0; + m_trig_L2_calo_eta = 0; + m_trig_L2_calo_phi = 0; + m_trig_L2_calo_e237 = 0; + m_trig_L2_calo_e277 = 0; + m_trig_L2_calo_fracs1 = 0; + m_trig_L2_calo_weta2 = 0; + m_trig_L2_calo_ehad1 = 0; + m_trig_L2_calo_emaxs1 = 0; + m_trig_L2_calo_e2tsts1 = 0; + m_trig_L2_calo_wstot = 0; + + + m_trig_L2_calo_energySample ->clear(); + m_trig_L2_calo_rings ->clear(); + m_trig_L2_calo_rnnOutput ->clear(); + + + // L2 Electron + m_trig_L2_el_pt ->clear(); + m_trig_L2_el_eta ->clear(); + m_trig_L2_el_phi ->clear(); + m_trig_L2_el_charge ->clear(); + m_trig_L2_el_caloEta ->clear(); + m_trig_L2_el_trkClusDeta ->clear(); + m_trig_L2_el_trkClusDphi ->clear(); + m_trig_L2_el_etOverPt ->clear(); + m_trig_L2_el_nTRTHits ->clear(); + m_trig_L2_el_nTRTHiThresholdHits ->clear(); + m_trig_L2_el_trackAlgID ->clear(); + + m_trig_EF_el_hasCalo ->clear(); + m_trig_EF_el_hasTrack ->clear(); + + // EF Calo + m_trig_EF_calo_e ->clear(); + m_trig_EF_calo_et ->clear(); + m_trig_EF_calo_eta ->clear(); + m_trig_EF_calo_phi ->clear(); + m_trig_EF_calo_etaBE2 ->clear(); + + m_trig_EF_calo_tight ->clear(); + m_trig_EF_calo_medium ->clear(); + m_trig_EF_calo_loose ->clear(); + m_trig_EF_calo_lhtight ->clear(); + m_trig_EF_calo_lhmedium ->clear(); + m_trig_EF_calo_lhloose ->clear(); + m_trig_EF_calo_lhvloose ->clear(); + + // HLT electron + m_trig_EF_el_calo_e ->clear(); + m_trig_EF_el_calo_et ->clear(); + m_trig_EF_el_calo_eta ->clear(); + m_trig_EF_el_calo_phi ->clear(); + m_trig_EF_el_calo_etaBE2 ->clear(); + + m_trig_EF_el_e ->clear(); + m_trig_EF_el_et ->clear(); + m_trig_EF_el_eta ->clear(); + m_trig_EF_el_phi ->clear(); + m_trig_EF_el_deltaE ->clear(); + m_trig_EF_el_ethad1 ->clear(); + m_trig_EF_el_ehad1 ->clear(); + m_trig_EF_el_f1 ->clear(); + m_trig_EF_el_f3 ->clear(); + m_trig_EF_el_f1core ->clear(); + m_trig_EF_el_f3core ->clear(); + m_trig_EF_el_weta1 ->clear(); + m_trig_EF_el_weta2 ->clear(); + m_trig_EF_el_wtots1 ->clear(); + m_trig_EF_el_fracs1 ->clear(); + m_trig_EF_el_Reta ->clear(); + m_trig_EF_el_Rphi ->clear(); + m_trig_EF_el_Eratio ->clear(); + m_trig_EF_el_Rhad ->clear(); + m_trig_EF_el_Rhad1 ->clear(); + m_trig_EF_el_e277 ->clear(); + m_trig_EF_el_deta2 ->clear(); + m_trig_EF_el_dphi2 ->clear(); + m_trig_EF_el_dphiresc ->clear(); + m_trig_EF_el_deltaPhiRescaled2 ->clear(); + m_trig_EF_el_deltaEta1 ->clear(); + m_trig_EF_el_etCone ->clear(); + m_trig_EF_el_ptCone ->clear(); + + m_trig_EF_el_trk_pt ->clear(); + m_trig_EF_el_trk_eta ->clear(); + m_trig_EF_el_trk_charge ->clear(); + m_trig_EF_el_trk_qOverP ->clear(); + m_trig_EF_el_trk_sigd0 ->clear(); + m_trig_EF_el_trk_d0 ->clear(); + m_trig_EF_el_trk_eProbabilityHT ->clear(); + m_trig_EF_el_trk_transformed_eProbabilityHT->clear(); + m_trig_EF_el_trk_d0significance ->clear(); + m_trig_EF_el_trk_deltaPOverP ->clear(); + m_trig_EF_el_trk_summaryValues ->clear(); + + + m_trig_EF_el_tight ->clear(); + m_trig_EF_el_medium ->clear(); + m_trig_EF_el_loose ->clear(); + m_trig_EF_el_lhtight ->clear(); + m_trig_EF_el_lhmedium ->clear(); + m_trig_EF_el_lhloose ->clear(); + m_trig_EF_el_lhvloose ->clear(); + + m_trig_tdt_L1_calo_accept ->clear(); + m_trig_tdt_L2_calo_accept ->clear(); + m_trig_tdt_L2_el_accept ->clear(); + m_trig_tdt_EF_calo_accept ->clear(); + m_trig_tdt_EF_el_accept ->clear(); + m_trig_tdt_emu_L1_calo_accept ->clear(); + m_trig_tdt_emu_L2_calo_accept ->clear(); + m_trig_tdt_emu_L2_el_accept ->clear(); + m_trig_tdt_emu_EF_calo_accept ->clear(); + m_trig_tdt_emu_EF_el_accept ->clear(); + + ///Monte Carlo + m_mc_hasMC = false; + m_mc_pt = -1; + m_mc_eta = -1; + m_mc_phi = -1; + m_mc_isTop = false; + m_mc_isParton = false; + m_mc_isMeson = false; + m_mc_isTau = false; + m_mc_isMuon = false; + m_mc_isPhoton = false; + m_mc_isElectron = false; + m_mc_hasZMother = false; + m_mc_hasWMother = false; + + +} + +void TrigEgammaPhysValBase::alloc_space(){ + + m_el_ringsE = new std::vector<float>(); + m_el_trk_summaryValues = new std::vector<uint8_t>(); + m_el_etCone = new std::vector<float>(); + m_el_ptCone = new std::vector<float>(); + + + m_trig_L2_calo_energySample = new std::vector<float>(); + m_trig_L2_calo_rings = new std::vector<float>(); + m_trig_L2_calo_rnnOutput = new std::vector<float>(); + + m_trig_L2_el_trackAlgID = new std::vector<int>(); + m_trig_L2_el_eta = new std::vector<float>(); + m_trig_L2_el_phi = new std::vector<float>(); + m_trig_L2_el_caloEta = new std::vector<float>(); + m_trig_L2_el_trkClusDeta = new std::vector<float>(); + m_trig_L2_el_trkClusDphi = new std::vector<float>(); + m_trig_L2_el_pt = new std::vector<float>(); + m_trig_L2_el_etOverPt = new std::vector<float>(); + m_trig_L2_el_nTRTHits = new std::vector<float>(); + m_trig_L2_el_nTRTHiThresholdHits = new std::vector<float>(); + m_trig_L2_el_charge = new std::vector<float>(); + + m_trig_EF_calo_et = new std::vector<float>(); + m_trig_EF_calo_eta = new std::vector<float>(); + m_trig_EF_calo_phi = new std::vector<float>(); + m_trig_EF_calo_etaBE2 = new std::vector<float>(); + m_trig_EF_calo_e = new std::vector<float>(); + + m_trig_EF_el_calo_et = new std::vector<float>(); + m_trig_EF_el_calo_eta = new std::vector<float>(); + m_trig_EF_el_calo_phi = new std::vector<float>(); + m_trig_EF_el_calo_etaBE2 = new std::vector<float>(); + m_trig_EF_el_calo_e = new std::vector<float>(); + + m_trig_EF_el_hasCalo = new std::vector<bool>(); + m_trig_EF_el_hasTrack = new std::vector<bool>(); + + m_trig_EF_el_et = new std::vector<float>(); + m_trig_EF_el_eta = new std::vector<float>(); + m_trig_EF_el_phi = new std::vector<float>(); + m_trig_EF_el_e = new std::vector<float>(); + m_trig_EF_el_deltaE = new std::vector<float>(); + m_trig_EF_el_ethad1 = new std::vector<float>(); + m_trig_EF_el_ehad1 = new std::vector<float>(); + m_trig_EF_el_f1 = new std::vector<float>(); + m_trig_EF_el_f3 = new std::vector<float>(); + m_trig_EF_el_f1core = new std::vector<float>(); + m_trig_EF_el_f3core = new std::vector<float>(); + m_trig_EF_el_weta1 = new std::vector<float>(); + m_trig_EF_el_weta2 = new std::vector<float>(); + m_trig_EF_el_wtots1 = new std::vector<float>(); + m_trig_EF_el_fracs1 = new std::vector<float>(); + m_trig_EF_el_e277 = new std::vector<float>(); + m_trig_EF_el_Reta = new std::vector<float>(); + m_trig_EF_el_Rphi = new std::vector<float>(); + m_trig_EF_el_Eratio = new std::vector<float>(); + m_trig_EF_el_Rhad = new std::vector<float>(); + m_trig_EF_el_Rhad1 = new std::vector<float>(); + m_trig_EF_el_deta2 = new std::vector<float>(); + m_trig_EF_el_dphi2 = new std::vector<float>(); + m_trig_EF_el_dphiresc = new std::vector<float>(); + m_trig_EF_el_deltaPhiRescaled2 = new std::vector<float>(); + m_trig_EF_el_deltaEta1 = new std::vector<float>(); + m_trig_EF_el_etCone = new std::vector<float>(); + m_trig_EF_el_ptCone = new std::vector<float>(); + + m_trig_EF_el_trk_pt = new std::vector<float>(); + m_trig_EF_el_trk_eta = new std::vector<float>(); + m_trig_EF_el_trk_charge = new std::vector<float>(); + m_trig_EF_el_trk_qOverP = new std::vector<float>(); + m_trig_EF_el_trk_sigd0 = new std::vector<float>(); + m_trig_EF_el_trk_d0 = new std::vector<float>(); + m_trig_EF_el_trk_eProbabilityHT = new std::vector<float>(); + m_trig_EF_el_trk_transformed_eProbabilityHT = new std::vector<float>(); + m_trig_EF_el_trk_d0significance = new std::vector<float>(); + m_trig_EF_el_trk_deltaPOverP = new std::vector<float>(); + m_trig_EF_el_trk_summaryValues = new std::vector<uint8_t>(); + + m_trig_EF_calo_tight = new std::vector<bool>(); + m_trig_EF_calo_medium = new std::vector<bool>(); + m_trig_EF_calo_loose = new std::vector<bool>(); + m_trig_EF_calo_lhtight = new std::vector<bool>(); + m_trig_EF_calo_lhmedium = new std::vector<bool>(); + m_trig_EF_calo_lhloose = new std::vector<bool>(); + m_trig_EF_calo_lhvloose = new std::vector<bool>(); + + m_trig_EF_el_tight = new std::vector<bool>(); + m_trig_EF_el_medium = new std::vector<bool>(); + m_trig_EF_el_loose = new std::vector<bool>(); + m_trig_EF_el_lhtight = new std::vector<bool>(); + m_trig_EF_el_lhmedium = new std::vector<bool>(); + m_trig_EF_el_lhloose = new std::vector<bool>(); + m_trig_EF_el_lhvloose = new std::vector<bool>(); + + m_trig_tdt_L1_calo_accept = new std::vector<int>(); + m_trig_tdt_L2_calo_accept = new std::vector<int>(); + m_trig_tdt_L2_el_accept = new std::vector<int>(); + m_trig_tdt_EF_calo_accept = new std::vector<int>(); + m_trig_tdt_EF_el_accept = new std::vector<int>(); + + m_trig_tdt_emu_L1_calo_accept = new std::vector<int>(); + m_trig_tdt_emu_L2_calo_accept = new std::vector<int>(); + m_trig_tdt_emu_L2_el_accept = new std::vector<int>(); + m_trig_tdt_emu_EF_calo_accept = new std::vector<int>(); + m_trig_tdt_emu_EF_el_accept = new std::vector<int>(); + + + +} + +void TrigEgammaPhysValBase::release_space(){ + + delete m_el_ringsE ; + delete m_el_trk_summaryValues ; + delete m_el_etCone ; + delete m_el_ptCone ; + + + + delete m_trig_L2_calo_energySample; + delete m_trig_L2_calo_rings ; + delete m_trig_L2_calo_rnnOutput ; + delete m_trig_L2_el_trackAlgID ; + delete m_trig_L2_el_pt ; + delete m_trig_L2_el_eta ; + delete m_trig_L2_el_caloEta ; + delete m_trig_L2_el_phi ; + delete m_trig_L2_el_charge ; + delete m_trig_L2_el_nTRTHits ; + delete m_trig_L2_el_nTRTHiThresholdHits ; + delete m_trig_L2_el_etOverPt ; + delete m_trig_L2_el_trkClusDeta ; + delete m_trig_L2_el_trkClusDphi ; + + delete m_trig_EF_calo_et ; + delete m_trig_EF_calo_eta ; + delete m_trig_EF_calo_phi ; + delete m_trig_EF_calo_etaBE2 ; + delete m_trig_EF_calo_e ; + + delete m_trig_EF_el_calo_et ; + delete m_trig_EF_el_calo_eta ; + delete m_trig_EF_el_calo_phi ; + delete m_trig_EF_el_calo_etaBE2 ; + delete m_trig_EF_el_calo_e ; + + delete m_trig_EF_el_et ; + delete m_trig_EF_el_eta ; + delete m_trig_EF_el_phi ; + delete m_trig_EF_el_e ; + delete m_trig_EF_el_deltaE ; + delete m_trig_EF_el_ethad1 ; + delete m_trig_EF_el_ehad1 ; + delete m_trig_EF_el_f1 ; + delete m_trig_EF_el_f3 ; + delete m_trig_EF_el_f1core ; + delete m_trig_EF_el_f3core ; + delete m_trig_EF_el_weta1 ; + delete m_trig_EF_el_weta2 ; + delete m_trig_EF_el_wtots1 ; + delete m_trig_EF_el_fracs1 ; + delete m_trig_EF_el_e277 ; + delete m_trig_EF_el_Reta ; + delete m_trig_EF_el_Rphi ; + delete m_trig_EF_el_Eratio ; + delete m_trig_EF_el_Rhad ; + delete m_trig_EF_el_Rhad1 ; + delete m_trig_EF_el_deta2 ; + delete m_trig_EF_el_dphi2 ; + delete m_trig_EF_el_dphiresc ; + delete m_trig_EF_el_deltaPhiRescaled2 ; + delete m_trig_EF_el_deltaEta1 ; + delete m_trig_EF_el_etCone ; + delete m_trig_EF_el_ptCone ; + + delete m_trig_EF_el_trk_pt ; + delete m_trig_EF_el_trk_eta ; + delete m_trig_EF_el_trk_charge ; + delete m_trig_EF_el_trk_qOverP ; + delete m_trig_EF_el_trk_sigd0 ; + delete m_trig_EF_el_trk_d0 ; + delete m_trig_EF_el_trk_eProbabilityHT ; + delete m_trig_EF_el_trk_transformed_eProbabilityHT ; + delete m_trig_EF_el_trk_d0significance ; + delete m_trig_EF_el_trk_deltaPOverP ; + delete m_trig_EF_el_trk_summaryValues ; + + delete m_trig_EF_calo_tight ; + delete m_trig_EF_calo_medium ; + delete m_trig_EF_calo_loose ; + delete m_trig_EF_calo_lhtight ; + delete m_trig_EF_calo_lhmedium ; + delete m_trig_EF_calo_lhloose ; + delete m_trig_EF_calo_lhvloose ; + delete m_trig_EF_el_tight ; + delete m_trig_EF_el_medium ; + delete m_trig_EF_el_loose ; + delete m_trig_EF_el_lhtight ; + delete m_trig_EF_el_lhmedium ; + delete m_trig_EF_el_lhloose ; + delete m_trig_EF_el_lhvloose ; + + delete m_trig_tdt_L1_calo_accept ; + delete m_trig_tdt_L2_calo_accept ; + delete m_trig_tdt_L2_el_accept ; + delete m_trig_tdt_EF_calo_accept ; + delete m_trig_tdt_EF_el_accept ; + delete m_trig_tdt_emu_L1_calo_accept ; + delete m_trig_tdt_emu_L2_calo_accept ; + delete m_trig_tdt_emu_L2_el_accept ; + delete m_trig_tdt_emu_EF_calo_accept ; + delete m_trig_tdt_emu_EF_el_accept ; + + + + delete m_trig_EF_el_hasCalo ; + delete m_trig_EF_el_hasTrack ; + + +} + + diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx index 1b1436394b59689968d6a065e678557e4f98ceee..f384b20e234476eef0a3f3ba83ba72a45fe2d792 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx @@ -161,23 +161,6 @@ void TrigEgammaPlotTool::setBinning(){ 20,20.5,21,21.5,22,22.5,23,23.5,24,24.5, 25,25.5}; - /* Ringer bins pdfs for each layer */ - m_minBin_ringer.assign - ({-500 ,-500 ,-1000,-1500,-1500,-1000,-1000,-1000,-500 ,-500 ,-500 ,-500 ,-500 ,-500 ,-500 ,-800, - -800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800, - -800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800, - -800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800, - -800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-800 ,-500 ,-500 ,-500 ,-500 ,-1000,-1000,-1000,-500, - -500 ,-500 ,-500 ,-500 ,-500 ,-500 ,-500 ,-500 ,-600 ,-1000,-1500,-2000,-400 ,-1000,-1500,-1500, - -1000,-2000,-2000,-2000}); - m_maxBin_ringer.assign - ({9000 , 7000, 2000, 2000, 2000, 2000, 2000, 2000, 20000, 20000, 6000, 4000, 3000, 2000, 2000, 800, - 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800, - 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800, - 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800, - 800 , 800 , 800 , 800 , 800 , 800 , 800 , 800 , 40000, 40000, 6000, 4000, 2000, 2000, 2000, 2000, - 500 , 500 , 500 , 500 , 500 , 500 ,500 , 500 , 3000 , 3000 , 3000 ,3000, 2000, 2000, 2000, 2000, - 8000, 5000 ,4000 ,3000}); if(m_doJpsiee){ m_nEtbins=51; @@ -608,24 +591,13 @@ TTree *TrigEgammaPlotTool::tree(const std::string &treeName, const std::string & return treeItr->second; } -void TrigEgammaPlotTool::parseCaloRingsLayers( unsigned layer, unsigned &minRing, - unsigned &maxRing, std::string &caloLayerName) -{ - if(layer == 0){minRing = 0; maxRing = 7 ; caloLayerName = "PreSampler";} - if(layer == 1){minRing = 8; maxRing = 71; caloLayerName = "EM1";} - if(layer == 2){minRing = 72; maxRing = 79; caloLayerName = "EM2";} - if(layer == 3){minRing = 80; maxRing = 87; caloLayerName = "EM3";} - if(layer == 4){minRing = 88; maxRing = 91; caloLayerName = "HAD1";} - if(layer == 5){minRing = 92; maxRing = 95; caloLayerName = "HAD2";} - if(layer == 6){minRing = 96; maxRing = 99; caloLayerName = "HAD3";} -} -void TrigEgammaPlotTool::bookAbsResolutionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookAbsResolutionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("res_pt", "HLT p_{T} resolution; (p_{T}(on)-p_{T}(off)) ; Count", 200, -1.5, 1.5)); addHistogram(new TH1F("res_et", "HLT E_{T} resolution; (E_{T}(on)-E_{T}(off)) ; Count", 200, -0.5, 0.5)); - addHistogram(new TH1F("res_eta", "#eta resolution; (#eta(on)-#eta(off)) ; Count", 40, -0.2, 0.2)); - addHistogram(new TH1F("res_phi", "#phi resolution; (#phi(on)-#phi(off)) ; Count", 40, -0.2, 0.2)); + addHistogram(new TH1F("res_eta", "#eta resolution; (#eta(on)-#eta(off)) ; Count", 40, -0.001, 0.001)); + addHistogram(new TH1F("res_phi", "#phi resolution; (#phi(on)-#phi(off)) ; Count", 40, -0.001, 0.001)); addHistogram(new TH2F("res_etVsEta", "HLT E_{T} resolution as function of #eta; #eta; (E_{T}(on)-E_{T}(off)); Count", 50, -2.47, 2.47, @@ -696,11 +668,11 @@ void TrigEgammaPlotTool::bookAbsResolutionHistos(const std::string directory){ } -void TrigEgammaPlotTool::bookResolutionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookResolutionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("res_et", "E_{T} resolution; (E_{T}(on)-E_{T}(off))/E_{T}(off) ; Count", 100, -0.1, 0.1)); - addHistogram(new TH1F("res_eta", "#eta resolution; (#eta(on)-#eta(off))/#eta(off) ; Count", 40, -0.2, 0.2)); - addHistogram(new TH1F("res_phi", "#phi resolution; (#phi(on)-#phi(off))/#phi(off) ; Count", 40, -0.2, 0.2)); + addHistogram(new TH1F("res_eta", "#eta resolution; (#eta(on)-#eta(off))/#eta(off) ; Count", 40, -0.001, 0.001)); + addHistogram(new TH1F("res_phi", "#phi resolution; (#phi(on)-#phi(off))/#phi(off) ; Count", 40, -0.001, 0.001)); addHistogram(new TH2F("res_etVsEta", "E_{T} resolution as function of #eta; #eta; (E_{T}(on)-E_{T}(off))/E_{T}(off); Count", 25, -2.5, 2.5, 50, -0.1, 0.1)); @@ -721,7 +693,7 @@ void TrigEgammaPlotTool::bookResolutionHistos(const std::string directory){ } -void TrigEgammaPlotTool::bookElectronResolutionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookElectronResolutionHistos(const std::string &directory){ cd(directory); //Electron addHistogram(new TH1F("res_pt", "p_{T} resolution; (p_{T}(on)-p_{T}(off))/p_{T}(off) ; Count", 120, -1.5, 1.5)); @@ -743,7 +715,7 @@ void TrigEgammaPlotTool::bookElectronResolutionHistos(const std::string director 50, 0., 1.)); } -void TrigEgammaPlotTool::bookElectronIsoResolutionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookElectronIsoResolutionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("res_ptcone20", "resolution ptcone20; ptcone20 (on-off)/off; Count", 200, -0.1, 0.1)); addHistogram(new TH1F("res_ptcone20_rel", "resolution ptcone20/pt; ptcone20/pt (on-off)/off; Count", 100, -0.1, 0.1)); @@ -789,7 +761,7 @@ void TrigEgammaPlotTool::bookElectronIsoResolutionHistos(const std::string direc } -void TrigEgammaPlotTool::bookPhotonResolutionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookPhotonResolutionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("res_et_cnv", "HLT E_{T} resolution for converted Photons; (E_{T}(on)-E_{T}(off))/E_{T}(off) ; Count", 200, -0.1, 0.1)); addHistogram(new TH1F("res_et_uncnv", "HLT E_{T} resolution for unconverted Photons; (E_{T}(on)-E_{T}(off))/E_{T}(off) ; Count", 200, -0.1, 0.1)); @@ -818,7 +790,7 @@ void TrigEgammaPlotTool::bookPhotonResolutionHistos(const std::string directory) addHistogram(new TH1F("res_uncnv_etInEta3", "HLT E_{T} resolution in #eta = [1.8,2.45]; (E_{T}(on)-E_{T}(off))/E_{T}(off) ; Count", 200, -0.1, 0.1)); } -void TrigEgammaPlotTool::bookPhotonIsoResolutionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookPhotonIsoResolutionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("res_topoetcone20", "resolution topoetcone20; ptcone20 (on-off)/off; Count", 200, -0.1, 0.1)); addHistogram(new TH1F("res_topoetcone20_rel", "resolution topoetcone20/pt; ptcone20/pt (on-off)/off; Count", 100, -0.1, 0.1)); @@ -834,15 +806,21 @@ void TrigEgammaPlotTool::bookPhotonIsoResolutionHistos(const std::string directo addHistogram(new TH2F("res_topoetcone20_relVsMu", "HLT topoetcone20/pt resolution as function of avg #mu; #mu; (on-off)/off; Count", 50, 0, 100, 100, -0.1, 0.1)); - addHistogram(new TH2F("res_topoetcone20_onVsOff", "online topoetcone20 vs offline topoetcone20; offline [MeV]; online [MeV]; Count", - 100, 0.0, 10000.0, - 100, 0.0, 10000.0)); + addHistogram(new TH2F("res_topoetcone20_onVsOff", "online topoetcone20 vs offline topoetcone20; offline [GeV]; online [GeV]; Count", + 100, -10.0, 10.0, + 100, -10.0, 10.0)); addHistogram(new TH2F("res_topoetcone20_rel_onVsOff", "online topoetcone20/pt vs offline topoetcone20/pt; offline; online; Count", - 100, 0.0, 0.2, - 100, 0.0, 0.2)); + 100, -0.5, 0.5, + 100, -0.5, 0.5)); + addHistogram(new TH2F("res_topoetcone40_shift_onVsOff", "online topoetcone40-2.45 GeV vs offline topoetcone40-2.45 GeV; offline [GeV]; online [GeV]; Count", + 100, -10.0, 10.0, + 100, -10.0, 10.0)); + addHistogram(new TH2F("res_topoetcone40_shift_rel_onVsOff", "online (topoetcone40-2.45 GeV)/pt vs offline (topoetcone40-2.45 GeV)/pt; offline; online; Count", + 100, -0.5, 0.5, + 100, -0.5, 0.5)); } -void TrigEgammaPlotTool::bookExpertResolutionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookExpertResolutionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("res_etInEta0", "HLT E_{T} resolution in #eta = [0,1.37]; (E_{T}(on)-E_{T}(off))/E_{T}(off) ; Count", 200, -0.1, 0.1)); @@ -943,7 +921,7 @@ void TrigEgammaPlotTool::bookExpertResolutionHistos(const std::string directory) } } -void TrigEgammaPlotTool::bookExpertL2CaloResolutionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookExpertL2CaloResolutionHistos(const std::string &directory){ cd(directory); addHistogram(new TH2F("res_f3VsEta", "L2Calo f3 resolution as function of #eta; #eta; (f3(on)-f3(off))/f3(off); Count", 50, -2.47, 2.47, @@ -1007,14 +985,14 @@ void TrigEgammaPlotTool::bookExpertL2CaloResolutionHistos(const std::string dire 50, -0.001, 0.001)); } -void TrigEgammaPlotTool::bookDistributionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookDistributionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("et", "ET; ET [GeV] ; Count", 100, 0., 100.)); addHistogram(new TH1F("eta", "eta; eta ; Count", m_nEtabins,m_etabins.data())); addHistogram(new TH1F("phi", "phi; phi ; Count", 20, -3.2, 3.2)); } -void TrigEgammaPlotTool::bookEgammaDistributionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookEgammaDistributionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("highet", "Offline E_{T}; E_{T} [GeV] ; Count", 100, 0., 2000.)); //addHistogram(new TH1F("e011", "e011; e011 ; Count", 165, -15., 150.)); @@ -1033,11 +1011,13 @@ void TrigEgammaPlotTool::bookEgammaDistributionHistos(const std::string director addHistogram(new TH1F("Rhad", "Rhad; Rhad ; Count", 35, -0.3, 0.3)); addHistogram(new TH1F("Rhad1", "Rhad1; Rhad1 ; Count", 30, -0.3, 0.3)); addHistogram(new TH1F("eratio","eratio; eratio; Count",20, 0, 2)); - addHistogram(new TH1F("topoetcone20", "topoetcone20; topoetcone20; Count", 50, 0.0, 5.0)); - addHistogram(new TH1F("topoetcone20_rel", "topoetcone20/pt; topoetcone20/pt; Count", 50, 0.0, 1.0)); + addHistogram(new TH1F("topoetcone20", "topoetcone20; topoetcone20 [GeV] ; Count", 100, -10.0, 10.0)); + addHistogram(new TH1F("topoetcone20_rel", "topoetcone20/pt; topoetcone20/pt ; Count", 100, -0.5, 0.5)); + addHistogram(new TH1F("topoetcone40_shift", "topoetcone40-2.45 GeV; topoetcone40-2.45 GeV [GeV] ; Count", 100, -10.0, 10.0)); + addHistogram(new TH1F("topoetcone40_shift_rel", "(topoetcone40-2.45 GeV)/pt; (topoetcone40-2.45 GeV)/pt ; Count", 100, -0.5, 0.5)); } -void TrigEgammaPlotTool::bookElectronDistributionHistos(const std::string directory){ +void TrigEgammaPlotTool::bookElectronDistributionHistos(const std::string &directory){ cd(directory); addHistogram(new TH1F("pt", "p_{T}; p_{T} [GeV] ; Count", 100,0.,100.)); addHistogram(new TH1F("deta1", "deta1; deta1 ; Count", 40, -0.01, 0.01)); @@ -1067,7 +1047,7 @@ void TrigEgammaPlotTool::bookElectronDistributionHistos(const std::string direct } -void TrigEgammaPlotTool::bookEfficiency2DHistos(const std::string directory){ +void TrigEgammaPlotTool::bookEfficiency2DHistos(const std::string &directory){ cd(directory); addHistogram(new TH2F("match_coarse_et_eta","Trigger Matched Offline #eta vs et; E_{T} GeV ;#eta; Count", @@ -1088,7 +1068,7 @@ void TrigEgammaPlotTool::bookEfficiency2DHistos(const std::string directory){ } -void TrigEgammaPlotTool::bookEfficiencyTProfile(const std::string directory){ +void TrigEgammaPlotTool::bookEfficiencyTProfile(const std::string &directory){ cd(directory); addHistogram(new TProfile("eff_pt", "#epsilon(p_T); p_{T} ; Efficiency",m_nEtbins,m_etbins.data())); addHistogram(new TProfile("eff_et", "#epsilon(E_T); E_{T} [GeV] ; Efficiency", m_nEtbins,m_etbins.data())); @@ -1101,7 +1081,7 @@ void TrigEgammaPlotTool::bookEfficiencyTProfile(const std::string directory){ addHistogram(new TProfile("eff_npvtx", "#epsilon(npvtx); npvtx ; Efficiency", 16, 0, 80)); } -void TrigEgammaPlotTool::bookEfficiencyHistos(const std::string directory){ +void TrigEgammaPlotTool::bookEfficiencyHistos(const std::string &directory){ cd(directory); bookEfficiencyTProfile(directory); // Numerator @@ -1185,6 +1165,7 @@ void TrigEgammaPlotTool::bookL1Histos(TrigInfo trigInfo){ } + void TrigEgammaPlotTool::bookExpertHistos(TrigInfo trigInfo){ const std::string basePath=m_baseDir+"/Expert/"+trigInfo.trigName; @@ -1338,29 +1319,6 @@ void TrigEgammaPlotTool::bookExpertHistos(TrigInfo trigInfo){ dirnames.push_back(dirname); addDirectory(dirname); - // Store ringer in trigInfo - if(boost::contains(trigInfo.trigName,"ringer") || trigInfo.trigEtcut || trigInfo.trigPerf){ - addHistogram(new TH1F("ringer_nnOutput", "Discriminator distribution; nnOutput ; Count", 100, -1, 1)); - addHistogram(new TH2F("ringer_etVsEta", "ringer count as function of #eta and E_{t}; #eta; E_{t} [GeV]; Count", - m_ndefaultEtabins,m_defaultEtabins.data(), m_ndefaultEtbins, m_defaultEtbins.data() )); - if(m_detailedHists){ - unsigned rCount=0; - for(unsigned layer =0; layer < 7; ++layer){ - unsigned minRing, maxRing; std::string strLayer; - parseCaloRingsLayers( layer, minRing, maxRing, strLayer ); - addDirectory(dirname+"/rings_"+strLayer); - for(unsigned r=minRing; r<=maxRing; ++r){ - std::stringstream ss_title, ss; - ss_title << "ringer_ring#" << r; ss << "L2Calo ringer ("<< strLayer <<"); ring#" << r << " E [MeV]; Count"; - addHistogram(new TH1F(ss_title.str().c_str(), ss.str().c_str(), 100, m_minBin_ringer[rCount], m_maxBin_ringer[rCount])); - rCount++; - } - }///Loop for each calo layers - } - } - - - //Book the kinematic plots for each trigger level for(const auto dir:dirnames) bookDistributionHistos(dir); @@ -1376,7 +1334,7 @@ void TrigEgammaPlotTool::bookExpertHistos(TrigInfo trigInfo){ } if(trigInfo.trigType=="photon"){ bookPhotonResolutionHistos(dirname); - if(boost::contains(trigInfo.trigName,"iloose")) + if(boost::contains(trigInfo.trigName,"icaloloose") ||boost::contains(trigInfo.trigName,"icalovloose") || boost::contains(trigInfo.trigName,"icalotight")) bookPhotonIsoResolutionHistos(dirname); } diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaResolutionTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaResolutionTool.cxx index c2d851d919f7ed4f46e9f8ac0f9b5c691291f37c..66e0a7441e5df957ab7f70c2aa54730dc16949ff 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaResolutionTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaResolutionTool.cxx @@ -47,6 +47,7 @@ StatusCode TrigEgammaResolutionTool::toolExecute(const std::string basePath,Trig const std::string dir = basePath+"/"+info.trigName; bool filliso=false; if(boost::contains(info.trigName,"iloose") || boost::contains(info.trigName,"ivarloose")) filliso=true; + if(boost::contains(info.trigName,"icaloloose") || boost::contains(info.trigName,"icalovloose") || boost::contains(info.trigName,"icalotight")) filliso=true; ATH_MSG_DEBUG("Executing resolution for " << dir); for(const auto pairObj : pairObjs){ const xAOD::Egamma* eg =pairObj.first; @@ -142,14 +143,17 @@ void TrigEgammaResolutionTool::resolutionElectron(const std::string basePath,std void TrigEgammaResolutionTool::resolutionL2Photon(const std::string dir,std::pair< const xAOD::Egamma*,const HLT::TriggerElement*> pairObj){ cd(dir); + ATH_MSG_DEBUG("L2 Photon Resolution"); float dRmax = 100; const xAOD::TrigPhoton *phL2 = nullptr; - if(pairObj.second){ - if(ancestorPassed<xAOD::TrigPhotonContainer>(pairObj.second)) - phL2=closestObject<xAOD::TrigPhoton,xAOD::TrigPhotonContainer>(pairObj,dRmax); - if(phL2){ - if(dRmax < 0.05){ - //Do something here + if(getSGContainsTrigPhoton()){ + if(pairObj.second){ + if(ancestorPassed<xAOD::TrigPhotonContainer>(pairObj.second)) + phL2=closestObject<xAOD::TrigPhoton,xAOD::TrigPhotonContainer>(pairObj,dRmax); + if(phL2){ + if(dRmax < 0.05){ + //Do something here + } } } } @@ -498,8 +502,6 @@ void TrigEgammaResolutionTool::fillIsolationResolution(const std::string dir,con float etoff=off->pt(); if (val_off > 0.) { hist1("res_topoetcone20")->Fill((getIsolation_topoetcone20(onl)-val_off)/val_off); - hist2("res_topoetcone20_onVsOff")->Fill(getIsolation_topoetcone20(off), - getIsolation_topoetcone20(onl)); if (etonl > 0. && etoff > 0.) { const float reliso_onl=getIsolation_topoetcone20(onl)/etonl; const float reliso_off=getIsolation_topoetcone20(off)/etoff; @@ -512,10 +514,18 @@ void TrigEgammaResolutionTool::fillIsolationResolution(const std::string dir,con (reliso_onl-reliso_off)/reliso_off); hist2("res_topoetcone20VsMu")->Fill(getAvgMu(), (reliso_onl-reliso_off)/reliso_off); - hist2("res_topoetcone20_rel_onVsOff")->Fill(getIsolation_topoetcone20(off)/etoff, - getIsolation_topoetcone20(onl)/etonl); } } + hist2("res_topoetcone20_onVsOff")->Fill(getIsolation_topoetcone20(off)/1e3, + getIsolation_topoetcone20(onl)/1e3); + hist2("res_topoetcone40_shift_onVsOff")->Fill((getIsolation_topoetcone40(off)-2450)/1e3, + (getIsolation_topoetcone40(onl)-2450)/1e3); + if (etonl > 0. && etoff > 0.) { + hist2("res_topoetcone20_rel_onVsOff")->Fill(getIsolation_topoetcone20(off)/etoff, + getIsolation_topoetcone20(onl)/etonl); + hist2("res_topoetcone40_shift_rel_onVsOff")->Fill((getIsolation_topoetcone40(off)-2450)/etoff, + (getIsolation_topoetcone40(onl)-2450)/etonl); + } } } diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/ITrigEgammaAnalysisBaseTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/ITrigEgammaAnalysisBaseTool.h index 366d3441c265dbbe286b6e097faa9703cf5d98a0..2b201ce53549c6654068388fb981a6ba798fb4f1 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/ITrigEgammaAnalysisBaseTool.h +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/ITrigEgammaAnalysisBaseTool.h @@ -42,6 +42,8 @@ public: virtual void setEmulationTool(ToolHandle<Trig::ITrigEgammaEmulationTool>)=0; virtual void setAvgMu(const float, const float)=0; virtual void setPVertex(const float, const float)=0; + virtual void setSGContainsRnn(bool)=0; + virtual void setSGContainsTrigPhoton(bool)=0; virtual StatusCode childInitialize(){return StatusCode::SUCCESS;}; virtual StatusCode childBook(){return StatusCode::SUCCESS;}; diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaAnalysisBaseTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaAnalysisBaseTool.h index 5a67bcefb1e402147f282fcb5b5e86b363879c60..2057c3376397b60fce660b5311c7b3b89a75d7e8 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaAnalysisBaseTool.h +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaAnalysisBaseTool.h @@ -27,20 +27,16 @@ #include "xAODEgamma/ElectronAuxContainer.h" #include "xAODTrigRinger/TrigRingerRings.h" #include "xAODTrigRinger/TrigRingerRingsContainer.h" +#include "xAODTrigRinger/TrigRNNOutput.h" +#include "xAODTrigRinger/TrigRNNOutputContainer.h" #include "xAODTracking/TrackParticleContainer.h" #include "xAODTrigger/TrigPassBits.h" #include "xAODEgamma/PhotonAuxContainer.h" - -/* - Ringer offline to be include for future -///////////////////////////////////////////////////////// -#include "xAODCaloRings/RingSet.h" // -#include "xAODCaloRings/RingSetContainer.h" // -#include "xAODCaloRings/CaloRings.h" // -#include "xAODCaloRings/CaloRingsContainer.h" // -#include "xAODCaloRings/tools/getCaloRingsDecorator.h" // -///////////////////////////////////////////////////////// -*/ +#include "xAODCaloRings/RingSet.h" +#include "xAODCaloRings/RingSetContainer.h" +#include "xAODCaloRings/CaloRings.h" +#include "xAODCaloRings/CaloRingsContainer.h" +#include "xAODCaloRings/tools/getCaloRingsDecorator.h" class TrigEgammaAnalysisBaseTool : public asg::AsgTool, @@ -50,12 +46,12 @@ ASG_TOOL_CLASS(TrigEgammaAnalysisBaseTool, ITrigEgammaAnalysisBaseTool) public: TrigEgammaAnalysisBaseTool( const std::string& myname); - virtual ~TrigEgammaAnalysisBaseTool() {}; + ~TrigEgammaAnalysisBaseTool() {}; - virtual StatusCode initialize() override; - virtual StatusCode book() override; - virtual StatusCode execute() override; - virtual StatusCode finalize() override; + StatusCode initialize() ; + StatusCode book() ; + StatusCode execute() ; + StatusCode finalize() ; template<class T, class B> std::unique_ptr<xAOD::TrigPassBits> createBits(const T* CONT, const B* BITS); template<class T> std::unique_ptr<xAOD::TrigPassBits> getBits(const HLT::TriggerElement* te,const T* CONT); template<class T> const T* getFeature(const HLT::TriggerElement* te,const std::string key=""); @@ -63,15 +59,18 @@ public: template <class T1, class T2> const T1* closestObject(const std::pair<const xAOD::Egamma *, const HLT::TriggerElement *>, float &, bool usePassbits=true,const std::string key=""); // Interface class methods needed to pass information to additional tools or to set common tools - virtual void setParent(IHLTMonTool *parent) override { m_parent = parent;}; - virtual void setPlotTool(ToolHandle<ITrigEgammaPlotTool> tool) override {m_plot=tool;} - virtual void setDetail(bool detail) override {m_detailedHists=detail;} - virtual void setTP(bool tp) override {m_tp=tp;} - virtual void setEmulation(bool doEmu) override {m_doEmulation=doEmu;} - virtual void setEmulationTool(ToolHandle<Trig::ITrigEgammaEmulationTool> tool) override {m_emulationTool=tool;} - virtual void setPVertex(const float onvertex, const float ngoodvertex) override {m_nPVertex = onvertex; m_nGoodVertex = ngoodvertex;} - virtual void setAvgMu(const float onlmu, const float offmu) override {m_onlmu=onlmu; m_offmu=offmu;} //For tools called by tools - + void setParent(IHLTMonTool *parent) { m_parent = parent;}; + void setPlotTool(ToolHandle<ITrigEgammaPlotTool> tool) {m_plot=tool;} + void setDetail(bool detail) {m_detailedHists=detail;} + void setTP(bool tp) {m_tp=tp;} + void setEmulation(bool doEmu) {m_doEmulation=doEmu;} + void setEmulationTool(ToolHandle<Trig::ITrigEgammaEmulationTool> tool) {m_emulationTool=tool;} + void setPVertex(const float onvertex, const float ngoodvertex) {m_nPVertex = onvertex; m_nGoodVertex = ngoodvertex;} + void setAvgMu(const float onlmu, const float offmu) {m_onlmu=onlmu; m_offmu=offmu;} //For tools called by tools + + void setSGContainsRnn(bool contains) {m_sgContainsRnn=contains;} + void setSGContainsTrigPhoton(bool contains) {m_sgContainsTrigPhoton=contains;} + // Set current MonGroup void cd(const std::string &dir); // Accessor members @@ -112,7 +111,10 @@ private: float m_offmu; float m_nGoodVertex; float m_nPVertex; - + + /*! Hook to check for RNN features in SG */ + bool m_sgContainsRnn; + bool m_sgContainsTrigPhoton; // Properties ToolHandle<Trig::TrigDecisionTool> m_trigdec; ToolHandle<Trig::ITrigEgammaMatchingTool> m_matchTool; @@ -137,6 +139,8 @@ protected: void bookAnalysisHistos(const std::string); void setTrigInfo(const std::string); + void setTrigEmulation(){m_forceTrigEmulation=true;}; + TrigInfo getTrigInfo(const std::string); std::map<std::string,TrigInfo> getTrigInfoMap() { return m_trigInfo; } @@ -169,7 +173,11 @@ protected: float getNPVtx(){return m_nPVertex;} float getNGoodVertex(){return m_nGoodVertex;} - /* trig rings and offline rings helper method for feature extraction from xaod */ + /* Protection for Holders not in AOD */ + bool getSGContainsRnn() { return m_sgContainsRnn;} + bool getSGContainsTrigPhoton() { return m_sgContainsTrigPhoton;} + + /* trig rings and offline rings helper method for feature extraction from xaod */ bool getCaloRings( const xAOD::Electron *, std::vector<float> & ); bool getTrigCaloRings( const xAOD::TrigEMCluster *, std::vector<float> & ); void parseCaloRingsLayers( unsigned layer, unsigned &minRing, unsigned &maxRing, std::string &caloLayerName); @@ -213,6 +221,11 @@ protected: bool m_tp; /*! Emulation Analysis */ bool m_doEmulation; + /*! force emulation trigger */ + bool m_forceTrigEmulation; + /* force trigger attachment into the list */ + bool m_forceTrigAttachment; + // Infra-structure members std::string m_file; /*! String for offline container key */ diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaDistTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaDistTool.h index 56a0eeb5119e60d389dc1f9262b6dc3b77b3a1f4..24d996c39876363fa9bca776b08977f2671d4735 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaDistTool.h +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaDistTool.h @@ -27,13 +27,12 @@ public: protected: private: /*! fill kinematic histograms, et,eta,phi,lumi and efficiency */ - void fillShowerShapes(const std::string, const xAOD::Egamma *); // Online and Offline fillers - void fillTracking(const std::string, const xAOD::Electron *); // Online and Offline fillers - void fillEFCalo(const std::string,const xAOD::CaloCluster *); - void fillL2Electron(const std::string,const xAOD::TrigElectron *); - void fillL2Calo(const std::string,const xAOD::TrigEMCluster *); - void fillRinger(const std::string,const xAOD::TrigEMCluster *); - void fillL1Calo(const std::string,const xAOD::EmTauRoI *); + void fillShowerShapes(const std::string &, const xAOD::Egamma *); // Online and Offline fillers + void fillTracking(const std::string &, const xAOD::Electron *); // Online and Offline fillers + void fillEFCalo(const std::string &,const xAOD::CaloCluster *); + void fillL2Electron(const std::string &,const xAOD::TrigElectron *); + void fillL2Calo(const std::string &,const xAOD::TrigEMCluster *); + void fillL1Calo(const std::string &,const xAOD::EmTauRoI *); /*! Include more detailed histograms */ bool m_detailedHists; }; diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaEventSelection.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaEventSelection.h new file mode 100644 index 0000000000000000000000000000000000000000..eb112b0d1a4a571e8d52a7f94788e6d52eee4ea7 --- /dev/null +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaEventSelection.h @@ -0,0 +1,118 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef TRIGEGAMMAANALYSISTOOLS_TRIGEGAMMANAVTPNTUPLE_H +#define TRIGEGAMMAANALYSISTOOLS_TRIGEGAMMANAVTPNTUPLE_H + +#include "TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h" +#include "TrigEgammaAnalysisTools/TrigEgammaPhysValBase.h" +#include "xAODTracking/TrackParticle.h" +#include "xAODTracking/Vertex.h" +#include "xAODEventInfo/EventInfo.h" +#include "xAODEgamma/EgammaEnums.h" +#include "xAODTracking/TrackingPrimitives.h" +#include <map> + +class TrigEgammaEventSelection : public TrigEgammaNavTPBaseTool, public TrigEgammaPhysValBase, + virtual public ITrigEgammaAnalysisBaseTool +{ + ASG_TOOL_CLASS(TrigEgammaEventSelection, ITrigEgammaAnalysisBaseTool) + + public: + + TrigEgammaEventSelection( const std::string& myname ); + ~TrigEgammaEventSelection() {}; + StatusCode childInitialize(); + StatusCode childBook(); + StatusCode childExecute(); + StatusCode childFinalize(); + + private: + + /* Dump trigger and offline probe object */ + bool EventSelectionZ(); + bool EventSelectionFakes(); + + bool ApplyFireTriggers( const xAOD::Electron *el); + bool isTruthElectronAny(const xAOD::Egamma *eg ); + + bool fill(TTree *t, const xAOD::Electron *el ); + + /* parse between objects and local variables connected to the + * ttree pointer */ + bool fillEvent ( ); + bool fillMonteCarlo ( const xAOD::Egamma *eg ); + bool fillElectron ( const xAOD::Electron *el ); + bool fillCaloRings ( const xAOD::Electron *el ); + bool fillEmTauRoI ( const xAOD::EmTauRoI *emTauRoI ); + bool fillTrigEMCluster( const xAOD::TrigEMCluster *emCluster ); + bool fillTrigElectron ( const xAOD::TrigElectron *trigEl ); + bool fillCaloCluster ( const xAOD::CaloCluster *cluster ); + bool fillAccept ( const HLT::TriggerElement * ); + bool fillTrigCaloRings( const HLT::TriggerElement *feat ); + bool fillHLTElectron ( const xAOD::Electron *el ); + bool fillTDT ( const xAOD::Electron *el , const HLT::TriggerElement *te ); + + // Helper methods + double get_el_sigd0(const xAOD::Electron *el); + double get_el_d0(const xAOD::Electron *el); + double get_el_eProbabilityHT(const xAOD::Electron *el); + double get_el_transformed_eProbabilityHT(const xAOD::Electron *el); + double get_el_d0significance(const xAOD::Electron *el); + double get_el_deltaPhiRescaled2(const xAOD::Electron *el); + double get_el_deltaEta1(const xAOD::Electron *el); + double get_el_DeltaPOverP(const xAOD::Electron *el); + + + private: + + std::map<std::string, unsigned >m_countMap; + + void count( std::string key ){ + if(m_countMap.find(key) == m_countMap.end()){ + m_countMap[key]= 1; + }else{ + m_countMap[key]++; + } + } + + + + + ToolHandleArray<IAsgElectronIsEMSelector> m_EFCaloElectronIsEMSelectors; + ToolHandleArray<IAsgElectronIsEMSelector> m_HLTElectronIsEMSelectors; + ToolHandleArray<IAsgElectronLikelihoodTool> m_EFCaloElectronLHSelectors; + ToolHandleArray<IAsgElectronLikelihoodTool> m_HLTElectronLHSelectors; + ToolHandle<IAsgElectronLikelihoodTool> m_electronLHVLooseTool; + + std::vector<std::string> m_supportingTrigList; + int m_detailedDataLevel; + bool m_selectionZ; + bool m_selectionW; + bool m_selectionMC; + bool m_selectionJpsi; + bool m_selectionFakes; + bool m_doCaloRings; + bool m_dumpTags; + +#define GETTER(_name_) void get_##_name_(const xAOD::Electron*, float); + GETTER(trig_EF_calo_isLHTightCaloOnly_rel21_20170217 ) + GETTER(trig_EF_calo_isLHMediumCaloOnly_rel21_20170217) + GETTER(trig_EF_calo_isLHLooseCaloOnly_rel21_20170217 ) + GETTER(trig_EF_calo_isLHVLooseCaloOnly_rel21_20170217) + GETTER(trig_EF_el_isLHTight_rel21_20170217 ) + GETTER(trig_EF_el_isLHMedium_rel21_20170217) + GETTER(trig_EF_el_isLHLoose_rel21_20170217 ) + GETTER(trig_EF_el_isLHVLoose_rel21_20170217) + GETTER(trig_EF_el_isLHTightNoD0_rel21_20170217 ) + GETTER(trig_EF_el_isLHMediumNoD0_rel21_20170217) + GETTER(trig_EF_el_isLHLooseNoD0_rel21_20170217 ) + GETTER(trig_EF_el_isLHVLooseNoD0_rel21_20170217) +#undef GETTER + + +}; + + + +#endif diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaInfo.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaInfo.h index b977da3bd5acd45f4af971f1fb16d443b2acbd51..8f6e1f62c7a2f9d1b7f74ca9a7e3a2a35bd1c7df 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaInfo.h +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaInfo.h @@ -16,6 +16,7 @@ typedef struct _triginfo bool trigEtcut; // Et cut only chain float trigThrHLT; // HLT Et threshold float trigThrL1; // L1 Et threshold + bool trigIsEmulation; } TrigInfo; // Enums diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h index 850ed18d98bd213822bbd8bbcc3d891768e8324b..9952cbcdc6ed932c6097a8d0f830542af00eb667 100755 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h @@ -26,6 +26,8 @@ #include "xAODTracking/TrackParticleContainer.h" #include "xAODTracking/TrackParticleAuxContainer.h" #include "xAODTrigCalo/TrigEMCluster.h" +#include "xAODTrigRinger/TrigRNNOutput.h" +#include "xAODTrigRinger/TrigRNNOutputContainer.h" #include "xAODCaloEvent/CaloClusterContainer.h" #include "xAODCaloEvent/CaloClusterAuxContainer.h" #include "xAODJet/JetContainer.h" diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavNtuple.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavNtuple.h deleted file mode 100755 index 4383d5db040eb9a4038318c750247bd5df56f42c..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavNtuple.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - - -#ifndef TRIGEGAMMAANALYSISTOOLS_TRIGEGAMMANAVNTUPLE_H -#define TRIGEGAMMAANALYSISTOOLS_TRIGEGAMMANAVNTUPLE_H - -#include "TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h" -#include "xAODTruth/TruthParticle.h" -#include "xAODTruth/TruthParticleContainer.h" -#include "xAODEventInfo/EventInfo.h" -#include "xAODEgamma/EgammaEnums.h" -#include "xAODTracking/TrackingPrimitives.h" - -class TrigEgammaNavNtuple : public TrigEgammaNavBaseTool, - virtual public ITrigEgammaAnalysisBaseTool -{ - ASG_TOOL_CLASS(TrigEgammaNavNtuple, ITrigEgammaAnalysisBaseTool) - - public: - - TrigEgammaNavNtuple( const std::string& myname ); - ~TrigEgammaNavNtuple() {}; - StatusCode childInitialize (); - StatusCode childBook(); - StatusCode childExecute(); - StatusCode childFinalize(); - - private: - - /* Dump offline photons */ - bool executePhotonDump(); - /* Dump offline electrons */ - bool executeElectronDump(); - /* Dump Trigger, electron and photons matched with the trigger object */ - bool executeTrigItemDump(); - /* Dump using trigger supports */ - bool executeTrigSupportDump(); - - - /* helper function */ - template <class T> void InitBranch(TTree* fChain, std::string branch_name, T* param, bool message = true); - - unsigned count_HLT_objects(const HLT::TriggerElement *); - - /* Create branches */ - void bookEventBranches( TTree *t ); - void bookElectronBranches( TTree *t ); - //void bookPhotonBranches( TTree *t ); - void bookTriggerBranches( TTree *t ); - void bookMonteCarloBranches( TTree *t ); - - /* uses InitBranch to connect the local variable and ttree pointer */ - void linkEventBranches( TTree *t); - void linkElectronBranches( TTree *t); - //void linkPhotonBranches( TTree *t); - void linkTriggerBranches( TTree *t); - void linkMonteCarloBranches( TTree *t); - - /* parse between objects and local variables connected to the - * ttree pointer */ - bool fillEvent ( ); - bool fillMonteCarlo ( const xAOD::Egamma *eg ); - bool fillElectron ( const xAOD::Electron *el ); - //bool fillPhoton ( const xAOD::Photon *ph ); - - bool fillCaloRings ( const xAOD::Electron *el ); - bool fillTrigCaloRings( const xAOD::TrigEMCluster *emCluster ); - bool fillEmTauRoI ( const xAOD::EmTauRoI *emTauRoI ); - bool fillTrigEMCluster( const xAOD::TrigEMCluster *emCluster ); - bool fillTrigElectron ( const xAOD::TrigElectron *trigEl ); - bool fillCaloCluster ( const xAOD::CaloCluster *cluster ); - - /* Space memory manager */ - void alloc_space(); - void release_space(); - void clear(); - - - - private: - - /* Offline variables only */ - bool m_doOfflineDump; - bool m_doSupport; - bool m_forceMCMatch; - float m_minEt; // default is -1 - - /* Branch variables */ - uint32_t m_runNumber{}; - unsigned long long m_eventNumber{}; - unsigned int m_eventCounter{}; - float m_avgmu{}; - - /* Egamma */ - float m_el_et{}; - float m_el_pt{}; - float m_el_eta{}; - float m_el_phi{}; - float m_el_ethad1{}; - float m_el_ehad1{}; - float m_el_f1{}; - float m_el_f3{}; - float m_el_d0{}; - float m_el_f1core{}; - float m_el_f3core{}; - float m_el_weta2{}; - float m_el_wtots1{}; - float m_el_fracs1{}; - float m_el_Reta{}; - float m_el_Rphi{}; - float m_el_Eratio{}; - float m_el_Rhad{}; - float m_el_Rhad1{}; - float m_el_deta1{}; - float m_el_deta2{}; - float m_el_dphi2{}; - float m_el_dphiresc{}; - float m_el_dphiresc2{}; - float m_el_eprobht{}; - float m_el_charge{}; - uint8_t m_el_nblayerhits{}; - uint8_t m_el_nblayerolhits{}; - uint8_t m_el_npixhits{}; - uint8_t m_el_npixolhits{}; - uint8_t m_el_nscthits{}; - uint8_t m_el_nsctolhits{}; - uint8_t m_el_ntrthightreshits{}; - uint8_t m_el_ntrthits{}; - uint8_t m_el_ntrthighthresolhits{}; - uint8_t m_el_ntrtolhits{}; - uint8_t m_el_ntrtxenonhits{}; - bool m_el_expectblayerhit{}; - uint8_t m_el_nsihits{} ; - uint8_t m_el_nsideadsensors{} ; - uint8_t m_el_npixdeadsensors{} ; - uint8_t m_el_nsctdeadsensors{} ; - bool m_el_loose{}; - bool m_el_medium{}; - bool m_el_tight{}; - bool m_el_lhLoose{}; - bool m_el_lhMedium{}; - bool m_el_lhTight{}; - bool m_el_rgLoose{}; - bool m_el_rgMedium{}; - bool m_el_rgTight{}; - bool m_el_multiLepton{}; - std::vector<float> *m_el_ringsE; - int m_el_nGoodVtx{}; - int m_el_nPileupPrimaryVtx{}; - ///Egamma Calo - float m_calo_et{}; - float m_calo_eta{}; - float m_calo_phi{}; - - // Level 1 - float m_trig_L1_eta{}; - float m_trig_L1_phi{}; - float m_trig_L1_emClus{}; - float m_trig_L1_tauClus{}; - float m_trig_L1_emIsol{}; - float m_trig_L1_hadIsol{}; - std::vector<std::string> *m_trig_L1_thrNames; - bool m_trig_L1_accept{}; - // Level 2 Calo - float m_trig_L2_calo_et{}; - float m_trig_L2_calo_eta{}; - float m_trig_L2_calo_phi{}; - float m_trig_L2_calo_e237{}; - float m_trig_L2_calo_e277{}; - float m_trig_L2_calo_fracs1{}; - float m_trig_L2_calo_weta2{}; - float m_trig_L2_calo_ehad1{}; - float m_trig_L2_calo_emaxs1{}; - float m_trig_L2_calo_e2tsts1{}; - float m_trig_L2_calo_wstot{}; - float m_trig_L2_calo_rnnOutput{}; - std::vector<float> *m_trig_L2_calo_energySample; - std::vector<float> *m_trig_L2_calo_rings; - bool m_trig_L2_calo_accept{}; - // level 2 id - std::vector<int> *m_trig_L2_el_trackAlgID; - std::vector<float> *m_trig_L2_el_pt; - std::vector<float> *m_trig_L2_el_caloEta; - std::vector<float> *m_trig_L2_el_eta; - std::vector<float> *m_trig_L2_el_phi; - std::vector<float> *m_trig_L2_el_charge; - std::vector<float> *m_trig_L2_el_nTRTHits; - std::vector<float> *m_trig_L2_el_nTRTHiThresholdHits; - std::vector<float> *m_trig_L2_el_etOverPt; - std::vector<float> *m_trig_L2_el_trkClusDeta; - std::vector<float> *m_trig_L2_el_trkClusDphi; - bool m_trig_L2_el_accept{}; - // Level EF - bool m_trig_EF_calo_accept{}; - std::vector<float> *m_trig_EF_calo_et; - std::vector<float> *m_trig_EF_calo_eta; - bool m_trig_EF_el_accept{}; - - - // Monte Carlo - bool m_mc_hasMC{} ; - float m_mc_pt{} ; - float m_mc_eta{} ; - float m_mc_phi{} ; - bool m_mc_isTop{} ; - bool m_mc_isParton{} ; - bool m_mc_isMeson{} ; - bool m_mc_isQuark{} ; - bool m_mc_isTau{} ; - bool m_mc_isMuon{} ; - bool m_mc_isPhoton{} ; - bool m_mc_isElectron{}; - bool m_mc_hasZMother{}; - bool m_mc_hasWMother{}; - -}; - - -#endif diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h index 317521db5d47f6ac02bc32ebd26abb8ec1f37e78..aa6a54f060ec62062a82269b26b8afee1a1e8b00 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h @@ -1,7 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ - #ifndef TrigEgammaNavTPBaseTool_H #define TrigEgammaNavTPBaseTool_H @@ -25,9 +24,12 @@ #include "xAODTracking/TrackParticleContainer.h" #include "xAODTracking/TrackParticleAuxContainer.h" #include "xAODTrigCalo/TrigEMCluster.h" +#include "xAODTrigRinger/TrigRNNOutput.h" +#include "xAODTrigRinger/TrigRNNOutputContainer.h" #include "xAODCaloEvent/CaloClusterContainer.h" #include "xAODCaloEvent/CaloClusterAuxContainer.h" #include "xAODJet/JetContainer.h" +#include "xAODMissingET/MissingETContainer.h" #include "xAODTrigger/EmTauRoIContainer.h" #include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h" #include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h" @@ -37,125 +39,139 @@ namespace Trig{ class FeatureContainer; } -class TrigEgammaNavTPBaseTool -: public TrigEgammaAnalysisBaseTool, +class TrigEgammaNavTPBaseTool: public TrigEgammaAnalysisBaseTool, virtual public ITrigEgammaAnalysisBaseTool { ASG_TOOL_CLASS(TrigEgammaNavTPBaseTool, ITrigEgammaAnalysisBaseTool) -public: - - TrigEgammaNavTPBaseTool( const std::string& myname ); - ~TrigEgammaNavTPBaseTool() {}; - - StatusCode childInitialize(); - StatusCode childBook(); - StatusCode childExecute(); - StatusCode childFinalize(); -protected: - /*! things like LAr-error, Tile-error, etc, should come here */ - bool EventWiseSelection(); - /*! at least one chain should pass. e28_tight_iloose? */ - bool MinimalTriggerRequirement (); - /*! Tag and Probe method called by derived classes */ - void executeTandP(); - /*! Match probes called by derived classes */ - void matchObjects(const std::string trigItem); - /*! Tag Electron selection */ - bool isTagElectron(const xAOD::Electron *el); - /*! Rerun offline selection */ - bool ApplyElectronPid(const xAOD::Electron *eg,const std::string); - /*! Rerun offline selection */ - void DressPid(const xAOD::Electron *eg); - /*! Probe selection */ - bool isGoodProbeElectron(const xAOD::Electron *el);//,const std::string,const float,const std::string); - /*! Event-wise trigger selection */ - bool passedTrigger(const HLT::TriggerElement* obj); - /*! Clears list of probes after each trigger item per event */ - void clearProbeList(); - /*! Clears list of matched probes after each trigger item per event */ - void clearPairList(); - /* Clears decorations offline objects */ - void clearDecorations(); - /*! Return pseudo-lifetime of Jpsi */ - float GetPseudoLifetime(const xAOD::Electron*,const xAOD::Electron*); - /*! Calculate the displacement of the Jpsi vertex w.r.t. the primary vertex in the transverse plane */ - double simple_lxy(int ,double, double, double , double , double , double , double, double ); - /*! vector of electron probes */ - std::vector<const xAOD::Electron*> m_probeElectrons; - /*! vector of photon probes */ - std::vector<const xAOD::Photon*> m_probePhotons; - /*! vector of offline electron probe and matched TE */ - std::vector<std::pair<const xAOD::Egamma*,const HLT::TriggerElement*> > m_pairObj; - /* vector of offline photon probe and matched TE */ - //std::vector<std::pair<const xAOD::Photon*,const HLT::TriggerElement*> > m_probePhotons; - /*! List of triggers from menu */ - std::vector<std::string> m_trigInputList; - /*! List of trigger categories for MaM */ - std::vector<std::string> m_categories; - /*! List of triggers to study */ - std::vector<std::string> m_trigList; - /*! Zee lower mass cut */ - float m_ZeeMassMin; - /*! Zee upper mass cut */ - float m_ZeeMassMax; - /*! Remove crack region for Probe default True */ - bool m_rmCrack; - /*! Directory name for each algorithm */ - std::string m_dir; - /*! Directory name for each algorithm */ - std::string m_anatype; + public: - const xAOD::EventInfo* m_eventInfo; - const xAOD::TruthParticleContainer* m_truthContainer; - - -private: - // ToolHandles - // - //Offline ++ selectors - // In python order will matter. Should always be tight, medium, loose - // Order no longer important since using a map - ///*! Offline isEM Selectors */ - ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMTool; - /*! Offline LH Selectors */ - ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHTool; + TrigEgammaNavTPBaseTool( const std::string& myname ); + ~TrigEgammaNavTPBaseTool() {}; + + StatusCode childInitialize(); + StatusCode childBook(); + StatusCode childExecute(); + StatusCode childFinalize(); + + protected: + + /*! things like LAr-error, Tile-error, etc, should come here */ + bool EventWiseSelection(); + /*! pass without detector errors */ + bool passesEventCleaning(); + /*! at least one chain should pass. e28_tight_iloose? */ + bool MinimalTriggerRequirement (); + /*! Tag and Probe method called by derived classes */ + void executeTandP(); + /*! Match probes called by derived classes */ + void matchObjects(const std::string trigItem); + /*! Tag Electron selection */ + bool isTagElectron(const xAOD::Electron *el); + /*! Rerun offline selection */ + bool ApplyElectronPid(const xAOD::Electron *eg,const std::string); + /*! Rerun offline selection */ + void DressPid(const xAOD::Electron *eg); + /*! Probe selection */ + bool isGoodProbeElectron(const xAOD::Electron *el);//,const std::string,const float,const std::string); + /*! Event-wise trigger selection */ + bool passedTrigger(const HLT::TriggerElement* obj); + /*! Clears list of probes after each trigger item per event */ + void clearProbeList(); + /*! Clears list of matched probes after each trigger item per event */ + void clearPairList(); + /* Clears decorations offline objects */ + void clearDecorations(); + /*! Return pseudo-lifetime of Jpsi */ + float GetPseudoLifetime(const xAOD::Electron*,const xAOD::Electron*); + /*! Calculate the displacement of the Jpsi vertex w.r.t. the primary vertex in the transverse plane */ + double simple_lxy(int ,double, double, double , double , double , double , double, double ); + /*! get the W mass */ + float getWTransverseMass( const xAOD::Electron *el ); + /*! Return MissingEt obj */ + const xAOD::MissingET* getMET(){ + return (*m_METContainer)["FinalClus"]; + } - std::map< std::string, unsigned int > m_PidToolMap; /*! Pass a string to pick up correct selector */ - //std::map< std::string, std::string > m_PidMap; /*! Map trigger pid to selector pid */ - // - /*! Event Wise offline ElectronContainer Access and end iterator */ - const xAOD::ElectronContainer* m_offElectrons; - /*! Jet container for probe selection */ - const xAOD::JetContainer* m_jets; - /* TP selection properties */ + /*! The pair index for each electron */ + std::vector<std::pair<unsigned,unsigned>> m_Z; + /*! vector of electron probes */ + std::vector<const xAOD::Electron*> m_probeElectrons; + /*! vector of photon probes */ + std::vector<const xAOD::Photon*> m_probePhotons; + /*! vector of offline electron probe and matched TE */ + std::vector<std::pair<const xAOD::Egamma*,const HLT::TriggerElement*> > m_pairObj; + /* vector of offline photon probe and matched TE */ + //std::vector<std::pair<const xAOD::Photon*,const HLT::TriggerElement*> > m_probePhotons; + /*! List of triggers from menu */ + std::vector<std::string> m_trigInputList; + /*! List of trigger categories for MaM */ + std::vector<std::string> m_categories; + /*! List of triggers to study */ + std::vector<std::string> m_trigList; + /*! Zee lower mass cut */ + float m_ZeeMassMin; + /*! Zee upper mass cut */ + float m_ZeeMassMax; + /*! Remove crack region for Probe default True */ + bool m_rmCrack; + /*! Enable the requirement of triggers */ + bool m_applyMinimalTrigger; + /*! Directory name for each algorithm */ + std::string m_dir; + /*! Directory name for each algorithm */ + std::string m_anatype; + /*! Select opposite or same-sign pairs -- for background studies */ + bool m_oppositeCharge; + /*! Minimum tag Et */ + float m_tagMinEt; + /*! Minimum probe Et */ + float m_probeMinEt; + + // Containers + /*! Event Wise offline ElectronContainer Access and end iterator */ + const xAOD::ElectronContainer* m_offElectrons; + /*! Jet container for probe selection */ + const xAOD::JetContainer* m_jets; + /*! Missing Et container */ + const xAOD::MissingETContainer* m_METContainer; + /*! EventInfo Container */ + const xAOD::EventInfo* m_eventInfo; + /* Truth Container */ + const xAOD::TruthParticleContainer* m_truthContainer; - /*! Not needed */ - // unsigned int m_isEMoffTag; - /*! Define the PID for tag electron */ - std::string m_offTagTightness; - /*! define the Pid of Probe from the trigger name */ - std::string m_offProbeTightness; - /*! define the Pid of Probe from the user */ - std::string m_defaultProbeTightness; - /*! force user defined probe for pid triggers */ - bool m_forceProbePid; - /*! Select opposite or same-sign pairs -- for background studies */ - bool m_oppositeCharge; - /*! Minimum tag Et */ - float m_tagMinEt; - /*! Minimum probe Et */ - float m_probeMinEt; - /*! Trigger for tag and event wise selection */ - std::vector<std::string> m_tagTrigList; - /*! Apply nearby jet selection */ - bool m_applyJetNearProbeSelection; - /*! force probe isolation */ - bool m_forceProbeIsolation; - /*! Define isolation working point for Probe electron */ - std::string m_offProbeIsolation; - /*! skip trigger for offline Tag and Probe analysis */ - bool m_skipTrigger; + private: + // In python order will matter. Should always be tight, medium, loose + // Order no longer important since using a map + ///*! Offline isEM Selectors */ + ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMTool; + /*! Offline LH Selectors */ + ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHTool; + + std::map< std::string, unsigned int > m_PidToolMap; /*! Pass a string to pick up correct selector */ + //std::map< std::string, std::string > m_PidMap; /*! Map trigger pid to selector pid */ + + /* TP selection properties */ + /*! Not needed */ + // unsigned int m_isEMoffTag; + /*! Define the PID for tag electron */ + std::string m_offTagTightness; + /*! define the Pid of Probe from the trigger name */ + std::string m_offProbeTightness; + /*! define the Pid of Probe from the user */ + std::string m_defaultProbeTightness; + /*! force user defined probe for pid triggers */ + bool m_forceProbePid; + /*! Trigger for tag and event wise selection */ + std::vector<std::string> m_tagTrigList; + /*! Apply nearby jet selection */ + bool m_applyJetNearProbeSelection; + /*! force probe isolation */ + bool m_forceProbeIsolation; + /*! Define isolation working point for Probe electron */ + std::string m_offProbeIsolation; + /*! skip trigger for offline Tag and Probe analysis */ + bool m_skipTrigger; }; #endif diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPNtuple.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPNtuple.h deleted file mode 100755 index cfe8b5a74cec06131cf3851270c4ea7b6bb1464f..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaNavTPNtuple.h +++ /dev/null @@ -1,220 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TRIGEGAMMAANALYSISTOOLS_TRIGEGAMMANAVTPNTUPLE_H -#define TRIGEGAMMAANALYSISTOOLS_TRIGEGAMMANAVTPNTUPLE_H - -#include "TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h" -#include "xAODTracking/TrackParticle.h" -#include "xAODTracking/Vertex.h" -#include "xAODEventInfo/EventInfo.h" -#include "xAODEgamma/EgammaEnums.h" -#include "xAODTracking/TrackingPrimitives.h" - -class TrigEgammaNavTPNtuple : public TrigEgammaNavTPBaseTool, - virtual public ITrigEgammaAnalysisBaseTool -{ - ASG_TOOL_CLASS(TrigEgammaNavTPNtuple, ITrigEgammaAnalysisBaseTool) - - public: - - TrigEgammaNavTPNtuple( const std::string& myname ); - ~TrigEgammaNavTPNtuple() {}; - StatusCode childInitialize(); - StatusCode childBook(); - StatusCode childExecute(); - StatusCode childFinalize(); - - private: - - /* Dump trigger and offline probe object */ - bool executeProbesDump(); - bool executeProbesSupportDump(); - bool executeProbesItemDump(); - - - /* helper function */ - template <class T> void InitBranch(TTree* fChain, std::string branch_name, T* param, bool message = true); - - unsigned count_HLT_objects(const HLT::TriggerElement *); - - /* Create branches */ - void bookEventBranches( TTree *t ); - void bookElectronBranches( TTree *t ); - //void bookPhotonBranches( TTree *t ); - void bookTriggerBranches( TTree *t ); - void bookMonteCarloBranches( TTree *t ); - - /* uses InitBranch to connect the local variable and ttree pointer */ - void linkEventBranches( TTree *t); - void linkElectronBranches( TTree *t); - void linkPhotonBranches( TTree *t); - void linkTriggerBranches( TTree *t); - void linkMonteCarloBranches( TTree *t); - - /* parse between objects and local variables connected to the - * ttree pointer */ - bool fillEvent ( ); - bool fillMonteCarlo ( const xAOD::Egamma *eg ); - bool fillElectron ( const xAOD::Electron *el ); - //bool fillPhoton ( const xAOD::Photon *ph ); - - bool fillCaloRings ( const xAOD::Electron *el ); - bool fillTrigCaloRings( const xAOD::TrigEMCluster *emCluster ); - bool fillEmTauRoI ( const xAOD::EmTauRoI *emTauRoI ); - bool fillTrigEMCluster( const xAOD::TrigEMCluster *emCluster ); - bool fillTrigElectron ( const xAOD::TrigElectron *trigEl ); - bool fillCaloCluster ( const xAOD::CaloCluster *cluster ); - - - /* Space memory manager */ - void alloc_space(); - void release_space(); - void clear(); - - - private: - - - /* Offline variables only */ - bool m_doOfflineDump; - /* Support triggers dump */ - bool m_doSupport; - float m_probeMinEt; - - /* Branch variables */ - uint32_t m_runNumber{}; - unsigned long long m_eventNumber{}; - unsigned int m_eventCounter{}; - float m_avgmu{}; - /* Egamma */ - float m_el_et{}; - float m_el_pt{}; - float m_el_eta{}; - float m_el_phi{}; - float m_el_ethad1{}; - float m_el_ehad1{}; - float m_el_f1{}; - float m_el_f3{}; - float m_el_d0{}; - float m_el_f1core{}; - float m_el_f3core{}; - float m_el_weta2{}; - float m_el_wtots1{}; - float m_el_fracs1{}; - float m_el_Reta{}; - float m_el_Rphi{}; - float m_el_Eratio{}; - float m_el_Rhad{}; - float m_el_Rhad1{}; - float m_el_deta1{}; - float m_el_deta2{}; - float m_el_dphi2{}; - float m_el_dphiresc{}; - float m_el_dphiresc2{}; - float m_el_eprobht{}; - float m_el_charge{}; - uint8_t m_el_nblayerhits{}; - uint8_t m_el_nblayerolhits{}; - uint8_t m_el_npixhits{}; - uint8_t m_el_npixolhits{}; - uint8_t m_el_nscthits{}; - uint8_t m_el_nsctolhits{}; - uint8_t m_el_ntrthightreshits{}; - uint8_t m_el_ntrthits{}; - uint8_t m_el_ntrthighthresolhits{}; - uint8_t m_el_ntrtolhits{}; - uint8_t m_el_ntrtxenonhits{}; - bool m_el_expectblayerhit{}; - uint8_t m_el_nsihits{} ; - uint8_t m_el_nsideadsensors{} ; - uint8_t m_el_npixdeadsensors{} ; - uint8_t m_el_nsctdeadsensors{} ; - bool m_el_loose{}; - bool m_el_medium{}; - bool m_el_tight{}; - bool m_el_lhLoose{}; - bool m_el_lhMedium{}; - bool m_el_lhTight{}; - bool m_el_rgLoose{}; - bool m_el_rgMedium{}; - bool m_el_rgTight{}; - bool m_el_multiLepton{}; - std::vector<float> *m_el_ringsE; - int m_el_nGoodVtx{}; - int m_el_nPileupPrimaryVtx{}; - ///Egamma Calo - float m_calo_et{}; - float m_calo_eta{}; - float m_calo_phi{}; - - // Level 1 - float m_trig_L1_eta{}; - float m_trig_L1_phi{}; - float m_trig_L1_emClus{}; - float m_trig_L1_tauClus{}; - float m_trig_L1_emIsol{}; - float m_trig_L1_hadIsol{}; - std::vector<std::string> *m_trig_L1_thrNames; - bool m_trig_L1_accept{}; - // Level 2 Calo - float m_trig_L2_calo_et{}; - float m_trig_L2_calo_eta{}; - float m_trig_L2_calo_phi{}; - float m_trig_L2_calo_e237{}; - float m_trig_L2_calo_e277{}; - float m_trig_L2_calo_fracs1{}; - float m_trig_L2_calo_weta2{}; - float m_trig_L2_calo_ehad1{}; - float m_trig_L2_calo_emaxs1{}; - float m_trig_L2_calo_e2tsts1{}; - float m_trig_L2_calo_wstot{}; - float m_trig_L2_calo_rnnOutput{}; - std::vector<float> *m_trig_L2_calo_energySample; - std::vector<float> *m_trig_L2_calo_rings; - bool m_trig_L2_calo_accept{}; - // level 2 id - std::vector<int> *m_trig_L2_el_trackAlgID; - std::vector<float> *m_trig_L2_el_pt; - std::vector<float> *m_trig_L2_el_caloEta; - std::vector<float> *m_trig_L2_el_eta; - std::vector<float> *m_trig_L2_el_phi; - std::vector<float> *m_trig_L2_el_charge; - std::vector<float> *m_trig_L2_el_nTRTHits; - std::vector<float> *m_trig_L2_el_nTRTHiThresholdHits; - std::vector<float> *m_trig_L2_el_etOverPt; - std::vector<float> *m_trig_L2_el_trkClusDeta; - std::vector<float> *m_trig_L2_el_trkClusDphi; - - - bool m_trig_L2_el_accept{}; - // Level EF - bool m_trig_EF_calo_accept{}; - std::vector<float> *m_trig_EF_calo_et; - std::vector<float> *m_trig_EF_calo_eta; - bool m_trig_EF_el_accept{}; - - - // Monte Carlo - bool m_mc_hasMC{} ; - float m_mc_pt{} ; - float m_mc_eta{} ; - float m_mc_phi{} ; - bool m_mc_isTop{} ; - bool m_mc_isQuark{} ; - bool m_mc_isParton{} ; - bool m_mc_isMeson{} ; - bool m_mc_isTau{} ; - bool m_mc_isMuon{} ; - bool m_mc_isPhoton{} ; - bool m_mc_isElectron{}; - bool m_mc_hasZMother{}; - bool m_mc_hasWMother{}; - - -}; - - - -#endif diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaPhysValBase.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaPhysValBase.h new file mode 100644 index 0000000000000000000000000000000000000000..6b77c0d095ad3a618aafaa64ea4996f86faa60e5 --- /dev/null +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaPhysValBase.h @@ -0,0 +1,276 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRIGEGAMMAANALYSISTOOLS_TRIGEGAMMAPHYSVALBASE_H +#define TRIGEGAMMAANALYSISTOOLS_TRIGEGAMMAPHYSVALBASE_H + +#include "xAODEventInfo/EventInfo.h" +#include "xAODTruth/TruthParticle.h" +#include "xAODTruth/TruthParticleContainer.h" +#include "xAODEventInfo/EventInfo.h" +#include "xAODEgamma/EgammaEnums.h" +#include "xAODTracking/TrackingPrimitives.h" +#include "TrigDecisionTool/TrigDecisionTool.h" +#include "TTree.h" + +class TrigEgammaPhysValBase +{ + public: + TrigEgammaPhysValBase(); + ~TrigEgammaPhysValBase() {}; + + protected: + /* helper function */ + template <class T> void InitBranch(TTree* fChain, std::string branch_name, T* param, bool message = true); + + /* Create branches */ + void bookEventBranches( TTree *t ); + void bookElectronBranches( TTree *t ); + void bookTriggerBranches( TTree *t ); + void bookMonteCarloBranches( TTree *t ); + void bookTDTBranches( TTree *t ); + + /* uses InitBranch to connect the local variable and ttree pointer */ + void linkEventBranches( TTree *t); + void linkElectronBranches( TTree *t); + void linkTriggerBranches( TTree *t); + void linkSelectorBranches( TTree *t); + void linkMonteCarloBranches( TTree *t); + void linkTDTBranches( TTree *t); + + /* Space memory manager */ + void alloc_space(); + void release_space(); + void clear(); + void createTDTMetadata( TTree *t, std::vector<std::string> trigList ); + + bool m_doMCDetailed; + bool m_doL2Detailed; + bool m_doL2CaloDetailed; + bool m_doRecoDetailed; + + /* Branch variables */ + uint32_t m_runNumber{}; + unsigned long long m_eventNumber{}; + unsigned int m_eventCounter{}; + float m_avgmu{}; + float m_lumiBlock{}; + + /* Egamma */ + + bool m_el_hasCalo ; + bool m_el_hasTrack ; + float m_el_e; + float m_el_et; + float m_el_eta; + float m_el_phi; + float m_el_ethad1; + float m_el_ehad1; + float m_el_f1; + float m_el_f3; + float m_el_f1core; + float m_el_f3core; + float m_el_weta1; + float m_el_weta2; + float m_el_wtots1; + float m_el_fracs1; + float m_el_Reta; + float m_el_Rphi; + float m_el_Eratio; + float m_el_Rhad; + float m_el_Rhad1; + float m_el_deta1; + float m_el_deta2; + float m_el_dphi2; + float m_el_dphiresc; + float m_el_deltaPhiRescaled2; + float m_el_deltaEta1; + float m_el_deltaE; + float m_el_e277; + std::vector<float> *m_el_etCone; + std::vector<float> *m_el_ptCone; + + + + float m_el_trk_pt; + float m_el_trk_eta; + float m_el_trk_charge; + float m_el_trk_sigd0; + float m_el_trk_d0; + float m_el_trk_eProbabilityHT; + float m_el_trk_transformed_eProbabilityHT; + float m_el_trk_d0significance; + float m_el_trk_deltaPOverP; + float m_el_trk_qOverP; + std::vector<uint8_t> *m_el_trk_summaryValues; + + bool m_el_loose{}; + bool m_el_medium{}; + bool m_el_tight{}; + bool m_el_lhVLoose{}; + bool m_el_lhLoose{}; + bool m_el_lhMedium{}; + bool m_el_lhTight{}; + bool m_el_rgLoose{}; + bool m_el_rgMedium{}; + bool m_el_rgTight{}; + bool m_el_multiLepton{}; + std::vector<float> *m_el_ringsE; + int m_el_nGoodVtx{}; + int m_el_nPileupPrimaryVtx{}; + ///Egamma Calo + float m_el_calo_et{}; + float m_el_calo_eta{}; + float m_el_calo_phi{}; + float m_el_calo_etaBE2{}; + float m_el_calo_e{}; + // Level 1 + float m_trig_L1_eta{}; + float m_trig_L1_phi{}; + float m_trig_L1_emClus{}; + float m_trig_L1_tauClus{}; + float m_trig_L1_emIsol{}; + float m_trig_L1_hadIsol{}; + float m_trig_L1_hadCore{}; + std::vector<std::string> *m_trig_L1_thrNames; + + // Level 2 Calo + float m_trig_L2_calo_et{}; + float m_trig_L2_calo_eta{}; + float m_trig_L2_calo_phi{}; + float m_trig_L2_calo_e237{}; + float m_trig_L2_calo_e277{}; + float m_trig_L2_calo_fracs1{}; + float m_trig_L2_calo_weta2{}; + float m_trig_L2_calo_ehad1{}; + float m_trig_L2_calo_emaxs1{}; + float m_trig_L2_calo_e2tsts1{}; + float m_trig_L2_calo_wstot{}; + float m_trig_L2_calo_nnOutput{}; + std::vector<float> *m_trig_L2_calo_energySample; + std::vector<float> *m_trig_L2_calo_rings; + std::vector<float> *m_trig_L2_calo_rnnOutput; + // level 2 id + std::vector<int> *m_trig_L2_el_trackAlgID; + std::vector<float> *m_trig_L2_el_pt; + std::vector<float> *m_trig_L2_el_caloEta; + std::vector<float> *m_trig_L2_el_eta; + std::vector<float> *m_trig_L2_el_phi; + std::vector<float> *m_trig_L2_el_charge; + std::vector<float> *m_trig_L2_el_nTRTHits; + std::vector<float> *m_trig_L2_el_nTRTHiThresholdHits; + std::vector<float> *m_trig_L2_el_etOverPt; + std::vector<float> *m_trig_L2_el_trkClusDeta; + std::vector<float> *m_trig_L2_el_trkClusDphi; + + // EFCalo and HLT steps + + std::vector<float> *m_trig_EF_calo_e; + std::vector<float> *m_trig_EF_calo_et; + std::vector<float> *m_trig_EF_calo_eta; + std::vector<float> *m_trig_EF_calo_phi; + std::vector<float> *m_trig_EF_calo_etaBE2; + + std::vector<float> *m_trig_EF_el_calo_e; + std::vector<float> *m_trig_EF_el_calo_et; + std::vector<float> *m_trig_EF_el_calo_eta; + std::vector<float> *m_trig_EF_el_calo_phi; + std::vector<float> *m_trig_EF_el_calo_etaBE2; + + std::vector<float> *m_trig_EF_el_e; + std::vector<float> *m_trig_EF_el_et; + std::vector<float> *m_trig_EF_el_eta; + std::vector<float> *m_trig_EF_el_phi; + std::vector<float> *m_trig_EF_el_ethad1; + std::vector<float> *m_trig_EF_el_ehad1; + std::vector<float> *m_trig_EF_el_f1; + std::vector<float> *m_trig_EF_el_f3; + std::vector<float> *m_trig_EF_el_f1core; + std::vector<float> *m_trig_EF_el_f3core; + std::vector<float> *m_trig_EF_el_weta1; + std::vector<float> *m_trig_EF_el_weta2; + std::vector<float> *m_trig_EF_el_wtots1; + std::vector<float> *m_trig_EF_el_fracs1; + std::vector<float> *m_trig_EF_el_Reta; + std::vector<float> *m_trig_EF_el_Rphi; + std::vector<float> *m_trig_EF_el_Eratio; + std::vector<float> *m_trig_EF_el_Rhad; + std::vector<float> *m_trig_EF_el_Rhad1; + std::vector<float> *m_trig_EF_el_deta2; + std::vector<float> *m_trig_EF_el_dphi2; + std::vector<float> *m_trig_EF_el_dphiresc; + std::vector<float> *m_trig_EF_el_e277; + std::vector<float> *m_trig_EF_el_deltaPhiRescaled2; + std::vector<float> *m_trig_EF_el_deltaEta1; + std::vector<float> *m_trig_EF_el_deltaE; + std::vector<float> *m_trig_EF_el_etCone; + std::vector<float> *m_trig_EF_el_ptCone; + + + std::vector<float> *m_trig_EF_el_trk_pt; + std::vector<float> *m_trig_EF_el_trk_eta; + std::vector<float> *m_trig_EF_el_trk_charge; + std::vector<float> *m_trig_EF_el_trk_sigd0; + std::vector<float> *m_trig_EF_el_trk_d0; + std::vector<float> *m_trig_EF_el_trk_eProbabilityHT; + std::vector<float> *m_trig_EF_el_trk_transformed_eProbabilityHT; + std::vector<float> *m_trig_EF_el_trk_d0significance; + std::vector<float> *m_trig_EF_el_trk_deltaPOverP; + std::vector<float> *m_trig_EF_el_trk_qOverP; + std::vector<uint8_t> *m_trig_EF_el_trk_summaryValues; + + + std::vector<bool> *m_trig_EF_el_hasCalo ; + std::vector<bool> *m_trig_EF_el_hasTrack ; + + + + std::vector<bool> *m_trig_EF_el_loose; + std::vector<bool> *m_trig_EF_el_medium; + std::vector<bool> *m_trig_EF_el_tight; + std::vector<bool> *m_trig_EF_el_lhvloose; + std::vector<bool> *m_trig_EF_el_lhloose; + std::vector<bool> *m_trig_EF_el_lhmedium; + std::vector<bool> *m_trig_EF_el_lhtight; + std::vector<bool> *m_trig_EF_calo_loose; + std::vector<bool> *m_trig_EF_calo_medium; + std::vector<bool> *m_trig_EF_calo_tight; + std::vector<bool> *m_trig_EF_calo_lhvloose; + std::vector<bool> *m_trig_EF_calo_lhloose; + std::vector<bool> *m_trig_EF_calo_lhmedium; + std::vector<bool> *m_trig_EF_calo_lhtight; + + std::vector<int> *m_trig_tdt_L1_calo_accept; + std::vector<int> *m_trig_tdt_L2_calo_accept; + std::vector<int> *m_trig_tdt_L2_el_accept ; + std::vector<int> *m_trig_tdt_EF_calo_accept; + std::vector<int> *m_trig_tdt_EF_el_accept ; + std::vector<int> *m_trig_tdt_emu_L1_calo_accept; + std::vector<int> *m_trig_tdt_emu_L2_calo_accept; + std::vector<int> *m_trig_tdt_emu_L2_el_accept ; + std::vector<int> *m_trig_tdt_emu_EF_calo_accept; + std::vector<int> *m_trig_tdt_emu_EF_el_accept ; + + + + // Monte Carlo + bool m_mc_hasMC{} ; + float m_mc_pt{} ; + float m_mc_eta{} ; + float m_mc_phi{} ; + bool m_mc_isTop{} ; + bool m_mc_isParton{} ; + bool m_mc_isMeson{} ; + bool m_mc_isQuark{} ; + bool m_mc_isTau{} ; + bool m_mc_isMuon{} ; + bool m_mc_isPhoton{} ; + bool m_mc_isElectron{}; + bool m_mc_hasZMother{}; + bool m_mc_hasWMother{}; + +}; + + +#endif diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaPlotTool.h b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaPlotTool.h index c1cd6fa59b9bd0efde9f3486ce30e7153f136f28..fd45b130a13977445e14be86be6493d91a44acfe 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaPlotTool.h +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/TrigEgammaAnalysisTools/TrigEgammaPlotTool.h @@ -73,8 +73,6 @@ class TrigEgammaPlotTool int m_ncoarseEtabins; //2D std::vector<float> m_etbins; std::vector<float> m_etabins; - std::vector<float> m_minBin_ringer; - std::vector<float> m_maxBin_ringer; std::vector<double> m_defaultEtbins; std::vector<double> m_defaultEtabins; std::vector<double> m_coarseEtbins; @@ -117,21 +115,20 @@ class TrigEgammaPlotTool void bookL1Histos(TrigInfo); void bookShifterHistos(); //void bookAnalysisHistos(const std::string dir); - void bookEfficiencyTProfile(const std::string dir); - void bookEfficiencyHistos(const std::string dir); - void bookEfficiency2DHistos(const std::string dir); - void bookEgammaDistributionHistos(const std::string dir); - void bookElectronDistributionHistos(const std::string dir); - void bookDistributionHistos(const std::string dir); - void bookResolutionHistos(const std::string dir); - void bookElectronResolutionHistos(const std::string dir); - void bookElectronIsoResolutionHistos(const std::string dir); - void bookPhotonResolutionHistos(const std::string dir); - void bookPhotonIsoResolutionHistos(const std::string dir); - void bookExpertResolutionHistos(const std::string dir); - void bookExpertL2CaloResolutionHistos(const std::string dir); - void bookAbsResolutionHistos(const std::string dir); - void parseCaloRingsLayers( unsigned layer, unsigned &minRing, unsigned &maxRing, std::string &caloLayerName); + void bookEfficiencyTProfile(const std::string &dir); + void bookEfficiencyHistos(const std::string &dir); + void bookEfficiency2DHistos(const std::string &dir); + void bookEgammaDistributionHistos(const std::string &dir); + void bookElectronDistributionHistos(const std::string &dir); + void bookDistributionHistos(const std::string &dir); + void bookResolutionHistos(const std::string &dir); + void bookElectronResolutionHistos(const std::string &dir); + void bookElectronIsoResolutionHistos(const std::string &dir); + void bookPhotonResolutionHistos(const std::string &dir); + void bookPhotonIsoResolutionHistos(const std::string &dir); + void bookExpertResolutionHistos(const std::string &dir); + void bookExpertL2CaloResolutionHistos(const std::string &dir); + void bookAbsResolutionHistos(const std::string &dir); }; #endif diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaAnalysisToolsConfig.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaAnalysisToolsConfig.py index 2159a9dd78156d32bf3c67810a0ee605bc4ddf7b..6b5d24fa7d7f24ed6f0031425b39433c008f53e1 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaAnalysisToolsConfig.py +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaAnalysisToolsConfig.py @@ -1,10 +1,11 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + from TrigEgammaAnalysisTools import TrigEgammaAnalysisToolsConf from AthenaCommon import CfgMgr from AthenaCommon.AppMgr import ToolSvc -from egammaRec.Factories import ToolFactory,FcnWrapper,AlgFactory, getPropertyValue +from egammaRec.Factories import PublicToolFactory,FcnWrapper,AlgFactory, getPropertyValue import PyUtils.RootUtils as ru ROOT = ru.import_root() @@ -29,22 +30,29 @@ MediumElectronSelector = CfgMgr.AsgElectronIsEMSelector("T0HLTMediumE TightElectronSelector = CfgMgr.AsgElectronIsEMSelector("T0HLTTightElectronSelector") LooseLHSelector = CfgMgr.AsgElectronLikelihoodTool("T0HLTLooseLHSelector") MediumLHSelector = CfgMgr.AsgElectronLikelihoodTool("T0HLTMediumLHSelector") -MediumLHHISelector = CfgMgr.AsgElectronLikelihoodTool("T0HLTMediumLHHISelector") TightLHSelector = CfgMgr.AsgElectronLikelihoodTool("T0HLTTightLHSelector") +VeryLooseLHSelector = CfgMgr.AsgElectronLikelihoodTool("T0HLTVeryLooseLHSelector") + +# see the configuration calib paths below LooseElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMLooseSelectorCutDefs.conf" MediumElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMMediumSelectorCutDefs.conf" TightElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMTightSelectorCutDefs.conf" +# 2018 (vtest) LooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodLooseOfflineConfig2017_CutBL_Smooth.conf" MediumLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodMediumOfflineConfig2017_Smooth.conf" -MediumLHHISelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20160907_HI/ElectronLikelihoodMediumOfflineConfig2016_HI.conf" TightLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodTightOfflineConfig2017_Smooth.conf" +VeryLooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf" + + + + ToolSvc+=LooseElectronSelector ToolSvc+=MediumElectronSelector ToolSvc+=TightElectronSelector ToolSvc+=LooseLHSelector ToolSvc+=MediumLHSelector -ToolSvc+=MediumLHHISelector ToolSvc+=TightLHSelector +ToolSvc+=VeryLooseLHSelector #from LumiBlockComps.LuminosityToolDefault import LuminosityToolOnline @@ -69,81 +77,43 @@ EgammaMatchTool = Trig__TrigEgammaMatchingTool() ToolSvc += EgammaMatchTool # Plot Tool sets the base path for histograms of all tools -TrigEgammaPlotTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaPlotTool, name="TrigEgammaPlotTool", +TrigEgammaPlotTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaPlotTool, name="TrigEgammaPlotTool", DirectoryPath="/HLT/Egamma", MaM=monitoring_mam, Efficiency=["eff_et","eff_eta","eff_mu"], Distribution=["et","eta"], Resolution=["res_et","res_eta"], OutputLevel=0) -EfficiencyTool = ToolFactory(TrigEgammaAnalysisToolsConf.EfficiencyTool, + +EfficiencyTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.EfficiencyTool, name="EfficiencyTool", PlotTool=TrigEgammaPlotTool, isEMResultNames=["Tight","Medium","Loose"], LHResultNames=["LHTight","LHMedium","LHLoose"], OutputLevel=0) -ResolutionTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaResolutionTool, + +ResolutionTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaResolutionTool, name="ResolutionTool", PlotTool=TrigEgammaPlotTool, OutputLevel=0) -DistTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaDistTool, + +DistTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaDistTool, name="DistTool", PlotTool=TrigEgammaPlotTool, OutputLevel=0) # import emulator egamma trigger tool -from TrigEgammaEmulationTool.TrigEgammaEmulationToolConfig import TrigEgammaEmulationTool +#from TrigEgammaEmulationTool.TrigEgammaEmulationToolConfig import TrigEgammaEmulationTool # Copy the default config w/ list # Allows factories below to instantiate emulator once Factories are instantiated -EmulationTool = TrigEgammaEmulationTool.copy( name = "TrigEgammaEmulationTool", - TriggerList = monitoringTP_electron) - -TrigEgammaNavTPNtuple = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavTPNtuple, name ="TrigEgammaNavTPNtuple", - Analysis='ZeeTPNtuple', - ElectronKey = 'Electrons', - MatchTool = EgammaMatchTool, - PlotTool=TrigEgammaPlotTool, - EmulationTool=EmulationTool, - Tools=[], - isEMResultNames=["Tight","Medium","Loose"], - LHResultNames=["LHTight","LHMedium","LHLoose"], - ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector], - ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], - ZeeLowerMass=80, - ZeeUpperMass=100, - doOfflineDump=False, - doEmulation=False, - OfflineTagSelector='Tight', # 1=tight, 2=medium, 3=loose - OfflineProbeSelector='Loose', - ForceProbePid=False, - OppositeCharge=True, - OfflineTagMinEt=25, - CutLabels=["Events","LAr","RetrieveElectrons","TwoElectrons","PassTrigger","EventWise","Success"], - TagTriggerList=["e24_tight_iloose"], - TriggerList=monitoringTP_electron +#EmulationTool = TrigEgammaEmulationTool.copy( name = "TrigEgammaEmulationTool", +# TriggerList = monitoringTP_electron) - ) +################################################################################################ +# Build factory -TrigEgammaNavNtuple = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavNtuple, name ="TrigEgammaNavNtuple", - Analysis='Ntuple', - ElectronKey = 'Electrons', - MatchTool = EgammaMatchTool, - PlotTool=TrigEgammaPlotTool, - EmulationTool=EmulationTool, - Tools=[], - ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector], - ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], - TriggerList=monitoringTP_electron, - doOfflineDump=False, - doEmulation=False, - ForcePidSelection=True, - ForceProbeIsolation=False, - ForceEtThreshold=True, - ForceMCEnhancedBias=False, - RemoveCrack=True, - ) -TrigEgammaNavTPAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavTPAnalysisTool, name = "TrigEgammaNavTPAnalysisTool", +TrigEgammaNavTPAnalysisTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavTPAnalysisTool, name = "TrigEgammaNavTPAnalysisTool", Analysis='Zee', ElectronKey = 'Electrons', MatchTool = EgammaMatchTool, @@ -162,6 +132,7 @@ TrigEgammaNavTPAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgamma OppositeCharge=True, doJpsiee=False, doEmulation=False, + ForceTrigAttachment=False, TPTrigger=False, OfflineTagMinEt=25, RemoveCrack=True, @@ -173,7 +144,7 @@ TrigEgammaNavTPAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgamma TagLabels=["Electrons","HasTrack","HasCluster","GoodPid","Et","Eta","IsGoodOQ","PassTrigger","MatchTrigger"], ) -TrigEgammaNavTPJpsieeAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavTPAnalysisTool, +TrigEgammaNavTPJpsieeAnalysisTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavTPAnalysisTool, name = "TrigEgammaNavTPJpsieeAnalysisTool", Analysis='Jpsiee', ElectronKey = 'Electrons', @@ -184,7 +155,7 @@ TrigEgammaNavTPJpsieeAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.Trig isEMResultNames=["Tight","Medium","Loose"], LHResultNames=["LHTight","LHMedium","LHLoose"], ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector], - ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector, MediumLHHISelector], + ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], ZeeLowerMass=2, ZeeUpperMass=5, OfflineTagSelector='Tight', # 1=tight, 2=medium, 3=loose @@ -193,6 +164,7 @@ TrigEgammaNavTPJpsieeAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.Trig OppositeCharge=True, doJpsiee=True, doEmulation=False, + ForceTrigAttachment=False, TPTrigger=False, OfflineTagMinEt=5, RemoveCrack=True, @@ -204,7 +176,7 @@ TrigEgammaNavTPJpsieeAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.Trig TagLabels=["Electrons","HasTrack","HasCluster","GoodPid","Et","Eta","PassTrigger","MatchTrigger"], ) -TrigEgammaNavAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavAnalysisTool, name ="TrigEgammaNavAnalysisTool", +TrigEgammaNavAnalysisTool = PublicToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavAnalysisTool, name ="TrigEgammaNavAnalysisTool", Analysis='Analysis', ElectronKey = 'Electrons', MatchTool = EgammaMatchTool, @@ -212,42 +184,140 @@ TrigEgammaNavAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNa #EmulationTool=EmulationTool, Tools=[EfficiencyTool,ResolutionTool,DistTool], ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector], - ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector,MediumLHHISelector], + ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], + ElectronLHVLooseTool=VeryLooseLHSelector, IsEMLabels=IneffLabels, TriggerList=monitoring_electron + monitoring_photon, ForcePidSelection=True, ForceProbeIsolation=False, ForceEtThreshold=True, + ForceTrigAttachment=False, RemoveCrack=True, doEmulation=False, ) -TrigEgammaNavEnhancedBiasAnalysisTool = ToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaNavAnalysisTool, name ="TrigEgammaNavEnhancedBiasAnalysisTool", - Analysis='EnhancedBias', - ElectronKey = 'Electrons', - MatchTool = EgammaMatchTool, - EmulationTool=EmulationTool, - PlotTool=TrigEgammaPlotTool, - Tools=[EfficiencyTool,ResolutionTool,DistTool], - ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector], - ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], - IsEMLabels=IneffLabels, - TriggerList=monitoring_electron + monitoring_photon, - ForcePidSelection=False, - ForceProbeIsolation=False, - ForceEtThreshold=False, - ForceMCEnhancedBias=False, - RemoveCrack=False, - doEmulation=False, - ) +############################################################################################# +# Functions # Function to return triggerlist tools def getAllTools(): return [TrigEgammaNavZeeTPCounts(),TrigEgammaNavZeeTPEff(),TrigEgammaNavZeeTPIneff(),TrigEgammaNavZeeTPRes(),] + +def setRunFlag( runFlag ): + if runFlag == '2018': + # cut based + LooseElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMLooseSelectorCutDefs.conf" + MediumElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMMediumSelectorCutDefs.conf" + TightElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMTightSelectorCutDefs.conf" + + # 2018 (vtest) + LooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodLooseOfflineConfig2017_CutBL_Smooth.conf" + MediumLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodMediumOfflineConfig2017_Smooth.conf" + TightLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodTightOfflineConfig2017_Smooth.conf" + VeryLooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf" + elif runFlag == '2017': + # cut based + LooseElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMLooseSelectorCutDefs.conf" + MediumElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMMediumSelectorCutDefs.conf" + TightElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMTightSelectorCutDefs.conf" + + # 2017 (v11) + LooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_CutBL_Smooth.conf" + MediumLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodMediumOfflineConfig2016_Smooth.conf" + TightLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodTightOfflineConfig2016_Smooth.conf" + VeryLooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodVeryLooseOfflineConfig2016_Smooth.conf" + else: + print 'Wrong run flag configuration' + + + # The main algorithm # Add triggerlist tools to ToolHandleArray TrigEgammaAnalysisAlg = AlgFactory(TrigEgammaAnalysisToolsConf.TrigEgammaAnalysisAlg, name='TrigEgammaAnalysisAlg', Tools = FcnWrapper(getAllTools), ) + + + +# This function will be used to collect events from Zee,JF17 and PhysicsMain samples. +# Use this if you really know. (for experts) +def getEventSelectionTool(runFlag): + + from TrigEgammaEmulationTool.TrigEgammaEmulationPidToolsConfig import getEgammaIsEMSelectorCaloOnly, \ + getElectronIsEMSelector,\ + getEgammaLikelihoodSelectorCaloOnly, \ + getElectronLikelihoodSelector2015,\ + getElectronLikelihoodSelectorNoD0 + from AthenaCommon import CfgMgr + from AthenaCommon.AppMgr import ToolSvc + # create all selector list. Here, the order is matter. Please check the + + setRunFlag(runFlag) + if runFlag == '2017': + + # trigger configuration + EFCaloIsEMSelectorList = getEgammaIsEMSelectorCaloOnly( "ElectronPhotonSelectorTools/trigger/rel21_20170217") + HLTIsEMSelectorList = getElectronIsEMSelector( "ElectronPhotonSelectorTools/trigger/rel21_20170217") + EFCaloLikelihoodSelectorList = getEgammaLikelihoodSelectorCaloOnly( "ElectronPhotonSelectorTools/trigger/rel21_20170217") + HLTLikelihoodSelectorList = getElectronLikelihoodSelectorNoD0( "ElectronPhotonSelectorTools/trigger/rel21_20170217") + + elif runFlag == '2018': + # trigger configuration + EFCaloIsEMSelectorList = getEgammaIsEMSelectorCaloOnly( "ElectronPhotonSelectorTools/trigger/rel21_20180312") + HLTIsEMSelectorList = getElectronIsEMSelector( "ElectronPhotonSelectorTools/trigger/rel21_20180312") + EFCaloLikelihoodSelectorList = getEgammaLikelihoodSelectorCaloOnly( "ElectronPhotonSelectorTools/trigger/rel21_20180312") + HLTLikelihoodSelectorList = getElectronLikelihoodSelectorNoD0( "ElectronPhotonSelectorTools/trigger/rel21_20180312") + + else: + print 'Wrong run flag configuration' + + # create the event selection tool + TrigEgammaEventSelection = PublicToolFactory(TrigEgammaAnalysisToolsConf.TrigEgammaEventSelection, name ="TrigEgammaEventSelection", + Analysis='EventsSelection', + ElectronKey = 'Electrons', + MatchTool = EgammaMatchTool, + PlotTool=TrigEgammaPlotTool, + EmulationTool=EmulationTool, # The emulation must be on in this tool. + doEmulation=True, + Tools=[], + isEMResultNames=["Tight","Medium","Loose"], + LHResultNames=["LHTight","LHMedium","LHLoose"], + ElectronLHVLooseTool=VeryLooseLHSelector, + ZeeLowerMass=80, + ZeeUpperMass=100, + OfflineTagSelector='Tight', # 1=tight, 2=medium, 3=loose + OfflineProbeSelector='Loose', + ForceProbePid=False, + OppositeCharge=True, + RemoveCrack=False, + OfflineTagMinEt=25, + OfflineProbeMinEt=4, + CutLabels=["Events","LAr","RetrieveElectrons","TwoElectrons","PassTrigger","EventWise","Success"], + TagTriggerList=["e24_tight_iloose"], + TriggerList=monitoringTP_electron, + ApplyMinimalTrigger = False, + SelectionZ=True, + SelectionW=False, + SelectionJpsi=False, + SelectionFakes=False, + SelectionMC=False, + ForceTrigAttachment=True, + DetailedDataLevel=0, # 0 = VerySlim, 1 = Slim and 2 = Full + # Asg selectors to decorate my final skimmed ntuple. + EFCaloElectronLikelihoodSelector=EFCaloLikelihoodSelectorList, + EFCaloElectronIsEMSelector=EFCaloIsEMSelectorList, + HLTElectronLikelihoodSelector=HLTLikelihoodSelectorList, + HLTElectronIsEMSelector=HLTIsEMSelectorList, + ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector], + ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], + + ) + + + # Return the template + return TrigEgammaEventSelection + + + diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py index c0e9cfe8cca733442ba604187a026c2f51a0bdcf..be86a3aa05aee9ad112d55350dde2e3caac6bb9c 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py @@ -484,6 +484,7 @@ defaultJpsi=[ "HLT_e5_lhvloose", ] + # Lowest single electron triggers for TP analysis monitoringTP_electron_extra =[ 'HLT_e24_lhmedium_L1EM18VH', @@ -547,5 +548,3 @@ supportingTriggerList.extend( [ - - diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisTools_emulator.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisTools_emulator.py new file mode 100644 index 0000000000000000000000000000000000000000..8dc82ce612d578237100e11f346d5d4291163087 --- /dev/null +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaAnalysisTools_emulator.py @@ -0,0 +1,250 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +#################################################################################################### +# Job options for standalone and Tier0 running of AnalysisTools +# Authors: +# Ryan Mackenzie White <ryan.white@cern.ch> +# Joao Victor Pinto <jodafons@cern.ch> +# +# Tool and algorithm configuration done using egamma Factories +# +# To run +# athena -l DEBUG -c "DIR='/afs/cern.ch/work/j/jolopezl/datasets/\ +# valid1.147406.PowhegPythia8_AZNLO_Zee.recon.AOD.e3099_s2578_r6220_tid05203475_00'" +# -c "NOV=50" test_ZeeElectronLowPtSupportingTrigAnalysis.py +# where NOV is the number of events to run +#################################################################################################### + + +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +from RecExConfig.RecFlags import rec +from RecExConfig.RecAlgsFlags import recAlgs +from AthenaCommon.AppMgr import ToolSvc +import os + +# Define triggers for tagging +tagList = ['HLT_e24_lhtight_nod0_ivarloose', + 'HLT_e26_lhtight_nod0_ivarloose', + 'HLT_e28_lhtight_nod0_ivarloose'] + +triggerList_commissioning_v1 = [ + + # standard monitoring chains + #'HLT_e17_lhvloose_nod0_L1EM15VHI', + 'HLT_e17_lhvloose_nod0', + 'HLT_e26_lhloose_nod0', + 'HLT_e26_lhmedium_nod0', + #'HLT_e26_lhtight_nod0', + #'HLT_e26_lhtight_nod0_ivarloose', + 'HLT_e28_lhtight_nod0_ivarloose', + 'HLT_e60_lhmedium_nod0_L1EM24VHI', + 'HLT_e140_lhloose_nod0_L1EM24VHI', + # ringer chains for the commissioning... + #'HLT_e17_lhvloose_nod0_ringer_L1EM15VHI', + 'HLT_e17_lhvloose_nod0_ringer', + 'HLT_e26_lhloose_nod0_ringer', + 'HLT_e26_lhmedium_nod0_ringer', + #'HLT_e26_lhtight_nod0_ringer', + #'HLT_e26_lhtight_nod0_ringer_ivarloose', + 'HLT_e28_lhtight_nod0_ringer_ivarloose', + 'HLT_e60_lhmedium_nod0_ringer_L1EM24VHI', + 'HLT_e140_lhloose_nod0_ringer_L1EM24VHI', + ] + + +triggerList_monitoring_v1 = [ + # standard monitoring chains + 'HLT_e17_lhvloose_nod0_L1EM15VHI', + 'HLT_e26_lhtight_nod0_ivarloose', + 'HLT_e28_lhtight_nod0_icaloloose', + 'HLT_e60_lhmedium_nod0_L1EM24VHI', + 'HLT_e140_lhloose_nod0_L1EM24VHI', + # no ringer chains for pos-commissioning... + 'HLT_e17_lhvloose_nod0_noringer_L1EM15VHI', + 'HLT_e26_lhtight_nod0_noringer_ivarloose', + 'HLT_e28_lhtight_nod0_noringer_ivarloose', + 'HLT_e60_lhmedium_nod0_noringer_L1EM24VHI', + 'HLT_e140_lhloose_nod0_noringer_L1EM24VHI', + + ] + + +triggerList = triggerList_monitoring_v1 + +doGRL=False +doEmulation=True +DetailedHistograms=False +#################################################################################################### +dirtouse = str() +finallist=[] +grllist=[] + +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf +from glob import glob + +if ('FILE' in dir()): + acf.FilesInput=[FILE] +elif ('DIR' in dir()): + inputFiles = glob(DIR+'*') + acf.FilesInput=inputFiles +if 'NOV' in dir(): + nov=NOV +else : + nov=500 +if 'GRL' in dir(): + grllist.append(GRL) +else: + #grllist.append('/afs/cern.ch/work/j/jodafons/public/data/data15_13TeV.periodAllYear_DetStatus-v79-repro20-02_DQDefects-00-02-02_PHYS_StandardGRL_All_Good_25ns.xml') + #grllist.append('data15_13TeV.periodAllYear_DetStatus-v79-repro20-02_DQDefects-00-02-02_PHYS_StandardGRL_All_Good_25ns.xml') + #grllist.append('/afs/cern.ch/work/j/jodafons/public/data/data16_13TeV.periodAllYear_DetStatus-v81-pro20-10_DQDefects-00-02-02_PHYS_StandardGRL_All_Good_25ns.xml') + #grllist.append('data16_13TeV.periodAllYear_DetStatus-v81-pro20-10_DQDefects-00-02-02_PHYS_StandardGRL_All_Good_25ns.xml') + grllist.append('data17_13TeV.periodAllYear_DetStatus-v92-pro21-05_Unknown_PHYS_StandardGRL_All_Good_25ns_Triggerno17e33prim.xml') + +#################################################################################################### + +acf.EvtMax=nov +rec.readAOD=True +# switch off detectors +rec.doForwardDet=False +rec.doInDet=False +rec.doCalo=False +rec.doMuon=False +rec.doEgamma=False +rec.doTrigger=True +recAlgs.doTrigger=False # disable trigger (maybe necessary if detectors switched off) +rec.doMuon=False +rec.doMuonCombined=False +rec.doWriteAOD=True +rec.doWriteESD=False +rec.doDPD=False +rec.doTruth=False +# autoconfiguration might trigger undesired feature +rec.doESD.set_Value_and_Lock(False) # uncomment if do not run ESD making algorithms +rec.doWriteESD.set_Value_and_Lock(False) # uncomment if do not write ESD +rec.doAOD.set_Value_and_Lock(True) # uncomment if do not run AOD making algorithms +rec.doWriteAOD.set_Value_and_Lock(False) # uncomment if do not write AOD +rec.doWriteTAG.set_Value_and_Lock(False) # uncomment if do not write TAG + +# main jobOption +include ("RecExCommon/RecExCommon_topOptions.py") +MessageSvc.debugLimit = 20000000 +MessageSvc.infoLimit = 20000000 + +# Add Trigger Decision Tool +from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool +tdt = Trig__TrigDecisionTool( "TrigDecisionTool" ) +tdt.TrigDecisionKey='xTrigDecision' +tdt.Navigation.ReadonlyHolders=True +ToolSvc+=tdt + +try: + include ("AthenaMonitoring/DataQualityInit_jobOptions.py") +except Exception: + treatException("Could not load AthenaMonitoring/DataQualityInit_jobOptions.py") + + + + +# Call top sequence +from AthenaCommon.AlgSequence import AlgSequence, AthSequencer +topSequence = AlgSequence() + + +##################################### GRL Tools ########################################## +# Good Run List (GRL) +if doGRL: + from RecExConfig.InputFilePeeker import inputFileSummary + try: + if inputFileSummary['evt_type'][0] == "IS_DATA": + from GoodRunsLists.GoodRunsListsConf import * + ToolSvc += GoodRunsListSelectorTool() + GoodRunsListSelectorTool.GoodRunsListVec = grllist + from GoodRunsListsUser.GoodRunsListsUserConf import * + seq = AthSequencer("AthFilterSeq") + seq += GRLTriggerSelectorAlg('GRLTriggerAlg1') + #seq.GRLTriggerAlg1.GoodRunsListArray = ['PHYS_StandardGRL_All_Good_25ns'] + seq.GRLTriggerAlg1.GoodRunsListArray = [grllist[0].replace('.xml','')] + except: + print "GRL not available!" + +##################################### Mon Tools ########################################## + +from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager +topSequence += AthenaMonManager( "HLTMonManager") +HLTMonManager = topSequence.HLTMonManager +################ Mon Tools ################# +#Global HLTMonTool +from TrigHLTMonitoring.TrigHLTMonitoringConf import HLTMonTool +HLTMon = HLTMonTool(name = 'HLTMon', histoPathBase = "HLT"); +ToolSvc += HLTMon; +HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; + +#################################################################################################### +#Define the base path for all histograms + + + +basePath = '/HLT/Egamma' +#Configure the TrigEgammaPlotTool +from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConfig import TrigEgammaNavTPAnalysisTool, TrigEgammaPlotTool, EfficiencyTool, DistTool, ResolutionTool +from TrigEgammaAnalysisTools.TrigEgammaProbelist import monitoring_mam, monitoring_electron, monitoring_photon +from TrigEgammaAnalysisTools.TrigEgammaProbelist import probeListLowMidPtSupportingTriggers, probeListHighPtSupportingTriggers + +PlotTool = TrigEgammaPlotTool.copy( name="TrigEgammaPlotTool", + DirectoryPath=basePath, + MaM=monitoring_mam, + Efficiency=[], + Distribution=[], + Resolution=[]) + +EffTool = EfficiencyTool.copy(name="EfficiencyTool", + PlotTool=PlotTool, + isEMResultNames=["Tight","Medium","Loose"], + LHResultNames=["LHTight","LHMedium","LHLoose"], + OutputLevel=0) + + + +#################################################################################################### +from TrigEgammaEmulationTool.TrigEgammaEmulationToolConfig import TrigEgammaEmulationTool +from TrigEgammaEmulationTool.TrigEgammaEmulationEFConfig import EgammaEFElectronDefaultEmulator,EgammaEFElectronNoD0Emulator +from TriggerJobOpts.TriggerFlags import TriggerFlags + +# Force this emulation selector path +TriggerFlags.EgammaSlice.pidVersion.set_Value_and_Lock("ElectronPhotonSelectorTools/trigger/rel21_20170217/") +TriggerFlags.EgammaSlice.ringerVersion.set_Value_and_Lock("RingerSelectorTools/TrigL2_20170505_v6") + +EmulationElectronTool = TrigEgammaEmulationTool.copy( name="TrigEgammaEmulationTool", + TriggerList = triggerList, + DoL2ElectronFex=True, + DoEFCaloPid=False, + DoRinger=True, + OutputLevel=0) + +#################################################################################################### + +AnalysisTool = TrigEgammaNavTPAnalysisTool( name = "TrigEgammaNavTPAnalysisTool", + Analysis='Zee', + PlotTool=PlotTool, + Tools=[EffTool], + OfflineTagSelector='Tight', # 1=tight, 2=medium, 3=loose + OfflineProbeSelector='Loose', + DefaultProbePid='LHMedium', + doEmulation=doEmulation, + DetailedHistograms=DetailedHistograms, + EmulationTool=EmulationElectronTool, + TPTrigger=False, + RemoveCrack=False, + TagTriggerList=tagList, + TriggerList=triggerList, + OutputLevel=0) + +#################################################################################################### +Tools=['TrigEgammaNavTPAnalysisTool/TrigEgammaNavTPAnalysisTool'] +from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConf import TrigEgammaMonTool +TrigEgammaMonTool = TrigEgammaMonTool( name = "HLTEgammaMon", histoPathBase=basePath, Tools=Tools) +ToolSvc += TrigEgammaMonTool +HLTMonManager.AthenaMonTools += [ "TrigEgammaMonTool/HLTEgammaMon" ] +HLTMonManager.FileKey = "GLOBAL" +ToolSvc.TrigDecisionTool.Navigation.OutputLevel = WARNING +#################################################################################################### diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaEventSelectionTool.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaEventSelectionTool.py new file mode 100644 index 0000000000000000000000000000000000000000..ba72df178c83f6d1e99bf66c96169841bb2868a5 --- /dev/null +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/share/testTrigEgammaEventSelectionTool.py @@ -0,0 +1,195 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +# Job options for standalone and Tier0 running of AnalysisTools +# Authors: +# Ryan Mackenzie White <ryan.white@cern.ch> +# +# Tool and algorithm configuration done using egamma Factories +# Default configurations found in TrigEgammaAnalysisToolsConfig +# +# To run +# athena -l DEBUG -c "DIR='/afs/cern.ch/work/j/jolopezl/datasets/valid1.147406.PowhegPythia8_AZNLO_Zee.recon.AOD.e3099_s2578_r6220_tid05203475_00'" +# -c "NOV=50" test_ZeeElectronLowPtSupportingTrigAnalysis.py +# where NOV is the number of events to run + +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +from RecExConfig.RecFlags import rec +from RecExConfig.RecAlgsFlags import recAlgs +from AthenaCommon.AppMgr import ToolSvc +import os + +doZ=True +doFakes=True + +# Define triggers for tagging +triggerTags = ['HLT_e24_lhtight_nod0_ivarloose', + 'HLT_e26_lhtight_nod0_ivarloose', + 'HLT_e28_lhtight_nod0_ivarloose'] + +triggerList = [ + # standard monitoring chains + 'HLT_e26_lhtight_nod0_ivarloose', + 'HLT_e28_lhtight_nod0_ivarloose', + 'HLT_e60_lhmedium_nod0_L1EM24VHI', + # no ringer chains for pos-commissioning... + 'HLT_e26_lhtight_nod0_noringer_ivarloose_L1EM22VHI', + 'HLT_e28_lhtight_nod0_noringer_ivarloose', # get real TDT + 'HLT_e28_lhtight_nod0_noringer_ivarloose_L1EM24VHI', + 'HLT_e60_lhmedium_nod0_noringer_L1EM24VHI', + ] + + + +#print 'Set some variables for job' +dirtouse = str() +finallist=[] + +if 'FILE' in dir() : + finallist.append(FILE) + +if 'DIR' in dir() : + dirtouse=DIR + print 'DIR = ',dirtouse + while( dirtouse.endswith('/') ) : + dirtouse= dirtouse.rstrip('/') + listfiles=os.listdir(dirtouse) + for ll in listfiles: + finallist.append(dirtouse+'/'+ll) + +if 'NOV' in dir(): + nov=NOV +else : + nov=-1 + + +print finallist +athenaCommonFlags.FilesInput=finallist +athenaCommonFlags.EvtMax=nov +rec.readAOD=True +# switch off detectors +rec.doForwardDet=False +rec.doInDet=False +rec.doCalo=False +rec.doMuon=False +rec.doEgamma=False +rec.doTrigger = True; recAlgs.doTrigger=False # disable trigger (maybe necessary if detectors switched off) +rec.doMuon=False +rec.doAOD=False +rec.doMuonCombined=False +rec.doWriteAOD=False +rec.doWriteESD=False +rec.doDPD=False +rec.doTruth=False + +# autoconfiguration might trigger undesired feature +rec.doESD.set_Value_and_Lock(False) # uncomment if do not run ESD making algorithms +rec.doWriteESD.set_Value_and_Lock(False) # uncomment if do not write ESD +rec.doAOD.set_Value_and_Lock(True) # uncomment if do not run AOD making algorithms +rec.doWriteAOD.set_Value_and_Lock(False) # uncomment if do not write AOD +rec.doWriteTAG.set_Value_and_Lock(False) # uncomment if do not write TAG + +# main jobOption +include ("RecExCommon/RecExCommon_topOptions.py") +MessageSvc.debugLimit = 20000000 +MessageSvc.infoLimit = 20000000 +# TDT +from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool +tdt = Trig__TrigDecisionTool( "TrigDecisionTool" ) +tdt.TrigDecisionKey='xTrigDecision' +tdt.Navigation.ReadonlyHolders=True +ToolSvc+=tdt + +try: + include ("AthenaMonitoring/DataQualityInit_jobOptions.py") +except Exception: + treatException("Could not load AthenaMonitoring/DataQualityInit_jobOptions.py") + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager +topSequence += AthenaMonManager( "HLTMonManager") +HLTMonManager = topSequence.HLTMonManager + +################ Mon Tools ################# +#Global HLTMonTool + +from TrigHLTMonitoring.TrigHLTMonitoringConf import HLTMonTool +HLTMon = HLTMonTool(name = 'HLTMon', histoPathBase = "HLT"); + +ToolSvc += HLTMon; +HLTMonManager.AthenaMonTools += [ "HLTMonTool/HLTMon" ]; + +from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConfig import TrigEgammaPlotTool, getEventSelectionTool +#Define the base path for all histograms +basePath = '/HLT/Physval' + +#Configure the TrigEgammaPlotTool +PlotTool = TrigEgammaPlotTool.copy( name="TrigEgammaPlotTool", + DirectoryPath=basePath, + #MaM=monitoring_mam, + Efficiency=[], + Distribution=[], + Resolution=[]) + +TrigEgammaEventSelection = getEventSelectionTool() + +#################################################################################################### + +from TrigEgammaEmulationTool.TrigEgammaEmulationToolConfig import TrigEgammaEmulationTool +from TrigEgammaEmulationTool.TrigEgammaEmulationEFConfig import EgammaEFElectronDefaultEmulator,EgammaEFElectronNoD0Emulator +from TriggerJobOpts.TriggerFlags import TriggerFlags + +# Force this emulation selector path +TriggerFlags.EgammaSlice.pidVersion.set_Value_and_Lock("ElectronPhotonSelectorTools/trigger/rel21_20170217/") +TriggerFlags.EgammaSlice.ringerVersion.set_Value_and_Lock("RingerSelectorTools/TrigL2_20170505_v6") + +EmulationElectronTool = TrigEgammaEmulationTool.copy( name="TrigEgammaEmulationTool", + TriggerList = triggerList, + DoL2ElectronFex=True, + DoEFCaloPid=False, + DoRinger=True, + OutputLevel=0) + +#################################################################################################### + + +Tool = TrigEgammaEventSelection( name='EventSelection', + Analysis='Probes', + PlotTool=PlotTool, + EmulationTool=EmulationElectronTool, + File="", + OutputLevel=0, + DetailedHistograms=False, + isEMResultNames=["Tight","Medium","Loose"], + LHResultNames=["LHTight","LHMedium","LHLoose"], + ZeeLowerMass=80, + ZeeUpperMass=100, + OfflineTagSelector='Tight', # 1=tight, 2=medium, 3=loose + OfflineProbeSelector='Loose', + ForceProbePid=False, + OppositeCharge=True, + OfflineTagMinEt=25, + TagTriggerList=triggerTags, + SelectionZ=doZ, + SelectionFakes=doFakes, + ApplyMinimalTrigger=False, + DetailedDataLevel=2, + DumpTags=False, + TriggerList=triggerList) + +Tools=['TrigEgammaEventSelection/EventSelection'] + +from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConf import TrigEgammaMonTool +TrigEgammaMonTool = TrigEgammaMonTool( name = "HLTEgammaMon", + histoPathBase=basePath, + Tools=Tools) + +ToolSvc += TrigEgammaMonTool + +#TrigEgammaMonToolConfig.TrigEgammaMonTool() +HLTMonManager.AthenaMonTools += [ "TrigEgammaMonTool/HLTEgammaMon" ] +HLTMonManager.FileKey = "GLOBAL" + + + diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/TrigEgammaMonTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/TrigEgammaMonTool.cxx index dd7bd078d5cafd27abcf966fe9f249a9caf90725..84c3551dfebaa04a6d898a422187b459a61147ac 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/TrigEgammaMonTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/TrigEgammaMonTool.cxx @@ -27,20 +27,23 @@ TrigEgammaMonTool( const std::string & type, const std::string & name, const IIn } TrigEgammaMonTool::~TrigEgammaMonTool(){} -StatusCode TrigEgammaMonTool::init(){ - + + +StatusCode TrigEgammaMonTool::init(){ return StatusCode::SUCCESS; } StatusCode TrigEgammaMonTool::book(){ ATH_MSG_INFO("Initializing " << name() << "..."); - ATH_MSG_INFO("Retrieving tools..."); + ATH_MSG_INFO("Retrieving tools..." << m_asgToolNames.size()); for(const auto toolname : m_asgToolNames){ + ATH_MSG_INFO("Add "<<toolname<<"..." ); m_asgtools.push_back(ToolHandle<ITrigEgammaAnalysisBaseTool>(toolname)); } for ( ToolHandleArray<ITrigEgammaAnalysisBaseTool>::const_iterator itoo=m_asgtools.begin(); itoo!=m_asgtools.end(); ++itoo ) { + ATH_MSG_INFO("Initializing..." ); ToolHandle<ITrigEgammaAnalysisBaseTool> htool = *itoo; htool->setParent(this); StatusCode sc = htool->initialize(); @@ -56,8 +59,6 @@ StatusCode TrigEgammaMonTool::book(){ } ATH_MSG_INFO("Tool retrieval completed."); - - return StatusCode::SUCCESS; } diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/components/TrigEgammaAnalysisTools_entries.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/components/TrigEgammaAnalysisTools_entries.cxx index 77b8a9677f6efc5eeab05dc99eb9e46bd6699c90..9facf0a35fafc63e7a0002d0f270795aacfbb8bc 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/components/TrigEgammaAnalysisTools_entries.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/components/TrigEgammaAnalysisTools_entries.cxx @@ -5,28 +5,25 @@ #include "TrigEgammaAnalysisTools/TrigEgammaNavAnalysisTool.h" #include "TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h" #include "TrigEgammaAnalysisTools/TrigEgammaNavTPAnalysisTool.h" -#include "TrigEgammaAnalysisTools/TrigEgammaNavNtuple.h" -#include "TrigEgammaAnalysisTools/TrigEgammaNavTPNtuple.h" #include "TrigEgammaAnalysisTools/EfficiencyTool.h" #include "TrigEgammaAnalysisTools/TrigEgammaResolutionTool.h" #include "TrigEgammaAnalysisTools/TrigEgammaDistTool.h" #include "TrigEgammaAnalysisTools/TrigEgammaPlotTool.h" +#include "TrigEgammaAnalysisTools/TrigEgammaEventSelection.h" #include "../TrigEgammaAnalysisAlg.h" #include "../TrigEgammaTDToolTest.h" -DECLARE_COMPONENT( TrigEgammaAnalysisBaseTool ) -DECLARE_COMPONENT( TrigEgammaMonTool ) -DECLARE_COMPONENT( TrigEgammaPhysValMonTool ) -DECLARE_COMPONENT( TrigEgammaNavTPBaseTool ) -DECLARE_COMPONENT( TrigEgammaNavTPNtuple ) -DECLARE_COMPONENT( TrigEgammaNavAnalysisTool ) -DECLARE_COMPONENT( TrigEgammaNavTPAnalysisTool ) -DECLARE_COMPONENT( TrigEgammaNavNtuple ) -DECLARE_COMPONENT( EfficiencyTool ) -DECLARE_COMPONENT( TrigEgammaResolutionTool ) -DECLARE_COMPONENT( TrigEgammaDistTool ) -DECLARE_COMPONENT( TrigEgammaPlotTool ) -DECLARE_COMPONENT( TrigEgammaAnalysisAlg ) -DECLARE_COMPONENT( TrigEgammaTDToolTest ) - +DECLARE_COMPONENT(TrigEgammaAnalysisBaseTool) +DECLARE_COMPONENT(TrigEgammaMonTool) +DECLARE_COMPONENT(TrigEgammaPhysValMonTool) +DECLARE_COMPONENT(TrigEgammaNavTPBaseTool) +DECLARE_COMPONENT(TrigEgammaNavAnalysisTool) +DECLARE_COMPONENT(TrigEgammaNavTPAnalysisTool) +DECLARE_COMPONENT(EfficiencyTool) +DECLARE_COMPONENT(TrigEgammaResolutionTool) +DECLARE_COMPONENT(TrigEgammaDistTool) +DECLARE_COMPONENT(TrigEgammaPlotTool) +DECLARE_COMPONENT(TrigEgammaEventSelection) +DECLARE_COMPONENT(TrigEgammaAnalysisAlg) +DECLARE_COMPONENT(TrigEgammaTDToolTest) diff --git a/Trigger/TrigT1/TrigT1CaloSim/TrigT1CaloSim/Run2TriggerTowerMaker.h b/Trigger/TrigT1/TrigT1CaloSim/TrigT1CaloSim/Run2TriggerTowerMaker.h index d94a92a38a21798b4d66c3c8bb3e7a2876f6f998..f655f8c48a4c372ee8b8cd3b5028baa4d7501c4a 100755 --- a/Trigger/TrigT1/TrigT1CaloSim/TrigT1CaloSim/Run2TriggerTowerMaker.h +++ b/Trigger/TrigT1/TrigT1CaloSim/TrigT1CaloSim/Run2TriggerTowerMaker.h @@ -131,9 +131,6 @@ private: //Flag to enable zero suppression (makes algorithm simulation much faster bool m_ZeroSuppress; - // locations within the TES to store collections of Trigger Towers - std::string m_outputLocation; - // require all calorimeters, or allow running with some missing? bool m_requireAllCalos; @@ -269,9 +266,10 @@ private: SG::ReadHandleKey<xAOD::EventInfo> m_xaodevtKey; // location of input TriggerTowers (for reprocessing) SG::ReadHandleKey<xAOD::TriggerTowerContainer> m_inputTTLocation; - // locations within the TES to store collections of Trigger Towers - //SG::WriteHandleKey<xAOD::TriggerTowerContainer> m_outputLocation; - //SG::WriteHandleKey<xAOD::TriggerTowerAuxContainer> m_outputAuxLocation; + // locations within StoreGate to store collections of Trigger Towers + SG::WriteHandleKey<xAOD::TriggerTowerContainer> m_outputLocation; + // locations within StoreGate to store collections of Trigger Towers for reprocessing + SG::WriteHandleKey<xAOD::TriggerTowerContainer> m_outputLocationRerun; // location of LAr TTL1 data SG::ReadHandleKey<LArTTL1Container> m_EmTTL1ContainerName; diff --git a/Trigger/TrigT1/TrigT1CaloSim/python/TrigT1CaloSimRun2Config.py b/Trigger/TrigT1/TrigT1CaloSim/python/TrigT1CaloSimRun2Config.py index 574d7211dc648983168829817d475a4494750360..0afdb6d4bab3d10076674724b5e45db671ec470e 100644 --- a/Trigger/TrigT1/TrigT1CaloSim/python/TrigT1CaloSimRun2Config.py +++ b/Trigger/TrigT1/TrigT1CaloSim/python/TrigT1CaloSimRun2Config.py @@ -37,6 +37,9 @@ class Run2TriggerTowerMaker(Run2TriggerTowerMakerBase): super(Run2TriggerTowerMaker, self).__init__(name) self.CellType = 3 # TTL1 input self.ZeroSuppress = True + + from SGComps.AddressRemappingSvc import addInputRename + addInputRename ( 'xAOD::TriggerTowerContainer', 'xAODTriggerTowers_rerun', 'xAODTriggerTowers') from AthenaCommon import CfgMgr from AthenaCommon.AppMgr import ToolSvc diff --git a/Trigger/TrigT1/TrigT1CaloSim/share/TrigT1CaloSimJobOptions_Run2.py b/Trigger/TrigT1/TrigT1CaloSim/share/TrigT1CaloSimJobOptions_Run2.py index 77a4e2bb8dafc224301a453f34b8e69a238a5a49..d4d3aa4a24cd2d35df6e003421fc9fc60226efcc 100755 --- a/Trigger/TrigT1/TrigT1CaloSim/share/TrigT1CaloSimJobOptions_Run2.py +++ b/Trigger/TrigT1/TrigT1CaloSim/share/TrigT1CaloSimJobOptions_Run2.py @@ -22,6 +22,9 @@ job = AlgSequence() include('TrigT1CaloCalibConditions/L1CaloCalibConditionsMC_jobOptions.py') from TrigT1CaloSim.TrigT1CaloSimRun2Config import Run2TriggerTowerMaker25ns, Run2TriggerTowerMaker50ns +from SGComps.AddressRemappingSvc import addInputRename +addInputRename ( 'xAOD::TriggerTowerContainer', 'xAODTriggerTowers_rerun', 'xAODTriggerTowers') + # try to determine wheter running with 25ns/50ns bunchspacing _bunchSpacing = None _doPC = True # do pedestal correction? diff --git a/Trigger/TrigT1/TrigT1CaloSim/src/Run2TriggerTowerMaker.cxx b/Trigger/TrigT1/TrigT1CaloSim/src/Run2TriggerTowerMaker.cxx index d8ee708a12e336bc46487d3930e5579c12ef4896..916a73f17462db19e1e1ece67f3c62501c01faa5 100755 --- a/Trigger/TrigT1/TrigT1CaloSim/src/Run2TriggerTowerMaker.cxx +++ b/Trigger/TrigT1/TrigT1CaloSim/src/Run2TriggerTowerMaker.cxx @@ -110,6 +110,7 @@ namespace LVL1 { declareProperty("RequireAllCalos",m_requireAllCalos=true,"Should EM,Had and Tile all be available?"); declareProperty("TriggerTowerLocation", m_outputLocation= TrigT1CaloDefs::xAODTriggerTowerLocation); + declareProperty("TriggerTowerLocationRerun", m_outputLocationRerun = TrigT1CaloDefs::xAODTriggerTowerRerunLocation); declareProperty("CellType", m_cellType = TTL1); // ADC simulation @@ -190,13 +191,26 @@ namespace LVL1 { ATH_CHECK(m_xaodevtKey.initialize()); ATH_CHECK(m_inputTTLocation.initialize()); - //ATH_CHECK(m_outputLocation.initialize()); - //m_outputAuxLocation = m_outputAuxLocation.key() + "Aux."; - //ATH_CHECK(m_outputAuxLocation.initialize()); ATH_CHECK(m_EmTTL1ContainerName.initialize()); ATH_CHECK(m_HadTTL1ContainerName.initialize()); ATH_CHECK(m_TileTTL1ContainerName.initialize()); + ATH_CHECK(m_outputLocation.initialize()); + + ATH_CHECK(m_outputLocationRerun.initialize()); + + //Rerun on trigger towers + if (m_cellType == TRIGGERTOWERS) { + renounce(m_EmTTL1ContainerName); + renounce(m_HadTTL1ContainerName); + renounce(m_TileTTL1ContainerName); + renounce(m_outputLocation); + } + //Start from RDO inputs + else if (m_cellType == TTL1) { + renounce(m_inputTTLocation); + renounce(m_outputLocationRerun); + } return StatusCode::SUCCESS; } @@ -887,9 +901,6 @@ namespace LVL1 { StatusCode Run2TriggerTowerMaker::store() { ATH_MSG_DEBUG("Storing TTs in DataVector"); - if(m_outputLocation.empty()) return StatusCode::SUCCESS; - //if(m_outputLocation.key().empty()) return StatusCode::SUCCESS; - if(m_ZeroSuppress) { // remove trigger towers whose energy is 0 m_xaodTowers->erase(std::remove_if(m_xaodTowers->begin(), m_xaodTowers->end(), @@ -899,12 +910,16 @@ namespace LVL1 { m_xaodTowers->end()); } - CHECK(evtStore()->record(m_xaodTowers.release(), m_outputLocation)); - CHECK(evtStore()->record(m_xaodTowersAux.release(), m_outputLocation+"Aux.")); - //SG::WriteHandle<xAOD::TriggerTowerContainer> output(m_outputLocation); - //SG::WriteHandle<xAOD::TriggerTowerAuxContainer> outputAux(m_outputAuxLocation); - //CHECK(output.record(std::move(m_xaodTowers))); - //CHECK(outputAux.record(std::move(m_xaodTowersAux))); + + + if (m_cellType == TRIGGERTOWERS) { + SG::WriteHandle<xAOD::TriggerTowerContainer> output(m_outputLocationRerun); + CHECK(output.record(std::move(m_xaodTowers), std::move(m_xaodTowersAux))); + } + else if (m_cellType == TTL1) { + SG::WriteHandle<xAOD::TriggerTowerContainer> output(m_outputLocation); + CHECK(output.record(std::move(m_xaodTowers), std::move(m_xaodTowersAux))); + } return StatusCode::SUCCESS; } // end of LVL1::Run2TriggerTowerMaker::store(){ diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/Coordinate.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/Coordinate.h index bd3fc94a31fcd49fc941aa12ae614ebf82da0fd9..7f91c22ea26899b84f9ac7debe6de4dd94e7511e 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/Coordinate.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/Coordinate.h @@ -1,6 +1,6 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** Coordinate.h - description @@ -47,7 +47,7 @@ namespace LVL1 { public: Coordinate( double phi, double eta ); Coordinate(); - virtual ~Coordinate(); + virtual ~Coordinate() = default; void setCoords( double phi, double eta ); double eta() const; diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/CoordinateRange.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/CoordinateRange.h index ee78f281f594bef70e5f59726fbde65b9ce74091..4615c274f448ce87ffcd5d7dc2d5227a672a0b51 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/CoordinateRange.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/CoordinateRange.h @@ -1,6 +1,6 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** CoordinateRange.h - description @@ -32,7 +32,7 @@ class CoordinateRange : public Coordinate { public: CoordinateRange(double phiMin, double phiMax, double etaMin, double etaMax); CoordinateRange(); - virtual ~CoordinateRange(); + virtual ~CoordinateRange() = default; void setRanges(double phiMin, double phiMax, double etaMin, double etaMax); PhiRange phiRange() const; diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1Topo.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1Topo.h index 82c0162ba4ccbaa9fd909c2701fbad54c37a8d6e..d06eecc2332be17bce7356e0f71a5e5be9f8e5c0 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1Topo.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1Topo.h @@ -27,7 +27,8 @@ namespace LVL1 { //constructor MuCTPIL1Topo(); MuCTPIL1Topo(std::vector<MuCTPIL1TopoCandidate> candList); - ~MuCTPIL1Topo(); + MuCTPIL1Topo(const MuCTPIL1Topo&) = default; + ~MuCTPIL1Topo() = default; //Return the vector of muon to L1Topo candidates std::vector<MuCTPIL1TopoCandidate> getCandidates() const; diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1TopoCandidate.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1TopoCandidate.h index f7743521fca39df1789a1308c83a005b51a188bc..06df7aa77ed38d934404cfa176223f14ec3d048a 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1TopoCandidate.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1TopoCandidate.h @@ -27,7 +27,7 @@ namespace LVL1 { MuCTPIL1TopoCandidate(); - ~MuCTPIL1TopoCandidate(); + ~MuCTPIL1TopoCandidate() = default; // set candidate data void setCandidateData(std::string sectorName, diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/PhiRange.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/PhiRange.h index b9e6ce2a4c3a36e1233214b5992bce79d964f08e..c8fa26ba855955712b60836e5ed371c891969691 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/PhiRange.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/PhiRange.h @@ -19,7 +19,7 @@ namespace LVL1 { public: PhiRange(); PhiRange( double min, double max ); - virtual ~PhiRange(); + ~PhiRange() = default; double min() const; double max() const; diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/Range.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/Range.h index f413ca52739cc591a8214fc32ca6964f258ac1c3..98df82f9fe422e146799078aa63d81bc095b35d8 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/Range.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/Range.h @@ -19,7 +19,7 @@ namespace LVL1 { public: Range() ; Range( double min, double max ); - virtual ~Range(); + ~Range() = default; double min() const; double max() const; diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/TrigT1CaloDefs.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/TrigT1CaloDefs.h index 2b5ae2235d4ac55cbc9a3f4c2f47935e0d403bce..70337e3a7e96c177ea6dc6665d0e8a88444cdfcd 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/TrigT1CaloDefs.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/TrigT1CaloDefs.h @@ -34,6 +34,7 @@ public: static const std::string TriggerTowerLocation; static const std::string xAODTriggerTowerLocation; + static const std::string xAODTriggerTowerRerunLocation; static const std::string CPMTowerLocation; static const std::string JetElementLocation; diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/iRecCoordRoI.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/iRecCoordRoI.h index b22be68336bd99994d09540e88a689dc9fe9f2c1..35ea8f22f5be8c21a2f78767e530907fce71fd81 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/iRecCoordRoI.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/iRecCoordRoI.h @@ -27,7 +27,7 @@ class iRecCoordRoI { public: iRecCoordRoI(); - virtual ~iRecCoordRoI(); + virtual ~iRecCoordRoI() = default; /** override this method & return eta coord */ virtual double eta() const = 0; /** override this method & return phi coord */ diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/Coordinate.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/Coordinate.cxx index 5a41447dc4d49a6f0c9121477b6d41c635da9a20..8dc6efc97fdd090aea20a62bc8500344359ca1a9 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/Coordinate.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/Coordinate.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** Coordinate.cxx - description @@ -27,11 +27,6 @@ namespace LVL1 { } - // Destructor - Coordinate::~Coordinate() { - - } - /** change coords of an existing Coordinate object*/ void Coordinate::setCoords( double phi, double eta ) { diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/CoordinateRange.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/CoordinateRange.cxx index 4bf3383ed2b69fa38e3588102d1663f73f31216e..aba45f67628977da7d103b7f8dfc6b0af603a1cd 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/CoordinateRange.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/CoordinateRange.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** CoordinateRange.cxx - description @@ -22,9 +22,6 @@ CoordinateRange::CoordinateRange(double phiMin, double phiMax, double etaMin, CoordinateRange::CoordinateRange() : m_phiRange(0.0, 0.0), m_etaRange(0.0, 0.0) {} -// Destructor -CoordinateRange::~CoordinateRange() {} - /** change coords of an existing CoordinateRange object*/ void CoordinateRange::setRanges(double phiMin, double phiMax, double etaMin, double etaMax) { diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/MuCTPIL1Topo.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/MuCTPIL1Topo.cxx index 040504058a0022598fec7bbf1456dd16b179774a..541e4d09b82ca6dd2019ff9cf60cc144b77c3ae5 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/MuCTPIL1Topo.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/MuCTPIL1Topo.cxx @@ -13,10 +13,6 @@ namespace LVL1 { m_muonTopoCandidates = candList; } - MuCTPIL1Topo::~MuCTPIL1Topo() { - - } - MuCTPIL1Topo& MuCTPIL1Topo::operator=( const MuCTPIL1Topo& a ) { clearCandidates(); diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/MuCTPIL1TopoCandidate.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/MuCTPIL1TopoCandidate.cxx index 81f3c0e58bc1938b3acf404cf614c4762b287a93..d4d43b48ce7174d9e6f1496e9479e95262dd69f3 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/MuCTPIL1TopoCandidate.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/MuCTPIL1TopoCandidate.cxx @@ -13,9 +13,6 @@ namespace LVL1 { m_bcid(0), m_ptThresholdID(0), m_ptL1TopoCode(0), m_ptValue(0), m_eta(0), m_phi(0), m_etacode(0), m_phicode(0), m_etamin(0), m_etamax(0), m_phimin(0), m_phimax(0), m_roiWord(0), m_mioctID(0), m_ieta(0), m_iphi(0) {} - MuCTPIL1TopoCandidate::~MuCTPIL1TopoCandidate() { - - } void MuCTPIL1TopoCandidate::setCandidateData(std::string sectorName, unsigned int roiID, unsigned int bcid, diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/PhiRange.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/PhiRange.cxx index f82d1328871c953515ad6c2afbe06c78a686ab69..d8b7be3b46cf26abb06a32d49880e0b0003feda8 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/PhiRange.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/PhiRange.cxx @@ -27,10 +27,6 @@ namespace LVL1 { checkValues(); } - PhiRange::~PhiRange() { - - } - double PhiRange::min() const { return m_min; } diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/Range.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/Range.cxx index 2d4de1344fa89d123e347eecbc64654fa56dc20d..eba9169d695c903ed2aada90c6102a5057f850d5 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/Range.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/Range.cxx @@ -23,10 +23,6 @@ namespace LVL1 { checkValues(); } - Range::~Range() { - - } - double Range::min() const { return m_min; } diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/TrigT1CaloDefs.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/TrigT1CaloDefs.cxx index 0ea2624a6fe9b24538b96b928d237fe795a6da0e..9e8b04eced7c1389048b655668d368d7a64f74e6 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/TrigT1CaloDefs.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/TrigT1CaloDefs.cxx @@ -29,6 +29,7 @@ const std::string TrigT1CaloDefs::AtlfastCellContainerLocation="/Event/AtlfastCe const std::string TrigT1CaloDefs::TriggerTowerLocation="TriggerTowers"; const std::string TrigT1CaloDefs::xAODTriggerTowerLocation="xAODTriggerTowers"; +const std::string TrigT1CaloDefs::xAODTriggerTowerRerunLocation="xAODTriggerTowers_rerun"; const std::string TrigT1CaloDefs::JetElementLocation="JetElements"; const std::string TrigT1CaloDefs::CPMTowerLocation="CPMTowers"; diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/iRecCoordRoI.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/iRecCoordRoI.cxx index a56186926de4de4be2ff8fd5e3f5c953bc443efb..cfb5a4790fa0d5ded6b1900c8e8831d16ce7d4ed 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/iRecCoordRoI.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/iRecCoordRoI.cxx @@ -12,5 +12,3 @@ iRecCoordRoI::iRecCoordRoI(){ } -iRecCoordRoI::~iRecCoordRoI(){ -} diff --git a/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test.conf b/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test.conf deleted file mode 100644 index b0c2786aeffadd8f8db3887386dc235c9d725899..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test.conf +++ /dev/null @@ -1,694 +0,0 @@ -# For a full documentation see: -# http://atlas-sw.cern.ch/cgi-bin/viewcvs-atlas.cgi/offline/Trigger/TrigValidation/TriggerTest/Testing/trigtest.conf?revision=HEAD&view=markup - - -# -# Note that references are on /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_ -# the */online/* folder might be merged in the future with offline refernce area -# - - -################################################ -# Infrastructure tests -################################################ -test 1 - name HelloWorldHLT - doc HelloWorld in athenaHLT - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -n 10 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data AthExHelloWorld/HelloWorldOptions.py - -test 2 - name HelloWorldHLT_run_stop_run - doc HelloWorld int athenaHLT with start/stop/start transition - stdinfile run-stop-run-saveHist.trans - checklog --config checklogTrigP1Test.conf --showexcludestats - customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000001_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH - athena_cmd athenaHLT.py -i -M --rewind -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data AthExHelloWorld/HelloWorldOptions.py - -test 3 - name MTMonHistOH - doc Histogram publishing test with OH infrastructure - # note testMonHistOH.py invokes athenaHLT with MTMonHist.py job options - # note that MTMonHist.py jo are in the HLT project - pre_command get_joboptions MTMonHist.py - athena_cmd testMonHistOH.py /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/daq.physicsMCppv2.latest.data - checklog --config checklogTrigP1Test.conf --showexcludestats - -################################################################################ -# Test of Physics_pp_V5 and Physics_pp_V6 menu, main test of trigger, this is run on the PUs -################################################################################ - -test 10 - name HLT_physicsV5 - doc athenaHLT on data with Physics_pp_v5 menu currently from 2015 EB data - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV5.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV5.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV5.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV5 -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data15_13TeV.00276952.physics_EnhancedBias.merge.RAW._lb0113._SFO-ALL._0001.data -c 'testPhysicsV5=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV5._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - - - - -test 13 - name HLT_physicsV7_rerunLVL1 - doc athenaHLT on data with Physics_pp_v6 menu currently from 2016 EB data - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_rerunLVL1.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_rerunLVL1.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_rerunLVL1.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_rerunLVL1 -n 25 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;rerunLVL1=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7_rerunLVL1._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - - -test 15 - name HLT_physicsV6_L1Topo_sim - doc athenaHLT on simulated data including L1Topo ROI & DAQ ROB decoding with Physics_pp_v6 menu, data is cosmics from M7 with sim L1Topo ROBFs merged in, override ROB Ids as sim data used different convention - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_L1Topo_sim.reference - customrootcomp rootcomp_l1topo.sh /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_L1Topo_sim.root - extra_failure_codes ROOTCOMP_MISMATCH - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_L1Topo_sim.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV6_L1Topo_sim -n 10 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data14_cos.00247688_mergedL1Topo._0001.data --extra-l1r-robs '[9502848,9502864]' --log-level INFO,ERROR -c 'testPhysicsV6=True;doValidation=True;L1TopoCheck=True;fpeAuditor=True' -C 'L1TopoROBMonitor.L1TopoDAQROBIDs=[0x00910001,0x00910011]; L1TopoROBMonitor.L1TopoROIROBIDs=[0x00910080,0x00910090]; L1TopoROBMonitor.useDetMask=False; svcMgr.ByteStreamAddressProviderSvc.TopoProcModuleID=[0x80,0x90]; from L1TopoByteStream.L1TopoByteStreamConf import L1TopoByteStreamTool; l1TopoByteStreamTool=L1TopoByteStreamTool(); l1TopoByteStreamTool.ROBSourceIDs=[0x00910001,0x00910011]; svcMgr.ToolSvc+=l1TopoByteStreamTool' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_command plotL1TopoROBMonHist.py expert-monitoring.root 2>/dev/null - -test 16 - name HLT_physicsV7_L1Topo_data - doc athenaHLT on online test data including L1Topo ROI & DAQ ROB decoding with Physics_pp_v7 menu on events selected from data15_13TeV.00278748.physics_Main - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_L1Topo_data.reference - customrootcomp rootcomp_l1topo.sh /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_L1Topo_data.root - extra_failure_codes ROOTCOMP_MISMATCH - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_L1Topo_data.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_L1Topo_data -n 10 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data15_13TeV.00278748.physics_Main.daq.RAW._lb0103._SFO-1._0001_selected.data --log-level INFO,ERROR -c 'testPhysicsV7=True;doValidation=True;L1TopoCheck=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_command plotL1TopoROBMonHist.py expert-monitoring.root 2>/dev/null - -test 17 - name HLT_physicsV6 - doc athenaHLT on data with Physics_pp_v6 menu currently from 2015 EB data - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV6 -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV6._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - -test 18 - name Reco_tf_physicsV7_savedBS - doc Reco_tf on saved output from HLT_physicsV7 - pre_condition if [[ $(find ../HLT_physicsV7/HLT_physicsV7._0001.data -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../HLT_physicsV7/HLT_physicsV7._0001.data ; else test -e non_existing_file ; fi - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; Reco_tf.py --inputBSFile ../HLT_physicsV7/HLT_physicsV7._0001.data --maxEvents 2 --autoConfiguration='everything' --conditionsTag "CONDBR2-BLKPA-2017-11" --geometryVersion "ATLAS-R2-2016-01-00-01" --preExec 'r2e:from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)' --outputESDFile HLT_physicsV7.ESD.pool.root - post_command checkFile.py HLT_physicsV7.ESD.pool.root > ESD.txt - post_command perl -i.clean -pe 's/^[\d:]+ //' log.RAWtoESD - post_command cat log.RAWtoESD >> Reco_tf_physicsV7_savedBS_test.log - checklog --config checklogTrigP1Test.conf --showexcludestats - -################################################################################ -# Test of MC_pp_V5 menu, will include "slow" cosmics chains from physics_pp_v5 menu--> need to split this test in two -# for the time being run this on enhanced bias, will probably time out -################################################################################ - -test 11 - name HLT_mcV5 - doc AthenaHLT on data, with MC_pp_V5 menu loose prescale set - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.root 1 HLT - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.root - athena_cmd athenaHLT.py -o HLT_mcV5 -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV5=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_mcV5._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S - -################################################################################ -# Test of MC_pp_V6 menu, will include "slow" cosmics chains from physics_pp_v5 menu--> need to split this test in two -# for the time being run this on enhanced bias, will probably time out -################################################################################ - -test 12 - name HLT_mcV6 - doc AthenaHLT on data, with MC_pp_V6 menu loose prescale set - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.root 1 HLT - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.root - athena_cmd athenaHLT.py -o HLT_mcV6 -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV6=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_mcV6._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S - - -################################################ -# Athena test on format writing RDO to BS and comparison to athenaHLT run -################################################ - - -test 20 - name AthenaP1RDO - doc Athena on Monte Carlo events, produces xml file for menu - athena_cmd athena.py -c "doRates=False" TrigP1Test/testAthenaP1RDO.py - checklog --config checklogTrigP1Test.conf --showexcludestats - regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1RDO_HLT.TrigChainMoniValidation.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1RDO.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1RDO.root 1 HLT - pre_command RecExCommon_links.sh - post_command chainDump.py -n -S - -test 21 - name AthenaP1RDOtoBS - doc Run RDO->BS using ttbar MC file - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1RDOtoBS.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1RDOtoBS.root - athena_cmd athena.py -c 'setMenu="MC_pp_v7";writeBS=True;rerunLVL1=True;jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10);PoolRDOInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"];myBSRDOOutput="AppName=Athena, OutputDirectory=./, FileTag="+setMenu+", Run=110401"' TriggerRelease/Trigger_topOptions_writeBS.py - post_command test -e data_test.00110401.Single_Stream.daq.RAW._lb0050._Athena._0001.data - -test 22 - name AthenaP1BS_standalone - doc Standalone HLT running in athena and compare to athenaHLT - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1BS_standalone.reference - rootcomp ../HLT_physicsV7/expert-monitoring.root expert-monitoring.root - checkcount ../HLT_physicsV7/expert-monitoring.root 0 BOTH - athena_cmd athena.py -c "BSRDOInput='root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data';testPhysicsV7=True;writeBS=True;rerunLVL1=True;doValidation=True;EvtMax=25" TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - - - -########################################################### -# Full menu tests on Monte Carlo using AthenaHLT -########################################################### -# - -test 30 - name HLT_MC_BSfromRDO - doc athenaHLT on MC with MC menu, input from AthenaP1RDOtoBS - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_MC_BSfromRDO.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_MC_BSfromRDO.root 0 BOTH - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_MC_BSfromRDO.root -# note ._0001.data is added automatically - pre_condition test -e ../AthenaP1RDOtoBS/data_test.00105200.Single_Stream.daq.RAW._lb0016._Athena._0001.data - # The geometry and conditions tag need to match the ones used in AthenaP1RDOtoBS - athena_cmd athenaHLT.py -l DEBUG -f ../AthenaP1RDOtoBS/data_test.00105200.Single_Stream.daq.RAW._lb0016._Athena._0001.data -c 'HLTOutputLevel=DEBUG;testMCV6MC=True;rerunLVL1=True;setDetDescr="ATLAS-R1-2012-02-00-00";setGlobalTag="OFLCOND-DR-BS7T-ANom-11";setPrescale="";doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - - -###################################################################################### -# -# Tests for T0 Reconstruction on a BS file produced with P1HLT cache currently, running on cosmics during M7 and M8 included in physics_v6 -# -###################################################################################### - - -# todo: get automatically what is currently running from ami -# conditionsTag and geometryVersion need to be updated from time to time -test 41 - name Trigreco_physicsV7_currentT0 - doc Trig_reco_tf with current T0 config - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd Trig_reco_tf.py --inputBS_RDOFile "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/data15_13TeV.00272531.physics_Main.daq.RAW._lb0104._SFO-5._0001.data" --precommand "testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True" --maxEvents '15' --outputBSFile "tmp.BS" ; source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; Reco_tf.py --inputBSFile "tmp.BS" --athenaopts=" --perfmon " --outputHISTFile 'myHIST.root' --outputAODFile 'myAOD.pool.root' --outputESDFile 'myESD.pool.root' --outputNTUP_MUONCALIBFile 'myNTUP_MUONCALIB.root' --autoConfiguration='everything' --conditionsTag "CONDBR2-BLKPA-2017-11" --geometryVersion "ATLAS-R2-2016-01-00-01" --preExec 'r2e:from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)' --triggerConfig r2e=DATARECO:REPR - post_command checkFile.py myAOD.pool.root > AOD.txt - - -test 42 - name TrigEDMCheck_physicsV7_currentT0_ESD - doc EDMCheck on TrigEDMCheck_physicsV7_currentT0 - joboptions testAthenaP1ESD_TrigEDMCheck_data.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_TrigEDMCheck_physicsV7_currentT0.reference - pre_condition if [[ $(find ../Trigreco_physicsV7_currentT0/myESD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../Trigreco_physicsV7_currentT0/myESD.pool.root ; else test -e non_existing_file ; fi - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; athena.py -c 'fileList=["../Trigreco_physicsV7_currentT0/myESD.pool.root"]' - -test 43 - name TrigEDMCheck_physicsV7_currentT0_AOD - doc EDMCheck on TrigEDMCheck_physicsV7_currentT0 - joboptions testAthenaP1ESD_TrigEDMCheck_data.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_TrigEDMCheck_physicsV7_currentT0.reference - pre_condition if [[ $(find ../Trigreco_physicsV7_currentT0/myAOD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../Trigreco_physicsV7_currentT0/myAOD.pool.root ; else test -e non_existing_file ; fi - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; athena.py -c 'fileList=["../Trigreco_physicsV7_currentT0/myAOD.pool.root"]' - - -### this does not work due to conditions... -test 44 - name Trig_reco_mcV6_currentT0 - doc Trig_reco_tf with current T0 config - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd Trig_reco_tf.py --inputBS_RDOFile=/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data12_8TeV.00212967.physics_EnhancedBias.merge_eb_zee_zmumu_cc.RAW._lb0291._SFO-5._0001.data --precommand 'testMCV6=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;useCONDBR2=False;setGlobalTag="COMCOND-HLTP-004-03-VAL-01";setDetDescr="ATLAS-R1-2012-02-00-00"' --outputHISTFile 'myHIST.root' --outputAODFile 'myAOD.pool.root' --outputESDFile 'myESD.pool.root' --outputNTUP_MUONCALIBFile 'myNTUP_MUONCALIB.root' --asetup r2e:AtlasProduction,20.7.X.Y,latest_copied_release e2a:AtlasProduction,20.7.X.Y,latest_copied_release --beamType 'cosmics' --autoConfiguration='everything' --maxEvents '15' --preExec 'r2e:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArHVCorr=False;jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False);from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True);InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False);DQMonFlags.doStreamAwareMon=False;DQMonFlags.enableLumiAccess=False;from JetRec.JetRecFlags import jetFlags;jetFlags.useTracks=False;DQMonFlags.doCTPMon=False;' --geometryVersion all:ATLAS-R2-2015-02-00-00 --conditionsTag all:CONDBR2-BLKPA-2015-02 --triggerConfig r2e=DATARECO:REPR - post_command checkFile.py myESD.pool.root > ESD.txt - - -test 45 - name TrigEDMCheck_mcV6_currentT0 - doc EDMCheck on Trig_reco_mcV6_currentT0 - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_TrigEDMCheck_mcV6_currentT0.reference - pre_condition test if [[ $(find ../Trig_reco_mcV6_currentT0/myESD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../Trig_reco_mcV6_currentT0/myESD.pool.root ; else test -e non_existing_file ; fi - pre_command ln -s ../Trig_reco_mcV6_currentT0/myESD.pool.root ESD.pool.root - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; athena.py -c 'fileList=["ESD.pool.root"]' TrigP1Test/testAthenaP1ESD_TrigEDMCheck_data.py - - -test 46 - name Trigreco_dbgstream_T0 - doc Trig_reco_tf using debug_stream setup as is run at T0 - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd cp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_cos.00291509.physics_Main.daq.RAW._lb0009._SFO-3._0001.data data16_cos.00291509.physics_Main.daq.RAW._lb0009._SFO-3._0001.data ; source /afs/cern.ch/user/t/trigcomm/public/tzero/setup_debugrec.sh ; python -u `which Trig_reco_tf.py` --argJSON=/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_cos.00291509.physics_Main.daq.RAW.job.argdict.json - - post_command test -e data16_cos.00291509.physics_Main.debug_rec.daq.RAW.g49._0001.data - - - -################################################################################ -# physics_v6 menu on cosmics 2012/2015 -################################################################################ - - -test 49 - name HLT_physicsV7_COS - doc athenaHLT on data with Physics_pp_v7 menu currently cosmics from 2016 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_COS -n 250 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_cos.00306147.physics_Main.daq.RAW._lb0494._SFO-4._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7_COS._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - - - - - -test 50 - name HLT_physicsV6_COS_2012 - doc athenaHLT standalone with physicsV6 menu on COSMICS 2012 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2012.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2012.root 1 HLT - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2012.root - athena_cmd athenaHLT.py -o HLT_physicsV6_COS_2012 -n 100 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_cos.00214912.express_express.merge.RAW._lb0184._SFO-ALL._0001.1 -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doValidation=True;doCosmics=True;useCONDBR2=False;setGlobalTag="COMCOND-HLTP-004-03-VAL-01";setDetDescr="ATLAS-R1-2012-02-00-00";fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV6_COS_2012._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - - -test 51 - name HLT_physicsV7_COS_2016MUONS - doc athenaHLT on data with Physics_pp_v6 menu currently cosmics from 2016 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS_2016MUONS.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS_2016MUONS.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS_2016MUONS.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_COS_2016MUONS -n 100 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_cos.00306147.physics_CosmicMuons.merge.RAW._lb0494._SFO-ALL._0001.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7_COS_2016MUONS._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - - -test 52 - name HLT_physicsV7_COS_2016IDCOSMICS - doc athenaHLT on data with Physics_pp_v6 menu currently cosmics from 2016 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS_2016IDCOSMICS.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS_2016IDCOSMICS.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_COS_2016IDCOSMICS.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_COS_2016IDCOSMICS -n 100 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_cos.00306147.physics_IDCosmic.merge.RAW._lb0494._SFO-ALL._0001.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7_COS_2016IDCOSMICS._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - - -test 53 - name HLT_physicsV6_COS_2015CALO - doc athenaHLT on data with Physics_pp_v6 menu currently cosmics from 2015 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015CALO.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015CALO.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015CALO.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV6_COS_2015CALO -n 100 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data15_cos.00256721.physics_CosmicCalo.merge.RAW._lb0403._SFO-ALL._0001.1 -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV6_COS_2015CALO._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - -test 54 - name HLT_physicsV6_COS_2015MBTS - doc athenaHLT on data with Physics_pp_v6 menu currently cosmics from M9 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015MBTS.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015MBTS.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015MBTS.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV6_COS_2015MBTS -n 100 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data15_cos.00257588.physics_L1MinBias.merge.RAW._lb0XXX._SFO-ALL._0001.1 -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV6_COS_2015MBTS._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - - -################################################################################ -# DB upload tests on Physics_pp_V6 menu inclusing running from the db (currently not possible as old triggertool has no cmdline option top run old physics_pp lvl1 menu) -################################################################################ - - - - -test 61 - name HLT_physicsV7_menu - doc Run athenaHLT on all events to create trigger configuration - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -M -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o HLT_physicsV7_menu -c 'testPhysicsV7=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - -test 63 - name HLT_physicsV7_rerun - doc Recreate trigger configuration and compare with configuration from HLT_physicsV7_menu - athena_cmd athenaHLT.py -M -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o HLT_physicsV7_rerun -c 'testPhysicsV7=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - -test 64 - name CheckKeysV7 - doc compare the SMK created from the HLT_physicsV7 first and rerun jobs - pre_condition test -e ../HLT_physicsV7_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV7_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV7_menu/outputHLT*xml - pre_condition test -e ../HLT_physicsV7_rerun/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV7_rerun/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV7_rerun/outputHLT*xml - checklog --config checklogTrigP1Test.conf --showexcludestats | grep -v "checking for" - athena_cmd testCheckKeys.sh --menu HLT_physicsV7 - - -## Compare JO vs DB also with rerunLvl1 to test the reprocessing on run1 data - -test 71 - name HLT_physicsV7_rerunLVL1_menu - doc Run athenaHLT on all events to create trigger configuration - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -M -n 25 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o HLT_physicsV7_rerunLVL1_menu -c 'doDBConfig=True;testPhysicsV7=True;rerunLVL1=True;trigBase="Default";enableCostForCAF=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - - -############################################################################################# -## Transform tests on BS from main HLT_physicsV7 test -## conditionsTag and geometryVersion need to be updated from time to time -############################################################################################# -test 80 - name RAWtoESD_physicsV7 - doc RAWtoESD on output from HLT_physicsV7 - checklog --config checklogTrigP1Test.conf --showexcludestats - pre_condition test -e '../HLT_physicsV7/HLT_physicsV7._0001.data' - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; Reco_tf.py --preExec 'from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)' --autoConfiguration 'everything' --conditionsTag "CONDBR2-BLKPA-2017-11" --geometryVersion "ATLAS-R2-2016-01-00-01" --inputBSFile ../HLT_physicsV7/HLT_physicsV7._0001.data --maxEvents 5 --outputESDFile RAWtoESD.pool.root - post_command checkFile.py RAWtoESD.pool.root > ESD.txt - -test 81 - name TrigEDMCheck_physicsV7 - doc EDM checker on ESD from RAWtoESD_physicsV7 - joboptions testAthenaP1ESD_TrigEDMCheck_data.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_TrigEDMCheck_physicsV7.reference - pre_condition if [[ $(find ../RAWtoESD_physicsV7/RAWtoESD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../RAWtoESD_physicsV7/RAWtoESD.pool.root ; else test -e non_existing_file ; fi - pre_command ln -s ../RAWtoESD_physicsV7/RAWtoESD.pool.root ESD.pool.root - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; athena.py -c 'fileList=["ESD.pool.root"]' - -test 82 - name TrigDecTool_physicsV7 - doc Check of TrigDec for events produced by RAWtoESD_physicsV7 - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_TrigDecTool_physicsV7.reference - pre_condition if [[ $(find ../RAWtoESD_physicsV7/RAWtoESD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../RAWtoESD_physicsV7/RAWtoESD.pool.root ; else test -e non_existing_file ; fi - pre_command ln -s ../RAWtoESD_physicsV7/RAWtoESD.pool.root ESD.pool.root - athena_cmd athena.py -c 'fileList=["ESD.pool.root"]' TrigP1Test/testAthenaP1ESD_TrigDecTool.py - -#test 83: Reco_tf_mcV7_savedBS got migrated to test 18: Reco_tf_physicsV7_savedBS -test 83 - name Reco_tf_mcV7_savedBS - doc Reco_tf on saved output from HLT_mcV7 - checklog --config checklogTrigP1Test.conf --showexcludestats - pre_command linktoP1HLT.sh mcV7 - athena_cmd Reco_tf.py --inputBSFile link_to_file_from_P1HLT.data --maxEvents 10 --outputESDFile data12_mcV7.ESD.pool.root - - -############################################################################################# -## Infrastructure tests on run/stop/run transitions -############################################################################################# -test 100 - name HLT_physicsV7_run_stop_run - doc athenaHLT on data with physics_pp_V7 menu with stop/start transition - stdinfile run-stop-run-saveHist.trans - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - customregtest regtest_multirun.sh atn_test.log - customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000001_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH ATHENA_REGTEST_FAILED - athena_cmd athenaHLT.py -i -M --rewind -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - - -############################################################################################# -## Additional Infrastructure tests -############################################################################################# - -# mrammens: localhost partition test goes to a new test suite-- remove this test here -test 111 - name AllPartition_physicsV6 - doc Physics_pp_v4 menu in localhost L2+EF partition - joboptions runHLT_standalone.py - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd part_runTest.sh part_lhl2ef - customregtest part_regtest.sh ../HLT_physicsV6/HLT_physicsV6.reference.new ../HLT_physicsV6/HLT_physicsV6.reference.new - customrootcomp part_rootcomp.sh ../HLT_physicsV6/expert-monitoring.root ../HLT_physicsV6/expert-monitoring.root - post_command cleanuplog.sh runHLT_standalone_test.log - -test 112 - name HLT_physicsV7_magField_on_off_on - doc athenaHLT on data with physicsV7 menu with On and Off magnetic field transition - pre_command get_files -jo setMagFieldCurrents.py - stdinfile magFieldOnOff.trans - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - customregtest regtest_multirun.sh atn_test.log 1 3 - customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000002_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH ATHENA_REGTEST_FAILED - athena_cmd athenaHLT.py -i -M --rewind -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - - -test 113 - name HLT_physicsV7_beamspot - doc Test of beamspot udpate with athenaHLT - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # DO NOT change the number of events for this test - athena_cmd athenaHLT.py -Z TrigP1Test.BeamSpotUpdate -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;doValidation=True;BeamspotFromSqlite=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - -test 114 - name HLT_physicsV6_nocache - doc athenaHLT on data with physics_pp_v6 menu, no caching in steering, use HLT_physicsV6 as reference - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - checkcount ../HLT_physicsV6/expert-monitoring.root 0 HLT - athena_cmd athenaHLT.py -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_8TeV.00212967.physics_eb_zee_zmumu_cc._0001.data -oHLT_physicsV6_nocache -c 'testPhysicsV6=True;noCaching=True;HLTOutputLevel=INFO;doValidation=True;useCONDBR2=False;setGlobalTag="COMCOND-HLTP-004-03-VAL-01";setDetDescr="ATLAS-R1-2012-02-00-00";fpeAuditor=True' TriggerRelease/runHLT_standalone.py - - -################################################################################ -# Test of ALFA -################################################################################# - - - -test 120 - name HLT_physicsV7_ALFAMon - doc athenaHLT with ALFA monitoring enabled, with Physics_pp_v6 menu, on run 2 data with ALFA in (see ATR-12448) - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_ALFAMon.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_ALFAMon.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_ALFAMon.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_ALFAMon -n 105 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data15_13TeV.00277025.physics_MinBias.merge.RAW._lb0500._SFO-1._0001.1 --log-level INFO,ERROR -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;enableALFAMon=True;trigBase="Default";fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - -################################################################################ -# Test of mcV6 menu for CAF reprocessing -################################################################################ - -test 130 - name HLT_mcV6_caf - doc athenaHLT on data with MC_pp_V6 menu for caf reprocessing - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -n 1 -M -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_mcV6_caf -c 'testMCV6=True;caf=True;trigBase="Default";doDBConfig=True;rerunLVL1=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - -test 131 - name HLT_physicsV6_caf - doc athenaHLT on data with Physics_pp_V6 menu for caf reprocessing - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -n 1 -M -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_physicsV6_caf -c 'testPhysicsV6=True;caf=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - -test 132 - name PrepareMenuKeys_physicsV6_caf - doc Prepares SMKs created from the HLT_physicsV6_caf tests - pre_condition test -e ../HLT_physicsV6_caf/outputHLTconfig_L2PU-1.xml - pre_condition test -e ../HLT_physicsV6_caf/l2_Default_setup.txt - pre_condition test -e ../HLT_physicsV6_caf/l2_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV6_caf/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV6_caf/ef_Default_setup_setup.txt - - athena_cmd testPrepareMenuKeysSelfX.sh physicsV6_caf - - -test 133 - name PrepareMenuKeys_mcV6_caf - doc Prepares SMKs created from the All*T_mcV6_caf tests - pre_condition test -e ../HLT_mcV6_caf/outputHLTconfig_L2PU-1.xml - pre_condition test -e ../HLT_mcV6_caf/l2_Default_setup.txt - pre_condition test -e ../HLT_mcV6_caf/l2_Default_setup_setup.txt - pre_condition test -e ../HLT_mcV6_caf/ef_Default_setup.txt - pre_condition test -e ../HLT_mcV6_caf/ef_Default_setup_setup.txt - - athena_cmd testPrepareMenuKeysSelfX.sh mcV6_caf - -test 134 - name PrepareMenuKeys_p1 - doc Prepares SMKs created from the All*T_physicsV6_menu test - pre_condition test -e ../HLT_physicsV6_menu/outputHLTconfig_L2PU-1.xml - pre_condition test -e ../HLT_physicsV6_menu/l2_Default_setup.txt - pre_condition test -e ../HLT_physicsV6_menu/l2_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV6_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV6_menu/ef_Default_setup_setup.txt - - athena_cmd testPrepareMenuKeysSelfX.sh physicsV6_menu - - - - -##Heavy Ion menu tests -# -# -# -# -test 159 - name HLT_HIV4 - doc athenaHLT standalone with HLT_HIV3 menu on a HI sample - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV4.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV4.root 1 L2 - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV4.root - athena_cmd athenaHLT.py -o HLT_HIV4 -n 25 -f '/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_hip5TeV.00312649.physics_EnhancedBias.merge.RAW._lb0150._SFO-ALL._0001.data' -c 'testHIV4=True;rerunLVL1=False;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_HIV3._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S - -test 160 - name HLT_HIV3 - doc athenaHLT standalone with HLT_HIV3 menu on a HI sample - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.root 1 L2 - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.root - athena_cmd athenaHLT.py -o HLT_HIV3 -n 25 -f '/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data15_hi.00287270.physics_HardProbes.daq.RAW._lb0122._SFO-1._0001.data' -c 'testHIV3=True;rerunLVL1=False;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True;setDetDescr="ATLAS-R2-2015-04-00-00";setGlobalTag="CONDBR2-HLTP-2016-01";from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_HIV3._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S - -################################################################################################################################################### -#0 #Steering Group - extremely fast! - -test 161 - name pureSteering_ecodes - doc stand-alone test of the steering with useErrorHandlingMenu - joboptions pureSteering_jobOptions.py - athena_args -c 'useErrorHandlingMenu=True' - regtest TrigSteer_HLT.ResultBuilder REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_pureSteering_ecodes_TrigSteer_HLT.ResultBuilder.reference - -test 162 - name pureSteering_prescaling - doc stand-alone test of the steering with the PrescaleMenu - joboptions pureSteering_jobOptions.py - athena_args -c 'repeat=100; usePrescaleMenu=True' - regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_pureSteering_prescaling_TrigSteer_HLT.ChainMoni.reference - -test 163 - name pureSteering - doc stand-alone test of the steering - joboptions pureSteering_jobOptions.py - regtest TrigSteer_HLT.ResultBuilder REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_pureSteering_TrigSteer_HLT.ResultBuilder.reference - - -########################## -# Steering test: ROBs access , slow 1h - -test 164 - name AthenaTrigBS_L2EFMerging - doc testing trigger results w/wo merging L2/EF, based on AthenaTrigRDO with run_standalone.py - joboptions testAthenaL2EFMerging.py - athena_args -c 'EvtMax=15; testPhysicsV7=True; BSRDOInput="root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data"' - #athena_args -c 'doHLT=True; useCONDBR2=False; setGlobalTag="COMCOND-HLTP-004-03-VAL-01"; setDetDescr="ATLAS-R1-2012-02-01-00"; EvtMax=15; testPhysicsV6=True; BSRDOInput="root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_8TeV.00212967.physics_eb_zee_zmumu_cc._0001.data"' - checklog --config checklogTriggerTest.conf --showexcludestats - checkmerge expert-monitoring.root /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigBS_L2EFMerging.root 0 - post_command chainDump.py -n -S - - -################################################################################ -# Test of physicsV6 menu for DataSouting -################################################################################ -test 170 - name HLT_physicsV7_DataScouting - doc athenaHLT on data with Physics_pp_v6 menu, test output of DataScouting containers - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -n50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -o ds_test_data_out -c 'testJet=True;testMuon=True;testPhysicsV7=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command trigbs_dumpHltDsData.py -v1 ds_test_data_out._0001.data >> atn_test.log - -################################################################################ -# Tests of physicsV7 menu -################################################################################ - -test 180 - name HLT_mcV7 - doc AthenaHLT on data, with MC_pp_V7 menu loose prescale set - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV7.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV7.root 1 HLT - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV7.root - athena_cmd athenaHLT.py -o HLT_mcV7 -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV7=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - -test 181 - name HLT_physicsV7 - doc athenaHLT on data with Physics_pp_v7 menu currently from 2016 EB data - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7 -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - extra_failure_codes ATHENA_ERROR_IN_LOG - -test 182 - name HLT_physicsV7_FTK - doc athenaHLT on data with Physics_pp_v7 menu and doFTK currently from 2016 EB data with FTK added - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_FTK.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_FTK.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV7_FTK.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_FTK -n 75 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/RAW.11043881._020686.pool.root.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True;from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.doFTK=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S diff --git a/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test_ART.conf b/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test_ART.conf deleted file mode 100644 index 4b8963abde129da7dcbcb220d097e391a463dab6..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/Testing/TrigP1Test_ART.conf +++ /dev/null @@ -1,979 +0,0 @@ -# For a full documentation see: -# http://atlas-sw.cern.ch/cgi-bin/viewcvs-atlas.cgi/offline/Trigger/TrigValidation/TriggerTest/Testing/trigtest.conf?revision=HEAD&view=markup - - -# -# Note that references are on /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_ -# the */online/* folder might be merged in the future with offline refernce area -# - -# -# ART tests migrated from TrigP1Test.conf (contact: Daniele Zanzi @ cern.ch) -# - -################################################ -# Infrastructure tests -################################################ -test 1 - name HelloWorldHLT - doc HelloWorld in athenaHLT - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -n 10 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 AthExHelloWorld/HelloWorldOptions.py - -test 2 - name HelloWorldHLT_run_stop_run - doc HelloWorld int athenaHLT with start/stop/start transition - stdinfile run-stop-run-saveHist.trans - checklog --config checklogTrigP1Test.conf --showexcludestats - customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000001_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH - athena_cmd athenaHLT.py -i -M --rewind -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 AthExHelloWorld/HelloWorldOptions.py - -# ART not migrated -#test 3 -# name MTMonHistOH -# doc Histogram publishing test with OH infrastructure -# # note testMonHistOH.py invokes athenaHLT with MTMonHist.py job options -# # note that MTMonHist.py jo are in the HLT project -# pre_command get_joboptions MTMonHist.py -# athena_cmd testMonHistOH.py /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/daq.physicsMCppv2.latest.data -# checklog --config checklogTrigP1Test.conf --showexcludestats - -################################################################################ -# Test of Physics_pp_V5 and Physics_pp_V6 menu, main test of trigger, this is run on the PUs -################################################################################ - -# ART not migrated -#test 10 -# name HLT_physicsV5 -# doc athenaHLT on data with Physics_pp_v5 menu currently from 2015 EB data -# filterlog filterREGTEST.py -# checklog --config checklogTrigP1Test.conf --showexcludestats -# fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV5.reference -# rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV5.root -# checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV5.root 1 HLT -# athena_cmd athenaHLT.py -o HLT_physicsV5 -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data15_13TeV.00276952.physics_EnhancedBias.merge.RAW._lb0113._SFO-ALL._0001.data -c 'testPhysicsV5=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -## post_command save_to_refdir.sh HLT_physicsV5._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest -# post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs -# post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - - -test 13 - name HLT_physicsV7_rerunLVL1 - doc athenaHLT on data with Physics_pp_v7 menu currently from 2016 EB data - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix reference - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_rerunLVL1/trigp1test_HLT_physicsV7_rerunLVL1.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_rerunLVL1/trigp1test_HLT_physicsV7_rerunLVL1.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_rerunLVL1/trigp1test_HLT_physicsV7_rerunLVL1.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_rerunLVL1 -n 25 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;rerunLVL1=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7_rerunLVL1._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S -# TODO: fix reference - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_rerunLVL1/trigp1test_checkHistathenaHLT.reference - - -test 15 - name HLT_physicsV6_L1Topo_sim - doc athenaHLT on simulated data including L1Topo ROI & DAQ ROB decoding with Physics_pp_v6 menu, data is cosmics from M7 with sim L1Topo ROBFs merged in, override ROB Ids as sim data used different convention - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_L1Topo_sim.reference - customrootcomp rootcomp_l1topo.sh /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_L1Topo_sim.root - extra_failure_codes ROOTCOMP_MISMATCH - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_L1Topo_sim.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV6_L1Topo_sim -n 10 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data14_cos.00247688_mergedL1Topo._0001.data --extra-l1r-robs '[9502848,9502864]' --log-level INFO,ERROR -c 'testPhysicsV6=True;doValidation=True;L1TopoCheck=True;fpeAuditor=True' -C 'L1TopoROBMonitor.L1TopoDAQROBIDs=[0x00910001,0x00910011]; L1TopoROBMonitor.L1TopoROIROBIDs=[0x00910080,0x00910090]; L1TopoROBMonitor.useDetMask=False; svcMgr.ByteStreamAddressProviderSvc.TopoProcModuleID=[0x80,0x90]; from L1TopoByteStream.L1TopoByteStreamConf import L1TopoByteStreamTool; l1TopoByteStreamTool=L1TopoByteStreamTool(); l1TopoByteStreamTool.ROBSourceIDs=[0x00910001,0x00910011]; svcMgr.ToolSvc+=l1TopoByteStreamTool' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_command plotL1TopoROBMonHist.py expert-monitoring.root 2>/dev/null - -test 16 - name HLT_physicsV7_L1Topo_data - doc athenaHLT on online test data including L1Topo ROI & DAQ ROB decoding with Physics_pp_v7 menu on events selected from data15_13TeV.00278748.physics_Main - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_L1Topo_data/trigp1test_HLT_physicsV7_L1Topo_data.reference - customrootcomp rootcomp_l1topo.sh /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_L1Topo_data/trigp1test_HLT_physicsV7_L1Topo_data.root - extra_failure_codes ROOTCOMP_MISMATCH - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_L1Topo_data/trigp1test_HLT_physicsV7_L1Topo_data.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_L1Topo_data -n 10 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data15_13TeV.00278748.physics_Main.daq.RAW._lb0103._SFO-1._0001_selected.data --log-level INFO,ERROR -c 'testPhysicsV7=True;doValidation=True;L1TopoCheck=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_command plotL1TopoROBMonHist.py expert-monitoring.root 2>/dev/null - -test 17 - name HLT_physicsV6 - doc athenaHLT on data with Physics_pp_v6 menu currently from 2015 EB data - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV6 -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV6._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - -test 18 - name Reco_tf_physicsV7_savedBS - doc Reco_tf on saved output from HLT_physicsV7 - pre_condition if [[ $(find ../HLT_physicsV7/HLT_physicsV7._0001.data -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../HLT_physicsV7/HLT_physicsV7._0001.data ; else test -e non_existing_file ; fi - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; Reco_tf.py --inputBSFile ../HLT_physicsV7/HLT_physicsV7._0001.data --maxEvents 2 --autoConfiguration='everything' --conditionsTag "CONDBR2-BLKPA-2017-11" --geometryVersion "ATLAS-R2-2016-01-00-01" --preExec 'r2e:from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.useDynamicAlignFolders.set_Value_and_Lock(True)' --outputESDFile HLT_physicsV7.ESD.pool.root - post_command checkFile.py HLT_physicsV7.ESD.pool.root > ESD.txt - post_command perl -i.clean -pe 's/^[\d:]+ //' log.RAWtoESD - post_command cat log.RAWtoESD >> Reco_tf_physicsV7_savedBS_test.log - checklog --config checklogTrigP1Test.conf --showexcludestats - -################################################################################ -# Test of MC_pp_V5 menu, will include "slow" cosmics chains from physics_pp_v5 menu--> need to split this test in two -# for the time being run this on enhanced bias, will probably time out -################################################################################ - -test 11 - name HLT_mcV5 - doc AthenaHLT on data, with MC_pp_V5 menu loose prescale set - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.root 1 HLT - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV5.root - athena_cmd athenaHLT.py -o HLT_mcV5 -n 75 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV5=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_mcV5._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S - -################################################################################ -# Test of MC_pp_V6 menu, will include "slow" cosmics chains from physics_pp_v5 menu--> need to split this test in two -# for the time being run this on enhanced bias, will probably time out -################################################################################ - -test 12 - name HLT_mcV6 - doc AthenaHLT on data, with MC_pp_V6 menu loose prescale set - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.root 1 HLT - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_mcV6.root - athena_cmd athenaHLT.py -o HLT_mcV6 -n 50 -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -c 'testMCV6=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_mcV6._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S - - -################################################ -# Athena test on format writing RDO to BS and comparison to athenaHLT run -################################################ - - -test 20 - name AthenaP1RDO - doc Athena on Monte Carlo events, produces xml file for menu - athena_cmd athena.py -c "doRates=False" TrigP1Test/testAthenaP1RDO.py - checklog --config checklogTrigP1Test.conf --showexcludestats - regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1RDO_HLT.TrigChainMoniValidation.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1RDO.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_AthenaP1RDO.root 1 HLT - pre_command RecExCommon_links.sh - post_command chainDump.py -n -S - -test 21 - name AthenaP1RDOtoBS - doc Run RDO->BS using ttbar MC file - checklog --config checklogTrigP1Test.conf --showexcludestats -# TODO: fix references - fullregtest REGTEST /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/AthenaP1RDOtoBS/trigp1test_AthenaP1RDOtoBS.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/AthenaP1RDOtoBS/trigp1test_AthenaP1RDOtoBS.root - athena_cmd athena.py -c 'setMenu="MC_pp_v7";writeBS=True;rerunLVL1=True;jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10);PoolRDOInput=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"];myBSRDOOutput="AppName=Athena, OutputDirectory=./, FileTag="+setMenu+", Run=110401"' TriggerRelease/Trigger_topOptions_writeBS.py - post_command test -e data_test.00110401.Single_Stream.daq.RAW._lb0050._Athena._0001.data - -test 22 - name AthenaP1BS_standalone - doc Standalone HLT running in athena and compare to athenaHLT - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/AthenaP1BS_standalone/trigp1test_AthenaP1BS_standalone.reference - rootcomp ../HLT_physicsV7/expert-monitoring.root expert-monitoring.root - checkcount ../HLT_physicsV7/expert-monitoring.root 0 BOTH - athena_cmd athena.py -c "BSRDOInput='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1';testPhysicsV7=True;writeBS=True;rerunLVL1=True;doValidation=True;EvtMax=25" TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - - - -########################################################### -# Full menu tests on Monte Carlo using AthenaHLT -########################################################### -# - -test 30 - name HLT_MC_BSfromRDO - doc athenaHLT on MC with MC menu, input from AthenaP1RDOtoBS - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_MC_BSfromRDO.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_MC_BSfromRDO.root 0 BOTH - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_MC_BSfromRDO.root -# note ._0001.data is added automatically - pre_condition test -e ../AthenaP1RDOtoBS/data_test.00105200.Single_Stream.daq.RAW._lb0016._Athena._0001.data - # The geometry and conditions tag need to match the ones used in AthenaP1RDOtoBS - athena_cmd athenaHLT.py -l DEBUG -f ../AthenaP1RDOtoBS/data_test.00105200.Single_Stream.daq.RAW._lb0016._Athena._0001.data -c 'HLTOutputLevel=DEBUG;testMCV6MC=True;rerunLVL1=True;setDetDescr="ATLAS-R1-2012-02-00-00";setGlobalTag="OFLCOND-DR-BS7T-ANom-11";setPrescale="";doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - - -###################################################################################### -# -# Tests for T0 Reconstruction on a BS file produced with P1HLT cache currently, running on cosmics during M7 and M8 included in physics_v6 -# -###################################################################################### - - -# todo: get automatically what is currently running from ami -# conditionsTag and geometryVersion need to be updated from time to time -test 41 - name Trigreco_physicsV7_currentT0 - doc Trig_reco_tf with current T0 config - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix file, conditionsTag, geometryVersion - #athena_cmd Trig_reco_tf.py --inputBS_RDOFile "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/data15_13TeV.00272531.physics_Main.daq.RAW._lb0104._SFO-5._0001.data" --precommand "testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True" --maxEvents '15' --outputBSFile "tmp.BS" ; source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; Reco_tf.py --inputBSFile "tmp.BS" --athenaopts=" --perfmon " --outputHISTFile 'myHIST.root' --outputAODFile 'myAOD.pool.root' --outputESDFile 'myESD.pool.root' --outputNTUP_MUONCALIBFile 'myNTUP_MUONCALIB.root' --autoConfiguration='everything' --conditionsTag "CONDBR2-BLKPA-2017-11" --geometryVersion "ATLAS-R2-2016-01-00-01" --preExec 'r2e:from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.useDynamicAlignFolders.set_Value_and_Lock(True)' --triggerConfig r2e=DATARECO:REPR - athena_cmd export AMIConfig=$(cat /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/T0Config.txt); echo $AMIConfig; Trig_reco_tf.py --inputBS_RDOFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1" --precommand "testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True" --maxEvents '15' --outputBSFile "tmp.BS"; Reco_tf.py --asetup "RAWtoALL:Athena,21.0,latest" --inputBSFile "tmp.BS" --athenaopts=" --perfmon " --outputHISTFile 'myHIST.root' --outputAODFile 'myAOD.pool.root' --outputESDFile 'myESD.pool.root' --AMIConfig "${AMIConfig}" - - post_command checkFile.py myAOD.pool.root > AOD.txt - - -test 42 - name TrigEDMCheck_physicsV7_currentT0_ESD - doc EDMCheck on TrigEDMCheck_physicsV7_currentT0 - joboptions testAthenaP1ESD_TrigEDMCheck_data.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/TrigEDMCheck_physicsV7_currentT0_ESD/trigp1test_TrigEDMCheck_physicsV7_currentT0.reference - pre_condition if [[ $(find ../Trigreco_physicsV7_currentT0/myESD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../Trigreco_physicsV7_currentT0/myESD.pool.root ; else test -e non_existing_file ; fi - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; athena.py -c 'fileList=["../Trigreco_physicsV7_currentT0/myESD.pool.root"]' - -test 43 - name TrigEDMCheck_physicsV7_currentT0_AOD - doc EDMCheck on TrigEDMCheck_physicsV7_currentT0 - joboptions testAthenaP1ESD_TrigEDMCheck_data.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/TrigEDMCheck_physicsV7_currentT0_AOD/trigp1test_TrigEDMCheck_physicsV7_currentT0.reference - pre_condition if [[ $(find ../Trigreco_physicsV7_currentT0/myAOD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../Trigreco_physicsV7_currentT0/myAOD.pool.root ; else test -e non_existing_file ; fi - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; athena.py -c 'fileList=["../Trigreco_physicsV7_currentT0/myAOD.pool.root"]' - - -### this does not work due to conditions... -test 44 - name Trig_reco_mcV6_currentT0 - doc Trig_reco_tf with current T0 config - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd Trig_reco_tf.py --inputBS_RDOFile=/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data12_8TeV.00212967.physics_EnhancedBias.merge_eb_zee_zmumu_cc.RAW._lb0291._SFO-5._0001.data --precommand 'testMCV6=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;useCONDBR2=False;setGlobalTag="COMCOND-HLTP-004-03-VAL-01";setDetDescr="ATLAS-R1-2012-02-00-00"' --outputHISTFile 'myHIST.root' --outputAODFile 'myAOD.pool.root' --outputESDFile 'myESD.pool.root' --outputNTUP_MUONCALIBFile 'myNTUP_MUONCALIB.root' --asetup r2e:AtlasProduction,20.7.X.Y,latest_copied_release e2a:AtlasProduction,20.7.X.Y,latest_copied_release --beamType 'cosmics' --autoConfiguration='everything' --maxEvents '15' --preExec 'r2e:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArHVCorr=False;jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False);from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doInnerDetectorCommissioning.set_Value_and_Lock(True);InDetFlags.useBroadClusterErrors.set_Value_and_Lock(False);DQMonFlags.doStreamAwareMon=False;DQMonFlags.enableLumiAccess=False;from JetRec.JetRecFlags import jetFlags;jetFlags.useTracks=False;DQMonFlags.doCTPMon=False;' --geometryVersion all:ATLAS-R2-2015-02-00-00 --conditionsTag all:CONDBR2-BLKPA-2015-02 --triggerConfig r2e=DATARECO:REPR - post_command checkFile.py myESD.pool.root > ESD.txt - - -test 45 - name TrigEDMCheck_mcV6_currentT0 - doc EDMCheck on Trig_reco_mcV6_currentT0 - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_TrigEDMCheck_mcV6_currentT0.reference - pre_condition test if [[ $(find ../Trig_reco_mcV6_currentT0/myESD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../Trig_reco_mcV6_currentT0/myESD.pool.root ; else test -e non_existing_file ; fi - pre_command ln -s ../Trig_reco_mcV6_currentT0/myESD.pool.root ESD.pool.root - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; athena.py -c 'fileList=["ESD.pool.root"]' TrigP1Test/testAthenaP1ESD_TrigEDMCheck_data.py - - -test 46 - name Trigreco_dbgstream_T0 - doc Trig_reco_tf using debug_stream setup as is run at T0 - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: setup_debugrec.sh on AFS - athena_cmd cp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data16_cos.00291509.physics_Main.daq.RAW._lb0009._SFO-3._0001.data data16_cos.00291509.physics_Main.daq.RAW._lb0009._SFO-3._0001.data ; source /afs/cern.ch/user/t/trigcomm/public/tzero/setup_debugrec.sh ; python -u `which Trig_reco_tf.py` --argJSON=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data16_cos.00291509.physics_Main.daq.RAW.job.argdict.json - - post_command test -e data16_cos.00291509.physics_Main.debug_rec.daq.RAW.g49._0001.data - - - -################################################################################ -# physics_v6 menu on cosmics 2012/2015 -################################################################################ - - -test 49 - name HLT_physicsV7_COS - doc athenaHLT on data with Physics_pp_v7 menu currently cosmics from 2016 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS/trigp1test_HLT_physicsV7_COS.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS/trigp1test_HLT_physicsV7_COS.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS/trigp1test_HLT_physicsV7_COS.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_COS -n 250 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data16_cos.00306147.physics_Main.daq.RAW._lb0494._SFO-4._0001.data -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7_COS._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - # TODO: fix ref - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS/trigp1test_checkHistathenaHLT.reference - - - - - -test 50 - name HLT_physicsV6_COS_2012 - doc athenaHLT standalone with physicsV6 menu on COSMICS 2012 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2012.reference - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2012.root 1 HLT - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2012.root - athena_cmd athenaHLT.py -o HLT_physicsV6_COS_2012 -n 100 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_cos.00214912.express_express.merge.RAW._lb0184._SFO-ALL._0001.1 -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doValidation=True;doCosmics=True;useCONDBR2=False;setGlobalTag="COMCOND-HLTP-004-03-VAL-01";setDetDescr="ATLAS-R1-2012-02-00-00";fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV6_COS_2012._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - - -test 51 - name HLT_physicsV7_COS_2016MUONS - doc athenaHLT on data with Physics_pp_v6 menu currently cosmics from 2016 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS_2016MUONS/trigp1test_HLT_physicsV7_COS_2016MUONS.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS_2016MUONS/trigp1test_HLT_physicsV7_COS_2016MUONS.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS_2016MUONS/trigp1test_HLT_physicsV7_COS_2016MUONS.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_COS_2016MUONS -n 100 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data16_cos.00306147.physics_CosmicMuons.merge.RAW._lb0494._SFO-ALL._0001.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7_COS_2016MUONS._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - # TODO: fix ref - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS_2016MUONS/trigp1test_checkHistathenaHLT.reference - - -test 52 - name HLT_physicsV7_COS_2016IDCOSMICS - doc athenaHLT on data with Physics_pp_v6 menu currently cosmics from 2016 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS_2016IDCOSMICS/trigp1test_HLT_physicsV7_COS_2016IDCOSMICS.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS_2016IDCOSMICS/trigp1test_HLT_physicsV7_COS_2016IDCOSMICS.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS_2016IDCOSMICS/trigp1test_HLT_physicsV7_COS_2016IDCOSMICS.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_COS_2016IDCOSMICS -n 100 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data16_cos.00306147.physics_IDCosmic.merge.RAW._lb0494._SFO-ALL._0001.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7_COS_2016IDCOSMICS._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - # TODO: fix ref - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_COS_2016IDCOSMICS/trigp1test_checkHistathenaHLT.reference - - -test 53 - name HLT_physicsV6_COS_2015CALO - doc athenaHLT on data with Physics_pp_v6 menu currently cosmics from 2015 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015CALO.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015CALO.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015CALO.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV6_COS_2015CALO -n 100 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data15_cos.00256721.physics_CosmicCalo.merge.RAW._lb0403._SFO-ALL._0001.1 -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV6_COS_2015CALO._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - -test 54 - name HLT_physicsV6_COS_2015MBTS - doc athenaHLT on data with Physics_pp_v6 menu currently cosmics from M9 - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015MBTS.reference - rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015MBTS.root - checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_physicsV6_COS_2015MBTS.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV6_COS_2015MBTS -n 100 -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data15_cos.00257588.physics_L1MinBias.merge.RAW._lb0XXX._SFO-ALL._0001.1 -c 'testPhysicsV6=True;HLTOutputLevel=INFO;doCosmics=True;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV6_COS_2015MBTS._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_checkHistathenaHLT.reference - - -################################################################################ -# DB upload tests on Physics_pp_V6 menu inclusing running from the db (currently not possible as old triggertool has no cmdline option top run old physics_pp lvl1 menu) -################################################################################ - - - - -test 61 - name HLT_physicsV7_menu - doc Run athenaHLT on all events to create trigger configuration - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -M -n 75 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -o HLT_physicsV7_menu -c 'testPhysicsV7=True;trigBase="Default";doDBConfig=True;enableCostForCAF=True' TriggerRelease/runHLT_standalone.py - post_test checkHist histSizes.py -t r0000000000_part_athenaHLT_mon_HLT-Histogramming.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_menu/trigp1test_checkHistathenaHLT.reference - -test 60 - name HLT_HIV5_menu - doc Run athenaHLT on all events to create trigger configuration with HIV5 menu with rerunL1 - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -M -o HLT_HIV5_menu -n 50 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data15_hi.00287843.physics_EnhancedBias.merge.RAW._lb0226._SFO-2._0001.1 -c 'testHIV5=True;rerunLVL1=True;trigBase="Default";doDBConfig=True;enableCostForCAF=True;useCONDBR2=True;setDetDescr="ATLAS-R2-2015-04-00-00";setGlobalTag="CONDBR2-HLTP-2016-01";from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)' TriggerRelease/runHLT_standalone.py - post_test checkHist histSizes.py -t r0000000000_part_athenaHLT_mon_HLT-Histogramming.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5_menu/trigp1test_checkHistathenaHLT.reference - - -test 62 - name UploadMenuKeys - doc Generates and uploads SMKs created from the HLT first and compares after rerun jobs from DB. - pre_condition test -e ../HLT_physicsV7_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV7_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV7_menu/outputHLT*xml - athena_cmd testUploadMenuKeys.sh --menu HLT_physicsV7 - -test 59 - name UploadMenuKeys_HI - doc Generates and uploads SMKs created with HIV5 rerunL1 from the HLT first and compares after rerun jobs from DB. - pre_condition test -e ../HLT_HIV5_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_HIV5_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_HIV5_menu/outputHLT*xml - athena_cmd testUploadMenuKeys.sh --menu HLT_HIV5 - -test 70 - name UploadMenuKeys_ART - doc Uploads SMKs created from the HLT with rerunL1 - pre_condition test -e ../HLT_physicsV7_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV7_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV7_menu/outputHLT*xml - athena_cmd testUploadMenuKeys.sh --menu HLT_physicsV7 --uploadPrescale --art - post_command cp prescaleKeys_17000.txt prescaleKeys_9000.txt /eos/atlas/atlascerngroupdisk/data-art/grid-input/TrigP1Test/. - -test 63 - name HLT_physicsV7_menu_checkkeys - doc Recreate trigger configuration and compare with configuration from HLT_physicsV7_menu - athena_cmd athenaHLT.py -M -n 75 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -o HLT_physicsV7_menu_checkkeys -c 'testPhysicsV7=True;trigBase="Default";doDBConfig=True;enableCostForCAF=True' TriggerRelease/runHLT_standalone.py - -test 58 - name HLT_HIV5_menu_checkkeys - doc Recreate trigger configuration and compare with configuration from HLT_HIV5_menu - athena_cmd athenaHLT.py -M -o HLT_HIV5_menu_checkkeys -n 50 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data15_hi.00287843.physics_EnhancedBias.merge.RAW._lb0226._SFO-2._0001.1 -c 'testHIV5=True;rerunLVL1=True;trigBase="Default";doDBConfig=True;enableCostForCAF=True;useCONDBR2=True;setDetDescr="ATLAS-R2-2015-04-00-00";setGlobalTag="CONDBR2-HLTP-2016-01";from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)' TriggerRelease/runHLT_standalone.py - - -test 64 - name CheckKeysV7 - doc compare the SMK created from the HLT_physicsV7 first and rerun jobs - pre_condition test -e ../HLT_physicsV7_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV7_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV7_menu/outputHLT*xml - pre_condition test -e ../HLT_physicsV7_menu_checkkeys/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV7_menu_checkkeys/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV7_menu_checkkeys/outputHLT*xml - checklog --config checklogTrigP1Test.conf --showexcludestats | grep -v "checking for" - athena_cmd testCheckKeys.sh --menu HLT_physicsV7 - -test 57 - name CheckKeysHIV5 - doc compare the SMK created from the HLT_HIV5 first and rerun jobs - pre_condition test -e ../HLT_HIV5_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_HIV5_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_HIV5_menu/outputHLT*xml - pre_condition test -e ../HLT_HIV5_menu_checkkeys/ef_Default_setup.txt - pre_condition test -e ../HLT_HIV5_menu_checkkeys/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_HIV5_menu_checkkeys/outputHLT*xml - checklog --config checklogTrigP1Test.conf --showexcludestats | grep -v "checking for" - athena_cmd testCheckKeys.sh --menu HLT_HIV5 - - -test 65 - name HLT_physicsV7_menu_rerundb - doc athenaHLT from DB, use HLT_physicsV7 as reference - checklog --config checklogTrigP1Test.conf --showexcludestats - rootcomp ../HLT_physicsV7_menu/r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000000_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH - pre_condition test -e ../UploadMenuKeys/exportMenuKeys.sh - athena_cmd unset FRONTIER_SERVER; source ../UploadMenuKeys/exportMenuKeys.sh; athenaHLT.py -M -n 75 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -o HLT_physicsV7_menu_rerundb -J TrigConf::HLTJobOptionsSvc --use-database --db-type "Coral" --db-server "TRIGGERDBATN" --db-smkey ${smk} --db-hltpskey ${hltpsk} --db-extra "{'lvl1key': ${l1psk}}" - post_command chainDump.py -n -S - post_test RunMsg check_msg_stat.py --showignored --config checkMsgStat_TrigP1Test.conf $logfile - -test 56 - name HLT_HIV5_menu_rerundb - doc athenaHLT from DB, use HLT_HIV5 as reference - checklog --config checklogTrigP1Test.conf --showexcludestats - rootcomp ../HLT_HIV5_menu/r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000000_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH - pre_condition test -e ../UploadMenuKeys_HI/exportMenuKeys.sh - athena_cmd unset FRONTIER_SERVER; source ../UploadMenuKeys_HI/exportMenuKeys.sh; athenaHLT.py -M -o HLT_HIV5_menu_rerundb -n 50 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data15_hi.00287843.physics_EnhancedBias.merge.RAW._lb0226._SFO-2._0001.1 -J TrigConf::HLTJobOptionsSvc --use-database --db-type "Coral" --db-server "TRIGGERDBATN" --db-smkey ${smk} --db-hltpskey ${hltpsk} --db-extra "{'lvl1key': ${l1psk}}" - post_command chainDump.py -n -S - post_test RunMsg check_msg_stat.py --showignored --config checkMsgStat_TrigP1Test.conf $logfile - -test 66 - name HLT_physicsV6_prescaleChange - doc Test of HLT prescale change - checklog --config checklogTrigP1Test.conf --showexcludestats - pre_condition test -e ../UploadMenuKeys/exportMenuKeys.sh - pre_condition test -e ../UploadMenuKeys/prescales.txt - pre_command ln -sf ../UploadMenuKeys/prescales.txt - pre_command get_files -jo testPrescaleChange_postconfig.py - athena_cmd source ../UploadMenuKeys/exportMenuKeys.sh; athenaHLT.py -Z TrigP1Test.PrescaleChange -C 'include("testPrescaleChange_postconfig.py");fpeAuditor=True' -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -J TrigConf::HLTJobOptionsSvc --use-database "DBServer=TRIGGERDBATN:Instance=L2:DBSMKey=${smk}:DBHLTPSKey=${hltpsk}:DBLVL1PSKey=${l1psk}" - -test 67 - name TriggerDBAccessTest - doc Access TriggerDB using Oracle and Frontier and compare -# pre_condition test -e ../UploadMenuKeys/exportMenuKeys.sh - athena_cmd testAccessDBAndCompare.sh - - -## Compare JO vs DB also with rerunLvl1 to test the reprocessing on run1 data - -test 71 - name HLT_physicsV7_rerunLVL1_menu - doc Run athenaHLT on all events to create trigger configuration - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -M -n 25 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -o HLT_physicsV7_rerunLVL1_menu -c 'doDBConfig=True;testPhysicsV7=True;rerunLVL1=True;trigBase="Default";enableCostForCAF=True' TriggerRelease/runHLT_standalone.py - -test 72 - name UploadMenuKeys_rerunLVL1 - doc Generates and uploads SMKs created from the HLT first and compares after rerun jobs from DB. - pre_condition test -e ../HLT_physicsV7_rerunLVL1_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV7_rerunLVL1_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV7_rerunLVL1_menu/outputHLT*xml - athena_cmd testUploadMenuKeys.sh --menu HLT_physicsV7_rerunLVL1 - - -test 73 - name HLT_physicsV7_rerunLVL1_menu_rerundb - doc athenaHLT from DB, use HLT_physicsV7 as reference - checklog --config checklogTrigP1Test.conf --showexcludestats - rootcomp ../HLT_physicsV7_rerunLVL1_menu/r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000000_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH - pre_condition test -e ../UploadMenuKeys_rerunLVL1/exportMenuKeys.sh - athena_cmd unset FRONTIER_SERVER; source ../UploadMenuKeys_rerunLVL1/exportMenuKeys.sh; athenaHLT.py -M -n 25 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -o HLT_physicsV7_rerunLVL1_menu_rerundb -J TrigConf::HLTJobOptionsSvc --use-database --db-type "Coral" --db-server "TRIGGERDBATN" --db-smkey ${smk} --db-hltpskey ${hltpsk} --db-extra "{'lvl1key': ${l1psk}}" - post_command chainDump.py -n -S - post_test RunMsg check_msg_stat.py --showignored --config checkMsgStat_TrigP1Test.conf $logfile - -test 74 - name HLT_mcV7_rerunLVL1_menu - doc Run athenaHLT on all events to create trigger configuration - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -M -n 1 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -o HLT_mcV7_rerunLVL1_menu -c 'doDBConfig=True;testMCV7=True;rerunLVL1=True;trigBase="Default";enableCostForCAF=True;doValidation=True' TriggerRelease/runHLT_standalone.py - -test 75 - name UploadMenuKeys_MC_rerunLVL1 - doc Generates and uploads SMKs created from the HLT first and compares after rerun jobs from DB. - pre_condition test -e ../HLT_mcV7_rerunLVL1_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_mcV7_rerunLVL1_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_mcV7_rerunLVL1_menu/outputHLT*xml - athena_cmd testUploadMenuKeys.sh --menu HLT_mcV7_rerunLVL1 --notUploadMenu - -test 76 - name HLT_mcV7_menu - doc Run athenaHLT on all events to create trigger configuration - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -M -n 1 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -o HLT_mcV7_menu -c 'testMCV7=True;trigBase="Default";doDBConfig=True;enableCostForCAF=True;doValidation=True' TriggerRelease/runHLT_standalone.py - -test 77 - name UploadMenuKeys_MC - doc Generates and uploads SMKs created from the HLT first and compares after rerun jobs from DB. - pre_condition test -e ../HLT_mcV7_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_mcV7_menu/ef_Default_setup_setup.txt - pre_condition test -e ../HLT_mcV7_menu/outputHLT*xml - athena_cmd testUploadMenuKeys.sh --menu HLT_mcV7 --notUploadMenu - - -############################################################################################# -## Transform tests on BS from main HLT_physicsV7 test -## conditionsTag and geometryVersion need to be updated from time to time -############################################################################################# -test 80 - name RAWtoESD_physicsV7 - doc RAWtoESD on output from HLT_physicsV7 - checklog --config checklogTrigP1Test.conf --showexcludestats - pre_condition test -e '../HLT_physicsV7/HLT_physicsV7._0001.data' - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; Reco_tf.py --preExec 'from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.useDynamicAlignFolders.set_Value_and_Lock(True);' --autoConfiguration 'everything' --conditionsTag "CONDBR2-BLKPA-2017-11" --geometryVersion "ATLAS-R2-2016-01-00-01" --inputBSFile ../HLT_physicsV7/HLT_physicsV7._0001.data --maxEvents 5 --outputESDFile RAWtoESD.pool.root - post_command checkFile.py RAWtoESD.pool.root > ESD.txt - -test 81 - name TrigEDMCheck_physicsV7 - doc EDM checker on ESD from RAWtoESD_physicsV7 - joboptions testAthenaP1ESD_TrigEDMCheck_data.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/TrigEDMCheck_physicsV7/trigp1test_TrigEDMCheck_physicsV7.reference - pre_condition if [[ $(find ../RAWtoESD_physicsV7/RAWtoESD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../RAWtoESD_physicsV7/RAWtoESD.pool.root ; else test -e non_existing_file ; fi - pre_command ln -s ../RAWtoESD_physicsV7/RAWtoESD.pool.root ESD.pool.root - athena_cmd source $AtlasSetup/scripts/asetup.sh latest,Athena,21.0 ; athena.py -c 'fileList=["ESD.pool.root"]' - -test 82 - name TrigDecTool_physicsV7 - doc Check of TrigDec for events produced by RAWtoESD_physicsV7 - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/TrigDecTool_physicsV7/trigp1test_TrigDecTool_physicsV7.reference - pre_condition if [[ $(find ../RAWtoESD_physicsV7/RAWtoESD.pool.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../RAWtoESD_physicsV7/RAWtoESD.pool.root ; else test -e non_existing_file ; fi - pre_command ln -s ../RAWtoESD_physicsV7/RAWtoESD.pool.root ESD.pool.root - athena_cmd athena.py -c 'fileList=["ESD.pool.root"]' TrigP1Test/testAthenaP1ESD_TrigDecTool.py - -#test 83: Reco_tf_mcV7_savedBS got migrated to test 18: Reco_tf_physicsV7_savedBS -test 83 - name Reco_tf_mcV7_savedBS - doc Reco_tf on saved output from HLT_mcV7 - checklog --config checklogTrigP1Test.conf --showexcludestats - pre_command linktoP1HLT.sh mcV7 - athena_cmd Reco_tf.py --inputBSFile link_to_file_from_P1HLT.data --maxEvents 10 --outputESDFile data12_mcV7.ESD.pool.root - - -############################################################################################# -## Infrastructure tests on run/stop/run transitions -############################################################################################# -test 100 - name HLT_physicsV7_run_stop_run - doc athenaHLT on data with physics_pp_V7 menu with stop/start transition - stdinfile run-stop-run-saveHist.trans - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - customregtest regtest_multirun.sh atn_test.log - customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000001_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH ATHENA_REGTEST_FAILED - athena_cmd athenaHLT.py -i -M --rewind -n 50 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - - -############################################################################################# -## Additional Infrastructure tests -############################################################################################# - -# mrammens: localhost partition test goes to a new test suite-- remove this test here -test 111 - name AllPartition_physicsV6 - doc Physics_pp_v4 menu in localhost L2+EF partition - joboptions runHLT_standalone.py - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd part_runTest.sh part_lhl2ef - customregtest part_regtest.sh ../HLT_physicsV6/HLT_physicsV6.reference.new ../HLT_physicsV6/HLT_physicsV6.reference.new - customrootcomp part_rootcomp.sh ../HLT_physicsV6/expert-monitoring.root ../HLT_physicsV6/expert-monitoring.root - post_command cleanuplog.sh runHLT_standalone_test.log - -test 112 - name HLT_physicsV7_magField_on_off_on - doc athenaHLT on data with physicsV7 menu with On and Off magnetic field transition - pre_command get_files -jo setMagFieldCurrents.py - stdinfile magFieldOnOff.trans - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - customregtest regtest_multirun.sh atn_test.log 1 3 - customrootcomp rootcomp_stopstart.sh r0000000000_part_athenaHLT_mon_HLT-Histogramming.root r0000000002_part_athenaHLT_mon_HLT-Histogramming.root - extra_failure_codes ROOTCOMP_MISMATCH ATHENA_REGTEST_FAILED - athena_cmd athenaHLT.py -i -M --rewind -n 50 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - - -test 113 - name HLT_physicsV7_beamspot - doc Test of beamspot udpate with athenaHLT - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # DO NOT change the number of events for this test - athena_cmd athenaHLT.py -Z TrigP1Test.BeamSpotUpdate -n 50 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -c 'testPhysicsV7=True;doValidation=True;BeamspotFromSqlite=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - - -test 109 - name HLT_physicsV7_ROSsim_17000 - doc athenaHLT on data with physicsV7 menu with ROS simulation. It uses PS keys generated with rerunL1 - pre_condition test -e ../UploadMenuKeys_ART/prescaleKeys_17000.txt - pre_command cp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ATLASros2rob2018.py . - athena_cmd trigp1test_prescaleForROSsim.py --nevents 600 --file /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 --ros2rob ATLASros2rob2018 --keys ../UploadMenuKeys_ART/prescaleKeys_17000.txt - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ROSsim_17000/trigp1test_HLT_physicsV7_ROSsim_17000.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ROSsim_17000/trigp1test_HLT_physicsV7_ROSsim_17000.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ROSsim_17000/trigp1test_HLT_physicsV7_ROSsim_17000.root 0 HLT - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test ROStest grep "ROS-" atn_test.log; cp post_test_ROStest.log ROStest.reference.new; diff ROStest.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ROSsim_17000/trigp1test_ROStest.reference - -test 110 - name HLT_physicsV7_ROSsim_9000 - doc athenaHLT on data with physicsV7 menu with ROS simulation. It uses PS keys generated with rerunL1 - pre_condition test -e ../UploadMenuKeys_ART/prescaleKeys_9000.txt - pre_command cp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ATLASros2rob2018.py . - athena_cmd trigp1test_prescaleForROSsim.py --nevents 600 --file /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 --ros2rob ATLASros2rob2018 --keys ../UploadMenuKeys_ART/prescaleKeys_9000.txt - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ROSsim_9000/trigp1test_HLT_physicsV7_ROSsim_9000.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ROSsim_9000/trigp1test_HLT_physicsV7_ROSsim_9000.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ROSsim_9000/trigp1test_HLT_physicsV7_ROSsim_9000.root 0 HLT - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test ROStest grep "ROS-" atn_test.log; cp post_test_ROStest.log ROStest.reference.new; diff ROStest.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ROSsim_9000/trigp1test_ROStest.reference - -test 114 - name HLT_physicsV6_nocache - doc athenaHLT on data with physics_pp_v6 menu, no caching in steering, use HLT_physicsV6 as reference - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - checkcount ../HLT_physicsV6/expert-monitoring.root 0 HLT - athena_cmd athenaHLT.py -f root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_8TeV.00212967.physics_eb_zee_zmumu_cc._0001.data -oHLT_physicsV6_nocache -c 'testPhysicsV6=True;noCaching=True;HLTOutputLevel=INFO;doValidation=True;useCONDBR2=False;setGlobalTag="COMCOND-HLTP-004-03-VAL-01";setDetDescr="ATLAS-R1-2012-02-00-00";fpeAuditor=True' TriggerRelease/runHLT_standalone.py - -test 115 - name tfTestPPV6 - doc Check tf for menu PP V6 data - pre_command xrdcp root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_8TeV.00212967.physics_eb_zee_zmumu_cc._0001.data . - pre_condition test -e ../UploadMenuKeys/exportMenuKeys.sh - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd source ../UploadMenuKeys/exportMenuKeys.sh; BatchHLTTrf_wrap.py inputBSFile=data12_8TeV.00212967.physics_eb_zee_zmumu_cc._0001.data outputRAWFile=RAW.999999._000001.data.1 doStreaming=True filters="express" stream_out=debug connection=TRIGGERDBATN smk=${smk} lvl1ps=${l1psk} hltps=${hltpsk} outputNTUP_TRIGCOSTEFFile=NTUP_TRIGCOSTEF.root outputNTUP_TRIGCOSTL2File=NTUP_TRIGCOSTL2.root outputNTUP_TRIGRATEEFFile=NTUP_TRIGRATEEF.root outputNTUP_TRIGRATEL2File=NTUP_TRIGRATEL2.root outputHIST_HLTMONEFFile=HIST_HLTMONEF.root outputHIST_HLTMONL2File=HIST_HLTMONL2.root max_events=10 - - - -################################################################################ -# Test of ALFA -################################################################################# - - - -test 120 - name HLT_physicsV7_ALFAMon - doc athenaHLT with ALFA monitoring enabled, with Physics_pp_v6 menu, on run 2 data with ALFA in (see ATR-12448) - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ALFAMon/trigp1test_HLT_physicsV7_ALFAMon.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ALFAMon/trigp1test_HLT_physicsV7_ALFAMon.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_ALFAMon/trigp1test_HLT_physicsV7_ALFAMon.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_ALFAMon -n 105 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data15_13TeV.00277025.physics_MinBias.merge.RAW._lb0500._SFO-1._0001.1 --log-level INFO,ERROR -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;enableALFAMon=True;trigBase="Default";fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - -test 121 - name HLT_physicsV7_AFP - doc athenaHLT on data with AFP included (see ATR-14776) - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_AFP/trigp1test_HLT_physicsV7_AFP.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_AFP/trigp1test_HLT_physicsV7_AFP.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_AFP/trigp1test_HLT_physicsV7_AFP.root 1 HLT - #TODO: fix file - athena_cmd athenaHLT.py -o HLT_physicsV7_AFP -n 105 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data16_13TeV.00309346.physics_Main.daq.RAW._lb0126._SFO-5._0002.data --log-level INFO,ERROR -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;trigBase="Default";fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - -################################################################################ -# Test of mcV6 menu for CAF reprocessing -################################################################################ - -test 130 - name HLT_mcV6_caf - doc athenaHLT on data with MC_pp_V6 menu for caf reprocessing - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -n 1 -M -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_mcV6_caf -c 'testMCV6=True;caf=True;trigBase="Default";doDBConfig=True;rerunLVL1=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - -test 131 - name HLT_physicsV6_caf - doc athenaHLT on data with Physics_pp_V6 menu for caf reprocessing - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -n 1 -M -f /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data17_13TeV.00327265.physics_eb_zmm_egz.merged.RAW.selected._0001.data -oHLT_physicsV6_caf -c 'testPhysicsV6=True;caf=True;trigBase="Default";doDBConfig=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - -test 132 - name PrepareMenuKeys_physicsV6_caf - doc Prepares SMKs created from the HLT_physicsV6_caf tests - pre_condition test -e ../HLT_physicsV6_caf/outputHLTconfig_L2PU-1.xml - pre_condition test -e ../HLT_physicsV6_caf/l2_Default_setup.txt - pre_condition test -e ../HLT_physicsV6_caf/l2_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV6_caf/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV6_caf/ef_Default_setup_setup.txt - - athena_cmd testPrepareMenuKeysSelfX.sh physicsV6_caf - - -test 133 - name PrepareMenuKeys_mcV6_caf - doc Prepares SMKs created from the All*T_mcV6_caf tests - pre_condition test -e ../HLT_mcV6_caf/outputHLTconfig_L2PU-1.xml - pre_condition test -e ../HLT_mcV6_caf/l2_Default_setup.txt - pre_condition test -e ../HLT_mcV6_caf/l2_Default_setup_setup.txt - pre_condition test -e ../HLT_mcV6_caf/ef_Default_setup.txt - pre_condition test -e ../HLT_mcV6_caf/ef_Default_setup_setup.txt - - athena_cmd testPrepareMenuKeysSelfX.sh mcV6_caf - -test 134 - name PrepareMenuKeys_p1 - doc Prepares SMKs created from the All*T_physicsV6_menu test - pre_condition test -e ../HLT_physicsV6_menu/outputHLTconfig_L2PU-1.xml - pre_condition test -e ../HLT_physicsV6_menu/l2_Default_setup.txt - pre_condition test -e ../HLT_physicsV6_menu/l2_Default_setup_setup.txt - pre_condition test -e ../HLT_physicsV6_menu/ef_Default_setup.txt - pre_condition test -e ../HLT_physicsV6_menu/ef_Default_setup_setup.txt - - athena_cmd testPrepareMenuKeysSelfX.sh physicsV6_menu - - - - -##Heavy Ion menu tests - - -test 159 - name HLT_HIV4 - doc athenaHLT standalone with HLT_HIV4 menu on a HI sample - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV4/trigp1test_HLT_HIV4.reference - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV4/trigp1test_HLT_HIV4.root 1 L2 - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV4/trigp1test_HLT_HIV4.root - athena_cmd athenaHLT.py -o HLT_HIV4 -n 50 -f '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data16_hip5TeV.00312649.physics_EnhancedBias.merge.RAW._lb0150._SFO-ALL._0001.data' -c 'testHIV4=True;rerunLVL1=True;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_HIV3._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S - -test 160 - name HLT_HIV5 - doc athenaHLT standalone with HLT_HIV5 menu on a HI sample - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5/trigp1test_HLT_HIV5.reference - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5/trigp1test_HLT_HIV5.root 1 L2 - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5/trigp1test_HLT_HIV5.root - athena_cmd athenaHLT.py -o HLT_HIV5 -n 50 -f '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data15_hi.00287843.physics_EnhancedBias.merge.RAW._lb0226._SFO-2._0001.1' -c 'testHIV5=True;rerunLVL1=True;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True;setDetDescr="ATLAS-R2-2015-04-00-00";setGlobalTag="CONDBR2-HLTP-2016-01";from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - -test 185 - name HLT_HIV5_FTK - doc athenaHLT standalone with HIV5 menu with doFTK on a HI sample - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5_FTK/trigp1test_HLT_HIV5_FTK.reference - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5_FTK/trigp1test_HLT_HIV5_FTK.root 1 L2 - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5_FTK/trigp1test_HLT_HIV5_FTK.root - athena_cmd athenaHLT.py -o HLT_HIV5_FTK -n 50 -f '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data15_hi.00287843.physics_EnhancedBias.merge.RAW._lb0226._SFO-2._0001.1' -c 'testHIV5=True;from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.doFTK=True;rerunLVL1=True;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True;setDetDescr="ATLAS-R2-2015-04-00-00";setGlobalTag="CONDBR2-HLTP-2016-01";from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - - - -test 165 - name HLT_MCHIV5 - doc athenaHLT standalone with HLT_MCHIV5 menu on a HI sample - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_MCHIV5/trigp1test_HLT_MCHIV5.reference - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_MCHIV5/trigp1test_HLT_MCHIV5.root 1 L2 - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_MCHIV5/trigp1test_HLT_MCHIV5.root - athena_cmd athenaHLT.py -o HLT_MCHIV5 -n 50 -f '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data15_hi.00287843.physics_EnhancedBias.merge.RAW._lb0226._SFO-2._0001.1' -c 'testMCHIV5=True;rerunLVL1=True;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True;setDetDescr="ATLAS-R2-2015-04-00-00";setGlobalTag="CONDBR2-HLTP-2016-01";from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - - -# ART not migrated -#test 160 -# name HLT_HIV3 -# doc athenaHLT standalone with HLT_HIV3 menu on a HI sample -# filterlog filterREGTEST.py -# checklog --config checklogTrigP1Test.conf --showexcludestats -# fullregtest REGTEST|WARNING /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.reference -# checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.root 1 L2 -# rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/trigp1test_HLT_HIV3.root -# athena_cmd athenaHLT.py -o HLT_HIV3 -n 25 -f '/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data15_hi.00287270.physics_HardProbes.daq.RAW._lb0122._SFO-1._0001.data' -c 'testHIV3=True;rerunLVL1=False;setPrescale="None";HLTOutputLevel=INFO;doValidation=True;useCONDBR2=True;fpeAuditor=True;setDetDescr="ATLAS-R2-2015-04-00-00";setGlobalTag="CONDBR2-HLTP-2016-01";from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)' TriggerRelease/runHLT_standalone.py -## post_command save_to_refdir.sh HLT_HIV3._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest -# post_command chainDump.py -n -S - -################################################################################################################################################### -#0 #Steering Group - extremely fast! - -test 161 - name pureSteering_ecodes - doc stand-alone test of the steering with useErrorHandlingMenu - joboptions pureSteering_jobOptions.py - athena_args -c 'useErrorHandlingMenu=True' - # TODO: fix reference - regtest TrigSteer_HLT.ResultBuilder REGTEST /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/pureSteering_ecodes/trigp1test_pureSteering_ecodes_TrigSteer_HLT.ResultBuilder.reference - -test 162 - name pureSteering_prescaling - doc stand-alone test of the steering with the PrescaleMenu - joboptions pureSteering_jobOptions.py - athena_args -c 'repeat=100; usePrescaleMenu=True' - # TODO: fix reference - regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/pureSteering_prescaling/trigp1test_pureSteering_prescaling_TrigSteer_HLT.ChainMoni.reference - -test 163 - name pureSteering - doc stand-alone test of the steering - joboptions pureSteering_jobOptions.py - # TODO: fix reference - regtest TrigSteer_HLT.ResultBuilder REGTEST /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/pureSteering/trigp1test_pureSteering_TrigSteer_HLT.ResultBuilder.reference - - -########################## -# Steering test: ROBs access , slow 1h - -test 164 - name AthenaTrigBS_L2EFMerging - doc testing trigger results w/wo merging L2/EF, based on AthenaTrigRDO with run_standalone.py - joboptions testAthenaL2EFMerging.py - athena_args -c 'EvtMax=15; testPhysicsV7=True; BSRDOInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1"' - #athena_args -c 'doHLT=True; useCONDBR2=False; setGlobalTag="COMCOND-HLTP-004-03-VAL-01"; setDetDescr="ATLAS-R1-2012-02-01-00"; EvtMax=15; testPhysicsV6=True; BSRDOInput="root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_8TeV.00212967.physics_eb_zee_zmumu_cc._0001.data"' - checklog --config checklogTriggerTest.conf --showexcludestats - # TODO: fix reference - checkmerge expert-monitoring.root /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/AthenaTrigBS_L2EFMerging/triggertest_AthenaTrigBS_L2EFMerging.root 0 - post_command chainDump.py -n -S - - -################################################################################ -# Test of physicsV6 menu for DataSouting -################################################################################ -test 170 - name HLT_physicsV7_DataScouting - doc athenaHLT on data with Physics_pp_v7 menu, test output of DataScouting containers - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd athenaHLT.py -n50 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -o ds_test_data_out -c 'testJet=True;testMuon=True;testPhysicsV7=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command trigbs_dumpHltDsData.py -v1 ds_test_data_out._0001.data >> atn_test.log - -################################################################################ -# Tests of physicsV7 menu -################################################################################ - -test 180 - name HLT_mcV7 - doc AthenaHLT on data, with MC_pp_V7 menu loose prescale set - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix references - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_mcV7/trigp1test_HLT_mcV7.reference - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_mcV7/trigp1test_HLT_mcV7.root 1 HLT - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_mcV7/trigp1test_HLT_mcV7.root - athena_cmd athenaHLT.py -o HLT_mcV7 -n 50 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -c 'testMCV7=True;rerunLVL1=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - -test 181 - name HLT_physicsV7 - doc athenaHLT on data with Physics_pp_v7 menu currently from 2016 EB data - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix reference - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7/trigp1test_HLT_physicsV7.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7/trigp1test_HLT_physicsV7.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7/trigp1test_HLT_physicsV7.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7 -n 75 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00349335.physics_EnhancedBias.merge.RAW._lb0200._SFO-1._0001.1 -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True' TriggerRelease/runHLT_standalone.py -# post_command save_to_refdir.sh HLT_physicsV7._0001.data /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/online/references/ATN/latest - post_command chainDump.py -n -S --rootDirs=TrigSteer_HLT --rootHists=ChainAcceptance --rootHists=NumberOfActiveTEs - post_test checkHist histSizes.py -t expert-monitoring.root ; cp post_test_checkHist.log checkHistathenaHLT.reference.new ; diff checkHistathenaHLT.reference.new /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7/trigp1test_checkHistathenaHLT.reference - extra_failure_codes ATHENA_ERROR_IN_LOG - -test 182 - name HLT_physicsV7_FTK - doc athenaHLT on data with Physics_pp_v7 menu and doFTK currently from 2016 EB data with FTK added - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_FTK/trigp1test_HLT_physicsV7_FTK.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_FTK/trigp1test_HLT_physicsV7_FTK.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_physicsV7_FTK/trigp1test_HLT_physicsV7_FTK.root 1 HLT - athena_cmd athenaHLT.py -o HLT_physicsV7_FTK -n 30 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/RAW_FTK.pool.root -c 'testPhysicsV7=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True;from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.doFTK=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - -test 184 - name HLT_HIV5_onFTKdata - doc athenaHLT on data with FTK simulation with HIV5 menu with doFTK - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - # TODO: fix ref - fullregtest REGTEST|WARNING /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5_onFTKdata/trigp1test_HLT_HIV5_onFTKdata.reference - rootcomp /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5_onFTKdata/trigp1test_HLT_HIV5_onFTKdata.root - checkcount /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/ref/latest/HLT_HIV5_onFTKdata/trigp1test_HLT_HIV5_onFTKdata.root 1 HLT - athena_cmd athenaHLT.py -o HLT_HIV5_onFTKdata -n 30 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/RAW_FTK.pool.root -c 'testHIV5=True;HLTOutputLevel=INFO;doValidation=True;fpeAuditor=True;from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.doFTK=True' TriggerRelease/runHLT_standalone.py - post_command chainDump.py -n -S - -test 183 - name athenaHLT_LatestRun_MCV7 - doc athenaHLT on latest available run - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd trigp1test_athenaHLT.py --nfiles=1 --nevents=100 --dir='/eos/atlas/atlastier0/rucio/data18_13TeV/physics_Main/' --modifiers="testMCV7=True;fpeAuditor=True;from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties ; pmon_properties.PerfMonFlags.doSemiDetailedMonitoring=True" - post_command chainDump.py -n -S - -test 186 - name athenaHLT_LatestRun_HIV5 - doc athenaHLT on latest available 2018 HI run - filterlog filterREGTEST.py - checklog --config checklogTrigP1Test.conf --showexcludestats - athena_cmd trigp1test_athenaHLT.py --nfiles=1 --nevents=100 --dir='/eos/atlas/atlastier0/rucio/data18_hi/physics_HardProbes/' --modifiers="testHIV5=True;fpeAuditor=True;from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties ; pmon_properties.PerfMonFlags.doSemiDetailedMonitoring=True" - post_command chainDump.py -n -S - - diff --git a/Trigger/TrigValidation/TrigP1Test/Testing/checklogTrigP1Test.conf b/Trigger/TrigValidation/TrigP1Test/Testing/checklogTrigP1Test.conf index 075f43bbb4e2e5c0cdc211b435d8e737194657e7..781c353229d2a6139cf98a893b267a77ddc69786 100644 --- a/Trigger/TrigValidation/TrigP1Test/Testing/checklogTrigP1Test.conf +++ b/Trigger/TrigValidation/TrigP1Test/Testing/checklogTrigP1Test.conf @@ -25,9 +25,9 @@ ignore 'IOVSvc\s+WARNING setRange\(CLID,key,range\) for unregistered proxies is ignore 'PoolSvc + WARNING Do not allow this ERROR to propagate to physics jobs.' # For HelloWorld test -ignore 'HelloWorld\s*FATAL A FATAL error message' -ignore 'HelloWorld\s*ERROR An ERROR message' -ignore 'HelloWorld\s*WARNING A WARNING message' +ignore 'HelloWorld\s*\d*\s*\d*\s*FATAL A FATAL error message' +ignore 'HelloWorld\s*\d*\s*\d*\s*ERROR An ERROR message' +ignore 'HelloWorld\s*\d*\s*\d*\s*WARNING A WARNING message' # Ignore other messages that contain the string "ERROR" ignore '.*VERBOSE.*ERROR.*' diff --git a/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test.sh b/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test.sh new file mode 100755 index 0000000000000000000000000000000000000000..d73b3db3ac080194dca9400348822e9a43ef3551 --- /dev/null +++ b/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# take inputs +POSITIONAL=() +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -c|--command) + ART_CMD="$2" + shift # past argument + shift # past value + ;; + -t|--timeout) + ART_TIMEOUT="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; +esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + +if [ -z ${TEST} ]; then + export TEST="TrigP1Test" +fi + +if [ -z ${NAME} ]; then + export NAME="UNDEFINED" +fi + +if [ -z ${JOB_LOG} ]; then + export JOB_LOG="atn_test.log" +fi + +if [ -z ${ART_FILE_NAME} ]; then + export ART_FILE_NAME="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00364485.physics_EnhancedBias.merge.RAW._lb0705._SFO-1._0001.1" +fi + +if [ -z ${JOB_athenaHLT_LOG} ]; then + export JOB_athenaHLT_LOG="atn_test_athenaHLT.log" +fi + +ART_CMD="timeout ${ART_TIMEOUT} ${ART_CMD}" +ART_CMD=${ART_CMD/INPUT_FILE/$ART_FILE_NAME} +echo "----------------------------------------" 2>&1 | tee -a ${JOB_LOG} +echo "Running athenaHLT command:" 2>&1 | tee -a ${JOB_LOG} +echo ${ART_CMD} 2>&1 | tee -a ${JOB_LOG} +echo "#!/bin/bash" >> run_athenaHLT.sh +echo ${ART_CMD} >> run_athenaHLT.sh +echo "echo 'art-result: '\$?' ${NAME}.athena_mother'" >> run_athenaHLT.sh +source run_athenaHLT.sh 2>&1 | tee -a ${JOB_athenaHLT_LOG} +echo "----------------------------------------" 2>&1 | tee -a ${JOB_LOG} + +source exec_art_trigp1test_merge.sh 2>&1 | tee -a ${JOB_LOG} +source exec_art_trigp1test_post.sh 2>&1 | tee -a ${JOB_LOG} +source exec_art_trigp1test_summary.sh 2>&1 | tee -a ${JOB_LOG} + diff --git a/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_merge.sh b/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_merge.sh new file mode 100755 index 0000000000000000000000000000000000000000..777591d339b0b6b5eb7aa707bd64cb16c7164ab2 --- /dev/null +++ b/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_merge.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo $(date "+%FT%H:%M %Z")" Execute TrigP1Test merging processing" + +# Merge log and monitoring files from children +for f in athenaHLT:*; do + cat $f >> ${JOB_athenaHLT_LOG} +done + +if [ -f expert-monitoring.root ]; then + mv expert-monitoring.root expert-monitoring_mother.root + hadd expert-monitoring.root athenaHLT_workers/*/*.root expert-monitoring_mother.root +fi + diff --git a/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_post.sh b/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_post.sh index 3e5909258cd83be8e00e1b308f93d30f8d18b690..3934ce042e65f48533fb6703d04d1c8a66b1d58b 100755 --- a/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_post.sh +++ b/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_post.sh @@ -3,6 +3,9 @@ echo $(date "+%FT%H:%M %Z")" Execute TrigP1Test post processing" ### DEFAULTS +if [ -z ${NAME} ]; then + export NAME="TrigP1Test" +fi if [ -z ${JOB_LOG} ]; then export JOB_LOG="athena.log" @@ -12,27 +15,93 @@ if [ -z ${TEST} ]; then export TEST="TrigP1Test" fi +if [ -n "${AtlasBuildBranch}" ]; then + export BRANCH=${AtlasBuildBranch} # available after asetup +elif [ -n "${gitlabTargetBranch}" ]; then + export BRANCH=${gitlabTargetBranch} # available in CI +else + echo "WARNING Cannot determine the branch name, both variables AtlasBuildBranch and gitlabTargetBranch are empty" +fi + if [ -z ${REF_FOLDER} ]; then - export REF_FOLDER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/${TEST}/ref/${AtlasBuildBranch}/${NAME}" + export REF_FOLDER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/${TEST}/ref/${BRANCH}/${NAME}" fi +export ROOTCOMP_CMD="rootcomp.py --pdf --noRoot" +export ROOTCOMP_LOG="rootcompout.log" + ### +echo $(date "+%FT%H:%M %Z")" Checking for athenaHLT log" +if [ -f ${JOB_athenaHLT_LOG} ]; then + echo "art-result: 0 ${NAME}.MissingLog" +else + echo "Cannot find log file" + echo "art-result: 1 ${NAME}.MissingLog" +fi -echo $(date "+%FT%H:%M %Z")" Running checklog" -timeout 1m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} | tee checklog.log +# mother process exit code +grep "art-result:" ${JOB_athenaHLT_LOG} + +echo $(date "+%FT%H:%M %Z")" Checking for timeouts in child processes" +if [ -f ${JOB_athenaHLT_LOG} ]; then + checkTimeut=`grep "CRITICAL stopped by user interrupt|ERROR Keyboard interruption caught|Signal handler: Killing [0-9]+ with 15" ${JOB_athenaHLT_LOG}` + if [[ -z "${checkTimeut}" ]]; then + echo "art-result: 0 ${NAME}.ChildTimeout" + else + echo "Timeout found: " + echo ${checkTimeut} + echo "art-result: 1 ${NAME}.ChildTimeout" + fi +fi -echo "art-result: ${PIPESTATUS[0]} CheckLog" +echo $(date "+%FT%H:%M %Z")" Running checklog" +timeout 1m check_log.pl --config checklogTrigP1Test.conf --showexcludestats ${JOB_athenaHLT_LOG} 2>&1 | tee -a checklog.log +echo "art-result: ${PIPESTATUS[0]} ${NAME}.CheckLog" # TODO # add check_statuscode.py ${JOB_LOG} # RunMsgFinder # Run perfmon -timeout 1m perfmon.py -f 0.90 ntuple.pmon.gz -timeout 1m convert -density 300 -trim ntuple.perfmon.pdf -quality 100 -resize 50% ntuple.perfmon.png +if [ -f ntuple.pmon.gz ]; then + timeout 1m perfmon.py -f 0.90 ntuple.pmon.gz + timeout 1m convert -density 300 -trim ntuple.perfmon.pdf -quality 100 -resize 50% ntuple.perfmon.png +fi + +if [ -f expert-monitoring.root ]; then + echo $(date "+%FT%H:%M %Z")" Running chainDump" + timeout 1m chainDump.py -S --rootFile=expert-monitoring.root + + echo $(date "+%FT%H:%M %Z")" Running check for zero L1, HLT or TE counts" + export COUNT_EXIT=0 + if [[ `sed 's|.*\(.* \)|\1|' L1AV.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then + echo "L1 counts ERROR : all entires are ZERO please consult L1AV.txt" + (( COUNT_EXIT = COUNT_EXIT || 1 )) + fi + if [[ `sed 's|.*\(.* \)|\1|' HLTChain.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then + echo "HLTChain counts ERROR : all entires are ZERO please consult HLTChain.txt" + (( COUNT_EXIT = COUNT_EXIT || 1 )) + fi + if [[ `sed 's|.*\(.* \)|\1|' HLTTE.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then + echo "HLTTE counts ERROR : all entires are ZERO please consult HLTTE.txt" + (( COUNT_EXIT = COUNT_EXIT || 1 )) + fi + echo "art-result: ${COUNT_EXIT} ${NAME}.ZeroCounts" + + if [ -f ${REF_FOLDER}/expert-monitoring.root ]; then + echo $(date "+%FT%H:%M %Z")" Running rootcomp" + timeout 10m ${ROOTCOMP_CMD} ${REF_FOLDER}/expert-monitoring.root 2>&1 | tee -a ${ROOTCOMP_LOG} + echo "art-result: ${PIPESTATUS[0]} ${NAME}.RootComp" + echo $(date "+%FT%H:%M %Z")" Running checkcounts" + timeout 10m trigtest_checkcounts.sh 0 expert-monitoring.root ${REF_FOLDER}/expert-monitoring.root HLT 2>&1 | tee -a checkcountout.log + echo "art-result: ${PIPESTATUS[0]} ${NAME}.CheckCounts" + else + echo $(date "+%FT%H:%M %Z")" No reference expert-monitoring.root found in ${REF_FOLDER}" + fi -echo $(date "+%FT%H:%M %Z")" Running chainDump" -timeout 1m chainDump.py -S --rootFile=expert-monitoring.root +else + echo $(date "+%FT%H:%M %Z")" No expert-monitoring.root file found. Skipping chainDump.py, RootComp and CheckCounts" +fi export JOB_LOG_TAIL=${JOB_LOG%%.*}.tail.${JOB_LOG#*.} tail -10000 ${JOB_LOG} > ${JOB_LOG_TAIL} @@ -40,23 +109,12 @@ tail -10000 ${JOB_LOG} > ${JOB_LOG_TAIL} grep REGTEST ${JOB_LOG} > athena.regtest if [ -f ${REF_FOLDER}/athena.regtest ]; then echo $(date "+%FT%H:%M %Z")" Running regtest" - timeout 1m regtest.pl --inputfile athena.regtest --reffile ${REF_FOLDER}/athena.regtest | tee regtest.log - echo "art-result: ${PIPESTATUS[0]} RegTest" + timeout 1m regtest.pl --inputfile athena.regtest --reffile ${REF_FOLDER}/athena.regtest 2>&1 | tee -a regtest.log + echo "art-result: ${PIPESTATUS[0]} ${NAME}.RegTest" else echo $(date "+%FT%H:%M %Z")" No reference athena.regtest found in ${REF_FOLDER}" fi -if [ -f ${REF_FOLDER}/expert-monitoring.root ]; then - echo $(date "+%FT%H:%M %Z")" Running rootcomp" - timeout 10m rootcomp.py ${REF_FOLDER}/expert-monitoring.root | tee rootcompout.log - echo "art-result: ${PIPESTATUS[0]} RootComp" - echo $(date "+%FT%H:%M %Z")" Running checkcounts" - timeout 10m trigtest_checkcounts.sh 0 expert-monitoring.root ${REF_FOLDER}/expert-monitoring.root HLT | tee checkcountout.log - echo "art-result: ${PIPESTATUS[0]} CheckCounts" -else - echo $(date "+%FT%H:%M %Z")" No reference expert-monitoring.root found in ${REF_FOLDER}" -fi - if [ -f trig_cost.root ]; then echo $(date "+%FT%H:%M %Z")" Running CostMon" # timeout 2h RunTrigCostD3PD -f trig_cost.root --outputTagFromAthena --costMode --ratesMode > costMon.log 2>&1 @@ -65,38 +123,21 @@ else echo $(date "+%FT%H:%M %Z")" file trig_cost.root does not exist thus RunTrigCostD3PD will not be run" fi -echo $(date "+%FT%H:%M %Z")" Running check for zero L1, HLT or TE counts" -export COUNT_EXIT=0 -if [[ `sed 's|.*\(.* \)|\1|' L1AV.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then - echo "L1 counts ERROR : all entires are ZERO please consult L1AV.txt" - (( COUNT_EXIT = COUNT_EXIT || 1 )) -fi -if [[ `sed 's|.*\(.* \)|\1|' HLTChain.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then - echo "HLTChain counts ERROR : all entires are ZERO please consult HLTChain.txt" - (( COUNT_EXIT = COUNT_EXIT || 1 )) -fi -if [[ `sed 's|.*\(.* \)|\1|' HLTTE.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then - echo "HLTTE counts ERROR : all entires are ZERO please consult HLTTE.txt" - (( COUNT_EXIT = COUNT_EXIT || 1 )) -fi -echo "art-result: ${COUNT_EXIT} ZeroCounts" - - if [ -f ESD.pool.root ]; then echo $(date "+%FT%H:%M %Z")" Running CheckFile on ESD" - timeout 10m checkFile.py ESD.pool.root | tee ESD.pool.root.checkFile - echo "art-result: ${PIPESTATUS[0]} CheckFileESD" + timeout 10m checkFile.py ESD.pool.root 2>&1 | tee -a ESD.pool.root.checkFile + echo "art-result: ${PIPESTATUS[0]} ${NAME}.CheckFileESD" else echo $(date "+%FT%H:%M %Z")" No ESD.pool.root to check" fi if [ -f AOD.pool.root ]; then echo $(date "+%FT%H:%M %Z")" Running CheckFile on AOD" - timeout 10m checkFile.py AOD.pool.root | tee AOD.pool.root.checkFile - echo "art-result: ${PIPESTATUS[0]} CheckFileAOD" + timeout 10m checkFile.py AOD.pool.root 2>&1 | tee -a AOD.pool.root.checkFile + echo "art-result: ${PIPESTATUS[0]} ${NAME}.CheckFileAOD" echo $(date "+%FT%H:%M %Z")" Running CheckxAOD AOD" - timeout 10m checkxAOD.py AOD.pool.root | tee AOD.pool.root.checkxAODFile - echo "art-result: ${PIPESTATUS[0]} CheckXAOD" + timeout 10m checkxAOD.py AOD.pool.root 2>&1 | tee -a AOD.pool.root.checkxAODFile + echo "art-result: ${PIPESTATUS[0]} ${NAME}.CheckFileXAOD" else echo $(date "+%FT%H:%M %Z")" No AOD.pool.root to check" fi @@ -106,5 +147,3 @@ ls -lh echo $(date "+%FT%H:%M %Z")" Finished TrigP1Test post processing" - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_summary.sh b/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_summary.sh new file mode 100755 index 0000000000000000000000000000000000000000..ade4aaa0c8960637825aeaa0a3cd1ef1e49b6c9e --- /dev/null +++ b/Trigger/TrigValidation/TrigP1Test/test/exec_art_trigp1test_summary.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "=====================================" +echo $(date "+%FT%H:%M %Z")" Test Summary:" +if [ -f ${JOB_LOG} ]; then + grep "art-result:" ${JOB_LOG} | awk '{split($0,a,":"); print a[2] }' > summary.log + cat summary.log +fi +echo "=====================================" diff --git a/Trigger/TrigValidation/TrigP1Test/test/exec_athenaHLT_art_trigger_validation.sh b/Trigger/TrigValidation/TrigP1Test/test/exec_athenaHLT_art_trigger_validation.sh deleted file mode 100755 index 835e77fa6348709cd9b7287ba47d1ce9dc55c992..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/exec_athenaHLT_art_trigger_validation.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -echo $(date "+%FT%H:%M %Z")" Execute AthenaHLT test ${NAME}" - -### DEFAULTS - -if [ -z ${MENU} ]; then - export MENU="Physics_pp_v7_unprescaled_only_physics_prescale" -fi - -if [ -z ${EVENTS} ]; then - export EVENTS="1000" -fi - -if [ -z ${JOBOPTION} ]; then - export JOBOPTION="TriggerTest/testCommonSliceAthenaTrigRDO.py" -fi - -if [ -z ${JOB_LOG} ]; then - export JOB_LOG="athena.log" -fi - -if [ -z ${FILE} ]; then - export FILE="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00339070.physics_EnhancedBias.merge.RAW._lb0101._SFO-1._0001.1" -fi - -if [ -z ${TESTOPTION} ]; then - export TESTOPTION="setMenu='Physics_pp_v7_unprescaled_only_physics_prescale';setLVL1XML='TriggerMenuXML/LVL1config_Physics_pp_v7.xml';setL1TopoXML=setLVL1XML.replace('/LVL1','/L1Topo');rerunLVL1=True;enableCostD3PD=True;enableCostForCAF=True" -fi - -if [ -z ${ATHENAHLTOPT} ]; then - export ATHENAHLTOPT="" -fi - -if [ -z ${ATHENAHLTCMD} ]; then - export ATHENAHLTCMD="athenaHLT.py" -fi - -###################################### - -${ATHENAHLTCMD} ${ATHENAHLTOPT} \ --n ${EVENTS} \ --f "${FILE}" \ --c "${TESTOPTION}" \ -${JOBOPTION} &> ${JOB_LOG} - -###################################### -COMMAND=$PREVIOUS_COMMAND ATH_RETURN=$? -echo ${COMMAND} > command.txt -echo "Command to reproduce:" -envsubst < command.txt -echo "art-result: ${ATH_RETURN} ${JOB_LOG%%.*}" -echo $(date "+%FT%H:%M %Z")" Done executing AthenaHLT test ${NAME}" - - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_AthenaP1RDOtoBS_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_AthenaP1RDOtoBS_build.sh deleted file mode 100755 index a044da96314f5dce207963af8839d41d882561b4..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_AthenaP1RDOtoBS_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: Run RDO->BS using ttbar MC file -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=AthenaP1RDOtoBS -export JOB_LOG="${NAME}.log" - -timeout 20m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_AthenaTrigBS_L2EFMerging_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_AthenaTrigBS_L2EFMerging_build.sh deleted file mode 100755 index 5a4fe1c08749e18deab8c8d483ee11aedafe7c5e..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_AthenaTrigBS_L2EFMerging_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: testing trigger results w/wo merging L2/EF, based on AthenaTrigRDO with run_standalone.py -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=AthenaTrigBS_L2EFMerging -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV4_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV4_build.sh deleted file mode 100755 index 390b145508c89047cff0129d6160da6d743e15fd..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV4_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT standalone with HLT_HIV4 menu on a HI sample -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_HIV4 -export JOB_LOG="${NAME}.log" - -timeout 40m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV5_FTK_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV5_FTK_build.sh deleted file mode 100755 index 834176f1ba0e93698f0d97b3c6ae7af52ad6779f..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV5_FTK_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on HI data with HI V5 menu and doFTK (NB: no FTK sim in input data) -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_HIV5_FTK -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV5_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV5_build.sh deleted file mode 100755 index 1b4fdbd2ad90079447ed5182585eb18634e27e6b..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_HIV5_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT standalone with HLT_HIV5 menu on a HI sample -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_HIV5 -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_MCHIV5_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_MCHIV5_build.sh deleted file mode 100755 index 8ee9eb1999c3a1ec702659dcddd5fa11b9b3e9fd..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_MCHIV5_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT standalone with HLT_HIV5 menu on a HI sample -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_MCHIV5 -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_RAWtoESD_TrigEDMCheck_TrigDecTool_physicsV7_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_RAWtoESD_TrigEDMCheck_TrigDecTool_physicsV7_build.sh deleted file mode 100755 index 4339e1f922bea7361a039bbe841047b02cd4c15e..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_RAWtoESD_TrigEDMCheck_TrigDecTool_physicsV7_build.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on EB data with Physics_pp_v7 menu, RAWtoESD on output, EDM checker on ESD, and Check of TrigDec -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7 -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=RAWtoESD_physicsV7 -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=TrigEDMCheck_physicsV7 -export JOB_LOG="${NAME}.log" - -timeout 50m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=TrigDecTool_physicsV7 -export JOB_LOG="${NAME}.log" - -timeout 50m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_mcV7_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_mcV7_build.sh deleted file mode 100755 index aa65bed73f74a09da3b264234c39eabb60b22a4a..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_mcV7_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: AthenaHLT on data, with MC_pp_V7 menu loose prescale set -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_mcV7 -export JOB_LOG="${NAME}.log" - -timeout 50m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_mcV7_menu_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_mcV7_menu_build.sh deleted file mode 100755 index e743376149a6d29171fb0144d4fe3aca8c83fb51..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_mcV7_menu_build.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# art-description: Run athenaHLT with and without rerunL1 to create the menu configurations to create SMK for reprocessings -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_mcV7_menu -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=UploadMenuKeys_MC -export JOB_LOG="${NAME}.log" - -timeout 120m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=HLT_mcV7_rerunLVL1_menu -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=UploadMenuKeys_MC_rerunLVL1 -export JOB_LOG="${NAME}.log" - -timeout 120m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_AFP_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_AFP_build.sh deleted file mode 100755 index 15dc0c38a3571d2993f0ee61350910d68de5abbf..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_AFP_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with AFP included, with Physics_pp_v7 menu (ATR-14776) -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_AFP -export JOB_LOG="${NAME}.log" - -timeout 40m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_ALFAMon_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_ALFAMon_build.sh deleted file mode 100755 index db92c868d337e27557632e70b67416fd797d9d98..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_ALFAMon_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT with ALFA monitoring enabled, with Physics_pp_v6 menu, on run 2 data with ALFA in (see ATR-12448) -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_ALFAMon -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_2016IDCOSMICS_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_2016IDCOSMICS_build.sh deleted file mode 100755 index de064ed9e45c2e81f37c9134a55d01a014ebd3c3..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_2016IDCOSMICS_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with Physics_pp_v7 menu currently cosmics from 2016 -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_COS_2016IDCOSMICS -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_2016MUONS_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_2016MUONS_build.sh deleted file mode 100755 index 9b8a1da8728507ba36cae1d9beb2208859240f78..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_2016MUONS_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with Physics_pp_v7 menu currently cosmics from 2016 -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_COS_2016MUONS -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_build.sh deleted file mode 100755 index c9f29497140f220b465f778f2f408837c054efa4..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_COS_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with Physics_pp_v7 menu currently cosmics from 2016 -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_COS -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_DataScouting_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_DataScouting_build.sh deleted file mode 100755 index 413e2aecaea835abaa883adaaf37953ca359faa8..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_DataScouting_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with Physics_pp_v7 menu, test output of DataScouting containers -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_DataScouting -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_FTK_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_FTK_build.sh deleted file mode 100755 index b059c04f180fd9b1807642cf86b21ccdf3d0dffc..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_FTK_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with Physics_pp_v7 menu and doFTK currently from 2016 EB data with FTK added -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_FTK -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_L1Topo_data_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_L1Topo_data_build.sh deleted file mode 100755 index f28dc7f69da7ac620798ac582ad7e4e8afe7c3e0..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_L1Topo_data_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on online test data including L1Topo ROI & DAQ ROB decoding with Physics_pp_v7 menu on events selected from data15_13TeV.00278748.physics_Main -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_L1Topo_data -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_ROBprefetching_off_on_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_ROBprefetching_off_on_build.sh deleted file mode 100755 index e1d9f8f60ca3e01f883ecf910ab78e5597295752..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_ROBprefetching_off_on_build.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with physicsV7 menu with and without ROB prefetching (ATR-17867) -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_ROBprefetching_off -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=HLT_physicsV7_ROBprefetching_on -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_beamspot_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_beamspot_build.sh deleted file mode 100755 index d403801e526fdffde88b7b961ef80bcd3006b47d..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_beamspot_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: Test of beamspot udpate with athenaHLT -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_beamspot -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_build.sh deleted file mode 100755 index d9d62260ee5716d0bf9bd37b4a6fee927aad0f5d..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with Physics_pp_v7 menu currently from 2016 EB data -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7 -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_magField_on_off_on_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_magField_on_off_on_build.sh deleted file mode 100755 index f4ca7cf65747fa0390ece7aa0872423d64dc0fe9..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_magField_on_off_on_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with physicsV7 menu with On and Off magnetic field transition -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_magField_on_off_on -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_ART_and_ROSsim_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_ART_and_ROSsim_build.sh deleted file mode 100755 index 2daf7732a0692068c1a47dcbb21f7f4d94afdfb8..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_ART_and_ROSsim_build.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# art-description: Run athenaHLT on all events to create trigger configuration, generates and uploads SMKs with rerunLVL1 physics menu, then run ROS simulation with prescale keys for 17000 and 9000. RB configured such that new chains are unprescaled. Only in 21.1! -# art-type: build -# art-include: 21.1/AthenaP1 - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_menu -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=UploadMenuKeys_ART -export JOB_LOG="${NAME}.log" - -timeout 120m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=HLT_physicsV7_ROSsim_17000 -export JOB_LOG="${NAME}.log" - -timeout 150m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=HLT_physicsV7_ROSsim_9000 -export JOB_LOG="${NAME}.log" - -timeout 150m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_ART_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_ART_build.sh deleted file mode 100755 index 7f512b93b62c16e52b4583a8c07eb54bb4167969..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_ART_build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# art-description: Run athenaHLT on all events to create trigger configuration, generates and uploads SMKs created from the HLT first and compares after rerun jobs from DB, then compare the SMK created from the HLT_physicsV7 first and rerun jobs.Only in 21.1! -# art-type: build -# art-include: 21.1/AthenaP1 - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_menu -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=UploadMenuKeys_ART -export JOB_LOG="${NAME}.log" - -timeout 120m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_build.sh deleted file mode 100755 index fa8615eac007be6f7186f3ce3aeb68084ceb5197..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_menu_build.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash - -# art-description: Run athenaHLT on all events to create trigger configuration, generates and uploads SMKs created from the HLT first and compares after rerun jobs from DB, then compare the SMK created from the HLT_physicsV7 first and rerun jobs. Runs the same thing also for the physics HI v5 menu -# art-type: build -# art-include: 21.1/AthenaP1 - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -#export NAME=HLT_physicsV7_menu -#export JOB_LOG="${NAME}.log" - -#timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -#ATH_RETURN=${PIPESTATUS[0]} -#echo "art-result: ${ATH_RETURN} ${NAME}" - -#export NAME=UploadMenuKeys -#export JOB_LOG="${NAME}.log" - -#timeout 120m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -#ATH_RETURN=${PIPESTATUS[0]} -#echo "art-result: ${ATH_RETURN} ${NAME}" - -#export NAME=HLT_physicsV7_menu_rerundb -#export JOB_LOG="${NAME}.log" - -#timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -#ATH_RETURN=${PIPESTATUS[0]} -#echo "art-result: ${ATH_RETURN} ${NAME}" - -#export NAME=HLT_physicsV7_menu_checkkeys -#export JOB_LOG="${NAME}.log" - -#timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -#ATH_RETURN=${PIPESTATUS[0]} -#echo "art-result: ${ATH_RETURN} ${NAME}" - -#export NAME=CheckKeysV7 -#export JOB_LOG="${NAME}.log" - -#timeout 180m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -#ATH_RETURN=${PIPESTATUS[0]} -#echo "art-result: ${ATH_RETURN} ${NAME}" - -#export NAME=HLT_physicsV7_rerunLVL1_menu -#export JOB_LOG="${NAME}.log" - -#timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -#ATH_RETURN=${PIPESTATUS[0]} -#echo "art-result: ${ATH_RETURN} ${NAME}" - -#export NAME=UploadMenuKeys_rerunLVL1 -#export JOB_LOG="${NAME}.log" - -#timeout 120m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -#ATH_RETURN=${PIPESTATUS[0]} -#echo "art-result: ${ATH_RETURN} ${NAME}" - -#export NAME=HLT_physicsV7_rerunLVL1_menu_rerundb -#export JOB_LOG="${NAME}.log" - -#timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -#ATH_RETURN=${PIPESTATUS[0]} -#echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=HLT_HIV5_menu -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=UploadMenuKeys_HI -export JOB_LOG="${NAME}.log" - -timeout 120m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=HLT_HIV5_menu_rerundb -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=HLT_HIV5_menu_checkkeys -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=CheckKeysHIV5 -export JOB_LOG="${NAME}.log" - -timeout 180m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_rerunLVL1_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_rerunLVL1_build.sh deleted file mode 100755 index 4d03689600def4bf02411e646a161d9c89b13854..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_rerunLVL1_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with Physics_pp_v7 menu currently from 2016 EB data -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_rerunLVL1 -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_run_stop_run_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_run_stop_run_build.sh deleted file mode 100755 index ac639511106cebbc2408ebd7946fac587410f666..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HLT_physicsV7_run_stop_run_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on data with physics_pp_V7 menu with stop/start transition -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7_run_stop_run -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_OHMonitoring_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_OHMonitoring_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..0964af66a8d242bce16759a91513abc3350bc3a5 --- /dev/null +++ b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_OHMonitoring_build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# art-description: HelloWorld in athenaHLT with OH monitoring +# art-type: build +# art-include: master/Athena + +export NAME=HelloWorldHLT_OHMonitoring +# use export ART_FILE_NAME=... to set the INPUT_FILE value +export ART_CMD="athenaHLT.py -M -n 10 -f INPUT_FILE AthExHelloWorld/HelloWorldOptions.py" + +exec_art_trigp1test.sh -c "${ART_CMD}" -t "20m" + diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_build.sh index da6e1824616cd6b31f7163ebfb23c579c8b1abff..21f53042cb59b557833159a68e7a0051d578de3e 100755 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_build.sh +++ b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_build.sh @@ -2,22 +2,11 @@ # art-description: HelloWorld in athenaHLT # art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi +# art-include: master/Athena export NAME=HelloWorldHLT -export JOB_LOG="${NAME}.log" - -timeout 5m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} +# use export ART_FILE_NAME=... to set the INPUT_FILE value +export ART_CMD="athenaHLT.py -n 10 -f INPUT_FILE AthExHelloWorld/HelloWorldOptions.py" -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" +exec_art_trigp1test.sh -c "${ART_CMD}" -t "20m" diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_forkAndMT_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_forkAndMT_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..9414525043d6334853ff7a7aeaf7260bf271ac0a --- /dev/null +++ b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_forkAndMT_build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# art-description: HelloWorld in athenaHLT with forking into 2 children and with 4 threads +# art-type: build +# art-include: master/Athena + +export NAME=HelloWorldHLT_forkAndMT +# use export ART_FILE_NAME=... to set the INPUT_FILE value +export ART_CMD="athenaHLT.py --nprocs 2 --threads 4 -n 10 -f INPUT_FILE AthExHelloWorld/HelloWorldOptions.py" + +exec_art_trigp1test.sh -c "${ART_CMD}" -t "20m" + diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_fork_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_fork_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..12dff9682527b3ee5faf363f98b1b36b45cde663 --- /dev/null +++ b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_fork_build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# art-description: HelloWorld in athenaHLT with forking into 2 children +# art-type: build +# art-include: master/Athena + +export NAME=HelloWorldHLT_fork +# use export ART_FILE_NAME=... to set the INPUT_FILE value +export ART_CMD="athenaHLT.py --nprocs 2 -n 10 -f INPUT_FILE AthExHelloWorld/HelloWorldOptions.py" + +exec_art_trigp1test.sh -c "${ART_CMD}" -t "20m" + diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_run_stop_run_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_run_stop_run_build.sh index 7bba08e2b405755663aecfdb455eab407d34231f..7bcf33d4b6f41d89b769a310dd52891e9cbba7a3 100755 --- a/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_run_stop_run_build.sh +++ b/Trigger/TrigValidation/TrigP1Test/test/test_HelloWorldHLT_run_stop_run_build.sh @@ -1,25 +1,13 @@ #!/bin/bash -# art-description: HelloWorld int athenaHLT with start/stop/start transition +# art-description: HelloWorld in athenaHLT with start/stop/start transition # art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi +# art-include: master/Athena export NAME=HelloWorldHLT_run_stop_run -export JOB_LOG="${NAME}.log" - -timeout 10m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - +# use export ART_FILE_NAME=... to set the INPUT_FILE value +export TRANSITIONS="run-stop-run-saveHist.trans" +export ART_CMD="get_files -data ${TRANSITIONS}; athenaHLT.py -i -M --rewind -f INPUT_FILE AthExHelloWorld/HelloWorldOptions.py < ${TRANSITIONS}" +exec_art_trigp1test.sh -c "${ART_CMD}" -t "20m" diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_Reco_tf_physicsV7_savedBS_AthenaP1BS_standalone_physicsV7_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_Reco_tf_physicsV7_savedBS_AthenaP1BS_standalone_physicsV7_build.sh deleted file mode 100755 index 66d99392c87b9f7c2ba19ee7ba089290e113e318..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_Reco_tf_physicsV7_savedBS_AthenaP1BS_standalone_physicsV7_build.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on EB data with Physics_pp_v7 menu, Reco_tf on saved output, and Standalone HLT running in athena and compare to athenaHLT -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=HLT_physicsV7 -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=Reco_tf_physicsV7_savedBS -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=AthenaP1BS_standalone -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_Trigreco_physicsV7_currentT0_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_Trigreco_physicsV7_currentT0_build.sh deleted file mode 100755 index 69befeb299251af82bd51f3d7f0a3f8d89e27f23..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_Trigreco_physicsV7_currentT0_build.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# art-description: Trig_reco_tf with current T0 config, EDMCheck on ESD and AOD -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=Trigreco_physicsV7_currentT0 -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=TrigEDMCheck_physicsV7_currentT0_ESD -export JOB_LOG="${NAME}.log" - -timeout 50m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -export NAME=TrigEDMCheck_physicsV7_currentT0_AOD -export JOB_LOG="${NAME}.log" - -timeout 50m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_CostMonitoring_PhysicsV7_grid.sh b/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_CostMonitoring_PhysicsV7_grid.sh deleted file mode 100755 index 16d87015854d3177551641655d1264d76877a72a..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_CostMonitoring_PhysicsV7_grid.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on recent EnhancedBias with cost monitoring enabled -# art-type: grid -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - -# art-output: HLTChain.txt -# art-output: HLTTE.txt -# art-output: L1AV.txt -# art-output: HLTconfig*.xml -# art-output: L1Topoconfig*.xml -# art-output: LVL1config*.xml -# art-output: *.log -# art-output: costMonitoring_* -# art-output: *.root -# art-output: ntuple.pmon.gz -# art-output: *perfmon* -# art-output: *.regtest -# art-output: athena_stdout.txt - -export NAME="athenaHLT_CostMonitoring_PhysicsV7_grid" -export TESTOPTION="setMenu='Physics_pp_v7_unprescaled_only_physics_prescale';setLVL1XML='TriggerMenuXML/LVL1config_Physics_pp_v7.xml';setL1TopoXML=setLVL1XML.replace('/LVL1','/L1Topo');rerunLVL1=True;enableCostD3PD=True;enableCostForCAF=True;HLTOutputLevel=INFO;doValidation=True;" -export FILE="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00339070.physics_EnhancedBias.merge.RAW._lb0101._SFO-1._0001.1" -export JOBOPTION="TriggerRelease/runHLT_standalone.py" -export EVENTS="10000" - -source exec_athenaHLT_art_trigger_validation.sh -source exec_art_trigp1test_post.sh - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_LatestRun_HIV5_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_LatestRun_HIV5_build.sh deleted file mode 100755 index f0f42221fe1f1e851dd5fd73487d289c13b2517b..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_LatestRun_HIV5_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on latest available run -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME="athenaHLT_LatestRun_HIV5" -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_LatestRun_MCV7_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_LatestRun_MCV7_build.sh deleted file mode 100755 index cbf3a84b70bf39e5dd692668ffc6d25c837224bb..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_LatestRun_MCV7_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on latest available run -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME="athenaHLT_LatestRun_MCV7" -export JOB_LOG="${NAME}.log" - -timeout 100m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_on_data_leakCheck_grid.sh b/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_on_data_leakCheck_grid.sh deleted file mode 100755 index 05dbb54c37516b4faa7b246f9cd5ee2e27a11c50..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_athenaHLT_on_data_leakCheck_grid.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# art-description: athenaHLT on DATA all slices leakCheck -# art-type: grid -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - -# art-output: HLTChain.txt -# art-output: HLTTE.txt -# art-output: L1AV.txt -# art-output: HLTconfig*.xml -# art-output: L1Topoconfig*.xml -# art-output: LVL1config*.xml -# art-output: *.log -# art-output: costMonitoring_* -# art-output: *.root -# art-output: ntuple.pmon.gz -# art-output: *perfmon* -# art-output: *.regtest -# art-output: LeakCheck.txt - -export NAME="athenaHLT_on_data_leakCheck_grid" -export JOB_LOG="${NAME}.log" - -export LD_PRELOAD=/cvmfs/sft.cern.ch/lcg/releases/libunwind/5c2cade-76996/$CMTCONFIG/lib/libunwind.so - -athenaHLT.py --stdcmalloc --leak-check-execute -o HLT_physicsV7 -n 100 -f "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00339070.physics_EnhancedBias.merge.RAW._lb0101._SFO-1._0001.1" -c "setMenu='Physics_pp_v7_tight_physics_prescale';setLVL1XML='TriggerMenuXML/LVL1config_Physics_pp_v7.xml';setL1TopoXML=setLVL1XML.replace('/LVL1','/L1Topo');HLTOutputLevel=WARNING;doValidation=True;rerunLVL1=True;" TrigP1Test/runHLT_standaloneRTT_leakCheck.py &> ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} athena" - -source exec_art_trigp1test_post.sh diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_physics_pp_v7_PSed_nightlyDayBefore_grid.sh b/Trigger/TrigValidation/TrigP1Test/test/test_physics_pp_v7_PSed_nightlyDayBefore_grid.sh deleted file mode 100755 index eed3d8bbb1255a7de527da1b20e0d592a8dc75b6..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_physics_pp_v7_PSed_nightlyDayBefore_grid.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash - -# art-description: Physics pp v7 menu with athenaHLT over EnhancedBias data with prescales created in ART build job and read from DB. FROM NIGHTLY OF THE DAY BEFORE! -# art-type: grid -# art-include: 21.1/AthenaP1 -# art-output: HLTChain.txt -# art-output: HLTTE.txt -# art-output: L1AV.txt -# art-output: HLTconfig*.xml -# art-output: L1Topoconfig*.xml -# art-output: LVL1config*.xml -# art-output: *.log -# art-output: costMonitoring_* -# art-output: *.root -# art-output: ntuple.pmon.gz -# art-output: *perfmon* -# art-output: *.regtest -# art-output: athena_stdout.txt - -export NAME="athenaHLT_prescaled_PhysicsV7" -export JOB_LOG="${NAME}.log" - -#source /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/prescaleKeys_17000.txt | tee ${JOB_LOG} -#for testing: -#source /eos/atlas/atlascerngroupdisk/data-art/grid-input/TrigP1Test/prescaleKeys_17000.txt | tee ${JOB_LOG} -eval "export $( grep 'smk=' /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/prescaleKeys_17000.txt)" -eval "export $( grep 'l1psk=' /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/prescaleKeys_17000.txt)" -eval "export $( grep 'hltpsk=' /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/prescaleKeys_17000.txt)" - -#smk=5218 -#l1psk=120 -#hltpsk=420 -echo 'smk' ${smk} | tee ${JOB_LOG} -echo 'l1psk' ${l1psk} | tee ${JOB_LOG} -echo 'hltpsk' ${hltpsk} | tee ${JOB_LOG} - -echo "Reading release from SMK" | tee ${JOB_LOG} -get_files releaseFromSMK.py -python releaseFromSMK.py TRIGGERDBART ${smk} > releaseFromSMK.log -cat releaseFromSMK.log | tee ${JOB_LOG} -eval "$( grep 'export release=' releaseFromSMK.log)" -if [ -z ${release} ]; then - echo "Release not found" | tee ${JOB_LOG} -fi - -l1psk="'lvl1key': ${l1psk}" -subshellcmd='source $AtlasSetup/scripts/asetup.sh AthenaP1,21.1,'${release}'; athenaHLT.py -n 5000 -f /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00339070.physics_EnhancedBias.merge.RAW._lb0101._SFO-1._0001.1 -o HLT_physicsV7_prescaled -J TrigConf::HLTJobOptionsSvc --use-database --db-type "Coral" --db-server "TRIGGERDBART" --db-smkey '${smk}' --db-hltpskey '${hltpsk}' --db-extra "{'${l1psk}'}"; Trig_reco_tf.py --inputBSFile=HLT_physicsV7_prescaled._0001.data --outputNTUP_TRIGCOST=trig_cost.root; RunTrigCostD3PD -f trig_cost.root --outputTagFromAthena --costMode --monitorRates --isCPUPrediction --useEBWeight --patternsMonitor HLT_costmonitor HLT_mistimemonj400 HLT_mistimemoncaltimenomu HLT_mistimemoncaltime HLT_l1topodebug HLT_l1calooverflow HLT_e5_lhvloose_nod0_bBeexM6000t HLT_2e5_lhvloose_nod0_bBeexM6000t HLT_cscmon_L1All HLT_j0_perf_ds1_L1J100 --patternsInvert --predictionLumi 1.50e34; chainDump.py -n -S 2>&1 | tee ${JOB_LOG}' -echo "running in subshell: $subshellcmd" -(eval $subshellcmd) - -grep -r "RATE_" costMonitoring_*/csv/Table_Rate_Group_HLT_All.csv | awk '{split($0,a,","); print a[1]"\t"a[4] }' >> HLTChain.txt -grep "TrigSteer_HLT.TrigChainMoni" stdout.txt | awk '{split($0,a,":|\t"); print a[4]" "a[10] }' | sed 's/\s*active\s*/_rerun\t/g' | sed 's/\s*HLT/HLT/g' >> HLTChain.txt - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - -#exec_art_trigp1test_post.sh - - -#echo 'ART Grid test with Physics_pp_v7 PSed menu' -# -#if ! [ -x "$(command -v athenaHLT.py)" ]; then -# echo 'Invalid - not a P1 environment.' >&2 -# exit 0 -#fi -# -#ART_dir=${PWD} -#echo 'ART_dir: '${ART_dir} -# -#MENU='Physics_pp_v7' -#echo 'Menu:' ${MENU} -# -#export ATLAS_LOCAL_ROOT_BASE="/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase" -#source $ATLAS_LOCAL_ROOT_BASE/packageSetups/localSetup.sh git -##TODO: at the moment working on RB master -#git clone https://:@gitlab.cern.ch:8443/atlas-trigger-menu/TrigMenuRulebook.git -##git clone /afs/cern.ch/user/t/tamartin/public/TrigMenuRulebook/ -#RB_dir=${PWD}/TrigMenuRulebook -#echo 'RB_dir: '${RB_dir} -# -# -#echo 'getting L1 and L1Topo xml files' -##get the L1 file -#get_files -xmls -copy LVL1config_${MENU}.xml -#l1menu=`find . -name LVL1config_${MENU}.xml` -##get the L1 Topo configuration -#get_files -xmls -copy L1Topoconfig_${MENU}.xml -#l1topo=`find . -name L1Topoconfig_${MENU}.xml` -# -## generate only hlt xml for RB without DB access -#echo "Generating menu" -#athena.py -c "TriggerMenuSetup='${MENU}'" TriggerMenuXML/runHLT_forXMLgeneration.py -#hltmenu=`find . -name outputHLTconfig.xml` -# -#echo 'l1menu: '${l1menu} -#echo 'l1topo: '${l1topo} -#echo 'hltmenu: '${hltmenu} -# -#cd ${RB_dir}/scripts -# -#rm -f l1.xml hlt.xml -#ln -s ${ART_dir}/${l1menu} l1.xml -#ln -s ${ART_dir}/${hltmenu} hlt.xml -# -##TODO: configure RB properly, which lumi point? -#sed -i -e 's/ignoreErrors = False/ignoreErrors = True/g' runOptions.py -#./runRuleBook.py 20000 -# -#cd ${ART_dir} -# -#hltPS=`find TrigMenuRulebook/scripts -name "RuleBook_HLTPS_${MENU}_*.xml"` -#l1PS=`find TrigMenuRulebook/scripts -name "RuleBook_LV1PS_${MENU}_*.xml"` -# -#echo "hltPS: "${hltPS} -#echo "l1PS: "${l1PS} -# -##TODO: what to do with missing chains? -#python ${RB_dir}/scripts/apply_PS.py ${l1menu} ${l1PS} PSed_LVL1_${MENU}.xml -#python ${RB_dir}/scripts/apply_PS.py ${hltmenu} ${hltPS} PSed_HLT_${MENU}.xml -# -#athenaHLT.py -f '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1' -c 'setMenu="'${MENU}'";setLVL1XML="PSed_LVL1_'${MENU}'.xml"; setHLTXML="PSed_HLT_'${MENU}'.xml";rerunLVL1=True;enableCostD3PD=True;enableCostForCAF=True' TriggerRelease/runHLT_standalone.py -#export ATH_EXIT=$? -# -#chainDump.py -S --rootFile=expert-monitoring.root -# -#return $ATH_ExXIT diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_build.sh deleted file mode 100755 index fea72aad6eeb5b84c6efc3f4f17a49200b27e5a7..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: stand-alone test of the steering -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=pureSteering -export JOB_LOG="${NAME}.log" - -timeout 50m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_ecodes_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_ecodes_build.sh deleted file mode 100755 index 48e8be9983eb82046b881440c99a1dcd23b53a8e..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_ecodes_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: stand-alone test of the steering with useErrorHandlingMenu -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=pureSteering_ecodes -export JOB_LOG="${NAME}.log" - -timeout 50m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_prescaling_build.sh b/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_prescaling_build.sh deleted file mode 100755 index 0db08281bdc2d0c4b7cebc736312dd3e46cef8cf..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigP1Test/test/test_pureSteering_prescaling_build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# art-description: stand-alone test of the steering with the PrescaleMenu -# art-type: build -# art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 -# art-include: 21.0/AthenaP1 -# art-include: 21.0-TrigMC/AthenaP1 - - - -if [ -z ${TEST} ]; then - export TEST="TrigP1Test" -fi - -export NAME=pureSteering_prescaling -export JOB_LOG="${NAME}.log" - -timeout 50m trigtest_ART.pl --cleardir --test ${NAME} --rundir ${NAME} --conf TrigP1Test_ART.conf | tee ${JOB_LOG} - -ATH_RETURN=${PIPESTATUS[0]} -echo "art-result: ${ATH_RETURN} ${NAME}" - - - diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py index 3c78e43548369302a7c24e16b155cb710c5c3561..c1140dcbfd78c901964e3651d9791c128db56914 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py @@ -27,58 +27,14 @@ def InDetIDCCacheCreatorCfg(): acc.addEventAlgo( InDetCacheCreatorTrig ) return acc - - -#Set up ID GeoModel -def InDetGMConfig( flags ): - acc = ComponentAccumulator() - from AtlasGeoModel.GeoModelConfig import GeoModelCfg - gmc,geoModelSvc = GeoModelCfg( flags ) - acc.merge( gmc ) - - from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc - acc.addService(GeometryDBSvc("InDetGeometryDBSvc")) - - from AthenaCommon import CfgGetter - geoModelSvc.DetectorTools += [ CfgGetter.getPrivateTool("PixelDetectorTool", checkType=True) ] - -# if (DetFlags.detdescr.BCM_on() ) : - - from BCM_GeoModel.BCM_GeoModelConf import InDetDD__BCM_Builder - bcmTool = InDetDD__BCM_Builder() - acc.addPublicTool( bcmTool ) - geoModelSvc.DetectorTools['PixelDetectorTool'].BCM_Tool = bcmTool - - from BLM_GeoModel.BLM_GeoModelConf import InDetDD__BLM_Builder - blmTool = InDetDD__BLM_Builder() - acc.addPublicTool( blmTool ) - geoModelSvc.DetectorTools['PixelDetectorTool'].BLM_Tool = blmTool - - geoModelSvc.DetectorTools['PixelDetectorTool'].useDynamicAlignFolders = True #InDetGeometryFlags.useDynamicAlignFolders() - -#if ( DetFlags.detdescr.SCT_on() ): - # Current atlas specific code - from AthenaCommon import CfgGetter - geoModelSvc.DetectorTools += [ CfgGetter.getPrivateTool("SCT_DetectorTool", checkType=True) ] - - geoModelSvc.DetectorTools['SCT_DetectorTool'].useDynamicAlignFolders = True #InDetGeometryFlags.useDynamicAlignFolders() - -# if ( DetFlags.detdescr.TRT_on() ): - from TRT_GeoModel.TRT_GeoModelConf import TRT_DetectorTool - trtDetectorTool = TRT_DetectorTool() -# if ( DetFlags.simulate.TRT_on() ): -# trtDetectorTool.DoXenonArgonMixture = True -# trtDetectorTool.DoKryptonMixture = True - trtDetectorTool.useDynamicAlignFolders = True #InDetGeometryFlags.useDynamicAlignFolders() - geoModelSvc.DetectorTools += [ trtDetectorTool ] - acc.addService(geoModelSvc) - return acc - #Set up conditions algorithms def TrigInDetCondConfig( flags ): acc = ComponentAccumulator() - acc.merge(InDetGMConfig(flags)) + from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg + acc.merge(InDetGeometryCfg(flags)) + #acc.merge(InDetGMConfig(flags)) + from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection")) acc.merge(addFoldersSplitOnline(flags, "INDET","/Indet/Onl/AlignL2/PIX","/Indet/AlignL2/PIX",className="CondAttrListCollection")) @@ -495,8 +451,7 @@ if __name__ == "__main__": acc.merge( TrigInDetConfig( ConfigFlags ) ) from RegionSelector.RegSelConfig import regSelCfg - rsc, regSel = regSelCfg( ConfigFlags ) - regSel.enableCalo = False # turn off calo, certainly a better way to do this... + rsc = regSelCfg( ConfigFlags ) acc.merge( rsc ) acc.addService(regSel) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py index 00c05345fad1382118dc87f2e7a93cd4a9b81cbb..95e00f23213ff4c1f31b3799675c65f5f7bbe2c3 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py @@ -67,13 +67,15 @@ def createFastCaloSequence(rerun=False): clusterMaker.ClustersName=clustersKey svcMgr.ToolSvc.TrigDataAccess.ApplyOffsetCorrection=False - from TrigMultiVarHypo.TrigL2CaloRingerFexMTInit import init_ringer - trigL2CaloRingerFexMT = init_ringer() - trigL2CaloRingerFexMT.ClustersKey = clusterMaker.ClustersName - trigL2CaloRingerFexMT.OutputLevel = DEBUG + #from TrigMultiVarHypo.TrigL2CaloRingerFexMTInit import init_ringer + #trigL2CaloRingerFexMT = init_ringer() + #trigL2CaloRingerFexMT.ClustersKey = clusterMaker.ClustersName + #trigL2CaloRingerFexMT.OutputLevel = DEBUG - fastCaloInViewAlgs = seqAND( __prefix+"fastCaloInViewAlgs", [ clusterMaker, trigL2CaloRingerFexMT ]) + + #fastCaloInViewAlgs = seqAND( __prefix+"fastCaloInViewAlgs", [ clusterMaker, trigL2CaloRingerFexMT ]) + fastCaloInViewAlgs = seqAND( __prefix+"fastCaloInViewAlgs", [ clusterMaker ]) filterL1RoIsAlg = RoRSeqFilter( __prefix+"filterL1RoIsAlg") diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py index 52d08bb197a1867bcebbcdcc4025ddaafe42608c..f569bc47d3e2f77eae00af5ccba93ea8c9078b2e 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py @@ -36,7 +36,7 @@ flags.Trigger.L1Decoder.forceEnableAllChains = True flags.lock() -from AthenaCommon.Constants import INFO,DEBUG +from AthenaCommon.Constants import INFO,DEBUG,WARNING acc = ComponentAccumulator() from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg @@ -62,12 +62,16 @@ acc.getEventAlgo( "TrigSignatureMoniMT" ).OutputLevel=DEBUG print acc.getEventAlgo( "TrigSignatureMoniMT" ) -# from TrigUpgradeTest.TestUtils import applyMenu -# applyMenu( acc.getEventAlgo( "L1Decoder" ) ) -#acc.getEventAlgo( "L1Decoder" ).OutputLevel=DEBUG -#acc.getEventAlgo( "L2ElectronCaloHypo" ).OutputLevel=DEBUG -#acc.getEventAlgo( "FastEMCaloAlgo" ).OutputLevel=DEBUG -#acc.getEventAlgo( "Filter_for_L2PhotonCaloHypo" ).OutputLevel=DEBUG +from AthenaCommon.Logging import logging +logging.getLogger('forcomps').setLevel(DEBUG) +acc.foreach_component("*/L1Decoder").OutputLevel = DEBUG +acc.foreach_component("*/L1Decoder/*Tool").OutputLevel = DEBUG # tools +acc.foreach_component("*HLTTop/*Hypo*").OutputLevel = DEBUG # hypo algs +acc.foreach_component("*HLTTop/*Hypo*/*Tool*").OutputLevel = DEBUG # hypo tools +acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = DEBUG # filters +acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers +acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type) + acc.printConfig() @@ -80,3 +84,4 @@ with file(fname, "w") as p: + diff --git a/graphics/AtlantisJava/CMakeLists.txt b/graphics/AtlantisJava/CMakeLists.txt deleted file mode 100644 index 7d9ae4dd60085d27fe898ae42a7229607783a2fc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################ -# Package: AtlantisJava -################################################################################ - -# Declare the package name: -atlas_subdir( AtlantisJava ) - -# External dependencies: -find_package( Java ) - -# Install files from the package: -atlas_install_joboptions( share/InteractiveServer.py ) -atlas_install_scripts( share/atlantis share/atlantis_online ) -atlas_install_generic( lib/*.jar - DESTINATION "share/AtlantisJava/lib" - EXECUTABLE ) -atlas_install_generic( img/*.gif img/*.png img/*.jpg - DESTINATION "share/AtlantisJava/img" - EXECUTABLE ) -atlas_install_generic( configuration/*.xml configuration/*.csv configuration/PSProlog.txt - DESTINATION "share/AtlantisJava/configuration" - EXECUTABLE ) -atlas_install_generic( events/event.dtd events/*.zip - DESTINATION "share/AtlantisJava/events" - EXECUTABLE ) -atlas_install_generic( geometry/*.xml - DESTINATION "share/AtlantisJava/geometry" - EXECUTABLE ) -atlas_install_generic( help/help.jar help/online.xml help/*.png - DESTINATION "share/AtlantisJava/help" - EXECUTABLE ) diff --git a/graphics/AtlantisJava/ant/build.xml b/graphics/AtlantisJava/ant/build.xml deleted file mode 100755 index 1172e921def862b788bda6e3ae478ea5868a9363..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/ant/build.xml +++ /dev/null @@ -1,469 +0,0 @@ -<?xml version="1.0"?> - -<!-- Main Ant build file for Atlantis --> - -<!-- basedir attribute to be adjusted - target build directory - - - - - --> -<project name="Atlantis" default="usage" basedir=".."> - <!-- begin properties - - - - - - - - - - - - - - - - - - - - - - - - --> - <!-- read in overriden properties from ant.properties file - - - - - --> - <property file="ant.properties"/> - <property name="appName" value="Atlantis"/> - - <!-- Use Java 1.6. - Note that this controls the source code accepted and bytecode generated but - does NOT ensure that the correct libraries are available so in principle you - could still build code that requires different libraries to run. - This was added when we needed to enforve Java 1.5 but 1.6 was already - the most commonly installed version. --> - <property name="ant.build.javac.source" value="1.6"/> - - <!-- webstart codebase with appropriate default --> - <property name="codebase" value="http://www.cern.ch/atlantis/webstart"/> - - <!-- password for webstart certificate - certificate is created in - webstart target, used to sign *.jar files and erased afterwards --> - <property name="password" value="webstart_certificate_atlantis_password"/> - - <!-- list of "specific system configurations" in configurations/config-*.xml --> - <!-- NOT including MINERVA since this needs a slightly different JNLP file to load events from a URL --> - <property name="configs" - value="acr-general,acr-public,l1calo-acr,lar-acr,lar-publications,mbts-acr,mdt-acr,pixel-acr,pixel-publications,sct-acr,sct-publications,tgc-acr,tile-acr,tile-publications,trt-acr,trt-publications"/> - - <!-- timeout in milliseconds for JUnit tests, applies to each forked JVM instance --> - <property name="test.timeout" value="300000"/> - - <!-- directories - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <property name="src.src" value="src"/> - <property name="lib.src" value="lib"/> - <property name="test.src" value="test/src"/> - <property name="test.events" value="test/events"/> - <!-- runtime directories and files --> - <property name="conf" value="configuration"/> - <property name="events" value="events"/> - <property name="geom" value="geometry"/> - <property name="help" value="help"/> - <property name="img" value="img"/> - <property name="share" value="share"/> - - <property name="conf.src" value="${conf}"/> - <property name="events.src" value="${events}"/> - <property name="geom.src" value="${geom}"/> - <property name="help.src" value="${help}"/> - <property name="img.src" value="${img}"/> - <property name="share.src" value="${share}"/> - - <property name="conf.run" value="${targetDir}/${conf}"/> - <property name="events.run" value="${targetDir}/${events}"/> - <property name="geom.run" value="${targetDir}/${geom}"/> - <property name="help.run" value="${targetDir}/${help}"/> - <property name="img.run" value="${targetDir}/${img}"/> - <property name="share.run" value="${targetDir}/${share}"/> - - <property name="class.run" value="${targetDir}/classes"/> - <property name="lib.run" value="${targetDir}/lib"/> - <property name="test.run" value="${targetDir}/classes-test"/> - - <!-- directories for test libraries and output --> - <property name="lib.test" value="${targetDir}/lib/test"/> - <property name="report.test" value="${targetDir}/report"/> - - <!-- Atlantis - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <property name="atlantis.jar" value="${targetDir}/atlantis.jar"/> - <property name="atlantis.main.class" value="atlantis.Atlantis"/> - - <!-- Classpath for manifest in Jar file --> - <path id="classpath.mf"> - <fileset dir="${lib.run}"> - <include name="**/*.jar"/> - </fileset> - <fileset dir="${help.run}"> - <include name="**/*.jar"/> - </fileset> - </path> - - <!-- "foreach" task needed to generate specific system configs, provided by ant-contrib --> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath> - <pathelement location="${lib.src}/build/ant-contrib-1.0b3.jar"/> - </classpath> - </taskdef> - - - <!-- =============================================================== --> - - <!-- targets begin - - - - - - - - - - - - - - - - - - - - - - - - - --> - - <!-- preinit target - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="preinit" description="Test if targetDir argument is set"> - <fail unless="targetDir"> - targetDir variable must be set - try: ant usage - example: ant -DtargetDir="test" all - </fail> - <echo>Atlantis build will be made into ${targetDir} directory</echo> - </target> - - - <!-- init target - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="init" depends="preinit" - description="Makes required directories, copies libs"> - <mkdir dir="${lib.run}"/> - <!-- For runtime libraries use include element to take only Jar files from lib directory, - not build subdirectory --> - <copy todir="${lib.run}"> - <fileset dir="${lib.src}"> - <include name="*.jar"/> - </fileset> - </copy> - - <mkdir dir="${conf.run}"/> - <copy todir="${conf.run}"> - <fileset dir="${conf.src}"/> - </copy> - - <mkdir dir="${events.run}"/> - <copy todir="${events.run}"> - <fileset dir="${events.src}"/> - </copy> - - <mkdir dir="${geom.run}"/> - <copy todir="${geom.run}"> - <fileset dir="${geom.src}"/> - </copy> - - <mkdir dir="${help.run}"/> - <copy todir="${help.run}"> - <fileset dir="${help.src}"> - <include name="help.jar"/> - </fileset> - </copy> - - <mkdir dir="${img.run}"/> - <copy todir="${img.run}"> - <fileset dir="${img.src}"/> - </copy> - - <mkdir dir="${share.run}"/> - <copy todir="${share.run}"> - <fileset dir="${share.src}"/> - </copy> - - <mkdir dir="${class.run}"/> - - </target> - - - - <!-- compile target --> - <target name="compile" depends="init" - description="Compiles all source files"> - - <javac includeAntRuntime="false" srcdir="${src.src}" destdir="${class.run}" deprecation="on" verbose="no"> - <!-- <compilerarg value="-Xlint:unchecked"/> --> - <include name="**/*.java"/> - <classpath> - <fileset dir="${lib.run}"> - <include name="**/*.jar"/> - </fileset> - </classpath> - </javac> - </target> - - - <!-- all target - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="all" depends="jar, clean" - description="Copy runtime files, build and clean up"/> - - <!-- jar-atlantis target - - - - - - - - - - - - - - - - - - - - - - --> - <!-- Keep for compatibility with existing CMT requirements file --> - <target name="jar-atlantis" depends="all" - description="Create jar file of Atlantis"> - </target> - - <!-- jar target - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="jar" depends="compile" - description="Create all jar files for deployment"> - <manifestclasspath property="jar.classpath" jarfile="${atlantis.jar}"> - <classpath refid="classpath.mf"/> - </manifestclasspath> - - <!-- jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <jar destfile="${atlantis.jar}"> - <fileset dir="${class.run}" /> - <fileset dir="${targetDir}"> - <exclude name="classes/*"/> - <exclude name="lib/*"/> - <exclude name="help/*"/> - <include name="*/*"/> - </fileset> - <manifest> - <attribute name="Built-By" value="${user.name}"/> - <attribute name="Main-Class" value="${atlantis.main.class}"/> - <attribute name="Class-Path" value="${jar.classpath}"/> - <attribute name="Implementation-Title" value="Atlantis"/> - </manifest> - </jar> - </target> - - <!-- webstartcommon target - - - - - - - - - - - - - - - - - - - - --> - <target name="webstartcommon" depends="compile"> - <manifestclasspath property="jar.classpath" jarfile="${atlantis.jar}"> - <classpath refid="classpath.mf"/> - </manifestclasspath> - - <jar destfile="${atlantis.jar}"> - <fileset dir="${class.run}" /> - - <fileset dir="${targetDir}"> - <exclude name="classes/*"/> - <exclude name="lib/*"/> - <exclude name="help/*"/> - <include name="*/*"/> - </fileset> - - <manifest> - <attribute name="Built-By" value="${user.name}"/> - <attribute name="Main-Class" value="${atlantis.main.class}"/> - <attribute name="Class-Path" value="${jar.classpath}"/> - <attribute name="Implementation-Title" value="Atlantis"/> - </manifest> - </jar> - - <!-- clean up, leave only lib/*.jar, help/*.jar, atlantis.jar --> - <delete dir="${conf.run}"/> - <delete dir="${events.run}"/> - <delete dir="${geom.run}"/> - <delete dir="${img.run}"/> - <delete dir="${share.run}"/> - - <antcall target="clean"/> - <antcall target="webstartjarsigner"/> - </target> - - - <!-- webstart - distribution via webstart (lib/*.jar, help/*.jar and - atlantis.jar (includes all data files) --> - <target name="webstart" depends="webstartcommon" - description="atlantis distribution for Java WebStart"> - - <!-- copy webstart .jnlp files --> - <copy file="${share.src}/atlantis.jnlp" todir="${targetDir}"> - <filterset> - <filter token="CODEBASE" value="${codebase}"/> - </filterset> - </copy> - - </target> - - - <!-- webstart - MINERVA version --> - <target name="webstart-minerva" depends="compile" - description="Atlantis MINERVA distribution for Java WebStart"> - - <!-- copy webstart .jnlp files --> - <copy file="${share.src}/MINERVA.jnlp" todir="${targetDir}"> - <filterset> - <filter token="CODEBASE" value="${codebase}"/> - </filterset> - </copy> - - </target> - - - <target name="webstart-config"> - <!-- copy webstart .jnlp files --> - <copy file="${share.src}/specificconfig.jnlp" tofile="${targetDir}/${config}.jnlp"> - <filterset> - <filter token="CODEBASE" value="${codebase}"/> - <filter token="HREF" value="${config}.jnlp"/> - <filter token="CONFIG" value="config-${config}.xml"/> - </filterset> - </copy> - </target> - - - <!-- webstart including basic atlantis.jnlp and "specific system configurations" --> - <target name="webstart-all" depends="webstart,webstart-specificconfigs,webstart-minerva" - description="Atlantis for Java Webstart including basic atlantis.jnlp and specific system configurations"/> - - - <target name="webstart-specificconfigs"> - <foreach param="config" list="${configs}" target="webstart-config"/> - </target> - - - <!-- webstartjarsigner target - - - - - - - - - - - - - - - - - - - --> - <target name="webstartjarsigner" description="Sign all jar files"> - <delete file="${targetDir}/keystore"/> - <exec executable="${java.home}/bin/keytool"> - <arg line="-genkey -dname 'cn=Atlantis team' -alias Atlantis - -keypass ${password} -keystore ${targetDir}/keystore - -storepass ${password} -validity 180"/> - </exec> - <signjar alias="Atlantis" - keystore="${targetDir}/keystore" - keypass="${password}" - storepass="${password}"> - - <fileset file="${lib.run}/*.jar" /> - <fileset file="${help.run}/*.jar"/> - <fileset file="${atlantis.jar}"/> - </signjar> - <delete file="${targetDir}/keystore"/> - </target> - - - - <!-- updateconfigurations target - - - - - - - - - - - - - - - - - - --> - <!-- update special configurations - jython script performs update of - all special / customised configurations shipped with atlantis and then - runs Atlantis with each configuration file --> - <target name="updateconfigs" depends="jar" - description="Update / synchronise customised configuration files"> - <echo>Requires jython available in PATH, otherwise fails.</echo> - - <!-- arg to exec - arguments to specify atlantis distribution direct. - and where the configuration files for updating are located --> - <!-- exec for unix, mac --> - <exec executable="jython" osfamily="unix" failonerror="true"> - <arg line="share/configupdater.py --atlantis ${targetDir} - --update ${conf.src}"/> - </exec> - <!-- exec for windows --> - <exec executable="cmd" osfamily="windows" failonerror="true"> - <arg value="/c"/> - <arg value="jython.bat"/> - <arg value="share\configupdater.py"/> - <arg value="--atlantis"/> - <arg line="${targetDir}"/> - <arg line="--update"/> - <arg line="${conf.src}"/> - </exec> - - <echo>Deleting build directory ${targetDir}, calling delete ...</echo> - <delete dir="${targetDir}"/> - </target> - - <!-- javadoc target - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="javadoc" description="Make Javadoc documentation"> - <mkdir dir="${targetDir}" /> - - <javadoc packagenames="atlantis.*" - sourcepath="${src.src}" - destdir="${targetDir}" - overview="${src.src}/overview.html" - doctitle="Atlantis event display for ATLAS" - > - <classpath> - <fileset dir="${lib.src}"> - <include name="**/*.jar"/> - </fileset> - </classpath> - </javadoc> - </target> - - <!-- clean target - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="clean" description="Erase *.class generated files"> - <delete dir="${class.run}"/> - </target> - - <target name="test" depends="unit-tests,gui-tests" description="Run all tests"> - <!-- If testcase is set, specified test is run here. --> - <junit printsummary="yes" haltonerror="no" haltonfailure="no" failureProperty="test.failed" errorProperty="test.failed" - fork="yes" timeout="${test.timeout}"> - <sysproperty key="atlantis.test.events" file="${test.events}"/> - <formatter type="xml"/> - <test name="${testcase}" toDir="${report.test}" if="testcase"/> - <classpath refid="classpath.test"/> - </junit> - - <mkdir dir="${report.test}/html"/> - <junitreport todir="${report.test}"> - <fileset dir="${report.test}"> - <include name="TEST-*.xml"/> - </fileset> - <report todir="${report.test}/html"/> - </junitreport> - - <fail message="Failed JUnit test(s)" if="test.failed"/> - </target> - - <!-- Has to continue on failure or error so report target can run. --> - <!-- Not sure why need haltonerror="no" even if failures occur but no errors --> - <target name="unit-tests" depends="compile-tests,jar" description="Run unit tests"> - <mkdir dir="${report.test}"/> - <junit printsummary="yes" haltonerror="no" haltonfailure="no" failureProperty="test.failed" errorProperty="test.failed" - fork="yes" timeout="${test.timeout}"> - <sysproperty key="atlantis.test.events" file="${test.events}"/> - <formatter type="xml"/> - <!-- If testcase is set, specified test will be run in "test" target. Otherwise run all of them. --> - <batchtest toDir="${report.test}" unless="testcase"> - <fileset dir="${test.run}" includes="atlantis/**/*Test.class"/> - </batchtest> - <classpath refid="classpath.test"/> - </junit> - </target> - - <!-- Has to continue on failure or error so report target can run. --> - <!-- Not sure why need haltonerror="no" even if failures occur but no errors --> - <target name="gui-tests" depends="compile-tests,jar" description="Run GUI tests"> - <mkdir dir="${report.test}"/> - <junit printsummary="yes" haltonerror="no" haltonfailure="no" failureProperty="test.failed" errorProperty="test.failed" - fork="yes" timeout="${test.timeout}"> - <sysproperty key="atlantis.test.events" file="${test.events}"/> - <formatter type="xml"/> - <!-- If testcase is set, specified test will be run in "test" target. Otherwise run all of them. --> - <batchtest toDir="${report.test}" unless="testcase"> - <fileset dir="${test.run}" includes="guitest/**/*Test.class"> - </fileset> - </batchtest> - <classpath refid="classpath.test"/> - </junit> - </target> - - <!-- compile-tests target: compile JUnit tests --> - <target name="compile-tests" depends="compile" - description="Compiles source files for all tests"> - <mkdir dir="${lib.run}/test"/> - <copy todir="${lib.run}/test"> - <fileset dir="${lib.src}/test"> - <include name="*.jar"/> - </fileset> - </copy> - <mkdir dir="${test.run}"/> - <javac includeAntRuntime="false" srcdir="${test.src}" destdir="${test.run}" deprecation="on" verbose="no"> - <include name="**/*.java"/> - <classpath> - <fileset dir="${lib.run}"> - <include name="**/*.jar"/> - </fileset> - <fileset dir="${lib.test}"> - <include name="**/*.jar"/> - </fileset> - <pathelement path="${class.run}"/> - </classpath> - </javac> - <path id="classpath.test"> - <fileset dir="${lib.run}"> - <include name="**/*.jar"/> - </fileset> - <fileset dir="${lib.test}"> - <include name="**/*.jar"/> - </fileset> - <pathelement path="${targetDir}/atlantis.jar"/> - <pathelement path="${test.run}"/> - </path> - </target> - - <!-- usage target - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="usage" description="Prints usage hint"> - <echo level="info" message="Usage:"/> - <echo>targetDir - directory to build atlantis distribution in</echo> - <echo>ant -DtargetDir=[target directory] [all|jar|javadoc|test|report|updateconfigs]</echo> - <echo>and -DtargetDir=[target directory] -Dtestcase=[test-case class] test</echo> - <echo>ant -DtargetDir=[target directory] [-Dcodebase="Webstart codebase URL"] [webstart|webstart-specificconfigs|webstart-all]</echo> - </target> - - <!-- help target - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="help" depends="usage" description="Prints usage hint"/> - -</project> diff --git a/graphics/AtlantisJava/configuration/PSProlog.txt b/graphics/AtlantisJava/configuration/PSProlog.txt deleted file mode 100755 index ca7483a2aebbe15106ede1fbfb41dd836f8063bb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/configuration/PSProlog.txt +++ /dev/null @@ -1,156 +0,0 @@ -100 dict dup begin - -% Author: Charles Loomis - -% Redefinitions which save some space in the output file. These are also -% the same as the PDF operators. -/q {gsave} def -/Q {grestore} def - -/n {newpath} def -/m {moveto} def -/l {lineto} def -/c {curveto} def -/h {closepath} def - -/re {4 -2 roll moveto - dup 0 exch rlineto exch 0 rlineto - neg 0 exch rlineto closepath} def - -/f {fill} def -/f* {eofill} def -/F {gsave vg&FC fill grestore} def -/F* {gsave vg&FC eofill grestore} def - -/s {closepath stroke} def -/S {stroke} def - -/b {closepath gsave vg&FC fill grestore - gsave stroke grestore newpath} def -/B {gsave vg&FC fill grestore gsave stroke grestore newpath} def -/b* {closepath gsave vg&FC eofill grestore - gsave stroke grestore newpath} def -/B* {gsave vg&FC eofill grestore gsave stroke grestore newpath} def - -/g {1 array astore /vg&fcolor exch def} def -/G {setgray} def -/k {4 array astore /vg&fcolor exch def} def -/K {setcmykcolor} def -/rg {3 array astore /vg&fcolor exch def} def -/RG {setrgbcolor} def - -% Initialize the fill color. -0 0 0 rg - -/vg&FC {mark vg&fcolor aload pop - counttomark 1 eq {G} if - counttomark 3 eq {RG} if - counttomark 4 eq {K} if - cleartomark } def - -/vg&DFC {/vg&fcolor exch def} def - -/vg&C {mark exch aload pop - counttomark 1 eq {G} if - counttomark 3 eq {RG} if - counttomark 4 eq {K} if - cleartomark } def - -/w {setlinewidth} def -/j {setlinejoin} def -/J {setlinecap} def -/M {setmiterlimit} def -/d {setdash} def -/i {setflat} def - -/W {clip} def -/W* {eoclip} def - -% Setup the default graphics state. -% (black; 1 pt. linewidth; miter join; butt-ends; solid) -/defaultGraphicsState {0 g 1 w 0 j 0 J [] 0 d} def - -% Emulation of the rectangle operators for PostScript implementations -% which do not implement all Level 2 features. This is an INCOMPLETE -% emulation; only the "x y width height rect..." form is emulated. -/*rf {gsave newpath re fill grestore} def -/*rs {gsave newpath re stroke grestore} def -/*rc {newpath re clip} def -/rf /rectfill where {pop /rectfill}{/*rf} ifelse load def -/rs /rectstroke where {pop /rectstroke}{/*rs} ifelse load def -/rc /rectclip where {pop /rectclip}{/*rc} ifelse load def - -% Emulation of the selectfont operator. This includes a 20% increase in -% the fontsize which is necessary to get sizes similar to the Java fonts. -/*sf {exch findfont exch - dup type /arraytype eq {makefont}{scalefont} ifelse setfont} bind def -/sf /selectfont where {pop {1.2 mul selectfont}}{{1.2 mul *sf}} ifelse def - -% Initialize variables for safety. -/delta 0 def -/xv 0 def /yv 0 def /width 0 def /height 0 def - -% Initialize to portrait A4 page. -/pw 595 def /ph 842 def /po true def /ftp false def - -% Initialize margins to 20 points. -/ml 20 def /mr 20 def /mt 20 def /mb 20 def - -% set page size (usage: <page width><page height> setpagesize) -/setpagesize {/ph exch def /pw exch def} def - -% set page orientation (usage: portrait or landscape) -/portrait {/po true def} def -/landscape {/po false def} def - -% force natural size for image (usage: naturalsize) -/naturalsize {/ftp false def} def - -% resize image to fill page (usage: fittopage) -/fittopage {/ftp true def} def - -% set margins of the page (usage: <left><bottom><top><right> setmargins) -/setmargins {/mr exch def /mt exch def /mb exch def /ml exch def} def - -% set the graphic's size (usage: <width><height> setsize) -/setsize {/gh exch def /gw exch def} def - -% set the graphic's origin (usage: <x0><y0> setorigin) -/setorigin {/gy exch def /gx exch def} def - -% calculate image center -/imagecenter {pw ml sub mr sub 2 div ml add - ph mt sub mb sub 2 div mb add} def - -% calculate the necessary scaling -/imagescale {po {gw}{gh} ifelse pw ml sub mr sub div - po {gh}{gw} ifelse ph mt sub mb sub div - 2 copy lt {exch} if pop - ftp not {1 2 copy lt {exch} if pop} if - 1 exch div /sfactor exch def - /gw gw sfactor mul def /gh gh sfactor mul def} def - -% calculate image origin -/imageorigin {pw ml sub mr sub 2 div ml add - po {gw}{gh} ifelse 2 div sub - ph mt sub mb sub 2 div mb add - po {gh}{gw} ifelse 2 div po {add}{sub} ifelse} def - -% calculate the clipping origin -/cliporigin {pw ml sub mr sub 2 div ml add - po {gw}{gh} ifelse 2 div sub floor - ph mt sub mb sub 2 div mb add - po {gh}{gw} ifelse 2 div sub floor} def - -% Set the clipping region to the bounding box. -/cliptobounds {cliporigin po {gw}{gh} ifelse 1 add - po {gh}{gw} ifelse 1 add rc} def - -% set the base transformation matrix (usage: setbasematrix) -/setbasematrix {imageorigin translate - po {0}{90} ifelse rotate - sfactor sfactor neg scale - /defaultmatrix matrix currentmatrix def} def - - - diff --git a/graphics/AtlantisJava/configuration/colormap.xml b/graphics/AtlantisJava/configuration/colormap.xml deleted file mode 100755 index 1160b07c23b933c56677f2b0e0d4ce4a67feef06..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/configuration/colormap.xml +++ /dev/null @@ -1,369 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE colormap [ - <!ELEMENT colormap (Mapping*)> - <!ATTLIST colormap - numMaps CDATA #REQUIRED - numColors CDATA #REQUIRED> - <!ELEMENT Mapping EMPTY> - <!ATTLIST Mapping - map CDATA #REQUIRED - index CDATA #REQUIRED - r CDATA #REQUIRED - g CDATA #REQUIRED - b CDATA #REQUIRED> -]> - -<colormap numMaps="9" numColors="29" > -<!-- map 0 - Default(1) --> - <!-- white --> - <Mapping map="0" index="0" r="176" g="176" b="176"/> - <!-- geometry --> - <Mapping map="0" index="1" r="58" g="58" b="58"/> - <Mapping map="0" index="2" r="32" g="32" b="32"/> - <Mapping map="0" index="3" r="205" g="92" b="92"/> - <Mapping map="0" index="4" r="55" g="101" b="140"/> - <Mapping map="0" index="5" r="130" g="200" b="130"/> - <Mapping map="0" index="6" r="70" g="130" b="180"/> - <Mapping map="0" index="7" r="200" g="200" b="200"/> - <!-- background --> - <Mapping map="0" index="8" r="255" g="255" b="255"/> - <!-- frames --> - <Mapping map="0" index="9" r="189" g="34" b="50"/> - <Mapping map="0" index="10" r="180" g="180" b="81"/> - <Mapping map="0" index="11" r="33" g="182" b="92"/> - <Mapping map="0" index="12" r="89" g="206" b="223"/> - <Mapping map="0" index="13" r="140" g="40" b="140"/> - <!-- grey --> - <Mapping map="0" index="14" r="153" g="153" b="153"/> - <!-- cells --> - <Mapping map="0" index="15" r="125" g="0" b="0"/> - <Mapping map="0" index="16" r="255" g="255" b="128"/> - <Mapping map="0" index="17" r="0" g="125" b="0"/> - <Mapping map="0" index="18" r="181" g="229" b="251"/> - <Mapping map="0" index="19" r="255" g="128" b="255"/> - <!-- red --> - <Mapping map="0" index="20" r="255" g="0" b="0"/> - <!-- green --> - <Mapping map="0" index="21" r="0" g="255" b="0"/> - <!-- blue --> - <Mapping map="0" index="22" r="0" g="0" b="255"/> - <!-- yellow --> - <Mapping map="0" index="23" r="255" g="255" b="0"/> - <!-- magenta --> - <Mapping map="0" index="24" r="255" g="0" b="255"/> - <!-- cyan --> - <Mapping map="0" index="25" r="0" g="255" b="255"/> - <!-- black --> - <Mapping map="0" index="26" r="0" g="0" b="0"/> - <!-- orange --> - <Mapping map="0" index="27" r="255" g="115" b="0"/> - <!-- cornflower blue --> - <Mapping map="0" index="28" r="135" g="206" b="250"/> -<!-- map 1 - Default(2) --> - <!-- white --> - <Mapping map="1" index="0" r="176" g="176" b="176"/> - <!-- geometry --> - <Mapping map="1" index="1" r="58" g="58" b="58"/> - <Mapping map="1" index="2" r="32" g="32" b="32"/> - <Mapping map="1" index="3" r="254" g="102" b="0"/> - <Mapping map="1" index="4" r="0" g="24" b="71"/> - <Mapping map="1" index="5" r="130" g="200" b="130"/> - <Mapping map="1" index="6" r="0" g="51" b="153"/> - <Mapping map="1" index="7" r="200" g="200" b="200"/> - <!-- background --> - <Mapping map="1" index="8" r="255" g="255" b="255"/> - <!-- frames --> - <Mapping map="1" index="9" r="189" g="34" b="50"/> - <Mapping map="1" index="10" r="180" g="180" b="81"/> - <Mapping map="1" index="11" r="33" g="182" b="92"/> - <Mapping map="1" index="12" r="89" g="206" b="223"/> - <Mapping map="1" index="13" r="140" g="40" b="140"/> - <!-- grey --> - <Mapping map="1" index="14" r="153" g="153" b="153"/> - <!-- cells --> - <Mapping map="1" index="15" r="185" g="0" b="0"/> - <Mapping map="1" index="16" r="255" g="255" b="128"/> - <Mapping map="1" index="17" r="0" g="125" b="0"/> - <Mapping map="1" index="18" r="181" g="229" b="251"/> - <Mapping map="1" index="19" r="255" g="128" b="255"/> - <!-- red --> - <Mapping map="1" index="20" r="255" g="0" b="0"/> - <!-- green --> - <Mapping map="1" index="21" r="0" g="255" b="0"/> - <!-- blue --> - <Mapping map="1" index="22" r="0" g="0" b="255"/> - <!-- yellow --> - <Mapping map="1" index="23" r="255" g="255" b="0"/> - <!-- magenta --> - <Mapping map="1" index="24" r="255" g="0" b="255"/> - <!-- cyan --> - <Mapping map="1" index="25" r="0" g="255" b="255"/> - <!-- black --> - <Mapping map="1" index="26" r="0" g="0" b="0"/> - <!-- orange --> - <Mapping map="1" index="27" r="255" g="170" b="0"/> - <!-- cornflower blue --> - <Mapping map="1" index="28" r="0" g="102" b="255"/> -<!-- map 2 - Default(M4+M5) --> - <!-- white --> - <Mapping map="2" index="0" r="255" g="255" b="255"/> - <!-- geometry --> - <Mapping map="2" index="1" r="40" g="0" b="0"/> - <Mapping map="2" index="2" r="0" g="35" b="0"/> - <Mapping map="2" index="3" r="132" g="39" b="32"/> - <Mapping map="2" index="4" r="138" g="138" b="68"/> - <Mapping map="2" index="5" r="98" g="134" b="122"/> - <Mapping map="2" index="6" r="78" g="139" b="170"/> - <Mapping map="2" index="7" r="97" g="65" b="97"/> - <!-- background --> - <Mapping map="2" index="8" r="44" g="47" b="50"/> - <!-- frames --> - <Mapping map="2" index="9" r="189" g="34" b="50"/> - <Mapping map="2" index="10" r="180" g="180" b="81"/> - <Mapping map="2" index="11" r="33" g="182" b="92"/> - <Mapping map="2" index="12" r="89" g="206" b="223"/> - <Mapping map="2" index="13" r="140" g="40" b="140"/> - <!-- grey --> - <Mapping map="2" index="14" r="153" g="153" b="153"/> - <!-- cells --> - <Mapping map="2" index="15" r="245" g="135" b="138"/> - <Mapping map="2" index="16" r="255" g="255" b="128"/> - <Mapping map="2" index="17" r="123" g="212" b="194"/> - <Mapping map="2" index="18" r="181" g="229" b="251"/> - <Mapping map="2" index="19" r="255" g="128" b="255"/> - <!-- red --> - <Mapping map="2" index="20" r="255" g="0" b="0"/> - <!-- green --> - <Mapping map="2" index="21" r="0" g="255" b="0"/> - <!-- blue --> - <Mapping map="2" index="22" r="0" g="0" b="255"/> - <!-- yellow --> - <Mapping map="2" index="23" r="255" g="255" b="0"/> - <!-- magenta --> - <Mapping map="2" index="24" r="255" g="0" b="255"/> - <!-- cyan --> - <Mapping map="2" index="25" r="0" g="255" b="255"/> - <!-- black --> - <Mapping map="2" index="26" r="0" g="0" b="0"/> - <!-- orange --> - <Mapping map="2" index="27" r="255" g="115" b="0"/> - <!-- cornflower blue --> - <Mapping map="2" index="28" r="102" g="128" b="255"/> -<!-- map 3 - Gray detector --> - <!-- white --> - <Mapping map="3" index="0" r="255" g="255" b="255"/> - <!-- geometry --> - <Mapping map="3" index="1" r="0" g="0" b="0"/> - <Mapping map="3" index="2" r="0" g="0" b="0"/> - <Mapping map="3" index="3" r="32" g="32" b="32"/> - <Mapping map="3" index="4" r="80" g="80" b="80"/> - <Mapping map="3" index="5" r="16" g="16" b="16"/> - <Mapping map="3" index="6" r="48" g="48" b="48"/> - <Mapping map="3" index="7" r="64" g="64" b="64"/> - <!-- background --> - <Mapping map="3" index="8" r="112" g="112" b="112"/> - <!-- frames --> - <Mapping map="3" index="9" r="189" g="34" b="50"/> - <Mapping map="3" index="10" r="180" g="180" b="81"/> - <Mapping map="3" index="11" r="33" g="182" b="92"/> - <Mapping map="3" index="12" r="89" g="206" b="223"/> - <Mapping map="3" index="13" r="140" g="40" b="140"/> - <!-- grey --> - <Mapping map="3" index="14" r="153" g="153" b="153"/> - <!-- cells --> - <Mapping map="3" index="15" r="245" g="135" b="138"/> - <Mapping map="3" index="16" r="255" g="255" b="128"/> - <Mapping map="3" index="17" r="123" g="212" b="194"/> - <Mapping map="3" index="18" r="181" g="229" b="251"/> - <Mapping map="3" index="19" r="255" g="128" b="255"/> - <!-- red --> - <Mapping map="3" index="20" r="255" g="0" b="0"/> - <!-- green --> - <Mapping map="3" index="21" r="0" g="255" b="0"/> - <!-- blue --> - <Mapping map="3" index="22" r="0" g="0" b="255"/> - <!-- yellow --> - <Mapping map="3" index="23" r="255" g="255" b="0"/> - <!-- magenta --> - <Mapping map="3" index="24" r="255" g="0" b="255"/> - <!-- cyan --> - <Mapping map="3" index="25" r="0" g="255" b="255"/> - <!-- black --> - <Mapping map="3" index="26" r="0" g="0" b="0"/> - <!-- orange --> - <Mapping map="3" index="27" r="255" g="115" b="0"/> - <!-- cornflower blue --> - <Mapping map="3" index="28" r="102" g="128" b="255"/> -<!-- map 4 - Original --> - <!-- white --> - <Mapping map="4" index="0" r="255" g="255" b="255"/> - <!-- geometry --> - <Mapping map="4" index="1" r="0" g="0" b="0"/> - <Mapping map="4" index="2" r="0" g="0" b="0"/> - <Mapping map="4" index="3" r="255" g="0" b="0"/> - <Mapping map="4" index="4" r="0" g="0" b="255"/> - <Mapping map="4" index="5" r="0" g="255" b="0"/> - <Mapping map="4" index="6" r="0" g="0" b="0"/> - <Mapping map="4" index="7" r="255" g="0" b="255"/> - <!-- background --> - <Mapping map="4" index="8" r="0" g="204" b="255"/> - <!-- frames --> - <Mapping map="4" index="9" r="189" g="34" b="50"/> - <Mapping map="4" index="10" r="180" g="180" b="81"/> - <Mapping map="4" index="11" r="33" g="182" b="92"/> - <Mapping map="4" index="12" r="89" g="206" b="223"/> - <Mapping map="4" index="13" r="140" g="40" b="140"/> - <!-- grey --> - <Mapping map="4" index="14" r="153" g="153" b="153"/> - <!-- cells --> - <Mapping map="4" index="15" r="245" g="135" b="138"/> - <Mapping map="4" index="16" r="255" g="255" b="128"/> - <Mapping map="4" index="17" r="123" g="212" b="194"/> - <Mapping map="4" index="18" r="181" g="229" b="251"/> - <Mapping map="4" index="19" r="255" g="128" b="255"/> - <!-- red --> - <Mapping map="4" index="20" r="255" g="0" b="0"/> - <!-- green --> - <Mapping map="4" index="21" r="0" g="255" b="0"/> - <!-- blue --> - <Mapping map="4" index="22" r="0" g="0" b="255"/> - <!-- yellow --> - <Mapping map="4" index="23" r="255" g="255" b="0"/> - <!-- magenta --> - <Mapping map="4" index="24" r="255" g="0" b="255"/> - <!-- cyan --> - <Mapping map="4" index="25" r="0" g="255" b="255"/> - <!-- black --> - <Mapping map="4" index="26" r="0" g="0" b="0"/> - <!-- orange --> - <Mapping map="4" index="27" r="255" g="115" b="0"/> - <!-- cornflower blue --> - <Mapping map="4" index="28" r="102" g="128" b="255"/> -<!-- map 5 - Grey --> - <!-- white --> - <Mapping map="5" index="0" r="255" g="255" b="255"/> - <Mapping map="5" index="1" r="255" g="255" b="255"/> - <Mapping map="5" index="2" r="255" g="255" b="255"/> - <Mapping map="5" index="3" r="255" g="255" b="255"/> - <Mapping map="5" index="4" r="255" g="255" b="255"/> - <Mapping map="5" index="5" r="255" g="255" b="255"/> - <Mapping map="5" index="6" r="255" g="255" b="255"/> - <Mapping map="5" index="7" r="255" g="255" b="255"/> - <!-- grey --> - <Mapping map="5" index="8" r="204" g="204" b="204"/> - <!-- black --> - <Mapping map="5" index="9" r="0" g="0" b="0"/> - <Mapping map="5" index="10" r="0" g="0" b="0"/> - <Mapping map="5" index="11" r="0" g="0" b="0"/> - <Mapping map="5" index="12" r="0" g="0" b="0"/> - <Mapping map="5" index="13" r="0" g="0" b="0"/> - <Mapping map="5" index="14" r="0" g="0" b="0"/> - <Mapping map="5" index="15" r="0" g="0" b="0"/> - <Mapping map="5" index="16" r="0" g="0" b="0"/> - <Mapping map="5" index="17" r="0" g="0" b="0"/> - <Mapping map="5" index="18" r="0" g="0" b="0"/> - <Mapping map="5" index="19" r="0" g="0" b="0"/> - <Mapping map="5" index="20" r="0" g="0" b="0"/> - <Mapping map="5" index="21" r="0" g="0" b="0"/> - <Mapping map="5" index="22" r="0" g="0" b="0"/> - <Mapping map="5" index="23" r="0" g="0" b="0"/> - <Mapping map="5" index="24" r="0" g="0" b="0"/> - <Mapping map="5" index="25" r="0" g="0" b="0"/> - <Mapping map="5" index="26" r="0" g="0" b="0"/> - <Mapping map="5" index="27" r="0" g="0" b="0"/> - <Mapping map="5" index="28" r="0" g="0" b="0"/> -<!-- map 6 - BW --> - <!-- white --> - <Mapping map="6" index="0" r="255" g="255" b="255"/> - <Mapping map="6" index="1" r="255" g="255" b="255"/> - <Mapping map="6" index="2" r="255" g="255" b="255"/> - <Mapping map="6" index="3" r="255" g="255" b="255"/> - <Mapping map="6" index="4" r="255" g="255" b="255"/> - <Mapping map="6" index="5" r="255" g="255" b="255"/> - <Mapping map="6" index="6" r="255" g="255" b="255"/> - <Mapping map="6" index="7" r="255" g="255" b="255"/> - <Mapping map="6" index="8" r="255" g="255" b="255"/> - <!-- black --> - <Mapping map="6" index="9" r="0" g="0" b="0"/> - <Mapping map="6" index="10" r="0" g="0" b="0"/> - <Mapping map="6" index="11" r="0" g="0" b="0"/> - <Mapping map="6" index="12" r="0" g="0" b="0"/> - <Mapping map="6" index="13" r="0" g="0" b="0"/> - <Mapping map="6" index="14" r="0" g="0" b="0"/> - <Mapping map="6" index="15" r="0" g="0" b="0"/> - <Mapping map="6" index="16" r="0" g="0" b="0"/> - <Mapping map="6" index="17" r="0" g="0" b="0"/> - <Mapping map="6" index="18" r="0" g="0" b="0"/> - <Mapping map="6" index="19" r="0" g="0" b="0"/> - <Mapping map="6" index="20" r="0" g="0" b="0"/> - <Mapping map="6" index="21" r="0" g="0" b="0"/> - <Mapping map="6" index="22" r="0" g="0" b="0"/> - <Mapping map="6" index="23" r="0" g="0" b="0"/> - <Mapping map="6" index="24" r="0" g="0" b="0"/> - <Mapping map="6" index="25" r="0" g="0" b="0"/> - <Mapping map="6" index="26" r="0" g="0" b="0"/> - <Mapping map="6" index="27" r="0" g="0" b="0"/> - <Mapping map="6" index="28" r="0" g="0" b="0"/> -<!-- map 7 - HITCOL --> - <Mapping map="7" index="0" r="0" g="0" b="85"/> - <Mapping map="7" index="1" r="0" g="0" b="255"/> - <Mapping map="7" index="2" r="85" g="85" b="170"/> - <Mapping map="7" index="3" r="0" g="170" b="255"/> - <Mapping map="7" index="4" r="0" g="255" b="255"/> - <Mapping map="7" index="5" r="0" g="85" b="85"/> - <Mapping map="7" index="6" r="0" g="85" b="0"/> - <Mapping map="7" index="7" r="0" g="170" b="0"/> - <Mapping map="7" index="8" r="0" g="255" b="0"/> - <Mapping map="7" index="9" r="170" g="255" b="0"/> - <Mapping map="7" index="10" r="255" g="255" b="0"/> - <Mapping map="7" index="11" r="255" g="170" b="0"/> - <Mapping map="7" index="12" r="170" g="85" b="0"/> - <Mapping map="7" index="13" r="255" g="85" b="85"/> - <Mapping map="7" index="14" r="255" g="0" b="0"/> - <Mapping map="7" index="15" r="170" g="0" b="0"/> - <Mapping map="7" index="16" r="85" g="0" b="0"/> - <!-- not used --> - <Mapping map="7" index="17" r="0" g="0" b="0"/> - <Mapping map="7" index="18" r="0" g="0" b="0"/> - <Mapping map="7" index="19" r="0" g="0" b="0"/> - <Mapping map="7" index="20" r="0" g="0" b="0"/> - <Mapping map="7" index="21" r="0" g="0" b="0"/> - <Mapping map="7" index="22" r="0" g="0" b="0"/> - <Mapping map="7" index="23" r="0" g="0" b="0"/> - <Mapping map="7" index="24" r="0" g="0" b="0"/> - <Mapping map="7" index="25" r="0" g="0" b="0"/> - <Mapping map="7" index="26" r="0" g="0" b="0"/> - <Mapping map="7" index="27" r="0" g="0" b="0"/> - <Mapping map="7" index="28" r="0" g="0" b="0"/> -<!-- map 8 - GREY HITCOL --> - <Mapping map="8" index="0" r="255" g="255" b="255"/> - <Mapping map="8" index="1" r="240" g="240" b="240"/> - <Mapping map="8" index="2" r="224" g="224" b="224"/> - <Mapping map="8" index="3" r="208" g="208" b="208"/> - <Mapping map="8" index="4" r="192" g="192" b="192"/> - <Mapping map="8" index="5" r="176" g="176" b="176"/> - <Mapping map="8" index="6" r="160" g="160" b="160"/> - <Mapping map="8" index="7" r="144" g="144" b="144"/> - <Mapping map="8" index="8" r="128" g="128" b="128"/> - <Mapping map="8" index="9" r="112" g="112" b="112"/> - <Mapping map="8" index="10" r="96" g="96" b="96"/> - <Mapping map="8" index="11" r="80" g="80" b="80"/> - <Mapping map="8" index="12" r="64" g="64" b="64"/> - <Mapping map="8" index="13" r="48" g="48" b="48"/> - <Mapping map="8" index="14" r="32" g="32" b="32"/> - <Mapping map="8" index="15" r="16" g="16" b="16"/> - <!-- not used --> - <Mapping map="8" index="16" r="0" g="0" b="0"/> - <Mapping map="8" index="17" r="0" g="0" b="0"/> - <Mapping map="8" index="18" r="0" g="0" b="0"/> - <Mapping map="8" index="19" r="0" g="0" b="0"/> - <Mapping map="8" index="20" r="0" g="0" b="0"/> - <Mapping map="8" index="21" r="0" g="0" b="0"/> - <Mapping map="8" index="22" r="0" g="0" b="0"/> - <Mapping map="8" index="23" r="0" g="0" b="0"/> - <Mapping map="8" index="24" r="0" g="0" b="0"/> - <Mapping map="8" index="25" r="0" g="0" b="0"/> - <Mapping map="8" index="26" r="0" g="0" b="0"/> - <Mapping map="8" index="27" r="0" g="0" b="0"/> - <Mapping map="8" index="28" r="0" g="0" b="0"/> -</colormap> diff --git a/graphics/AtlantisJava/configuration/config.dtd b/graphics/AtlantisJava/configuration/config.dtd deleted file mode 100644 index 189f117e0911fd8e93e72c9852be466b9f5df8d4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/configuration/config.dtd +++ /dev/null @@ -1,169 +0,0 @@ -<!ELEMENT AtlantisConfiguration (Initialization, Parameters,ParameterDifferences*, WindowCorners*)> - -<!ELEMENT Initialization (Interactions, Canvas)> - -<!ELEMENT Interactions (Panel*, InteractionControl+)> - -<!ELEMENT InteractionControl (Panel*)> - <!ATTLIST InteractionControl - projectionName CDATA #REQUIRED - availableInDemoMode CDATA "YES" - defaultInDemoMode CDATA "NO" > - -<!ELEMENT Panel EMPTY> - <!ATTLIST Panel - screenName CDATA #REQUIRED - fileName CDATA #REQUIRED - toolTip CDATA ""> - -<!ELEMENT Canvas (UsedWindow+, Layout+)> - <!ATTLIST Canvas - startupLayout CDATA #REQUIRED - aspectRatio CDATA #REQUIRED> - -<!ELEMENT UsedWindow EMPTY> - <!ATTLIST UsedWindow - name CDATA #REQUIRED - projection CDATA "EP" - group CDATA "Data"> - -<!ELEMENT Layout (Window+, Page+)> - <!ATTLIST Layout - name CDATA #REQUIRED - startup CDATA #REQUIRED - startupWindow CDATA #REQUIRED> - -<!ELEMENT Window EMPTY> - <!ATTLIST Window - name CDATA #REQUIRED - hPos CDATA #REQUIRED - vPos CDATA #REQUIRED - width CDATA #REQUIRED - height CDATA #REQUIRED> - -<!ELEMENT Page EMPTY> - <!ATTLIST Page - name CDATA #REQUIRED - content CDATA #REQUIRED> - -<!ELEMENT Parameters (SuperGroup*)> - <!ATTLIST Parameters - userLevel CDATA #REQUIRED> - -<!ELEMENT SuperGroup (Group*)> - <!ATTLIST SuperGroup - name CDATA #REQUIRED - toolTip CDATA "" - userLevel CDATA "0"> - -<!ELEMENT Group (Command*,((ENUM)*, (SENUM)*, (ICUT)*, (SICUT)*, (FCUT)*, (SFCUT)*, (INT)*, (SINT)*,(LINT)*, (SLINT)*, (FLOAT)*, (SFLOAT)*, (COLOR)*, (SCOLOR)*, (StatusRoot)*, (STATUS)*, (LINK)*)* )> - <!ATTLIST Group - name CDATA #REQUIRED - sname CDATA "" - guiUsage (NO_USE|TABLE|PROJECTION|BRAIN_TEST) "NO_USE" - scope (LOCAL|GLOBAL) "GLOBAL" - userLevel CDATA "0" - toolTip CDATA ""> - -<!ELEMENT Command EMPTY> - <!ATTLIST Command - name CDATA #REQUIRED - command CDATA #REQUIRED - ul CDATA "0" - toolTip CDATA ""> - -<!ENTITY none "0"> - -<!ELEMENT ENUM EMPTY> <!ATTLIST ENUM fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" tip CDATA "" ul CDATA "0" scope CDATA ""> -<!ELEMENT SENUM EMPTY> <!ATTLIST SENUM fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" st (ON|OFF) #REQUIRED tip CDATA "" ul CDATA "0" scope CDATA ""> -<!ELEMENT ICUT EMPTY> <!ATTLIST ICUT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" isMod (YES|NO) "NO" op CDATA #REQUIRED dop CDATA "" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT SICUT EMPTY> <!ATTLIST SICUT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" st (ON|OFF) #REQUIRED isMod (YES|NO) "NO" op CDATA #REQUIRED dop CDATA "" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT FCUT EMPTY> <!ATTLIST FCUT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" isMod (YES|NO) "NO" op CDATA #REQUIRED dop CDATA "" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT SFCUT EMPTY> <!ATTLIST SFCUT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" st (ON|OFF) #REQUIRED isMod (YES|NO) "NO" op CDATA #REQUIRED dop CDATA "" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT INT EMPTY> <!ATTLIST INT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" isMod (YES|NO) "NO" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT SINT EMPTY> <!ATTLIST SINT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" st (ON|OFF) #REQUIRED isMod (YES|NO) "NO" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT FLOAT EMPTY> <!ATTLIST FLOAT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" isMod (YES|NO) "NO" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT SFLOAT EMPTY> <!ATTLIST SFLOAT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" st (ON|OFF) #REQUIRED isMod (YES|NO) "NO" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT LINT EMPTY> <!ATTLIST LINT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT SLINT EMPTY> <!ATTLIST SLINT fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" st (ON|OFF) #REQUIRED tip CDATA "" ul CDATA "0" scope CDATA "" u CDATA "&none;"> -<!ELEMENT COLOR EMPTY> <!ATTLIST COLOR fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" tip CDATA "" ul CDATA "0" scope CDATA ""> -<!ELEMENT SCOLOR EMPTY> <!ATTLIST SCOLOR fn CDATA #REQUIRED sn CDATA "" va CDATA #REQUIRED pv CDATA "-inf : inf" st (ON|OFF) #REQUIRED tip CDATA "" ul CDATA "0" scope CDATA ""> -<!ELEMENT StatusRoot (StatusGroup*, STATUS*)> <!ATTLIST StatusRoot fn CDATA #REQUIRED sn CDATA "" st (ON|OFF) "OFF" tip CDATA "" ul CDATA "0" scope CDATA ""> -<!ELEMENT StatusGroup (StatusGroup*, STATUS*)> <!ATTLIST StatusGroup fn CDATA #REQUIRED sn CDATA "" st (ON|OFF) "OFF" tip CDATA "" ul CDATA "0" scope CDATA ""> -<!ELEMENT STATUS EMPTY> <!ATTLIST STATUS fn CDATA #REQUIRED sn CDATA "" st (ON|OFF) #REQUIRED tip CDATA "" ul CDATA "0" scope CDATA ""> -<!ELEMENT LINK EMPTY> <!ATTLIST LINK to CDATA #REQUIRED> - -<!ELEMENT ParameterDifferences (DIFFERENCE*)> - -<!ELEMENT DIFFERENCE EMPTY> - <!ATTLIST DIFFERENCE - group CDATA #REQUIRED - name CDATA #REQUIRED - windowName CDATA "*" - va CDATA "" - st CDATA "" - op CDATA ""> - -<!ELEMENT WindowCorners (CORNERS*)> - -<!ELEMENT CORNERS EMPTY> - <!ATTLIST CORNERS - windowName CDATA #REQUIRED - x0 CDATA #REQUIRED - y0 CDATA #REQUIRED - x1 CDATA #REQUIRED - y1 CDATA #REQUIRED - x2 CDATA #REQUIRED - y2 CDATA #REQUIRED> - -<!ENTITY length "1"> -<!ENTITY energy "2"> -<!ENTITY energyMEV "3"> - -<!ENTITY user "0"> -<!ENTITY superuser "1"> -<!ENTITY debug "3"> - -<!ENTITY assocCutOptions "All=0, Connected=1, Unconnected=2"> -<!ENTITY drawTo "Pixels = 0, Silicon Strips = 1, TRT_DriftCircle=2, LAr = 3, TILE = 4, Muon System = 5"> -<!ENTITY colorFn "Constant = 0, Simulated Track = 1, Reconstructed Track = 2, SubDetector = 3, Track Segment = 4"> -<!ENTITY colorFnTRT "Constant = 0, Simulated Track = 1, Reconstructed Track = 2, SubDetector = 3, Track Segment = 4, isOutlier = 5, driftSign = 6, threshold = 7"> -<!ENTITY colorFnMTr "Constant = 0, Index = 1, Pt = 2"> -<!ENTITY colorFnCal "Constant = 0, SubDetector = 1, Cluster = 2, Layer = 3, Energy = 4, Jet = 5, ECAL/HCAL = 6, Time = 7"> -<!ENTITY colorFnS3D "Constant = 0, Simulated Track = 1, Reconstructed Track = 2, SubDetector = 3, Group = 4, Layer = 5"> -<!ENTITY colorFnTrigS3D "Constant = 0, Simulated Track = 1, Reconstructed Track = 2, SubDetector = 3, Layer = 4"> -<!ENTITY colorFnSiCluster "Constant = 0, Simulated Track = 1, Reconstructed Track = 2, SubDetector = 3, Layer = 4, Orientation=5"> -<!ENTITY colorFnPixCluster "Constant = 0, Simulated Track = 1, Reconstructed Track = 2, SubDetector = 3, Layer = 4, Orientation=5, dE/dx=6"> -<!ENTITY colorFnSTr "Constant = 0, Index = 1, Pt = 2, Particle Type = 3, Origin Vertex = 4"> -<!ENTITY colorFnRTr "Constant = 0, Index = 1, Pt = 2, Collection = 3, Simulated Track = 4, RecVertex = 5, Objects = 7"> -<!ENTITY colorFnBasic "Constant = 0, Index = 1"> -<!ENTITY colorFnBasicVtx "Constant = 0, Index = 1 , VertexType = 2"> -<!ENTITY colorFnBasicCollection "Constant = 0, Index = 1, Collection = 2"> -<!ENTITY colorFnBasicCollectionBJets "Constant = 0, Index = 1, Collection = 2, BJets = 3"> - -<!ENTITY energyMode "Sum (Linear) = 0, Max (Linear) = 1, Sum (Logarithmic) = 2, Max (Logarithmic) = 3, Sum (Square Root) = 4, Max (Square Root) = 5"> -<!ENTITY symbol "Filled Square=0,Filled Circle=4,Horizontal Line=1,Vertical Line=2,Plus=3"> -<!ENTITY pickingModes "Event Data=0, Detectors=1"> -<!ENTITY frameCol "0,8:14"> -<!ENTITY detectCol "0:8,14"> -<!ENTITY dataCol "0,8,14:28"> -<!ENTITY histoCol "0,8,14:28"> -<!ENTITY real "<,>"> -<!ENTITY eta "η"> -<!ENTITY rho "ρ"> -<!ENTITY phi "Φ"> -<!ENTITY delta "Δ"> -<!ENTITY lambda "λ"> -<!ENTITY sigma "σ"> -<!ENTITY prime "'"> -<!ENTITY ne "!="> -<!ENTITY le "<="> -<!ENTITY ge ">="> -<!ENTITY int "=,≠,<,≤,>,≥"> -<!ENTITY intEqual "="> -<!ENTITY modesFZ "Standard = 0, RPC Middle 1 = 1, RPC Middle 2 = 2, RPC Outer = 3, MDT Inner and Extension = 4, MDT Middle = 5, MDT Outer = 6"> -<!ENTITY modesYX "Standard = 0, TGC Inner 1 = 1,TGC Middle 1 = 2, TGC Middle 2 = 3, TGC Middle 3 = 4, MDT/CSC Inner 1 = 5, MDT Extension = 6, MDT Middle = 7, MDT Outer = 8, FCAL EM= 9, FCAL HAD 1= 10, FCAL HAD 2= 11, LAr Ecap Presamp= 12, LAr Ecap 1= 13, LAr Ecap 2= 14, LAr Ecap 3= 15, HEC 1= 16, HEC 2= 17, HEC 3= 18, HEC 4= 19, LAr Ecap Summed=20, HEC Summed=21, MBTS=22"> - -<!-- Entities for including blocks of common data --> -<!ENTITY CommonInteractions SYSTEM "common-interactions.xml"> -<!ENTITY CommonParameters SYSTEM "common-parameters.xml"> diff --git a/graphics/AtlantisJava/configuration/epusti.csv b/graphics/AtlantisJava/configuration/epusti.csv deleted file mode 100644 index 0c0b9051835d8c6c1c35fa69c6df0141d3f0a592..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/configuration/epusti.csv +++ /dev/null @@ -1,5 +0,0 @@ -# Event Properties User Selected Trigger Items - -# example: "L1_EM7, L2_e10, EF_e10, L2_g10, EF_g10, L1_J70, EF_tau100" - -"" \ No newline at end of file diff --git a/graphics/AtlantisJava/configuration/pdg.xml b/graphics/AtlantisJava/configuration/pdg.xml deleted file mode 100755 index 20f87414de8996681a5f01779d208cdc48960a0b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/configuration/pdg.xml +++ /dev/null @@ -1,109 +0,0 @@ -<?xml version="1.0"?> - -<!DOCTYPE PDG [ - - <!ELEMENT PDG (Particle*)> - - <!ELEMENT Particle EMPTY> - - <!ATTLIST Particle - charge (-1 | 0 | 1 | 10) #REQUIRED - type CDATA #REQUIRED - code CDATA #REQUIRED - name CDATA #REQUIRED - > - - <!-- - charge = 10 : unknown particle or bug - --> - - <!ENTITY eta "η"> - <!ENTITY rho "ρ"> - <!ENTITY phi "Φ"> - <!ENTITY delta "Δ"> - <!ENTITY pi "π"> - <!ENTITY sigma "Σ"> - <!ENTITY tau "τ"> - <!ENTITY xi "Ξ"> - <!ENTITY omega "Ω"> - <!ENTITY mu "μ"> - <!ENTITY gamma "γ"> - <!ENTITY nu "ν"> - <!ENTITY lambda "Λ"> - <!ENTITY psi "ψ"> - <!ENTITY upsilon "Υ"> - -]> - -<PDG> - - <!-- - 'type' used for InDet selection cuts - --> - - <Particle charge="10" type="0" code="1" name="unknown" /> - <Particle charge="10" type="0" code="0" name="Bug" /> - - <Particle charge="1" type="1" code="211" name="π" /> - <Particle charge="1" type="1" code="2212" name="Proton" /> - <Particle charge="1" type="1" code="321" name="K" /> - <Particle charge="1" type="1" code="3222" name="σ" /> - <Particle charge="-1" type="1" code="3112" name="Anti-σ" /> - <Particle charge="1" type="1" code="411" name="D" /> - <Particle charge="1" type="1" code="431" name="Ds" /> - <Particle charge="-1" type="1" code="3312" name="ξ" /> - <Particle charge="-1" type="1" code="3334" name="ω" /> - <Particle charge="-1" type="2" code="15" name="τ" /> - <Particle charge="-1" type="3" code="11" name="e" /> - <Particle charge="-1" type="4" code="13" name="μ" /> - <Particle charge="0" type="5" code="111" name="π0" /> - <Particle charge="0" type="5" code="2112" name="Neutron" /> - <Particle charge="0" type="5" code="130" name="K0_L" /> - <Particle charge="0" type="5" code="310" name="K0_S" /> - <Particle charge="0" type="5" code="3212" name="σ0" /> - <Particle charge="0" type="5" code="221" name="η" /> - <Particle charge="0" type="5" code="3122" name="λ" /> - <Particle charge="0" type="5" code="3322" name="ξ0" /> - <Particle charge="0" type="5" code="421" name="D0" /> - <Particle charge="0" type="6" code="22" name="γ" /> - <Particle charge="0" type="7" code="12" name="ν" /> - <Particle charge="0" type="7" code="14" name="ν" /> - <Particle charge="0" type="7" code="16" name="ν" /> - <Particle charge="0" type="7" code="1000022" name="neutralino" /> - <Particle charge="0" type="7" code="1000039" name="gravitino" /> - <Particle charge="0" type="8" code="1" name="u" /> - <Particle charge="0" type="8" code="2" name="d" /> - <Particle charge="0" type="8" code="3" name="s" /> - <Particle charge="0" type="8" code="4" name="c" /> - <Particle charge="0" type="8" code="5" name="b" /> - <Particle charge="0" type="8" code="6" name="t" /> - <Particle charge="-1" type="9" code="1000015" name="stau" /> - <Particle charge="-1" type="9" code="2000011" name="selectron" /> - <Particle charge="-1" type="9" code="2000013" name="smuon" /> - <Particle charge="1" type="10" code="24" name="W" /> - <Particle charge="-1" type="11" code="601" name="From Ntuple: d" /> - <Particle charge="1" type="11" code="602" name="From Ntuple: u" /> - <Particle charge="-1" type="11" code="603" name="From Ntuple: s" /> - <Particle charge="1" type="11" code="604" name="From Ntuple: c" /> - <Particle charge="-1" type="11" code="605" name="From Ntuple: b" /> - <Particle charge="1" type="11" code="606" name="From Ntuple: t" /> - <Particle charge="0" type="12" code="21" name="gluon" /> - <Particle charge="0" type="13" code="23" name="Z" /> - - <!-- - fragmentation types - --> - - <Particle charge="0" type="14" code="91" name="cluster fragmentation" /> - <Particle charge="0" type="14" code="92" name="string fragmentation" /> - <Particle charge="0" type="14" code="93" name="independent fragmentation" /> - - <!-- - extra particles (Higgs (h0), J/psi, upsilon) - --> - - <Particle charge="0" type="15" code="25" name="h0" /> - <Particle charge="0" type="15" code="443" name="J/ψ" /> - <Particle charge="0" type="15" code="553" name="υ" /> - -</PDG> diff --git a/graphics/AtlantisJava/configuration/rpsplt_fcal.csv b/graphics/AtlantisJava/configuration/rpsplt_fcal.csv deleted file mode 100644 index f5c29d69492368c1ccc22a696aa4dc0d2eb1d377..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/configuration/rpsplt_fcal.csv +++ /dev/null @@ -1,498 +0,0 @@ -# Real Pulse Shape Plots Lookup Table values for FCAL calorimeter - - -# FCAL, lookup table layer 0, amplitude values -FCAL_LAYER0_AMPLITUDE - "0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.00145f, -0.0002f, -0.00052f, - -9e-05f, 0.00017f, 0.00022f, 3e-05f, -0.00031f, - -0.00061f, -0.00046f, -0.00033f, 0.00012f, -0.00013f, - -0.00025f, -0.0005f, -0.00038f, -0.00035f, -0.0002f, - -0.00042f, -0.00031f, -0.00022f, 0.0001f, -0.00017f, - -0.00033f, 0.00028f, 0.00017f, 2e-05f, 9e-05f, - -0.00018f, -0.00023f, 6e-05f, -3e-05f, -0.00037f, - -0.00029f, -0.00021f, -0.00042f, -0.00047f, -0.00032f, - -0.00041f, -0.0002f, 0.0001f, 0.00032f, 0.0006f, - 0.00147f, 0.00234f, 0.00409f, 0.00701f, 0.01124f, - 0.01704f, 0.02441f, 0.0349f, 0.04655f, 0.06027f, - 0.07674f, 0.09489f, 0.11624f, 0.13948f, 0.16603f, - 0.19516f, 0.22665f, 0.25946f, 0.29534f, 0.3334f, - 0.37421f, 0.41508f, 0.45488f, 0.49473f, 0.53529f, - 0.5759f, 0.61356f, 0.65022f, 0.68584f, 0.72121f, - 0.75454f, 0.78585f, 0.81642f, 0.84443f, 0.8694f, - 0.89244f, 0.9134f, 0.93157f, 0.94811f, 0.96263f, - 0.9756f, 0.98573f, 0.99294f, 0.99721f, 0.99958f, - 0.99937f, 0.99596f, 0.99067f, 0.98339f, 0.97312f, - 0.96037f, 0.94624f, 0.93069f, 0.9126f, 0.89226f, - 0.87097f, 0.84789f, 0.82241f, 0.79715f, 0.7696f, - 0.74111f, 0.713f, 0.68302f, 0.65322f, 0.62221f, - 0.58901f, 0.55499f, 0.52119f, 0.48651f, 0.45161f, - 0.41474f, 0.37863f, 0.34418f, 0.31038f, 0.2759f, - 0.24106f, 0.20725f, 0.17425f, 0.14223f, 0.10914f, - 0.07784f, 0.04664f, 0.01518f, -0.01539f, -0.04403f, - -0.07252f, -0.1007f, -0.12714f, -0.15365f, -0.17955f, - -0.20587f, -0.23009f, -0.25359f, -0.27704f, -0.29989f, - -0.32317f, -0.34403f, -0.3634f, -0.3812f, -0.39806f, - -0.41503f, -0.42994f, -0.4448f, -0.45808f, -0.46945f, - -0.47926f, -0.48934f, -0.50054f, -0.51152f, -0.52073f, - -0.52908f, -0.53691f, -0.5431f, -0.55034f, -0.55776f, - -0.56445f, -0.56952f, -0.57341f, -0.57756f, -0.58138f, - -0.58532f, -0.58718f, -0.58934f, -0.5898f, -0.59049f, - -0.59047f, -0.5886f, -0.58601f, -0.58368f, -0.58009f, - -0.57595f, -0.56963f, -0.55958f, -0.54925f, -0.5387f, - -0.52797f, -0.5171f, -0.50614f, -0.49513f, -0.4841f, - -0.47308f, -0.46212f, -0.45122f, -0.44041f, -0.42973f, - -0.41916f, -0.40875f, -0.39851f, -0.38846f, -0.37862f, - -0.36901f, -0.35965f, -0.35054f, -0.34168f, -0.33306f, - -0.32471f, -0.31661f, -0.30876f, -0.30117f, -0.29382f, - -0.28672f, -0.27987f, -0.27327f, -0.2669f, -0.26077f, - -0.25487f, -0.2492f, -0.24375f, -0.23855f, -0.23358f, - -0.22884f, -0.22433f, -0.22007f, -0.21602f, -0.21221f, - -0.20861f, -0.20521f, -0.20199f, -0.19895f, -0.19609f, - -0.19337f, -0.19079f, -0.18833f, -0.186f, -0.18376f, - -0.1816f, -0.17953f, -0.17753f, -0.17557f, -0.17367f, - -0.1718f, -0.16996f, -0.16814f, -0.16634f, -0.16454f, - -0.16276f, -0.16097f, -0.15917f, -0.15737f, -0.15555f, - -0.15372f, -0.15186f, -0.14997f, -0.14801f, -0.14599f, - -0.14389f, -0.1417f, -0.13943f, -0.13712f, -0.13482f, - -0.13255f, -0.13036f, -0.12824f, -0.12623f, -0.12429f, - -0.12243f, -0.12061f, -0.11882f, -0.11704f, -0.11527f, - -0.11349f, -0.11167f, -0.10983f, -0.10794f, -0.10603f, - -0.10406f, -0.10205f, -0.1f, -0.09791f, -0.09578f, - -0.09361f, -0.09141f, -0.08918f, -0.08694f, -0.08466f, - -0.08238f, -0.08009f, -0.0778f, -0.0755f, -0.07321f, - -0.07093f, -0.06867f, -0.06642f, -0.06421f, -0.06202f, - -0.05986f, -0.05774f, -0.05566f, -0.0536f, -0.05158f, - -0.04959f, -0.04764f, -0.04572f, -0.04385f, -0.04203f, - -0.04025f, -0.03853f, -0.03687f, -0.03526f, -0.0337f, - -0.03218f, -0.03072f, -0.0293f, -0.02794f, -0.02663f, - -0.02536f, -0.02413f, -0.02294f, -0.02181f, -0.0207f, - -0.01964f, -0.01861f, -0.01761f, -0.01665f, -0.01573f, - -0.01484f, -0.01399f, -0.01319f, -0.01242f, -0.01168f, - -0.011f, -0.01034f, -0.00973f, -0.00914f, -0.00861f, - -0.00808f, -0.00761f, -0.00716f, -0.00673f, -0.00632f, - -0.00595f, -0.00559f, -0.00526f, -0.00494f, -0.00464f, - -0.00436f, -0.00409f, -0.00383f, -0.00359f, -0.00335f, - -0.00312f, -0.00291f, -0.00271f, -0.00252f, -0.00234f, - -0.00219f, -0.00204f, -0.0019f, -0.00174f, -0.00158f, - -0.00139f, -0.00118f, -0.00094f, -0.00068f, -0.00042f, - -0.00016f, 8e-05f, 0.00032f, 0.00052f, 0.0007f, - 0.00088f, 0.00102f, 0.00114f, 0.0013f, 0.0014f, - 0.00148f, 0.00159f, 0.00171f, 0.0018f, 0.00191f, - 0.00197f, 0.00207f, 0.00218f, 0.00232f, 0.00243f, - 0.00254f, 0.00267f, 0.0028f, 0.00292f, 0.00305f, - 0.00318f, 0.00331f, 0.00347f, 0.00363f, 0.00376f, - 0.00388f, 0.00405f, 0.00421f, 0.00433f, 0.00446f, - 0.00458f, 0.00473f, 0.00488f, 0.00497f, 0.00514f, - 0.00522f, 0.00538f, 0.00553f, 0.00563f, 0.00573f, - 0.00588f, 0.00596f, 0.00608f, 0.0062f, 0.00629f, - 0.00636f, 0.00646f, 0.00654f, 0.00663f, 0.00669f, - 0.00674f, 0.00679f, 0.00688f, 0.00688f, 0.00696f, - 0.00702f, 0.00704f, 0.00711f, 0.00712f, 0.0072f, - 0.0072f, 0.00727f, 0.00729f, 0.00729f, 0.00737f, - 0.00737f, 0.00737f, 0.00737f, 0.00746f, 0.00746f, - 0.00746f, 0.00746f, 0.00746f, 0.00746f, 0.00746f, - 0.00746f, 0.00746f, 0.00737f, 0.00737f, 0.00737f, - 0.00737f, 0.00737f, 0.00737f, 0.00729f, 0.00729f, - 0.00729f, 0.00729f, 0.00729f, 0.0072f, 0.0072f, - 0.00717f, 0.00712f, 0.00708f, 0.00704f, 0.00704f, - 0.00696f, 0.00696f, 0.00696f, 0.00696f, 0.00696f, - 0.00696f, 0.00696f, 0.00696f, 0.00696f, 0.00696f, - 0.00688f, 0.00688f, 0.00688f, 0.00688f, 0.00688f, - 0.00684f, 0.00679f, 0.00679f, 0.00679f, 0.00671f, - 0.00671f, 0.00671f, 0.00671f, 0.00663f, 0.00663f, - 0.00663f, 0.00663f, 0.00659f, 0.00655f, 0.00655f, - 0.00655f, 0.00655f, 0.00655f, 0.00651f, 0.00646f, - 0.00646f, 0.00646f, 0.00646f, 0.00646f, 0.00646f, - 0.00646f, 0.00646f, 0.00639f, 0.00638f, 0.00638f, - 0.00638f, 0.00638f, 0.00638f, 0.00638f, 0.00638f, - 0.00638f, 0.00638f, 0.00638f, 0.00638f, 0.0063f, - 0.00629f, 0.00629f, 0.00629f, 0.00629f, 0.00629f, - 0.00629f, 0.00629f, 0.00629f, 0.00629f, 0.00622f, - 0.00622f, 0.00622f, 0.00622f, 0.00622f, 0.00622f, - 0.00622f, 0.00622f, 0.00612f, 0.00612f, 0.00612f, - 0.00612f, 0.00612f, 0.00612f, 0.00612f, 0.00612f, - 0.00606f, 0.00605f, 0.00605f, 0.00605f, 0.00605f, - 0.00605f, 0.00605f, 0.00601f, 0.00596f, 0.00596f, - 0.00596f, 0.00596f, 0.00596f, 0.00596f, 0.00596f, - 0.00588f, 0.00588f, 0.00588f, 0.00588f, 0.00588f, - 0.00588f, 0.00585f, 0.00579f, 0.00579f, 0.00579f, - 0.00579f, 0.00579f, 0.00572f, 0.00572f, 0.00572f, - 0.00572f, 0.00572f, 0.00572f, 0.00572f, 0.00572f, - 0.00572f, 0.00563f, 0.00563f, 0.00563f, 0.00563f, - 0.00563f, 0.00563f, 0.00563f, 0.00563f, 0.00563f, - 0.00563f, 0.00563f, 0.00563f, 0.00563f, 0.00563f" - - -# FCAL lookup table layer 1, amplitude values -FCAL_LAYER1_AMPLITUDE - "0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, -0.00014f, - -0.00015f, -0.00019f, -0.00024f, -2e-05f, 8e-05f, - 0.00012f, -3e-05f, -0.00012f, -0.00011f, -0.0002f, - -4e-05f, 7e-05f, 5e-05f, -1e-05f, -9e-05f, - -3e-05f, -0.00012f, -3e-05f, -3e-05f, -1e-05f, - -3e-05f, -1e-05f, -0.00011f, -0.00021f, -0.00017f, - -0.00016f, -6e-05f, 1e-05f, 1e-05f, -3e-05f, - -0.00018f, -0.0002f, -0.00018f, -8e-05f, -2e-05f, - -5e-05f, 0.00011f, 4e-05f, 0.00032f, 0.00076f, - 0.00136f, 0.00271f, 0.00417f, 0.00696f, 0.01099f, - 0.01602f, 0.02229f, 0.02963f, 0.03936f, 0.05282f, - 0.06928f, 0.08819f, 0.10857f, 0.12914f, 0.15221f, - 0.17682f, 0.20343f, 0.23335f, 0.26583f, 0.29864f, - 0.33272f, 0.36835f, 0.40457f, 0.44149f, 0.47595f, - 0.51049f, 0.54648f, 0.5816f, 0.61676f, 0.65114f, - 0.68367f, 0.7141f, 0.74147f, 0.76915f, 0.79855f, - 0.82565f, 0.85105f, 0.87379f, 0.89366f, 0.9111f, - 0.927f, 0.94162f, 0.95496f, 0.96664f, 0.97688f, - 0.98534f, 0.99109f, 0.99601f, 0.99887f, 0.99964f, - 0.99962f, 0.99681f, 0.99299f, 0.98726f, 0.98f, - 0.97158f, 0.96249f, 0.95187f, 0.9393f, 0.92385f, - 0.90628f, 0.88827f, 0.86996f, 0.85269f, 0.83453f, - 0.81503f, 0.79519f, 0.77368f, 0.74984f, 0.72628f, - 0.70228f, 0.67716f, 0.65181f, 0.62399f, 0.59774f, - 0.57129f, 0.54263f, 0.51398f, 0.48417f, 0.45309f, - 0.42268f, 0.39325f, 0.36432f, 0.33302f, 0.29777f, - 0.26282f, 0.22816f, 0.19507f, 0.16394f, 0.13389f, - 0.10437f, 0.07385f, 0.04319f, 0.01199f, -0.01883f, - -0.04912f, -0.07801f, -0.10802f, -0.13734f, -0.16453f, - -0.19169f, -0.2182f, -0.24487f, -0.27109f, -0.29671f, - -0.32083f, -0.34391f, -0.36456f, -0.38568f, -0.40796f, - -0.428f, -0.44835f, -0.46643f, -0.48286f, -0.49816f, - -0.51161f, -0.5248f, -0.5374f, -0.54928f, -0.5608f, - -0.57103f, -0.57868f, -0.58697f, -0.59288f, -0.59803f, - -0.60282f, -0.60532f, -0.60756f, -0.60862f, -0.60882f, - -0.60828f, -0.60572f, -0.60473f, -0.60353f, -0.60196f, - -0.6001f, -0.59736f, -0.59308f, -0.58847f, -0.5836f, - -0.57846f, -0.57308f, -0.56749f, -0.56171f, -0.55576f, - -0.54966f, -0.54343f, -0.5371f, -0.53066f, -0.52415f, - -0.51757f, -0.51094f, -0.50428f, -0.4976f, -0.4909f, - -0.4842f, -0.47749f, -0.47078f, -0.4641f, -0.45745f, - -0.45081f, -0.44422f, -0.43769f, -0.43118f, -0.42475f, - -0.41838f, -0.41207f, -0.40583f, -0.39965f, -0.39355f, - -0.38752f, -0.38156f, -0.37568f, -0.36988f, -0.36414f, - -0.35848f, -0.35292f, -0.34744f, -0.34205f, -0.33676f, - -0.33155f, -0.32642f, -0.32135f, -0.31634f, -0.31139f, - -0.30648f, -0.30164f, -0.29688f, -0.29227f, -0.28779f, - -0.28349f, -0.27937f, -0.27541f, -0.2716f, -0.26792f, - -0.26432f, -0.26084f, -0.25743f, -0.25406f, -0.25074f, - -0.24743f, -0.24413f, -0.24086f, -0.23757f, -0.23428f, - -0.23096f, -0.22764f, -0.22429f, -0.22092f, -0.21754f, - -0.21414f, -0.21072f, -0.20729f, -0.20385f, -0.20038f, - -0.19692f, -0.19344f, -0.18993f, -0.18644f, -0.18293f, - -0.17943f, -0.17592f, -0.17244f, -0.16898f, -0.16553f, - -0.16211f, -0.1587f, -0.15533f, -0.15198f, -0.14866f, - -0.14538f, -0.14213f, -0.13891f, -0.13573f, -0.13259f, - -0.12948f, -0.12641f, -0.1234f, -0.12042f, -0.11747f, - -0.11457f, -0.11173f, -0.10891f, -0.10617f, -0.10345f, - -0.10079f, -0.09819f, -0.09562f, -0.09311f, -0.09065f, - -0.08823f, -0.08586f, -0.08354f, -0.08125f, -0.07903f, - -0.07685f, -0.07471f, -0.07262f, -0.07057f, -0.06857f, - -0.06662f, -0.06471f, -0.06284f, -0.06102f, -0.05926f, - -0.05751f, -0.05582f, -0.05416f, -0.05254f, -0.05096f, - -0.04942f, -0.04792f, -0.04647f, -0.04507f, -0.04369f, - -0.04235f, -0.04104f, -0.03974f, -0.03845f, -0.03717f, - -0.03591f, -0.03467f, -0.03347f, -0.03231f, -0.03119f, - -0.03012f, -0.0291f, -0.02812f, -0.02718f, -0.02629f, - -0.02542f, -0.0246f, -0.02381f, -0.02304f, -0.0223f, - -0.02157f, -0.02088f, -0.0202f, -0.01953f, -0.01888f, - -0.01824f, -0.01761f, -0.017f, -0.0164f, -0.0158f, - -0.01523f, -0.01466f, -0.0141f, -0.01355f, -0.01301f, - -0.01247f, -0.01195f, -0.01141f, -0.0109f, -0.01039f, - -0.00989f, -0.0094f, -0.0089f, -0.00842f, -0.00796f, - -0.0075f, -0.00705f, -0.0066f, -0.00616f, -0.00575f, - -0.00533f, -0.00493f, -0.00452f, -0.00413f, -0.00375f, - -0.00338f, -0.003f, -0.00265f, -0.00228f, -0.00195f, - -0.00162f, -0.00128f, -0.00096f, -0.00064f, -0.00035f, - -5e-05f, 0.00023f, 0.0005f, 0.00079f, 0.00105f, - 0.00131f, 0.00156f, 0.00181f, 0.00201f, 0.0023f, - 0.0025f, 0.00267f, 0.00287f, 0.00315f, 0.00335f, - 0.00346f, 0.00367f, 0.0039f, 0.0041f, 0.00421f, - 0.00441f, 0.00458f, 0.00473f, 0.0049f, 0.00505f, - 0.00516f, 0.00522f, 0.00537f, 0.00551f, 0.00552f, - 0.00569f, 0.00579f, 0.0059f, 0.00601f, 0.00615f, - 0.00628f, 0.00632f, 0.00648f, 0.00653f, 0.00664f, - 0.00679f, 0.0068f, 0.00696f, 0.00696f, 0.007f, - 0.00711f, 0.00711f, 0.00724f, 0.00728f, 0.00728f, - 0.00728f, 0.00743f, 0.00743f, 0.00743f, 0.00743f, - 0.00744f, 0.00759f, 0.00759f, 0.00759f, 0.00759f, - 0.00759f, 0.00759f, 0.00774f, 0.00775f, 0.00775f, - 0.00775f, 0.00775f, 0.00775f, 0.00775f, 0.00775f, - 0.00789f, 0.00791f, 0.00791f, 0.00791f, 0.00791f, - 0.00791f, 0.00791f, 0.00791f, 0.00791f, 0.00791f, - 0.00791f, 0.00792f, 0.00807f, 0.00807f, 0.00807f, - 0.00807f, 0.00807f, 0.00807f, 0.00807f, 0.00807f, - 0.00807f, 0.00807f, 0.00807f, 0.00807f, 0.00807f, - 0.00807f, 0.00807f, 0.00807f, 0.00807f, 0.00807f, - 0.00807f, 0.00807f, 0.00807f, 0.00807f, 0.00807f, - 0.00807f, 0.00807f, 0.00807f, 0.00807f, 0.00807f, - 0.00807f, 0.00807f, 0.00807f, 0.00807f, 0.00807f, - 0.00807f, 0.00807f, 0.00807f, 0.00807f, 0.00807f, - 0.00807f, 0.00807f, 0.00807f, 0.00791f, 0.00791f, - 0.00791f, 0.00791f, 0.00791f, 0.00791f, 0.00791f, - 0.00791f, 0.00791f, 0.00791f, 0.00791f, 0.00791f, - 0.00791f, 0.00791f, 0.00791f, 0.00791f, 0.00791f, - 0.00791f, 0.00775f, 0.00775f, 0.00775f, 0.00775f, - 0.00775f, 0.00775f, 0.00775f, 0.00775f, 0.00775f, - 0.00775f, 0.00775f, 0.00775f, 0.00775f, 0.0076f, - 0.00759f, 0.00759f, 0.00759f, 0.00759f, 0.00759f, - 0.00759f, 0.00759f, 0.00759f, 0.00759f, 0.00759f, - 0.00759f, 0.00753f, 0.00743f, 0.00743f, 0.00743f, - 0.00743f, 0.00743f, 0.00743f, 0.00743f, 0.00743f, - 0.00743f, 0.00743f, 0.00743f, 0.00743f, 0.00743f, - 0.00728f, 0.00728f, 0.00728f, 0.00728f, 0.00728f, - 0.00728f, 0.00728f, 0.00728f, 0.00728f, 0.00728f, - 0.00728f, 0.00728f, 0.00728f, 0.00727f, 0.00711f, - 0.00711f, 0.00711f, 0.00711f, 0.00711f, 0.00711f, - 0.00711f, 0.00711f, 0.00711f, 0.00711f, 0.00711f, - 0.00711f, 0.00711f, 0.00711f, 0.00711f, 0.00711f" - - -# FCAL lookup table layer 2, amplitude values -FCAL_LAYER2_AMPLITUDE - "0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, -0.00128f, -0.00011f, 0.00018f, 2e-05f, - 0.00012f, -6e-05f, -5e-05f, -4e-05f, -4e-05f, - -6e-05f, -0.00031f, 3e-05f, -0.00022f, 7e-05f, - -3e-05f, 2e-05f, 0.00011f, 9e-05f, -0.00025f, - -5e-05f, -0.00026f, -3e-05f, -3e-05f, -5e-05f, - -3e-05f, 8e-05f, 0.00016f, 0.00025f, 0.00015f, - 0.00018f, 9e-05f, -0.00016f, -0.00017f, 0.00012f, - 0.00031f, 0.00061f, 0.00137f, 0.00259f, 0.00487f, - 0.00807f, 0.01106f, 0.01611f, 0.02298f, 0.03195f, - 0.04154f, 0.05328f, 0.06624f, 0.08155f, 0.09926f, - 0.11723f, 0.13765f, 0.16233f, 0.18937f, 0.21701f, - 0.24599f, 0.27675f, 0.30806f, 0.34205f, 0.3763f, - 0.40922f, 0.44335f, 0.47795f, 0.51151f, 0.54584f, - 0.58035f, 0.61246f, 0.64345f, 0.67427f, 0.70516f, - 0.73373f, 0.75953f, 0.78417f, 0.80817f, 0.83037f, - 0.85125f, 0.87108f, 0.88998f, 0.9072f, 0.92291f, - 0.93755f, 0.95053f, 0.96236f, 0.97239f, 0.9802f, - 0.9869f, 0.99293f, 0.99661f, 0.99861f, 0.99968f, - 0.99958f, 0.99822f, 0.99567f, 0.9913f, 0.98539f, - 0.97946f, 0.97165f, 0.96321f, 0.95356f, 0.943f, - 0.93288f, 0.92124f, 0.90748f, 0.8924f, 0.87741f, - 0.86239f, 0.84699f, 0.83096f, 0.81354f, 0.79568f, - 0.77812f, 0.75942f, 0.73898f, 0.71895f, 0.6979f, - 0.67584f, 0.65541f, 0.63427f, 0.61183f, 0.58872f, - 0.56582f, 0.54277f, 0.51966f, 0.49662f, 0.47374f, - 0.45068f, 0.42633f, 0.40063f, 0.37501f, 0.35003f, - 0.32551f, 0.30122f, 0.27643f, 0.2508f, 0.22669f, - 0.2018f, 0.1756f, 0.15017f, 0.12637f, 0.102f, - 0.07617f, 0.05128f, 0.02768f, 0.00478f, -0.01868f, - -0.0427f, -0.06341f, -0.08504f, -0.10568f, -0.12438f, - -0.14567f, -0.16618f, -0.18641f, -0.20502f, -0.22295f, - -0.24012f, -0.2569f, -0.27256f, -0.28823f, -0.30194f, - -0.31542f, -0.33028f, -0.34304f, -0.35301f, -0.36387f, - -0.37478f, -0.38515f, -0.39437f, -0.4023f, -0.41029f, - -0.41949f, -0.42512f, -0.43117f, -0.43628f, -0.44007f, - -0.4454f, -0.45203f, -0.45813f, -0.46382f, -0.46907f, - -0.4739f, -0.47832f, -0.48235f, -0.48597f, -0.4892f, - -0.49207f, -0.49454f, -0.49666f, -0.49841f, -0.49984f, - -0.50092f, -0.50166f, -0.50208f, -0.50221f, -0.50202f, - -0.50155f, -0.50082f, -0.49982f, -0.49856f, -0.49706f, - -0.49533f, -0.49338f, -0.49122f, -0.48885f, -0.48628f, - -0.48354f, -0.48064f, -0.47755f, -0.47432f, -0.47094f, - -0.46742f, -0.46379f, -0.46001f, -0.45611f, -0.45208f, - -0.4479f, -0.44361f, -0.43919f, -0.43467f, -0.43006f, - -0.42543f, -0.42077f, -0.41613f, -0.4115f, -0.4069f, - -0.40233f, -0.39778f, -0.39325f, -0.38873f, -0.38422f, - -0.37971f, -0.37519f, -0.37068f, -0.36616f, -0.36163f, - -0.3571f, -0.35256f, -0.34802f, -0.34347f, -0.33892f, - -0.33436f, -0.32982f, -0.32529f, -0.32077f, -0.31626f, - -0.31179f, -0.30733f, -0.30289f, -0.2985f, -0.29413f, - -0.2898f, -0.28552f, -0.28129f, -0.27709f, -0.27294f, - -0.26885f, -0.26479f, -0.26078f, -0.25685f, -0.25293f, - -0.24906f, -0.24524f, -0.24147f, -0.23772f, -0.23403f, - -0.23038f, -0.22676f, -0.22318f, -0.21964f, -0.21614f, - -0.21268f, -0.20925f, -0.20586f, -0.20249f, -0.19916f, - -0.19588f, -0.19261f, -0.1894f, -0.18622f, -0.18305f, - -0.17994f, -0.17686f, -0.1738f, -0.17078f, -0.16779f, - -0.16484f, -0.1619f, -0.15902f, -0.15615f, -0.15333f, - -0.15054f, -0.14777f, -0.14504f, -0.14234f, -0.13967f, - -0.13704f, -0.13444f, -0.13187f, -0.12934f, -0.12684f, - -0.12439f, -0.12197f, -0.11959f, -0.11724f, -0.11494f, - -0.11265f, -0.1104f, -0.10815f, -0.10592f, -0.10371f, - -0.10151f, -0.09934f, -0.0972f, -0.09509f, -0.09302f, - -0.09099f, -0.08899f, -0.08705f, -0.08514f, -0.08327f, - -0.08145f, -0.07966f, -0.0779f, -0.07617f, -0.07448f, - -0.07282f, -0.07119f, -0.06958f, -0.06801f, -0.06646f, - -0.06493f, -0.06344f, -0.06196f, -0.06051f, -0.05908f, - -0.05768f, -0.05629f, -0.05495f, -0.0536f, -0.05229f, - -0.051f, -0.04974f, -0.04849f, -0.04726f, -0.04607f, - -0.0449f, -0.04375f, -0.04262f, -0.04151f, -0.04044f, - -0.03937f, -0.03834f, -0.03732f, -0.03634f, -0.03536f, - -0.0344f, -0.03347f, -0.03256f, -0.03166f, -0.03079f, - -0.02993f, -0.02908f, -0.02826f, -0.02745f, -0.02666f, - -0.02588f, -0.02512f, -0.02437f, -0.02364f, -0.02293f, - -0.02223f, -0.02154f, -0.02087f, -0.02021f, -0.01957f, - -0.01892f, -0.0183f, -0.01768f, -0.0171f, -0.01651f, - -0.01594f, -0.01536f, -0.01482f, -0.01428f, -0.01375f, - -0.01323f, -0.01271f, -0.01221f, -0.01171f, -0.01123f, - -0.01076f, -0.01029f, -0.00984f, -0.0094f, -0.00898f, - -0.00857f, -0.00817f, -0.00777f, -0.00739f, -0.007f, - -0.00663f, -0.00624f, -0.00587f, -0.00551f, -0.00514f, - -0.00479f, -0.00444f, -0.0041f, -0.00377f, -0.00344f, - -0.00313f, -0.00282f, -0.00252f, -0.00223f, -0.00195f, - -0.00168f, -0.0014f, -0.00114f, -0.00089f, -0.00063f, - -0.00039f, -0.00015f, 9e-05f, 0.00031f, 0.00053f, - 0.00076f, 0.00096f, 0.00117f, 0.00138f, 0.00158f, - 0.00178f, 0.00194f, 0.00216f, 0.00234f, 0.00251f, - 0.00269f, 0.0029f, 0.00298f, 0.00319f, 0.00338f, - 0.00353f, 0.00368f, 0.00383f, 0.00398f, 0.00408f, - 0.00427f, 0.00438f, 0.00447f, 0.00458f, 0.00472f, - 0.00488f, 0.00501f, 0.00512f, 0.00517f, 0.00532f, - 0.00546f, 0.00547f, 0.00561f, 0.00572f, 0.00576f, - 0.0059f, 0.00594f, 0.00606f, 0.0062f, 0.0062f, - 0.00635f, 0.00636f, 0.0065f, 0.0065f, 0.00664f, - 0.00665f, 0.0068f, 0.0068f, 0.00684f, 0.00695f, - 0.00695f, 0.0071f, 0.0071f, 0.00721f, 0.00725f, - 0.00725f, 0.00739f, 0.0074f, 0.0074f, 0.00751f, - 0.00755f, 0.00755f, 0.00759f, 0.00769f, 0.00769f, - 0.00769f, 0.00769f, 0.00783f, 0.00783f, 0.00783f, - 0.00783f, 0.00795f, 0.00799f, 0.00799f, 0.00799f, - 0.00799f, 0.00812f, 0.00813f, 0.00813f, 0.00813f, - 0.00813f, 0.00813f, 0.00828f, 0.00829f, 0.00829f, - 0.00829f, 0.00829f, 0.00829f, 0.00829f, 0.00829f, - 0.00843f, 0.00843f, 0.00843f, 0.00843f, 0.00843f, - 0.00843f, 0.00843f, 0.00843f, 0.00843f, 0.00843f, - 0.00843f, 0.00843f, 0.00843f, 0.00844f, 0.00858f, - 0.00858f, 0.00858f, 0.00858f, 0.00858f, 0.00858f, - 0.00858f, 0.00858f, 0.00858f, 0.00858f, 0.00858f, - 0.00858f, 0.00858f, 0.00858f, 0.00858f, 0.00858f, - 0.00858f, 0.00858f, 0.00858f, 0.00858f, 0.00858f, - 0.00858f, 0.00858f, 0.00858f, 0.00858f, 0.00858f, - 0.00858f, 0.00858f, 0.00858f, 0.00858f, 0.00858f, - 0.00858f, 0.00858f, 0.00858f, 0.00858f, 0.00858f, - 0.00858f, 0.00858f, 0.00854f, 0.00843f, 0.00843f, - 0.00843f, 0.00843f, 0.00843f, 0.00843f, 0.00843f, - 0.00843f, 0.00843f, 0.00843f, 0.00843f, 0.00843f, - 0.00843f, 0.00843f, 0.00843f, 0.00843f, 0.00843f, - 0.00843f, 0.00843f, 0.00843f, 0.00843f, 0.00843f" - - -# FCAL lookup table time values -FCAL_TIME - "0.5f, 1.5f, 2.5f, 3.5f, 4.5f, - 5.5f, 6.5f, 7.5f, 8.5f, 9.5f, - 10.5f, 11.5f, 12.5f, 13.5f, 14.5f, - 15.5f, 16.5f, 17.5f, 18.5f, 19.5f, - 20.5f, 21.5f, 22.5f, 23.5f, 24.5f, - 25.5f, 26.5f, 27.5f, 28.5f, 29.5f, - 30.5f, 31.5f, 32.5f, 33.5f, 34.5f, - 35.5f, 36.5f, 37.5f, 38.5f, 39.5f, - 40.5f, 41.5f, 42.5f, 43.5f, 44.5f, - 45.5f, 46.5f, 47.5f, 48.5f, 49.5f, - 50.5f, 51.5f, 52.5f, 53.5f, 54.5f, - 55.5f, 56.5f, 57.5f, 58.5f, 59.5f, - 60.5f, 61.5f, 62.5f, 63.5f, 64.5f, - 65.5f, 66.5f, 67.5f, 68.5f, 69.5f, - 70.5f, 71.5f, 72.5f, 73.5f, 74.5f, - 75.5f, 76.5f, 77.5f, 78.5f, 79.5f, - 80.5f, 81.5f, 82.5f, 83.5f, 84.5f, - 85.5f, 86.5f, 87.5f, 88.5f, 89.5f, - 90.5f, 91.5f, 92.5f, 93.5f, 94.5f, - 95.5f, 96.5f, 97.5f, 98.5f, 99.5f, - 100.5f, 101.5f, 102.5f, 103.5f, 104.5f, - 105.5f, 106.5f, 107.5f, 108.5f, 109.5f, - 110.5f, 111.5f, 112.5f, 113.5f, 114.5f, - 115.5f, 116.5f, 117.5f, 118.5f, 119.5f, - 120.5f, 121.5f, 122.5f, 123.5f, 124.5f, - 125.5f, 126.5f, 127.5f, 128.5f, 129.5f, - 130.5f, 131.5f, 132.5f, 133.5f, 134.5f, - 135.5f, 136.5f, 137.5f, 138.5f, 139.5f, - 140.5f, 141.5f, 142.5f, 143.5f, 144.5f, - 145.5f, 146.5f, 147.5f, 148.5f, 149.5f, - 150.5f, 151.5f, 152.5f, 153.5f, 154.5f, - 155.5f, 156.5f, 157.5f, 158.5f, 159.5f, - 160.5f, 161.5f, 162.5f, 163.5f, 164.5f, - 165.5f, 166.5f, 167.5f, 168.5f, 169.5f, - 170.5f, 171.5f, 172.5f, 173.5f, 174.5f, - 175.5f, 176.5f, 177.5f, 178.5f, 179.5f, - 180.5f, 181.5f, 182.5f, 183.5f, 184.5f, - 185.5f, 186.5f, 187.5f, 188.5f, 189.5f, - 190.5f, 191.5f, 192.5f, 193.5f, 194.5f, - 195.5f, 196.5f, 197.5f, 198.5f, 199.5f, - 200.5f, 201.5f, 202.5f, 203.5f, 204.5f, - 205.5f, 206.5f, 207.5f, 208.5f, 209.5f, - 210.5f, 211.5f, 212.5f, 213.5f, 214.5f, - 215.5f, 216.5f, 217.5f, 218.5f, 219.5f, - 220.5f, 221.5f, 222.5f, 223.5f, 224.5f, - 225.5f, 226.5f, 227.5f, 228.5f, 229.5f, - 230.5f, 231.5f, 232.5f, 233.5f, 234.5f, - 235.5f, 236.5f, 237.5f, 238.5f, 239.5f, - 240.5f, 241.5f, 242.5f, 243.5f, 244.5f, - 245.5f, 246.5f, 247.5f, 248.5f, 249.5f, - 250.5f, 251.5f, 252.5f, 253.5f, 254.5f, - 255.5f, 256.5f, 257.5f, 258.5f, 259.5f, - 260.5f, 261.5f, 262.5f, 263.5f, 264.5f, - 265.5f, 266.5f, 267.5f, 268.5f, 269.5f, - 270.5f, 271.5f, 272.5f, 273.5f, 274.5f, - 275.5f, 276.5f, 277.5f, 278.5f, 279.5f, - 280.5f, 281.5f, 282.5f, 283.5f, 284.5f, - 285.5f, 286.5f, 287.5f, 288.5f, 289.5f, - 290.5f, 291.5f, 292.5f, 293.5f, 294.5f, - 295.5f, 296.5f, 297.5f, 298.5f, 299.5f, - 300.5f, 301.5f, 302.5f, 303.5f, 304.5f, - 305.5f, 306.5f, 307.5f, 308.5f, 309.5f, - 310.5f, 311.5f, 312.5f, 313.5f, 314.5f, - 315.5f, 316.5f, 317.5f, 318.5f, 319.5f, - 320.5f, 321.5f, 322.5f, 323.5f, 324.5f, - 325.5f, 326.5f, 327.5f, 328.5f, 329.5f, - 330.5f, 331.5f, 332.5f, 333.5f, 334.5f, - 335.5f, 336.5f, 337.5f, 338.5f, 339.5f, - 340.5f, 341.5f, 342.5f, 343.5f, 344.5f, - 345.5f, 346.5f, 347.5f, 348.5f, 349.5f, - 350.5f, 351.5f, 352.5f, 353.5f, 354.5f, - 355.5f, 356.5f, 357.5f, 358.5f, 359.5f, - 360.5f, 361.5f, 362.5f, 363.5f, 364.5f, - 365.5f, 366.5f, 367.5f, 368.5f, 369.5f, - 370.5f, 371.5f, 372.5f, 373.5f, 374.5f, - 375.5f, 376.5f, 377.5f, 378.5f, 379.5f, - 380.5f, 381.5f, 382.5f, 383.5f, 384.5f, - 385.5f, 386.5f, 387.5f, 388.5f, 389.5f, - 390.5f, 391.5f, 392.5f, 393.5f, 394.5f, - 395.5f, 396.5f, 397.5f, 398.5f, 399.5f, - 400.5f, 401.5f, 402.5f, 403.5f, 404.5f, - 405.5f, 406.5f, 407.5f, 408.5f, 409.5f, - 410.5f, 411.5f, 412.5f, 413.5f, 414.5f, - 415.5f, 416.5f, 417.5f, 418.5f, 419.5f, - 420.5f, 421.5f, 422.5f, 423.5f, 424.5f, - 425.5f, 426.5f, 427.5f, 428.5f, 429.5f, - 430.5f, 431.5f, 432.5f, 433.5f, 434.5f, - 435.5f, 436.5f, 437.5f, 438.5f, 439.5f, - 440.5f, 441.5f, 442.5f, 443.5f, 444.5f, - 445.5f, 446.5f, 447.5f, 448.5f, 449.5f, - 450.5f, 451.5f, 452.5f, 453.5f, 454.5f, - 455.5f, 456.5f, 457.5f, 458.5f, 459.5f, - 460.5f, 461.5f, 462.5f, 463.5f, 464.5f, - 465.5f, 466.5f, 467.5f, 468.5f, 469.5f, - 470.5f, 471.5f, 472.5f, 473.5f, 474.5f, - 475.5f, 476.5f, 477.5f, 478.5f, 479.5f, - 480.5f, 481.5f, 482.5f, 483.5f, 484.5f, - 485.5f, 486.5f, 487.5f, 488.5f, 489.5f, - 490.5f, 491.5f, 492.5f, 493.5f, 494.5f, - 495.5f, 496.5f, 497.5f, 498.5f, 499.5f, - 500.5f, 501.5f, 502.5f, 503.5f, 504.5f, - 505.5f, 506.5f, 507.5f, 508.5f, 509.5f, - 510.5f, 511.5f, 512.5f, 513.5f, 514.5f, - 515.5f, 516.5f, 517.5f, 518.5f, 519.5f, - 520.5f, 521.5f, 522.5f, 523.5f, 524.5f, - 525.5f, 526.5f, 527.5f, 528.5f, 529.5f, - 530.5f, 531.5f, 532.5f, 533.5f, 534.5f, - 535.5f, 536.5f, 537.5f, 538.5f, 539.5f, - 540.5f, 541.5f, 542.5f, 543.5f, 544.5f, - 545.5f, 546.5f, 547.5f, 548.5f, 549.5f, - 550.5f, 551.5f, 552.5f, 553.5f, 554.5f, - 555.5f, 556.5f, 557.5f, 558.5f, 559.5f, - 560.5f, 561.5f, 562.5f, 563.5f, 564.5f, - 565.5f, 566.5f, 567.5f, 568.5f, 569.5f, - 570.5f, 571.5f, 572.5f, 573.5f, 574.5f, - 575.5f, 576.5f, 577.5f, 578.5f, 579.5f, - 580.5f, 581.5f, 582.5f, 583.5f, 584.5f, - 585.5f, 586.5f, 587.5f, 588.5f, 589.5f, - 590.5f, 591.5f, 592.5f, 593.5f, 594.5f, - 595.5f, 596.5f, 597.5f, 598.5f, 599.5f" - diff --git a/graphics/AtlantisJava/configuration/rpsplt_hec.csv b/graphics/AtlantisJava/configuration/rpsplt_hec.csv deleted file mode 100644 index 0b1285de75ed53b27ab96a8c5204dd60c747f3bd..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/configuration/rpsplt_hec.csv +++ /dev/null @@ -1,329 +0,0 @@ -# Real Pulse Shape Plots Lookup Table values for HEC calorimeter - - -# HEC lookup table, amplitude values -HEC_AMPLITUDE -"0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0.000101187f, 0.00664058f, 0.00527695f, 0.0002041f, -0.000215028f, 0.000293915f, 0.000490323f, 0.000903528f, 0.00170435f, -0.00314031f, 0.00552285f, 0.00920343f, 0.0145539f, 0.0219273f, -0.0316359f, 0.043942f, 0.059033f, 0.0770143f, 0.0978915f, -0.121549f, 0.147763f, 0.17623f, 0.206609f, 0.238601f, -0.272f, 0.306696f, 0.342649f, 0.379813f, 0.418056f, -0.457117f, 0.496607f, 0.536044f, 0.57493f, 0.612812f, -0.649334f, 0.684243f, 0.717392f, 0.748708f, 0.778165f, -0.805768f, 0.831539f, 0.85551f, 0.877704f, 0.898131f, -0.916774f, 0.933594f, 0.948547f, 0.961595f, 0.972719f, -0.98191f, 0.989184f, 0.994564f, 0.998103f, 0.99988f, -1f, 0.998581f, 0.995722f, 0.991483f, 0.985877f, -0.978879f, 0.970462f, 0.960624f, 0.949425f, 0.936981f, -0.92346f, 0.909059f, 0.893975f, 0.878385f, 0.862425f, -0.846174f, 0.829654f, 0.812831f, 0.795626f, 0.777953f, -0.759737f, 0.740952f, 0.721636f, 0.701896f, 0.681887f, -0.661787f, 0.64177f, 0.621975f, 0.602503f, 0.583422f, -0.564766f, 0.54655f, 0.528765f, 0.511376f, 0.494318f, -0.477505f, 0.460853f, 0.444298f, 0.427826f, 0.411478f, -0.395336f, 0.379494f, 0.364017f, 0.348923f, 0.334176f, -0.319715f, 0.305481f, 0.291443f, 0.277605f, 0.263994f, -0.250654f, 0.237625f, 0.224942f, 0.21263f, 0.200696f, -0.189132f, 0.177913f, 0.166995f, 0.156325f, 0.145848f, -0.135522f, 0.125326f, 0.115279f, 0.105427f, 0.0958465f, -0.0866154f, 0.0777954f, 0.0694189f, 0.0614767f, 0.0539207f, -0.0466707f, 0.0396293f, 0.0327093f, 0.0258526f, 0.0190475f, -0.0123301f, 0.00576636f, -0.000577978f, -0.00665906f, -0.0124708f, --0.0180326f, -0.023372f, -0.0285029f, -0.0334147f, -0.0380814f, --0.0424744f, -0.0465814f, -0.0504199f, -0.0540364f, -0.0574984f, --0.060883f, -0.0642531f, -0.06764f, -0.0710355f, -0.0743926f, --0.0776445f, -0.0807294f, -0.0836115f, -0.0862943f, -0.0888135f, --0.091227f, -0.0935885f, -0.0959315f, -0.0982592f, -0.100547f, --0.102752f, -0.104836f, -0.106781f, -0.108595f, -0.110316f, --0.112001f, -0.113707f, -0.115471f, -0.117302f, -0.119178f, --0.121058f, -0.122894f, -0.124646f, -0.126288f, -0.127819f, --0.129262f, -0.130658f, -0.132056f, -0.133495f, -0.134988f, --0.136514f, -0.138027f, -0.139477f, -0.140829f, -0.142082f, --0.143263f, -0.144417f, -0.145579f, -0.146758f, -0.147944f, --0.149106f, -0.150203f, -0.151199f, -0.152063f, -0.152785f, --0.153383f, -0.153917f, -0.154483f, -0.155185f, -0.156098f, --0.157233f, -0.158526f, -0.159851f, -0.161065f, -0.162059f, --0.162781f, -0.163253f, -0.163543f, -0.163732f, -0.163889f, --0.164059f, -0.164269f, -0.164541f, -0.1649f, -0.165369f, --0.165963f, -0.166671f, -0.167457f, -0.168261f, -0.169021f, --0.169687f, -0.170237f, -0.170686f, -0.171074f, -0.171449f, --0.171844f, -0.172271f, -0.172716f, -0.173152f, -0.173545f, --0.173864f, -0.174091f, -0.174214f, -0.174244f, -0.174208f, --0.174145f, -0.174091f, -0.174075f, -0.174109f, -0.174199f, --0.174347f, -0.174556f, -0.174822f, -0.175124f, -0.175427f, --0.175685f, -0.175868f, -0.175971f, -0.176023f, -0.17607f, --0.17616f, -0.176313f, -0.176514f, -0.176721f, -0.176879f, --0.176951f, -0.176934f, -0.176855f, -0.17676f, -0.176689f, --0.176655f, -0.176648f, -0.176647f, -0.176639f, -0.176628f, --0.176632f, -0.176673f, -0.176754f, -0.176855f, -0.176936f, --0.176952f, -0.176875f, -0.176706f, -0.17647f, -0.176211f, --0.175972f, -0.175794f, -0.175711f, -0.175755f, -0.175946f, --0.176285f, -0.176742f, -0.177258f, -0.177757f, -0.17817f, --0.17845f, -0.178579f, -0.178566f, -0.178437f, -0.178227f, --0.177974f, -0.177712f, -0.177464f, -0.177238f, -0.177031f, --0.176835f, -0.176652f, -0.176495f, -0.176386f, -0.176349f, --0.176395f, -0.176518f, -0.176694f, -0.176894f, -0.177086f, --0.177248f, -0.177368f, -0.177442f, -0.177475f, -0.177466f, --0.177409f, -0.177287f, -0.177085f, -0.176805f, -0.176481f, --0.176177f, -0.175968f, -0.175917f, -0.176041f, -0.176305f, --0.176639f, -0.176956f, -0.177192f, -0.177313f, -0.177318f, --0.17723f, -0.177084f, -0.176912f, -0.176746f, -0.176605f, --0.176497f, -0.176412f, -0.176339f, -0.176273f, -0.176226f, --0.176224f, -0.176294f, -0.176444f, -0.176653f, -0.176876f, --0.177061f, -0.17717f, -0.177187f, -0.177116f, -0.176969f, --0.17676f, -0.176495f, -0.176185f, -0.175846f, -0.175501f, --0.175181f, -0.174914f, -0.174722f, -0.174603f, -0.174535f, --0.174484f, -0.174419f, -0.174334f, -0.174257f, -0.174241f, --0.174339f, -0.174568f, -0.174897f, -0.175247f, -0.175527f, --0.175668f, -0.175649f, -0.175504f, -0.175302f, -0.175115f, --0.17499f, -0.174941f, -0.174946f, -0.174966f, -0.174962f, --0.174908f, -0.174796f, -0.174638f, -0.174464f, -0.174308f, --0.174196f, -0.174135f, -0.174112f, -0.174105f, -0.174099f, --0.1741f, -0.174129f, -0.174211f, -0.174347f, -0.174508f, --0.174639f, -0.174693f, -0.174653f, -0.174547f, -0.17444f, --0.174397f, -0.17446f, -0.174621f, -0.174834f, -0.175026f, --0.175129f, -0.175111f, -0.174973f, -0.174755f, -0.174506f, --0.174263f, -0.174042f, -0.173832f, -0.173617f, -0.173383f, --0.173135f, -0.172888f, -0.172667f, -0.172506f, -0.172432f, --0.172467f, -0.172611f, -0.172834f, -0.173088f, -0.173314f, --0.173464f, -0.173523f, -0.173511f, -0.173469f, -0.17344f, --0.173454f, -0.173512f, -0.173588f, -0.173645f, -0.173641f, --0.173557f, -0.173396f, -0.173188f, -0.172974f, -0.172789f, --0.172649f, -0.172556f, -0.172492f, -0.17244f, -0.172391f, --0.172346f, -0.17231f, -0.172284f, -0.172267f, -0.172255f, --0.172249f, -0.172253f, -0.172273f, -0.17231f, -0.172352f, --0.172388f, -0.172401f, -0.172379f, -0.172311f, -0.172176f, --0.171942f, -0.171573f, -0.17104f, -0.17034f, -0.169499f, --0.168562f, -0.16757f, -0.166543f, -0.165477f, -0.164352f, --0.163143f, -0.161835f, -0.160427f, -0.158922f, -0.157329f, --0.155643f, -0.153858f, -0.15196f, -0.149937f, -0.147782f, --0.145494f, -0.143082f, -0.14057f, -0.137992f, -0.135393f, --0.132824f, -0.130331f, -0.127944f, -0.12568f, -0.123532f, --0.121472f, -0.119454f, -0.117412f, -0.115278f, -0.112998f, --0.110548f, -0.107945f, -0.105239f, -0.102501f, -0.0997942f, --0.0971684f, -0.0946474f, -0.0922345f, -0.0899178f, -0.087684f, --0.0855244f, -0.0834364f, -0.0814211f, -0.0794707f, -0.0775634f, --0.0756617f, -0.0737202f, -0.0717019f, -0.0695945f, -0.0674152f, --0.0652053f, -0.0630127f, -0.0608754f, -0.0588116f, -0.056822f, --0.0549011f, -0.0530426f, -0.0512422f, -0.049497f, -0.0478024f, --0.0461557f, -0.0445622f, -0.0430403f, -0.0416186f, -0.0403259f, --0.0391799f, -0.0381777f, -0.0372926f, -0.0364776f, -0.0356725f, --0.0348179f, -0.0338654f, -0.0327897f, -0.0315966f, -0.0303215f, --0.0290217f, -0.0277614f, -0.0265938f, -0.0255459f, -0.0246139f, --0.0237676f, -0.0229666f, -0.0221815f, -0.0214062f, -0.0206548f, --0.0199489f, -0.0192999f, -0.0186995f, -0.0181225f, -0.0175376f, --0.0169217f, -0.0162671f, -0.015582f, -0.0148865f, -0.0142068f, --0.013571f, -0.0130013f, -0.0125088f, -0.0120878f, -0.0117106f, --0.0113307f, -0.010896f, -0.0103706f, -0.00975524f, -0.00909709f, --0.00847957f, -0.00799095f, -0.00768947f, -0.00757594f, -0.00759465f, --0.007658f, -0.00768306f, -0.00761927f, -0.00745677f, -0.00721301f, --0.0069087f, -0.00655204f, -0.00613803f, -0.00565728f, -0.0051098f, --0.00451485f, -0.00390879f, -0.00333665f, -0.00284016f, -0.00244591f, --0.00216087f, -0.00197292f, -0.00185468f, -0.00177376f, -0.0017025f, --0.00162463f, -0.00153632f, -0.00144381f, -0.00135502f, -0.00127151f, --0.00118363f, -0.00107486f, -0.000933489f, -0.000765153f, -0.000595878f, --0.000462136f, -0.000391149f, -0.000381636f, -0.00039948f, -0.000392457f, --0.00031506f, -0.000148614f, 9.0048e-05f, 0.00035786f, 0.000604245f, -0.000786303f, 0.000878787f, 0.000875978f, 0.000791694f, 0.000657695f, -0.00051893f, 0.000425818f, 0.000426074f, 0.000551054f, 0.000806885f, -0.00117476f, 0.00161695f, 0.00208652f, 0.00253376f, 0.00290882f, -0.00316028f, 0.00323814f, 0.00310475f, 0.00275044f, 0.00220837f, -0.00155712f, 0.000907431f, 0.000374364f, 4.94567e-05f, -2.10426e-05f, -0.000152468f, 0.000507839f, 0.000947469f, 0.00136192f, 0.00165448f, -0.00176273f, 0.00167267f, 0.00141913f, 0.00107273f, 0.000722145f, -0.000454802f, 0.000340469f, 0.000418315f, 0.000688105f, 0.00110894f, -0.00160413f, 0.00207832f, 0.00244585f, 0.00265788f, 0.0027142f, -0.00265461f, 0.00253537f, 0.00240031f, 0.00226566f, 0.00212575f, -0.00197065f, 0.00180602f, 0.00166146f, 0.00158237f, 0.00160939f, -0.00175419f, 0.00198981f, 0.00225835f, 0.00249251f, 0.00264239f, -0.00268974f, 0.00264634f, 0.00253697f, 0.00238428f, 0.00220657f, -0.00202457f, 0.00187327f, 0.00179975f, 0.00184459f, 0.00201759f, -0.00228424f, 0.00257413f, 0.00280859f, 0.00293672f, 0.00295574f, -0.00290479f, 0.0028433f, 0.00282479f, 0.00288132f, 0.00302619f, -0.00326351f, 0.00359044f, 0.00398678f, 0.00440043f, 0.00474437f, -0.00491837f, 0.00484987f, 0.00453341f, 0.00404398f, 0.00351183f, -0.00306889f, 0.00279655f, 0.00270115f, 0.0027279f, 0.00280162f, -0.00286887f, 0.00291904f, 0.00297615f, 0.00307301f, 0.00322684f, -0.00343021f, 0.00365863f, 0.003885f, 0.00409031f, 0.00426691f, -0.00441451f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f, -0f, 0f, 0f, 0f, 0f" - - -# HEC lookup table, time values -HEC_TIME -"0f, 1.03959f, 2.07917f, 3.11876f, 4.15835f, -5.19794f, 6.23752f, 7.27711f, 8.3167f, 9.35629f, -10.3959f, 11.4355f, 12.475f, 13.5146f, 14.5542f, -15.5938f, 16.6334f, 17.673f, 18.7126f, 19.7522f, -20.7917f, 21.8313f, 22.8709f, 23.9105f, 24.9501f, -25.9897f, 27.0293f, 28.0689f, 29.1084f, 30.148f, -31.1876f, 32.2272f, 33.2668f, 34.3064f, 35.346f, -36.3856f, 37.4251f, 38.4647f, 39.5043f, 40.5439f, -41.5835f, 42.6231f, 43.6627f, 44.7023f, 45.7418f, -46.7814f, 47.821f, 48.8606f, 49.9002f, 50.9398f, -51.9794f, 53.019f, 54.0585f, 55.0981f, 56.1377f, -57.1773f, 58.2169f, 59.2565f, 60.2961f, 61.3357f, -62.3752f, 63.4148f, 64.4544f, 65.494f, 66.5336f, -67.5732f, 68.6128f, 69.6524f, 70.6919f, 71.7315f, -72.7711f, 73.8107f, 74.8503f, 75.8899f, 76.9295f, -77.9691f, 79.0086f, 80.0482f, 81.0878f, 82.1274f, -83.167f, 84.2066f, 85.2462f, 86.2858f, 87.3253f, -88.3649f, 89.4045f, 90.4441f, 91.4837f, 92.5233f, -93.5629f, 94.6025f, 95.642f, 96.6816f, 97.7212f, -98.7608f, 99.8004f, 100.84f, 101.88f, 102.919f, -103.959f, 104.998f, 106.038f, 107.078f, 108.117f, -109.157f, 110.196f, 111.236f, 112.275f, 113.315f, -114.355f, 115.394f, 116.434f, 117.473f, 118.513f, -119.553f, 120.592f, 121.632f, 122.671f, 123.711f, -124.75f, 125.79f, 126.83f, 127.869f, 128.909f, -129.948f, 130.988f, 132.028f, 133.067f, 134.107f, -135.146f, 136.186f, 137.226f, 138.265f, 139.305f, -140.344f, 141.384f, 142.423f, 143.463f, 144.503f, -145.542f, 146.582f, 147.621f, 148.661f, 149.701f, -150.74f, 151.78f, 152.819f, 153.859f, 154.899f, -155.938f, 156.978f, 158.017f, 159.057f, 160.096f, -161.136f, 162.176f, 163.215f, 164.255f, 165.294f, -166.334f, 167.374f, 168.413f, 169.453f, 170.492f, -171.532f, 172.572f, 173.611f, 174.651f, 175.69f, -176.73f, 177.769f, 178.809f, 179.849f, 180.888f, -181.928f, 182.967f, 184.007f, 185.047f, 186.086f, -187.126f, 188.165f, 189.205f, 190.245f, 191.284f, -192.324f, 193.363f, 194.403f, 195.442f, 196.482f, -197.522f, 198.561f, 199.601f, 200.64f, 201.68f, -202.72f, 203.759f, 204.799f, 205.838f, 206.878f, -207.917f, 208.957f, 209.997f, 211.036f, 212.076f, -213.115f, 214.155f, 215.195f, 216.234f, 217.274f, -218.313f, 219.353f, 220.393f, 221.432f, 222.472f, -223.511f, 224.551f, 225.59f, 226.63f, 227.67f, -228.709f, 229.749f, 230.788f, 231.828f, 232.868f, -233.907f, 234.947f, 235.986f, 237.026f, 238.066f, -239.105f, 240.145f, 241.184f, 242.224f, 243.263f, -244.303f, 245.343f, 246.382f, 247.422f, 248.461f, -249.501f, 250.541f, 251.58f, 252.62f, 253.659f, -254.699f, 255.739f, 256.778f, 257.818f, 258.857f, -259.897f, 260.936f, 261.976f, 263.016f, 264.055f, -265.095f, 266.134f, 267.174f, 268.214f, 269.253f, -270.293f, 271.332f, 272.372f, 273.412f, 274.451f, -275.491f, 276.53f, 277.57f, 278.609f, 279.649f, -280.689f, 281.728f, 282.768f, 283.807f, 284.847f, -285.887f, 286.926f, 287.966f, 289.005f, 290.045f, -291.084f, 292.124f, 293.164f, 294.203f, 295.243f, -296.282f, 297.322f, 298.362f, 299.401f, 300.441f, -301.48f, 302.52f, 303.56f, 304.599f, 305.639f, -306.678f, 307.718f, 308.757f, 309.797f, 310.837f, -311.876f, 312.916f, 313.955f, 314.995f, 316.035f, -317.074f, 318.114f, 319.153f, 320.193f, 321.233f, -322.272f, 323.312f, 324.351f, 325.391f, 326.43f, -327.47f, 328.51f, 329.549f, 330.589f, 331.628f, -332.668f, 333.708f, 334.747f, 335.787f, 336.826f, -337.866f, 338.906f, 339.945f, 340.985f, 342.024f, -343.064f, 344.103f, 345.143f, 346.183f, 347.222f, -348.262f, 349.301f, 350.341f, 351.381f, 352.42f, -353.46f, 354.499f, 355.539f, 356.579f, 357.618f, -358.658f, 359.697f, 360.737f, 361.776f, 362.816f, -363.856f, 364.895f, 365.935f, 366.974f, 368.014f, -369.054f, 370.093f, 371.133f, 372.172f, 373.212f, -374.251f, 375.291f, 376.331f, 377.37f, 378.41f, -379.449f, 380.489f, 381.529f, 382.568f, 383.608f, -384.647f, 385.687f, 386.727f, 387.766f, 388.806f, -389.845f, 390.885f, 391.924f, 392.964f, 394.004f, -395.043f, 396.083f, 397.122f, 398.162f, 399.202f, -400.241f, 401.281f, 402.32f, 403.36f, 404.4f, -405.439f, 406.479f, 407.518f, 408.558f, 409.597f, -410.637f, 411.677f, 412.716f, 413.756f, 414.795f, -415.835f, 416.875f, 417.914f, 418.954f, 419.993f, -421.033f, 422.073f, 423.112f, 424.152f, 425.191f, -426.231f, 427.27f, 428.31f, 429.35f, 430.389f, -431.429f, 432.468f, 433.508f, 434.548f, 435.587f, -436.627f, 437.666f, 438.706f, 439.746f, 440.785f, -441.825f, 442.864f, 443.904f, 444.943f, 445.983f, -447.023f, 448.062f, 449.102f, 450.141f, 451.181f, -452.221f, 453.26f, 454.3f, 455.339f, 456.379f, -457.418f, 458.458f, 459.498f, 460.537f, 461.577f, -462.616f, 463.656f, 464.696f, 465.735f, 466.775f, -467.814f, 468.854f, 469.894f, 470.933f, 471.973f, -473.012f, 474.052f, 475.091f, 476.131f, 477.171f, -478.21f, 479.25f, 480.289f, 481.329f, 482.369f, -483.408f, 484.448f, 485.487f, 486.527f, 487.567f, -488.606f, 489.646f, 490.685f, 491.725f, 492.764f, -493.804f, 494.844f, 495.883f, 496.923f, 497.962f, -499.002f, 500.042f, 501.081f, 502.121f, 503.16f, -504.2f, 505.24f, 506.279f, 507.319f, 508.358f, -509.398f, 510.437f, 511.477f, 512.517f, 513.556f, -514.596f, 515.635f, 516.675f, 517.715f, 518.754f, -519.794f, 520.833f, 521.873f, 522.913f, 523.952f, -524.992f, 526.031f, 527.071f, 528.11f, 529.15f, -530.19f, 531.229f, 532.269f, 533.308f, 534.348f, -535.388f, 536.427f, 537.467f, 538.506f, 539.546f, -540.585f, 541.625f, 542.665f, 543.704f, 544.744f, -545.783f, 546.823f, 547.863f, 548.902f, 549.942f, -550.981f, 552.021f, 553.061f, 554.1f, 555.14f, -556.179f, 557.219f, 558.258f, 559.298f, 560.338f, -561.377f, 562.417f, 563.456f, 564.496f, 565.536f, -566.575f, 567.615f, 568.654f, 569.694f, 570.734f, -571.773f, 572.813f, 573.852f, 574.892f, 575.931f, -576.971f, 578.011f, 579.05f, 580.09f, 581.129f, -582.169f, 583.209f, 584.248f, 585.288f, 586.327f, -587.367f, 588.407f, 589.446f, 590.486f, 591.525f, -592.565f, 593.604f, 594.644f, 595.684f, 596.723f, -597.763f, 598.802f, 599.842f, 600.882f, 601.921f, -602.961f, 604f, 605.04f, 606.08f, 607.119f, -608.159f, 609.198f, 610.238f, 611.277f, 612.317f, -613.357f, 614.396f, 615.436f, 616.475f, 617.515f, -618.555f, 619.594f, 620.634f, 621.673f, 622.713f, -623.752f, 624.792f, 625.832f, 626.871f, 627.911f, -628.95f, 629.99f, 631.03f, 632.069f, 633.109f, -634.148f, 635.188f, 636.228f, 637.267f, 638.307f, -639.346f, 640.386f, 641.425f, 642.465f, 643.505f, -644.544f, 645.584f, 646.623f, 647.663f, 648.703f, -649.742f, 650.782f, 651.821f, 652.861f, 653.901f, -654.94f, 655.98f, 657.019f, 658.059f, 659.098f, -660.138f, 661.178f, 662.217f, 663.257f, 664.296f, -665.336f, 666.376f, 667.415f, 668.455f, 669.494f, -670.534f, 671.574f, 672.613f, 673.653f, 674.692f, -675.732f, 676.771f, 677.811f, 678.851f, 679.89f, -680.93f, 681.969f, 683.009f, 684.049f, 685.088f, -686.128f, 687.167f, 688.207f, 689.247f, 690.286f, -691.326f, 692.365f, 693.405f, 694.444f, 695.484f, -696.524f, 697.563f, 698.603f, 699.642f, 700.682f, -701.722f, 702.761f, 703.801f, 704.84f, 705.88f, -706.919f, 707.959f, 708.999f, 710.038f, 711.078f, -712.117f, 713.157f, 714.197f, 715.236f, 716.276f, -717.315f, 718.355f, 719.395f, 720.434f, 721.474f, -722.513f, 723.553f, 724.592f, 725.632f, 726.672f, -727.711f, 728.751f, 729.79f, 730.83f, 731.87f, -732.909f, 733.949f, 734.988f, 736.028f, 737.068f, -738.107f, 739.147f, 740.186f, 741.226f, 742.265f, -743.305f, 744.345f, 745.384f, 746.424f, 747.463f, -748.503f, 749.543f, 750.582f, 751.622f, 752.661f, -753.701f, 754.741f, 755.78f, 756.82f, 757.859f, -758.899f, 759.938f, 760.978f, 762.018f, 763.057f, -764.097f, 765.136f, 766.176f, 767.216f, 768.255f, -769.295f, 770.334f, 771.374f, 772.414f, 773.453f, -774.493f, 775.532f, 776.572f, 777.611f, 778.651f, -779.691f, 780.73f, 781.77f, 782.809f, 783.849f, -784.889f, 785.928f, 786.968f, 788.007f, 789.047f, -790.086f, 791.126f, 792.166f, 793.205f, 794.245f, -795.284f, 796.324f, 797.364f, 798.403f, 799.443f, -800.482f, 801.522f, 802.562f, 803.601f, 804.641f, -805.68f, 806.72f, 807.759f, 808.799f, 809.839f, -810.878f, 811.918f, 812.957f, 813.997f, 815.037f, -816.076f, 817.116f, 818.155f, 819.195f, 820.235f, -821.274f, 822.314f, 823.353f, 824.393f, 825.432f, -826.472f, 827.512f, 828.551f, 829.591f, 830.63f" diff --git a/graphics/AtlantisJava/configuration/rpsplt_tile.csv b/graphics/AtlantisJava/configuration/rpsplt_tile.csv deleted file mode 100644 index 213666c43c9fab6638f5d9a93f8705ff0cb14742..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/configuration/rpsplt_tile.csv +++ /dev/null @@ -1,169 +0,0 @@ -# Real Pulse Shape Plots Lookup Table values for TILE calorimeter - -# TILE, time values -TILE_TIME -"-75.5f, -75f, -74.5f, -74f, -73.5f, --73f, -72.5f, -72f, -71.5f, -71f, --70.5f, -70f, -69.5f, -69f, -68.5f, --68f, -67.5f, -67f, -66.5f, -66f, --65.5f, -65f, -64.5f, -64f, -63.5f, --63f, -62.5f, -62f, -61.5f, -61f, --60.5f, -60f, -59.5f, -59f, -58.5f, --58f, -57.5f, -57f, -56.5f, -56f, --55.5f, -55f, -54.5f, -54f, -53.5f, --53f, -52.5f, -52f, -51.5f, -51f, --50.5f, -50f, -49.5f, -49f, -48.5f, --48f, -47.5f, -47f, -46.5f, -46f, --45.5f, -45f, -44.5f, -44f, -43.5f, --43f, -42.5f, -42f, -41.5f, -41f, --40.5f, -40f, -39.5f, -39f, -38.5f, --38f, -37.5f, -37f, -36.5f, -36f, --35.5f, -35f, -34.5f, -34f, -33.5f, --33f, -32.5f, -32f, -31.5f, -31f, --30.5f, -30f, -29.5f, -29f, -28.5f, --28f, -27.5f, -27f, -26.5f, -26f, --25.5f, -25f, -24.5f, -24f, -23.5f, --23f, -22.5f, -22f, -21.5f, -21f, --20.5f, -20f, -19.5f, -19f, -18.5f, --18f, -17.5f, -17f, -16.5f, -16f, --15.5f, -15f, -14.5f, -14f, -13.5f, --13f, -12.5f, -12f, -11.5f, -11f, --10.5f, -10f, -9.5f, -9f, -8.5f, --8f, -7.5f, -7f, -6.5f, -6f, --5.5f, -5f, -4.5f, -4f, -3.5f, --3f, -2.5f, -2f, -1.5f, -1f, --0.5f, 0f, 0.5f, 1f, 1.5f, -2f, 2.5f, 3f, 3.5f, 4f, -4.5f, 5f, 5.5f, 6f, 6.5f, -7f, 7.5f, 8f, 8.5f, 9f, -9.5f, 10f, 10.5f, 11f, 11.5f, -12f, 12.5f, 13f, 13.5f, 14f, -14.5f, 15f, 15.5f, 16f, 16.5f, -17f, 17.5f, 18f, 18.5f, 19f, -19.5f, 20f, 20.5f, 21f, 21.5f, -22f, 22.5f, 23f, 23.5f, 24f, -24.5f, 25f, 25.5f, 26f, 26.5f, -27f, 27.5f, 28f, 28.5f, 29f, -29.5f, 30f, 30.5f, 31f, 31.5f, -32f, 32.5f, 33f, 33.5f, 34f, -34.5f, 35f, 35.5f, 36f, 36.5f, -37f, 37.5f, 38f, 38.5f, 39f, -39.5f, 40f, 40.5f, 41f, 41.5f, -42f, 42.5f, 43f, 43.5f, 44f, -44.5f, 45f, 45.5f, 46f, 46.5f, -47f, 47.5f, 48f, 48.5f, 49f, -49.5f, 50f, 50.5f, 51f, 51.5f, -52f, 52.5f, 53f, 53.5f, 54f, -54.5f, 55f, 55.5f, 56f, 56.5f, -57f, 57.5f, 58f, 58.5f, 59f, -59.5f, 60f, 60.5f, 61f, 61.5f, -62f, 62.5f, 63f, 63.5f, 64f, -64.5f, 65f, 65.5f, 66f, 66.5f, -67f, 67.5f, 68f, 68.5f, 69f, -69.5f, 70f, 70.5f, 71f, 71.5f, -72f, 72.5f, 73f, 73.5f, 74f, -74.5f, 75f, 75.5f, 76f, 76.5f, -77f, 77.5f, 78f, 78.5f, 79f, -79.5f, 80f, 80.5f, 81f, 81.5f, -82f, 82.5f, 83f, 83.5f, 84f, -84.5f, 85f, 85.5f, 86f, 86.5f, -87f, 87.5f, 88f, 88.5f, 89f, -89.5f, 90f, 90.5f, 91f, 91.5f, -92f, 92.5f, 93f, 93.5f, 94f, -94.5f, 95f, 95.5f, 96f, 96.5f, -97f, 97.5f, 98f, 98.5f, 99f, -99.5f, 100f, 100.5f, 101f, 101.5f, -102f, 102.5f, 103f, 103.5f, 104f, -104.5f, 105f, 105.5f, 106f, 106.5f, -107f, 107.5f, 108f, 108.5f, 109f, -109.5f, 110f, 110.5f, 111f, 111.5f, -112f, 112.5f, 113f, 113.5f, 114f, -114.5f, 115f, 115.5f, 116f, 116.5f, -117f, 117.5f, 118f, 118.5f, 119f, -119.5f, 120f, 120.5f, 121f, 121.5f, -122f, 122.5f, 123f, 123.5f, 124f, -124.5f" - -# TILE, amplitude values -TILE_AMPLITUDE -"0f, 2.304e-05f, 5.178e-05f, 8.592e-05f, 0.00012515f, -0.00016918f, 0.0002177f, 0.00027043f, 0.00032705f, 0.00038728f, -0.00045081f, 0.00051733f, 0.00058656f, 0.00065819f, 0.00073193f, -0.00080746f, 0.0008845f, 0.00096275f, 0.0010419f, 0.00112166f, -0.00120172f, 0.00128179f, 0.00136157f, 0.00144076f, 0.00151905f, -0.00159642f, 0.0016754f, 0.00176001f, 0.00185428f, 0.00196225f, -0.00208795f, 0.00223542f, 0.00240868f, 0.00261177f, 0.00284873f, -0.00312358f, 0.00344037f, 0.00380312f, 0.00421586f, 0.00468264f, -0.00520748f, 0.00579479f, 0.00645263f, 0.00719117f, 0.00802059f, -0.00895106f, 0.00999278f, 0.0111559f, 0.0124507f, 0.0138872f, -0.0154757f, 0.0172264f, 0.0191494f, 0.0212549f, 0.0235531f, -0.0260541f, 0.0287667f, 0.0316991f, 0.0348593f, 0.0382556f, -0.041896f, 0.0457887f, 0.0499419f, 0.0543637f, 0.0590621f, -0.0640455f, 0.0693218f, 0.0748993f, 0.0807861f, 0.0869903f, -0.09352f, 0.100383f, 0.107581f, 0.115115f, 0.122983f, -0.131184f, 0.139719f, 0.148586f, 0.157786f, 0.167316f, -0.177177f, 0.187369f, 0.19789f, 0.208739f, 0.219917f, -0.231423f, 0.243248f, 0.255385f, 0.267822f, 0.28055f, -0.29356f, 0.306842f, 0.320385f, 0.334181f, 0.348219f, -0.362489f, 0.376982f, 0.391688f, 0.406597f, 0.421699f, -0.436986f, 0.452445f, 0.46806f, 0.483808f, 0.499668f, -0.515617f, 0.531635f, 0.547698f, 0.563786f, 0.579876f, -0.595946f, 0.611975f, 0.62794f, 0.64382f, 0.659592f, -0.675236f, 0.69073f, 0.706053f, 0.721186f, 0.736109f, -0.7508f, 0.76524f, 0.779408f, 0.793285f, 0.806849f, -0.82008f, 0.832959f, 0.845464f, 0.857576f, 0.869274f, -0.880538f, 0.891349f, 0.901693f, 0.911564f, 0.920954f, -0.929854f, 0.938257f, 0.946156f, 0.953541f, 0.960406f, -0.966742f, 0.972542f, 0.977798f, 0.982501f, 0.986645f, -0.990222f, 0.993234f, 0.995685f, 0.997581f, 0.998929f, -0.999733f, 1f, 0.999735f, 0.998944f, 0.997632f, -0.995806f, 0.99347f, 0.99063f, 0.987293f, 0.983464f, -0.979148f, 0.974352f, 0.969089f, 0.963376f, 0.957231f, -0.95067f, 0.943711f, 0.936371f, 0.928666f, 0.920615f, -0.912235f, 0.903542f, 0.894553f, 0.885287f, 0.875759f, -0.865988f, 0.855985f, 0.845763f, 0.835332f, 0.824704f, -0.81389f, 0.8029f, 0.791746f, 0.780439f, 0.768991f, -0.757412f, 0.745713f, 0.733906f, 0.722002f, 0.710012f, -0.697947f, 0.685818f, 0.673635f, 0.66141f, 0.649153f, -0.636873f, 0.624581f, 0.612288f, 0.600004f, 0.587739f, -0.575503f, 0.563307f, 0.551161f, 0.539076f, 0.527062f, -0.515129f, 0.503286f, 0.491542f, 0.479906f, 0.468386f, -0.456991f, 0.445729f, 0.434609f, 0.42364f, 0.412831f, -0.402189f, 0.391724f, 0.381444f, 0.371358f, 0.361474f, -0.351802f, 0.342348f, 0.333115f, 0.3241f, 0.315301f, -0.306715f, 0.298339f, 0.290172f, 0.282211f, 0.274453f, -0.266897f, 0.259539f, 0.252377f, 0.245409f, 0.238632f, -0.232044f, 0.225642f, 0.219421f, 0.213379f, 0.207511f, -0.201813f, 0.196283f, 0.190915f, 0.185707f, 0.180655f, -0.175755f, 0.171003f, 0.166395f, 0.161928f, 0.157598f, -0.153402f, 0.149335f, 0.145394f, 0.141575f, 0.137874f, -0.134288f, 0.130813f, 0.127445f, 0.12418f, 0.121015f, -0.117947f, 0.11497f, 0.112082f, 0.109278f, 0.106556f, -0.103911f, 0.10134f, 0.0988427f, 0.0964156f, 0.0940569f, -0.0917646f, 0.0895367f, 0.0873709f, 0.0852652f, 0.0832176f, -0.0812259f, 0.0792881f, 0.0774021f, 0.0755657f, 0.0737769f, -0.0720337f, 0.0703338f, 0.0686753f, 0.0670561f, 0.065474f, -0.0639269f, 0.0624129f, 0.0609298f, 0.0594755f, 0.0580479f, -0.0566449f, 0.0552645f, 0.0539046f, 0.052563f, 0.0512377f, -0.0499268f, 0.0486296f, 0.0473466f, 0.0460778f, 0.0448235f, -0.0435841f, 0.0423598f, 0.0411508f, 0.0399573f, 0.0387798f, -0.0376183f, 0.0364732f, 0.0353447f, 0.0342331f, 0.0331386f, -0.0320615f, 0.0310021f, 0.0299605f, 0.0289372f, 0.0279322f, -0.0269459f, 0.0259786f, 0.0250305f, 0.0241018f, 0.0231928f, -0.0223038f, 0.021435f, 0.0205867f, 0.0197591f, 0.0189525f, -0.0181671f, 0.017403f, 0.01666f, 0.0159379f, 0.0152367f, -0.0145562f, 0.0138962f, 0.0132567f, 0.0126374f, 0.0120383f, -0.0114592f, 0.0109f, 0.0103606f, 0.00984081f, 0.00934049f, -0.00885952f, 0.00839776f, 0.00795509f, 0.00753137f, 0.00712647f, -0.00674024f, 0.00637256f, 0.0060233f, 0.00569231f, 0.00537947f, -0.00508463f, 0.00480767f, 0.00454845f, 0.00430684f, 0.0040827f, -0.00387587f, 0.00368583f, 0.00351191f, 0.00335339f, 0.0032096f, -0.00307982f, 0.00296336f, 0.00285953f, 0.00276764f, 0.00268698f, -0.00261686f, 0.00255658f, 0.00250545f, 0.00246277f, 0.00242785f, -0.00239998f, 0.00237849f, 0.00236265f, 0.00235179f, 0.00234521f, -0.0023422f, 0.00234208f, 0.00234415f, 0.0023477f, 0.00235206f, -0.00235651f, 0.00236036f, 0.00236293f, 0.0023635f, 0.00236139f, -0.00235594f, 0.00234693f, 0.00233436f, 0.00231825f, 0.00229862f, -0.00227549f, 0.00224886f, 0.00221876f, 0.0021852f, 0.00214819f, -0.00210775f, 0.0020639f, 0.00201666f, 0.00196603f, 0.00191204f, -0.0018547f" diff --git a/graphics/AtlantisJava/events/event.dtd b/graphics/AtlantisJava/events/event.dtd deleted file mode 100755 index e9937b30976ee0d9d75d92b0a3d3fa54aa143085..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/events/event.dtd +++ /dev/null @@ -1,506 +0,0 @@ -<!-- -kine element is alias to barcode resp. to new-style truth association - using barcodes + numBarcodes (1 hits - to more tracks) at hits - (2006/08), kine should be removed completely on turn 2006/2007 ---> - -<!ENTITY % string.Type "CDATA"> - -<!ENTITY % eventAttributes - "version %string.Type; #IMPLIED - runNumber %string.Type; #IMPLIED - eventNumber %string.Type; #IMPLIED - dateTime %string.Type; #IMPLIED - lumiBlock %string.Type; #IMPLIED - eventProperties %string.Type; #IMPLIED"> - - -<!ELEMENT Event - (BJet|CaloETMis|Cluster|CompositeParticle|CSC|CSCD|Electron|EmTauROI| - ETMis|FCAL|HEC|IDScan|iPat|Jet|JetROI|LAr|LVL1JetElement|LVL1Result| - LVL1TriggerTower|MBTS|MDT|MSeg|Muon|MuonETMis|MuonROI|ParticleJet| - Photon|PixelRDO|RMTr|RPC|RTr|RVx|S3D|SCTRDO|Segment|SiHit|SMTr|STC|STr| - TauJet|TGC|TILE|Track|TrigS3D|TriggerInfo|TRT|xKal)+> -<!ATTLIST Event %eventAttributes;> - -<!ENTITY % attributes 'count CDATA "" storeGateKey CDATA ""'> - -<!ENTITY % type 'type (FLOAT|INT|STRING) #FIXED'> -<!ENTITY % unit 'unit (NONE | CM | RAD | GEV)'> -<!ENTITY % integer - ' %type; "INT" - multiple CDATA "1" - %unit; "NONE" '> -<!ENTITY % float - ' %type; "FLOAT" - multiple CDATA "1" - %unit; "NONE" '> -<!ENTITY % string - ' %type; "STRING" - multiple CDATA "1" - %unit; "NONE" '> - -<!ELEMENT BJet (charge|clusterIndex|clusterKey|clusterLinkCount|energy| - eta|label|lhSig|mass|phi|pt|secVtxCount|secVtxFitProb|secVtxMass| - secVtxMult|secVtxRPhiDist|secVtxTagLh|secVtxTagLhErr| - trackIndex|trackKey|trackLinkCount|weight)+> -<!ATTLIST BJet %attributes;> - -<!ELEMENT CaloETMis (et|etx|ety)+> -<!ATTLIST CaloETMis %attributes;> - -<!ELEMENT Cluster (cells|energy|emfrac|et|eta|id|numCells|phi)+> -<!ATTLIST Cluster %attributes;> - -<!ELEMENT CompositeParticle (author|charge|dataType|daughterIndex|daughterKey| - daughterPdgId|eta|label|pdgId|phi|pt|typeEV)+> -<!ATTLIST CompositeParticle %attributes;> - -<!ELEMENT CSC (barcode|hitsFull|id|identifier|kine|length|numHits|sigma| - x|y|z)+> -<!ATTLIST CSC %attributes;> - -<!ELEMENT CSCD (barcode|charge|id|identifier|kine|length|x|y|z)+> -<!ATTLIST CSCD %attributes;> - -<!ELEMENT Electron (author|clusterIndex|clusterKey|clusterLinkCount|dataType| - emWeight|eOverp|et37|eta|etCone|etCone20|etHad1|f1|fracs1| - hasTrack|hitsBLayer|hitsHighThresTRT|hitsPixel|hitsSCT| - hitsTRT|isEM|isEMString|pdgId|phi|pionWeight|pt|trackIndex|trackKey| - trackLinkCount)+> -<!ATTLIST Electron %attributes;> - -<!ELEMENT EmTauROI (energy|energyEM|energyTAU|eta|phi|roiWord|thrPattern)+> -<!ATTLIST EmTauROI %attributes;> - -<!ELEMENT ETMis (et|etx|ety)+> -<!ATTLIST ETMis %attributes;> - -<!ELEMENT FCAL (adc2Mev|adcCounts|cluster|dx|dy|energy|id|layer|sub| - x|y|channel|feedThrough|slot)+> -<!ATTLIST FCAL %attributes;> - -<!ELEMENT HEC (adc2Mev|adcCounts|energy|eta|id|layer|phi|sub| - cluster|channel|feedThrough|slot)+> -<!ATTLIST HEC %attributes;> - -<!ELEMENT IDScan (barcode|chi2|cotTheta|covMatrix|d0|hits|id|numHits| - phi0|pt|z0)+> -<!ATTLIST IDScan %attributes;> - -<!ELEMENT InDetSegment (hits|numHits|phi|theta|x|y|z)+> -<!ATTLIST InDetSegment %attributes;> - -<!ELEMENT iPat (barcode|chi2|cotTheta|covMatrix|d0|hits| - id|kine|numHits|numPolyline|phi0|polylineX|polylineY| - polylineZ|pt|z0)+> -<!ATTLIST iPat %attributes;> - -<!-- cluster should be an array of calo Cluster IDs, but it's not provided in - the event files nor any processing exists in the Jet handling code --> -<!ELEMENT Jet (OutOfTimeEfrac|bTagName|bTagValue|cells|cluster|clusterIndex|clusterKey|clusterLinkCount| - emfrac|et|eta|fcorCell|fcorDotx|fcorJet|fcorJetForCell|fracSamplingMax|hecf| - isBad|isGood|isUgly|n90cells|n90const|nbadcells|id|jvf|numCells|phi|pt| - quality|qualityLAr|qualityTile|sMax|tileGap3f|time|timeClusters|trackIndex|trackKey| - trackLinkCount|mass|px|py|pz)+> -<!ATTLIST Jet %attributes;> - -<!ELEMENT JetROI (energy|eta|phi)+> -<!ATTLIST JetROI %attributes;> - -<!ELEMENT LAr (adc2Mev|adcCounts|BadCell|cellGain|cellPedestal|cellTime|cluster| - energy|eta|id|layer|phi|sub|channel|feedThrough|slot)+> -<!ATTLIST LAr %attributes;> - -<!ELEMENT LVL1JetElement (energy|eta|phi)+> -<!ATTLIST LVL1JetElement %attributes;> - -<!ELEMENT LVL1Result (ctpItemList|ctpWord0|ctpWord1|ctpWord2| - energyEtMiss|energyEx|energyEy|energySumEt| - itemListEF|itemListL2|passedEF|passedL1|passedL2| - passedTrigger|prescaleListEF|prescaleListL1|prescaleListL2)+> -<!ATTLIST LVL1Result %attributes;> - -<!ELEMENT LVL1TriggerTower (emADC|emBCID|emEnergy|eta|hadADC|hadBCID|hadEnergy| - isEMSaturated|isHadSaturated|numADC|phi|sumEnergy)+> -<!ATTLIST LVL1TriggerTower %attributes;> - -<!ELEMENT MBTS (channel|energy|eta|label|module|phi|quality|sampling|time|type| - adcCounts|cellPedestal|cellRawAmplitude|cellRawTime)+> -<!ATTLIST MBTS %attributes;> - -<!ELEMENT MDT (barcode|driftR|id|identifier|kine|length|x|y|z)+> -<!ATTLIST MDT %attributes;> - -<!ELEMENT MSeg (cotTheta|hits|numHits|phi0|x|y|z)+> -<!ATTLIST MSeg %attributes;> - -<!ELEMENT Muon (author|chi2|dataType|eta|etConeIsol|pdgId|phi|pt| - trackIndex|trackKey|trackLinkCount)+> -<!ATTLIST Muon %attributes;> - -<!ELEMENT MuonETMis (et|etx|ety)+> -<!ATTLIST MuonETMis %attributes;> - -<!ELEMENT MuonROI (energy|eta|phi|roiWord|thrName|thrNumber|thrValue)+> -<!ATTLIST MuonROI %attributes;> - -<!ELEMENT MuonSegment (hits|numHits|phi|theta|x|y|z)+> -<!ATTLIST MuonSegment %attributes;> - -<!ELEMENT ParticleJet (cells|cluster|et|eta|id|numCells|phi|pt)+> -<!ATTLIST ParticleJet %attributes;> - -<!ELEMENT PixCluster (barcode|barcodes|eloss|etaModule|id|numBarcodes| - phiModule|widthx|widthy|x0|y0|z0)+> -<!ATTLIST PixCluster %attributes;> - -<!ELEMENT Photon (clusterIndex|clusterKey|clusterLinkCount|emWeight|et37| - eta|etCone|etHad1|f1|fracs1|isEM|isEMString|phi|pionWeight|pt)+> -<!ATTLIST Photon %attributes;> - -<!-- PixelRDO - object derived from S3D --> -<!ELEMENT PixelRDO (etaModule|id|phiModule|x|y|z)+> -<!ATTLIST PixelRDO %attributes;> - -<!ELEMENT RMTr (barcode|cotTheta|hits|hitsFull|id|kine|numHits| - numPolyline|phi0|polylineX|polylineY|polylineZ|pt| - x|y|z)+> -<!ATTLIST RMTr %attributes;> - -<!ELEMENT RPC (barcode|id|identifier|kine|length|width|x|y|z)+> -<!ATTLIST RPC %attributes;> - -<!ELEMENT RTr (barcode|chi2|cotTheta|covMatrix|d0|kine|phi0|pt|z0)+> -<!ATTLIST RTr %attributes;> - -<!ELEMENT RVx (chi2|covMatrix|numTracks|vertexType|primVxCand| - sgkey|tracks|x|y|z)+> -<!ATTLIST RVx %attributes;> - -<!ELEMENT S3D (barcode|barcodes|clusters|etaModule|kine|numBarcodes|phi| - phiModule|rho|x|y|z)+> -<!ATTLIST S3D %attributes;> - -<!-- SCTRDO - object derived from STC (SiCluster) --> -<!ELEMENT SCTRDO (BCIDError|etaModule|firstHitError|formatterError|id| - lvl1Error|phiModule|preambleError|secondHitError| - syncError|timeBin|x0|x1|y0|y1|z0|z1)+> -<!ATTLIST SCTRDO %attributes;> - -<!ELEMENT Segment (hits|numHits|phi|theta|x|y|z)+> -<!ATTLIST Segment %attributes;> - -<!ELEMENT SiHit (energyloss|trackid|x|y|z)+> -<!ATTLIST SiHit %attributes;> - -<!ELEMENT SMTr (barcode|cotTheta|id|kine|phi0|pt|x|y|z)+> -<!ATTLIST SMTr %attributes;> - -<!ELEMENT STC (barcode|barcodes|etaModule|id|kine|numBarcodes| - phiModule|widthside|x0|x1|y0|y1|z0|z1)+> -<!ATTLIST STC %attributes;> - -<!ELEMENT STr (barcode|code|eta|id|phi|phiEndVertex|phiVertex|pt| - rhoEndVertex|rhoVertex|zVertex|zEndVertex)+> -<!ATTLIST STr %attributes;> - -<!ELEMENT TauJet (author|charge|clusterIndex|clusterKey|clusterLinkCount| - emRadius|eta|etEMCalib|etHadCalib|isolFrac|isTau|isTauString| - logLhRatio|numTracks|phi|pt|stripWidth|trackIndex| - trackKey|trackLinkCount)+> -<!ATTLIST TauJet %attributes;> - -<!ELEMENT TGC (barcode|id|identifier|kine|length|lwidth|swidth| - x|y|z)+> -<!ATTLIST TGC %attributes;> - -<!ELEMENT TILE (adcCounts1|adcCounts2|BadCell|cluster|energy|eta|id|layer|phi| - pmt1Chi2|pmt1Energy|pmt1Gain|pmt1Number|pmt1Pedestal| - pmt1Time|pmt2Chi2|pmt2Energy|pmt2Gain|pmt2Number| - pmt2Pedestal|pmt2Time|sub|pmt1ADCStatus|pmt2ADCStatus| - pmt1RawTime|pmt2RawTime|pmt1RawAmplitude|pmt2RawAmplitude)+> -<!ATTLIST TILE %attributes;> - -<!ELEMENT Track (author|barcode|chi2|cotTheta|covMatrix|d0|driftSign|hits|id| - isOutlier|kine|numHits|numPolyline|numTsos|phi0|polylineX| - polylineY|polylineZ|pt|tsosDetType|tsosPosR|tsosPullLoc1| - tsosPullLoc2|tsosResLoc1|tsosResLoc2|trackAuthor|z0|numDoF| - nBLayerHits|nPixHits|nSCTHits|nTRTHits)+> -<!ATTLIST Track %attributes;> - -<!ELEMENT TrigS3D (barcodes|cluster|dphi|dr|dz|eta|id|layer|numBarcodes|phi| - r|x|y|z)+> -<!ATTLIST TrigS3D %attributes;> - -<!ELEMENT TriggerInfo (energyEtMiss|energyEx|energyEy|energySumEt| - trigInfoEF|trigInfoExtL1ID|trigInfoL1|trigInfoL2| - trigInfoLvl1Type|trigInfoStatus|trigInfoStreamTag)+> -<!ATTLIST TriggerInfo %attributes;> - -<!ELEMENT TRT (barcode|barcodes|driftR|id|kine|numBarcodes|phi|rhoz|sub| - threshold|noise|bitPattern|timeOverThreshold)+> -<!ATTLIST TRT %attributes;> - -<!ELEMENT xKal (barcode|chi2|cotTheta|covMatrix|d0|hits| - id|numHits|numPolyline|phi0|polylineX|polylineY| - polylineZ|pt|z0)+> -<!ATTLIST xKal %attributes;> - -<!ELEMENT OutOfTimeEfrac (#PCDATA)> <!ATTLIST OutOfTimeEfrac %float;> -<!ELEMENT adc2Mev (#PCDATA)> <!ATTLIST adc2Mev %float;> -<!ELEMENT adcCounts (#PCDATA)> <!ATTLIST adcCounts %integer;> -<!ELEMENT adcCounts1 (#PCDATA)> <!ATTLIST adcCounts1 %integer;> -<!ELEMENT adcCounts2 (#PCDATA)> <!ATTLIST adcCounts2 %integer;> -<!ELEMENT author (#PCDATA)> <!ATTLIST author %string;> -<!ELEMENT BadCell (#PCDATA)> <!ATTLIST BadCell %integer;> -<!ELEMENT barcode (#PCDATA)> <!ATTLIST barcode %integer;> -<!ELEMENT barcodes (#PCDATA)> <!ATTLIST barcodes %integer;> -<!ELEMENT bitPattern (#PCDATA)> <!ATTLIST bitPattern %integer;> -<!ELEMENT BCIDError (#PCDATA)> <!ATTLIST BCIDError %integer;> -<!ELEMENT bTagName (#PCDATA)> <!ATTLIST bTagName %string;> -<!ELEMENT bTagValue (#PCDATA)> <!ATTLIST bTagValue %float;> -<!ELEMENT cellTime (#PCDATA)> <!ATTLIST cellTime %float;> -<!ELEMENT cellGain (#PCDATA)> <!ATTLIST cellGain %integer;> -<!ELEMENT cellPedestal (#PCDATA)> <!ATTLIST cellPedestal %float;> -<!ELEMENT cells (#PCDATA)> <!ATTLIST cells %integer;> -<!ELEMENT channel (#PCDATA)> <!ATTLIST channel %integer;> -<!ELEMENT feedThrough (#PCDATA)> <!ATTLIST feedThrough %integer;> -<!ELEMENT slot (#PCDATA)> <!ATTLIST slot %integer;> -<!ELEMENT charge (#PCDATA)> <!ATTLIST charge %float;> -<!ELEMENT chi2 (#PCDATA)> <!ATTLIST chi2 %float;> -<!ELEMENT cluster (#PCDATA)> <!ATTLIST cluster %integer;> -<!ELEMENT clusters (#PCDATA)> <!ATTLIST clusters %integer;> -<!ELEMENT clusterIndex (#PCDATA)> <!ATTLIST clusterIndex %integer;> -<!ELEMENT clusterKey (#PCDATA)> <!ATTLIST clusterKey %string;> -<!ELEMENT clusterLinkCount (#PCDATA)> <!ATTLIST clusterKey %integer;> -<!ELEMENT code (#PCDATA)> <!ATTLIST code %integer;> -<!ELEMENT cotTheta (#PCDATA)> <!ATTLIST cotTheta %float;> -<!ELEMENT covMatrix (#PCDATA)> <!ATTLIST covMatrix %float;> -<!ELEMENT ctpItemList (#PCDATA)> <!ATTLIST ctpItemList %string;> -<!ELEMENT ctpWord0 (#PCDATA)> <!ATTLIST ctpWord0 %integer;> -<!ELEMENT ctpWord1 (#PCDATA)> <!ATTLIST ctpWord1 %integer;> -<!ELEMENT ctpWord2 (#PCDATA)> <!ATTLIST ctpWord2 %integer;> -<!ELEMENT d0 (#PCDATA)> <!ATTLIST d0 %float;> -<!ELEMENT dataType (#PCDATA)> <!ATTLIST dataType %integer;> -<!ELEMENT daughterIndex (#PCDATA)> <!ATTLIST daughterIndex %integer;> -<!ELEMENT daughterKey (#PCDATA)> <!ATTLIST daughterKey %string;> -<!ELEMENT daughterPdgId (#PCDATA)> <!ATTLIST daughterPdgId %integer;> -<!ELEMENT deta (#PCDATA)> <!ATTLIST deta %float;> -<!ELEMENT dphi (#PCDATA)> <!ATTLIST dphi %float;> -<!ELEMENT dr (#PCDATA)> <!ATTLIST dr %float;> -<!ELEMENT driftR (#PCDATA)> <!ATTLIST driftR %float;> -<!ELEMENT driftSign (#PCDATA)> <!ATTLIST driftSign %integer;> -<!ELEMENT dx (#PCDATA)> <!ATTLIST dx %float;> -<!ELEMENT dy (#PCDATA)> <!ATTLIST dy %float;> -<!ELEMENT dz (#PCDATA)> <!ATTLIST dz %float;> -<!ELEMENT eloss (#PCDATA)> <!ATTLIST eloss %float;> -<!ELEMENT emfrac (#PCDATA)> <!ATTLIST emfrac %float;> -<!ELEMENT emADC (#PCDATA)> <!ATTLIST emADC %integer;> -<!ELEMENT emBCID (#PCDATA)> <!ATTLIST emBCID %integer;> -<!ELEMENT emEnergy (#PCDATA)> <!ATTLIST emEnergy %float;> -<!ELEMENT emRadius (#PCDATA)> <!ATTLIST emRadius %float;> -<!ELEMENT emWeight (#PCDATA)> <!ATTLIST emWeight %float;> -<!ELEMENT energy (#PCDATA)> <!ATTLIST energy %float;> -<!ELEMENT energyEM (#PCDATA)> <!ATTLIST energyEM %float;> -<!ELEMENT energyTAU (#PCDATA)> <!ATTLIST energyTAU %float;> -<!ELEMENT energyEtMiss (#PCDATA)> <!ATTLIST energyEtMiss %float;> -<!ELEMENT energyEx (#PCDATA)> <!ATTLIST energyEx %float;> -<!ELEMENT energyEy (#PCDATA)> <!ATTLIST energyEy %float;> -<!ELEMENT energyloss (#PCDATA)> <!ATTLIST energyloss %float;> -<!ELEMENT energySumEt (#PCDATA)> <!ATTLIST energySumEt %float;> -<!ELEMENT eOverp (#PCDATA)> <!ATTLIST eOverp %float;> -<!ELEMENT et (#PCDATA)> <!ATTLIST et %float;> -<!ELEMENT et37 (#PCDATA)> <!ATTLIST et37 %float;> -<!ELEMENT eta (#PCDATA)> <!ATTLIST eta %float;> -<!ELEMENT etaModule (#PCDATA)> <!ATTLIST etaModule %integer;> -<!ELEMENT etCone (#PCDATA)> <!ATTLIST etCone %float;> -<!ELEMENT etCone20 (#PCDATA)> <!ATTLIST etCone20 %float;> -<!ELEMENT etEMCalib (#PCDATA)> <!ATTLIST etEMCalib %float;> -<!ELEMENT etHad1 (#PCDATA)> <!ATTLIST etHad1 %float;> -<!ELEMENT etHadCalib (#PCDATA)> <!ATTLIST etHadCalib %float;> -<!ELEMENT etx (#PCDATA)> <!ATTLIST etx %float;> -<!ELEMENT ety (#PCDATA)> <!ATTLIST ety %float;> -<!ELEMENT etConeIsol (#PCDATA)> <!ATTLIST etConeIsol %float;> -<!ELEMENT f1 (#PCDATA)> <!ATTLIST f1 %float;> -<!ELEMENT firstHitError (#PCDATA)> <!ATTLIST firstHitError %integer;> -<!ELEMENT fcorCell (#PCDATA)> <!ATTLIST fcorCell %float;> -<!ELEMENT fcorDotx (#PCDATA)> <!ATTLIST fcorDotx %float;> -<!ELEMENT fcorJet (#PCDATA)> <!ATTLIST fcorJet %float;> -<!ELEMENT fcorJetForCell (#PCDATA)> <!ATTLIST fcorJetForCell %float;> -<!ELEMENT formatterError (#PCDATA)> <!ATTLIST formatterError %integer;> -<!ELEMENT fracs1 (#PCDATA)> <!ATTLIST fracs1 %float;> -<!ELEMENT fracSamplingMax (#PCDATA)> <!ATTLIST fracSamplingMax %float;> -<!ELEMENT hadADC (#PCDATA)> <!ATTLIST hadADC %integer;> -<!ELEMENT hadBCID (#PCDATA)> <!ATTLIST hadBCID %integer;> -<!ELEMENT hadEnergy (#PCDATA)> <!ATTLIST hadEnergy %float;> -<!ELEMENT hasTrack (#PCDATA)> <!ATTLIST hasTrack %integer;> -<!ELEMENT hecf (#PCDATA)> <!ATTLIST hecf %float;> -<!ELEMENT hits (#PCDATA)> <!ATTLIST hits %integer;> -<!ELEMENT hitsBLayer (#PCDATA)> <!ATTLIST hitsBLayer %integer;> -<!ELEMENT hitsFull (#PCDATA)> <!ATTLIST hitsFull %string;> -<!ELEMENT hitsHighThresTRT (#PCDATA)> <!ATTLIST hitsHighThresTRT %integer;> -<!ELEMENT hitsPixel (#PCDATA)> <!ATTLIST hitsPixel %integer;> -<!ELEMENT hitsSCT (#PCDATA)> <!ATTLIST hitsSCT %integer;> -<!ELEMENT hitsTRT (#PCDATA)> <!ATTLIST hitsTRT %integer;> -<!ELEMENT id (#PCDATA)> <!ATTLIST id %integer;> -<!ELEMENT identifier (#PCDATA)> <!ATTLIST identifier %string;> -<!ELEMENT isBad (#PCDATA)> <!ATTLIST isBad %float;> -<!ELEMENT isEM (#PCDATA)> <!ATTLIST isEM %integer;> -<!ELEMENT isEMString (#PCDATA)> <!ATTLIST isEMString %string;> -<!ELEMENT isEMSaturated (#PCDATA)> <!ATTLIST isEMSaturated %integer;> -<!ELEMENT isGood (#PCDATA)> <!ATTLIST isGood %float;> -<!ELEMENT isHadSaturated (#PCDATA)> <!ATTLIST isHadSaturated %integer;> -<!ELEMENT isTau (#PCDATA)> <!ATTLIST isTau %integer;> -<!ELEMENT isTauString (#PCDATA)> <!ATTLIST isTauString %string;> -<!ELEMENT isUgly (#PCDATA)> <!ATTLIST isUgly %float;> -<!ELEMENT isolated (#PCDATA)> <!ATTLIST isolated %integer;> -<!ELEMENT isolFrac (#PCDATA)> <!ATTLIST isolFrac %float;> -<!ELEMENT isOutlier (#PCDATA)> <!ATTLIST isOutlier %integer;> -<!ELEMENT itemListEF (#PCDATA)> <!ATTLIST itemListEF %string;> -<!ELEMENT itemListL2 (#PCDATA)> <!ATTLIST itemListL2 %string;> -<!ELEMENT jvf (#PCDATA)> <!ATTLIST jvf %float;> -<!ELEMENT kine (#PCDATA)> <!ATTLIST kine %integer;> -<!ELEMENT label (#PCDATA)> <!ATTLIST label %string;> -<!ELEMENT layer (#PCDATA)> <!ATTLIST layer %integer;> -<!ELEMENT length (#PCDATA)> <!ATTLIST length %float;> -<!ELEMENT lhSig (#PCDATA)> <!ATTLIST lhSig %float;> -<!ELEMENT logLhRatio (#PCDATA)> <!ATTLIST logLhRatio %float;> -<!ELEMENT lvl1Error (#PCDATA)> <!ATTLIST lvl1Error %integer;> -<!ELEMENT lwidth (#PCDATA)> <!ATTLIST lwidth %float; > -<!ELEMENT mass (#PCDATA)> <!ATTLIST mass %float;> -<!ELEMENT module (#PCDATA)> <!ATTLIST module %integer;> -<!ELEMENT nbadcells (#PCDATA)> <!ATTLIST nbadcells %integer;> -<!ELEMENT noise (#PCDATA)> <!ATTLIST noise %integer;> -<!ELEMENT nBLayerHits (#PCDATA)> <!ATTLIST nBLayerHits %integer;> -<!ELEMENT nPixHits (#PCDATA)> <!ATTLIST nPixHits %integer;> -<!ELEMENT nSCTHits (#PCDATA)> <!ATTLIST nSCTHits %integer;> -<!ELEMENT nTRTHits (#PCDATA)> <!ATTLIST nTRTHits %integer;> -<!ELEMENT n90cells (#PCDATA)> <!ATTLIST n90cells %integer;> -<!ELEMENT n90const (#PCDATA)> <!ATTLIST n90const %integer;> -<!ELEMENT numADC (#PCDATA)> <!ATTLIST numADC %integer;> -<!ELEMENT numBarcodes (#PCDATA)> <!ATTLIST numBarcodes %integer;> -<!ELEMENT numCells (#PCDATA)> <!ATTLIST numCells %integer;> -<!ELEMENT numDoF (#PCDATA)> <!ATTLIST numDoF %integer;> -<!ELEMENT numHits (#PCDATA)> <!ATTLIST numHits %integer;> -<!ELEMENT numPolyline (#PCDATA)> <!ATTLIST numPolyline %integer;> -<!ELEMENT numTracks (#PCDATA)> <!ATTLIST numTracks %integer;> -<!ELEMENT numTsos (#PCDATA)> <!ATTLIST numTsos %integer;> -<!ELEMENT passedEF (#PCDATA)> <!ATTLIST passedEF %integer;> -<!ELEMENT passedL1 (#PCDATA)> <!ATTLIST passedL1 %integer;> -<!ELEMENT passedL2 (#PCDATA)> <!ATTLIST passedL2 %integer;> -<!ELEMENT passedTrigger (#PCDATA)> <!ATTLIST passedTrigger %integer;> -<!ELEMENT pdgId (#PCDATA)> <!ATTLIST pdgId %integer;> -<!ELEMENT phi (#PCDATA)> <!ATTLIST phi %float;> -<!ELEMENT phi0 (#PCDATA)> <!ATTLIST phi0 %float;> -<!ELEMENT phiEndVertex (#PCDATA)> <!ATTLIST phiEndVertex %float;> -<!ELEMENT phiModule (#PCDATA)> <!ATTLIST phiModule %integer;> -<!ELEMENT phiVertex (#PCDATA)> <!ATTLIST phiVertex %float;> -<!ELEMENT pionWeight (#PCDATA)> <!ATTLIST pionWeight %float;> -<!ELEMENT pmt1Energy (#PCDATA)> <!ATTLIST pmt1Energy %float;> -<!ELEMENT pmt2Energy (#PCDATA)> <!ATTLIST pmt2Energy %float;> -<!ELEMENT pmt1Chi2 (#PCDATA)> <!ATTLIST pmt1Chi2 %float;> -<!ELEMENT pmt2Chi2 (#PCDATA)> <!ATTLIST pmt2Chi2 %float;> -<!ELEMENT pmt1Time (#PCDATA)> <!ATTLIST pmt1Time %float;> -<!ELEMENT pmt2Time (#PCDATA)> <!ATTLIST pmt2Time %float;> -<!ELEMENT cellRawAmplitude (#PCDATA)> <!ATTLIST cellRawAmplitude %float;> -<!ELEMENT cellRawTime (#PCDATA)> <!ATTLIST cellRawTime %float;> -<!ELEMENT pmt1RawTime (#PCDATA)> <!ATTLIST pmt1RawTime %float;> -<!ELEMENT pmt2RawTime (#PCDATA)> <!ATTLIST pmt2RawTime %float;> -<!ELEMENT pmt1RawAmplitude (#PCDATA)> <!ATTLIST pmt1RawAmplitude %float;> -<!ELEMENT pmt2RawAmplitude (#PCDATA)> <!ATTLIST pmt2RawAmplitude %float;> -<!ELEMENT pmt1Gain (#PCDATA)> <!ATTLIST pmt1Gain %integer;> -<!ELEMENT pmt2Gain (#PCDATA)> <!ATTLIST pmt2Gain %integer;> -<!ELEMENT pmt1Pedestal (#PCDATA)> <!ATTLIST pmt1Pedestal %float;> -<!ELEMENT pmt2Pedestal (#PCDATA)> <!ATTLIST pmt2Pedestal %float;> -<!ELEMENT pmt1Number (#PCDATA)> <!ATTLIST pmt1Number %integer;> -<!ELEMENT pmt2Number (#PCDATA)> <!ATTLIST pmt2Number %integer;> -<!ELEMENT pmt1ADCStatus (#PCDATA)> <!ATTLIST pmt1ADCStatus %integer;> -<!ELEMENT pmt2ADCStatus (#PCDATA)> <!ATTLIST pmt2ADCStatus %integer;> -<!ELEMENT polylineX (#PCDATA)> <!ATTLIST polylineX %float;> -<!ELEMENT polylineY (#PCDATA)> <!ATTLIST polylineY %float;> -<!ELEMENT polylineZ (#PCDATA)> <!ATTLIST polylineZ %float;> -<!ELEMENT preambleError (#PCDATA)> <!ATTLIST preambleError %integer;> -<!ELEMENT prescaleListEF (#PCDATA)> <!ATTLIST prescaleListEF %string;> -<!ELEMENT prescaleListL1 (#PCDATA)> <!ATTLIST prescaleListL1 %string;> -<!ELEMENT prescaleListL2 (#PCDATA)> <!ATTLIST prescaleListL2 %string;> -<!ELEMENT vertexType (#PCDATA)> <!ATTLIST vertexType %integer;> -<!ELEMENT primVxCand (#PCDATA)> <!ATTLIST primVxCand %integer;> -<!ELEMENT pt (#PCDATA)> <!ATTLIST pt %float;> -<!ELEMENT px (#PCDATA)> <!ATTLIST px %float;> -<!ELEMENT py (#PCDATA)> <!ATTLIST py %float;> -<!ELEMENT pz (#PCDATA)> <!ATTLIST pz %float;> -<!ELEMENT quality (#PCDATA)> <!ATTLIST quality %float;> -<!ELEMENT qualityLAr (#PCDATA)> <!ATTLIST qualityLAr %float;> -<!ELEMENT qualityTile (#PCDATA)> <!ATTLIST qualityTile %float;> -<!ELEMENT r (#PCDATA)> <!ATTLIST r %float;> -<!ELEMENT rho (#PCDATA)> <!ATTLIST rho %float;> -<!ELEMENT rhoEndVertex (#PCDATA)> <!ATTLIST rhoEndVertex %float;> -<!ELEMENT rhoVertex (#PCDATA)> <!ATTLIST rhoVertex %float;> -<!ELEMENT rhoz (#PCDATA)> <!ATTLIST rhoz %float;> -<!ELEMENT roiWord (#PCDATA)> <!ATTLIST roiWord %float;> -<!ELEMENT sampling (#PCDATA)> <!ATTLIST sampling %integer;> -<!ELEMENT secondHitError (#PCDATA)> <!ATTLIST secondHitError %integer;> -<!ELEMENT secVtxCount (#PCDATA)> <!ATTLIST secVtxCount %float;> -<!ELEMENT secVtxFitProb (#PCDATA)> <!ATTLIST secVtxFitProb %float;> -<!ELEMENT secVtxMass (#PCDATA)> <!ATTLIST secVtxMass %float;> -<!ELEMENT secVtxMult (#PCDATA)> <!ATTLIST secVtxMult %integer;> -<!ELEMENT secVtxRPhiDist (#PCDATA)> <!ATTLIST secVtxRPhiDist %float;> -<!ELEMENT secVtxTagLh (#PCDATA)> <!ATTLIST secVtxTagLh %float;> -<!ELEMENT secVtxTagLhErr (#PCDATA)> <!ATTLIST secVtxTagLhErr %float;> -<!ELEMENT sgkey (#PCDATA)> <!ATTLIST sgkey %string;> -<!ELEMENT side (#PCDATA)> <!ATTLIST side %integer;> -<!ELEMENT sigma (#PCDATA)> <!ATTLIST sigma %float;> -<!ELEMENT sMax (#PCDATA)> <!ATTLIST sMax %float;> -<!ELEMENT stripWidth (#PCDATA)> <!ATTLIST stripWidth %float;> -<!ELEMENT sub (#PCDATA)> <!ATTLIST sub %integer;> -<!ELEMENT sumEnergy (#PCDATA)> <!ATTLIST sumEnergy %float;> -<!ELEMENT swidth (#PCDATA)> <!ATTLIST swidth %float;> -<!ELEMENT syncError (#PCDATA)> <!ATTLIST syncError %integer;> -<!ELEMENT theta (#PCDATA)> <!ATTLIST theta %float;> -<!ELEMENT threshold (#PCDATA)> <!ATTLIST threshold %integer;> -<!ELEMENT timeOverThreshold (#PCDATA)> <!ATTLIST timeOverThreshold %float;> -<!ELEMENT thrName (#PCDATA)> <!ATTLIST thrName %string;> -<!ELEMENT thrNumber (#PCDATA)> <!ATTLIST thrNumber %float;> -<!ELEMENT thrValue (#PCDATA)> <!ATTLIST thrValue %float;> -<!ELEMENT thrPattern (#PCDATA)> <!ATTLIST thrPattern %float;> -<!ELEMENT tileGap3f (#PCDATA)> <!ATTLIST tileGap3f %float;> -<!ELEMENT time (#PCDATA)> <!ATTLIST time %float;> -<!ELEMENT timeClusters (#PCDATA)> <!ATTLIST timeClusters %float;> -<!ELEMENT timeBin (#PCDATA)> <!ATTLIST timeBin %integer;> -<!ELEMENT trackAuthor (#PCDATA)> <!ATTLIST trackAuthor %integer;> -<!ELEMENT trackid (#PCDATA)> <!ATTLIST trackid %integer;> -<!ELEMENT trackIndex (#PCDATA)> <!ATTLIST trackIndex %integer;> -<!ELEMENT trackKey (#PCDATA)> <!ATTLIST trackKey %string;> -<!ELEMENT trackLinkCount (#PCDATA)> <!ATTLIST trackLinkCount %integer;> -<!ELEMENT tracks (#PCDATA)> <!ATTLIST tracks %integer;> -<!ELEMENT trigInfoEF (#PCDATA)> <!ATTLIST trigInfoEF %string;> -<!ELEMENT trigInfoExtL1ID (#PCDATA)> <!ATTLIST trigInfoExtL1ID %string;> -<!ELEMENT trigInfoL1 (#PCDATA)> <!ATTLIST trigInfoL1 %string;> -<!ELEMENT trigInfoL2 (#PCDATA)> <!ATTLIST trigInfoL2 %string;> -<!ELEMENT trigInfoLvl1Type (#PCDATA)> <!ATTLIST trigInfoLvl1Type %string;> -<!ELEMENT trigInfoStatus (#PCDATA)> <!ATTLIST trigInfoStatus %string;> -<!ELEMENT trigInfoStreamTag (#PCDATA)> <!ATTLIST trigInfoStreamTag %string;> -<!ELEMENT tsosDetType (#PCDATA)> <!ATTLIST tsosDetType %string;> -<!ELEMENT tsosPosR (#PCDATA)> <!ATTLIST tsosPosR %float;> -<!ELEMENT tsosPullLoc1 (#PCDATA)> <!ATTLIST tsosPullLoc1 %float;> -<!ELEMENT tsosPullLoc2 (#PCDATA)> <!ATTLIST tsosPullLoc2 %float;> -<!ELEMENT tsosResLoc1 (#PCDATA)> <!ATTLIST tsosResLoc1 %float;> -<!ELEMENT tsosResLoc2 (#PCDATA)> <!ATTLIST tsosResLoc2 %float;> -<!ELEMENT type (#PCDATA)> <!ATTLIST type %integer;> -<!ELEMENT typeEV (#PCDATA)> <!ATTLIST typeEV %string;> -<!ELEMENT weight (#PCDATA)> <!ATTLIST weight %float;> -<!ELEMENT width (#PCDATA)> <!ATTLIST width %float;> -<!ELEMENT widthside (#PCDATA)> <!ATTLIST widthside %float;> -<!ELEMENT widthx (#PCDATA)> <!ATTLIST widthx %float;> -<!ELEMENT widthy (#PCDATA)> <!ATTLIST widthy %float;> -<!ELEMENT x (#PCDATA)> <!ATTLIST x %float;> -<!ELEMENT x0 (#PCDATA)> <!ATTLIST x0 %float;> -<!ELEMENT x1 (#PCDATA)> <!ATTLIST x1 %float;> -<!ELEMENT y (#PCDATA)> <!ATTLIST y %float;> -<!ELEMENT y0 (#PCDATA)> <!ATTLIST y0 %float;> -<!ELEMENT y1 (#PCDATA)> <!ATTLIST y1 %float;> -<!ELEMENT z (#PCDATA)> <!ATTLIST z %float;> -<!ELEMENT z0 (#PCDATA)> <!ATTLIST z0 %float;> -<!ELEMENT z1 (#PCDATA)> <!ATTLIST z1 %float;> -<!ELEMENT zEndVertex (#PCDATA)> <!ATTLIST zEndVertex %float;> -<!ELEMENT zVertex (#PCDATA)> <!ATTLIST zVertex %float;> diff --git a/graphics/AtlantisJava/geometry/AGeometry.xml b/graphics/AtlantisJava/geometry/AGeometry.xml deleted file mode 100755 index 0d903668879fb85de943955618e6a68b80bd1fa3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/AGeometry.xml +++ /dev/null @@ -1,233 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE AGeometry [ -<!ELEMENT AGeometry (ADisc | ARectangle | ABarrelCalorimeter | - AEndcapCalorimeter | AGapCalorimeter | - ABarrelSiliconDetector | AEndcapSiliconDetector | - ABarrelTRTDetector | AEndcapTRTDetector)* > -<!ELEMENT ADisc EMPTY > -<!ATTLIST ADisc - p CDATA #REQUIRED - c CDATA #REQUIRED - n CDATA #REQUIRED - rIn CDATA #REQUIRED - rOut CDATA #REQUIRED - nIn CDATA "256" - nOut CDATA "256"> -<!ELEMENT ARectangle EMPTY > -<!ATTLIST ARectangle - p CDATA #REQUIRED - c CDATA #REQUIRED - n CDATA #REQUIRED - xMin CDATA #REQUIRED - xMax CDATA #REQUIRED - yMin CDATA #REQUIRED - yMax CDATA #REQUIRED - xR (YES|NO) "YES" - yR (YES|NO) "YES"> -<!ELEMENT ABarrelCalorimeter EMPTY > -<!ATTLIST ABarrelCalorimeter - c CDATA #REQUIRED - n CDATA #REQUIRED - sampling CDATA #REQUIRED - region CDATA #REQUIRED - rMin CDATA #REQUIRED - rMax CDATA #REQUIRED - zMin CDATA #REQUIRED - zMax CDATA #REQUIRED - eta0 CDATA #REQUIRED - deta CDATA #REQUIRED - neta CDATA #REQUIRED - meta CDATA #REQUIRED - phi0 CDATA #REQUIRED - nphi CDATA #REQUIRED> -<!ELEMENT AEndcapCalorimeter EMPTY > -<!ATTLIST AEndcapCalorimeter - c CDATA #REQUIRED - n CDATA #REQUIRED - sampling CDATA #REQUIRED - region CDATA #REQUIRED - rMin CDATA #REQUIRED - rMax CDATA #REQUIRED - zMin CDATA #REQUIRED - zMax CDATA #REQUIRED - eta0 CDATA #REQUIRED - deta CDATA #REQUIRED - neta CDATA #REQUIRED - meta CDATA #REQUIRED - phi0 CDATA #REQUIRED - nphi CDATA #REQUIRED> -<!ELEMENT AGapCalorimeter EMPTY > -<!ATTLIST AGapCalorimeter - c CDATA #REQUIRED - n CDATA #REQUIRED - sampling CDATA #REQUIRED - region CDATA #REQUIRED - rMin CDATA #REQUIRED - rMax CDATA #REQUIRED - zMin CDATA #REQUIRED - zMax CDATA #REQUIRED - eta CDATA #REQUIRED - phi0 CDATA #REQUIRED - nphi CDATA #REQUIRED> -<!ELEMENT AEndcapCryostat EMPTY > -<!ATTLIST AEndcapCryostat - c CDATA #REQUIRED - n CDATA #REQUIRED - sampling CDATA #REQUIRED - region CDATA #REQUIRED - rMin CDATA #REQUIRED - rMax CDATA #REQUIRED - zMin CDATA #REQUIRED - zMax CDATA #REQUIRED - neta CDATA #REQUIRED - nphi CDATA #REQUIRED> -<!ELEMENT ABarrelSiliconDetector EMPTY > -<!ATTLIST ABarrelSiliconDetector - c CDATA #REQUIRED - n CDATA #REQUIRED - layer CDATA #REQUIRED - length CDATA #REQUIRED - width CDATA #REQUIRED - thickness CDATA #REQUIRED - tilt CDATA #REQUIRED - nz CDATA #REQUIRED - nphi CDATA #REQUIRED - r0 CDATA #REQUIRED - phi0 CDATA #REQUIRED - zMin CDATA #REQUIRED - zMax CDATA #REQUIRED> -<!ELEMENT AEndcapSiliconDetector EMPTY > -<!ATTLIST AEndcapSiliconDetector - c CDATA #REQUIRED - n CDATA #REQUIRED - layer CDATA #REQUIRED - length CDATA #REQUIRED - width CDATA #REQUIRED - thickness CDATA #REQUIRED - nz CDATA #REQUIRED - nphi CDATA #REQUIRED - rMin CDATA #REQUIRED - rMax CDATA #REQUIRED - phi0 CDATA #REQUIRED - zMin CDATA #REQUIRED - zMax CDATA #REQUIRED> -<!ELEMENT ABarrelTRTDetector EMPTY > -<!ATTLIST ABarrelTRTDetector - c CDATA #REQUIRED - n CDATA #REQUIRED - layer CDATA #REQUIRED - nphi CDATA #REQUIRED - rMin CDATA #REQUIRED - rMax CDATA #REQUIRED - phiIn CDATA #REQUIRED - phiOut CDATA #REQUIRED - zMin CDATA #REQUIRED - zMax CDATA #REQUIRED> -<!ELEMENT AEndcapTRTDetector EMPTY > -<!ATTLIST AEndcapTRTDetector - c CDATA #REQUIRED - n CDATA #REQUIRED - layer CDATA #REQUIRED - nphi CDATA #REQUIRED - rMin CDATA #REQUIRED - rMax CDATA #REQUIRED - phi0 CDATA #REQUIRED - zMin CDATA #REQUIRED - zMax CDATA #REQUIRED> -]> - -<AGeometry> -<ABarrelSiliconDetector c="PIX" n="Pixel" layer="0" length="2" width="1.9" thickness="0.270702" tilt="-14.0063" nz="20" nphi="14" r0="3.32803" phi0="22.2819" zMin="-33.6323" zMax="33.6323" /> -<ABarrelSiliconDetector c="PIX" n="Pixel" layer="1" length="6.08" width="1.64" thickness="0.306424" tilt="-19.9962" nz="13" nphi="22" r0="5.10491" phi0="-0.391852" zMin="-40.5702" zMax="40.5702" /> -<ABarrelSiliconDetector c="PIX" n="Pixel" layer="2" length="6.08" width="1.64" thickness="0.307646" tilt="-19.9962" nz="13" nphi="38" r0="8.88103" phi0="-0.12952" zMin="-40.5702" zMax="40.5702" /> -<ABarrelSiliconDetector c="PIX" n="Pixel" layer="3" length="6.08" width="1.64" thickness="0.30793" tilt="-19.9962" nz="13" nphi="52" r0="12.2722" phi0="3.38916" zMin="-40.5702" zMax="40.5702" /> -<AEndcapSiliconDetector c="PIX" n="Pixel" layer="0" length="6.08" width="1.64" thickness="1.51617" nz="1" nphi="48" rMin="8.91479" rMax="14.9795" phi0="3.75" zMin="48.79" zMax="49.79" /> -<AEndcapSiliconDetector c="PIX" n="Pixel" layer="1" length="6.08" width="1.64" thickness="1.51617" nz="1" nphi="48" rMin="8.91479" rMax="14.9795" phi0="3.75" zMin="57.29" zMax="58.29" /> -<AEndcapSiliconDetector c="PIX" n="Pixel" layer="2" length="6.08" width="1.64" thickness="1.51617" nz="1" nphi="48" rMin="8.91479" rMax="14.9795" phi0="3.75" zMin="64.29" zMax="65.29" /> -<ABarrelSiliconDetector c="SIL" n="Silicon" layer="0" length="12.609" width="6.144" thickness="0.83814" tilt="11.0677" nz="6" nphi="32" r0="30.134" phi0="3.24616" zMin="-74.8273" zMax="74.8273" /> -<ABarrelSiliconDetector c="SIL" n="Silicon" layer="1" length="12.609" width="6.144" thickness="0.75531" tilt="11.0546" nz="6" nphi="40" r0="37.2063" phi0="2.63207" zMin="-74.8273" zMax="74.8273" /> -<ABarrelSiliconDetector c="SIL" n="Silicon" layer="2" length="12.609" width="6.144" thickness="0.836751" tilt="11.2967" nz="6" nphi="48" r0="44.4326" phi0="2.10644" zMin="-74.8273" zMax="74.8273" /> -<ABarrelSiliconDetector c="SIL" n="Silicon" layer="3" length="12.609" width="6.144" thickness="0.776445" tilt="11.2902" nz="6" nphi="56" r0="51.4693" phi0="1.80488" zMin="-74.8273" zMax="74.8273" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="0" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="-1.03842" zMin="83.5567" zMax="84.6532" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="0" length="11.77" width="6.31592" thickness="24.099" nz="1" nphi="40" rMin="33.7464" rMax="45.7959" phi0="4.46486" zMin="86.5567" zMax="87.6532" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="1" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="-1.01417" zMin="91.5768" zMax="92.6732" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="1" length="11.77" width="6.31592" thickness="36.6061" nz="2" nphi="40" rMin="27.4929" rMax="45.7959" phi0="4.5" zMin="91.5768" zMax="95.6732" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="2" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="-1.03842" zMin="107.327" zMax="108.423" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="2" length="11.77" width="6.31592" thickness="36.6061" nz="2" nphi="40" rMin="27.4929" rMax="45.7959" phi0="4.46486" zMin="107.327" zMax="111.423" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="3" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="-1.01417" zMin="128.167" zMax="129.263" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="3" length="11.77" width="6.31592" thickness="36.6061" nz="2" nphi="40" rMin="27.4929" rMax="45.7959" phi0="4.5" zMin="128.167" zMax="132.263" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="4" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="-1.03842" zMin="138.147" zMax="139.243" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="4" length="11.77" width="6.31592" thickness="36.6061" nz="2" nphi="40" rMin="27.4929" rMax="45.7959" phi0="4.46486" zMin="138.147" zMax="142.243" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="5" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="-1.01417" zMin="175.317" zMax="176.413" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="5" length="11.77" width="6.31592" thickness="36.6061" nz="2" nphi="40" rMin="27.4929" rMax="45.7959" phi0="4.5" zMin="175.317" zMax="179.413" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="6" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="-1.03842" zMin="209.697" zMax="210.793" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="6" length="11.77" width="6.31592" thickness="24.099" nz="1" nphi="40" rMin="33.7464" rMax="45.7959" phi0="4.46486" zMin="212.697" zMax="213.793" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="7" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="-1.01417" zMin="248.677" zMax="249.773" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="7" length="5.2475" width="6.83547" thickness="11.0247" nz="1" nphi="40" rMin="40.2836" rMax="45.7959" phi0="4.5" zMin="251.677" zMax="252.773" /> -<AEndcapSiliconDetector c="SIL" n="Silicon" layer="8" length="12.1235" width="6.2019" thickness="24.7693" nz="1" nphi="52" rMin="43.8426" rMax="56.2272" phi0="1.01417" zMin="273.747" zMax="274.843" /> -<ABarrelTRTDetector c="TRT" n="TRT" layer="0" nphi="32" rMin="56.7302" rMax="69.8248" phiIn="-6.17382" phiOut="-10.7369" zMin="-70.975" zMax="70.975" /> -<ABarrelTRTDetector c="TRT" n="TRT" layer="1" nphi="32" rMin="70.1346" rMax="86.6458" phiIn="-10.7202" phiOut="-5.99874" zMin="-70.975" zMax="70.975" /> -<ABarrelTRTDetector c="TRT" n="TRT" layer="2" nphi="32" rMin="86.9559" rMax="107.232" phiIn="-6.00171" phiOut="-10.9221" zMin="-70.975" zMax="70.975" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="0" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="85.85" zMax="98.55" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="1" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="100.18" zMax="112.88" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="2" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="114.565" zMax="127.265" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="3" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="128.86" zMax="141.56" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="4" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="143.12" zMax="155.82" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="5" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="157.388" zMax="170.088" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="6" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="175.008" zMax="185.408" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="7" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="187.185" zMax="197.585" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="8" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="199.34" zMax="209.74" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="9" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="211.49" zMax="221.89" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="10" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="223.64" zMax="234.04" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="11" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="235.795" zMax="246.195" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="12" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="247.96" zMax="258.36" /> -<AEndcapTRTDetector c="TRT" n="TRT" layer="13" nphi="34" rMin="64.67" rMax="100.1" phi0="0" zMin="260.083" zMax="270.483" /> -<ADisc p="YX" c="Sol" n="Solenoid" rIn="122.9" rOut="127.4" /> -<ARectangle p="RZ" c="Sol" n="Solenoid" xMin="-265" xMax="265" yMin="122.9" yMax="127.4" xR="NO" /> -<ABarrelCalorimeter c="ECAL" n="LAr Presampler" sampling="0" region="0" rMin="142.173" rMax="143.858" zMin="0" zMax="325.0" eta0="3.1225e-17" deta="0.025" neta="61" meta="0" phi0="-0.175783" nphi="64" /> -<ABarrelCalorimeter c="ECAL" n="LAr" sampling="1" region="0" rMin="148.175" rMax="158" zMin="0" zMax="325.0" eta0="0.003125" deta="0.003125" neta="447" meta="1" phi0="-0.175783" nphi="64" /> -<ABarrelCalorimeter c="ECAL" n="LAr" sampling="1" region="1" rMin="148.175" rMax="158" zMin="0" zMax="325.0" eta0="1.4" deta="0.025" neta="3" meta="0" phi0="-0.175783" nphi="256" /> -<ABarrelCalorimeter c="ECAL" n="LAr" sampling="2" region="0" rMin="158" rMax="184" zMin="0" zMax="325.0" eta0="0.0" deta="0.025" neta="56" meta="0" phi0="-0.175783" nphi="256" /> -<ABarrelCalorimeter c="ECAL" n="LAr" sampling="2" region="1" rMin="158" rMax="184" zMin="0" zMax="325.0" eta0="1.4" deta="0.075" neta="1" meta="0" phi0="-0.175783" nphi="256" /> -<ABarrelCalorimeter c="ECAL" n="LAr" sampling="3" region="0" rMin="184" rMax="198.47" zMin="0" zMax="325.0" eta0="0.0" deta="0.05" neta="27" meta="0" phi0="-0.175783" nphi="256" /> -<AEndcapCalorimeter c="ECAL" n="LAr Endcap Presampler" sampling="0" region="0" rMin="29.0" rMax="203.4" zMin="368.075" zMax="371.425" eta0="1.50988" deta="0.025" neta="12" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="1" region="0" rMin="29.0" rMax="203.4" zMin="375.424" zMax="380.073" eta0="1.38444" deta="0.05" neta="1" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="1" region="1" rMin="29.0" rMax="203.4" zMin="375.424" zMax="380.073" eta0="1.43452" deta="0.025" neta="3" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="1" region="2" rMin="29.0" rMax="203.4" zMin="375.424" zMax="380.073" eta0="1.50965" deta="0.003125" neta="96" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="1" region="3" rMin="29.0" rMax="203.4" zMin="375.424" zMax="380.073" eta0="1.81009" deta="0.00416667" neta="48" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="1" region="4" rMin="29.0" rMax="203.4" zMin="375.424" zMax="380.073" eta0="2.01027" deta="0.00625" neta="64" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="1" region="5" rMin="29.0" rMax="203.4" zMin="375.424" zMax="380.073" eta0="2.41048" deta="0.025" neta="4" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Inner Endcap" sampling="1" region="0" rMin="29.0" rMax="203.4" zMin="375.424" zMax="420.125" eta0="2.51004" deta="0.1" neta="7" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="2" region="0" rMin="29.0" rMax="203.4" zMin="380.073" zMax="424.326" eta0="1.38381" deta="0.05" neta="7" meta="0" phi0="-0.234375" nphi="256" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="2" region="1" rMin="29.0" rMax="203.4" zMin="380.073" zMax="415.624" eta0="1.43388" deta="0.025" neta="43" meta="0" phi0="-0.234375" nphi="256" /> -<AEndcapCalorimeter c="ECAL" n="LAr Inner Endcap" sampling="2" region="0" rMin="29.0" rMax="203.4" zMin="420.125" zMax="424.326" eta0="2.5094" deta="0.1" neta="7" meta="0" phi0="-0.234375" nphi="64" /> -<AEndcapCalorimeter c="ECAL" n="LAr Outer Endcap" sampling="3" region="0" rMin="29.0" rMax="203.4" zMin="415.624" zMax="424.326" eta0="1.50867" deta="0.05" neta="20" meta="0" phi0="-0.234375" nphi="256" /> -<AEndcapCalorimeter c="HCAL" n="HEC" sampling="0" region="0" rMin="37.2" rMax="203.4" zMin="435" zMax="463" eta0="1.50824" deta="0.1" neta="10" meta="0" phi0="0" nphi="64" /> -<AEndcapCalorimeter c="HCAL" n="HEC" sampling="0" region="1" rMin="37.2" rMax="203.4" zMin="435" zMax="463" eta0="2.50892" deta="0.2" neta="4" meta="0" phi0="0" nphi="32" /> -<AEndcapCalorimeter c="HCAL" n="HEC" sampling="1" region="0" rMin="48.5" rMax="203.4" zMin="463" zMax="510" eta0="1.50755" deta="0.1" neta="10" meta="0" phi0="0" nphi="64" /> -<AEndcapCalorimeter c="HCAL" n="HEC" sampling="1" region="1" rMin="48.5" rMax="203.4" zMin="463" zMax="510" eta0="2.50817" deta="0.2" neta="3" meta="0" phi0="0" nphi="32" /> -<AEndcapCalorimeter c="HCAL" n="HEC" sampling="2" region="0" rMin="48.5" rMax="203.4" zMin="513" zMax="559" eta0="1.6" deta="0.1" neta="9" meta="1" phi0="0" nphi="64" /> -<AEndcapCalorimeter c="HCAL" n="HEC" sampling="2" region="1" rMin="48.5" rMax="203.4" zMin="513" zMax="559" eta0="2.5" deta="0.2" neta="3" meta="0" phi0="-7.95139e-16" nphi="32" /> -<AEndcapCalorimeter c="HCAL" n="HEC" sampling="3" region="0" rMin="48.5" rMax="203.4" zMin="559" zMax="605" eta0="1.7" deta="0.1" neta="8" meta="2" phi0="-3.97569e-16" nphi="64" /> -<AEndcapCalorimeter c="HCAL" n="HEC" sampling="3" region="1" rMin="48.5" rMax="203.4" zMin="559" zMax="605" eta0="2.5" deta="0.2" neta="4" meta="0" phi0="-7.95139e-16" nphi="32" /> -<ADisc p="YX" c="ECAL" n="FCAL EM" rIn="7.84392" rOut="47.5" /> -<ARectangle p="RZ" c="ECAL" n="FCAL EM" xMin="466.85" xMax="511.85" yMin="7.84392" yMax="47.5" /> -<ADisc p="YX" c="HCAL" n="FCAL HAD 1" rIn="7.90558" rOut="47.5" /> -<ARectangle p="RZ" c="HCAL" n="FCAL HAD 1" xMin="512.3" xMax="557.3" yMin="7.90558" yMax="47.5" /> -<ADisc p="YX" c="HCAL" n="FCAL HAD 2" rIn="7.96007" rOut="47.5" /> -<ARectangle p="RZ" c="HCAL" n="FCAL HAD 2" xMin="559.75" xMax="604.75" yMin="7.96007" yMax="47.5" /> -<ABarrelCalorimeter c="HCAL" n="TILE Barrel" sampling="0" region="0" rMin="229" rMax="260" zMin="0" zMax="282" eta0="0" deta="0.1" neta="10" meta="0" phi0="0" nphi="64" /> -<ABarrelCalorimeter c="HCAL" n="TILE Barrel" sampling="1" region="0" rMin="260" rMax="344" zMin="0" zMax="282" eta0="0" deta="0.1" neta="9" meta="0" phi0="0" nphi="64" /> -<ABarrelCalorimeter c="HCAL" n="TILE Barrel" sampling="2" region="0" rMin="344" rMax="386" zMin="-36.5199" zMax="282" eta0="-0.1" deta="0.2" neta="4" meta="0" phi0="0" nphi="64" /> -<ABarrelCalorimeter c="HCAL" n="Extended TILE" sampling="0" region="0" rMin="229" rMax="260" zMin="355.95" zMax="615" eta0="1.1" deta="0.1" neta="5" meta="11" phi0="0" nphi="64" /> -<ABarrelCalorimeter c="HCAL" n="Extended TILE" sampling="1" region="0" rMin="260" rMax="314" zMin="355.95" zMax="615" eta0="1" deta="0.1" neta="5" meta="10" phi0="0" nphi="64" /> -<ABarrelCalorimeter c="HCAL" n="Extended TILE" sampling="2" region="0" rMin="314" rMax="386" zMin="355.95" zMax="615" eta0="0.9" deta="0.2" neta="2" meta="10" phi0="0" nphi="64" /> -<AGapCalorimeter c="HCAL" n="ITC Gap" sampling="1" region="0" rMin="299" rMax="344" zMin="346.435" zMax="355.92" eta="9" phi0="0" nphi="64" /> -<AGapCalorimeter c="HCAL" n="ITC Gap" sampling="2" region="0" rMin="344" rMax="386" zMin="325.05" zMax="355.95" eta="8" phi0="0" nphi="64" /> -<AGapCalorimeter c="HCAL" n="ITC Gap" sampling="3" region="0" rMin="264.6" rMax="295.9" zMin="354.45" zMax="355.95" eta="10" phi0="0" nphi="64" /> -<AGapCalorimeter c="HCAL" n="ITC Gap" sampling="3" region="0" rMin="230.5" rMax="264.6" zMin="354.45" zMax="355.95" eta="11" phi0="0" nphi="64" /> -<AGapCalorimeter c="HCAL" n="ITC Gap" sampling="3" region="0" rMin="182.7" rMax="230.5" zMin="353.2" zMax="354" eta="13" phi0="0" nphi="64" /> -<AGapCalorimeter c="HCAL" n="ITC Gap" sampling="3" region="0" rMin="146.5" rMax="182.7" zMin="353.2" zMax="354" eta="15" phi0="0" nphi="64" /> -<AEndcapCryostat c="HCAL" n="Minimum Bias Trigger Scintillators" sampling="0" region="0" rMin="15.3" rMax="42.6" zMin="319.187" zMax="321.187" neta="1" nphi="8" /> -<AEndcapCryostat c="HCAL" n="Minimum Bias Trigger Scintillators" sampling="1" region="0" rMin="42.6" rMax="89" zMin="319.187" zMax="321.187" neta="1" nphi="8" /> -</AGeometry> diff --git a/graphics/AtlantisJava/geometry/AMuonGeometry.xml b/graphics/AtlantisJava/geometry/AMuonGeometry.xml deleted file mode 100755 index bf6ea122c013daecbd829202bb9479a6cbdba8a7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/AMuonGeometry.xml +++ /dev/null @@ -1,220 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE AMuonGeometry [ -<!ELEMENT AMuonGeometry (ABox | ATBx | ATrd)*> -<!ELEMENT ABox EMPTY > -<!ATTLIST ABox - n CDATA #REQUIRED - zi CDATA #REQUIRED - zo CDATA #REQUIRED - ri CDATA #REQUIRED - ro CDATA #REQUIRED - w CDATA #REQUIRED - eta CDATA #REQUIRED - phi CDATA #REQUIRED - dphi CDATA "0" - sh CDATA "0" - RPCi CDATA "0" - RPCo CDATA "0"> -<!ELEMENT ATBx EMPTY > -<!ATTLIST ATBx - n CDATA #REQUIRED - zi CDATA #REQUIRED - zo CDATA #REQUIRED - ri CDATA #REQUIRED - ro CDATA #REQUIRED - w CDATA #REQUIRED - eta CDATA #REQUIRED - phi CDATA #REQUIRED - sh CDATA "0" - dphi CDATA "0" - RPCi CDATA "0" - RPCo CDATA "0" - zis CDATA #REQUIRED - zos CDATA #REQUIRED - ws CDATA #REQUIRED - or CDATA "0"> -<!ELEMENT ATrd EMPTY > -<!ATTLIST ATrd - n CDATA #REQUIRED - zi CDATA #REQUIRED - zo CDATA #REQUIRED - ri CDATA #REQUIRED - ro CDATA #REQUIRED - wi CDATA #REQUIRED - wo CDATA #REQUIRED - eta CDATA #REQUIRED - phi CDATA #REQUIRED - dphi CDATA "0" - sh CDATA "0" - a CDATA "0"> -]> -<AMuonGeometry> -<ABox n="MDT_BIL" zi="33" zo="124.607" ri="474.091" ro="515.705" w="267.15" eta="1" phi="1 2 3 7" /> -<ABox n="MDT_BIL" zi="51" zo="124.586" ri="474.091" ro="515.705" w="267.15" eta="1" phi="4" /> -<ABox n="MDT_BIL" zi="56" zo="147.607" ri="525.691" ro="567.305" w="267.15" eta="1" phi="5" /> -<ABox n="MDT_BIL" zi="125" zo="234.628" ri="474.091" ro="515.705" w="267.15" eta="2" phi="1 2 3 4 5 7" /> -<ABox n="MDT_BIL" zi="235" zo="326.607" ri="474.091" ro="515.705" w="267.15" eta="3" phi="1 2 4 5 7" /> -<ABox n="MDT_BIL" zi="235" zo="344.628" ri="474.091" ro="515.705" w="267.15" eta="3" phi="3" /> -<ABox n="MDT_BIL" zi="345" zo="454.628" ri="474.091" ro="515.705" w="267.15" eta="4" phi="1 2 3 4 5" /> -<ABox n="MDT_BIL" zi="345" zo="436.607" ri="474.091" ro="515.705" w="267.15" eta="4" phi="7" /> -<ABox n="MDT_BIL" zi="455" zo="546.607" ri="474.091" ro="515.705" w="267.15" eta="5" phi="1 2 3 4 5" /> -<ABox n="MDT_BIL" zi="437" zo="528.607" ri="474.091" ro="515.705" w="267.15" eta="5" phi="7" /> -<ABox n="MDT_BIL" zi="547" zo="656.628" ri="474.091" ro="515.705" w="267.15" eta="6" phi="1 2 3 5" /> -<ABox n="MDT_BIL" zi="547" zo="638.607" ri="474.091" ro="515.705" w="267.15" eta="6" phi="4 7" /> -<ABox n="MDT_BIS" zi="1" zo="110.628" ri="440.793" ro="469.207" w="167.15" eta="1" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BIS" zi="111" zo="202.607" ri="440.793" ro="469.207" w="167.15" eta="2" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BIS" zi="203" zo="294.607" ri="440.793" ro="469.207" w="167.15" eta="3" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BIS" zi="295" zo="386.607" ri="440.793" ro="469.207" w="167.15" eta="4" phi="1 2 3" dphi="22.5" /> -<ABox n="MDT_BIS" zi="313" zo="404.607" ri="440.793" ro="469.207" w="167.15" eta="4" phi="4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BIS" zi="387" zo="478.607" ri="440.793" ro="469.207" w="167.15" eta="5" phi="1 2 3" dphi="22.5" /> -<ABox n="MDT_BIS" zi="405" zo="496.607" ri="440.793" ro="469.207" w="167.15" eta="5" phi="4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BIS" zi="479" zo="570.607" ri="440.793" ro="469.207" w="167.15" eta="6" phi="1 2 3" dphi="22.5" /> -<ABox n="MDT_BIS" zi="497" zo="588.607" ri="440.793" ro="469.207" w="167.15" eta="6" phi="4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BIS" zi="571" zo="680.628" ri="440.793" ro="469.207" w="167.15" eta="7" phi="1 2 3" dphi="22.5" /> -<ABox n="MDT_BIS" zi="589" zo="680.607" ri="440.793" ro="469.207" w="167.15" eta="7" phi="4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BIS" zi="681" zo="730.558" ri="454.864" ro="466.145" w="85.15" eta="8" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BML" zi="15" zo="184.698" ri="675.194" ro="754.205" w="357.6" eta="1" phi="1 2" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="39" zo="184.67" ri="675.194" ro="754.205" w="357.6" eta="1" phi="3 7" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="87" zo="184.614" ri="675.194" ro="753.005" w="357.6" eta="1" phi="4 5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="63" zo="184.642" ri="675.194" ro="753.005" w="357.6" eta="1" phi="6 8" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="185" zo="354.698" ri="675.194" ro="754.205" w="357.6" eta="2" phi="1 2 3 4 5 6 7 8" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="355" zo="524.698" ri="675.194" ro="754.205" w="357.6" eta="3" phi="1 2 3 4 5 6 7 8" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="525" zo="646.642" ri="675.194" ro="753.005" w="357.6" eta="4" phi="1 2 3 4 5 6 8" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="647" zo="768.642" ri="675.194" ro="753.005" w="357.6" eta="4" phi="7" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="647" zo="768.642" ri="675.194" ro="753.005" w="357.6" eta="5" phi="1 2 3 4 5 6 8" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="769" zo="914.67" ri="675.194" ro="754.205" w="357.6" eta="5" phi="7" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="769" zo="914.67" ri="675.194" ro="754.205" w="357.6" eta="6" phi="1 2 3 4 5 6 8" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="918" zo="966" ri="743.8" ro="753.8" w="304" eta="6" phi="7" RPCi="15" RPCo="15" /> -<ABox n="MDT_BML" zi="918" zo="966" ri="743.8" ro="753.8" w="304" eta="7" phi="1 2 3 4 5 6 8" RPCi="15" RPCo="15" /> -<ABox n="MDT_BMS" zi="15" zo="184.698" ri="777.694" ro="842.905" w="309.6" eta="1" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BMS" zi="185" zo="364.5" ri="777.694" ro="845.705" w="309.6" eta="2" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BMS" zi="368" zo="513.67" ri="777.694" ro="841.705" w="309.6" eta="3" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BMS" zi="514" zo="691.35" ri="777.694" ro="851.305" w="309.6" eta="4" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BMS" zi="692.5" zo="790.114" ri="777.694" ro="841.705" w="309.6" eta="5" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BMS" zi="790.5" zo="936.17" ri="777.694" ro="842.905" w="309.6" eta="6" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BOL" zi="15" zo="232.754" ri="924.444" ro="989.055" w="498.6" eta="1" phi="1 2" RPCo="15" /> -<ABox n="MDT_BOL" zi="39" zo="232.726" ri="924.444" ro="989.055" w="498.6" eta="1" phi="3" RPCo="15" /> -<ABox n="MDT_BOL" zi="87" zo="232.67" ri="924.444" ro="989.055" w="498.6" eta="1" phi="4 5" RPCo="15" /> -<ABox n="MDT_BOL" zi="63" zo="232.698" ri="924.444" ro="989.055" w="498.6" eta="1" phi="6 7 8" RPCo="15" /> -<ABox n="MDT_BOL" zi="233" zo="450.754" ri="924.444" ro="989.055" w="498.6" eta="2" phi="1 2 3 4 5 6 8" RPCo="15" /> -<ABox n="MDT_BOL" zi="233" zo="378.67" ri="924.444" ro="989.055" w="498.6" eta="2" phi="7" RPCo="15" /> -<ABox n="MDT_BOL" zi="451" zo="620.698" ri="924.444" ro="989.055" w="498.6" eta="3" phi="1 2 3 4 5 6 8" RPCo="15" /> -<ABox n="MDT_BOL" zi="379" zo="524.67" ri="924.444" ro="989.055" w="498.6" eta="3" phi="7" RPCo="15" /> -<ABox n="MDT_BOL" zi="621" zo="838.754" ri="924.444" ro="989.055" w="498.6" eta="4" phi="1 2 3 4 5 6 7 8" RPCo="15" /> -<ABox n="MDT_BOL" zi="839" zo="1056.75" ri="924.444" ro="989.055" w="498.6" eta="5" phi="1 2 3 4 5 6 7 8" RPCo="15" /> -<ABox n="MDT_BOL" zi="1057" zo="1226.7" ri="924.444" ro="989.055" w="498.6" eta="6" phi="1 2 3 4 5 6 7 8" RPCo="15" /> -<ABox n="MDT_BOS" zi="1" zo="218.754" ri="1019.19" ro="1082.46" w="379.6" eta="1" phi="1 2 3 5 8" dphi="22.5" RPCi="15" /> -<ABox n="MDT_BOS" zi="73" zo="218.67" ri="1019.19" ro="1082.46" w="379.6" eta="1" phi="4" dphi="22.5" RPCi="15" /> -<ABox n="MDT_BOS" zi="219" zo="436.754" ri="1019.19" ro="1082.46" w="379.6" eta="2" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" /> -<ABox n="MDT_BOS" zi="437" zo="654.754" ri="1019.19" ro="1082.46" w="379.6" eta="3" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" /> -<ABox n="MDT_BOS" zi="655" zo="872.754" ri="1019.19" ro="1082.46" w="379.6" eta="4" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" /> -<ABox n="MDT_BOS" zi="873" zo="1090.75" ri="1019.19" ro="1082.46" w="379.6" eta="5" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" /> -<ABox n="MDT_BOS" zi="1091" zo="1284.73" ri="1019.19" ro="1082.46" w="379.6" eta="6" phi="1 2 3 4 5 8" dphi="22.5" RPCi="15" /> -<ABox n="MDT_BEE" zi="877.9" zo="1023.57" ri="433.023" ro="452.33" w="91.15" eta="1" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BEE" zi="1023.9" zo="1169.57" ri="433.023" ro="452.33" w="91.15" eta="2" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ABox n="MDT_BIR" zi="52" zo="143.607" ri="592.407" ro="634.021" w="267.15" eta="1" phi="6" sh="11.65" /> -<ABox n="MDT_BIR" zi="52" zo="143.607" ri="592.407" ro="634.021" w="267.15" eta="1" phi="8" sh="-11.65" /> -<ABox n="MDT_BIR" zi="200" zo="291.607" ri="596.1" ro="637.714" w="153.65" eta="2" phi="6" sh="68.4" /> -<ABox n="MDT_BIR" zi="200" zo="291.607" ri="596.1" ro="637.714" w="153.65" eta="2" phi="8" sh="-68.4" /> -<ABox n="MDT_BIR" zi="292" zo="392.617" ri="594.083" ro="635.697" w="110.55" eta="3" phi="6" sh="46.85" /> -<ABox n="MDT_BIR" zi="292" zo="392.617" ri="594.083" ro="635.697" w="110.55" eta="3" phi="8" sh="-46.85" /> -<ABox n="MDT_BIR" zi="394" zo="485.607" ri="596.1" ro="637.714" w="153.65" eta="4" phi="6" sh="68.4" /> -<ABox n="MDT_BIR" zi="394" zo="485.607" ri="596.1" ro="637.714" w="153.65" eta="4" phi="8" sh="-68.4" /> -<ABox n="MDT_BIR" zi="541" zo="614.586" ri="596.1" ro="637.714" w="153.65" eta="5" phi="6" sh="68.4" /> -<ABox n="MDT_BIR" zi="541" zo="614.586" ri="596.1" ro="637.714" w="153.65" eta="5" phi="8" sh="-68.4" /> -<ABox n="MDT_BIR" zi="616" zo="725.628" ri="594.083" ro="635.697" w="110.55" eta="6" phi="6" sh="46.85" /> -<ABox n="MDT_BIR" zi="616" zo="725.628" ri="594.083" ro="635.697" w="110.55" eta="6" phi="8" sh="-46.85" /> -<ABox n="MDT_BMF" zi="62.5" zo="280.254" ri="777.694" ro="841.705" w="309.6" eta="1" phi="6 7" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BMF" zi="406" zo="599.726" ri="777.694" ro="841.705" w="309.6" eta="2" phi="6 7" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BMF" zi="728" zo="873.67" ri="777.694" ro="841.705" w="309.6" eta="3" phi="6 7" dphi="22.5" RPCi="15" RPCo="15" /> -<ABox n="MDT_BOF" zi="62.57" zo="280.324" ri="1028.19" ro="1093.06" w="379.6" eta="1" phi="6 7" dphi="22.5" RPCo="15" /> -<ABox n="MDT_BOF" zi="405.46" zo="599.186" ri="1028.19" ro="1106.21" w="379.6" eta="2" phi="6 7" dphi="22.5" RPCo="15" /> -<ABox n="MDT_BOF" zi="727.92" zo="873.59" ri="1028.19" ro="1107.41" w="379.6" eta="3" phi="6 7" dphi="22.5" RPCo="15" /> -<ABox n="MDT_BOF" zi="1002.6" zo="1124.24" ri="1028.19" ro="1106.21" w="379.6" eta="4" phi="6 7" dphi="22.5" RPCo="15" /> -<ABox n="MDT_BOG" zi="-60.821" zo="60.8208" ri="1028.19" ro="1093.06" w="379.6" eta="0" phi="6 7" dphi="22.5" RPCo="15" /> -<ABox n="MDT_BOG" zi="282.07" zo="403.712" ri="1028.19" ro="1093.06" w="379.6" eta="1" phi="6 7" dphi="22.5" RPCo="15" /> -<ABox n="MDT_BOG" zi="602.75" zo="724.392" ri="1028.19" ro="1093.06" w="379.6" eta="2" phi="6 7" dphi="22.5" RPCo="15" /> -<ABox n="MDT_BOG" zi="877.14" zo="998.782" ri="1028.19" ro="1106.21" w="379.6" eta="3" phi="6 7" dphi="22.5" RPCo="15" /> -<ABox n="MDT_BOG" zi="1147.2" zo="1268.84" ri="1028.19" ro="1106.21" w="379.6" eta="4" phi="6 7" dphi="22.5" RPCo="15" /> -<ATrd n="MDT_EIL1" zi="749.146" zo="785.86" ri="207.6" ro="317.228" wi="132.15" wo="186.9" eta="1" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EIL2" zi="749.146" zo="785.86" ri="319.1" ro="428.728" wi="186.15" wo="240.9" eta="2" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EIL3" zi="749.146" zo="785.86" ri="427.23" ro="464.774" wi="207.15" wo="207.15" eta="3" phi="1 2 3 4 5 7" /> -<ATrd n="MDT_EIL3" zi="749.146" zo="785.86" ri="427.535" ro="465.079" wi="174.15" wo="174.15" eta="3" phi="6" sh="-16.5" /> -<ATrd n="MDT_EIL3" zi="749.146" zo="785.86" ri="427.535" ro="465.079" wi="174.15" wo="174.15" eta="3" phi="8" sh="16.5" /> -<ATrd n="MDT_EIL4" zi="745.796" zo="782.51" ri="472" ro="509.544" wi="153.65" wo="153.65" eta="4" phi="1 5" /> -<ATrd n="MDT_EIL4" zi="745.796" zo="782.51" ri="472" ro="635.691" wi="235.15" wo="316.9" eta="4" phi="2 3 7" /> -<ATrd n="MDT_EIL4" zi="745.796" zo="782.51" ri="473.105" ro="636.796" wi="165.15" wo="246.9" eta="4" phi="4" sh="35" /> -<ATrd n="MDT_EIL4" zi="745.796" zo="782.51" ri="511.445" ro="639.094" wi="128.15" wo="191.9" eta="4" phi="6" sh="-62.5" /> -<ATrd n="MDT_EIL4" zi="745.796" zo="782.51" ri="511.445" ro="639.094" wi="128.15" wo="191.9" eta="4" phi="8" sh="62.5" /> -<ATrd n="MDT_EIL5" zi="745.796" zo="782.51" ri="508.04" ro="635.689" wi="253.15" wo="316.9" eta="5" phi="1 5" /> -<ATrd n="MDT_EEL1" zi="1116.5" zo="1148.11" ri="651.3" ro="772.942" wi="336.15" wo="396.9" eta="1" phi="1 2 4 5 6 7 8" /> -<ATrd n="MDT_EEL1" zi="1066.09" zo="1097.7" ri="671.8" ro="817.47" wi="244.65" wo="288.3" eta="1" phi="3" /> -<ATrd n="MDT_EEL2" zi="1116.5" zo="1148.11" ri="774.97" ro="896.612" wi="396.15" wo="456.9" eta="2" phi="1 2 4 5 6 7 8" /> -<ATrd n="MDT_EES1" zi="1011.9" zo="1043.51" ri="589.3" ro="734.97" wi="201.45" wo="245.1" eta="1" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EES2" zi="1011.9" zo="1043.51" ri="737" ro="858.642" wi="244.65" wo="281.1" eta="2" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EML1" zi="1411.25" zo="1447.66" ri="177" ro="346.698" wi="118.65" wo="203.4" eta="1" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EML2" zi="1411.25" zo="1447.66" ri="348.5" ro="542.226" wi="202.65" wo="299.4" eta="2" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EML3" zi="1411.25" zo="1447.66" ri="544" ro="737.726" wi="298.65" wo="395.4" eta="3" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EML4" zi="1411.25" zo="1447.66" ri="739.5" ro="933.226" wi="394.65" wo="491.4" eta="4" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EML5" zi="1411.25" zo="1447.66" ri="935" ro="1128.73" wi="490.65" wo="587.4" eta="5" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EMS1" zi="1369.65" zo="1406.06" ri="177" ro="370.726" wi="83.55" wo="141.6" eta="1" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EMS2" zi="1369.65" zo="1406.06" ri="372.5" ro="566.226" wi="141.15" wo="199.2" eta="2" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EMS3" zi="1369.65" zo="1406.06" ri="568" ro="761.726" wi="198.75" wo="256.8" eta="3" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EMS4" zi="1369.65" zo="1406.06" ri="763.5" ro="957.226" wi="256.35" wo="314.4" eta="4" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EMS5" zi="1369.65" zo="1406.06" ri="959" ro="1152.73" wi="313.95" wo="372" eta="5" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EOL1" zi="2124.25" zo="2160.66" ri="277" ro="446.698" wi="168.15" wo="252.9" eta="1" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EOL2" zi="2124.25" zo="2160.66" ri="448.5" ro="618.198" wi="264.15" wo="348.9" eta="2" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EOL3" zi="2124.25" zo="2160.66" ri="620" ro="765.67" wi="348.15" wo="420.9" eta="3" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EOL4" zi="2124.25" zo="2160.66" ri="767.5" ro="913.17" wi="420.15" wo="492.9" eta="4" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EOL5" zi="2124.25" zo="2160.66" ri="915" ro="1060.67" wi="492.15" wo="564.9" eta="5" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EOL6" zi="2124.25" zo="2160.66" ri="1062.5" ro="1208.17" wi="564.15" wo="636.9" eta="6" phi="1 2 3 4 5 6 7 8" /> -<ATrd n="MDT_EOS1" zi="2165.85" zo="2202.26" ri="277" ro="446.698" wi="124.95" wo="175.8" eta="1" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EOS2" zi="2165.85" zo="2202.26" ri="448.5" ro="618.198" wi="175.35" wo="226.2" eta="2" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EOS3" zi="2165.85" zo="2202.26" ri="620" ro="789.698" wi="225.75" wo="276.6" eta="3" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EOS4" zi="2165.85" zo="2202.26" ri="791.5" ro="937.17" wi="276.15" wo="319.8" eta="4" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EOS5" zi="2165.85" zo="2202.26" ri="939" ro="1084.67" wi="319.35" wo="363" eta="5" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EOS6" zi="2165.85" zo="2202.26" ri="1086.5" ro="1232.17" wi="362.55" wo="406.2" eta="6" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="TGC_T1F1" zi="1327.15" zo="1334.15" ri="190" ro="397.54" wi="57.69" wo="112.34" eta="1" phi="1 3 5 7 9 11 13 15 17 19 21 23" dphi="7.5" /> -<ATrd n="TGC_T1F1" zi="1345.05" zo="1352.05" ri="190" ro="397.54" wi="57.69" wo="112.34" eta="1" phi="2 4 6 8 10 12 14 16 18 20 22 24" dphi="7.5" /> -<ATrd n="TGC_T1E1" zi="1345.05" zo="1359.95" ri="388" ro="1068.2" wi="64.49" wo="154.85" eta="1" phi="1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47" dphi="3.75" /> -<ATrd n="TGC_T1E1" zi="1327.15" zo="1342.05" ri="388" ro="1068.2" wi="64.49" wo="154.85" eta="1" phi="2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48" dphi="3.75" /> -<ATrd n="TGC_T2F1" zi="1460.05" zo="1464.42" ri="252.59" ro="432.15" wi="75.51" wo="122.78" eta="1" phi="1 3 5 7 9 11 13 15 17 19 21 23" dphi="7.5" /> -<ATrd n="TGC_T2F1" zi="1475.55" zo="1479.92" ri="252.59" ro="432.15" wi="75.51" wo="122.78" eta="1" phi="2 4 6 8 10 12 14 16 18 20 22 24" dphi="7.5" /> -<ATrd n="TGC_T2E1" zi="1475.55" zo="1485.42" ri="418.4" ro="1191.7" wi="68.47" wo="170.84" eta="1" phi="1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47" dphi="3.75" /> -<ATrd n="TGC_T2E1" zi="1460.05" zo="1469.92" ri="418.4" ro="1191.7" wi="68.47" wo="170.84" eta="1" phi="2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48" dphi="3.75" /> -<ATrd n="TGC_T3F1" zi="1502.05" zo="1506.42" ri="261" ro="440.56" wi="75.51" wo="122.79" eta="1" phi="1 3 5 7 9 11 13 15 17 19 21 23" dphi="7.5" /> -<ATrd n="TGC_T3F1" zi="1517.55" zo="1521.92" ri="261" ro="440.56" wi="75.51" wo="122.79" eta="1" phi="2 4 6 8 10 12 14 16 18 20 22 24" dphi="7.5" /> -<ATrd n="TGC_T3E1" zi="1517.55" zo="1527.42" ri="436.56" ro="1191.7" wi="70.84" wo="170.84" eta="1" phi="1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47" dphi="3.75" /> -<ATrd n="TGC_T3E1" zi="1502.05" zo="1511.92" ri="436.56" ro="1191.7" wi="70.84" wo="170.84" eta="1" phi="2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48" dphi="3.75" /> -<ATrd n="TGC_T4F1" zi="698.06" zo="702.43" ri="217" ro="443.4" wi="62.38" wo="121.99" eta="1" phi="1 3 4 6 7 9 10 12 13 15 16 18 19 21 22 24" dphi="7.5" /> -<ATrd n="TGC_T4F1" zi="693.04" zo="697.41" ri="217" ro="433.4" wi="62.38" wo="119.36" eta="1" phi="2 5 8 11 14 17 20 23" dphi="7.5" /> -<ATrd n="TGC_T4E1" zi="730.87" zo="735.24" ri="470" ro="619" wi="83.33" wo="108.09" eta="1" phi="1 4 7" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="520" ro="619" wi="91.64" wo="108.09" eta="1" phi="2" dphi="-5.5" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="470" ro="619" wi="83.33" wo="108.09" eta="1" phi="3 6" dphi="5.5" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="470" ro="619" wi="83.33" wo="108.09" eta="1" phi="5 8" dphi="-5.5" /> -<ATrd n="TGC_T4E1" zi="730.87" zo="735.24" ri="470" ro="619" wi="83.33" wo="108.09" eta="1" phi="9 12" dphi="15" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="470" ro="619" wi="83.33" wo="108.09" eta="1" phi="10" dphi="9.5" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="520" ro="619" wi="91.64" wo="108.09" eta="1" phi="11 14" dphi="20.5" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="520" ro="619" wi="91.64" wo="108.09" eta="1" phi="13" dphi="9.5" /> -<ATrd n="TGC_T4E1" zi="730.87" zo="735.24" ri="520" ro="619" wi="91.64" wo="108.09" eta="1" phi="15" dphi="15" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="470" ro="619" wi="83.33" wo="108.09" eta="1" phi="16" dphi="35.5" /> -<ATrd n="TGC_T4E1" zi="730.87" zo="735.24" ri="470" ro="619" wi="83.33" wo="108.09" eta="1" phi="17" dphi="30" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="470" ro="619" wi="83.33" wo="108.09" eta="1" phi="18" dphi="24.5" /> -<ATrd n="TGC_T4E1" zi="730.87" zo="735.24" ri="520" ro="619" wi="91.64" wo="108.09" eta="1" phi="19" dphi="45" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="520" ro="619" wi="91.64" wo="108.09" eta="1" phi="20" dphi="39.5" /> -<ATrd n="TGC_T4E1" zi="737.53" zo="741.9" ri="520" ro="619" wi="91.64" wo="108.09" eta="1" phi="21" dphi="50.5" /> -<ATrd n="MDT_EIS1" zi="707.746" zo="744.46" ri="207.6" ro="335.249" wi="89.85" wo="128.1" eta="1" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="MDT_EIS2" zi="707.746" zo="744.46" ri="337.1" ro="446.728" wi="127.65" wo="160.5" eta="2" phi="1 2 3 4 5 6 7 8" dphi="22.5" /> -<ATrd n="CSC_CSS1" zi="708.102" zo="738.022" ri="86.6016" ro="207.832" wi="40.29" wo="75.7865" eta="1" phi="1 2 3 4 5 6 7 8" dphi="22.5" a="-11.587" /> -<ATrd n="CSC_CSL1" zi="744.539" zo="774.459" ri="92.0422" ro="206.732" wi="61.01" wo="117.027" eta="1" phi="1 2 3 4 5 6 7 8" a="-11.587" /> -<ABox n="MDT_BIM" zi="107" zo="216.628" ri="519.465" ro="561.079" w="153.65" eta="1" phi="6" sh="-56.6" /> -<ABox n="MDT_BIM" zi="107" zo="216.628" ri="519.465" ro="561.079" w="153.65" eta="1" phi="8" sh="56.6" /> -<ABox n="MDT_BIM" zi="217" zo="326.628" ri="519.465" ro="561.079" w="153.65" eta="2" phi="6" sh="-56.6" /> -<ABox n="MDT_BIM" zi="217" zo="326.628" ri="519.465" ro="561.079" w="153.65" eta="2" phi="8" sh="56.6" /> -<ABox n="MDT_BIM" zi="327" zo="436.628" ri="519.465" ro="561.079" w="153.65" eta="3" phi="6" sh="-56.6" /> -<ABox n="MDT_BIM" zi="327" zo="436.628" ri="519.465" ro="561.079" w="153.65" eta="3" phi="8" sh="56.6" /> -<ABox n="MDT_BIM" zi="437" zo="546.628" ri="519.465" ro="561.079" w="153.65" eta="4" phi="6" sh="-56.6" /> -<ABox n="MDT_BIM" zi="437" zo="546.628" ri="519.465" ro="561.079" w="153.65" eta="4" phi="8" sh="56.6" /> -<ABox n="MDT_BIM" zi="547" zo="656.628" ri="519.465" ro="561.079" w="153.65" eta="5" phi="6" sh="-56.6" /> -<ABox n="MDT_BIM" zi="547" zo="656.628" ri="519.465" ro="561.079" w="153.65" eta="5" phi="8" sh="56.6" /> -</AMuonGeometry> diff --git a/graphics/AtlantisJava/geometry/ATLAS_IDS.xml b/graphics/AtlantisJava/geometry/ATLAS_IDS.xml deleted file mode 100755 index 81f4d7c3a445165a6d37202e8752316a53a36d98..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/ATLAS_IDS.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE IdDict SYSTEM "IdDict.dtd" [ - <!ENTITY InnerDetector SYSTEM "IdDictInnerDetector.xml"> - <!ENTITY LArCalorimeter SYSTEM "IdDictLArCalorimeter.xml"> - <!ENTITY TileCalorimeter SYSTEM "IdDictTileCalorimeter.xml"> - <!ENTITY Calorimeter SYSTEM "IdDictCalorimeter.xml"> - <!ENTITY MuonSpectrometer SYSTEM "IdDictMuonSpectrometer.xml"> - <!ENTITY ATLAS SYSTEM "IdDictATLAS.xml"> - <!ENTITY LArHighVoltage SYSTEM "IdDictLArHighVoltage.xml"> - <!ENTITY LArElectrode SYSTEM "IdDictLArElectrode.xml"> - <!ENTITY ForwardDetectors SYSTEM "IdDictForwardDetectors.xml"> -]> - -<IdDict IdDictVersion="v1"> - -&InnerDetector; -&LArCalorimeter; -&TileCalorimeter; -&Calorimeter; -&MuonSpectrometer; -&ATLAS; -&LArHighVoltage; -&LArElectrode; -&ForwardDetectors; - -</IdDict> - diff --git a/graphics/AtlantisJava/geometry/IdDict.dtd b/graphics/AtlantisJava/geometry/IdDict.dtd deleted file mode 100755 index 5077ec98a6362888c719f4eb4d034ebdad43b40d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDict.dtd +++ /dev/null @@ -1,118 +0,0 @@ -<?xml encoding="US-ASCII"?> - -<!-- IdDict: Identifier Dictionary - ========================== - - o This describes the possible identifier ranges. - - o One may describe several identifier dictionaries, each by a IdDictionary element. - A dictionary is identified by its name. - - o Each dictionary may describe : - - + individual identifier fields ("field"). - - - This is useful when the field values are individually labelled. - - purely numeric fields do not need to be explicitly - described, in which case, their possible ranges will be deduced from the defined - regions. - - + identifier regions ("region"). - - - they are the alternate identifier ranges for this dictionary. - - a region specifies a contiguous range of identifiers, complete for the dictionary. - - it may be labelled with a "name". - - it may also have a "tag" (see alternate regions) - - it contains the ordered list of fields with their explicit value range. - - each entry in this list may be - - a range assigned to a given field ("range") - - a reference to a subregion ("reference") (see below) - - a reference to a complete identifier domain ("identifiers") - - a list of alternative ranges which are differentiated according - to their tag ("alternate_ranges") - - + alternate regions ("alternate_regions"). - - - this contains two or more alternate region specifications - which are differentiated by their "tag". An empty tag is - default. This allows at generation time to select a specific - tag. - - + subregions ("subregion") - - - A subregion speficies a contiguous range of identifiers, describing a - subset of the identifier fields in the dictionary. - - it must identified by a name. - - the role of subregions is to be referenced by regions, and they typically describe - the parts that are common to several regions. - ---> - - - -<!ENTITY % DTD_constraint 'IdDictVersion ( v1 ) #REQUIRED'> - -<!ELEMENT IdDict ( IdDictionary )* > -<!ATTLIST IdDict - %DTD_constraint;> - -<!ELEMENT IdDictionary ( field | subregion | region | alternate_regions )* > -<!ATTLIST IdDictionary - name ID #REQUIRED - version CDATA #IMPLIED - date CDATA #IMPLIED - author CDATA #IMPLIED> - - -<!ELEMENT field ( label )* > -<!ATTLIST field - name CDATA #REQUIRED > - -<!ELEMENT label EMPTY> -<!ATTLIST label - name CDATA #REQUIRED - value CDATA #IMPLIED> - -<!ELEMENT alternate_regions ( region )* > -<!ATTLIST alternate_regions - name CDATA #IMPLIED> - -<!ELEMENT region ( range | reference | dictionary )* > -<!ATTLIST region - name CDATA #IMPLIED - group CDATA #IMPLIED - tag CDATA #IMPLIED - next_abs_eta CDATA #IMPLIED - prev_samp CDATA #IMPLIED - next_samp CDATA #IMPLIED - prev_subdet CDATA #IMPLIED - next_subdet CDATA #IMPLIED - eta0 CDATA #IMPLIED - deta CDATA #IMPLIED - phi0 CDATA #IMPLIED - dphi CDATA #IMPLIED> - -<!ELEMENT range EMPTY> -<!ATTLIST range - field CDATA #REQUIRED - value CDATA #IMPLIED - minvalue CDATA #IMPLIED - maxvalue CDATA #IMPLIED - values CDATA #IMPLIED - prev_value CDATA #IMPLIED - next_value CDATA #IMPLIED - wraparound (TRUE | false) "false"> - -<!ELEMENT reference EMPTY> -<!ATTLIST reference - subregion IDREF #REQUIRED> - -<!ELEMENT dictionary EMPTY> -<!ATTLIST dictionary - name IDREF #REQUIRED> - -<!ELEMENT subregion ( range | reference | dictionary )* > -<!ATTLIST subregion - name ID #REQUIRED> - - diff --git a/graphics/AtlantisJava/geometry/IdDictATLAS.xml b/graphics/AtlantisJava/geometry/IdDictATLAS.xml deleted file mode 100755 index 95314ee2c0db033f750c4050786018c930893017..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDictATLAS.xml +++ /dev/null @@ -1,56 +0,0 @@ - -<IdDictionary name="ATLAS"> - - <field name="subdet"> - <label name="InnerDetector" value="2" /> - <label name="LArCalorimeter" value="4" /> - <label name="TileCalorimeter" value="5" /> - <label name="MuonSpectrometer" value="7" /> - <label name="Calorimeter" value="10" /> - <label name="LArHighVoltage" value="11" /> - <label name="LArElectrode" value="12" /> - <label name="ForwardDetectors" value="13" /> - </field> - - <region> - <range field="subdet" value="InnerDetector" /> - <dictionary name="InnerDetector" /> - </region> - - <region> - <range field="subdet" value="LArCalorimeter" /> - <dictionary name="LArCalorimeter" /> - </region> - - <region> - <range field="subdet" value="TileCalorimeter" /> - <dictionary name="TileCalorimeter" /> - </region> - - <region> - <range field="subdet" value="MuonSpectrometer" /> - <dictionary name="MuonSpectrometer" /> - </region> - - <region> - <range field="subdet" value="Calorimeter" /> - <dictionary name="Calorimeter" /> - </region> - - <region> - <range field="subdet" value="LArHighVoltage" /> - <dictionary name="LArHighVoltage" /> - </region> - - <region> - <range field="subdet" value="LArElectrode" /> - <dictionary name="LArElectrode" /> - </region> - - <region> - <range field="subdet" value="ForwardDetectors" /> - <dictionary name="ForwardDetectors" /> - </region> - -</IdDictionary> - diff --git a/graphics/AtlantisJava/geometry/IdDictCalorimeter.xml b/graphics/AtlantisJava/geometry/IdDictCalorimeter.xml deleted file mode 100755 index f94f801d91ea8eb220722a139cc9d7e0d4c8f782..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDictCalorimeter.xml +++ /dev/null @@ -1,731 +0,0 @@ - -<IdDictionary name="Calorimeter" > - - -<field name="DetZside" > - <label name="negative_DMTile_side" value="-5" /> - <label name="negative_DMLar_side" value="-4" /> - <label name="negative_eta_side" value="-2" /> - <label name="negative_lvl1_side" value="-1" /> - <label name="positive_lvl1_side" value="+1" /> - <label name="positive_eta_side" value="+2" /> - <label name="positive_DMLar_side" value="+4" /> - <label name="positive_DMTile_side" value="+5" /> -</field> - - -<!-- Dead Material Types --> -<!-- xxxxxxxxxxxxxxxxxxxx --> - -<!-- 3 types of LAr Dead Material --> - - <subregion name="DMLArOutside" > - <range field="DetZside" values="negative_DMLar_side positive_DMLar_side" /> - <range field="DMvalue" value="1" /> - </subregion> - - <subregion name="DMLarInside" > - <range field="DetZside" values="negative_DMLar_side positive_DMLar_side" /> - <range field="DMvalue" value="2" /> - </subregion> - - <subregion name="DMLArBeamTest"> - <range field="DetZside" values="negative_DMLar_side positive_DMLar_side" /> - <range field="DMvalue" value="3" /> - </subregion> - -<!-- 2 types of Tile Dead Material --> - - <subregion name="DMTileOutside" > - <range field="DetZside" values="negative_DMTile_side positive_DMTile_side" /> - <range field="DMvalue" value="1" /> - </subregion> - - <subregion name="DMTileDefHits" > - <range field="DetZside" values="negative_DMTile_side positive_DMTile_side" /> - <range field="DMvalue" value="2" /> - </subregion> - - <subregion name="DMTileBeamTest" > - <range field="DetZside" values="negative_DMTile_side positive_DMTile_side" /> - <range field="DMvalue" value="3" /> - </subregion> - - - -<!-- Dead Material Phi regions --> -<!-- xxxxxxxxxxxxxxxxxxxxxxxxxx --> - -<!-- 3 types of Phi region --> - - <subregion name="DMPhi-1" > - <range field="phivalue" minvalue="0" maxvalue="63" wraparound="TRUE" /> - </subregion> - - <subregion name="DMPhi-2" > - <range field="phivalue" minvalue="0" maxvalue="31" wraparound="TRUE" /> - </subregion> - - <subregion name="DMPhi-3" > - <range field="phivalue" value="0" wraparound="TRUE" /> - </subregion> - - - -<!-- LAr DM Samplings --> -<!-- xxxxxxxxxxxxxxxxx --> - - -<!-- 4 sampling region: 0 to 3 --> - - <subregion name="DMLArSampling-0" > - <range field="samplingvalue" value="0" /> - </subregion> - - <subregion name="DMLArSampling-1" > - <range field="samplingvalue" value="1" /> - </subregion> - - <subregion name="DMLArSampling-2" > - <range field="samplingvalue" value="2" /> - </subregion> - - <subregion name="DMLArSampling-3" > - <range field="samplingvalue" value="3" /> - </subregion> - - -<!-- Tile DM Samplings --> -<!-- xxxxxxxxxxxxxxxxx --> - - -<!-- 4 sampling region: 0 to 3 --> - - - <subregion name="DMTileSampling-0" > - <range field="samplingvalue" value="0" /> - </subregion> - - <subregion name="DMTileSampling-1" > - <range field="samplingvalue" value="1" /> - </subregion> - - <subregion name="DMTileSampling-2" > - <range field="samplingvalue" value="2" /> - </subregion> - - <subregion name="DMTileSampling-3" > - <range field="samplingvalue" value="3" /> - </subregion> - - - -<!-- LAr DM regions --> -<!-- xxxxxxxxxxxxxx --> - -<!-- type 1, sampling 0, regions 0 to 5 --> - - <region group="DM_Reg" name="DM_4_1_0_0" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-0" /> - <range field="DMregion" minvalue="0" maxvalue="5" /> - <range field="DMEta" minvalue="0" maxvalue="49" /> - <reference subregion="DMPhi-1" /> - </region> - -<!-- type 1, sampling 1, region 0 to 7--> - - <region group="DM_Reg" name="DM_4_1_1_0" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="0" /> - <range field="DMEta" minvalue="0" maxvalue="14" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_1_1" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="1" /> - <range field="DMEta" minvalue="0" maxvalue="14" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_1_2" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="2" /> - <range field="DMEta" minvalue="0" maxvalue="15" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_1_3" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="3" /> - <range field="DMEta" minvalue="0" maxvalue="15" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_1_4" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="4" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_1_5" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="5" /> - <range field="DMEta" minvalue="0" maxvalue="2" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_1_6" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="6" /> - <range field="DMEta" minvalue="0" maxvalue="18" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_1_7" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="7" /> - <range field="DMEta" minvalue="0" maxvalue="17" /> - <reference subregion="DMPhi-1" /> - </region> - -<!-- type 1, sampling 2, region 0 to 5--> - - <region group="DM_Reg" name="DM_4_1_2_0" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="0" /> - <range field="DMEta" minvalue="0" maxvalue="9" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_2_1" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="1" /> - <range field="DMEta" minvalue="0" maxvalue="9" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_2_2" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="2" /> - <range field="DMEta" minvalue="0" maxvalue="4" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_2_3" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="3" /> - <range field="DMEta" minvalue="0" maxvalue="17" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_2_4" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="4" /> - <range field="DMEta" minvalue="0" maxvalue="17" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_2_5" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="5" /> - <range field="DMEta" minvalue="0" maxvalue="6" /> - <reference subregion="DMPhi-1" /> - </region> - - -<!-- type 1, sampling 3, region 0 to 2--> - - <region group="DM_Reg" name="DM_4_1_3_0" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="0" /> - <range field="DMEta" minvalue="0" maxvalue="32" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_3_1" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="1" /> - <range field="DMEta" minvalue="0" maxvalue="14" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_1_3_2" > - <reference subregion="DMLArOutside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="2" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-3" /> - </region> - - -<!-- type 2, sampling [0,3], region 0 to 5--> - - <region group="DM_Reg" name="DM_4_2_0_0" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-0" /> - <range field="DMregion" value="0" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_0_1" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-0" /> - <range field="DMregion" value="1" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - - <region group="DM_Reg" name="DM_4_2_0_2" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-0" /> - <range field="DMregion" value="2" /> - <range field="DMEta" minvalue="0" maxvalue="9" /> - <reference subregion="DMPhi-2" /> - </region> - - <region group="DM_Reg" name="DM_4_2_0_3" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-0" /> - <range field="DMregion" value="3" /> - <range field="DMEta" minvalue="0" maxvalue="3" /> - <reference subregion="DMPhi-2" /> - </region> - - <region group="DM_Reg" name="DM_4_2_0_4" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-0" /> - <range field="DMregion" value="4" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_0_5" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-0" /> - <range field="DMregion" value="5" /> - <range field="DMEta" minvalue="0" maxvalue="19" /> - <reference subregion="DMPhi-1" /> - </region> - - - <region group="DM_Reg" name="DM_4_2_1_0" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="0" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_1_1" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="1" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_1_2" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="2" /> - <range field="DMEta" minvalue="0" maxvalue="9" /> - <reference subregion="DMPhi-2" /> - </region> - - <region group="DM_Reg" name="DM_4_2_1_3" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="3" /> - <range field="DMEta" minvalue="0" maxvalue="3" /> - <reference subregion="DMPhi-2" /> - </region> - - <region group="DM_Reg" name="DM_4_2_1_4" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="4" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_1_5" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-1" /> - <range field="DMregion" value="5" /> - <range field="DMEta" minvalue="0" maxvalue="19" /> - <reference subregion="DMPhi-1" /> - </region> - - - <region group="DM_Reg" name="DM_4_2_2_0" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="0" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_2_1" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="1" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_2_2" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="2" /> - <range field="DMEta" minvalue="0" maxvalue="9" /> - <reference subregion="DMPhi-2" /> - </region> - - <region group="DM_Reg" name="DM_4_2_2_3" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="3" /> - <range field="DMEta" minvalue="0" maxvalue="3" /> - <reference subregion="DMPhi-2" /> - </region> - - <region group="DM_Reg" name="DM_4_2_2_4" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="4" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_2_5" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-2" /> - <range field="DMregion" value="5" /> - <range field="DMEta" minvalue="0" maxvalue="19" /> - <reference subregion="DMPhi-1" /> - </region> - - - <region group="DM_Reg" name="DM_4_2_3_0" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="0" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_3_1" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="1" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_3_2" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="2" /> - <range field="DMEta" minvalue="0" maxvalue="9" /> - <reference subregion="DMPhi-2" /> - </region> - - <region group="DM_Reg" name="DM_4_2_3_3" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="3" /> - <range field="DMEta" minvalue="0" maxvalue="3" /> - <reference subregion="DMPhi-2" /> - </region> - - <region group="DM_Reg" name="DM_4_2_3_4" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="4" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_4_2_3_5" > - <reference subregion="DMLarInside" /> - <reference subregion="DMLArSampling-3" /> - <range field="DMregion" value="5" /> - <range field="DMEta" minvalue="0" maxvalue="19" /> - <reference subregion="DMPhi-1" /> - </region> - - -<!-- TILE DM regions --> -<!-- xxxxxxxxxxxxxxx --> - -<!-- type 1, sampling 0, region 0 to 1 --> - - <region group="DM_Reg" name="DM_5_1_0_0" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-0" /> - <range field="DMregion" value="0" /> - <range field="DMEta" minvalue="0" maxvalue="9" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_5_1_0_1" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-0" /> - <range field="DMregion" value="1" /> - <range field="DMEta" minvalue="0" maxvalue="4" /> - <reference subregion="DMPhi-1" /> - </region> - -<!-- type 1, sampling 1, region 0 to 2 --> - - <region group="DM_Reg" name="DM_5_1_1_0" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-1" /> - <range field="DMregion" value="0" /> - <range field="DMEta" minvalue="0" maxvalue="3" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_5_1_1_1" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-1" /> - <range field="DMregion" value="1" /> - <range field="DMEta" minvalue="0" maxvalue="2" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_5_1_1_2" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-1" /> - <range field="DMregion" value="2" /> - <range field="DMEta" minvalue="0" maxvalue="3" /> - <reference subregion="DMPhi-1" /> - </region> - - -<!-- type 1, sampling 2, region 0 to 2 --> - - <region group="DM_Reg" name="DM_5_1_2_0" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-2" /> - <range field="DMregion" value="0" /> - <range field="DMEta" minvalue="0" maxvalue="7" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_5_1_2_1" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-2" /> - <range field="DMregion" value="1" /> - <range field="DMEta" minvalue="0" maxvalue="4" /> - <reference subregion="DMPhi-1" /> - </region> - - <region group="DM_Reg" name="DM_5_1_2_2" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-2" /> - <range field="DMregion" value="2" /> - <range field="DMEta" minvalue="0" maxvalue="1" /> - <reference subregion="DMPhi-1" /> - </region> - -<!-- type 1, sampling 3, region 0 --> - - <region group="DM_Reg" name="DM_5_1_3_0" > - <reference subregion="DMTileOutside" /> - <reference subregion="DMTileSampling-3" /> - <range field="DMregion" value="0" /> - <range field="DMEta" minvalue="0" maxvalue="16" /> - <reference subregion="DMPhi-1" /> - </region> - -<!-- type 2, sampling 0, region 0 --> - - <region group="DM_Reg" name="DM_5_2_0_0" > - <reference subregion="DMTileDefHits" /> - <reference subregion="DMTileSampling-0" /> - <range field="DMregion" value="0" /> - <range field="DMEta" value="0" /> - <reference subregion="DMPhi-3" /> - </region> - - -<!-- LVL1 part --> -<!-- xxxxxxxxxxxxxxxxx --> - - <field name="LVL1sampling" > - <label name="EM" value="0" /> - <label name="Hadronic" value="1" /> - </field> - - <subregion name="LVL1" > - <range field="DetZside" values="negative_lvl1_side positive_lvl1_side" /> - <range field="LVL1sampling" values="EM Hadronic" /> - </subregion> - - - <region group="Reg_Lvl1" name="Lvl1_0" > - <reference subregion="LVL1" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="24" /> - <range field="phi" minvalue="0" maxvalue="63" wraparound="TRUE" /> - <range field="layer" minvalue="0" maxvalue="3" /> - </region> - - <region group="Reg_Lvl1" name="Lvl1_1" > - <reference subregion="LVL1" /> - <range field="region" value="1" /> - <range field="eta" minvalue="0" maxvalue="2" /> - <range field="phi" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer" minvalue="0" maxvalue="3" /> - </region> - - <region group="Reg_Lvl1" name="Lvl1_2" > - <reference subregion="LVL1" /> - <range field="region" value="2" /> - <range field="eta" value="0" /> - <range field="phi" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer" minvalue="0" maxvalue="3" /> - </region> - - - <region group="Reg_Lvl1" name="Lvl1_3" > - <reference subregion="LVL1" /> - <range field="region" value="3" /> - <range field="eta" minvalue="0" maxvalue="3"/> - <range field="phi" minvalue="0" maxvalue="15" wraparound="TRUE" /> - <range field="layer" minvalue="0" maxvalue="1" /> - </region> - - - -<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --> -<!-- Online L1 Trigger Tower regions --> -<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --> - - -<!-- Fields used to describe a TTower --> - - <field name="barrel_endcap_fcal" > - <label name="barrel" value="0" /> - <label name="endcap" value="1" /> - <label name="fcal" value="2" /> - </field> - - <field name="em_had" > - <label name="em" value="0" /> - <label name="had" value="1" /> - </field> - - -<!-- Subregion definition --> - - <subregion name="OnlineL1-barrel" > - <range field="DetZside" values="negative_eta_side positive_eta_side" /> - <range field="barrel_endcap_fcal" value="barrel" /> - </subregion> - - <subregion name="OnlineL1-endcap" > - <range field="DetZside" values="negative_eta_side positive_eta_side" /> - <range field="barrel_endcap_fcal" value="endcap" /> - </subregion> - - <subregion name="OnlineL1-fcal" > - <range field="DetZside" values="negative_eta_side positive_eta_side" /> - <range field="barrel_endcap_fcal" value="fcal" /> - </subregion> - - -<!-- Online L1 EM-Barrel --> -<!-- xxxxxxxxxxxxxxxxxxxx --> - -<region group="Online_L1" name="l1_barrel" > - <reference subregion="OnlineL1-barrel" /> - <range field="em_had" value="em" /> - <range field="tower_eta" minvalue="1" maxvalue="15" /> - <range field="tower_phi" minvalue="1" maxvalue="64" /> - <range field="tower_layer" minvalue="0" maxvalue="3" /> - </region> - - -<!-- Online L1 EM Endcap --> -<!-- xxxxxxxxxxxxxxxxxxxx --> - -<region group="Online_L1" name="l1_emec_region1" > - <reference subregion="OnlineL1-endcap" /> - <range field="em_had" value="em" /> - <range field="tower_eta" minvalue="1" maxvalue="11" /> - <range field="tower_phi" minvalue="1" maxvalue="64" /> - <range field="tower_layer" minvalue="0" maxvalue="3" /> -</region> - -<region group="Online_L1" name="l1_emec_region2" > - <reference subregion="OnlineL1-endcap" /> - <range field="em_had" value="em" /> - <range field="tower_eta" minvalue="12" maxvalue="15" /> - <range field="tower_phi" minvalue="1" maxvalue="32" /> - <range field="tower_layer" minvalue="0" maxvalue="3" /> -</region> - -<!-- Online L1 HEC Endcap --> -<!-- xxxxxxxxxxxxxxxxxxxxx --> - -<region group="Online_L1" name="l1_hec_region1" > - <reference subregion="OnlineL1-endcap" /> - <range field="em_had" value="had" /> - <range field="tower_eta" minvalue="2" maxvalue="11" /> - <range field="tower_phi" minvalue="1" maxvalue="64" /> - <range field="tower_layer" minvalue="0" maxvalue="3" /> -</region> - -<region group="Online_L1" name="l1_hec_region2" > - <reference subregion="OnlineL1-endcap" /> - <range field="em_had" value="had" /> - <range field="tower_eta" minvalue="12" maxvalue="15" /> - <range field="tower_phi" minvalue="1" maxvalue="32" /> - <range field="tower_layer" minvalue="0" maxvalue="3" /> -</region> - - -<!-- Online L1 FCAL --> -<!-- xxxxxxxxxxxxxxx --> - -<region group="Online_L1" name="l1_fcal_em" > - <reference subregion="OnlineL1-fcal" /> - <range field="em_had" value="em" /> - <range field="tower_eta" minvalue="1" maxvalue="4" /> - <range field="tower_phi" minvalue="1" maxvalue="16" /> - <range field="tower_layer" value="0" /> -</region> - -<region group="Online_L1" name="l1_fcal_had" > - <reference subregion="OnlineL1-fcal" /> - <range field="em_had" value="had" /> - <range field="tower_eta" minvalue="1" maxvalue="4" /> - <range field="tower_phi" minvalue="1" maxvalue="16" /> - <range field="tower_layer" minvalue="0" maxvalue="1" /> -</region> - - -</IdDictionary> diff --git a/graphics/AtlantisJava/geometry/IdDictForwardDetectors.xml b/graphics/AtlantisJava/geometry/IdDictForwardDetectors.xml deleted file mode 100644 index 588eb81db1c635085b9c09a21f5076eb78e6d937..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDictForwardDetectors.xml +++ /dev/null @@ -1,140 +0,0 @@ - - -<!-- - - The ForwardDetectors identifier is arranged as follows - - ForwardDetectors - part=BCM - <to be defined> - - part=BCM_Online - <to be defined> - - part=LUCID - <to be defined> - - part=LUCID_Online - <to be defined> - - part=ZDC - side module type channel - - part=ZDC_Online - side module type channel gain delay - - --> - -<IdDictionary name="ForwardDetectors" > - - <!-- - Start by defining some symbolic labels used for some fields - (other fields will be specified by numeric ranges) - --> - - <field name="part" > - <label name="ALFA" value="1" /> - <label name="ALFA_Online" value="2" /> - <label name="BCM" value="3" /> - <label name="BCM_Online" value="4" /> - <label name="LUCID" value="5" /> - <label name="LUCID_Online" value="6" /> - <label name="ZDC" value="7" /> - <label name="ZDC_Online" value="8" /> - <label name="Extra" value="9" /> - <label name="Extra_Online" value="10" /> - </field> - - <field name="side"> - <label name="negative" value="-1" /> - <label name="positive" value="+1" /> - </field> - - - <!-- - - ALFA - to do - - --> - - <region group="ALFA" name = "alfa"> - <range field="part" value="ALFA" /> - </region> - - <region group="ALFA_Online" name = "alfa"> - <range field="part" value="ALFA_Online" /> - </region> - - <!-- - - BCM - to do - - --> - - <region group="BCM" name = "bcm"> - <range field="part" value="BCM" /> - </region> - - <region group="BCM_Online" name = "bcm"> - <range field="part" value="BCM_Online" /> - </region> - - <!-- - - LUCID - to do - - --> - - <region group="LUCID" name = "lucid"> - <range field="part" value="LUCID" /> - </region> - - <region group="LUCID_Online" name = "lucid"> - <range field="part" value="LUCID_Online" /> - </region> - - <!-- - - ZDC - - --> - - <!-- ZDC - offline --> - - <region group="ZDC" name = "zdc"> - <range field="part" value="ZDC" /> - <range field="side" values="negative positive"/> - <range field="module" minvalue="0" maxvalue="3"/> - <range field="type" minvalue="0" maxvalue="1" /> - <range field="channel" minvalue="0" maxvalue="63" /> - </region> - - <!-- ZDC - online --> - - <region group="ZDC_Online" name = "zdc_online"> - <range field="part" value="ZDC_Online" /> - <range field="side" values="negative positive"/> - <range field="module" minvalue="0" maxvalue="3"/> - <range field="type" minvalue="0" maxvalue="1" /> - <range field="channel" minvalue="0" maxvalue="63" /> - <range field="gain" minvalue="0" maxvalue="1" /> - <range field="delay" minvalue="0" maxvalue="1" /> - </region> - - <!-- - - EXTRA - to do - - --> - - <region group="EXTRA" name = "extra"> - <range field="part" value="Extra" /> - </region> - - <region group="EXTRA_Online" name = "extra"> - <range field="part" value="Extra_Online" /> - </region> - - -</IdDictionary> - diff --git a/graphics/AtlantisJava/geometry/IdDictInnerDetector.xml b/graphics/AtlantisJava/geometry/IdDictInnerDetector.xml deleted file mode 100755 index 98c405c193ab543bb28f7f837b27879d3a79420c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDictInnerDetector.xml +++ /dev/null @@ -1,559 +0,0 @@ - - -<!-- - - The InnerDetector identifier is arranged as follows - - InnerDetector - part=Pixel - side=barrel - layer phi_module eta_module phi_index eta_index - side=endcap - disk phi_module eta_module phi_index eta_index - - part=SCT - side=barrel - layer phi_module eta_module side strip - side=endcap - disk phi_module eta_module side strip - - part=TRT - side=barrel - layer phi_module straw_layer straw - side=endcap - wheel phi_module straw_layer straw - - - --> - -<IdDictionary name="InnerDetector" > - - <!-- - Start by defining some symbolic labels used for some fields - (other fields will be specified by numeric ranges) - --> - - <field name="part" > - <label name="Pixel" value="1" /> - <label name="SCT" value="2" /> - <label name="TRT" value="3" /> - </field> - - <field name="barrel_endcap"> - <label name="negative_endcap" value="-2" /> - <label name="negative_barrel" value="-1" /> - <label name="barrel" value="0" /> - <label name="positive_barrel" value="+1" /> - <label name="positive_endcap" value="+2" /> - </field> - - - - <!-- - - Pixel - - --> - - <!-- Dummy region: This forces the bit packing to be the same for all layouts --> - - <region group="pixel" name = "dummy"> - <range field="part" value="Pixel" /> - <range field="barrel_endcap" values="negative_endcap barrel positive_endcap"/> - <range field="layer" minvalue="0" maxvalue="2"/> - <range field="phi_module" minvalue="0" maxvalue="51" /> - <range field="eta_module" minvalue="-6" maxvalue="+6" /> - <range field="phi_index" minvalue="0" maxvalue="327" /> - <range field="eta_index" minvalue="0" maxvalue="191" /> - </region> - - - <!-- - Define few subregions which are re-used in several id-ranges. - --> - - <subregion name="pixel_barrel"> - <range field="part" value="Pixel" /> - <range field="barrel_endcap" value="barrel" /> - </subregion> - - <subregion name="pixel_endcap"> - <range field="part" value="Pixel" /> - <range field="barrel_endcap" values="negative_endcap positive_endcap" /> - </subregion> - - <subregion name="pixel_default_eta_module"> - <range field="phi_index" minvalue="0" maxvalue="327" /> - <range field="eta_index" minvalue="0" maxvalue="143" /> - </subregion> - - <subregion name="pixel_phi_barrel_module"> - <range field="eta_module" minvalue="-6" maxvalue="+6" /> - <reference subregion="pixel_default_eta_module" /> - </subregion> - - <subregion name="pixel_phi_endcap_module"> - <range field="eta_module" value="0" /> - <reference subregion="pixel_default_eta_module" /> - </subregion> - - <!-- - Then enumerate all the possible regions of the Pixel subdetector. - Each region corresponds to an identifier range. - --> - - <!-- - The follow region is the pixel b-layer. Normally, the correct - phi_index max should be 319, but we set it to 327 as for the other - layers to allow to calculate the pixel_id from SiDigit, i.e. using - the G3 numbering which is not completely correct. This should be a - temporary fix. Correct specif: - <range field="phi_index" minvalue="0" maxvalue="319" /> - --> - <alternate_regions> - <region group="pixel" > - <reference subregion="pixel_barrel" /> - <range field="layer" value="0" /> - <range field="phi_module" minvalue="0" maxvalue="21" wraparound="TRUE" /> - <range field="eta_module" minvalue="-6" maxvalue="+6" /> - <range field="phi_index" minvalue="0" maxvalue="327" /> - <range field="eta_index" minvalue="0" maxvalue="191" /> - </region> - <region group="pixel" tag="initial_layout" > - <reference subregion="pixel_barrel" /> - <range field="layer" value="0" /> - <range field="phi_module" minvalue="0" maxvalue="21" wraparound="TRUE" /> - <reference subregion="pixel_phi_barrel_module" /> - </region> - <region group="pixel" tag="final_layout" > - <reference subregion="pixel_barrel" /> - <range field="layer" value="0" /> - <range field="phi_module" minvalue="0" maxvalue="21" wraparound="TRUE" /> - <reference subregion="pixel_phi_barrel_module" /> - </region> - <region group="pixel" tag="destaged_layout" > - <reference subregion="pixel_barrel" /> - <range field="layer" value="0" /> - <range field="phi_module" minvalue="0" maxvalue="21" wraparound="TRUE" /> - <reference subregion="pixel_phi_barrel_module" /> - </region> - </alternate_regions> - - <alternate_regions> - <region group="pixel" > - <reference subregion="pixel_barrel" /> - <range field="layer" value="1" /> - <range field="phi_module" minvalue="0" maxvalue="37" wraparound="TRUE" /> - <reference subregion="pixel_phi_barrel_module" /> - </region> - <region group="pixel" tag="initial_layout" /> - <region group="pixel" tag="final_layout" > - <reference subregion="pixel_barrel" /> - <range field="layer" value="1" /> - <range field="phi_module" minvalue="0" maxvalue="37" wraparound="TRUE" /> - <reference subregion="pixel_phi_barrel_module" /> - </region> - <region group="pixel" tag="destaged_layout" > - <reference subregion="pixel_barrel" /> - <range field="layer" value="1" /> - <range field="phi_module" minvalue="0" maxvalue="37" wraparound="TRUE" /> - <reference subregion="pixel_phi_barrel_module" /> - </region> - </alternate_regions> - - <region group="pixel" > - <reference subregion="pixel_barrel" /> - <range field="layer" value="2" /> - <range field="phi_module" minvalue="0" maxvalue="51" wraparound="TRUE" /> - <reference subregion="pixel_phi_barrel_module" /> - </region> - - <alternate_regions> - <region group="pixel" > - <reference subregion="pixel_endcap" /> - <range field="disk" minvalue="0" maxvalue="2" /> - <range field="phi_module" minvalue="0" maxvalue="47" wraparound="TRUE" /> - <reference subregion="pixel_phi_endcap_module" /> - </region> - <region group="pixel" tag="initial_layout" > - <reference subregion="pixel_endcap" /> - <range field="disk" values="0 2" /> - <range field="phi_module" minvalue="0" maxvalue="47" wraparound="TRUE" /> - <reference subregion="pixel_phi_endcap_module" /> - </region> - <region group="pixel" tag="final_layout" > - <reference subregion="pixel_endcap" /> - <range field="disk" minvalue="0" maxvalue="2" /> - <range field="phi_module" minvalue="0" maxvalue="47" wraparound="TRUE" /> - <reference subregion="pixel_phi_endcap_module" /> - </region> - <region group="pixel" tag="destaged_layout" > - <reference subregion="pixel_endcap" /> - <range field="disk" minvalue="0" maxvalue="2" /> - <range field="phi_module" minvalue="0" maxvalue="47" wraparound="TRUE" /> - <reference subregion="pixel_phi_endcap_module" /> - </region> - </alternate_regions> - - - - <!-- - - SCT - - --> - - - <subregion name="SCT_barrel"> - <range field="part" value="SCT" /> - <range field="barrel_endcap" value="barrel" /> - </subregion> - - <subregion name="SCT_endcap"> - <range field="part" value="SCT" /> - <range field="barrel_endcap" values="negative_endcap positive_endcap" /> - </subregion> - - <subregion name="SCT_eta_module"> - <range field="side" minvalue="0" maxvalue="1" /> - <range field="strip" minvalue="0" maxvalue="767" /> - </subregion> - - - - - <subregion name="SCT_phi_negative_barrel_module"> - <range field="eta_module" minvalue="-6" maxvalue="-1" next_value="1" /> - <reference subregion="SCT_eta_module" /> - </subregion> - - <region group="sct" > - <reference subregion="SCT_barrel" /> - <range field="layer" value="0" /> - <range field="phi_module" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <reference subregion="SCT_phi_negative_barrel_module" /> - </region> - - <region group="sct" > - <reference subregion="SCT_barrel" /> - <range field="layer" value="1" /> - <range field="phi_module" minvalue="0" maxvalue="39" wraparound="TRUE" /> - <reference subregion="SCT_phi_negative_barrel_module" /> - </region> - - <region group="sct" > - <reference subregion="SCT_barrel" /> - <range field="layer" value="2" /> - <range field="phi_module" minvalue="0" maxvalue="47" wraparound="TRUE" /> - <reference subregion="SCT_phi_negative_barrel_module" /> - </region> - - <region group="sct" > - <reference subregion="SCT_barrel" /> - <range field="layer" value="3" /> - <range field="phi_module" minvalue="0" maxvalue="55" wraparound="TRUE"/> - <reference subregion="SCT_phi_negative_barrel_module" /> - </region> - - - - - - <subregion name="SCT_phi_positive_barrel_module"> - <range field="eta_module" minvalue="+1" maxvalue="+6" prev_value="-1" /> - <reference subregion="SCT_eta_module" /> - </subregion> - - <region group="sct" > - <reference subregion="SCT_barrel" /> - <range field="layer" value="0" /> - <range field="phi_module" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <reference subregion="SCT_phi_positive_barrel_module" /> - </region> - - <region group="sct" > - <reference subregion="SCT_barrel" /> - <range field="layer" value="1" /> - <range field="phi_module" minvalue="0" maxvalue="39" wraparound="TRUE" /> - <reference subregion="SCT_phi_positive_barrel_module" /> - </region> - - <region group="sct" > - <reference subregion="SCT_barrel" /> - <range field="layer" value="2" /> - <range field="phi_module" minvalue="0" maxvalue="47" wraparound="TRUE" /> - <reference subregion="SCT_phi_positive_barrel_module" /> - </region> - - <region group="sct" > - <reference subregion="SCT_barrel" /> - <range field="layer" value="3" /> - <range field="phi_module" minvalue="0" maxvalue="55" wraparound="TRUE" /> - <reference subregion="SCT_phi_positive_barrel_module" /> - </region> - - <subregion name="SCT_ring_0"> - <range field="phi_module" minvalue="0" maxvalue="51" wraparound="TRUE" /> - <range field="eta_module" value="0" /> - <reference subregion="SCT_eta_module" /> - </subregion> - - <subregion name="SCT_ring_1"> - <range field="phi_module" minvalue="0" maxvalue="39" wraparound="TRUE" /> - <range field="eta_module" value="1" /> - <reference subregion="SCT_eta_module" /> - </subregion> - - <subregion name="SCT_ring_1_2"> - <range field="phi_module" minvalue="0" maxvalue="39" wraparound="TRUE" /> - <range field="eta_module" minvalue="1" maxvalue="2" /> - <reference subregion="SCT_eta_module" /> - </subregion> - - <region group="sct" name="SCT_endcap_ring0_disks08"> - <reference subregion="SCT_endcap" /> - <range field="disk" minvalue="0" maxvalue="8" /> - <reference subregion="SCT_ring_0" /> - </region> - - - <region group="sct" name="SCT_endcap_ring1_disk0"> - <reference subregion="SCT_endcap" /> - <range field="disk" value="0" /> - <reference subregion="SCT_ring_1" /> - </region> - - <region group="sct" name="SCT_endcap_rings12_disks15"> - <reference subregion="SCT_endcap" /> - <range field="disk" minvalue="1" maxvalue="5" /> - <reference subregion="SCT_ring_1_2" /> - </region> - - <region group="sct" name="SCT_endcap_ring1_disks67"> - <reference subregion="SCT_endcap" /> - <range field="disk" minvalue="6" maxvalue="7" /> - <reference subregion="SCT_ring_1" /> - </region> - - <!-- - - TRT - - --> - - <subregion name="TRT_barrel"> - <range field="part" value="TRT" /> - <range field="barrel_endcap" values="negative_barrel positive_barrel" /> - </subregion> - - <subregion name="TRT_endcap"> - <range field="part" value="TRT" /> - <range field="barrel_endcap" values="negative_endcap positive_endcap" /> - </subregion> - - - - <subregion name="TRT_layer_0"> - <reference subregion="TRT_barrel" /> - <range field="phi_sector" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer_or_wheel" value="0" /> - </subregion> - - <region group="trt" > - <reference subregion="TRT_layer_0" /> - <range field="straw_layer" value="0" /> - <range field="straw" minvalue="0" maxvalue="14" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_0" /> - <range field="straw_layer" minvalue="1" maxvalue="4" /> - <range field="straw" minvalue="0" maxvalue="15" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_0" /> - <range field="straw_layer" minvalue="5" maxvalue="9" /> - <range field="straw" minvalue="0" maxvalue="16" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_0" /> - <range field="straw_layer" minvalue="10" maxvalue="14" /> - <range field="straw" minvalue="0" maxvalue="17" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_0" /> - <range field="straw_layer" minvalue="15" maxvalue="17" /> - <range field="straw" minvalue="0" maxvalue="18" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_0" /> - <range field="straw_layer" value="18" /> - <range field="straw" minvalue="0" maxvalue="17" /> - </region> - - - - - - <subregion name="TRT_layer_1"> - <reference subregion="TRT_barrel" /> - <range field="phi_sector" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer_or_wheel" value="1" /> - </subregion> - - <region group="trt" > - <reference subregion="TRT_layer_1" /> - <range field="straw_layer" value="0" /> - <range field="straw" minvalue="0" maxvalue="18" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_1" /> - <range field="straw_layer" minvalue="1" maxvalue="5" /> - <range field="straw" minvalue="0" maxvalue="19" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_1" /> - <range field="straw_layer" minvalue="6" maxvalue="10" /> - <range field="straw" minvalue="0" maxvalue="20" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_1" /> - <range field="straw_layer" minvalue="11" maxvalue="15" /> - <range field="straw" minvalue="0" maxvalue="21" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_1" /> - <range field="straw_layer" minvalue="16" maxvalue="20" /> - <range field="straw" minvalue="0" maxvalue="22" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_1" /> - <range field="straw_layer" minvalue="21" maxvalue="22" /> - <range field="straw" minvalue="0" maxvalue="23" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_1" /> - <range field="straw_layer" value="23" /> - <range field="straw" minvalue="0" maxvalue="22" /> - </region> - - - - - - <subregion name="TRT_layer_2"> - <reference subregion="TRT_barrel" /> - <range field="phi_sector" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer_or_wheel" value="2" /> - </subregion> - - <region group="trt" > - <reference subregion="TRT_layer_2" /> - <range field="straw_layer" value="0" /> - <range field="straw" minvalue="0" maxvalue="22" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_2" /> - <range field="straw_layer" minvalue="1" maxvalue="4" /> - <range field="straw" minvalue="0" maxvalue="23" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_2" /> - <range field="straw_layer" minvalue="5" maxvalue="9" /> - <range field="straw" minvalue="0" maxvalue="24" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_2" /> - <range field="straw_layer" minvalue="10" maxvalue="14" /> - <range field="straw" minvalue="0" maxvalue="25" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_2" /> - <range field="straw_layer" minvalue="15" maxvalue="19" /> - <range field="straw" minvalue="0" maxvalue="26" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_2" /> - <range field="straw_layer" minvalue="20" maxvalue="24" /> - <range field="straw" minvalue="0" maxvalue="27" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_2" /> - <range field="straw_layer" minvalue="25" maxvalue="28" /> - <range field="straw" minvalue="0" maxvalue="28" /> - </region> - - <region group="trt" > - <reference subregion="TRT_layer_2" /> - <range field="straw_layer" value="29" /> - <range field="straw" minvalue="0" maxvalue="27" /> - </region> - - - - - <region group="trt" > - <reference subregion="TRT_endcap" /> - <range field="phi_sector" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer_or_wheel" minvalue="0" maxvalue="5" /> - <range field="straw_layer" minvalue="0" maxvalue="15" /> - <range field="straw" minvalue="0" maxvalue="23" /> - </region> - - <region group="trt" > - <reference subregion="TRT_endcap" /> - <range field="phi_sector" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer_or_wheel" minvalue="6" maxvalue="13" /> - <range field="straw_layer" minvalue="0" maxvalue="7" /> - <range field="straw" minvalue="0" maxvalue="23" /> - </region> - - <alternate_regions> - <region group="trt" > - <reference subregion="TRT_endcap" /> - <range field="phi_sector" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer_or_wheel" minvalue="14" maxvalue="17" /> - <range field="straw_layer" minvalue="0" maxvalue="15" /> - <range field="straw" minvalue="0" maxvalue="17" /> - </region> - <region group="trt" tag="initial_layout" /> - <region group="trt" tag="final_layout" > - <reference subregion="TRT_endcap" /> - <range field="phi_sector" minvalue="0" maxvalue="31" wraparound="TRUE" /> - <range field="layer_or_wheel" minvalue="14" maxvalue="17" /> - <range field="straw_layer" minvalue="0" maxvalue="15" /> - <range field="straw" minvalue="0" maxvalue="17" /> - </region> - <region group="trt" tag="destaged_layout" /> - </alternate_regions> - - <!-- Dummy region: This forces the bit packing to be the same for all layouts --> - - <region group="trt" name = "dummy"> - <range field="part" value="TRT" /> - <range field="barrel_endcap" values="negative_endcap negative_barrel positive_barrel positive_endcap"/> - <range field="phi_sector" minvalue="0" maxvalue="31" /> - <range field="layer_or_wheel" minvalue="0" maxvalue="17" /> - <range field="straw_layer" minvalue="0" maxvalue="29" /> - <range field="straw" minvalue="0" maxvalue="28" /> - </region> - - -</IdDictionary> - diff --git a/graphics/AtlantisJava/geometry/IdDictLArCalorimeter.xml b/graphics/AtlantisJava/geometry/IdDictLArCalorimeter.xml deleted file mode 100755 index 9eac43e86363c4204fac23074fcd89c805420974..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDictLArCalorimeter.xml +++ /dev/null @@ -1,694 +0,0 @@ -<IdDictionary name="LArCalorimeter" version="fullAtlas" > - - <field name="part" > - <label name="LArEM" value="1" /> - <label name="LArHEC" value="2" /> - <label name="LArFCAL" value="3" /> - <label name="LArOnline" value="4" /> - <label name="LArOnlineCalib" value="5" /> - <label name="LArEMdisc" value="-1" /> - <label name="LArHECdisc" value="-2" /> - <label name="LArFCALdisc" value="-3" /> - </field> - - <field name="barrel-endcap"> - <label name="negative-endcap-inner-wheel" value="-3" /> - <label name="negative-endcap-outer-wheel" value="-2" /> - <label name="negative-barrel" value="-1" /> - <label name="barrel" value="0" /> - <label name="positive-barrel" value="+1" /> - <label name="positive-endcap-outer-wheel" value="+2" /> - <label name="positive-endcap-inner-wheel" value="+3" /> - </field> - - <field name="barrel-ec"> - <label name="barrel" value="0" /> - <label name="endcap" value="1" /> - </field> - - <field name="pos_neg"> - <label name="negative-side" value="0" /> - <label name="positive-side" value="1" /> - </field> - - <subregion name="LArFCAL-module" > - <range field="phi-fcal" minvalue="0" maxvalue="15" wraparound="TRUE" /> - </subregion> - - <subregion name="LArEM-extralarge-module" > - <range field="phi" minvalue="0" maxvalue="31" wraparound="TRUE" /> - </subregion> - - <subregion name="LArEM-large-module" > - <range field="phi" minvalue="0" maxvalue="63" wraparound="TRUE" /> - </subregion> - - <subregion name="LArEM-thin-module" > - <range field="phi" minvalue="0" maxvalue="255" wraparound="TRUE" /> - </subregion> - - - - <!-- EM Barrel --> - - <subregion name="LArEM-barrel" > - <range field="part" value="LArEM" /> - <range field="barrel-endcap" values="negative-barrel positive-barrel" /> - </subregion> - - <region group="lar_em" name="LArEM-barrel-00" - next_samp="LArEM-barrel-10 LArEM-barrel-11" - next_subdet="LArEM-outer-wheel-10 LArEM-outer-wheel-00" - eta0="0.0" deta="0.025" phi0="0.0" dphi="64" > - <reference subregion="LArEM-barrel" /> - <range field="sampling" value="0" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="60" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-barrel-10" next_abs_eta="LArEM-barrel-11" - prev_samp="LArEM-barrel-00" - next_samp="LArEM-barrel-20" - eta0="0.003125" deta="0.003125" phi0="0.0" dphi="64" > - <reference subregion="LArEM-barrel" /> - <range field="sampling" value="1" /> - <range field="region" value="0" /> - <range field="eta" minvalue="1" maxvalue="447" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-barrel-11" - prev_samp="LArEM-barrel-00" - next_samp="LArEM-barrel-21" - eta0="1.4" deta="0.025" phi0="0.0" dphi="256" > - <reference subregion="LArEM-barrel" /> - <range field="sampling" value="1" /> - <range field="region" value="1" /> - <range field="eta" minvalue="0" maxvalue="2" /> - <reference subregion="LArEM-thin-module" /> - </region> - - <region group="lar_em" name="LArEM-barrel-20" next_abs_eta="LArEM-barrel-21" - prev_samp="LArEM-barrel-10" - next_samp="LArEM-barrel-30" - eta0="0.0" deta="0.025" phi0="0.0" dphi="256" > - <reference subregion="LArEM-barrel" /> - <range field="sampling" value="2" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="55" /> - <reference subregion="LArEM-thin-module" /> - </region> - - <region group="lar_em" name="LArEM-barrel-21" - prev_samp="LArEM-barrel-11" - next_subdet="LArEM-outer-wheel-10" - eta0="1.4" deta="0.075" phi0="0.0" dphi="256" > - <reference subregion="LArEM-barrel" /> - <range field="sampling" value="2" /> - <range field="region" value="1" /> - <range field="eta" value="0" /> - <reference subregion="LArEM-thin-module" /> - </region> - - <region group="lar_em" name="LArEM-barrel-30" - prev_samp="LArEM-barrel-20" eta0="0.0" deta="0.05" phi0="0.0" dphi="256" > - <reference subregion="LArEM-barrel" /> - <range field="sampling" value="3" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="26" /> - <reference subregion="LArEM-thin-module" /> - </region> - - - - <!-- EM outer wheel --> - - <subregion name="LArEM-outer-wheel" > - <range field="part" value="LArEM" /> - <range field="barrel-endcap" values="negative-endcap-outer-wheel positive-endcap-outer-wheel" /> - </subregion> - - <region group="lar_em" name="LArEM-outer-wheel-00" - next_samp="LArEM-outer-wheel-12" - prev_subdet="LArEM-barrel-00" - eta0="1.5" deta="0.025" phi0="0.0" dphi="64" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="0" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="11" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-10" next_abs_eta="LArEM-outer-wheel-11" - next_samp="LArEM-outer-wheel-20" - prev_subdet="LArEM-barrel-00 LArEM-barrel-21" - eta0="1.375" deta="0.05" phi0="0.0" dphi="64" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="1" /> - <range field="region" value="0" /> - <range field="eta" value="0" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-11" next_abs_eta="LArEM-outer-wheel-12" - next_samp="LArEM-outer-wheel-21" eta0="1.425" deta="0.025" phi0="0.0" dphi="64" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="1" /> - <range field="region" value="1" /> - <range field="eta" minvalue="0" maxvalue="2" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-12" next_abs_eta="LArEM-outer-wheel-13" - prev_samp="LArEM-outer-wheel-00" - next_samp="LArEM-outer-wheel-21" eta0="1.5" deta="0.003125" phi0="0.0" dphi="64" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="1" /> - <range field="region" value="2" /> - <range field="eta" minvalue="0" maxvalue="95" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-13" next_abs_eta="LArEM-outer-wheel-14" - next_samp="LArEM-outer-wheel-21" eta0="1.8" deta="0.0041666666667" phi0="0.0" dphi="64" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="1" /> - <range field="region" value="3" /> - <range field="eta" minvalue="0" maxvalue="47" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-14" next_abs_eta="LArEM-outer-wheel-15" - next_samp="LArEM-outer-wheel-21" eta0="2.0" deta="0.00625" phi0="0.0" dphi="64" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="1" /> - <range field="region" value="4" /> - <range field="eta" minvalue="0" maxvalue="63" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-15" - next_samp="LArEM-outer-wheel-21" eta0="2.4" deta="0.025" phi0="0.0" dphi="64" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="1" /> - <range field="region" value="5" /> - <range field="eta" minvalue="0" maxvalue="3" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-20" next_abs_eta="LArEM-outer-wheel-21" - prev_samp="LArEM-outer-wheel-10" eta0="1.375" deta="0.05" phi0="0.0" dphi="256" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="2" /> - <range field="region" value="0" /> - <range field="eta" value="0" /> - <reference subregion="LArEM-thin-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-21" next_abs_eta="LArEM-inner-wheel-10" - prev_samp="LArEM-outer-wheel-11 LArEM-outer-wheel-12 LArEM-outer-wheel-13 LArEM-outer-wheel-14 LArEM-outer-wheel-15" - next_samp="LArEM-outer-wheel-30" eta0="1.425" deta="0.025" phi0="0.0" dphi="256" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="2" /> - <range field="region" value="1" /> - <range field="eta" minvalue="0" maxvalue="42" /> - <reference subregion="LArEM-thin-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-30" next_abs_eta="LArEM-inner-wheel-20" - prev_samp="LArEM-outer-wheel-21" eta0="1.5" deta="0.05" phi0="0.0" dphi="256" > - <reference subregion="LArEM-outer-wheel" /> - <range field="sampling" value="3" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="19" /> - <reference subregion="LArEM-thin-module" /> - </region> - - - - - - - <!-- EM inner wheel --> - - <subregion name="LArEM-inner-wheel" > - <range field="part" value="LArEM" /> - <range field="barrel-endcap" values="negative-endcap-inner-wheel positive-endcap-inner-wheel" /> - </subregion> - - <region group="lar_em" name="LArEM-inner-wheel-10" - next_samp="LArEM-inner-wheel-20" eta0="2.5" deta="0.1" phi0="0.0" dphi="64" > - <reference subregion="LArEM-inner-wheel" /> - <range field="sampling" value="1" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="6" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-inner-wheel-20" - prev_samp="LArEM-inner-wheel-10" eta0="2.5" deta="0.1" phi0="0.0" dphi="64" > - <reference subregion="LArEM-inner-wheel" /> - <range field="sampling" value="2" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="6" /> - <reference subregion="LArEM-large-module" /> - </region> - - - - - - <!-- - - LArHEC - - --> - - <subregion name="LArHEC" > - <range field="part" value="LArHEC" /> - <range field="barrel-endcap" values="negative-endcap-outer-wheel positive-endcap-outer-wheel" /> - </subregion> - - <region group="lar_hec" name="LArHEC-00" next_abs_eta="LArHEC-01" - next_samp="LArHEC-10" eta0="1.5" deta="0.1" phi0="0.0" dphi="64" > - <reference subregion="LArHEC" /> - <range field="sampling" value="0" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="9" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_hec" name="LArHEC-10" next_abs_eta="LArHEC-11" - next_samp="LArHEC-20" prev_samp="LArHEC-00" eta0="1.5" deta="0.1" phi0="0.0" dphi="64" > - <reference subregion="LArHEC" /> - <range field="sampling" value="1" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="9" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_hec" name="LArHEC-20" next_abs_eta="LArHEC-21" - next_samp="LArHEC-30" prev_samp="LArHEC-10" eta0="1.6" deta="0.1" phi0="0.0" dphi="64" > - <reference subregion="LArHEC" /> - <range field="sampling" values="2" /> - <range field="region" value="0" /> - <range field="eta" minvalue="1" maxvalue="9" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_hec" name="LArHEC-30" next_abs_eta="LArHEC-31" - prev_samp="LArHEC-20" eta0="1.7" deta="0.1" phi0="0.0" dphi="64" > - <reference subregion="LArHEC" /> - <range field="sampling" values="3" /> - <range field="region" value="0" /> - <range field="eta" minvalue="2" maxvalue="9" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_hec" name="LArHEC-01" - next_samp="LArHEC-11" eta0="2.5" deta="0.2" phi0="0.0" dphi="32" > - <reference subregion="LArHEC" /> - <range field="sampling" value="0" /> - <range field="region" value="1" /> - <range field="eta" minvalue="0" maxvalue="3" /> - <reference subregion="LArEM-extralarge-module" /> - </region> - - <region group="lar_hec" name="LArHEC-11" next_abs_eta="LArFCAL-1" - next_samp="LArHEC-21" prev_samp="LArHEC-01" eta0="2.5" deta="0.2" phi0="0.0" dphi="32" > - <reference subregion="LArHEC" /> - <range field="sampling" value="1" /> - <range field="region" value="1" /> - <range field="eta" minvalue="0" maxvalue="2" /> - <reference subregion="LArEM-extralarge-module" /> - </region> - - <region group="lar_hec" name="LArHEC-21" - next_samp="LArHEC-31" prev_samp="LArHEC-11" eta0="2.5" deta="0.2" phi0="0.0" dphi="32" > - <reference subregion="LArHEC" /> - <range field="sampling" value="2" /> - <range field="region" value="1" /> - <range field="eta" minvalue="0" maxvalue="2" /> - <reference subregion="LArEM-extralarge-module" /> - </region> - - <region group="lar_hec" name="LArHEC-31" - prev_samp="LArHEC-21" eta0="2.5" deta="0.2" phi0="0.0" dphi="32" > - <reference subregion="LArHEC" /> - <range field="sampling" value="3" /> - <range field="region" value="1" /> - <range field="eta" minvalue="0" maxvalue="3" /> - <reference subregion="LArEM-extralarge-module" /> - </region> - - - - - <!-- - - LArFCAL - - --> - - <subregion name="LArFCAL" > - <range field="part" value="LArFCAL" /> - <range field="barrel-endcap" values="negative-endcap-outer-wheel positive-endcap-outer-wheel" /> - </subregion> - - <region group="lar_fcal" name="LArFCAL-1" - eta0="3.2" deta="0.025" phi0="0.0" dphi="16" > - <reference subregion="LArFCAL" /> - <range field="module" value="1" /> - <range field="eta-fcal" minvalue="0" maxvalue="62" /> - <reference subregion="LArFCAL-module" /> - </region> - - <region group="lar_fcal" name="LArFCAL-2a" - eta0="3.2" deta="0.05" phi0="0.0" dphi="16" > - <reference subregion="LArFCAL" /> - <range field="module" value="2" /> - <range field="eta-fcal" minvalue="0" maxvalue="29" /> - <range field="phi-fcal" values="0 7 8 15" /> - </region> - - <region group="lar_fcal" name="LArFCAL-2b" - eta0="3.2" deta="0.05" phi0="0.0" dphi="16" > - <reference subregion="LArFCAL" /> - <range field="module" value="2" /> - <range field="eta-fcal" minvalue="0" maxvalue="30" /> - <range field="phi-fcal" values="3 4 11 12" /> - </region> - - <region group="lar_fcal" name="LArFCAL-2c" - eta0="3.2" deta="0.05" phi0="0.0" dphi="16" > - <reference subregion="LArFCAL" /> - <range field="module" value="2" /> - <range field="eta-fcal" minvalue="0" maxvalue="31" /> - <range field="phi-fcal" values="1 2 5 6 9 10 13 14" /> - </region> - - <region group="lar_fcal" name="LArFCAL-3a" - eta0="3.2" deta="0.1" phi0="0.0" dphi="16" > - <reference subregion="LArFCAL" /> - <range field="module" value="3" /> - <range field="eta-fcal" minvalue="0" maxvalue="14" /> - <range field="phi-fcal" values="2 10" /> - </region> - - <region group="lar_fcal" name="LArFCAL-3b" - eta0="3.2" deta="0.1" phi0="0.0" dphi="16" > - <reference subregion="LArFCAL" /> - <range field="module" value="3" /> - <range field="eta-fcal" minvalue="0" maxvalue="15" /> - <range field="phi-fcal" values="0 1 3 4 5 6 7 8 9 11 12 13 14 15" /> - </region> - - - - <!-- - - Disconnected Channels - - --> - - <subregion name="LArEM-barreldisc" > - <range field="part" value="LArEMdisc" /> - <range field="barrel-endcap" values="negative-barrel positive-barrel" /> - </subregion> - - <region group="lar_em" name="LArEM-barrel-00disconnected" > - <reference subregion="LArEM-barreldisc" /> - <range field="sampling" value="0" /> - <range field="region" value="0" /> - <range field="eta" minvalue="61" maxvalue="63" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-barrel-10disconnected" > - <reference subregion="LArEM-barreldisc" /> - <range field="sampling" value="1" /> - <range field="region" value="0" /> - <range field="eta" value="0" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-barrel-30disconnected" > - <reference subregion="LArEM-barreldisc" /> - <range field="sampling" value="3" /> - <range field="region" value="0" /> - <range field="eta" value="27" /> - <reference subregion="LArEM-thin-module" /> - </region> - - - <subregion name="LArEM-outer-wheeldisc" > - <range field="part" value="LArEMdisc" /> - <range field="barrel-endcap" values="negative-endcap-outer-wheel positive-endcap-outer-wheel" /> - </subregion> - - <region group="lar_em" name="LArEM-outer-wheel-00disconnected" > - <reference subregion="LArEM-outer-wheeldisc" /> - <range field="sampling" value="0" /> - <range field="region" value="0" /> - <range field="eta" minvalue="12" maxvalue="19" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-11disconnected" > - <reference subregion="LArEM-outer-wheeldisc" /> - <range field="sampling" value="1" /> - <range field="region" value="1" /> - <range field="eta" minvalue="3" maxvalue="6" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-13disconnected" > - <reference subregion="LArEM-outer-wheeldisc" /> - <range field="sampling" value="1" /> - <range field="region" value="3" /> - <range field="eta" minvalue="48" maxvalue="63" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-outer-wheel-15disconnected" > - <reference subregion="LArEM-outer-wheeldisc" /> - <range field="sampling" value="1" /> - <range field="region" value="5" /> - <range field="eta" minvalue="4" maxvalue="7" /> - <reference subregion="LArEM-large-module" /> - </region> - - - <subregion name="LArEM-inner-wheeldisc" > - <range field="part" value="LArEMdisc" /> - <range field="barrel-endcap" values="negative-endcap-inner-wheel positive-endcap-inner-wheel" /> - </subregion> - - <region group="lar_em" name="LArEM-inner-wheel-10disconnected" > - <reference subregion="LArEM-inner-wheeldisc" /> - <range field="sampling" value="1" /> - <range field="region" value="0" /> - <range field="eta" value="7" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_em" name="LArEM-inner-wheel-20disconnected" > - <reference subregion="LArEM-inner-wheeldisc" /> - <range field="sampling" value="2" /> - <range field="region" value="0" /> - <range field="eta" value="7" /> - <reference subregion="LArEM-large-module" /> - </region> - - - - <subregion name="LArHECdisc" > - <range field="part" value="LArHECdisc" /> - <range field="barrel-endcap" values="negative-endcap-outer-wheel positive-endcap-outer-wheel" /> - </subregion> - - <region group="lar_hec" name="LArHEC-20disconnected" > - <reference subregion="LArHECdisc" /> - <range field="sampling" values="2" /> - <range field="region" value="0" /> - <range field="eta" value="0" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_hec" name="LArHEC-30disconnected" > - <reference subregion="LArHECdisc" /> - <range field="sampling" values="3" /> - <range field="region" value="0" /> - <range field="eta" minvalue="0" maxvalue="1" /> - <reference subregion="LArEM-large-module" /> - </region> - - <region group="lar_hec" name="LArHEC-11disconnected" > - <reference subregion="LArHECdisc" /> - <range field="sampling" value="1" /> - <range field="region" value="1" /> - <range field="eta" value="3" /> - <reference subregion="LArEM-extralarge-module" /> - </region> - - <region group="lar_hec" name="LArHEC-21disconnected" > - <reference subregion="LArHECdisc" /> - <range field="sampling" value="2" /> - <range field="region" value="1" /> - <range field="eta" value="3" /> - <reference subregion="LArEM-extralarge-module" /> - </region> - - - <subregion name="LArFCALdisc" > - <range field="part" value="LArFCALdisc" /> - <range field="barrel-endcap" values="negative-endcap-outer-wheel positive-endcap-outer-wheel" /> - </subregion> - - <region group="lar_fcal" name="LArFCAL-1disconnected" > - <reference subregion="LArFCALdisc" /> - <range field="module" value="1" /> - <range field="eta-fcal" value="63" /> - <reference subregion="LArFCAL-module" /> - </region> - - <region group="lar_fcal" name="LArFCAL-2adisconnected" > - <reference subregion="LArFCALdisc" /> - <range field="module" value="2" /> - <range field="eta-fcal" minvalue="30" maxvalue="31" /> - <range field="phi-fcal" values="0 7 8 15" /> - </region> - - <region group="lar_fcal" name="LArFCAL-2bdisconnected" - eta0="3.2" deta="0.05" phi0="0.0" dphi="0.4" > - <reference subregion="LArFCALdisc" /> - <range field="module" value="2" /> - <range field="eta-fcal" value="31" /> - <range field="phi-fcal" values="3 4 11 12" /> - </region> - - <region group="lar_fcal" name="LArFCAL-3adisconnected" > - <reference subregion="LArFCALdisc" /> - <range field="module" value="3" /> - <range field="eta-fcal" value="15" /> - <range field="phi-fcal" values="2 10" /> - </region> - - - <!-- LAr Online --> - - - <!-- LArOnline -Barrel --> - - <subregion name="LArOnline-Barrel"> - <range field="part" value="LArOnline" /> - <range field="barrel-ec" values="barrel" /> - </subregion> - - <region group="LArOnline" name="laronline-barrel"> - <reference subregion="LArOnline-Barrel" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" minvalue="0" maxvalue="31" /> - <range field="slot" minvalue="1" maxvalue="14" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - <!-- LArOnline-EndCap Standard --> - - <subregion name="LArOnline-Endcap"> - <range field="part" value="LArOnline" /> - <range field="barrel-ec" values="endcap" /> - </subregion> - - <region group="LArOnline" name="laronline-endcap-standard"> - <reference subregion="LArOnline-Endcap" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" values="0 1 4 5 7 8 11 12 13 14 17 18 19 20 23 24" /> - <range field="slot" minvalue="1" maxvalue="13" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - <!-- LArOnline-Endcap-Special --> - - <region group="LArOnline" name="laronline-endcap-special" > - <reference subregion="LArOnline-Endcap" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" values="2 9 15 21" /> - <range field="slot" minvalue="1" maxvalue="15" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - <!-- LArOnline-HEC--> - - <region group="LArOnline" name="laronline-hec"> - <reference subregion="LArOnline-Endcap" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" values="3 10 16 22" /> - <range field="slot" values="1 2 5 6 7 8 9 10" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - <!-- LArOnline-FCAL--> - - <region group="LArOnline" name="laronlinefcal" > - <reference subregion="LArOnline-Endcap" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" value="6" /> - <range field="slot" minvalue="1" maxvalue="14" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - <!-- LArOnline -Barrel Calib --> - - <subregion name="LArOnline-Barrel-Calib"> - <range field="part" value="LArOnlineCalib" /> - <range field="barrel-ec" values="barrel" /> - </subregion> - - <region group="LArOnline" name="laronline-barrel-calib"> - <reference subregion="LArOnline-Barrel-Calib" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" minvalue="0" maxvalue="31" /> - <range field="slot" value="15" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - <!-- LArOnline-EndCap Standard Calib --> - - <subregion name="LArOnline-Endcap-Calib"> - <range field="part" value="LArOnlineCalib" /> - <range field="barrel-ec" values="endcap" /> - </subregion> - - <region group="LArOnline" name="laronline-endcap-standard"> - <reference subregion="LArOnline-Endcap-Calib" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" values="0 1 4 5 7 8 11 12 13 14 17 18 19 20 23 24" /> - <range field="slot" value="15" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - <!-- LArOnline-HEC CALIB --> - - <region group="LArOnline" name="laronline-hec-calib"> - <reference subregion="LArOnline-Endcap-Calib" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" values="3 10 16 22" /> - <range field="slot" values="3 4 12" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - <!-- LArOnline-FCAL CALIB --> - - <region group="LArOnline" name="laronline-fcal-calib"> - <reference subregion="LArOnline-Endcap-Calib" /> - <range field="pos_neg" values="negative-side positive-side" /> - <range field="feedthrough" values="6" /> - <range field="slot" value="16" /> - <range field="channel_in_slot" minvalue="0" maxvalue="127" /> - </region> - - -</IdDictionary> - diff --git a/graphics/AtlantisJava/geometry/IdDictLArElectrode.xml b/graphics/AtlantisJava/geometry/IdDictLArElectrode.xml deleted file mode 100755 index 948ccf3d09965521af0cd7eb2cd3f1c7a0714d88..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDictLArElectrode.xml +++ /dev/null @@ -1,327 +0,0 @@ -<IdDictionary name="LArElectrode" version="fullAtlas" > - - <field name="detector" > - <label name="EMB" value="0" /> - <label name="EMBPS" value="1" /> - <label name="EMEC" value="2" /> - <label name="EMECPS" value="3" /> - <label name="HEC" value="4" /> - <label name="FCAL" value="5" /> - <label name="EMBPUR" value="6" /> - <label name="ECPUR" value="7" /> - </field> - - <field name="configuration" > - <label name="Atlas" value="1" /> - <label name="TestBeam" value="2" /> - </field> - - <field name="zside"> - <label name="A" value="0" /> - <label name="C" value="1" /> - </field> - - <field name="module"> - </field> - - <field name="hvphi" > - </field> - - <field name="hveta" > - </field> - - <field name="hvgap" > - </field> - - <field name="electrode"> - </field> - - - <!-- LAr Electrodes--> - - <subregion name="AtlasLArElectrode"> - <range field="configuration" value="Atlas" /> - </subregion> - - <!--EMB-FT=-1 --> - <region group="LArElec" name="EM-BARREL-ALL"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMB" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="15" /> - <range field="hvphi" values="1" /> - <range field="hveta" minvalue="1" maxvalue="7" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="0" maxvalue="31" /> - </region> - - <!--EMB-FT=0 --> - <region group="LArElec" name="EM-BARREL-FT0"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMB" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="15" /> - <range field="hvphi" values="0" /> - <range field="hveta" minvalue="1" maxvalue="7" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="32" maxvalue="63" /> - </region> - - <!--EMBPS --> - <region group="LArElec" name="EM-BARREL-PS"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMBPS" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="31" /> - <range field="hvphi" values="0 1" /> - <range field="hveta" minvalue="1" maxvalue="4" /> - <range field="hvgap" values="0 1" /> - <!--note that this value 'electrode' is DUMMY until confirmation by Hostachy--> - <range field="electrode" value="0" /> - </region> - - <!--EMEC-INNER-WHEEL--> - <region group="LArElec" name="EM-ENDCAP-INNER-S1"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="1" /> - <range field="hveta" minvalue="7" maxvalue="8" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="0" maxvalue="3" /> - </region> - <region group="LArElec" name="EM-ENDCAP-INNER-S2"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="2" /> - <range field="hveta" minvalue="7" maxvalue="8" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="4" maxvalue="7" /> - </region> - <region group="LArElec" name="EM-ENDCAP-INNER-S3"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="3" /> - <range field="hveta" minvalue="7" maxvalue="8" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="8" maxvalue="11" /> - </region> - <region group="LArElec" name="EM-ENDCAP-INNER-S4"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="4" /> - <range field="hveta" minvalue="7" maxvalue="8" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="12" maxvalue="15" /> - </region> - <region group="LArElec" name="EM-ENDCAP-INNER-S5"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="5" /> - <range field="hveta" minvalue="7" maxvalue="8" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="16" maxvalue="19" /> - </region> - <region group="LArElec" name="EM-ENDCAP-INNER-S6"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="6" /> - <range field="hveta" minvalue="7" maxvalue="8" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="20" maxvalue="23" /> - </region> - <region group="LArElec" name="EM-ENDCAP-INNER-S7"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="7" /> - <range field="hveta" minvalue="7" maxvalue="8" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="24" maxvalue="27" /> - </region> - <region group="LArElec" name="EM-ENDCAP-INNER-S8"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="8" /> - <range field="hveta" minvalue="7" maxvalue="8" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="28" maxvalue="31" /> - </region> - - <!--EMEC-OUTER-WHEEL--> - <region group="LArElec" name="EM-ENDCAP-OUTER-S1"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="1" /> - <range field="hveta" minvalue="0" maxvalue="6" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="0" maxvalue="23" /> - </region> - <region group="LArElec" name="EM-ENDCAP-OUTER-S2"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="2" /> - <range field="hveta" minvalue="0" maxvalue="6" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="24" maxvalue="47" /> - </region> - <region group="LArElec" name="EM-ENDCAP-OUTER-S3"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="3" /> - <range field="hveta" minvalue="0" maxvalue="6" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="48" maxvalue="71" /> - </region> - <region group="LArElec" name="EM-ENDCAP-OUTER-S4"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="4" /> - <range field="hveta" minvalue="0" maxvalue="6" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" minvalue="72" maxvalue="95" /> - </region> - - <!--EMEC-PS--> - <region group="LArElec" name="EM-ENDCAP-PS"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMECPS" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="31" /> - <range field="hvphi" value="0" /> - <range field="hveta" value="0" /> - <range field="hvgap" values="0 1" /> - <range field="electrode" value="0" /> - </region> - - <!--HEC--> - <region group="LArElec" name="HEC-ETA1"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="HEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="31" /> - <range field="hvphi" value="0" /> - <range field="hveta" value="1" /> - <range field="hvgap" minvalue="0" maxvalue="3" /> - <range field="electrode" minvalue="1" maxvalue="8" /> - </region> - - <region group="LArElec" name="HEC-ETA2"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="HEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="31" /> - <range field="hvphi" value="0" /> - <range field="hveta" value="2" /> - <range field="hvgap" minvalue="0" maxvalue="3" /> - <range field="electrode" minvalue="9" maxvalue="24" /> - </region> - - <region group="LArElec" name="HEC-ETA3"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="HEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="31" /> - <range field="hvphi" value="0" /> - <range field="hveta" value="3" /> - <range field="hvgap" minvalue="0" maxvalue="3" /> - <range field="electrode" minvalue="25" maxvalue="32" /> - </region> - - <region group="LArElec" name="HEC-ETA4"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="HEC" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="31" /> - <range field="hvphi" value="0" /> - <range field="hveta" value="4" /> - <range field="hvgap" minvalue="0" maxvalue="3" /> - <range field="electrode" minvalue="33" maxvalue="40" /> - </region> - - <!--FCAL--> - - <!--FCAL1--> - <region group="LArElec" name="FCAL-S1"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="FCAL" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="15" /> - <range field="hvphi" value="0" /> - <range field="hveta" value="1" /> - <range field="hvgap" minvalue="0" maxvalue="3" /> - <range field="electrode" value="0" /> - </region> - - <region group="LArElec" name="FCAL-S2"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="FCAL" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="7" /> - <range field="hvphi" value="0" /> - <range field="hveta" value="2" /> - <range field="hvgap" minvalue="0" maxvalue="3" /> - <range field="electrode" value="0" /> - </region> - - <region group="LArElec" name="FCAL-S3"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="FCAL" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="0" maxvalue="3" /> - <range field="hvphi" value="0" /> - <range field="hveta" value="3" /> - <range field="hvgap" minvalue="0" maxvalue="3" /> - <range field="electrode" value="0" /> - </region> - - - <!--EMBPUR--> - <region group="LArElec" name="EMB-PUR"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="EMBPUR" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="1" maxvalue="5" /> - <range field="hvphi" value="0" /> - <range field="hveta" minvalue="0" /> - <range field="hvgap" minvalue="0" maxvalue="1" /> - <range field="electrode" value="0" /> - </region> - - <!--ECPUR--> - <region group="LArElec" name="EC-PUR"> - <reference subregion="AtlasLArElectrode" /> - <range field="detector" value="ECPUR" /> - <range field="zside" values="0 1" /> - <range field="module" minvalue="1" maxvalue="10" /> - <range field="hvphi" value="0" /> - <range field="hveta" minvalue="0" /> - <range field="hvgap" minvalue="0" maxvalue="1" /> - <range field="electrode" value="0" /> - </region> - - -</IdDictionary> - diff --git a/graphics/AtlantisJava/geometry/IdDictLArHighVoltage.xml b/graphics/AtlantisJava/geometry/IdDictLArHighVoltage.xml deleted file mode 100755 index b0a26c9558edf6fc52d55398f940e8fec0aa658b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDictLArHighVoltage.xml +++ /dev/null @@ -1,222 +0,0 @@ - -<IdDictionary name="LArHighVoltage" version="fullAtlas" > - - <field name="configuration" > - <label name="Atlas" value="1" /> - <label name="TestBeam" value="2" /> - </field> - - <field name="cannode"> - </field> - - <field name="hvline"> - </field> - - <field name="partition" > - </field> - - <field name="canline"> - </field> - - - <!-- HighVoltage Lines--> - - <subregion name="AtlasHighVoltage"> - <range field="configuration" value="Atlas" /> - </subregion> - - - <!-- LArHV HEC --> - - <region group="LArHV" name="LArHV-HEC-A"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="48" maxvalue="79" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - <region group="LArHV" name="LArHV-HEC-C"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="148" maxvalue="179" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - <!-- LArHV FCAL --> - - <region group="LArHV" name="LArHV-FCAL-A"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="80" maxvalue="93" /> - <range field="hvline" minvalue="0" maxvalue="7" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - <region group="LArHV" name="LArHV-FCAL-C"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="180" maxvalue="193" /> - <range field="hvline" minvalue="0" maxvalue="7" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - - <!-- LArHV EMB --> - - <!-- EMB-A-SIDE--> - <region group="LArHV" name="LArHV-EMB-A-STD"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="200" maxvalue="231" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="LArHV-EMB-C-STD"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="232" maxvalue="263" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="LArHV-EMB-A-SPE"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" values="296 297 306 307" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="LArHV-EMB-C-SPE"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" values="299 304 305 308 309" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - - - <!-- LArHV EMBPS --> - - <region group="LArHV" name="LArHV-EMBPS-A"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="264" maxvalue="279" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - <region group="LArHV" name="LArHV-EMBPS-C"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="280" maxvalue="295" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - - <!-- LArHV EMEC --> - - <region group="LArHV" name="LArHV-EMEC-A1"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="0" maxvalue="47" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="LArHV-EMEC-A2"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="320" maxvalue="322" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="LArHV-EMEC-C1"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="100" maxvalue="147" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="LArHV-EMEC-C2"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" values="324 325" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - - <!-- LArHV EMECPS --> - - <region group="LArHV" name="LArHV-EMECPS-A"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="312" maxvalue="315" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - <region group="LArHV" name="LArHV-EMECPS-C"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="316" maxvalue="319" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - - <!-- LArHV EMPUR --> - - <region group="LArHV" name="LArEMBPUR-A"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="300" maxvalue="303" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - - <!-- All these lines are free to use --> - - <region group="LArHV" name="NOCONN-NEW"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" values="310 311" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="NOCONN-A"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" values="323" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="NOCONN-C"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" values="326 327" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="FREE-A"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="94" maxvalue="99" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - <region group="LArHV" name="FREE-B"> - <reference subregion="AtlasHighVoltage" /> - <range field="cannode" minvalue="194" maxvalue="199" /> - <range field="hvline" minvalue="0" maxvalue="15" /> - <range field="partition" value="1" /> - <range field="canline" value="1" /> - </region> - - - -</IdDictionary> - diff --git a/graphics/AtlantisJava/geometry/IdDictTileCalorimeter.xml b/graphics/AtlantisJava/geometry/IdDictTileCalorimeter.xml deleted file mode 100755 index 76ab90dd0d52d69db648d69c47d44125c9b504a6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/geometry/IdDictTileCalorimeter.xml +++ /dev/null @@ -1,398 +0,0 @@ -<IdDictionary name="TileCalorimeter" version="fullAtlasAndTestBeam" > - - <field name="section" > - <label name="Online" value="0" /> - <label name="Barrel" value="1" /> - <label name="Extended-barrel" value="2" /> - <label name="ITC-gap-scintillator" value="3" /> - <label name="Testbeam" value="4" /> - </field> - - <field name="side" > - <label name="positive" value="+1" /> - <label name="negative" value="-1" /> - </field> - - <subregion name="cylinder-pos" > - <range field="side" value="positive" /> - <range field="module" minvalue="0" maxvalue="63" /> - </subregion> - - <subregion name="cylinder-neg" > - <range field="side" value="negative" /> - <range field="module" minvalue="0" maxvalue="63" /> - </subregion> - - <subregion name="cylinder" > - <range field="side" /> - <range field="module" minvalue="0" maxvalue="63" /> - </subregion> - - <subregion name="pmt1" > - <range field="pmt" value="0" /> - <range field="adc" minvalue="0" maxvalue="1" /> - </subregion> - - <subregion name="pmt2" > - <range field="pmt" minvalue="0" maxvalue="1" /> - <range field="adc" minvalue="0" maxvalue="1" /> - </subregion> - - <subregion name="tower0AB" > - <range field="tower" value="0" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower0" > - <range field="tower" value="0" /> - <range field="sampling" minvalue="0" maxvalue="2" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower1" > - <range field="tower" value="1" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower2" > - <range field="tower" value="2" /> - <range field="sampling" minvalue="0" maxvalue="2" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower3" > - <range field="tower" value="3" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower4" > - <range field="tower" value="4" /> - <range field="sampling" minvalue="0" maxvalue="2" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower5" > - <range field="tower" value="5" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower6" > - <range field="tower" value="6" /> - <range field="sampling" minvalue="0" maxvalue="2" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower7" > - <range field="tower" value="7" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower8" > - <range field="tower" value="8" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower9" > - <range field="tower" value="9" /> - <range field="sampling" value="0" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower10" > - <range field="tower" value="10" /> - <range field="sampling" minvalue="1" maxvalue="2" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower11" > - <range field="tower" value="11" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower12" > - <range field="tower" value="12" /> - <range field="sampling" minvalue="0" maxvalue="2" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower13" > - <range field="tower" value="13" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower14" > - <range field="tower" value="14" /> - <range field="sampling" minvalue="0" maxvalue="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="tower15" > - <range field="tower" value="15" /> - <range field="sampling" value="0" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="D4" > - <range field="tower" value="8" /> - <range field="sampling" value="2" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="C10" > - <range field="tower" value="9" /> - <range field="sampling" value="1" /> - <reference subregion="pmt2" /> - </subregion> - - <subregion name="E1" > - <range field="tower" value="10" /> - <range field="sampling" value="3" /> - <reference subregion="pmt1" /> - </subregion> - - <subregion name="E2" > - <range field="tower" value="11" /> - <range field="sampling" value="3" /> - <reference subregion="pmt1" /> - </subregion> - - <subregion name="E3" > - <range field="tower" value="13" /> - <range field="sampling" value="3" /> - <reference subregion="pmt1" /> - </subregion> - - <subregion name="E4" > - <range field="tower" value="15" /> - <range field="sampling" value="3" /> - <reference subregion="pmt1" /> - </subregion> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower0AB" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower0" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower1" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower1" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower2" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower2" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower3" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower3" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower4" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower4" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower5" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower5" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower6" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower6" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower7" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower7" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower8" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower8" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-neg" /> - <reference subregion="tower9" /> - </region> - - <region> - <range field="section" value="Barrel" /> - <reference subregion="cylinder-pos" /> - <reference subregion="tower9" /> - </region> - - <region> - <range field="section" value="Extended-barrel" /> - <reference subregion="cylinder" /> - <reference subregion="tower10" /> - </region> - - <region> - <range field="section" value="Extended-barrel" /> - <reference subregion="cylinder" /> - <reference subregion="tower11" /> - </region> - - <region> - <range field="section" value="Extended-barrel" /> - <reference subregion="cylinder" /> - <reference subregion="tower12" /> - </region> - - <region> - <range field="section" value="Extended-barrel" /> - <reference subregion="cylinder" /> - <reference subregion="tower13" /> - </region> - - <region> - <range field="section" value="Extended-barrel" /> - <reference subregion="cylinder" /> - <reference subregion="tower14" /> - </region> - - <region> - <range field="section" value="Extended-barrel" /> - <reference subregion="cylinder" /> - <reference subregion="tower15" /> - </region> - - <region> - <range field="section" value="ITC-gap-scintillator" /> - <reference subregion="cylinder" /> - <reference subregion="D4" /> - </region> - - <region> - <range field="section" value="ITC-gap-scintillator" /> - <reference subregion="cylinder" /> - <reference subregion="C10" /> - </region> - - <region> - <range field="section" value="ITC-gap-scintillator" /> - <reference subregion="cylinder" /> - <reference subregion="E1" /> - </region> - - <region> - <range field="section" value="ITC-gap-scintillator" /> - <reference subregion="cylinder" /> - <reference subregion="E2" /> - </region> - - <region> - <range field="section" value="ITC-gap-scintillator" /> - <reference subregion="cylinder" /> - <reference subregion="E3" /> - </region> - - <region> - <range field="section" value="ITC-gap-scintillator" /> - <reference subregion="cylinder" /> - <reference subregion="E4" /> - </region> - - - <region> - <range field="section" value="Online" /> - <range field="ros" minvalue="1" maxvalue="4" /> - <range field="drawer" minvalue="0" maxvalue="63" /> - <range field="channel" minvalue="0" maxvalue="47" /> - <range field="gain" minvalue="0" maxvalue="1" /> - </region> - - <region> - <range field="section" value="Online" /> - <range field="ros" value="0" /> - <range field="drawer" values="0 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19 20 21 22 255" /> - <range field="channel" minvalue="0" maxvalue="15" /> - <range field="gain" minvalue="0" maxvalue="0" /> - </region> - - <region> - <range field="section" value="Testbeam" /> - <range field="type" minvalue="-1" maxvalue="10" /> - <range field="tbmodule" minvalue="0" maxvalue="255" /> - <range field="tbchannel" minvalue="0" maxvalue="63" /> - <range field="tbdummy1" minvalue="0" maxvalue="15" /> - <range field="tbdummy2" minvalue="0" maxvalue="3" /> - <range field="tbdummy3" minvalue="0" maxvalue="3" /> - </region> - -</IdDictionary> diff --git a/graphics/AtlantisJava/img/atlantis_icon.gif b/graphics/AtlantisJava/img/atlantis_icon.gif deleted file mode 100755 index ea1ad1a27796918182df08347719cf5efdfb8723..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/atlantis_icon.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/atlantis_log.gif b/graphics/AtlantisJava/img/atlantis_log.gif deleted file mode 100755 index 7afe0dde1b99cc58b127f5ffb0c12f622a5f6326..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/atlantis_log.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/atlas.jpg b/graphics/AtlantisJava/img/atlas.jpg deleted file mode 100755 index fc381ca49e94fa5a0cfa5a3c64aa925e9239c761..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/atlas.jpg and /dev/null differ diff --git a/graphics/AtlantisJava/img/atlas_logo_big.png b/graphics/AtlantisJava/img/atlas_logo_big.png deleted file mode 100644 index b41fa2deb8cbd1f2cf2163c921f70966e684c3ba..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/atlas_logo_big.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_DnD_invalid_32x32.gif b/graphics/AtlantisJava/img/cursor_DnD_invalid_32x32.gif deleted file mode 100755 index 64c265d3e9f3f1d8e9486b0c6562beb6249452e5..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_DnD_invalid_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_DnD_invalid_64x64.gif b/graphics/AtlantisJava/img/cursor_DnD_invalid_64x64.gif deleted file mode 100755 index f0da1d0b3a4529cc22d74c22e7e9c64b174ab157..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_DnD_invalid_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_DnD_valid_32x32.gif b/graphics/AtlantisJava/img/cursor_DnD_valid_32x32.gif deleted file mode 100755 index a2d986bab98db68aec96f8a155c2bc7079ad7486..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_DnD_valid_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_DnD_valid_64x64.gif b/graphics/AtlantisJava/img/cursor_DnD_valid_64x64.gif deleted file mode 100755 index 167754d0f3c04bc1c9e24829957dd640c15b7a2f..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_DnD_valid_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_fisheye_32x32.gif b/graphics/AtlantisJava/img/cursor_fisheye_32x32.gif deleted file mode 100644 index 274cae270ef0f05f0ffe6e2c4bb40f2ab81d9121..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_fisheye_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_fisheye_64x64.gif b/graphics/AtlantisJava/img/cursor_fisheye_64x64.gif deleted file mode 100644 index bd9f9e8f6fe33b42f1bad61e8ae8f64970c5a51f..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_fisheye_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_fisheye_bw_32x32.gif b/graphics/AtlantisJava/img/cursor_fisheye_bw_32x32.gif deleted file mode 100644 index 31b8d566e033c12980fea7c35d4814ffc71832f3..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_fisheye_bw_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_fisheye_bw_64x64.gif b/graphics/AtlantisJava/img/cursor_fisheye_bw_64x64.gif deleted file mode 100644 index 817fee3d0bc475f0c82ed063cc40d8d994ff2b00..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_fisheye_bw_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_move_32x32.gif b/graphics/AtlantisJava/img/cursor_move_32x32.gif deleted file mode 100644 index fb4d30e49177e62158f4e654cc3d6ac44ca82995..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_move_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_move_64x64.gif b/graphics/AtlantisJava/img/cursor_move_64x64.gif deleted file mode 100644 index 1312c63e98e5b27e17c32c04111bbc8880568a17..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_move_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_pick_32x32.gif b/graphics/AtlantisJava/img/cursor_pick_32x32.gif deleted file mode 100644 index 381e8e27aeeebf84f1b6d6b308471777ca4917c4..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_pick_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_pick_64x64.gif b/graphics/AtlantisJava/img/cursor_pick_64x64.gif deleted file mode 100644 index 933ee9025e4ffa057890de5c5681cb3faa9e6ef8..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_pick_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_rectsel_32x32.gif b/graphics/AtlantisJava/img/cursor_rectsel_32x32.gif deleted file mode 100644 index 735e03ad7ed142cfc3c718381ecc73112c91a385..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_rectsel_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_rectsel_64x64.gif b/graphics/AtlantisJava/img/cursor_rectsel_64x64.gif deleted file mode 100644 index 6af540579930f5b3fe343ccb10159401343bf607..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_rectsel_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_rotate_32x32.gif b/graphics/AtlantisJava/img/cursor_rotate_32x32.gif deleted file mode 100644 index 61b6efdc627f8271344f4822dfbc560f0bdea2b9..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_rotate_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_rotate_64x64.gif b/graphics/AtlantisJava/img/cursor_rotate_64x64.gif deleted file mode 100644 index a376b6b532e11f4472aab2b577d2da106b4c0601..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_rotate_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_rotate_bw_32x32.gif b/graphics/AtlantisJava/img/cursor_rotate_bw_32x32.gif deleted file mode 100644 index 6833e4bb8a3619f0bb523896726efb0ed8713672..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_rotate_bw_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_rotate_bw_64x64.gif b/graphics/AtlantisJava/img/cursor_rotate_bw_64x64.gif deleted file mode 100644 index 5ba49f2c75c5ea37270b345b1bdb4505dea40816..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_rotate_bw_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_sync_32x32.gif b/graphics/AtlantisJava/img/cursor_sync_32x32.gif deleted file mode 100644 index c383ec1293a38aa62b98f1fb5095a73eceb8b700..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_sync_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_sync_64x64.gif b/graphics/AtlantisJava/img/cursor_sync_64x64.gif deleted file mode 100644 index 1853af35b54f06708257342985a282853ba158e1..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_sync_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_zoom_32x32.gif b/graphics/AtlantisJava/img/cursor_zoom_32x32.gif deleted file mode 100644 index 6880193d449f3c7f2e895ed742024d78d2bc460c..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_zoom_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_zoom_64x64.gif b/graphics/AtlantisJava/img/cursor_zoom_64x64.gif deleted file mode 100644 index 72d75f2a100a07b6a5173a1461dde5d071718b17..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_zoom_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_zoom_bw_32x32.gif b/graphics/AtlantisJava/img/cursor_zoom_bw_32x32.gif deleted file mode 100644 index 9e2afd655574cbbe2991ba2b52ca0e71a7ddff91..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_zoom_bw_32x32.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/cursor_zoom_bw_64x64.gif b/graphics/AtlantisJava/img/cursor_zoom_bw_64x64.gif deleted file mode 100644 index 2efd87e0d4d1a5f4cb08e46a16fe2bd9199564a2..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/cursor_zoom_bw_64x64.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/downarrow.png b/graphics/AtlantisJava/img/downarrow.png deleted file mode 100644 index 17b7273d22a682f1fe269ed260d78559fe342144..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/downarrow.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_clock.png b/graphics/AtlantisJava/img/interaction_clock.png deleted file mode 100644 index 0078909d9bd3ec15a13d2c8fe542faa1618e61d5..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_clock.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_fisheye.png b/graphics/AtlantisJava/img/interaction_fisheye.png deleted file mode 100644 index 6ddbd1b556a528d332b6e98e3272b4ed832b56d8..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_fisheye.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_pick.png b/graphics/AtlantisJava/img/interaction_pick.png deleted file mode 100644 index 5bb9411ccf89581a77f9a6a4ddec694bb70562c9..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_pick.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_rotate.png b/graphics/AtlantisJava/img/interaction_rotate.png deleted file mode 100644 index 511c2837239dc8849ab31e74e1a9a3178ad12a86..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_rotate.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_rubberband.png b/graphics/AtlantisJava/img/interaction_rubberband.png deleted file mode 100644 index c101f8ccd9fb2b067b6debd4d7bff251884d6dc0..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_rubberband.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_rubberbandyx.png b/graphics/AtlantisJava/img/interaction_rubberbandyx.png deleted file mode 100644 index eefdf1e4425d59f0b758beef4d94654db23d5f22..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_rubberbandyx.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_scale.png b/graphics/AtlantisJava/img/interaction_scale.png deleted file mode 100644 index 6a4699d2530b7a1ecc737e10e23055bd2be2e433..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_scale.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_skew.png b/graphics/AtlantisJava/img/interaction_skew.png deleted file mode 100644 index db0c357a0f7014f917abe4dd102b4fdedcc0b886..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_skew.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_synccursors.png b/graphics/AtlantisJava/img/interaction_synccursors.png deleted file mode 100644 index d19b2253e87ad4b95163fd50e26c924cd322f7c2..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_synccursors.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_zmr.png b/graphics/AtlantisJava/img/interaction_zmr.png deleted file mode 100644 index 06e95704d7442d5bdc2f7606e93ca4badc0bd7c0..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_zmr.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/interaction_zr.png b/graphics/AtlantisJava/img/interaction_zr.png deleted file mode 100644 index c6f46cc29f0c9381097e522bebaef22c65ce5b1e..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/interaction_zr.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/left.gif b/graphics/AtlantisJava/img/left.gif deleted file mode 100755 index 279e6710d4961d7644ea2e3e39e6afd300147aa8..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/left.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/minerva_log.gif b/graphics/AtlantisJava/img/minerva_log.gif deleted file mode 100644 index b7ba3677b6b3ad098bbbbf5c7b639d41de2aac10..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/minerva_log.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/mode_loop.png b/graphics/AtlantisJava/img/mode_loop.png deleted file mode 100644 index c4573849c5c3555e80b5f91df2659d592a11d9ba..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/mode_loop.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/mode_loop_on.png b/graphics/AtlantisJava/img/mode_loop_on.png deleted file mode 100644 index 1a6b5bed230293c52fa71d78d228a3a7fc2ac3e8..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/mode_loop_on.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/mode_random.png b/graphics/AtlantisJava/img/mode_random.png deleted file mode 100644 index d7861bd112a56079c81778995267ee6d15259878..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/mode_random.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/mode_random_on.png b/graphics/AtlantisJava/img/mode_random_on.png deleted file mode 100644 index 19c332640d439e2f44b055430f1326603626be51..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/mode_random_on.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/mode_sequential.png b/graphics/AtlantisJava/img/mode_sequential.png deleted file mode 100644 index e4c2d857205282a26b8e45ca5427cf8d14d47acb..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/mode_sequential.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/mode_sequential_on.png b/graphics/AtlantisJava/img/mode_sequential_on.png deleted file mode 100644 index c083bef019f8924502fcfff9cce53910dbcfb8b2..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/mode_sequential_on.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/right.gif b/graphics/AtlantisJava/img/right.gif deleted file mode 100755 index b256e5f75fb1f5467251abbf9442f338892e6ab5..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/right.gif and /dev/null differ diff --git a/graphics/AtlantisJava/img/toolbar_next.png b/graphics/AtlantisJava/img/toolbar_next.png deleted file mode 100755 index bd1b428684b001ef8ebe6fad7b5d10b3271953eb..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/toolbar_next.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/toolbar_open.png b/graphics/AtlantisJava/img/toolbar_open.png deleted file mode 100755 index c2d8efa7b0707f148900b981c51a5fc9adc92067..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/toolbar_open.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/toolbar_previous.png b/graphics/AtlantisJava/img/toolbar_previous.png deleted file mode 100755 index 940797b8a588cd4a74ce79ffd8c3957041c319e6..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/toolbar_previous.png and /dev/null differ diff --git a/graphics/AtlantisJava/img/uparrow.png b/graphics/AtlantisJava/img/uparrow.png deleted file mode 100644 index 339e331a52746b8c5d30b968cacbe4e6745576be..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/img/uparrow.png and /dev/null differ diff --git a/graphics/AtlantisJava/lib/Jama.jar b/graphics/AtlantisJava/lib/Jama.jar deleted file mode 100755 index 4c76beca1d5499cd3f996b3e3f30d77b02c7d319..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/Jama.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/batik-anim.jar b/graphics/AtlantisJava/lib/batik-anim.jar deleted file mode 100644 index 6913e421c916241b2c96081e5402191b6e18e1db..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/batik-anim.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/batik-ext.jar b/graphics/AtlantisJava/lib/batik-ext.jar deleted file mode 100644 index 8c904e1f2ab5de46eec36952299a181769e867c1..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/batik-ext.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/batik-extension.jar b/graphics/AtlantisJava/lib/batik-extension.jar deleted file mode 100644 index 106e4ac3cbd922d89f6b08087a30485ad0d2799b..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/batik-extension.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/batik-parser.jar b/graphics/AtlantisJava/lib/batik-parser.jar deleted file mode 100644 index 286b3799c3f922a0ddf66a99eec096f4ab01429b..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/batik-parser.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/batik-script.jar b/graphics/AtlantisJava/lib/batik-script.jar deleted file mode 100644 index 433f02e67c5561b54ae05161e9578cc6f474bbee..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/batik-script.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/batik-xml.jar b/graphics/AtlantisJava/lib/batik-xml.jar deleted file mode 100644 index d05eb25f7778d3463f07380cf5ec1df675d534bd..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/batik-xml.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/commons-cli-1.0.jar b/graphics/AtlantisJava/lib/commons-cli-1.0.jar deleted file mode 100755 index 22a004e14e16720cae9af97d4d1475b12d2388aa..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/commons-cli-1.0.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/commons-codec-1.4.jar b/graphics/AtlantisJava/lib/commons-codec-1.4.jar deleted file mode 100644 index 458d432da88b0efeab640c229903fb5aad274044..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/commons-codec-1.4.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/commons-logging-1.1.jar b/graphics/AtlantisJava/lib/commons-logging-1.1.jar deleted file mode 100644 index 2ff9bbd90d63f92cdffea944869ed9bea7ead49c..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/commons-logging-1.1.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/jas-aida-dev.jar b/graphics/AtlantisJava/lib/jas-aida-dev.jar deleted file mode 100755 index a698fcb714e42754a7e62a44c5934d5767d1aac4..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/jas-aida-dev.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/jas-aida.jar b/graphics/AtlantisJava/lib/jas-aida.jar deleted file mode 100755 index b539738f665293379179708c453af1b88deb7d95..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/jas-aida.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/jas-jel.jar b/graphics/AtlantisJava/lib/jas-jel.jar deleted file mode 100755 index 384f9eeb7a4e3652719925331a5f94fc0d1e0def..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/jas-jel.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/jlibeps.jar b/graphics/AtlantisJava/lib/jlibeps.jar deleted file mode 100644 index 6d049b27ce2c17e20455e390b0c554680c49808a..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/jlibeps.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/oncrpc.jar b/graphics/AtlantisJava/lib/oncrpc.jar deleted file mode 100644 index 3910ab9f555e0a3cf6f8bcc3d2ef7fbacc09e6e3..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/oncrpc.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/ostermillerutils_1_05_00.jar b/graphics/AtlantisJava/lib/ostermillerutils_1_05_00.jar deleted file mode 100644 index 79be1c0549dbce8d17fe99aa94815a442b81dc33..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/ostermillerutils_1_05_00.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/test/fest-assert-1.2.jar b/graphics/AtlantisJava/lib/test/fest-assert-1.2.jar deleted file mode 100644 index dcd667e53566009670eb087365eb064727f1525a..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/test/fest-assert-1.2.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/test/fest-reflect-1.2.jar b/graphics/AtlantisJava/lib/test/fest-reflect-1.2.jar deleted file mode 100644 index d33ddb65349ebd5b6ee159a2cf7d569bf7f5d4ef..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/test/fest-reflect-1.2.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/test/fest-util-1.1.2.jar b/graphics/AtlantisJava/lib/test/fest-util-1.1.2.jar deleted file mode 100644 index c5f608bfabb4b04653c0c6384e9a4ad28aba2d08..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/test/fest-util-1.1.2.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/test/jcip-annotations-1.0.jar b/graphics/AtlantisJava/lib/test/jcip-annotations-1.0.jar deleted file mode 100644 index 9ca41331f9d84cd668a8620850fdc5b1724a10b8..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/test/jcip-annotations-1.0.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/ws-commons-util-1.0.2.jar b/graphics/AtlantisJava/lib/ws-commons-util-1.0.2.jar deleted file mode 100644 index 3fc364e7f605b580850530c281998a1f861cc0c5..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/ws-commons-util-1.0.2.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/xml-apis-ext.jar b/graphics/AtlantisJava/lib/xml-apis-ext.jar deleted file mode 100644 index a7869d68aacd655c782bb373c7334e5ff667ca58..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/xml-apis-ext.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/xmlrpc-client-3.1.jar b/graphics/AtlantisJava/lib/xmlrpc-client-3.1.jar deleted file mode 100644 index a76e6ec96dd62265a199eb3ab72c54b7ebb99368..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/xmlrpc-client-3.1.jar and /dev/null differ diff --git a/graphics/AtlantisJava/lib/xmlrpc-server-3.1.jar b/graphics/AtlantisJava/lib/xmlrpc-server-3.1.jar deleted file mode 100644 index bb64a504ee8997cca1f08ae0814b6cdf90d0cdbb..0000000000000000000000000000000000000000 Binary files a/graphics/AtlantisJava/lib/xmlrpc-server-3.1.jar and /dev/null differ diff --git a/graphics/AtlantisJava/share/InteractiveServer.py b/graphics/AtlantisJava/share/InteractiveServer.py deleted file mode 100755 index 1b1adeb2a9cda9b8cf2de0d12915fa7fb67e5dd3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/share/InteractiveServer.py +++ /dev/null @@ -1,483 +0,0 @@ -#!/usr/bin/env python - -# InteractiveServer.py -# -# author: Zdenek Maxa, UCL HEP group (zdenek.maxa --at-- hep.ucl.ac.uk) -# -# CVS location: offline/graphics/AtlantisJava/share/InteractiveServer.py -# -# Interface between the Athena Python interactive prompt and the Atlantis -# event display. This server script takes over the interactive prompt of -# Athena. The Atlantis user can then type Athena commands directly in the -# Atlantis dialog from where they are sent to Athena through this server. -# Commands: e.g. changing/querying job options and executing .initialize(), -# .execute() and .finalize() methods of algorithms, etc. -# -# -# setting up Atlantis - Interactive Athena: -# 0) get_files InteractiveServer.py [from 'run' directory] -# 1) athena -i <job_options.py> [launch Athena in the interactive mode] -# 2) theApp.initialize() -# 3) execfile ("InteractiveServer.py") -# 4) if the server started successfully an info message is printed and -# denoted string has to be copied into the Atlantis Interactive Athena -# dialog (Atlantis menu: File -> Interactive Athena) -# -# Once the InteractiveServer is started, the Athena prompt is taken over -# by the server and the user can no longer access it. The server can be -# shut down by Ctrl+C after which the interactive prompt should be given -# back to the user. -# -# -# setting up for Athenaeum: -# argumentInteractiveServerNoAlgTools = True -# argumentInteractiveServerServerPort = 2323 -# argumentInteractiveServerServerKey = "someKey" -# execfile ("InteractiveServer.py") - -# Multithreaded version, modification made by Julius.Hrivnac -- at -- cern.ch -# Athenaeum commands can be executed in several parallel threads. -# Unlike in the single-thread version, all stdout and stderr output -# goes into system streams, so into the server log file. The result -# of the "remote script" should be put into answer array so that -# they are given to the client. - - -# --------------------------------------------------------------------------- - -import os, sys, math, traceback, random, time, StringIO, getopt, md5, base64 -import SocketServer -from SimpleXMLRPCServer import SimpleXMLRPCServer,SimpleXMLRPCRequestHandler -import cppyy - -class AsyncXMLRPCServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer): pass - -# --------------------------------------------------------------------------- -class InteractiveServer: - """ """ - - # <configuration attributes --------> - debug = False # debug messages to print (False / True) - keyLength = 15 - minCharValue = 33 # ascii table range (generating key) - maxCharValue = 126 # ascii table range (generating key) - minPortNumber = 2000 - maxPortNumber = 20000 - maxAttempts = 5 # number of attempts when creating the server - resultLengthLimit = 400 - # </configuration attributes --------> - - # other attributes - serverName = "" - serverPort = 0 - key = "" - server = None # XMLRPC server instance - - vxTool = None # access to vertexing tool (Athena AlgTool) - visTool = None # access to JiveXML (EventData2XML) (Athena AlgTool) - - keyForbiddenChars = ("'", '"', ':') - noAlgTools = False # if False, AlgTools will be initialised - - # answer in a multhreaded invironment are passed in the global array - global answer - answer = {} - - # ----------------------------------------------------------------------- - def __init__(self, noAlgTools = False, serverPort = 0, key = ""): - """ """ - - self.serverName = os.uname()[1] - self.noAlgTools = noAlgTools - self.serverPort = serverPort - self.key = key - SocketServer.ThreadingTCPServer.daemon_threads = True - - # __init__() ------------------------------------------------------------ - - - # ----------------------------------------------------------------------- - def makeServer(self): - """ """ - - try: - SimpleXMLRPCServer.allow_reuse_address = 1 - self.server = AsyncXMLRPCServer((self.serverName, self.serverPort), SimpleXMLRPCRequestHandler) - - except Exception, why: - print "\n%s\nCould not create the server on '%s' port: " \ - "'%s'" % (why, self.serverName, self.serverPort) - if self.debug: - trace = traceback.format_exception(*sys.exc_info()) - traceString = '\n '.join(trace) - errorMsg = "ERROR:\n%s\n" % (traceString) - print errorMsg - raise - else: - print "XMLRPC server created" - - # makeServer() ---------------------------------------------------------- - - - # ----------------------------------------------------------------------- - def generatePortAndMakeServer(self): - """ """ - - alreadyTriedPorts = [] # already tried port numbers - - for i in range(self.maxAttempts): - while 1: - self.serverPort = random.randint(self.minPortNumber, - self.maxPortNumber) - if self.serverPort not in alreadyTriedPorts: - break - alreadyTriedPorts.append(self.serverPort) - - try: - self.makeServer() - except: - continue - else: - break - else: - # for loop iterated through exhaustion of the list and wasn't - # terminated by the break, so the server wasn't created, notify - # the caller by raising an exception - raise - - # generatePortAndMakeServer() ------------------------------------------- - - - # ----------------------------------------------------------------------- - def registerMethod(self, name): - """ """ - - methodName = name.__name__ - try: - self.server.register_function(name) - except Exception, why: - print "%s\nCould not register method (%s)" % (why, methodName) - raise - else: - if self.debug: - print "method '%s()' registered" % methodName - - # registerMethod() ------------------------------------------------------ - - - # ----------------------------------------------------------------------- - def runServer(self): - """ """ - # this will probably have to be in a thread if the interactive - # prompt is to remain at the user's disposal - - print "Waiting for requests..." - try: - self.server.serve_forever() - except KeyboardInterrupt: - try: - print "Stopped from keyboard, exit" - print "Closing InteractiveServer:", - self.server.server_close() - except: - print "can't close the server" - else: - print "server closed" - except Exception, why: - print "%s\nException occured" % why - raise - - # runServer() ----------------------------------------------------------- - - - # ----------------------------------------------------------------------- - def execute(self, param = "<empty>"): - - print "execute(param = '%s')" % param - resultMsg = "SUCCESS" - - try: - exec param - except Exception, why: - trace = traceback.format_exception(*sys.exc_info()) - traceString = '\n '.join(trace) - resultMsg = "ERROR:\n%s\n%s\n" % (traceString, why) - print resultMsg - - return str(resultMsg) - - # execute() ------------------------------------------------------------- - - - # ----------------------------------------------------------------------- - def get(self, name = "<empty>"): - """ """ - - print "get(name = '%s')" % name - resultMsg = "SUCCESS" - - try: - result = eval(name) - except Exception, why: - trace = traceback.format_exception(*sys.exc_info()) - traceString = '\n '.join(trace) - resultMsg = "ERROR:\n%s\n%s\n" % (traceString, why) - print resultMsg - return str(resultMsg) - else: - return str(result) - - # get() ----------------------------------------------------------------- - - - - # ----------------------------------------------------------------------- - def callVertexFit(self, tracksId): - """Track IDs (tracksId array) are passed to vertex fit algtool""" - - print "callVertexFit(tracksId = '%s')" % tracksId - - cppyy.loadDictionary('SealSTLDict') - - g.std.vector(int) - vi = g.std.vector(int)(0) - - for i in tracksId: - vi.push_back(i) - - print " calling vertexing tool: vxTool.fitAtlantisTracks(",vi,")" - - r = self.vxTool.fitAtlantisTracks(vi) - if r: - resultMsg = "SUCCESS (get updated event data)" - else: - resultMsg = "ERROR while calling vertexing tool" - - return resultMsg - - # callVertexFit() ------------------------------------------------------- - - - # ----------------------------------------------------------------------- - def executeScript(self, param = "<empty>", pid = ""): - """Execute Python code snippets from Athenaeum plugin""" - - errorMsg = "SUCCESS" - resultMsg = "" - - try: - exec param - global answer - try: - resultMsg = answer[pid] - del answer[pid] - except: - resultMsg = "No resultMsg" - except Exception, why: - trace = traceback.format_exception(*sys.exc_info()) - traceString = '\n '.join(trace) - errorMsg = "ERROR:\n%s\n%s\n" % (traceString, why) - - return resultMsg + "\n" + str(errorMsg) - - # executeScript() ------------------------------------------------------- - - - # ----------------------------------------------------------------------- - # the only method which is exposed (registred) for remote calling - def process(self, digest = "", request = "<empty>", tracksId = ''): - """ """ - - print "\n\n<incoming request> " + 50 * '-' - if self.debug: - print "process(request = '%s', tracksId = '%s')" % (request, - tracksId) - result = "<empty_result>" - - # generate message digest and compare - md5My = md5.new() - md5My.update(request) - md5My.update(self.key) - myDigest = md5My.digest() - # received digest is BAE64 encoded, so encode mine as well - myDigest = base64.encodestring(myDigest)[:-1] # without list '\n' - - if digest == myDigest: - # determine the nature of the request - # request 'runVertexFit' -> pass tracksId to the algorithm - if str(request) == "runVertexFit": - result = self.callVertexFit(tracksId) - - # request to process Python code snippet (e.g. from Athenaeum) - # multiline request - # tracksId is the client identifier - elif len(str(request).split('\n')) > 1: - result = self.executeScript(request, tracksId) - - # get event data from JiveXML - elif str(request) == "eventData": - self.visTool.execute() - result = self.visTool.getXML() - - # two last characters must be '()' if it's a method to execute - elif request[-2:] == "()": - result = self.execute(request) - - # if the request contains '=' - it's an assignment to execute - elif request.find('=') > -1: - result = self.execute(request) - - # it's likely name of a variable to evaluate (or wrong request) - else: - result = self.get(request) - else: - result = "Request not processed, keys (digests) don't match" - - - # don't print out result messages longer than resultLengthLimit chars - # in such a case print just the beginning and the end of the message - limit = self.resultLengthLimit - print "result to send:" - if len(result) < limit: - print "%s" % result - else: - print "%s" % result[:limit/2] - print "\n+++ %s other characters +++\n" % (len(result) - limit) - print "%s" % result[-limit/2:] - - print "</incoming request> " + 50 * '-' - return result - - # process() ------------------------------------------------------------- - - - # ----------------------------------------------------------------------- - def generateKey(self): - """ """ - - # generate keyLength characters long key - random.seed() - while len(self.key) < self.keyLength: - k = str(chr(random.randint(self.minCharValue, self.maxCharValue))) - if k in self.keyForbiddenChars: - continue - self.key += k - - # generateKey() --------------------------------------------------------- - - # ----------------------------------------------------------------------- - def printInfo(self): - """ """ - - print "String between the quotation marks to copy & paste", - print "into the dialog:" - print "\t '%s:%s:%s'" % (self.serverName, self.serverPort, self.key) - - # printInfo() ----------------------------------------------------------- - - - # ----------------------------------------------------------------------- - def createAlgTools(self): - - print "Getting vertexing AlgTool (ToolSvc.VxWrapperTool)" - # self.vxTool = \ - # theApp.toolsvc().retrieve('ToolSvc.VxWrapperTool')._itool - self.vxTool = \ - theApp.toolsvc().create('VxWrapperTool','VxWrapperTool', - cppyy.Pointer(g.IInterface)(0))._itool - - print "Getting JiveXML AlgTool (ToolSvc.EventData2XML)" - # self.visTool = \ - # theApp.toolsvc().retrieve('ToolSvc.EventData2XML')._itool - self.visTool = \ - theApp.toolsvc().create('EventData2XML','EventData2XML', - cppyy.Pointer(g.IInterface)(0))._itool - - # createAlgTools() ------------------------------------------------------ - - - # ----------------------------------------------------------------------- - def start(self): - """ """ - - print "Starting Multithreaded InteractiveServer:", - try: - # generate key if it wasn't specified as a command line option - if self.key == "": - self.generateKey() - - # choose random port before creating the server if the port number - # wasn't specified as a command line option - if self.serverPort == 0: - self.generatePortAndMakeServer() - else: - self.makeServer() - - self.registerMethod(self.process) - # self.server.register_introspection_functions() # what for? - - # don't initialise algtools if --no_algtools command line argument - if self.noAlgTools == False: - self.createAlgTools() - - self.printInfo() - self.runServer() - except Exception, why: - print "Exception occured." - print "Reason: %s" % why - - # start() --------------------------------------------------------------- - - -# class InteractiveServer =================================================== - - -# --------------------------------------------------------------------------- -def getArguments(): - """Reading arguments when executing by execfile()""" - - # default values - noAlgTools = False - serverPort = 0 - serverKey = "" - - if globals().has_key("argumentInteractiveServerNoAlgTools"): - if argumentInteractiveServerNoAlgTools: - noAlgTools = True - - if globals().has_key("argumentInteractiveServerServerPort"): - port = argumentInteractiveServerServerPort - try: - serverPort = int(port) - except ValueError: - msg = "Incorrectly specified port number: %s" % port - raise Exception(msg) - - if globals().has_key("argumentInteractiveServerServerKey"): - serverKey = argumentInteractiveServerServerKey - - return (noAlgTools, serverPort, serverKey) - -# getArguments() ------------------------------------------------------------ - - -# --------------------------------------------------------------------------- -def main(): - - try: - (noAlgTools, serverPort, key) = getArguments() - except Exception, why: - print "Exception occured while reading variable arguments, exit" - print "Reason: %s" % why - return - - server = InteractiveServer(noAlgTools, serverPort, key) - server.start() - -# main() -------------------------------------------------------------------- - - -# --------------------------------------------------------------------------- -if __name__ == "__main__": - main() -# --------------------------------------------------------------------------- diff --git a/graphics/AtlantisJava/share/MINERVA.jnlp b/graphics/AtlantisJava/share/MINERVA.jnlp deleted file mode 100644 index f3e3897fe74fe40a8cbb6ad812370fc91b5bb1c9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/share/MINERVA.jnlp +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- JNLP webstart file for Atlantis event display for ATLAS --> -<!-- MINERVA version --> -<jnlp - spec="1.0+" - codebase="@CODEBASE@" - href="MINERVA.jnlp"> - <information> - <title>Atlantis event display for ATLAS</title> - <vendor>Atlantis team</vendor> - <homepage href=""/> <!-- should be used from codebase --> - <description>Atlantis event display for ATLAS</description> - <!-- <icon href="files/goofy_favicon.ico"/> - <icon kind="splash" href="files/logo.gif"/> --> - <offline-allowed/> - <shortcut online="false"> - <desktop/> - <menu submenu="Atlantis event display"/> - </shortcut> - </information> - <security> - <all-permissions/> - </security> - <resources> - <j2se version="1.6+" max-heap-size="512m"/> - - <jar href="lib/commons-cli-1.0.jar"/> - <jar href="lib/Jama.jar"/> - <jar href="lib/jas-aida-dev.jar"/> - <jar href="lib/jas-aida.jar"/> - <jar href="lib/jas-freehep-base.jar"/> - <jar href="lib/jas-freehep-hep.jar"/> - <jar href="lib/jas-jas-plotter.jar"/> - <jar href="lib/jas-jel.jar"/> - <jar href="lib/jas-JMinuit.jar"/> - <jar href="lib/jogl.jar"/> - <jar href="lib/jh.jar"/> - <jar href="lib/oncrpc.jar"/> - <jar href="lib/log4j-1.2.15.jar"/> - <jar href="lib/ostermillerutils_1_05_00.jar"/> - <jar href="lib/wired-base-4.0.beta.3-SNAPSHOT.jar"/> - <jar href="lib/ws-commons-util-1.0.2.jar"/> - <jar href="lib/xercesImpl.jar"/> - <jar href="lib/xml-apis.jar"/> - <jar href="lib/xmlrpc-client-3.1.jar"/> - <jar href="lib/xmlrpc-common-3.1.jar"/> - <jar href="lib/jlibeps.jar"/> - <jar href="lib/xmlrpc-server-3.1.jar"/> - <jar href="lib/commons-logging-1.1.jar"/> - <jar href="lib/commons-codec-1.4.jar"/> - <jar href="lib/xml-apis-ext.jar"/> - <jar href="lib/batik-dom.jar"/> - <jar href="lib/batik-anim.jar"/> - <jar href="lib/batik-svggen.jar"/> - <jar href="lib/batik-css.jar"/> - <jar href="lib/batik-bridge.jar"/> - <jar href="lib/batik-parser.jar"/> - <jar href="lib/batik-xml.jar"/> - <jar href="lib/batik-gui-util.jar"/> - <jar href="lib/batik-script.jar"/> - <jar href="lib/batik-transcoder.jar"/> - <jar href="lib/batik-svg-dom.jar"/> - <jar href="lib/batik-extension.jar"/> - <jar href="lib/batik-codec.jar"/> - <jar href="lib/batik-util.jar"/> - <jar href="lib/batik-swing.jar"/> - <jar href="lib/batik-ext.jar"/> - <jar href="lib/batik-gvt.jar"/> - <jar href="lib/batik-awt-util.jar"/> - <jar href="help/help.jar"/> - - <jar href="atlantis.jar" main="true"/> <!-- look for main class here --> - </resources> - - <application-desc main-class="atlantis.Atlantis"> - <argument>--config</argument> - <argument>configuration/config-MINERVA.xml</argument> - <argument>--debug</argument> - <argument>DEBUG</argument> - <argument>--source</argument> - <argument>http://www.cern.ch/atlas-minerva/MINERVA_tutorial_events.zip</argument> - </application-desc> - -</jnlp> diff --git a/graphics/AtlantisJava/share/atlantis b/graphics/AtlantisJava/share/atlantis deleted file mode 100755 index d9e99ce0a1c3f5931f2891874270afe4f0978d17..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/share/atlantis +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# running Atlantis in the Athena environment - -# Check JRE version. Workaround because "java -version:1.6+" does not work on lxplus -JAVAVERSION=`java -version 2>&1 | grep "java version" | awk '{print $3}' | tr -d \" | awk '{split($0, array, ".")} END{print array[2]}'` -if [[ $JAVAVERSION -lt 6 ]]; then - echo "Atlantis required Java version 1.6 or greater" - exit 1 -fi - -ATLANTISJAVA_HOME=`dirname $0`/../AtlantisJava -java -Xms128m -Xmx1024m -jar $ATLANTISJAVA_HOME/atlantis.jar $* diff --git a/graphics/AtlantisJava/share/atlantis.jnlp b/graphics/AtlantisJava/share/atlantis.jnlp deleted file mode 100644 index 39612b50c59d7fd86926ee348439d76f3235db26..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/share/atlantis.jnlp +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- JNLP webstart file for Atlantis event display for ATLAS --> -<jnlp - spec="1.0+" - codebase="@CODEBASE@" - href="atlantis.jnlp"> - <information> - <title>Atlantis event display for ATLAS</title> - <vendor>Atlantis team</vendor> - <homepage href=""/> <!-- should be used from codebase --> - <description>Atlantis event display for ATLAS</description> - <!-- <icon href="files/goofy_favicon.ico"/> - <icon kind="splash" href="files/logo.gif"/> --> - <offline-allowed/> - <shortcut online="false"> - <desktop/> - <menu submenu="Atlantis event display"/> - </shortcut> - </information> - <security> - <all-permissions/> - </security> - <resources> - <j2se version="1.6+" max-heap-size="512m"/> - - <jar href="lib/commons-cli-1.0.jar"/> - <jar href="lib/Jama.jar"/> - <jar href="lib/jas-aida-dev.jar"/> - <jar href="lib/jas-aida.jar"/> - <jar href="lib/jas-freehep-base.jar"/> - <jar href="lib/jas-freehep-hep.jar"/> - <jar href="lib/jas-jas-plotter.jar"/> - <jar href="lib/jas-jel.jar"/> - <jar href="lib/jas-JMinuit.jar"/> - <jar href="lib/jogl.jar"/> - <jar href="lib/jh.jar"/> - <jar href="lib/oncrpc.jar"/> - <jar href="lib/log4j-1.2.15.jar"/> - <jar href="lib/ostermillerutils_1_05_00.jar"/> - <jar href="lib/wired-base-4.0.beta.3-SNAPSHOT.jar"/> - <jar href="lib/ws-commons-util-1.0.2.jar"/> - <jar href="lib/xercesImpl.jar"/> - <jar href="lib/xml-apis.jar"/> - <jar href="lib/xmlrpc-client-3.1.jar"/> - <jar href="lib/xmlrpc-common-3.1.jar"/> - <jar href="lib/jlibeps.jar"/> - <jar href="lib/xmlrpc-server-3.1.jar"/> - <jar href="lib/commons-logging-1.1.jar"/> - <jar href="lib/commons-codec-1.4.jar"/> - <jar href="lib/xml-apis-ext.jar"/> - <jar href="lib/batik-dom.jar"/> - <jar href="lib/batik-anim.jar"/> - <jar href="lib/batik-svggen.jar"/> - <jar href="lib/batik-css.jar"/> - <jar href="lib/batik-bridge.jar"/> - <jar href="lib/batik-parser.jar"/> - <jar href="lib/batik-xml.jar"/> - <jar href="lib/batik-gui-util.jar"/> - <jar href="lib/batik-script.jar"/> - <jar href="lib/batik-transcoder.jar"/> - <jar href="lib/batik-svg-dom.jar"/> - <jar href="lib/batik-extension.jar"/> - <jar href="lib/batik-codec.jar"/> - <jar href="lib/batik-util.jar"/> - <jar href="lib/batik-swing.jar"/> - <jar href="lib/batik-ext.jar"/> - <jar href="lib/batik-gvt.jar"/> - <jar href="lib/batik-awt-util.jar"/> - - <jar href="help/help.jar"/> - - <jar href="atlantis.jar" main="true"/> <!-- look for main class here --> - </resources> - - <application-desc main-class="atlantis.Atlantis"> - <argument>--debug</argument> - <argument>DEBUG</argument> - </application-desc> - -</jnlp> - diff --git a/graphics/AtlantisJava/share/atlantis_online b/graphics/AtlantisJava/share/atlantis_online deleted file mode 100755 index 1d9cace7cfa0cddb791ac5e5592237ef9a0a2ec9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/share/atlantis_online +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# running Atlantis in the TDAQ online environment -# This requires the TDAQ_JAVA_HOME to be defined in the enviroment - -JAVA=$TDAQ_JAVA_HOME/bin/java - -# Check JRE version. Workaround because "java -version:1.6+" does not work on lxplus -JAVAVERSION=`$JAVA -version 2>&1 | grep "java version" | awk '{print $3}' | tr -d \" | awk '{split($0, array, ".")} END{print array[2]}'` -if [[ $JAVAVERSION -lt 6 ]]; then - echo "Atlantis required Java version 1.6 or greater" - exit 1 -fi - -exec $JAVA -Xms128m -Xmx1024m -jar $EVENTDISPLAY_SW_INST_PATH/share/AtlantisJava/atlantis.jar $* diff --git a/graphics/AtlantisJava/share/ntupleXML.h b/graphics/AtlantisJava/share/ntupleXML.h deleted file mode 100644 index c1282f14004b8db1647ea47e58a02576c4f43358..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/share/ntupleXML.h +++ /dev/null @@ -1,1351 +0,0 @@ -//ntupleXML v1.0 - Tim Martin - Aug 07 - tamartin@cern.ch -//Classes TopViewXML and EventViewXML to output ntuple -//events to a Atlantis readable xml file - -#include "TXMLEngine.h" -#include <TChain.h> -#include <TFriendElement.h> -#include <TFile.h> - -#include <iostream> -#include <string> -#include <sstream> -#include <vector> -#include <iomanip> - -//Main class, TopView and EventView classes inherit from this -class ntupleXML { - protected: - std::string dataTypeCon, etaCon, labelCon, pdgIdCon, phiCon, ptCon, typeEVCon, mainTreeName; - Bool_t FR_Active, TR_Active, FRA_Active, TRA_Active, TA_Active, isTopView; - Int_t nParticles, Warn, truthPref, Append; - TChain* activeFile; - vector<TChain*> fileStore; - TTree* activeTree; - TFriendElement* friendTree; - TXMLEngine* TVXMLEng; - XMLNodePointer_t event; - Int_t FR_eventNumber; - Int_t FR_runNumber; - Double_t FR_MET_Final_ex; - Double_t FR_MET_Final_ey; - Double_t FR_MET_Final_et; - Double_t TR_MET_Truth_ex; - Double_t TR_MET_Truth_ey; - Double_t TR_MET_Truth_et; - Int_t FR_El_N; - vector<double>* FR_El_pdgId; - vector<double>* FR_El_p_T; - vector<double>* FR_El_phi; - vector<double>* FR_El_eta; - Int_t FR_Mu_N; - vector<double>* FR_Mu_pdgId; - vector<double>* FR_Mu_p_T; - vector<double>* FR_Mu_phi; - vector<double>* FR_Mu_eta; - Int_t FR_Tau_N; - vector<double>* FR_Tau_pdgId; - vector<double>* FR_Tau_p_T; - vector<double>* FR_Tau_phi; - vector<double>* FR_Tau_eta; - Int_t FR_Ph_N; - vector<double>* FR_Ph_pdgId; - vector<double>* FR_Ph_p_T; - vector<double>* FR_Ph_phi; - vector<double>* FR_Ph_eta; - Int_t FR_PJet_N; - vector<double>* FR_PJet_pdgId; - vector<double>* FR_PJet_p_T; - vector<double>* FR_PJet_phi; - vector<double>* FR_PJet_eta; - vector<int>* FR_PJet_BTagged; - Int_t FRA_El_N; - vector<double>* FRA_El_pdgId; - vector<double>* FRA_El_p_T; - vector<double>* FRA_El_phi; - vector<double>* FRA_El_eta; - Int_t FRA_Mu_N; - vector<double>* FRA_Mu_pdgId; - vector<double>* FRA_Mu_p_T; - vector<double>* FRA_Mu_phi; - vector<double>* FRA_Mu_eta; - Int_t FRA_Nu_N; - vector<double>* FRA_Nu_pdgId; - vector<double>* FRA_Nu_p_T; - vector<double>* FRA_Nu_phi; - vector<double>* FRA_Nu_eta; - Int_t FRA_HadW_N; - vector<double>* FRA_HadW_pdgId; - vector<double>* FRA_HadW_p_T; - vector<double>* FRA_HadW_phi; - vector<double>* FRA_HadW_eta; - Int_t FRA_LepW_N; - vector<double>* FRA_LepW_pdgId; - vector<double>* FRA_LepW_p_T; - vector<double>* FRA_LepW_phi; - vector<double>* FRA_LepW_eta; - Int_t FRA_HadTop_N; - vector<double>* FRA_HadTop_pdgId; - vector<double>* FRA_HadTop_p_T; - vector<double>* FRA_HadTop_phi; - vector<double>* FRA_HadTop_eta; - Int_t FRA_LepTop_N; - vector<double>* FRA_LepTop_pdgId; - vector<double>* FRA_LepTop_p_T; - vector<double>* FRA_LepTop_phi; - vector<double>* FRA_LepTop_eta; - Int_t FRA_Lepb_N; - vector<double>* FRA_Lepb_pdgId; - vector<double>* FRA_Lepb_p_T; - vector<double>* FRA_Lepb_phi; - vector<double>* FRA_Lepb_eta; - Int_t FRA_Hadb_N; - vector<double>* FRA_Hadb_pdgId; - vector<double>* FRA_Hadb_p_T; - vector<double>* FRA_Hadb_phi; - vector<double>* FRA_Hadb_eta; - Int_t FRA_Hadj_N; - vector<double>* FRA_Hadj_pdgId; - vector<double>* FRA_Hadj_p_T; - vector<double>* FRA_Hadj_phi; - vector<double>* FRA_Hadj_eta; - Int_t TRA_El_N; - vector<double>* TRA_El_pdgId; - vector<double>* TRA_El_p_T; - vector<double>* TRA_El_phi; - vector<double>* TRA_El_eta; - Int_t TRA_Mu_N; - vector<double>* TRA_Mu_pdgId; - vector<double>* TRA_Mu_p_T; - vector<double>* TRA_Mu_phi; - vector<double>* TRA_Mu_eta; - Int_t TRA_Tau_N; - vector<double>* TRA_Tau_pdgId; - vector<double>* TRA_Tau_p_T; - vector<double>* TRA_Tau_phi; - vector<double>* TRA_Tau_eta; - Int_t TRA_HadW_N; - vector<double>* TRA_HadW_pdgId; - vector<double>* TRA_HadW_p_T; - vector<double>* TRA_HadW_phi; - vector<double>* TRA_HadW_eta; - Int_t TRA_LepW_N; - vector<double>* TRA_LepW_pdgId; - vector<double>* TRA_LepW_p_T; - vector<double>* TRA_LepW_phi; - vector<double>* TRA_LepW_eta; - Int_t TRA_HadTop_N; - vector<double>* TRA_HadTop_pdgId; - vector<double>* TRA_HadTop_p_T; - vector<double>* TRA_HadTop_phi; - vector<double>* TRA_HadTop_eta; - Int_t TRA_LepTop_N; - vector<double>* TRA_LepTop_pdgId; - vector<double>* TRA_LepTop_p_T; - vector<double>* TRA_LepTop_phi; - vector<double>* TRA_LepTop_eta; - Int_t TRA_Bot_N; - vector<double>* TRA_Bot_pdgId; - vector<double>* TRA_Bot_p_T; - vector<double>* TRA_Bot_phi; - vector<double>* TRA_Bot_eta; - Int_t TRA_LQ_N; - vector<double>* TRA_LQ_pdgId; - vector<double>* TRA_LQ_p_T; - vector<double>* TRA_LQ_phi; - vector<double>* TRA_LQ_eta; - vector<double>* TA_Tru_p_T; - vector<double>* TA_Tru_phi; - vector<double>* TA_Tru_eta; - vector<double>* TA_Tru_pdgId; - vector<int>* TA_Tru_barcode; - TBranch* b_FR_eventNumber; - TBranch* b_FR_runNumber; - TBranch* b_FR_MET_Final_ex; - TBranch* b_FR_MET_Final_ey; - TBranch* b_FR_MET_Final_et; - TBranch* b_TR_MET_Truth_ex; - TBranch* b_TR_MET_Truth_ey; - TBranch* b_TR_MET_Truth_et; - TBranch* b_FR_El_N; - TBranch* b_FR_El_pdgId; - TBranch* b_FR_El_p_T; - TBranch* b_FR_El_phi; - TBranch* b_FR_El_eta; - TBranch* b_FR_Mu_N; - TBranch* b_FR_Mu_pdgId; - TBranch* b_FR_Mu_p_T; - TBranch* b_FR_Mu_phi; - TBranch* b_FR_Mu_eta; - TBranch* b_FR_Tau_N; - TBranch* b_FR_Tau_pdgId; - TBranch* b_FR_Tau_p_T; - TBranch* b_FR_Tau_phi; - TBranch* b_FR_Tau_eta; - TBranch* b_FR_Ph_N; - TBranch* b_FR_Ph_pdgId; - TBranch* b_FR_Ph_p_T; - TBranch* b_FR_Ph_phi; - TBranch* b_FR_Ph_eta; - TBranch* b_FR_PJet_N; - TBranch* b_FR_PJet_pdgId; - TBranch* b_FR_PJet_p_T; - TBranch* b_FR_PJet_phi; - TBranch* b_FR_PJet_eta; - TBranch* b_FR_PJet_BTagged; - TBranch* b_FRA_El_N; - TBranch* b_FRA_El_pdgId; - TBranch* b_FRA_El_p_T; - TBranch* b_FRA_El_phi; - TBranch* b_FRA_El_eta; - TBranch* b_FRA_Mu_N; - TBranch* b_FRA_Mu_pdgId; - TBranch* b_FRA_Mu_p_T; - TBranch* b_FRA_Mu_phi; - TBranch* b_FRA_Mu_eta; - TBranch* b_FRA_Nu_N; - TBranch* b_FRA_Nu_pdgId; - TBranch* b_FRA_Nu_p_T; - TBranch* b_FRA_Nu_phi; - TBranch* b_FRA_Nu_eta; - TBranch* b_FRA_HadW_N; - TBranch* b_FRA_HadW_pdgId; - TBranch* b_FRA_HadW_p_T; - TBranch* b_FRA_HadW_phi; - TBranch* b_FRA_HadW_eta; - TBranch* b_FRA_LepW_N; - TBranch* b_FRA_LepW_pdgId; - TBranch* b_FRA_LepW_p_T; - TBranch* b_FRA_LepW_phi; - TBranch* b_FRA_LepW_eta; - TBranch* b_FRA_HadTop_N; - TBranch* b_FRA_HadTop_pdgId; - TBranch* b_FRA_HadTop_p_T; - TBranch* b_FRA_HadTop_phi; - TBranch* b_FRA_HadTop_eta; - TBranch* b_FRA_LepTop_N; - TBranch* b_FRA_LepTop_pdgId; - TBranch* b_FRA_LepTop_p_T; - TBranch* b_FRA_LepTop_phi; - TBranch* b_FRA_LepTop_eta; - TBranch* b_FRA_Lepb_N; - TBranch* b_FRA_Lepb_pdgId; - TBranch* b_FRA_Lepb_p_T; - TBranch* b_FRA_Lepb_phi; - TBranch* b_FRA_Lepb_eta; - TBranch* b_FRA_Hadb_N; - TBranch* b_FRA_Hadb_pdgId; - TBranch* b_FRA_Hadb_p_T; - TBranch* b_FRA_Hadb_phi; - TBranch* b_FRA_Hadb_eta; - TBranch* b_FRA_Hadj_N; - TBranch* b_FRA_Hadj_pdgId; - TBranch* b_FRA_Hadj_p_T; - TBranch* b_FRA_Hadj_phi; - TBranch* b_FRA_Hadj_eta; - TBranch* b_TRA_El_N; - TBranch* b_TRA_El_pdgId; - TBranch* b_TRA_El_p_T; - TBranch* b_TRA_El_phi; - TBranch* b_TRA_El_eta; - TBranch* b_TRA_Mu_N; - TBranch* b_TRA_Mu_pdgId; - TBranch* b_TRA_Mu_p_T; - TBranch* b_TRA_Mu_phi; - TBranch* b_TRA_Mu_eta; - TBranch* b_TRA_Tau_N; - TBranch* b_TRA_Tau_pdgId; - TBranch* b_TRA_Tau_p_T; - TBranch* b_TRA_Tau_phi; - TBranch* b_TRA_Tau_eta; - TBranch* b_TRA_HadW_N; - TBranch* b_TRA_HadW_pdgId; - TBranch* b_TRA_HadW_p_T; - TBranch* b_TRA_HadW_phi; - TBranch* b_TRA_HadW_eta; - TBranch* b_TRA_LepW_N; - TBranch* b_TRA_LepW_pdgId; - TBranch* b_TRA_LepW_p_T; - TBranch* b_TRA_LepW_phi; - TBranch* b_TRA_LepW_eta; - TBranch* b_TRA_HadTop_N; - TBranch* b_TRA_HadTop_pdgId; - TBranch* b_TRA_HadTop_p_T; - TBranch* b_TRA_HadTop_phi; - TBranch* b_TRA_HadTop_eta; - TBranch* b_TRA_LepTop_N; - TBranch* b_TRA_LepTop_pdgId; - TBranch* b_TRA_LepTop_p_T; - TBranch* b_TRA_LepTop_phi; - TBranch* b_TRA_LepTop_eta; - TBranch* b_TRA_Bot_N; - TBranch* b_TRA_Bot_pdgId; - TBranch* b_TRA_Bot_p_T; - TBranch* b_TRA_Bot_phi; - TBranch* b_TRA_Bot_eta; - TBranch* b_TRA_LQ_N; - TBranch* b_TRA_LQ_pdgId; - TBranch* b_TRA_LQ_p_T; - TBranch* b_TRA_LQ_phi; - TBranch* b_TRA_LQ_eta; - TBranch* b_TA_Tru_p_T; - TBranch* b_TA_Tru_phi; - TBranch* b_TA_Tru_eta; - TBranch* b_TA_Tru_pdgId; - TBranch* b_TA_Tru_barcode; - //Protected memeber functions - template<typename TYPE> - std::string asString(const TYPE&); - void SetBranches(void); - void FillBranches(Int_t entryNumber); - void SetActiveFile(Int_t fileNumber); - void GetFullReco(void); - void GetFullRecoAna(void); - void GetTruthAll(Bool_t onlyMuons); - void GetTruthAna(Bool_t onlyMuons); - void GetMET(Bool_t getTruth); - void StartXML(void); - void FillXML_ParticleDump(Char_t* nodeName, Char_t* storeGateKey); - void FillXML_TruthDump(Char_t* nodeName, Char_t* storeGateKey); - void FillXML_MET(Char_t* storeGateKey); - void EndXML(Char_t* outputFilename); - public: - Bool_t ntuple2XML(Char_t* outputFilename, UInt_t entryNumber, UInt_t fileNumber); - void Add(Char_t* fileLocation); - void Clear(void); - Int_t GetNfiles(void) { return fileStore.size(); } - Int_t GetNentries(UInt_t fileNumber); - Bool_t SetWarnLevel(UInt_t warnLevel); - Bool_t SetTruthPreference(UInt_t truthPreference); - Bool_t SetFilenameAppend(UInt_t filenameAppend); - -}; - -struct TopViewXML: public ntupleXML { - TopViewXML(Char_t* fileLocation); - TopViewXML(void); - ~TopViewXML(void) {} -}; - -struct EventViewXML: public ntupleXML { - EventViewXML(Char_t* fileLocation); - EventViewXML(void); - ~EventViewXML(void) {} -}; - -//Constructors// - -TopViewXML::TopViewXML(Char_t* fileLocation) { - isTopView=1; - Append=1; Warn=1; truthPref=2; - mainTreeName = "FullReco0"; - ntupleXML::Add(fileLocation); -} - -TopViewXML::TopViewXML(void) { - isTopView=1; - Append=1; Warn=1; truthPref=2; - mainTreeName = "FullReco0"; -} - -EventViewXML::EventViewXML(Char_t* fileLocation) { - isTopView=0; - Append=1; Warn=1; truthPref=2; - mainTreeName = "CollectionTree"; - ntupleXML::Add(fileLocation); -} - -EventViewXML::EventViewXML(void) { - isTopView=0; - Append=1; Warn=1; truthPref=2; - mainTreeName = "CollectionTree"; -} - -//Inherited public methods// - -//ntuple2XML takes an entry from a file loaded in the internal File Chain and writes an -//atlantis xml file for the event. -Bool_t ntupleXML::ntuple2XML(Char_t* outputFilename, UInt_t entryNumber, UInt_t fileNumber) { - - if (fileNumber >= fileStore.size()) { - if (Warn>0) { std::cout << "\nntupleXML: Error cannot access file #" << fileNumber - << ", " << fileStore.size() << " file(s) currently loaded. "; - } - return 0; - } - - //Set the required file as activeFile, main tree as activeTree & associate branches - ntupleXML::SetActiveFile(fileNumber); - - if (entryNumber >= activeTree->GetEntries()) { - if (Warn>0) { std::cout << "\nntupleXML: Error cannot access entry #" << entryNumber - << ", file #" << fileNumber << " contains " << activeTree->GetEntries() << " entries. "; - } - return 0; - } - - //Cannot proceed without FullReco/CollectionTree branches set - if (!FR_Active) { - if (Warn>0) { std::cout << "\nntupleXML: Error unable to access " << mainTreeName << " Tree. "; } - return 0; - } - - //Retrieve event - ntupleXML::FillBranches(entryNumber); - nParticles=0; - - //Prepare XML document - ntupleXML::StartXML(); - - ntupleXML::GetFullReco(); - if (nParticles) { ntupleXML::FillXML_ParticleDump("CompositeParticle","RecoView"); } - - ntupleXML::GetMET(0); - ntupleXML::FillXML_MET("MET_Final"); - if (TR_Active) { - ntupleXML::GetMET(1); - ntupleXML::FillXML_MET("MET_Truth"); - } else if (Warn>1) { std::cout << "\nntupleXML: Warning unable to output MET_Truth. "; } - - if (FRA_Active) { - ntupleXML::GetFullRecoAna(); - if (nParticles) { ntupleXML::FillXML_ParticleDump("CompositeParticle","RecoAnaView"); } - } else if (Warn>1 && isTopView) { std::cout << "\nntupleXML: Warning unable to output FullRecoAna Tree. "; } - - if (TA_Active && truthPref == 1) { - ntupleXML::GetTruthAll(0); - if (nParticles) { ntupleXML::FillXML_TruthDump("STr",""); } - ntupleXML::GetTruthAll(1); //Get only muons - if (nParticles) { ntupleXML::FillXML_TruthDump("SMTr",""); } - } else if (TRA_Active && truthPref) { - ntupleXML::GetTruthAna(0); - if (nParticles) { ntupleXML::FillXML_TruthDump("STr",""); } - ntupleXML::GetTruthAna(1); - if (nParticles) { ntupleXML::FillXML_TruthDump("SMTr",""); } - } else if (Warn>1 && truthPref && isTopView) { - std::cout << "\nntupleXML: Warning unable to output TruthAna or TruthAll Tree. "; - } - - //Construct filename - std::string filenameStr(outputFilename), ext; - ext = filenameStr.substr(filenameStr.length() - 4, 4); - if (Append) { - if (ext == ".xml" || ext == ".Xml" || ext == ".XML") { - filenameStr = filenameStr.substr(0, filenameStr.length() - 4) ; - if (Append==1) { filenameStr += "_" + asString(FR_eventNumber) + ext; } - else { filenameStr += "_" + asString(entryNumber) + ext; } - } else { - if (Append==1) { filenameStr += "_" + asString(FR_eventNumber) + ".xml"; } - else { filenameStr += "_" + asString(entryNumber) + ".xml"; } - } - } else { - if (!(ext == ".xml" || ext == ".Xml" || ext == ".XML")) { - filenameStr += ".xml"; - } - } - - //Write .xml file - ntupleXML::EndXML((Char_t*) filenameStr.c_str()); - if (Warn>1) { std::cout << "\nntupleXML: Output to " << filenameStr; } - - //Return success - return 1; -} - -Bool_t ntupleXML::SetWarnLevel(UInt_t warnLevel) { - if (warnLevel <= 2) { - Warn=warnLevel; - return 1; - } else { return 0; } -} - -Bool_t ntupleXML::SetTruthPreference(UInt_t truthPreference) { - if (truthPreference <= 2) { - truthPref=truthPreference; - return 1; - } else { return 0; } -} - -Bool_t ntupleXML::SetFilenameAppend(UInt_t filenameAppend) { - if (filenameAppend <= 2) { - Append=filenameAppend; - return 1; - } else { return 0; } -} - -Int_t ntupleXML::GetNentries(UInt_t fileNumber) { - if (fileNumber >= fileStore.size()) { - if (Warn>0) { std::cout << "\nntupleXML: Error cannot access file #" << fileNumber - << ", " << fileStore.size() << " file(s) currently loaded. "; - } - return 0; - } else { - ntupleXML::SetActiveFile(fileNumber); - return activeTree->GetEntries(); - } -} - -void ntupleXML::Add(Char_t* fileLocation) { - TChain* tf; - if (isTopView) { - tf = new TChain("FullReco0"); - tf->Add(fileLocation); - tf->AddFriend("FullRecoAna0"); - tf->AddFriend("TruthAna0"); - tf->AddFriend("TruthAll0"); - tf->AddFriend("Truth0"); - if ( tf->LoadTree(0) < 0 ) { - if (Warn>0) { std::cout << "\nntupleXML: Error, file was not added. "; } - return; - } - } else { - tf = new TChain("CollectionTree"); - tf->Add(fileLocation); - if ( tf->LoadTree(0) < 0 ) { - if (Warn>0) { std::cout << "\nntupleXML: Error, file was not added. "; } - return; - } - - } - fileStore.push_back(tf); -} - -void ntupleXML::Clear(void) { - for (UInt_t i=0; i<fileStore.size(); i++) { - delete fileStore[i]; - } - fileStore.clear(); - activeFile = NULL; -} - -//XML File Construction Members// - -void ntupleXML::StartXML(void) { - //Create XML engine - TVXMLEng = new TXMLEngine(); - event = TVXMLEng->NewChild(0, 0, "Event"); - TVXMLEng->NewAttr(event, 0, "version", "ntuple"); - TVXMLEng->NewIntAttr(event, "runNumber", FR_runNumber); - TVXMLEng->NewIntAttr(event, "eventNumber", FR_eventNumber); - TDatime* makeTime = new TDatime(); - Char_t makeTimeStr[26]; - makeTime->AsString(makeTimeStr); //This 'AsString' is member of TDatime - delete makeTime; - TVXMLEng->NewAttr(event, 0, "dateTime", makeTimeStr); -} - -void ntupleXML::FillXML_ParticleDump(Char_t* nodeName, Char_t* storeGateKey) { - //Create Composite particle subnode - XMLNodePointer_t compPart = TVXMLEng->NewChild(event, 0, nodeName); - TVXMLEng->NewIntAttr(compPart, "count", nParticles); - TVXMLEng->NewAttr(compPart, 0, "storeGateKey", storeGateKey); - TVXMLEng->NewChild(compPart, 0, "dataType", dataTypeCon.c_str()); - TVXMLEng->NewChild(compPart, 0, "eta", etaCon.c_str()); - TVXMLEng->NewChild(compPart, 0, "label", labelCon.c_str()); - TVXMLEng->NewChild(compPart, 0, "pdgId", pdgIdCon.c_str()); - TVXMLEng->NewChild(compPart, 0, "phi", phiCon.c_str()); - TVXMLEng->NewChild(compPart, 0, "pt", ptCon.c_str()); - TVXMLEng->NewChild(compPart, 0, "typeEV", typeEVCon.c_str()); - dataTypeCon=""; etaCon=""; phiCon=""; labelCon=""; pdgIdCon=""; ptCon=""; typeEVCon=""; - nParticles=0; -} - -void ntupleXML::FillXML_TruthDump(Char_t* nodeName, Char_t* storeGateKey) { - //Create truth subnode - XMLNodePointer_t truBlock = TVXMLEng->NewChild(event, 0, nodeName); - TVXMLEng->NewIntAttr(truBlock, "count", nParticles); - TVXMLEng->NewAttr(truBlock, 0, "storeGateKey", storeGateKey); - TVXMLEng->NewChild(truBlock, 0, "code", pdgIdCon.c_str()); - TVXMLEng->NewChild(truBlock, 0, "eta", etaCon.c_str()); - TVXMLEng->NewChild(truBlock, 0, "id", labelCon.c_str()); - TVXMLEng->NewChild(truBlock, 0, "phi", phiCon.c_str()); - TVXMLEng->NewChild(truBlock, 0, "phiVertex", dataTypeCon.c_str()); - TVXMLEng->NewChild(truBlock, 0, "pt", ptCon.c_str()); - TVXMLEng->NewChild(truBlock, 0, "rhoVertex", dataTypeCon.c_str()); - TVXMLEng->NewChild(truBlock, 0, "zVertex", dataTypeCon.c_str()); - dataTypeCon=""; etaCon=""; phiCon=""; labelCon=""; pdgIdCon=""; ptCon=""; - nParticles=0; -} - -void ntupleXML::FillXML_MET(Char_t* storeGateKey) { - //Create MET subnode - XMLNodePointer_t MET = TVXMLEng->NewChild(event, 0, "ETMis"); - TVXMLEng->NewIntAttr(MET, "count", 1); - TVXMLEng->NewAttr(MET, 0, "storeGateKey", storeGateKey); - TVXMLEng->NewChild(MET, 0, "et", etaCon.c_str()); - TVXMLEng->NewChild(MET, 0, "etx", phiCon.c_str()); - TVXMLEng->NewChild(MET, 0, "ety", ptCon.c_str()); - etaCon=""; phiCon=""; ptCon=""; -} - -void ntupleXML::EndXML(Char_t* outputFilename) { - //Create document - XMLDocPointer_t xmldoc = TVXMLEng->NewDoc(); - TVXMLEng->DocSetRootElement(xmldoc, event); - TVXMLEng->AddDocRawLine(xmldoc, "<?ATLAS Release: \"RELEASE#\"?>"); - TVXMLEng->AddDocRawLine(xmldoc, "<!DOCTYPE Event SYSTEM \"event.dtd\">"); - // Save document to file - TVXMLEng->SaveDoc(xmldoc, outputFilename); - // Release memory before exit - TVXMLEng->FreeDoc(xmldoc); - delete TVXMLEng; -} - -//String Filling Members// - -void ntupleXML::GetFullReco(void) { - std::string id; - if (isTopView) { id = "FR_"; } - else { id = "EV_"; } - for (Int_t i=0; i<FR_El_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVElectron "; - labelCon += id + "Electron "; - etaCon += asString(FR_El_eta->at(i)) + " "; - phiCon += asString(FR_El_phi->at(i)) + " "; - ptCon += asString(FR_El_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FR_El_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FR_Mu_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVMuon "; - labelCon += id + "Muon "; - etaCon += asString(FR_Mu_eta->at(i)) + " "; - phiCon += asString(FR_Mu_phi->at(i)) + " "; - ptCon += asString(FR_Mu_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FR_Mu_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FR_Tau_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVTauJet "; - labelCon += id + "Tau "; - etaCon += asString(FR_Tau_eta->at(i)) + " "; - phiCon += asString(FR_Tau_phi->at(i)) + " "; - ptCon += asString(FR_Tau_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FR_Tau_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FR_Ph_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVPhoton "; - labelCon += id + "Photon "; - etaCon += asString(FR_Ph_eta->at(i)) + " "; - phiCon += asString(FR_Ph_phi->at(i)) + " "; - ptCon += asString(FR_Ph_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FR_Ph_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FR_PJet_N; i++) { - if (isTopView) { - if (FR_PJet_BTagged->at(i)) { - typeEVCon += "EVBJet "; - labelCon += id + "BTaggedJet "; - pdgIdCon += "5 "; - } else { - typeEVCon += "EVParticleJet "; - labelCon += id + "ParticleJet "; - pdgIdCon += "0 "; - } - } else { - typeEVCon += "EVParticleJet "; - labelCon += id + "ParticleJet "; - pdgIdCon += "5 "; - } - nParticles++; - dataTypeCon += "1 "; - etaCon += asString(FR_PJet_eta->at(i)) + " "; - phiCon += asString(FR_PJet_phi->at(i)) + " "; - ptCon += asString(FR_PJet_p_T->at(i)/1000.) + " "; - } -} - -void ntupleXML::GetMET(Bool_t getTruth) { - if (!getTruth) { - etaCon += asString(FR_MET_Final_et/1000.) + " "; - phiCon += asString(FR_MET_Final_ex/1000.) + " "; - ptCon += asString(FR_MET_Final_ey/1000.) + " "; - } else { - etaCon += asString(TR_MET_Truth_et/1000.) + " "; - phiCon += asString(TR_MET_Truth_ex/1000.) + " "; - ptCon += asString(TR_MET_Truth_ey/1000.) + " "; - } -} - -void ntupleXML::GetFullRecoAna(void) { - for (Int_t i=0; i<FRA_El_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVElectron "; - labelCon += "FRA_Electron "; - etaCon += asString(FRA_El_eta->at(i)) + " "; - phiCon += asString(FRA_El_phi->at(i)) + " "; - ptCon += asString(FRA_El_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FRA_El_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FRA_Mu_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVMuon "; - labelCon += "FRA_Muon "; - etaCon += asString(FRA_Mu_eta->at(i)) + " "; - phiCon += asString(FRA_Mu_phi->at(i)) + " "; - ptCon += asString(FRA_Mu_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FRA_Mu_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FRA_Nu_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVNeutrino "; - labelCon += "FRA_Neutrino "; - etaCon += asString(FRA_Nu_eta->at(i)) + " "; - phiCon += asString(FRA_Nu_phi->at(i)) + " "; - ptCon += asString(FRA_Nu_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FRA_Nu_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FRA_HadW_N; i++) { - nParticles++; - dataTypeCon += "0 "; - typeEVCon += "EVCompositeParticle "; - labelCon += "FRA_HadronicW "; - etaCon += asString(FRA_HadW_eta->at(i)) + " "; - phiCon += asString(FRA_HadW_phi->at(i)) + " "; - ptCon += asString(FRA_HadW_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FRA_HadW_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FRA_LepW_N; i++) { - nParticles++; - dataTypeCon += "0 "; - typeEVCon += "EVCompositeParticle "; - labelCon += "FRA_LeptonicW "; - etaCon += asString(FRA_LepW_eta->at(i)) + " "; - phiCon += asString(FRA_LepW_phi->at(i)) + " "; - ptCon += asString(FRA_LepW_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FRA_LepW_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FRA_HadTop_N; i++) { - nParticles++; - dataTypeCon += "0 "; - typeEVCon += "EVCompositeParticle "; - labelCon += "FRA_HadronicTop "; - etaCon += asString(FRA_HadTop_eta->at(i)) + " "; - phiCon += asString(FRA_HadTop_phi->at(i)) + " "; - ptCon += asString(FRA_HadTop_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FRA_HadTop_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FRA_LepTop_N; i++) { - nParticles++; - dataTypeCon += "0 "; - typeEVCon += "EVCompositeParticle "; - labelCon += "FRA_LeptonicTop "; - etaCon += asString(FRA_LepTop_eta->at(i)) + " "; - phiCon += asString(FRA_LepTop_phi->at(i)) + " "; - ptCon += asString(FRA_LepTop_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)FRA_LepTop_pdgId->at(i)) + " "; - } - for (Int_t i=0; i<FRA_Lepb_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVBJet "; - labelCon += "FRA_LeptonicBJet "; - etaCon += asString(FRA_Lepb_eta->at(i)) + " "; - phiCon += asString(FRA_Lepb_phi->at(i)) + " "; - ptCon += asString(FRA_Lepb_p_T->at(i)/1000.) + " "; - pdgIdCon += "5 "; - } - for (Int_t i=0; i<FRA_Hadb_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVBJet "; - labelCon += "FRA_HadronicBJet "; - etaCon += asString(FRA_Hadb_eta->at(i)) + " "; - phiCon += asString(FRA_Hadb_phi->at(i)) + " "; - ptCon += asString(FRA_Hadb_p_T->at(i)/1000.) + " "; - pdgIdCon += "5 "; - } - for (Int_t i=0; i<FRA_Hadj_N; i++) { - nParticles++; - dataTypeCon += "1 "; - typeEVCon += "EVParticleJet "; - labelCon += "FRA_HadronicParticleJet "; - etaCon += asString(FRA_Hadj_eta->at(i)) + " "; - phiCon += asString(FRA_Hadj_phi->at(i)) + " "; - ptCon += asString(FRA_Hadj_p_T->at(i)/1000.) + " "; - pdgIdCon += "0 "; - } -} - -//onlyMouns is set true when filling SMTr -void ntupleXML::GetTruthAna(Bool_t onlyMuons) { - Int_t sign; - for (Int_t i=0; i<TRA_Mu_N; i++) { - nParticles++; - etaCon += asString(TRA_Mu_eta->at(i)) + " "; - phiCon += asString(TRA_Mu_phi->at(i)) + " "; - ptCon += asString(TRA_Mu_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)TRA_Mu_pdgId->at(i)) + " "; - labelCon += "0 "; //Barcode - dataTypeCon += "0.000001 "; //Used to fill vertexes - } - - if (onlyMuons) { return; } - - for (Int_t i=0; i<TRA_El_N; i++) { - nParticles++; - etaCon += asString(TRA_El_eta->at(i)) + " "; - phiCon += asString(TRA_El_phi->at(i)) + " "; - ptCon += asString(TRA_El_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)TRA_El_pdgId->at(i)) + " "; - labelCon += "0 "; - dataTypeCon += " 0.000001 "; - } - for (Int_t i=0; i<TRA_Tau_N; i++) { - nParticles++; - etaCon += asString(TRA_Tau_eta->at(i)) + " "; - phiCon += asString(TRA_Tau_phi->at(i)) + " "; - ptCon += asString(TRA_Tau_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)TRA_Tau_pdgId->at(i)) + " "; - labelCon += "0 "; - dataTypeCon += "0.000001 "; - } - for (Int_t i=0; i<TRA_HadW_N; i++) { - nParticles++; - etaCon += asString(TRA_HadW_eta->at(i)) + " "; - phiCon += asString(TRA_HadW_phi->at(i)) + " "; - ptCon += asString(TRA_HadW_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)TRA_HadW_pdgId->at(i)) + " "; - labelCon += "0 "; - dataTypeCon += "0.000001 "; - } - for (Int_t i=0; i<TRA_LepW_N; i++) { - nParticles++; - etaCon += asString(TRA_LepW_eta->at(i)) + " "; - phiCon += asString(TRA_LepW_phi->at(i)) + " "; - ptCon += asString(TRA_LepW_p_T->at(i)/1000.) + " "; - pdgIdCon += asString((Int_t)TRA_LepW_pdgId->at(i)) + " "; - labelCon += "0 "; - dataTypeCon += "0.000001 "; - } - for (Int_t i=0; i<TRA_HadTop_N; i++) { - nParticles++; - etaCon += asString(TRA_HadTop_eta->at(i)) + " "; - phiCon += asString(TRA_HadTop_phi->at(i)) + " "; - ptCon += asString(TRA_HadTop_p_T->at(i)/1000.) + " "; - sign = (Int_t) (fabs(TRA_HadTop_pdgId->at(i))/TRA_HadTop_pdgId->at(i)); - pdgIdCon += asString((Int_t)(TRA_HadTop_pdgId->at(i)+(600*sign))) + " "; - labelCon += "0 "; - dataTypeCon += "0.000001 "; - } - for (Int_t i=0; i<TRA_LepTop_N; i++) { - nParticles++; - etaCon += asString(TRA_LepTop_eta->at(i)) + " "; - phiCon += asString(TRA_LepTop_phi->at(i)) + " "; - ptCon += asString(TRA_LepTop_p_T->at(i)/1000.) + " "; - sign = (Int_t) (fabs(TRA_LepTop_pdgId->at(i))/TRA_LepTop_pdgId->at(i)); - pdgIdCon += asString((Int_t)(TRA_LepTop_pdgId->at(i)+(600*sign))) + " "; - labelCon += "0 "; - dataTypeCon += "0.000001 "; - } - for (Int_t i=0; i<TRA_Bot_N; i++) { - nParticles++; - etaCon += asString(TRA_Bot_eta->at(i)) + " "; - phiCon += asString(TRA_Bot_phi->at(i)) + " "; - ptCon += asString(TRA_Bot_p_T->at(i)/1000.) + " "; - sign = (Int_t) (fabs(TRA_Bot_pdgId->at(i))/TRA_Bot_pdgId->at(i)); - pdgIdCon += asString((Int_t)(TRA_Bot_pdgId->at(i)+(600*sign))) + " "; - labelCon += "0 "; - dataTypeCon += "0.000001 "; - } - for (Int_t i=0; i<TRA_LQ_N; i++) { //LQ - Light Quarks - nParticles++; - etaCon += asString(TRA_LQ_eta->at(i)) + " "; - phiCon += asString(TRA_LQ_phi->at(i)) + " "; - ptCon += asString(TRA_LQ_p_T->at(i)/1000.) + " "; - sign = (Int_t) (fabs(TRA_LQ_pdgId->at(i))/TRA_LQ_pdgId->at(i)); - pdgIdCon += asString((Int_t)(TRA_LQ_pdgId->at(i)+(600*sign))) + " "; - labelCon += "0 "; - dataTypeCon += "0.000001 "; - } -} - -void ntupleXML::GetTruthAll(Bool_t onlyMuons) { - //Loop over entire truth block (if present) - Int_t id, sign; - for (UInt_t i=0; i<TA_Tru_p_T->size(); i++) { - if (!onlyMuons || (onlyMuons && fabs(TA_Tru_pdgId->at(i)) == 13)) { - nParticles++; - etaCon += asString(TA_Tru_eta->at(i)) + " "; - phiCon += asString(TA_Tru_phi->at(i)) + " "; - ptCon += asString(TA_Tru_p_T->at(i)/1000.) + " "; - id = (Int_t) TA_Tru_pdgId->at(i); - sign = (Int_t) (fabs(TA_Tru_pdgId->at(i))/TA_Tru_pdgId->at(i)); - //Atlantis' True Particle Simulation ignores quarks, however with TopView - //we are interested in t and b quarks, 6 special pdgIds have therefore - //been set up in Atlantis (601-606) so as to display quarks from ntuples - if (abs(id) <= 6) { id += (600 * sign); } - pdgIdCon += asString(id) + " "; - labelCon += asString(TA_Tru_barcode->at(i)) + " "; - dataTypeCon += "0.000001 "; //If zero, Atlantis crashes on eta-phi plot due to rhoVertex - } - } -} - -//Branch Association// - -void ntupleXML::SetBranches(void) { - FR_El_pdgId = 0; - FR_El_p_T = 0; - FR_El_phi = 0; - FR_El_eta = 0; - FR_Mu_pdgId = 0; - FR_Mu_p_T = 0; - FR_Mu_phi = 0; - FR_Mu_eta = 0; - FR_Tau_pdgId = 0; - FR_Tau_p_T = 0; - FR_Tau_phi = 0; - FR_Tau_eta = 0; - FR_Ph_pdgId = 0; - FR_Ph_p_T = 0; - FR_Ph_phi = 0; - FR_Ph_eta = 0; - FR_PJet_pdgId = 0; - FR_PJet_p_T = 0; - FR_PJet_phi = 0; - FR_PJet_eta = 0; - FR_PJet_BTagged = 0; - FRA_El_pdgId = 0; - FRA_El_p_T = 0; - FRA_El_phi = 0; - FRA_El_eta = 0; - FRA_Mu_pdgId = 0; - FRA_Mu_p_T = 0; - FRA_Mu_phi = 0; - FRA_Mu_eta = 0; - FRA_Nu_pdgId = 0; - FRA_Nu_p_T = 0; - FRA_Nu_phi = 0; - FRA_Nu_eta = 0; - FRA_HadW_pdgId = 0; - FRA_HadW_p_T = 0; - FRA_HadW_phi = 0; - FRA_HadW_eta = 0; - FRA_LepW_pdgId = 0; - FRA_LepW_p_T = 0; - FRA_LepW_phi = 0; - FRA_LepW_eta = 0; - FRA_HadTop_pdgId = 0; - FRA_HadTop_p_T = 0; - FRA_HadTop_phi = 0; - FRA_HadTop_eta = 0; - FRA_LepTop_pdgId = 0; - FRA_LepTop_p_T = 0; - FRA_LepTop_phi = 0; - FRA_LepTop_eta = 0; - FRA_Lepb_pdgId = 0; - FRA_Lepb_p_T = 0; - FRA_Lepb_phi = 0; - FRA_Lepb_eta = 0; - FRA_Hadb_pdgId = 0; - FRA_Hadb_p_T = 0; - FRA_Hadb_phi = 0; - FRA_Hadb_eta = 0; - FRA_Hadj_pdgId = 0; - FRA_Hadj_p_T = 0; - FRA_Hadj_phi = 0; - FRA_Hadj_eta = 0; - TRA_El_pdgId = 0; - TRA_El_p_T = 0; - TRA_El_phi = 0; - TRA_El_eta = 0; - TRA_Mu_pdgId = 0; - TRA_Mu_p_T = 0; - TRA_Mu_phi = 0; - TRA_Mu_eta = 0; - TRA_Tau_pdgId = 0; - TRA_Tau_p_T = 0; - TRA_Tau_phi = 0; - TRA_Tau_eta = 0; - TRA_HadW_pdgId = 0; - TRA_HadW_p_T = 0; - TRA_HadW_phi = 0; - TRA_HadW_eta = 0; - TRA_LepW_pdgId = 0; - TRA_LepW_p_T = 0; - TRA_LepW_phi = 0; - TRA_LepW_eta = 0; - TRA_HadTop_pdgId = 0; - TRA_HadTop_p_T = 0; - TRA_HadTop_phi = 0; - TRA_HadTop_eta = 0; - TRA_LepTop_pdgId = 0; - TRA_LepTop_p_T = 0; - TRA_LepTop_phi = 0; - TRA_LepTop_eta = 0; - TRA_Bot_pdgId = 0; - TRA_Bot_p_T = 0; - TRA_Bot_phi = 0; - TRA_Bot_eta = 0; - TRA_LQ_pdgId = 0; - TRA_LQ_p_T = 0; - TRA_LQ_phi = 0; - TRA_LQ_eta = 0; - TA_Tru_p_T = 0; - TA_Tru_phi = 0; - TA_Tru_eta = 0; - TA_Tru_pdgId = 0; - TA_Tru_barcode = 0; - FR_Active=0; - TR_Active=0; - FRA_Active=0; - TRA_Active=0; - TA_Active=0; - - activeTree = activeFile->GetTree(); - - if (activeTree) { - FR_Active = 1; - activeTree->SetBranchAddress("eventNumber", &FR_eventNumber, &b_FR_eventNumber); - activeTree->SetBranchAddress("runNumber", &FR_runNumber, &b_FR_runNumber); - activeTree->SetBranchAddress("MET_Final_ex", &FR_MET_Final_ex, &b_FR_MET_Final_ex); - activeTree->SetBranchAddress("MET_Final_ey", &FR_MET_Final_ey, &b_FR_MET_Final_ey); - activeTree->SetBranchAddress("MET_Final_et", &FR_MET_Final_et, &b_FR_MET_Final_et); - if (!isTopView) { - //With EventView ntuples, MET Truth is in the CollectionTree - activeTree->SetBranchAddress("MET_Truth_ex", &TR_MET_Truth_ex, &b_TR_MET_Truth_ex); - activeTree->SetBranchAddress("MET_Truth_ey", &TR_MET_Truth_ey, &b_TR_MET_Truth_ey); - activeTree->SetBranchAddress("MET_Truth_et", &TR_MET_Truth_et, &b_TR_MET_Truth_et); - TR_Active=1; - } - activeTree->SetBranchAddress("El_N", &FR_El_N, &b_FR_El_N); - activeTree->SetBranchAddress("El_p_T", &FR_El_p_T, &b_FR_El_p_T); - activeTree->SetBranchAddress("El_pdgId", &FR_El_pdgId, &b_FR_El_pdgId); - activeTree->SetBranchAddress("El_phi", &FR_El_phi, &b_FR_El_phi); - activeTree->SetBranchAddress("El_eta", &FR_El_eta, &b_FR_El_eta); - activeTree->SetBranchAddress("Mu_N", &FR_Mu_N, &b_FR_Mu_N); - activeTree->SetBranchAddress("Mu_p_T", &FR_Mu_p_T, &b_FR_Mu_p_T); - activeTree->SetBranchAddress("Mu_pdgId", &FR_Mu_pdgId, &b_FR_Mu_pdgId); - activeTree->SetBranchAddress("Mu_phi", &FR_Mu_phi, &b_FR_Mu_phi); - activeTree->SetBranchAddress("Mu_eta", &FR_Mu_eta, &b_FR_Mu_eta); - activeTree->SetBranchAddress("Tau_N", &FR_Tau_N, &b_FR_Tau_N); - activeTree->SetBranchAddress("Tau_p_T", &FR_Tau_p_T, &b_FR_Tau_p_T); - activeTree->SetBranchAddress("Tau_pdgId", &FR_Tau_pdgId, &b_FR_Tau_pdgId); - activeTree->SetBranchAddress("Tau_phi", &FR_Tau_phi, &b_FR_Tau_phi); - activeTree->SetBranchAddress("Tau_eta", &FR_Tau_eta, &b_FR_Tau_eta); - activeTree->SetBranchAddress("Ph_N", &FR_Ph_N, &b_FR_Ph_N); - activeTree->SetBranchAddress("Ph_p_T", &FR_Ph_p_T, &b_FR_Ph_p_T); - activeTree->SetBranchAddress("Ph_pdgId", &FR_Ph_pdgId, &b_FR_Ph_pdgId); - activeTree->SetBranchAddress("Ph_phi", &FR_Ph_phi, &b_FR_Ph_phi); - activeTree->SetBranchAddress("Ph_eta", &FR_Ph_eta, &b_FR_Ph_eta); - activeTree->SetBranchAddress("PJet_N", &FR_PJet_N, &b_FR_PJet_N); - activeTree->SetBranchAddress("PJet_p_T", &FR_PJet_p_T, &b_FR_PJet_p_T); - activeTree->SetBranchAddress("PJet_pdgId", &FR_PJet_pdgId, &b_FR_PJet_pdgId); - activeTree->SetBranchAddress("PJet_phi", &FR_PJet_phi, &b_FR_PJet_phi); - activeTree->SetBranchAddress("PJet_eta", &FR_PJet_eta, &b_FR_PJet_eta); - if (isTopView) { activeTree->SetBranchAddress("PJet_BTagged", &FR_PJet_BTagged, &b_FR_PJet_BTagged); } - } else if (Warn>1) { std::cout << "\nntupleXML: Warning cannot find " << mainTreeName << " tree. "; } - - //Stop here with EventView - if (!isTopView) { return; } - - friendTree = (TFriendElement*) (activeFile->GetListOfFriends()->FindObject("FullRecoAna0")); - activeTree = friendTree->GetTree(); - if (activeTree) { - FRA_Active=1; - activeTree->SetBranchAddress("El_N", &FRA_El_N, &b_FRA_El_N); - activeTree->SetBranchAddress("El_p_T", &FRA_El_p_T, &b_FRA_El_p_T); - activeTree->SetBranchAddress("El_pdgId", &FRA_El_pdgId, &b_FRA_El_pdgId); - activeTree->SetBranchAddress("El_phi", &FRA_El_phi, &b_FRA_El_phi); - activeTree->SetBranchAddress("El_eta", &FRA_El_eta, &b_FRA_El_eta); - activeTree->SetBranchAddress("Mu_N", &FRA_Mu_N, &b_FRA_Mu_N); - activeTree->SetBranchAddress("Mu_p_T", &FRA_Mu_p_T, &b_FRA_Mu_p_T); - activeTree->SetBranchAddress("Mu_pdgId", &FRA_Mu_pdgId, &b_FRA_Mu_pdgId); - activeTree->SetBranchAddress("Mu_phi", &FRA_Mu_phi, &b_FRA_Mu_phi); - activeTree->SetBranchAddress("Mu_eta", &FRA_Mu_eta, &b_FRA_Mu_eta); - activeTree->SetBranchAddress("Nu_N", &FRA_Nu_N, &b_FRA_Nu_N); - activeTree->SetBranchAddress("Nu_p_T", &FRA_Nu_p_T, &b_FRA_Nu_p_T); - activeTree->SetBranchAddress("Nu_pdgId", &FRA_Nu_pdgId, &b_FRA_Nu_pdgId); - activeTree->SetBranchAddress("Nu_phi", &FRA_Nu_phi, &b_FRA_Nu_phi); - activeTree->SetBranchAddress("Nu_eta", &FRA_Nu_eta, &b_FRA_Nu_eta); - activeTree->SetBranchAddress("HadW_N", &FRA_HadW_N, &b_FRA_HadW_N); - activeTree->SetBranchAddress("HadW_p_T", &FRA_HadW_p_T, &b_FRA_HadW_p_T); - activeTree->SetBranchAddress("HadW_pdgId", &FRA_HadW_pdgId, &b_FRA_HadW_pdgId); - activeTree->SetBranchAddress("HadW_phi", &FRA_HadW_phi, &b_FRA_HadW_phi); - activeTree->SetBranchAddress("HadW_eta", &FRA_HadW_eta, &b_FRA_HadW_eta); - activeTree->SetBranchAddress("LepW_N", &FRA_LepW_N, &b_FRA_LepW_N); - activeTree->SetBranchAddress("LepW_p_T", &FRA_LepW_p_T, &b_FRA_LepW_p_T); - activeTree->SetBranchAddress("LepW_pdgId", &FRA_LepW_pdgId, &b_FRA_LepW_pdgId); - activeTree->SetBranchAddress("LepW_phi", &FRA_LepW_phi, &b_FRA_LepW_phi); - activeTree->SetBranchAddress("LepW_eta", &FRA_LepW_eta, &b_FRA_LepW_eta); - activeTree->SetBranchAddress("HadTop_N", &FRA_HadTop_N, &b_FRA_HadTop_N); - activeTree->SetBranchAddress("HadTop_p_T", &FRA_HadTop_p_T, &b_FRA_HadTop_p_T); - activeTree->SetBranchAddress("HadTop_pdgId", &FRA_HadTop_pdgId, &b_FRA_HadTop_pdgId); - activeTree->SetBranchAddress("HadTop_phi", &FRA_HadTop_phi, &b_FRA_HadTop_phi); - activeTree->SetBranchAddress("HadTop_eta", &FRA_HadTop_eta, &b_FRA_HadTop_eta); - activeTree->SetBranchAddress("LepTop_N", &FRA_LepTop_N, &b_FRA_LepTop_N); - activeTree->SetBranchAddress("LepTop_p_T", &FRA_LepTop_p_T, &b_FRA_LepTop_p_T); - activeTree->SetBranchAddress("LepTop_pdgId", &FRA_LepTop_pdgId, &b_FRA_LepTop_pdgId); - activeTree->SetBranchAddress("LepTop_phi", &FRA_LepTop_phi, &b_FRA_LepTop_phi); - activeTree->SetBranchAddress("LepTop_eta", &FRA_LepTop_eta, &b_FRA_LepTop_eta); - activeTree->SetBranchAddress("Lepb_N", &FRA_Lepb_N, &b_FRA_Lepb_N); - activeTree->SetBranchAddress("Lepb_p_T", &FRA_Lepb_p_T, &b_FRA_Lepb_p_T); - activeTree->SetBranchAddress("Lepb_pdgId", &FRA_Lepb_pdgId, &b_FRA_Lepb_pdgId); - activeTree->SetBranchAddress("Lepb_phi", &FRA_Lepb_phi, &b_FRA_Lepb_phi); - activeTree->SetBranchAddress("Lepb_eta", &FRA_Lepb_eta, &b_FRA_Lepb_eta); - activeTree->SetBranchAddress("Hadb_N", &FRA_Hadb_N, &b_FRA_Hadb_N); - activeTree->SetBranchAddress("Hadb_p_T", &FRA_Hadb_p_T, &b_FRA_Hadb_p_T); - activeTree->SetBranchAddress("Hadb_pdgId", &FRA_Hadb_pdgId, &b_FRA_Hadb_pdgId); - activeTree->SetBranchAddress("Hadb_phi", &FRA_Hadb_phi, &b_FRA_Hadb_phi); - activeTree->SetBranchAddress("Hadb_eta", &FRA_Hadb_eta, &b_FRA_Hadb_eta); - activeTree->SetBranchAddress("Hadj_N", &FRA_Hadj_N, &b_FRA_Hadj_N); - activeTree->SetBranchAddress("Hadj_p_T", &FRA_Hadj_p_T, &b_FRA_Hadj_p_T); - activeTree->SetBranchAddress("Hadj_pdgId", &FRA_Hadj_pdgId, &b_FRA_Hadj_pdgId); - activeTree->SetBranchAddress("Hadj_phi", &FRA_Hadj_phi, &b_FRA_Hadj_phi); - activeTree->SetBranchAddress("Hadj_eta", &FRA_Hadj_eta, &b_FRA_Hadj_eta); - } else if (Warn>1) { std::cout << "\nntupleXML: Warning, cannot find FullRecoAna tree. "; } - - friendTree = (TFriendElement*) (activeFile->GetListOfFriends()->FindObject("TruthAna0")); - activeTree = friendTree->GetTree(); - if (activeTree) { - TRA_Active=1; - activeTree->SetBranchAddress("El_N", &TRA_El_N, &b_TRA_El_N); - activeTree->SetBranchAddress("El_p_T", &TRA_El_p_T, &b_TRA_El_p_T); - activeTree->SetBranchAddress("El_pdgId", &TRA_El_pdgId, &b_TRA_El_pdgId); - activeTree->SetBranchAddress("El_phi", &TRA_El_phi, &b_TRA_El_phi); - activeTree->SetBranchAddress("El_eta", &TRA_El_eta, &b_TRA_El_eta); - activeTree->SetBranchAddress("Mu_N", &TRA_Mu_N, &b_TRA_Mu_N); - activeTree->SetBranchAddress("Mu_p_T", &TRA_Mu_p_T, &b_TRA_Mu_p_T); - activeTree->SetBranchAddress("Mu_pdgId", &TRA_Mu_pdgId, &b_TRA_Mu_pdgId); - activeTree->SetBranchAddress("Mu_phi", &TRA_Mu_phi, &b_TRA_Mu_phi); - activeTree->SetBranchAddress("Mu_eta", &TRA_Mu_eta, &b_TRA_Mu_eta); - activeTree->SetBranchAddress("Tau_N", &TRA_Tau_N, &b_TRA_Tau_N); - activeTree->SetBranchAddress("Tau_p_T", &TRA_Tau_p_T, &b_TRA_Tau_p_T); - activeTree->SetBranchAddress("Tau_pdgId", &TRA_Tau_pdgId, &b_TRA_Tau_pdgId); - activeTree->SetBranchAddress("Tau_phi", &TRA_Tau_phi, &b_TRA_Tau_phi); - activeTree->SetBranchAddress("Tau_eta", &TRA_Tau_eta, &b_TRA_Tau_eta); - activeTree->SetBranchAddress("HadW_N", &TRA_HadW_N, &b_TRA_HadW_N); - activeTree->SetBranchAddress("HadW_p_T", &TRA_HadW_p_T, &b_TRA_HadW_p_T); - activeTree->SetBranchAddress("HadW_pdgId", &TRA_HadW_pdgId, &b_TRA_HadW_pdgId); - activeTree->SetBranchAddress("HadW_phi", &TRA_HadW_phi, &b_TRA_HadW_phi); - activeTree->SetBranchAddress("HadW_eta", &TRA_HadW_eta, &b_TRA_HadW_eta); - activeTree->SetBranchAddress("LepW_N", &TRA_LepW_N, &b_TRA_LepW_N); - activeTree->SetBranchAddress("LepW_p_T", &TRA_LepW_p_T, &b_TRA_LepW_p_T); - activeTree->SetBranchAddress("LepW_pdgId", &TRA_LepW_pdgId, &b_TRA_LepW_pdgId); - activeTree->SetBranchAddress("LepW_phi", &TRA_LepW_phi, &b_TRA_LepW_phi); - activeTree->SetBranchAddress("LepW_eta", &TRA_LepW_eta, &b_TRA_LepW_eta); - activeTree->SetBranchAddress("HadTop_N", &TRA_HadTop_N, &b_TRA_HadTop_N); - activeTree->SetBranchAddress("HadTop_p_T", &TRA_HadTop_p_T, &b_TRA_HadTop_p_T); - activeTree->SetBranchAddress("HadTop_pdgId", &TRA_HadTop_pdgId, &b_TRA_HadTop_pdgId); - activeTree->SetBranchAddress("HadTop_phi", &TRA_HadTop_phi, &b_TRA_HadTop_phi); - activeTree->SetBranchAddress("HadTop_eta", &TRA_HadTop_eta, &b_TRA_HadTop_eta); - activeTree->SetBranchAddress("LepTop_N", &TRA_LepTop_N, &b_TRA_LepTop_N); - activeTree->SetBranchAddress("LepTop_p_T", &TRA_LepTop_p_T, &b_TRA_LepTop_p_T); - activeTree->SetBranchAddress("LepTop_pdgId", &TRA_LepTop_pdgId, &b_TRA_LepTop_pdgId); - activeTree->SetBranchAddress("LepTop_phi", &TRA_LepTop_phi, &b_TRA_LepTop_phi); - activeTree->SetBranchAddress("LepTop_eta", &TRA_LepTop_eta, &b_TRA_LepTop_eta); - activeTree->SetBranchAddress("Bot_N", &TRA_Bot_N, &b_TRA_Bot_N); - activeTree->SetBranchAddress("Bot_p_T", &TRA_Bot_p_T, &b_TRA_Bot_p_T); - activeTree->SetBranchAddress("Bot_pdgId", &TRA_Bot_pdgId, &b_TRA_Bot_pdgId); - activeTree->SetBranchAddress("Bot_phi", &TRA_Bot_phi, &b_TRA_Bot_phi); - activeTree->SetBranchAddress("Bot_eta", &TRA_Bot_eta, &b_TRA_Bot_eta); - activeTree->SetBranchAddress("LQ_N", &TRA_LQ_N, &b_TRA_LQ_N); - activeTree->SetBranchAddress("LQ_p_T", &TRA_LQ_p_T, &b_TRA_LQ_p_T); - activeTree->SetBranchAddress("LQ_pdgId", &TRA_LQ_pdgId, &b_TRA_LQ_pdgId); - activeTree->SetBranchAddress("LQ_phi", &TRA_LQ_phi, &b_TRA_LQ_phi); - activeTree->SetBranchAddress("LQ_eta", &TRA_LQ_eta, &b_TRA_LQ_eta); - } else if (Warn>1) { std::cout << "\nntupleXML: Warning, cannot find TruthAna tree. "; } - - friendTree = (TFriendElement*) (activeFile->GetListOfFriends()->FindObject("TruthAll0")); - activeTree = friendTree->GetTree(); - if (activeTree) { - TA_Active=1; - activeTree->SetBranchAddress("Tru_p_T", &TA_Tru_p_T, &b_TA_Tru_p_T); - activeTree->SetBranchAddress("Tru_phi", &TA_Tru_phi, &b_TA_Tru_phi); - activeTree->SetBranchAddress("Tru_eta", &TA_Tru_eta, &b_TA_Tru_eta); - activeTree->SetBranchAddress("Tru_pdgId", &TA_Tru_pdgId, &b_TA_Tru_pdgId); - activeTree->SetBranchAddress("Tru_barcode", &TA_Tru_barcode, &b_TA_Tru_barcode); - } else if (Warn>1) { std::cout << "\nntupleXML: Warning, cannot find TruthAll tree. "; } - - //If using TopView ntuples, MET_Truth must be fetched from Truth0 - friendTree = (TFriendElement*) (activeFile->GetListOfFriends()->FindObject("Truth0")); - activeTree = friendTree->GetTree(); - if (activeTree) { - TR_Active=1; - activeTree->SetBranchAddress("MET_Truth_ex", &TR_MET_Truth_ex, &b_TR_MET_Truth_ex); - activeTree->SetBranchAddress("MET_Truth_ey", &TR_MET_Truth_ey, &b_TR_MET_Truth_ey); - activeTree->SetBranchAddress("MET_Truth_et", &TR_MET_Truth_et, &b_TR_MET_Truth_et); - } else if (Warn>1) { std::cout << "\nntupleXML: Warning, cannot find Truth tree. "; } -} - -void ntupleXML::FillBranches(Int_t entryNumber) { - if (FR_Active) { - b_FR_eventNumber->GetEntry(entryNumber); - b_FR_runNumber->GetEntry(entryNumber); - b_FR_MET_Final_ex->GetEntry(entryNumber); - b_FR_MET_Final_ey->GetEntry(entryNumber); - b_FR_MET_Final_et->GetEntry(entryNumber); - if (TR_Active) { - b_TR_MET_Truth_ex->GetEntry(entryNumber); - b_TR_MET_Truth_ey->GetEntry(entryNumber); - b_TR_MET_Truth_et->GetEntry(entryNumber); - } - b_FR_El_N->GetEntry(entryNumber); - b_FR_El_pdgId->GetEntry(entryNumber); - b_FR_El_p_T->GetEntry(entryNumber); - b_FR_El_phi->GetEntry(entryNumber); - b_FR_El_eta->GetEntry(entryNumber); - b_FR_Mu_N->GetEntry(entryNumber); - b_FR_Mu_pdgId->GetEntry(entryNumber); - b_FR_Mu_p_T->GetEntry(entryNumber); - b_FR_Mu_phi->GetEntry(entryNumber); - b_FR_Mu_eta->GetEntry(entryNumber); - b_FR_Tau_N->GetEntry(entryNumber); - b_FR_Tau_pdgId->GetEntry(entryNumber); - b_FR_Tau_p_T->GetEntry(entryNumber); - b_FR_Tau_phi->GetEntry(entryNumber); - b_FR_Tau_eta->GetEntry(entryNumber); - b_FR_Ph_N->GetEntry(entryNumber); - b_FR_Ph_pdgId->GetEntry(entryNumber); - b_FR_Ph_p_T->GetEntry(entryNumber); - b_FR_Ph_phi->GetEntry(entryNumber); - b_FR_Ph_eta->GetEntry(entryNumber); - b_FR_PJet_N->GetEntry(entryNumber); - b_FR_PJet_pdgId->GetEntry(entryNumber); - b_FR_PJet_p_T->GetEntry(entryNumber); - b_FR_PJet_phi->GetEntry(entryNumber); - b_FR_PJet_eta->GetEntry(entryNumber); - } - - if (!isTopView) { return; } - - if (FR_Active) { b_FR_PJet_BTagged->GetEntry(entryNumber); } - - if (FRA_Active) { - b_FRA_El_N->GetEntry(entryNumber); - b_FRA_El_pdgId->GetEntry(entryNumber); - b_FRA_El_p_T->GetEntry(entryNumber); - b_FRA_El_phi->GetEntry(entryNumber); - b_FRA_El_eta->GetEntry(entryNumber); - b_FRA_Mu_N->GetEntry(entryNumber); - b_FRA_Mu_pdgId->GetEntry(entryNumber); - b_FRA_Mu_p_T->GetEntry(entryNumber); - b_FRA_Mu_phi->GetEntry(entryNumber); - b_FRA_Mu_eta->GetEntry(entryNumber); - b_FRA_Nu_N->GetEntry(entryNumber); - b_FRA_Nu_pdgId->GetEntry(entryNumber); - b_FRA_Nu_p_T->GetEntry(entryNumber); - b_FRA_Nu_phi->GetEntry(entryNumber); - b_FRA_Nu_eta->GetEntry(entryNumber); - b_FRA_HadW_N->GetEntry(entryNumber); - b_FRA_HadW_pdgId->GetEntry(entryNumber); - b_FRA_HadW_p_T->GetEntry(entryNumber); - b_FRA_HadW_phi->GetEntry(entryNumber); - b_FRA_HadW_eta->GetEntry(entryNumber); - b_FRA_LepW_N->GetEntry(entryNumber); - b_FRA_LepW_pdgId->GetEntry(entryNumber); - b_FRA_LepW_p_T->GetEntry(entryNumber); - b_FRA_LepW_phi->GetEntry(entryNumber); - b_FRA_LepW_eta->GetEntry(entryNumber); - b_FRA_HadTop_N->GetEntry(entryNumber); - b_FRA_HadTop_pdgId->GetEntry(entryNumber); - b_FRA_HadTop_p_T->GetEntry(entryNumber); - b_FRA_HadTop_phi->GetEntry(entryNumber); - b_FRA_HadTop_eta->GetEntry(entryNumber); - b_FRA_LepTop_N->GetEntry(entryNumber); - b_FRA_LepTop_pdgId->GetEntry(entryNumber); - b_FRA_LepTop_p_T->GetEntry(entryNumber); - b_FRA_LepTop_phi->GetEntry(entryNumber); - b_FRA_LepTop_eta->GetEntry(entryNumber); - b_FRA_Lepb_N->GetEntry(entryNumber); - b_FRA_Lepb_pdgId->GetEntry(entryNumber); - b_FRA_Lepb_p_T->GetEntry(entryNumber); - b_FRA_Lepb_phi->GetEntry(entryNumber); - b_FRA_Lepb_eta->GetEntry(entryNumber); - b_FRA_Hadb_N->GetEntry(entryNumber); - b_FRA_Hadb_pdgId->GetEntry(entryNumber); - b_FRA_Hadb_p_T->GetEntry(entryNumber); - b_FRA_Hadb_phi->GetEntry(entryNumber); - b_FRA_Hadb_eta->GetEntry(entryNumber); - b_FRA_Hadj_N->GetEntry(entryNumber); - b_FRA_Hadj_pdgId->GetEntry(entryNumber); - b_FRA_Hadj_p_T->GetEntry(entryNumber); - b_FRA_Hadj_phi->GetEntry(entryNumber); - b_FRA_Hadj_eta->GetEntry(entryNumber); - } - if (TRA_Active) { - b_TRA_El_N->GetEntry(entryNumber); - b_TRA_El_pdgId->GetEntry(entryNumber); - b_TRA_El_p_T->GetEntry(entryNumber); - b_TRA_El_phi->GetEntry(entryNumber); - b_TRA_El_eta->GetEntry(entryNumber); - b_TRA_Mu_N->GetEntry(entryNumber); - b_TRA_Mu_pdgId->GetEntry(entryNumber); - b_TRA_Mu_p_T->GetEntry(entryNumber); - b_TRA_Mu_phi->GetEntry(entryNumber); - b_TRA_Mu_eta->GetEntry(entryNumber); - b_TRA_Tau_N->GetEntry(entryNumber); - b_TRA_Tau_pdgId->GetEntry(entryNumber); - b_TRA_Tau_p_T->GetEntry(entryNumber); - b_TRA_Tau_phi->GetEntry(entryNumber); - b_TRA_Tau_eta->GetEntry(entryNumber); - b_TRA_HadW_N->GetEntry(entryNumber); - b_TRA_HadW_pdgId->GetEntry(entryNumber); - b_TRA_HadW_p_T->GetEntry(entryNumber); - b_TRA_HadW_phi->GetEntry(entryNumber); - b_TRA_HadW_eta->GetEntry(entryNumber); - b_TRA_LepW_N->GetEntry(entryNumber); - b_TRA_LepW_pdgId->GetEntry(entryNumber); - b_TRA_LepW_p_T->GetEntry(entryNumber); - b_TRA_LepW_phi->GetEntry(entryNumber); - b_TRA_LepW_eta->GetEntry(entryNumber); - b_TRA_HadTop_N->GetEntry(entryNumber); - b_TRA_HadTop_pdgId->GetEntry(entryNumber); - b_TRA_HadTop_p_T->GetEntry(entryNumber); - b_TRA_HadTop_phi->GetEntry(entryNumber); - b_TRA_HadTop_eta->GetEntry(entryNumber); - b_TRA_LepTop_N->GetEntry(entryNumber); - b_TRA_LepTop_pdgId->GetEntry(entryNumber); - b_TRA_LepTop_p_T->GetEntry(entryNumber); - b_TRA_LepTop_phi->GetEntry(entryNumber); - b_TRA_LepTop_eta->GetEntry(entryNumber); - b_TRA_Bot_N->GetEntry(entryNumber); - b_TRA_Bot_pdgId->GetEntry(entryNumber); - b_TRA_Bot_p_T->GetEntry(entryNumber); - b_TRA_Bot_phi->GetEntry(entryNumber); - b_TRA_Bot_eta->GetEntry(entryNumber); - b_TRA_LQ_N->GetEntry(entryNumber); - b_TRA_LQ_pdgId->GetEntry(entryNumber); - b_TRA_LQ_p_T->GetEntry(entryNumber); - b_TRA_LQ_phi->GetEntry(entryNumber); - b_TRA_LQ_eta->GetEntry(entryNumber); - } - if (TA_Active) { - b_TA_Tru_p_T->GetEntry(entryNumber); - b_TA_Tru_phi->GetEntry(entryNumber); - b_TA_Tru_eta->GetEntry(entryNumber); - b_TA_Tru_pdgId->GetEntry(entryNumber); - b_TA_Tru_barcode->GetEntry(entryNumber); - } -} - -void ntupleXML::SetActiveFile(Int_t fileNumber) { - if (activeFile != fileStore[fileNumber]) { - activeFile = fileStore[fileNumber]; - if (Warn>1) { std::cout << "\nntupleXML: Setting New Active Tree. "; } - //Associates branches with their variables - ntupleXML::SetBranches(); - } -} - -template<typename TYPE> -std::string ntupleXML::asString(const TYPE& x) { - std::ostringstream o; - o << std::setiosflags(ios::fixed); - if (!(o << x)) { - if (Warn>0) { std::cout << "\nntupleXML: Error in toString Conversion Function. "; } - return "ERROR"; - } - return o.str(); -} - diff --git a/graphics/AtlantisJava/share/specificconfig.jnlp b/graphics/AtlantisJava/share/specificconfig.jnlp deleted file mode 100644 index 46f896703eedf76ed13f010518defebe4945c995..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/share/specificconfig.jnlp +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Template JNLP webstart file for Atlantis event display for ATLAS - with specific configuration file. --> -<jnlp - spec="1.0+" - codebase="@CODEBASE@" - href="@HREF@"> - <information> - <title>Atlantis event display for ATLAS</title> - <vendor>Atlantis team</vendor> - <homepage href=""/> <!-- should be used from codebase --> - <description>Atlantis event display for ATLAS</description> - <!-- <icon href="files/goofy_favicon.ico"/> - <icon kind="splash" href="files/logo.gif"/> --> - <offline-allowed/> - <shortcut online="false"> - <desktop/> - <menu submenu="Atlantis event display"/> - </shortcut> - </information> - <security> - <all-permissions/> - </security> - <resources> - <j2se version="1.6+" max-heap-size="512m"/> - - <jar href="lib/commons-cli-1.0.jar"/> - <jar href="lib/Jama.jar"/> - <jar href="lib/jas-aida-dev.jar"/> - <jar href="lib/jas-aida.jar"/> - <jar href="lib/jas-freehep-base.jar"/> - <jar href="lib/jas-freehep-hep.jar"/> - <jar href="lib/jas-jas-plotter.jar"/> - <jar href="lib/jas-jel.jar"/> - <jar href="lib/jas-JMinuit.jar"/> - <jar href="lib/jogl.jar"/> - <jar href="lib/jh.jar"/> - <jar href="lib/oncrpc.jar"/> - <jar href="lib/log4j-1.2.15.jar"/> - <jar href="lib/ostermillerutils_1_05_00.jar"/> - <jar href="lib/wired-base-4.0.beta.3-SNAPSHOT.jar"/> - <jar href="lib/ws-commons-util-1.0.2.jar"/> - <jar href="lib/xercesImpl.jar"/> - <jar href="lib/xml-apis.jar"/> - <jar href="lib/xmlrpc-client-3.1.jar"/> - <jar href="lib/xmlrpc-common-3.1.jar"/> - <jar href="lib/jlibeps.jar"/> - <jar href="lib/xmlrpc-server-3.1.jar"/> - <jar href="lib/commons-logging-1.1.jar"/> - <jar href="lib/commons-codec-1.4.jar"/> - <jar href="lib/xml-apis-ext.jar"/> - <jar href="lib/batik-dom.jar"/> - <jar href="lib/batik-anim.jar"/> - <jar href="lib/batik-svggen.jar"/> - <jar href="lib/batik-css.jar"/> - <jar href="lib/batik-bridge.jar"/> - <jar href="lib/batik-parser.jar"/> - <jar href="lib/batik-xml.jar"/> - <jar href="lib/batik-gui-util.jar"/> - <jar href="lib/batik-script.jar"/> - <jar href="lib/batik-transcoder.jar"/> - <jar href="lib/batik-svg-dom.jar"/> - <jar href="lib/batik-extension.jar"/> - <jar href="lib/batik-codec.jar"/> - <jar href="lib/batik-util.jar"/> - <jar href="lib/batik-swing.jar"/> - <jar href="lib/batik-ext.jar"/> - <jar href="lib/batik-gvt.jar"/> - <jar href="lib/batik-awt-util.jar"/> - <jar href="help/help.jar"/> - - <jar href="atlantis.jar" main="true"/> <!-- look for main class here --> - </resources> - - <application-desc main-class="atlantis.Atlantis"> - <argument>--config</argument> - <argument>configuration/@CONFIG@</argument> - <argument>--debug</argument> - <argument>DEBUG</argument> - </application-desc> - -</jnlp> - diff --git a/graphics/AtlantisJava/src/atlantis/ACommandLine.java b/graphics/AtlantisJava/src/atlantis/ACommandLine.java deleted file mode 100644 index 3c87dcf910629763dc4915c2b03cefc53a71339e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/ACommandLine.java +++ /dev/null @@ -1,399 +0,0 @@ -package atlantis; - -import atlantis.event.AEpsImageProducer; -import atlantis.event.AImageProducer; -import atlantis.event.AEventSource; -import atlantis.event.APngImageProducer; -import atlantis.event.ASvgImageProducer; -import atlantis.globals.AGlobals; -import atlantis.gui.AGUI; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; -import java.awt.Dimension; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.GnuParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.OptionBuilder; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.ParseException; - -/** - * This package-private class holds all the command line options - * as well as providing verification - * @author Sebastian Boeser - */ -class ACommandLine { - - //A help formatter - private final HelpFormatter formatter = new HelpFormatter(); - - private AGlobals globals = AGlobals.instance(); - - //The set of command-line options - private final Options options = new Options(); - - //The usage line - private static final String usage = "Atlantis [OPTIONS] [[-s]SOURCE]"; - - //The help message header and footer - private final String headerMsg; - private final String footerMsg; - - - /** - * Create all the options in the constructor. Options are sorted alphabetically in here. - */ - ACommandLine(){ - - //show HLTAutokey tracks - options.addOption(new Option("a", false, "show HLTAutoKey tracks")); - - //configuration file - options.addOption(OptionBuilder.withArgName("file") - .hasArg() - .withDescription("read configuration from specified file") - .withLongOpt("config") - .create("c") - ); - - - //debug - String debugDescr = "log messages of level to " + - "'stdout', optionally to file destination. " + - "Message levels are "+ ALogger.getStringLevels() + " (INFO is default)"; - options.addOption(OptionBuilder - .hasArg() - .hasOptionalArg() - .withArgName("level [destination]") - .withDescription(debugDescr) - .withLongOpt("debug") - .create('d') - ); - - - //help/usage - options.addOption(new Option("h", "help", false, "display this help message")); - - //demo mode - options.addOption(OptionBuilder.withArgName("projections") - .hasOptionalArg() - .withDescription("colon seperated list of projections for the demo mode (e.g \"-j YX:VP\"). " - + "Available projections/actions are YX, " - + "VP(" + AMath.PHI + AMath.ETA + "), " - + "RZ(" + AMath.RHO + "Z), " - + "FR(" + AMath.PHI + AMath.RHO + "), " - + "FZ(" + AMath.PHI + "Z), " - + "XZ(X'Z), " - + "YZ(Y'Z), " - + "LegoPlot, " - + "NE(next event)") - .withLongOpt("projection") - .create("j") - ); - - //loop mode - String loopDescr = "Set event navigation mode, supported values are " - +AEventSource.NavigationMode.LOOP.toString()+", " - +AEventSource.NavigationMode.RANDOM.toString()+", " - +AEventSource.NavigationMode.SEQUENTIAL.toString(); - options.addOption(OptionBuilder.withArgName("mode") - .hasArg() - .withDescription(loopDescr) - .withLongOpt("loop") - .create("l") - ); - - //color map - options.addOption(OptionBuilder.withArgName("file") - .hasArg() - .withDescription("read colourmap from specified file") - .withLongOpt("colormap") - .create("m") - ); - - // output image files - String outputDescr = "Output event image " + - "into directory dir (default: current directory) "+ - "of dimensions width x height (default: 800x828). "+ - "If height is not specified the aspect ratio of the canvas is used. " + - "If scale is given, images will be scaled by that factor (use for thumbnails). "+ - "If a filename is given, that file will be overwritten, "+ - "otherwise a new file will be created for each event. "+ - "The output format may be specified as PNG (the default) or EPS using" + - "the --outputformat option."; - options.addOption(OptionBuilder.hasOptionalArgs(4) - .withArgName("[dir] [width[xheight]] [scale] [filename]") - .withDescription(outputDescr) - .withLongOpt("output") - .create('o') - ); - - String outputFormatDescr = "output format for -o option (eps or png, default is png)"; - options.addOption(OptionBuilder.hasArg() - .withArgName("format") - .withDescription(outputFormatDescr) - .withLongOpt("outputformat") - .create('f') - ); - - //event loop intervall - options.addOption(OptionBuilder.withArgName("seconds") - .hasArg() - .withDescription("pause inbetween events and/or projections options") - .withLongOpt("pause") - .create("p") - ); - - //default source - String sourceDescr = "Set initial event source, e.g\n"+ - "* [file://]<filename>\n"+ - "* http://<url>\n"+ - "* xmlrpc://<server>:<port>\n"+ - "* oncrpc://<server>[:port][:stream]"; - options.addOption(OptionBuilder.withArgName("source") - .hasArg() - .withDescription(sourceDescr) - .withLongOpt("source") - .create("s") - ); - - //update config - options.addOption(new Option("x", "updateconfig", false, "update user's configuration file")); - - //max GUI width - options.addOption(OptionBuilder.withArgName("maxwidth") - .hasArg() - .withDescription("maximum screen width used by Atlantis") - .withLongOpt("maxwidth") - .create("w") - ); - - - //image server - options.addOption(OptionBuilder.hasArgs(1) - .withArgName("port") - .withDescription("Run a server on port <port> which accepts " + - "event data from a client and returns images") - .withLongOpt("imgserver") - .create('I') - ); - - - /** - * Now create header and footer Messages - */ - headerMsg = "\nMandatory arguments to long options are " + - "mandatory for short options too.\n"; - footerMsg = "\nAtlFast objects were supported up to " + - "AtlantisJava-09-05-28 via \"Fast\" option.\n" + - "Beginner simplified GUI was supported up to " + - "AtlantisJava-09-05-28 via \"Beginner\" option.\n" + - "CTB 2004 geometry was supported up to " + - "AtlantisJava-09-07-42 via -t, --testbeam option.\n"; - - } - - /** - * Parse and validate the command line options - */ - void process(String[] args){ - - //Create GNU style parse - CommandLineParser parser = new GnuParser(); - - //Now try parsing the options - try { - - //invoke GNU parser - CommandLine cmdLine = parser.parse(options, args); - - /** - * Now validate and process all options - */ - - //auto-keys - if(cmdLine.hasOption('a')) globals.setHLTAutoKeys(true); - - //config - if(cmdLine.hasOption('c')){ - Atlantis.configCommandLine = cmdLine.getOptionValue('c', null); - } - - //debug - if(cmdLine.hasOption('d')){ - //Get option values - String[] vals = cmdLine.getOptionValues('d'); - //this arg will always be there - String level = vals[0]; - if (! ALogger.getStringLevels().contains(level)) - throw new ParseException("Invalid logging level "+level); - //Check if there was also another argument - String destination = null; - if(vals.length == 2) destination = vals[1]; - - //Finally initialize the logger - ALogger.initialize(level,destination); - } - - //help - if(cmdLine.hasOption('h')) { - formatter.printHelp(usage, headerMsg, options, footerMsg); - System.exit(0); - } - - //image server - if(cmdLine.hasOption('I')){ - Atlantis.imageServerPort = Integer.parseInt(cmdLine.getOptionValue('I')); - if (Atlantis.imageServerPort < 0) - throw new ParseException("Port number "+cmdLine.getOptionValue('I')+ - " is not valid for -I option"); - //Check for other mutual exclusive options - if (cmdLine.hasOption('j') || cmdLine.hasOption('p')) - throw new ParseException("Can not use option -I with -j or -p options"); - } - - //demo mode projections - if(cmdLine.hasOption('j')){ - //NOTE: default is not null but "", so we can distinguish inbetween - //this flag being set or not w/o introducing more parameters - Atlantis.selectedProjections = cmdLine.getOptionValue('j', ""); - } - - //navigation mode - if(cmdLine.hasOption('l')){ - //Get arguments - String loopMode = cmdLine.getOptionValue('l',null); - if (loopMode == null) - throw new ParseException("Option -l needs an argument"); - Atlantis.initialMode = AEventSource.NavigationMode.valueOf(loopMode); - } - - - //color map - if(cmdLine.hasOption('m')){ - // retrieve the argument for options or assign default value - Atlantis.colormapCommandLine = cmdLine.getOptionValue('m', null); - } - - // generate PNG/EPS output files - if(cmdLine.hasOption('o')) - { - String format = "PNG"; - if (cmdLine.hasOption('f')) { - String formatVal = cmdLine.getOptionValue('f'); - format = formatVal.toUpperCase(); - if (!("EPS".equals(format)||"PNG".equals(format))) { - throw new ParseException("Invalid output format "+formatVal); - } - } - String[] vals = cmdLine.getOptionValues('o'); - this.processImageOutputOptions(vals,format); - } - - // generate PNG output files - if(cmdLine.hasOption('e')) - { - String[] vals = cmdLine.getOptionValues('e'); - this.processImageOutputOptions(vals,"EPS"); - } - - //source - if (cmdLine.hasOption('s')){ - //Simply set this as default event source - Atlantis.initialEventSource = cmdLine.getOptionValue('s'); - } - - //pause - if (cmdLine.hasOption('p')){ - //Check for integer value - String val = cmdLine.getOptionValue('p', null); - try { - Atlantis.loopInterval = Integer.parseInt(val); - } catch (NumberFormatException nfe) { - throw new ParseException("Invalid seconds value "+val+" for -p option"); - } - } - - //GUI width - if(cmdLine.hasOption('w')){ - String val = cmdLine.getOptionValue('w', null); - try { - int maxWidth = Integer.parseInt(val); - AGUI.getGUI().setMaxWidth(maxWidth); - } catch (NumberFormatException e) { - throw new ParseException("Invalid width value "+val+" for -w option"); - } - } - - //update config - if(cmdLine.hasOption('x')) Atlantis.updateConfig = true; - - //finally check for positional options (i.e w/o --opt) - String[] unspecifiedOpts=cmdLine.getArgs(); - if (unspecifiedOpts.length > 0){ - //We accept only one, which is a single string for the event source - if ((unspecifiedOpts.length != 1) - || cmdLine.hasOption('s') - || cmdLine.hasOption('I')){ - throw new ParseException("Can only specify one event source"); - } - Atlantis.initialEventSource = unspecifiedOpts[0]; - } - - } catch(ParseException ex) { - //Every error above should have thrown a parse exception - //Show help message and exit - System.err.println("\n" + ex.getMessage() + "\n"); - formatter.printHelp(usage, headerMsg, options, footerMsg); - System.exit(1); - } - - } - - private void processImageOutputOptions(String[] vals, String fileFormat) throws ParseException { - try - { - //vals[0] - directory to store events and png into - //Use current directory as default - String dir=System.getProperty("user.dir"); - if ((vals!=null)&&(vals.length > 0)) dir = vals[0]; - // vals[1] - WidthxHeight string - Dimension dim=new Dimension(800,828); - if ((vals!=null)&&(vals.length > 1)){ - short width = Short.parseShort(vals[1].split("x")[0]); - short height =-1; - if (vals[1].split("x").length > 1) - height = Short.parseShort(vals[1].split("x")[1]); - dim = new Dimension(width,height); - } - // vals[2] - scale factor, default is one - double scale = 1; - if ((vals!=null)&&(vals.length > 2)) scale = Double.parseDouble(vals[2]); - // vals[3] - fixed filename, default is null - String fixedFile = null; - if ((vals!=null)&&(vals.length > 3)) fixedFile = vals[3]; - //Now create a new image generator - if ("EPS".equals(fileFormat)) { - Atlantis.imageProducer = new AEpsImageProducer(dir,dim,scale,fixedFile); - } - else if ("PNG".equals(fileFormat)) { - Atlantis.imageProducer = new APngImageProducer(dir,dim,scale,fixedFile); - } - else if ("SVG".equals(fileFormat)) { - Atlantis.imageProducer = new ASvgImageProducer(dir,dim,scale,fixedFile); - } - else { - throw new Error("Invalid file format for output: "+fileFormat); - } - } catch (NumberFormatException nfe){ - throw new ParseException("Invalid parameters to option -o"); - } catch (IndexOutOfBoundsException iob){ - throw new ParseException("Invalid dimension parameter to option -o"); - } catch (AImageProducer.InstantiationException iex){ - throw new ParseException("Invalid configuration for option -o: "+iex.getMessage()); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/AOpenGLTools.java b/graphics/AtlantisJava/src/atlantis/AOpenGLTools.java deleted file mode 100644 index 02cbf863cc997c6425eceea6d89f7b19151f4ebd..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/AOpenGLTools.java +++ /dev/null @@ -1,22 +0,0 @@ -package atlantis; - -import javax.media.opengl.GLCanvas; -import javax.media.opengl.GLCapabilities; - -/** - * Provides utility method to check if OpenGL is available. - * @author Adam - */ -public class AOpenGLTools { - - public static boolean isOpenGLAvailable() { - try { - GLCapabilities cap = new GLCapabilities(); - GLCanvas canv = new GLCanvas(cap); - } catch (Error e) { - // Expect some kind of hard exception if the class can't be loaded - return false; - } - return true; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/Atlantis.java b/graphics/AtlantisJava/src/atlantis/Atlantis.java deleted file mode 100644 index e54be406c3aa9f2bc4c629ff9db544b39ea18beb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/Atlantis.java +++ /dev/null @@ -1,770 +0,0 @@ -package atlantis; - -import java.awt.Toolkit; -import java.io.File; -import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; - -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Node; -import org.w3c.dom.Document; - -import atlantis.canvas.ACanvas; -import atlantis.config.ADefaultValues; -import atlantis.config.AConfigUpdater; -import atlantis.event.AEventManager; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; - -import atlantis.geometry.AAtlasDetector; -import atlantis.geometry.ADetectorSystem; -import atlantis.globals.AGlobals; -import atlantis.graphics.colormap.AColorMap; -import atlantis.gui.ADemoDialog; -import atlantis.gui.AEventQueue; -import atlantis.gui.AGUI; -import atlantis.gui.AStartupWindow; -import atlantis.gui.AEventLoopDialog; -import atlantis.output.AExceptionHandler; -import atlantis.parameters.APar; -import atlantis.projection.AProjectionsManager; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AUtilities; -import atlantis.utils.xml.AXMLErrorHandler; -import atlantis.utils.xml.AXMLEntityResolver; -import atlantis.utils.xml.AXMLUtils; -import atlantis.event.AImageProducer; -import atlantis.event.AEventSource; -import atlantis.utils.ALogger; -import atlantis.event.xmlrpc.AServerXMLRPC; -import atlantis.event.xmlrpc.AServerXMLRPCEventSource; -import atlantis.gui.ACrashReporter; -import atlantis.gui.ADemoLoop; -import atlantis.interactions.AInteractionsConfigReader; -import atlantis.utils.ANewIdHelper; -import atlantis.utils.xml.AXMLEntityResolver; - -import java.util.Arrays; -import java.util.Vector; -import javax.swing.JOptionPane; - - -/** - * Main class of Atlantis application. - * Initialises the application's main components and provides access to them. - */ -public class Atlantis -{ - // The main class logger gets initialized after command line options - // are processed. All other classes will just do - // logger = ALogger.getLogger(Class.class) in their attribute definitions - private static ALogger logger = null; - - /** Store for Atlantis global state. */ - private static AGlobals globals = AGlobals.instance(); - - // expands into SVN tag - private static String versionAtlantisJava = "$HeadURL: file:///atlas/scratch0/graemes/ao-mirror/graphics/AtlantisJava/tags/AtlantisJava-09-16-05-18/src/atlantis/Atlantis.java $"; - - private static final String FILE_SEPAR = System.getProperty("file.separator"); - private static final String USER_HOME_DIR = System.getProperty("user.home"); - - // This is the URL that is used as default for "Read events from URL" - // The stream is set to "Default" as this is the only one guaranteed to be there. - private static final String LIVE_POINT_1_EVENTS_URL = - "http://atlas-live.cern.ch/event_files/Default"; - - // expected file name of the user customised configuration file - // (stored in the user's home directory) - private static final String USER_CONFIG_FILE_PATH = - USER_HOME_DIR + FILE_SEPAR + ".Atlantis-config.xml"; - - // configuration file from the Atlantis distribution (default config) - private static final String DISTRIB_DEFAULT_CONFIG_FILE = - "configuration" + FILE_SEPAR + "config.xml"; - - // this is checksum file of the distribution's main configuration file - // if it doesn't match, Atlantis tries to update user's configuration - // or the --config <configfile> configuration - // it is an indicator that the master config.xml changed - private static final String CONFIG_CHECKSUM_FILE_PATH = - USER_HOME_DIR + FILE_SEPAR + ".Atlantis-config.chk"; - - // limit the total width of Atlantis to this number of pixels (0 = screen width) - private static int MAX_WIDTH = 0; - - /** - * The list of parameters that can be set from the command line - */ - // force Atlantis to update the personal configuration file - protected static boolean updateConfig = false; - // configuration file specified as command line argument - protected static String configCommandLine = null; - // colormap file specified as command line argument - protected static String colormapCommandLine = null; - // selected projections specified as command line argument for demo mode - protected static String selectedProjections = null; - // timer delay from command line for reading events in a loop - protected static Integer loopInterval = null; - // navigation mode from command line - protected static AEventSource.NavigationMode initialMode = null; - // initial event source, may be specified from command line - protected static String initialEventSource = "events"+FILE_SEPAR+"test_events.zip"; - // Object for saving event images in a directory - protected static AImageProducer imageProducer = null; - // Port number for image server from command line - protected static int imageServerPort = -1; - - private static final boolean atlantisWithOpenGL = false; - - private static final String INIT_ERROR_MSG = - "Error during Atlantis initialization.\n" + - "(configuration file related issues might be\n" + - "corrected by running with -x (updating customised configuration)).\n" + - "See console output for more information."; - - // main Atlantis components - private static APar parameterStore = null; - private static AEventManager eventManager = null; - private static ADetectorSystem detector = null; - private static ACanvas canvas = null; - private static AGUI gui = null; - - /** - * Returns the delay for timer for automatic event reading from server - * when this option was specified as command line argument - * @return the delay in seconds - */ - private static Integer getLoopInterval() - { - return loopInterval; - } - - - /** - * Set the default java look and feel ("metal") - */ - private static void setLookAndFeel() - { - try { - UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); - } catch(Exception e) { - AExceptionHandler.processException("Error setting default Look and Feel", e); - } - } - - - /** - * Check if the checksum file CONFIG_CHECKSUM_FILE_PATH is up-to-date. - * Create one if it does not exist or update it if it is not up-to-date. - */ - private static void checkAndUpdateConfigCheckSumFile(String distribFile) - throws AAtlantisException - { - if(Atlantis.updateConfig) - { - logger.info("Checksum not checked, run with -x, configuration update " + - "forced anyway."); - return; - } - - logger.info("Checking if the used configuration is up-to-date ..."); - - logger.debug("Checking checksum of the configuration file from the " + - "Atlantis distribution: " + distribFile); - logger.debug("Checksum file: " + CONFIG_CHECKSUM_FILE_PATH); - - boolean checkSumExists = new File(CONFIG_CHECKSUM_FILE_PATH).exists(); - - if(checkSumExists) - { - boolean comparison = AConfigUpdater.compareChecksums(distribFile, - CONFIG_CHECKSUM_FILE_PATH); - if(comparison) - { - logger.debug("Checksum file - checksum match, no update necessary."); - Atlantis.updateConfig = false; - return; - } - } - - // doesn't match, force update of custom configuration - // and re-generate checksum - AConfigUpdater.createChecksumFile(distribFile, CONFIG_CHECKSUM_FILE_PATH); - logger.debug("Checksum didn't match, updating customised " + - "configuration forced."); - Atlantis.updateConfig = true; - - } // checkAndUpdateConfigCheckSumFile() --------------------------------- - - - - /** - * Returns InputStream to read XML application configuration from. - * - * Evaluates sources from which Atlantis XML configuration is - * possibly loaded from (prioritised): - * 1) -c, --config <configfile.xml> specified on the command line - * here available in configCommandLine variable - * 2) if USER_CONFIG_FILE_PATH exists, read that one - * 3) or eventually read <ATLANTIS_DIRECTORY>/DISTRIB_DEFAULT_CONFIG_FILE - * - * User's customised (in the home directory) or --config <configfile> are - * also tried to be updated when the checksum configuration file doesn't - * match. Atlantis calculates checksum of the main distribution - * configuration file and stores that checksum in CONFIG_CHECKSUM_FILE_PATH. - * If this checksum doesn't match when Atlantis is run on the user's - * home directory configuration or --config <configfile> configuration, - * automatic configuration file update process is executed. - * - * Updating means that config.xml (main, base) contains some changes - * which are not consistent with the user's config or custom config - * and they need to be propagated there. - * Update process: - * AConfigUpdater.updateConfigurationFile(distribFilePath, configToUse) - * is then executed. - * - * Do not try to update custom configuration which is located in the same - * directory as the base config file - it means that such custom config - * comes with AtlantisJava distribution - no need updating this one. - */ - private static InputStream getXMLConfigAsStream() throws Exception - { - String configToUse = null; - - logger.info("Reading the XML configuration ..."); - - // configuration file from the Atlantis distribution - String distribFilePath = getHomeDirectory() + DISTRIB_DEFAULT_CONFIG_FILE; - - // distribution config file checksum only taken into account when having - // --config command line argument or when running from user's (home - // directory) configuration - - // option / source 1) - command line argument - highest priority - if(configCommandLine != null) - { - logger.info("Using configuration file specified on the command " + - "line: " + configCommandLine); - // sets Atlantis.updateConfig = true; accordingly - checkAndUpdateConfigCheckSumFile(distribFilePath); - configToUse = configCommandLine; - } - else - { - // check if we can read the user configuration file (in home dir.) - // option / source 2) - if(new File(USER_CONFIG_FILE_PATH).exists()) - { - logger.info("Using user's configuration file: " + - USER_CONFIG_FILE_PATH); - // sets Atlantis.updateConfig = true; accordingly - checkAndUpdateConfigCheckSumFile(distribFilePath); - configToUse = USER_CONFIG_FILE_PATH; - } - else - { - // // option / source 3) - logger.info("Using distribution configuration file: " + - distribFilePath); - if(Atlantis.updateConfig) - { - logger.warn("Update custom configuration flag is set, " + - "that doesn't make sence - no custom config " + - "file available, ignored."); - Atlantis.updateConfig = false; - } - configToUse = distribFilePath; - } - } - - - try - { - // try to update custom configuration before loading it - if(Atlantis.updateConfig) - { - logger.info("Updating customised configuration file ..."); - // check if configToUse comes from atlantis home directory, if - // so, then configToUse is from AtlantisJava distribution, should - // already be up-to-date and no automatic update will be performed - String atlantisHome = Atlantis.getHomeDirectory(); - String customConfigDir = new File(configToUse).getAbsolutePath(); - - logger.info("Updating configuration - customised config directory: " + - customConfigDir); - // if configToUse comes from AtlantisJava distribution, customConfigDir - // path start with atlantisHome path plus 'configuration' directory - // (does not filter off webstart since .getHomeDirectory() - // returns user's home directory when running via webstart, - // the condition below should be improved to cover webstart situation - // as well ...) - if(customConfigDir.startsWith(atlantisHome)) - { - logger.debug("Updating configuration - Atlantis home: " + atlantisHome); - logger.info("Updating configuration - customised config directory " + - "is in the Atlantis home, no need updating it."); - } - else - { - AConfigUpdater.updateConfigurationFile(distribFilePath, - configToUse); - } - } - } - catch(AAtlantisException aae) - { - logger.error(aae.getMessage()); - } - - - InputStream isConfig = null; // configuration file input stream - try - { - isConfig = AUtilities.getFileAsStream(configToUse); - } - catch(AAtlantisException aae) - { - String m = "Could not read " + configToUse + " reason: " + - aae.getMessage(); - throw new Exception(m); - } - - logger.info("Going to parse XML configuration: " + configToUse); - return isConfig; - - } // getXMLConfigAsStream() --------------------------------------------- - - - - private static void initAtlantis() { - - String homeDirectory = Atlantis.getHomeDirectory(); - globals.setHomeDirectory(homeDirectory); - - //Create startup window and set how often - //the progress bar will get update below - AStartupWindow startupWin = new AStartupWindow(9); - - try { - System.setProperty("sun.awt.exception.handler", - "AExceptionHandler"); - - startupWin.updateText("Atlantis initialisation"); - - //Show atlantis home - logger.info("Atlantis home: "+homeDirectory); - - //Create an event manager - eventManager = AEventManager.instance(); - - // reading Atlantis runtime configuration (text file in the home directory) - logger.info("Reading Atlantis runtime configuration, file: " + - ADefaultValues.CONFIGFILE); - ADefaultValues.readRuntimeValues(); - - - // read the configuration xml files ------------------------- - startupWin.updateText("Reading Atlantis configuration"); - - // evaluate configuration sources options and get the configuration - InputStream isConfig = getXMLConfigAsStream(); - - // prepare XML parser for parsing the XML configuration - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setValidating(true); - DocumentBuilder parser = factory.newDocumentBuilder(); - parser.setErrorHandler(new AXMLErrorHandler()); - parser.setEntityResolver(new AXMLEntityResolver()); - - // parse the XML configuration - String configBase = homeDirectory + FILE_SEPAR + "configuration" + FILE_SEPAR; - Document xmlConfigDoc = parser.parse(isConfig, configBase); - Node rootNode = xmlConfigDoc.getDocumentElement(); - // read the XML initialization node, and performs initialization - Node initializationNode = AXMLUtils.getChild(rootNode, "Initialization"); - - // parse the ID dictionary - String geometryBase = homeDirectory + FILE_SEPAR + "geometry" + FILE_SEPAR; - InputStream isIdDict = AUtilities.getFileAsStream(geometryBase+"ATLAS_IDS.xml"); - Document xmlDictDoc = parser.parse(isIdDict, geometryBase); - ANewIdHelper.construct(xmlDictDoc.getDocumentElement()); - - - // read colour map (colormap.xml) configuration ----------------- - startupWin.updateText( "Reading colour map"); - AColorMap.readColorMap(Atlantis.colormapCommandLine); - - - // creating canvas ---------------------------------------------- - startupWin.updateText("Building canvas and projections"); - Node canvasNode = AXMLUtils.getChild(initializationNode, "Canvas"); - canvas = ACanvas.construct(canvasNode); - - // reading parameters ------------------------------------------ - logger.info("Building parameters"); - parameterStore = APar.construct(AXMLUtils.getChild(rootNode, "Parameters")); - parameterStore.update(AXMLUtils.getChild(rootNode, "ParameterDifferences")); - eventManager.addNewEventListener(parameterStore); - // creating the Projections Manager (reading the projections) - Node interactionsNode = - AXMLUtils.getChild(initializationNode, "Interactions"); - AInteractionsConfigReader.readInteractions(interactionsNode); - AProjectionsManager.initialise(); - - //set the output flag: 0 normal 1 eta/phi/pt 2 px/py/pz 3 eta/phi/pt/px/py/pz - if(parameterStore.get("Minerva","alternativesimpleoutput").getStatus()){ - if(parameterStore.get("Minerva","simpleoutput").getStatus()){ - globals.setSimpleOutput(3); - }else{ - globals.setSimpleOutput(2); - } - }else if(parameterStore.get("Minerva","simpleoutput").getStatus()){ - globals.setSimpleOutput(1); - } - - // reading the geometry ---------------------------------------- - startupWin.updateText("Reading geometry"); - String geomPrefix = Atlantis.getHomeDirectory() + "geometry" + - Atlantis.FILE_SEPAR; - String geomName = ADefaultValues.get("GeometryName"); - if (!"".equals(geomName)) { - // name of the geometry considered after underscore - geomName = "_" + geomName; - - // do the geometry files exist - just try loading the files - String geomNameFull1 = geomPrefix + "AGeometry" + geomName + ".xml"; - String geomNameFull2 = geomPrefix + "AMuonGeometry" + geomName + ".xml"; - try { - // just accessibility test - @SuppressWarnings("unused") - InputStream i = AUtilities.getFileAsStream(geomNameFull1); - i = AUtilities.getFileAsStream(geomNameFull2); - i = null; - } catch (AAtlantisException ae) { - geomName = ""; // will fall back to default geometry - } - } - String geomIdCalo = geomPrefix + "AGeometry" + geomName + ".xml"; - String geomMuon = geomPrefix + "AMuonGeometry" + geomName + ".xml"; - detector = new AAtlasDetector(geomIdCalo, geomMuon); - AAtlasDetector.setDetector(detector); - - canvas.finalizeConstruction(); - canvas.readCorners(AXMLUtils.getChild(rootNode, "WindowCorners")); - // This is needed here, design should be changed to remove this problem - canvas.setCurrentWindow(canvas.getCurrentWindowName()); - - //Add the canvas as a NewEvent event listener - eventManager.addNewEventListener(canvas); - - // reading the first event -------------------------------------- - startupWin.updateText("Reading initial event"); - getInitialEvent(); - - // displaying GUI, Canvas --------------------------------------- - startupWin.updateText("Displaying GUI and Canvas"); - - // update colors to those selected in the config file - AColorMap.setColorMap(parameterStore.get("Prefs", "ColorMap").getI()); - // NB: must calculate the size of GUI after calling - // canvas.setVisible(true), in which the real final size of Canvas - // will be calculated - canvas.setCanvasVisible(true); - - // Now the canvas is on the screen and have a size, check if we need - // to rework the aspect ratio on YX projections at all as is the case - // when going to control room projectors for example - AD - canvas.correctAspectRatios(); - - //Create the GUI - gui = AGUI.getGUI(); - - //If we got one, show it (e.g. not in headless mode) - if (gui != null){ - gui.setMaxWidth(MAX_WIDTH); - gui.setName("Atlantis GUI"); // Name is used by JUnit/FEST tests - // Tell the parameter store about the GUI so it can inform the GUI of parameter changes - parameterStore.addParameterChangeListener(gui); - //Display it - gui.setVisible(true); - // and register as a layout change listener - canvas.addOverlay(); - canvas.addLayoutChangeListener(gui); - } - - //Before starting any loops, inform user we are ready to go - startupWin.updateText("Atlantis Ready"); - - // Set the navigation mode if given on the command line. - // Use SwingUtilities.invokeLater() to "defer until all pending events - // have been processed", avoiding the deadlock that otherwise occurs. - if (Atlantis.initialMode != null){ - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - try { - eventManager.setNavigationMode(initialMode); - } catch (InvalidEventSourceException e) { - logger.error("Invalid event source", e); - } - } - }); - } - - //Set up event loop if requested - if ((Atlantis.loopInterval != null) - && (Atlantis.selectedProjections == null ) - && (!AGlobals.isAtlantisHeadless()) ) { - // A loop interval has been given, but no projections - - // so create an event loop dialog, but not in headless mode - AEventLoopDialog dialog = AEventLoopDialog.getInstance(); - - //set all properties - dialog.setUpdateInterval(getLoopInterval()); - dialog.showDialog(); - dialog.startEventLoop(); - } - - //setup demo loop if requested - if (Atlantis.selectedProjections != null) { - //If user just gave -j, use default settings - if (Atlantis.selectedProjections.equals("")) - ADemoDialog.getInstance().setDefaultSequence(); - //User may also give the update interval - if (getLoopInterval() != null) - ADemoDialog.getInstance().setTimerInterval(getLoopInterval()); - ADemoDialog.getInstance().setVisible(true); - ADemoDialog.getInstance().startDemo(); - } - - //Add an image server if requested on the command line - if (imageServerPort >= 0) { - AServerXMLRPC serv = new AServerXMLRPC(imageServerPort, AServerXMLRPCEventSource.class); - serv.start(); - } - - //If we have a image saver, add it now as new event listener - if (imageProducer != null){ - eventManager.addNewEventListener(imageProducer); - //if we are also running in headless mode, add an automatic event loop - if (AGlobals.isAtlantisHeadless()){ - //Check whether the event source is a file or an ONCRPC server - //For a server, start the loop in a "try hard" mode, i.e only stop on ReadEventException - boolean stopOnFailure = !(eventManager.getEventSource() instanceof atlantis.event.oncrpc.AONCRPCEventSource ); - //If a loop interval is given on the command line, use it, - //otherwise, run in "as fast as can mode" - int sleepTime = (Atlantis.loopInterval != null) ? Atlantis.loopInterval*1000 : 0; - //Show warning in case of "as fast as we can mode" - if (sleepTime == 0) logger.info("No loop intervall given - processing events as fast as possible"); - //Now create the loop - ADemoLoop loop = new ADemoLoop(sleepTime,new Vector<String>(Arrays.asList("NE")),stopOnFailure); - //And start it right away - loop.startDemoLoop(); - //also wait for it to finish before the program finishes - synchronized (loop) { loop.wait(); } - } - } - - } catch (Exception e) { - logger.fatal(INIT_ERROR_MSG); - logger.fatal(e.getMessage(), e); - AExceptionHandler.processException(INIT_ERROR_MSG, e); - } finally { - if (startupWin != null) { - startupWin.dispose(); - } - } - - } // initAtlantis() ----------------------------------------------------- - - - protected static String getHomeDirectory() - { - // where was this class loaded from - String temp = Atlantis.class.getResource("Atlantis.class").getFile(); - - // remove "file://" or "file:" - if (temp.startsWith("file://")) { - temp = temp.substring(7); - } else if (temp.startsWith("file:")) { - temp = temp.substring(5); - } - - if(temp.indexOf("!") > -1) - { - // atlantis is in a .jar file - temp = temp.substring(0, temp.indexOf("!")); - temp = temp.replaceAll("%20", " "); - return temp.substring(0, temp.lastIndexOf('/') + 1); - } - // must be the current working directory of the user - return System.getProperty("user.dir") + FILE_SEPAR; - - } // getHomeDirectory() ------------------------------------------------- - - /** - * Process the options passed on the command line - * @param args the command line arguments - */ - private static void processCommandLineParameters(String args[]) - { - - //echo the given command line options - System.out.println("Command line arguments:"); - for(String arg : args) System.out.print(arg + " "); - System.out.println("\n"); - - //Then go and process the command line - (new ACommandLine()).process(args); - - } // processCommandLineParameters() ------------------------------------- - - - /** - * Try to read the initial event - * - from the given event source - * - from the default event - */ - private static void getInitialEvent() - { - //Get the file where the default event is stored - //if not a special source - String eventPath = Atlantis.initialEventSource; - - // if this is not a special source then consider it - // a) to be a file with relative or absolute path - // b) to be a file relative to the Atlantis directory - if (! eventPath.contains("://") ) { - //This should be a file, see if it exists - if(! new File(eventPath).exists()) { - //try prepending atlantis home directory - logger.info("File "+eventPath+" does not exist - trying in "+Atlantis.getHomeDirectory()); - eventPath = Atlantis.getHomeDirectory()+eventPath; - } - - //All non specified sources are assumed to be files - eventPath = "file://" + eventPath; - } - - //be verbose - logger.info("Reading the default event from " + eventPath); - //set the event source and read an event - try { - eventManager.setEventSource(eventPath); - eventManager.nextEvent(); - } catch (InvalidEventSourceException ies){ - //Write error message - String msg = "Can not access "+eventPath+": "+ies.getMessage(); - logger.error(msg); - //Show error dialog - if (AGlobals.isAtlantisHeadless()) return; - JOptionPane.showMessageDialog(ACanvas.getCanvas(), msg, - "Invalid Event Source",JOptionPane.ERROR_MESSAGE); - } catch (NoMoreEventsException nme){ - String msg = "No events in "+eventPath+": "+nme.getMessage(); - logger.error(msg); - //Show error dialog - if (AGlobals.isAtlantisHeadless()) return; - JOptionPane.showMessageDialog(ACanvas.getCanvas(), msg, - "No Events found",JOptionPane.ERROR_MESSAGE); - } catch (ReadEventException rex){ - String msg = "Can not read events from "+eventPath+": "+rex.getMessage(); - logger.error(msg); - //Show error dialog - if (AGlobals.isAtlantisHeadless()) return; - JOptionPane.showMessageDialog(ACanvas.getCanvas(), msg, - "Can not read event",JOptionPane.ERROR_MESSAGE); - } - } - - /** - * Get the SVN tag version from the HeadURL, which is automatically - * substituted by SVN. - */ - private static void setSVNTagInfo() - { - // SVN expands into $HeadURL: file:///atlas/scratch0/graemes/ao-mirror/graphics/AtlantisJava/tags/AtlantisJava-09-16-05-18/src/atlantis/Atlantis.java $, - // we only want the tag name - String s = Atlantis.versionAtlantisJava; - // 0) Check we are in a tagged version - if (!s.contains("tags")){ - Atlantis.versionAtlantisJava = "AtlantisJava (SVN tag n/a)"; - return; - } - // 1) Replace anything after src - s=s.substring(0,s.indexOf("/src")); - // 2) Next find the "tags" subdir and cut after that - s=s.substring(s.indexOf("tags/")+5); - //this should be the version - Atlantis.versionAtlantisJava = s; - } - - public static void main(String[] args) - { - - /** - * First thing always: say hello with a version number - */ - //Retrieve the SVN version tag number - setSVNTagInfo(); - globals.setVersion(versionAtlantisJava); - globals.setLivePoint1EventsURL(LIVE_POINT_1_EVENTS_URL); - globals.setUserConfigFile(USER_CONFIG_FILE_PATH); - globals.setUseOpenGL(atlantisWithOpenGL); - System.out.println("AtlantisJava version (SVN tag): " + Atlantis.versionAtlantisJava); - - // Any uncaught exception should be reported to the developers - Thread.setDefaultUncaughtExceptionHandler(new ACrashReporter()); - - /** - * Now run all the checks for system properties - */ - - //Now set the default look and feel - setLookAndFeel(); - - // Disable rename file/make new directory from the file chooser - UIManager.put("FileChooser.readOnly", Boolean.TRUE); - - /** - * Process the command line parameters - */ - //process args - processCommandLineParameters(args); - - //Logger can be created only after cmdl opts to catch settings - logger = ALogger.getLogger(Atlantis.class); - - //Do some OGL checks - if (Atlantis.atlantisWithOpenGL) { - logger.info("Testing for OpenGL"); - logger.info(AOpenGLTools.isOpenGLAvailable() ? "Open GL Available" : "Open GL Unavailable"); - } - - /** - * Now go and create the manifold Atlantis classes and singletons. - * Has to run on main thread so display is updated during initialization. - */ - initAtlantis(); - // Replace event queue by AEventQueue, but only after initialization. - try { - SwingUtilities.invokeAndWait(new Runnable() { - @Override - public void run() { - logger.debug("Waiting for AWT event queue to be empty."); - } - }); - } catch (InterruptedException e) { - logger.error("Interrupted while waiting for event queue.", e); - } catch (InvocationTargetException e) { - logger.error("Error while waiting for event queue.",e); - } - Toolkit.getDefaultToolkit().getSystemEventQueue().push(new AEventQueue()); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/ACanvas.java b/graphics/AtlantisJava/src/atlantis/canvas/ACanvas.java deleted file mode 100755 index 41b32a59cbc3272084d1ee6527673e673b6f0972..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/ACanvas.java +++ /dev/null @@ -1,1113 +0,0 @@ -package atlantis.canvas; - -import atlantis.event.AEvent; -import atlantis.event.ANewEventListener; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Rectangle; -import java.awt.Insets; -import java.awt.Toolkit; -import java.awt.geom.Point2D; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Stack; -import java.util.Vector; -import java.util.Set; - -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JLayeredPane; - -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import atlantis.globals.AGlobals; -import atlantis.graphics.ACursorFactory; -import atlantis.graphics.AIcon; -import atlantis.graphics.layout.AGridLayout; -import atlantis.parameters.APar; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.utils.xml.AXMLUtils; -import atlantis.gui.AClosingConfirmationDialog; -import atlantis.gui.AInteractionToolBar; -import atlantis.gui.APreferencesControl; -import atlantis.interactions.AZMRInteraction; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionEventInfo; -import atlantis.utils.ALogger; -import java.awt.Graphics; -import java.awt.event.WindowFocusListener; -import java.util.Iterator; -import javax.swing.JMenuBar; -import javax.swing.JPanel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -/** - * ACanvas is a singleton class that acts as a sort of WindowManager It knows the currentLayout (of the - * windows), their history and the currentWindow. It also contains the title (Menu Bar). - * Window changes are given via two letter commands e.g. "W5" inserted into the - * CommandProcessor (static). The command processor informs ACanvas. - * Each window also has its own layer that is stored in a JLayeredPane object. - */ -public class ACanvas extends JPanel implements ANewEventListener { - - //Singleton instance - private static ACanvas instance; - - private final static ALogger logger = ALogger.getLogger(ACanvas.class); - - /** The fraction of the screen width used by default. */ - public final double SCREEN_USAGE = 0.73; - /** Temporary flag to set the window corners from config file. */ - protected boolean customisedCorner = false; - - //the layeredPane - private JLayeredPane layeredPane; - //from some reason we count or layers from 1000 on? - private final int baseLayer = 1000; - - //A list of layout names and layouts - private Hashtable<String, ALayout> layouts = new Hashtable<String, ALayout>(); - //The current canvas layout - private ALayout currentLayout; - //The name of the startup layout - private String startupLayoutName; - //Everyone that should get informed if the layout is changed - private Vector<ALayoutChangeListener> layoutChangeListeners = new Vector<ALayoutChangeListener>(); - - //Save a history of the windows layouts - // - this is used for "Zoom/Unzoom colorimters" in VPlot - private Stack<ALayout> windowLayoutHistory = new Stack<ALayout>(); //History of ALayout objects - private Stack<String> windowNameHistory = new Stack<String>(); //History of the selected window - private Stack<Vector<String>> windowsActive = new Stack<Vector<String>>(); //History of active (i.e. visible windows) - - private Hashtable<String,AWindow> windowsList; // A list of all window <name,object> pairs - private AWindow currentWindow; // The currently selected window - private AWindow paintingWindow; // The window we are currently painting in - //Everyone that should get informed about changes of the active window - private Vector<ChangeListener> windowChangeListeners = new Vector<ChangeListener>(); - //Everyone that should get informed about window freeze/unfreeze changes - private Vector<ChangeListener> lockChangeListeners = new Vector<ChangeListener>(); - - //The title bar showing Event/Run numbers etc. - private ATitleMenuBar title; - - //If constructed from a config file, this stores the aspect ratio of the - //canvas layout which was saved into the config file, this is then used - //later to correct if the current screen is different - private double oldaspect = 1.0; - - private JFrame parentWindow = null; - - private APar parameterStore; - - /** - * Get the singleton instance. - * @return - */ - public static synchronized ACanvas getCanvas() { - if (instance==null) throw new Error("Attempted to access ACanvas instance before initialization."); - return instance; - } - - /** - * Create and return the singleton instance. - * @param parameters - */ - public static synchronized ACanvas construct(Node node) { - instance = new ACanvas(node); - return instance; - } - - /** - * Constructs the singleton instance by reading the config file. - */ - private ACanvas(Node node) { - - if (!AGlobals.isAtlantisHeadless()) { - // Create parent window - parentWindow = new JFrame("Atlantis Canvas"); - parentWindow.add(this); - } - - //Create the title bar - title = new ATitleMenuBar(); - - if (!AGlobals.isAtlantisHeadless()) { - parentWindow.setJMenuBar(title); - } - - //instanciate instance pointer for singleton class - instance = this; - - if (!AGlobals.isAtlantisHeadless()) { - // AClosingConfirmationDialog class handles closing Atlantis - parentWindow.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - parentWindow.addWindowListener(new AClosingConfirmationDialog(parentWindow)); - - //Set the window icon - AIcon.setIconImage(parentWindow); - } - - // building the Layered Pane - layeredPane = new JLayeredPane(); - - // reading all the content of Canvas configuration node - windowsList = new Hashtable<String,AWindow>(); - // Allow null Node to generate partially initialized instance for unit tests of - // other classes that depend on ACanvas. - if (node!=null) readConfig(node); - - } // ACanvas() ---------------------------------------------------------- - - /** - * For testing only: create instance without initializing. - * @return - */ - public static synchronized ACanvas constructDummyForTesting() { - instance = new ACanvas(null); - return instance; - } - - void addParentWindowFocusListener(WindowFocusListener wfl) { - if (parentWindow != null) { - parentWindow.addWindowFocusListener(wfl); - } - } - - public void setCanvasVisible(boolean v) { - if (parentWindow != null) { - parentWindow.setVisible(v); - } else { - setVisible(v); - } - } - - public Rectangle getScreenSize() { - if (parentWindow != null) { - return parentWindow.getGraphicsConfiguration().getBounds(); - } else { - // If we're headless then make up a size! - return new Rectangle(1024, 768); - } - } - - public Rectangle getStartupCanvasSize() { - if (parentWindow == null) { - return null; - } - Rectangle canvpos = parentWindow.getBounds(); - Dimension canvlayoutdim = parentWindow.getPreferredSize(); - Rectangle canvbound = new Rectangle(canvpos.x, canvpos.y, - canvlayoutdim.width, canvlayoutdim.height); - - return canvbound; - } - - public JMenuBar getTitleBar() { - if (parentWindow == null) { - return null; - } - return parentWindow.getJMenuBar(); - } - - public void bringToFront() { - if (parentWindow != null) { - parentWindow.toFront(); - } - } - - /*public JFrame getParentWindow() { - return parentWindow; - }*/ - - private void readConfig(Node node){ - - //Get a list of subnodes - NodeList children = node.getChildNodes(); - - //Loop over all subnodes - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - //Check wether subnode is a Window or a Layout - if (child.getNodeType() == Node.ELEMENT_NODE) { - String nodeName = child.getNodeName(); - //Add a Window or a layout - if (nodeName.equals("UsedWindow")) readWindow(child); - else if (nodeName.equals("Layout")) readLayout(child); - } - } - - // reading all the attributes of Canvas node - NamedNodeMap attributes = node.getAttributes(); - // The startupLayout: - startupLayoutName = attributes.getNamedItem("startupLayout").getNodeValue().trim(); - - // Aspect ratio stuff: - oldaspect = Double.NaN; - Node n = attributes.getNamedItem("aspectRatio"); - - if (n != null) { - oldaspect = Double.parseDouble( - attributes.getNamedItem("aspectRatio").getNodeValue().trim()); - } - - logger.debug("Read config file with aspectRatio: " + oldaspect); - } - - //Read window configuration - private void readWindow(Node node) { - AWindow w = AWindow.createFromXMLConfigNode(node, getWindowsCount()); - - if (!windowsList.containsKey(w.getName())) { - windowsList.put(w.getName(), w); - } else - throw new Error("Redefinition of window: " + w.getName()); - } - - //Read layout configuration - private void readLayout(Node node) { - ALayout layout = new ALayout(node); - - if (!layouts.containsKey(layout.getName())) - layouts.put(layout.getName(), layout); - else - throw new Error("Redefinition of layout: " + layout.getName()); - } - - //Read window corners - public void readCorners(Node corners) { - if (corners == null) - return; - //Set flag to set default corners - customisedCorner = true; - //Get list of corners - NodeList children = corners.getChildNodes(); - //Loop over corners - for (int i = 0; i < children.getLength(); i++) { - Node corner = children.item(i); - if (corner.getNodeType() == Node.ELEMENT_NODE) { - //Get corner attributes - NamedNodeMap attributes = corner.getAttributes(); - String windowName = AXMLUtils.tryAttribut(attributes, "windowName"); - double x0 = Double.parseDouble(AXMLUtils.tryAttribut(attributes, "x0")); - double y0 = Double.parseDouble(AXMLUtils.tryAttribut(attributes, "y0")); - double x1 = Double.parseDouble(AXMLUtils.tryAttribut(attributes, "x1")); - double y1 = Double.parseDouble(AXMLUtils.tryAttribut(attributes, "y1")); - double x2 = Double.parseDouble(AXMLUtils.tryAttribut(attributes, "x2")); - double y2 = Double.parseDouble(AXMLUtils.tryAttribut(attributes, "y2")); - //Create an array with new window corners - Point2D.Double[] c = new Point2D.Double[] { new Point2D.Double(x0, y0), new Point2D.Double(x1, y1), new Point2D.Double(x2, y2) }; - //Set the corners for this window - - getWindow(windowName).setUserCorners(c); - } - } - customisedCorner = false; - } - - - //Finalize the canvas construction - public void finalizeConstruction() { - parameterStore = APar.instance(); - - if (!parameterStore.get("Prefs", "CanvasTitle").getStatus()) { - title.setVisible(false); - } - - //Bring the startup layout on screen - setCurrentLayout(startupLayoutName); - } - - public void addOverlay() { - - AOverlay overlay = new AOverlay(); - if(parentWindow != null) - parentWindow.setGlassPane(overlay); - overlay.setVisible(true); - } - - public void correctAspectRatios() { - - // If we didn't have a saved aspect ratio or didn't know it when - // the config was written - if (Double.isNaN(oldaspect)) { - return; - } - - // Only correct aspect ratio for the full screen layout, the other - // layouts have fixed aspect ratios and should always be okay - if (!currentLayout.getName().equals("FULL SCREEN")) { - return; - } - - // If aspect ratios are the same, we can stop - if (java.lang.Math.abs(getAspectRatio() - oldaspect) < 1e-2) { - logger.debug("Aspect ratio of config file same as this display, no correction required"); - return; - } - - logger.info("Aspect ratio of config file (" + oldaspect + ") does not match this display (" + getAspectRatio() + ") attempting to correct"); - - // Else, iterate over all windows - Iterator<AWindow> it = windowsList.values().iterator(); - while(it.hasNext()) { - AWindow w = (AWindow)(it.next()); - AProjection p = w.getProjection(); - if (p instanceof AProjection2D) { - ((AProjection2D)p).aspectRatioChange(w, oldaspect, getAspectRatio()); - } - } - } - - /** - * Mimics the behavior of a normal canvas paint, but with the canvas scaled to a predefined size. - * @param g Graphics object to draw on - * @param imageWidth width of the image - * @param imageHeight height of the image - * @param type extension of image - */ - public void drawScaledCanvas(Graphics g, int imageWidth, int imageHeight, String type) - { - //hide red ZMR center dot - AZMRInteraction.setPaintCenterDot(false); - - //anti-alias pictures by default - boolean aastatus = APreferencesControl.getAliasMenuItem(); - if(!aastatus) - APreferencesControl.setAliasMenuItem(true); - - // Calculate the scale factors. - double factorX = ((double)imageWidth) / (double)getWidth(); - double factorY = ((double)imageHeight) / (double)getHeight(); - - // Add the title bar, if required. - if (title != null && parameterStore.get("Prefs", "CanvasTitle").getStatus()) { - - //Get old dimensions - int titleWidth = title.getWidth(); - int titleHeight = title.getHeight(); - - if (AGlobals.isAtlantisHeadless()) { - Dimension d = title.getLayout().preferredLayoutSize(title); - titleWidth = (int)d.getWidth(); - titleHeight = (int)d.getHeight(); - } - - //Scale to image width (height is constant) and draw - title.setSize(imageWidth, titleHeight); - title.paint(g); - //restore old - title.setSize(titleWidth, titleHeight); - g.translate(0, titleHeight); - //Re-adjust y-scale for title height - factorY = ((double)(imageHeight-titleHeight))/(double)getHeight(); - } - - // Loop over all windows. - String[] windows = getCurrentLayout().getWindowNames(); - for (int i=0; i<windows.length; i++) - { - AWindow window = getWindow(windows[i]); - int x = window.getX(); - int y = window.getY(); - int width = window.getWidth(); - int height = window.getHeight(); - // If the window is visible resize it temporarily and then draw it. - if (isReallyOnScreen(window)){ - - g.translate((int)(factorX*x), (int)(factorY*y)); - - // Perhaps I should override window.setSize to automatically validate - // This is because AWindow is now a container with a view inside - // - Adam - window.setSize((int)(factorX*width), (int)(factorY*height)); - window.validate(); - - // Needed in headless mode because normally components don't - // do layout until they're really drawn - if (AGlobals.isAtlantisHeadless()) { - window.getLayout().layoutContainer(window); - window.invalidateQuietly(); - } - - //Now print the actual windows - window.print(g); - - // Show ATLAS logo only on the top left window if there's - // enough room and if the checkbox is selected - if(x == 0 && y == 0 && (imageWidth > 300 || imageHeight > 250) && - APreferencesControl.getAtlasLogoMenuItem()){ - g.drawImage(ACursorFactory.getInstance().getAtlasLogo(),32,4,null); - } - //reset old dimensions - window.setSize(width, height); - window.validate(); - g.translate(-(int)(factorX*x), -(int)(factorY*y)); - } - } - - // Overlay does not work in XMLRPC mode (no parentWindow) - if (this.parentWindow != null) { - //get the overlay, resize to our desired canvas size, draw it, then set it back to normal - AOverlay overlay = (AOverlay) this.parentWindow.getGlassPane(); - int width = overlay.getWidth(); - int height = overlay.getHeight(); - overlay.setSize(imageWidth, imageHeight); - overlay.paintComponent(g); - overlay.setSize(width, height); - } - - //do reset - AZMRInteraction.setPaintCenterDot(true); - if(!aastatus) - APreferencesControl.setAliasMenuItem(aastatus); - } - - - //Restore canvas defaults - public void restoreDefaults() { - //Current layout should never be null - if (currentLayout != null) { - if (!currentLayout.getName().equals(startupLayoutName)) { - setCurrentLayout(startupLayoutName); - } - String[] frontWindows = currentLayout.getStartupSequence(); - String[] windows = this.getKnownWindowNames(); - for (String window : windows) windowsList.get(window).restoreDefaults(); - for (String window : frontWindows) this.moveToFrontWindow(window); - setCurrentWindow(currentLayout.getStartupWindow()); - } else - throw new Error("Current layout is not defined"); - - // If an aspect ratio correction took place when we loaded this config - // make sure it is reapplied on a reset - AD - correctAspectRatios(); - } - - /* - * Return a string containing the list of currently visible windows - * that is then written to the config file by AConfigWriter - */ - public String getStartupString() { - StringBuilder s = new StringBuilder(); - //Loop over all windows in all layers - int maxLayer = baseLayer + currentLayout.getWindowNames().length; - for (int i = baseLayer; i <= maxLayer; i++) { - Component[] c = layeredPane.getComponentsInLayer(i); - for (int j = 0; j < c.length; j++) - if (c[j] instanceof AWindow) - if (isReallyOnScreen((AWindow) c[j])) - s.append(((AWindow) c[j]).getName()); - } - return s.toString(); - } - - /* - * Bring this window to the front, i.e. make it the topmost window - */ - public void moveToFrontWindow(String windowName) { - //Make sure the window exists - if (windowsList.containsKey(windowName)) { - //Get the window - AWindow w = windowsList.get(windowName); - //Get the current layer of the window - int layer = JLayeredPane.getLayer(w); - //Get the other components int the same layer - Component[] cc = layeredPane.getComponentsInLayer(layer); - //Check for the current uppermost window - int maxLayer = baseLayer + currentLayout.getWindowNames().length; - - //Now loop over all layers above the one the object is in - for (int i = layer + 1; i <= maxLayer; i++) { - //Get all components from this layers - Component[] c = layeredPane.getComponentsInLayer(i); - //Move them down one layer - for (int j = 0; j < c.length; j++) - layeredPane.setLayer(c[j], i - 1); - } - //Finaly move all component from the current layer to the top - for (int j = 0; j < cc.length; j++) - layeredPane.setLayer(cc[j], maxLayer); - //validate and repaint - this.validate(); - if (!w.isVisible()) { - w.setVisible(true); - } - hideNonVisible(); - w.repaintFromScratch(); - } else - throw new Error("Cannot find window: " + windowName); - } - - /* - * Return window by name - */ - public AWindow getWindow(String windowName) { - //Search for the window in the list an return it - if (windowsList.containsKey(windowName)) - return (AWindow) windowsList.get(windowName); - else - throw new Error("Cannot find window: " + windowName); - } - - /* - * Repaint all but the current window - * Used to update SynchroCursor in all windows. - */ - public void repaintOthers(Component current) { - //Fill all windows in an enumeration object - Enumeration<AWindow> myenum = windowsList.elements(); - - //Loop over windows - while (myenum.hasMoreElements()) { - AWindow window = (AWindow) myenum.nextElement(); - //repaint those that are visible - if ((window != current) && this.isReallyOnScreen(window)) - window.repaint(); - } - } - - private void hideNonVisible() { - for (AWindow window : windowsList.values()) { - if (this.isValidWindowName(window.getName())) { - if (!this.isReallyOnScreen(window)) { - if (window.isVisible()) { - window.setVisible(false); - } - } - } - } - } - - /* - * Repaint all windows from Scratch - */ - public void repaintAllFromScratch() { - Enumeration<AWindow> myenum = windowsList.elements(); - - hideNonVisible(); - - while (myenum.hasMoreElements()) { - AWindow window = (AWindow) myenum.nextElement(); - - if (this.isReallyOnScreen(window)) { - if (!window.isVisible()) { - window.setVisible(true); - } - window.repaintFromScratch(); - } - } - title.repaint(); - } - - /* - * Return a string will the names of all layouts - * to be shown in the layout dialog - */ - public String[] getLayoutNames() { - Enumeration<String> myenum = layouts.keys(); - String[] s = new String[layouts.size()]; - //Loop over all layouts and concatenate their names - for (int i = 0; i < s.length; i++) - s[i] = (String) myenum.nextElement(); - - return s; - } - - /* - * Get Layout by name - */ - public ALayout getLayout(String name) { - if (layouts.containsKey(name)) - return layouts.get(name); - else - throw new Error("getLayout, unknown: " + name); - } - - /* - * Return the current layout - */ - public ALayout getCurrentLayout() { - return currentLayout; - } - - /* - * Set the current layout and apply the changes right away - */ - public void setCurrentLayout(String newLayout) { - //Make sure the new layout exists - if (layouts.containsKey(newLayout)) { - - //get current layout and its dimension - currentLayout = layouts.get(newLayout); - Dimension dim = currentLayout.getSize(); - - // clear the frame - setLayout(null); - removeAll(); - layeredPane.removeAll(); - - //Toolkit is not aware of multi-screens, but "adds them all together". - // Dimension ScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); - //getMaxWindowBounds gets max bounds, again added up over multiple screens. In contrast to the above, - //it will account for MenuBars, StatusBars, etc from the the WindowManager - // Rectangle ScreenSize = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); - //This is how to get the default screen, we should rather use the one we are on - // GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment(); - // GraphicsDevice gscreen = genv.getDefaultScreenDevice(); - // GraphicsConfiguration gconf = gscreen.getDefaultConfiguration(); - - //Final total Width, Height and position of the Canvas - int W, H, X, Y; - - //First get the screen size of the current screen - Rectangle ScreenSize = getScreenSize(); - - //This is not a real full screen mode, rather a maximised Window mode. - //In proper full screen, some window managers (such as Cacao) will allow - //to have the title bar/menues disappear, etc. - if(newLayout.equals("FULL SCREEN")) { - //Really take the full screen in this mode - W = ScreenSize.width; - H = ScreenSize.height; - X = ScreenSize.x; - Y = ScreenSize.y; - } else { - //if not full screen then have to take account of task bars - //First gets the insets (borders) from all sides - Insets borders = new Insets(0, 0, 0, 0); - if (!AGlobals.isAtlantisHeadless()) { - borders = Toolkit.getDefaultToolkit() - .getScreenInsets(parentWindow.getGraphicsConfiguration()); - } - //calculate new usable screen size - ScreenSize.width -= borders.left+borders.right; - ScreenSize.height -= borders.top+borders.bottom; - ScreenSize.x += borders.left; - ScreenSize.y += borders.top; - - W = (int) (ScreenSize.width * SCREEN_USAGE); - H = ScreenSize.height; - X = ScreenSize.x; - Y = ScreenSize.y; - } - - //Apply the new layout dimensions - layeredPane.setLayout(new AGridLayout(dim, null)); - - //Now check for the existing windows - String[] usedWindowNames = currentLayout.getWindowNames(); - - //Loop over windows and add them to the new layout - for (int i = 0; i < usedWindowNames.length; i++) { - //Get the window dimensions - Rectangle constraint = currentLayout.getWindowConstraints(usedWindowNames[i]); - //Get the window itself - AWindow window = windowsList.get(usedWindowNames[i]); - //Make sure its finalized - if (!window.finalized) { - window.finalizeConstruction(); - } - //Add window to a new layer with the given dimensions - layeredPane.setLayer(window, baseLayer + i); - layeredPane.add(window, constraint); - } - // adding the layeredPane to the frame - setLayout(new BorderLayout()); - add(layeredPane); - - if (parentWindow != null) { - //Set the new window dimensions and position - parentWindow.setLocation(X, Y); - parentWindow.setSize(W, H); - - //Validate and update - parentWindow.validate(); - parentWindow.repaint(); - - } else { - - // This is real voodoo to make the canvas lay itself out in the - // right way in headless mode - // It seems that because there's no repaint events things like - // layouts often don't work in the way you expect. I'm fully - // willing to believe I don't understand the best way to do this. - // This is rather a scattergun approach that seems to work... - // - Adam - - setSize(W, H); - layeredPane.setSize(W, H); - - Dimension d = layeredPane.getLayout().preferredLayoutSize(layeredPane); - - validate(); - repaint(); - - setSize(d); - layeredPane.setSize(d); - layeredPane.getLayout().layoutContainer(layeredPane); - } - - fireLayoutChange(); - - //Now apply window ordering - String[] ss = currentLayout.getStartupSequence(); - for (int i = 0; i < ss.length; i++) this.moveToFrontWindow(ss[i]); - - //Finally set the current window to the same it was before, if it exists - if ((currentWindow != null) && (currentLayout.hasWindow(currentWindow.getName()))) - setCurrentWindow(currentWindow.getName()); - else - setCurrentWindow(currentLayout.getStartupWindow()); - } else - throw new Error("setCurrentLayout: unknown layout name !?"); - } - - /* - * Inform everyone on the LayoutChangeListener list about the layout change - */ - private void fireLayoutChange() { - for (ALayoutChangeListener changeListener : layoutChangeListeners) { - changeListener.layoutChanged(getCanvas()); - } - } - - /* - * Store the current layout in the stack - * This is need for layout history, used by e.g. "Zoom/Unzoom LAr/Calorimeters" - */ - public void saveLayout() { - //Add the current layout and active window name - windowLayoutHistory.push(getCurrentLayout()); - windowNameHistory.push(currentWindow.getName()); - - //Also store all windows that are actually on screen - Vector<String> windowsOnScreen = new Vector<String>(); - String[] usedWindowNames = currentLayout.getWindowNames(); - for (String windowName : usedWindowNames) { - AWindow window = windowsList.get(windowName); - if(isReallyOnScreen(window)) { - windowsOnScreen.add(windowName); - } - } - windowsActive.push(windowsOnScreen); - } - - /* - * Revert to the previous layout in the layout history - */ - void unlayout() { - //Make sure there is a previous one - if(windowLayoutHistory.size() > 0) { - //Get the old layout and active window - ALayout newLayout=windowLayoutHistory.pop(); - String windowName=windowNameHistory.pop(); - //Only change layout if it has actually changed - if(!newLayout.getName().equals(currentLayout.getName())) { - //Set new layout and current window - setCurrentLayout(newLayout.getName()); - setCurrentWindow(windowName); - } - //now bring windows in the proper order - Vector<String> windowsOnScreen = windowsActive.pop(); - - for (String winName : windowsOnScreen) { - this.moveToFrontWindow(winName); - } - } - } - - /* - * Add objects that shall be informed if there is a change in the lock status - */ - public void addLockChangeListener(ChangeListener listener) { - lockChangeListeners.addElement(listener); - listener.stateChanged(new ChangeEvent(this)); - } - /* - * Add objects that shall be informed if there is a change in the layout - */ - public void addLayoutChangeListener(ALayoutChangeListener listener) { - layoutChangeListeners.addElement(listener); - listener.layoutChanged(getCanvas()); - } - - /* - * Add objects that shall be informed if there is a - * change in the current window - */ - public void addWindowChangeListener(ChangeListener listener) { - windowChangeListeners.addElement(listener); - listener.stateChanged(new ChangeEvent(this)); - } - - /* - * Check if the given window name exists in the list of windows - */ - public boolean isValidWindowName(String name) { - return windowsList.containsKey(name); - } - - /* - * Get a string with all the existing windows - */ - public String[] getKnownWindowNames() { - Set<String> windowNames = windowsList.keySet(); - return windowNames.toArray(new String[windowNames.size()]); - } - - /* - * Returns the name of the current window - */ - public String getCurrentWindowName() { - return currentWindow.getName(); - } - - /* - * Return the current window - */ - public AWindow getCurrentWindow() { - return currentWindow; - } - - /* - * Return the window we are currently painting in - */ - public AWindow getPaintingWindow() { - return paintingWindow; - } - - /* - * Notify everyone about a change in the active window - */ - private void fireWindowChange() { - ChangeEvent changeEvent = new ChangeEvent(this); - for (ChangeListener changeListener : windowChangeListeners) { - changeListener.stateChanged(changeEvent); - } - } - - /* - * Notify everyone about a change in the lock status - */ - void fireLockChange() { - ChangeEvent changeEvent = new ChangeEvent(this); - for (ChangeListener changeListener : lockChangeListeners) { - changeListener.stateChanged(changeEvent); - } - } - - /* - * Get number of windows - */ - public int getWindowsCount() { - return windowsList.size(); - } - - /** - * Sets the current window. Informs all registered listeners. - * - * @param newWindowName The name of the window to be set to current. - */ - public void setCurrentWindow(String newWindowName) { - //Make sure window does exist - if (windowsList.containsKey(newWindowName)) { - //Deselect the current window - if (currentWindow != null) currentWindow.deselect(); - //Get the new window - currentWindow = (AWindow) windowsList.get(newWindowName); - //Select it - currentWindow.select(); - //Inform APar class about the new current window - parameterStore.setCurrentWindowIndex(currentWindow.getIndex()); - //Move the current window on top of all others - moveToFrontWindow(currentWindow.getName()); - //Inform everyone about the change - fireWindowChange(); - } else - throw new Error("setCurrentWindow, window: " + newWindowName + " , doesn't exist !?"); - } - - /** - * Sets the currently window currently being painted - * - * @param window the window being painted - */ - public void setPaintingWindow(AWindow window) { - paintingWindow = window; - } - - /** - * Copy settings from one window to another window - * - * @param from the window to copy settings from - * @param to the window to copy settings to - */ - public void copyWindowSettings(String from, String to) { - AWindow fromW = getWindow(from); - AWindow toW = getWindow(to); - - parameterStore.copyParameters(from, to); - - // IMPORTANT! Do not change the order - // setCurrentWindow() should be always before setProjection() - setCurrentWindow(to); - - // copy the projection, group and scales - toW.setProjection(fromW.getProjection()); - toW.setGroup(fromW.getGroupName()); - toW.setScaleStatus(fromW.getScaleStatus()); - - // copy the interaction (no interactions valid for EventInfo projection) - if(!(fromW.getProjection() instanceof AProjectionEventInfo)) - { - AInteractionToolBar fromI = fromW.getInteractionToolBar(); - AInteractionToolBar toI = toW.getInteractionToolBar(); - - toI.setSelectedGroup(fromI.getSelectedGroupName()); - // copy the state of the panel - toI.getSelectedGroup().setGroupState(fromI.getSelectedGroup()); - } - // for LegoPlot windows we need to set the (x,y,z)-corners from the projection - // TODO: Check and understand this. Previously there was no check that toW was - // an instance of AProjectionLegoPlot, put perhaps this works because only - // ever copy settings from one projection to another of the same type? - if(fromW.getProjection() instanceof AProjectionLegoPlot - && toW.getProjection() instanceof AProjectionLegoPlot) { - AProjectionLegoPlot.setxz(toW.getIndex(), AProjectionLegoPlot.getxz(fromW.getIndex())); - AProjectionLegoPlot.setyz(toW.getIndex(), AProjectionLegoPlot.getyz(fromW.getIndex())); - //reset the center of detector dot on ZMR - toW.getInteractionManager().setContext(toW.getInteractionToolBar().getSelectedGroup()); - } - //copy the user corners - toW.setUserCorners(fromW.getUserCorners()); - } - - /** - * As each window has its own layer, find the window that is in this window - * - * @param layer the layer which the window is in - */ - private AWindow getWindowForLayer(int layer) { - //Get all the components in this layer - Component[] c = layeredPane.getComponentsInLayer(layer); - //Return the first instance of AWindow - for (int i = 0; i < c.length; i++) - if (c[i] instanceof AWindow) return (AWindow) c[i]; - //Otherwise return 0 - return null; - } - - /** - * Get the associated tile menu bar - */ - public ATitleMenuBar getATitle() { - return title; - } - - /** - * Get the top-most window at a certain point - * - * @param x x-coordinate in pixels - * @param y y-coordinate in pixels - */ - private AWindow getWindowForPoint(double x, double y) { - //Loop over all layers - int maxLayer = baseLayer + currentLayout.getWindowNames().length; - for (int lay = maxLayer; lay >= 0; lay--) { - //Get the window that is in this layer - AWindow w = getWindowForLayer(lay); - if (w == null || currentLayout == null) { - continue; - } - //Get the window rectangle - Rectangle r = currentLayout.getWindowConstraints(w.getName()); - //Check if x,y is inside the rectangle - if (r.contains(x, y)) - return w; - } - - return null; - } - - /** - * Check if a given window is partially visible - * - * @param window the window to check - */ - public boolean isReallyOnScreen(AWindow window) { - //The full area covered by the canvas - Dimension layoutSize = currentLayout.getSize(); - - //Run over every single point on the canvas - //until we hit one that belongs to the window -- aaaaaarrrrggghhh!!! (SB?) - - //This function almost always exits on the first pixel - //Profiling indicates it takes only a few miliseconds - //even in very rare worst cases - AD - for (int j = 0; j < layoutSize.height; j++) - for (int i = 0; i < layoutSize.width; i++) - if (getWindowForPoint(i + 0.5, j + 0.5).equals(window)) - return true; - - return false; - } - - /** - * Implementation of the new event listener: gets called for each new event - * and repaints all the windows. - * - * @param evt the new event - */ - @Override - public void newEvent(AEvent evt) { - repaintAllFromScratch(); - } - - /** Return the aspect ratio of the canvas drawing area (hopefully) as h/w. - * Sorry if this is usually defined as w/h? - AD */ - public double getAspectRatio() { - Dimension d = layeredPane.getSize(); - return d.getHeight() / d.getWidth(); - } - - /** - * Calculates the image height that will result if one resizes the current canvas to the given width. - * @param width target width - * @return corresponding height - */ - public int getRespectiveHeight(int width){ - - //Get rootpane dimensions - int canvasWidth = getWidth(); - int canvasHeight = getHeight(); - - //calculate factor - double factor = ((double)width) / canvasWidth; - - //Account for menu bar if its there - if (title != null && parameterStore.get("Prefs", "CanvasTitle").getStatus()) { - //if (getTitleBar() != null && getTitleBar().isVisible()){ - int height = title.getHeight(); - - if (AGlobals.isAtlantisHeadless()) { - // In headless mode the menu bar isn't really enabled - // So get the size it would be if it was - height = (int) (title.getLayout().preferredLayoutSize(title).getHeight()); - } - - return (int) (factor * canvasHeight) + height; - - } - - //Otherwise just scale - return (int)(factor*canvasHeight); - } - -} //ACanvas diff --git a/graphics/AtlantisJava/src/atlantis/canvas/ADrawCalorimeterSummedEndcaps.java b/graphics/AtlantisJava/src/atlantis/canvas/ADrawCalorimeterSummedEndcaps.java deleted file mode 100755 index c7b6a307a49229133e5608b9b6be6e051f292df3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/ADrawCalorimeterSummedEndcaps.java +++ /dev/null @@ -1,937 +0,0 @@ -package atlantis.canvas; - -import java.awt.Color; - -import atlantis.data.ACalorimeterData; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.graphics.ACoord; -import atlantis.graphics.ADrawParameters; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.utils.AMath; -import atlantis.utils.APolygon; - -/** - * Contains the function for drawing the summed LAr and HEC endcaps - * - * @author Mark Stockton - */ -public class ADrawCalorimeterSummedEndcaps -{ - static int minEtaIndex,minPhiIndex,maxEtaIndex,maxPhiIndex,numCombinedCells,binvalue=1,SmallestEtaBinNumber,LargestEtaBinNumber; - static double etaBin, phiBin, SmallestZMin,maxCellEnergy,minCellEnergy; - static String name; - - protected static APar parameterStore = APar.instance(); - - /** - * Draws the summed endcaps. This method is called - * from drawCalorimeters and should not be used directly. - * - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - * @param calorimeter ACalorimeterData current calorimeter - * @param etaIndex short[] index of eta values - * @param phiIndex short[] index of phi values - * @param side byte[] side of detector - */ - public static void drawCalorimeterSummedEndcaps(AWindow window, AGraphics ag, AProjection2D projection, ACalorimeterData calorimeter, short[] etaIndex, short[] phiIndex, byte[] side) - { - resetGlobalValues(calorimeter.getName()); - ACoord data; - double[][] EndcapBinnedEnergy = new double[(36/binvalue)][(64/binvalue)]; - calorimeter.makeDrawList(); - //loop over drawlist to find z of first plane and smallest and largest eta - setSmallestAndLargest(calorimeter); - //now loop over drawlist to draw - for (int k = 0; k < calorimeter.getNumDraw(); k++) - { - int j = calorimeter.getDrawIndex(k); - short detectorIndex = (short) ACalorimeterDetector.getDetectorIndex(calorimeter.getIdFromIndex(j)); - ACalorimeterDetector currentDetector=ACalorimeterDetector.get(detectorIndex); - if (detectorIndex >= 0) - { - ACoord coord = currentDetector.getCell(projection, etaIndex[j], phiIndex[j], side[j]); - if (coord.hv[0].length > 0) - { - //has a cell so get its energy - double cellEnergy=calorimeter.getEnergy(j); - //find the eta min and max of each cell - double[] etaminmax=findEtaMinAndMax(currentDetector,etaIndex[j],side[j]); - //test to see if the cell overlaps the eta border - if(etaminmax[2]==1) - { - //Only want cells upto the eta split - double middle=parameterStore.get("YX", "SplitEta").getD()-(0.5*etaBin); - //find the min and max of each cell - double[] minmax1=findMinAndMax(currentDetector,etaminmax[0],middle,phiIndex[j]); - //has to find out how many cells overlap new binning border - int totNumOfCells1 =findNumberOfCells(minmax1); - //Only want cells above the eta split - middle=parameterStore.get("YX", "SplitEta").getD()+(0.5*etaBin); - //find the min and max of each cell - double[] minmax2=findMinAndMax(currentDetector,middle,etaminmax[1],phiIndex[j]); - //has to find out how many cells overlap new binning border - int totNumOfCells2 =findNumberOfCells(minmax1); - //check found positive number of cells - int NumOfCellsTotal=0; - if(totNumOfCells1>0) - NumOfCellsTotal+=totNumOfCells1; - else - System.out.println("Found negative amount of cells!?!"); - if(totNumOfCells2>0) - NumOfCellsTotal+=totNumOfCells2; - else - System.out.println("Found negative amount of cells!?!"); - if(NumOfCellsTotal>0) - { - //split energy between the cells - cellEnergy/=NumOfCellsTotal; - //now add on energy - if(totNumOfCells1>0) - { - EndcapBinnedEnergy=AddOnToEnergy(EndcapBinnedEnergy, cellEnergy, minmax1); - } - if(totNumOfCells2>0) - { - EndcapBinnedEnergy=AddOnToEnergy(EndcapBinnedEnergy, cellEnergy, minmax2); - } - } - } - else - { - //find the min and max of each cell - double[] minmax=findMinAndMax(currentDetector,etaminmax[0],etaminmax[1],phiIndex[j]); - //has to find out how many cells overlap new binning border - int totNumOfCells =findNumberOfCells(minmax); - //if found cells - if(totNumOfCells>0) - { - //split energy between the cells - cellEnergy/=totNumOfCells; - //not overlapping eta split so just add on energy - EndcapBinnedEnergy=AddOnToEnergy(EndcapBinnedEnergy, cellEnergy, minmax); - } - else - System.out.println("Found negative amount of cells!?!"); - } - } - } - } - //if no cells then don't need to draw - if(numCombinedCells==0) - return; - //now need to order energy into a list aswell as get the geometry of cells with energy - double[] EndcapBinnedEnergyList; - double[] YXBinnedEnergyList=new double[numCombinedCells];//needed as could be FR projection - double[][][] YXhv=new double[2][numCombinedCells][0]; - int currentCount=0; - for(int a=minEtaIndex; a<=maxEtaIndex;a++) - { - for(int b=minPhiIndex; b<=maxPhiIndex;b++) - { - if(EndcapBinnedEnergy[a][b]>0.0) - { - //has an energy so store its cell coordinates - ACoord coord = calculateCellGeometry(a,b); - YXhv[0][currentCount]=coord.hv[0][0]; - YXhv[1][currentCount]=coord.hv[1][0]; - //sorts energy into a list less blank cells - YXBinnedEnergyList[currentCount]=EndcapBinnedEnergy[a][b]; - currentCount++; - //check if is largest/smallest cell energy - if(EndcapBinnedEnergy[a][b]>maxCellEnergy) - maxCellEnergy=EndcapBinnedEnergy[a][b]; - if(EndcapBinnedEnergy[a][b]<minCellEnergy) - minCellEnergy=EndcapBinnedEnergy[a][b]; - } - } - } - //store coords and scale for display - ACoord YXData = new ACoord(YXhv); - //now need to alter to FR projection if needed otherwise will continue with temp - if(projection instanceof AProjectionFR) - { - //convert data to FR and add data to loop in phi - data=convertToFR(YXData, window); - //now need to loop the energies - EndcapBinnedEnergyList=new double[3*numCombinedCells]; - for(int j=0; j<numCombinedCells;j++) - { - EndcapBinnedEnergyList[j]=YXBinnedEnergyList[j]; - EndcapBinnedEnergyList[j+numCombinedCells]=YXBinnedEnergyList[j]; - EndcapBinnedEnergyList[j+(2*numCombinedCells)]=YXBinnedEnergyList[j]; - } - numCombinedCells*=3;//now have 3 lots of cells - } - else - { - //If not FR then the YX values are correct - EndcapBinnedEnergyList=YXBinnedEnergyList; - data=YXData; - } - data = window.calculateDisplay(projection.nonLinearTransform(data)); - // Draw the cell frames - boolean drawCells = parameterStore.get( name, "Cells").getStatus(); - if (drawCells) - drawCells(window, ag, data, EndcapBinnedEnergyList); - // Draw the histograms. - ACalorimeterData.drawEndcapHistogram(calorimeter, window, ag, projection); - } - - /** - * Resets gobal values - * @param CalName name of calorimeter - */ - protected static void resetGlobalValues(String CalName) - { - name=CalName; - minEtaIndex=999; - minPhiIndex=999; - maxEtaIndex=0; - maxPhiIndex=0; - numCombinedCells=0; - SmallestZMin = 99999.0; - SmallestEtaBinNumber = 99999; - LargestEtaBinNumber = 0; - maxCellEnergy=0.0; - minCellEnergy = 99999.0; - //check if using 0.1 binning or 0.2 binning - if(name.equals("HEC")) - binvalue = parameterStore.get("YX", "HECBin").getI(); - else - binvalue = parameterStore.get("YX", "LArBin").getI(); - if(binvalue==3) - { - etaBin=0.1; - phiBin=(2*Math.PI/64); - binvalue=1; - } - else - { - etaBin=0.1*binvalue; - phiBin=(2*Math.PI/64)*binvalue;//(2*Math.PI/64)=0.098 - } - } - - /** - * Set the smallest Z, smallest and largest eta - * - * @param calorimeter ACalorimeterData current calorimeter - */ - protected static void setSmallestAndLargest(ACalorimeterData calorimeter) - { - double largestRho=0.0,smallestRho=99999.0; - double largestEtaValue=0.0,smallestEtaValue=99999.0; - //to shorten detectors to loop over - short prevDetectorIndex=999; - //loop over drawlist - for (int k = 0; k < calorimeter.getNumDraw(); k++) - { - int j = calorimeter.getDrawIndex(k); - short detectorIndex = (short) ACalorimeterDetector.getDetectorIndex(calorimeter.getIdFromIndex(j)); - ACalorimeterDetector currentDetector=ACalorimeterDetector.get(detectorIndex); - String detectorName=currentDetector.getName(); - if (detectorIndex!=prevDetectorIndex && detectorIndex >= 0 - && (detectorName.indexOf("Endcap")>0 || detectorName.indexOf("EC")>=0 || detectorName.equals("HEC"))) - { - //in a different detector - prevDetectorIndex=detectorIndex; - //find z of the first plane - if(currentDetector.getZMin()<SmallestZMin) - { - SmallestZMin=currentDetector.getZMin(); - } - //find smallest rho - if(currentDetector.getRMin()<smallestRho) - { - smallestRho=currentDetector.getRMin(); - largestEtaValue=AMath.etaAbs(currentDetector.getZMin(), smallestRho); - } - //find largest rho - if(currentDetector.getRMax()>largestRho) - { - largestRho=currentDetector.getRMax(); - smallestEtaValue=AMath.etaAbs(currentDetector.getZMin(), largestRho); - } - } - } - //if drawing cell outlines then this will have already been done - if (splitBinning() && !parameterStore.getUnknown("Det", "CaloDetail").getStatus()) - ACalorimeterDetector.setEtaSplit(); - //if using split binning and eta is in inner section - if(splitBinning() && smallestEtaValue>=parameterStore.get("YX", "SplitEta").getD()) - { - double belowSplit=parameterStore.get("YX", "SplitEta").getD()/0.1; - double aboveSplit=(smallestEtaValue-parameterStore.get("YX", "SplitEta").getD())/0.2; - SmallestEtaBinNumber=(int)Math.floor(belowSplit+aboveSplit); - } - else - { - SmallestEtaBinNumber=(int)Math.floor(smallestEtaValue/etaBin); - } - if(splitBinning() && largestEtaValue>=parameterStore.get("YX", "SplitEta").getD()) - { - double belowSplit=parameterStore.get("YX", "SplitEta").getD()/0.1; - double aboveSplit=(largestEtaValue-parameterStore.get("YX", "SplitEta").getD())/0.2; - LargestEtaBinNumber=(int)Math.floor(belowSplit+aboveSplit); - } - else - { - LargestEtaBinNumber=(int)Math.floor(largestEtaValue/etaBin); - } - } - - /** - * Test to see if using split binning - * - * @return Status of if using split binning - */ - protected static boolean splitBinning() - { - int test=0; - if(name.equals("HEC")) - test = parameterStore.get("YX", "HECBin").getI(); - else - test = parameterStore.get("YX", "LArBin").getI(); - if(test==3) - return true; - else - return false; - } - - /** - * Finds the max and min values of the hit cell - * Also tests and sets the min and max indicies for eta and phi - * - * @param currentDetector ACalorimeterDetector current detector - * @param etaIndex short index of eta values - * @param side byte side of detector - * - * @return minAndMax[0] double minEta of cell - * @return minAndMax[1] double maxEta of cell - * @return minAndMax[2] double status of if is an overlapping cell - */ - protected static double[] findEtaMinAndMax(ACalorimeterDetector currentDetector, short etaIndex, byte side) - { - double realEtaBin=etaBin; - //if using split binning and eta is in outer section - if(splitBinning() && Math.abs(currentDetector.getEtaMin(etaIndex, side))>=parameterStore.get("YX", "SplitEta").getD()) - { - realEtaBin=0.2; - } - //used for x when taking arsinh(x)=ln(x+sqrt(x*x+1)) - double asinhOf; - //have to alter eta so can be drawn at the front layer - double zFactor = SmallestZMin/currentDetector.getZMin(); - //do for minimum of cell - double calcEtaMin=Math.abs(currentDetector.getEtaMin(etaIndex, side)); - asinhOf = zFactor*Math.sinh(calcEtaMin); - calcEtaMin = Math.log(asinhOf + Math.sqrt(asinhOf*asinhOf+1)); - //do for center of cell - double calcEta=Math.abs(currentDetector.getEta(etaIndex, side)); - asinhOf = zFactor*Math.sinh(calcEta); - calcEta= Math.log(asinhOf + Math.sqrt(asinhOf*asinhOf+1)); - //find cell size in eta and phi - double deta=currentDetector.getDeltaEta(); - double minEta,maxEta; - //check for overlaping cells in eta and phi - if(deta>realEtaBin) - { - minEta=calcEtaMin; - maxEta=minEta+deta; - } - else - { - minEta=calcEta; - maxEta=minEta;//there is only 1 cell - } - - //make minEta in detector otherwise causes problems if SplitEta=SmallestEtaBinNumber*0.1 - if(minEta<SmallestEtaBinNumber*0.1) - { - minEta=SmallestEtaBinNumber*0.1; - } - - //now store in variable to return - double[] minAndMax=new double[3]; - minAndMax[0]= minEta; - minAndMax[1]= maxEta; - - if(splitBinning()) - { - if(minEta<parameterStore.get("YX", "SplitEta").getD() && - maxEta>parameterStore.get("YX", "SplitEta").getD()) - { - minAndMax[2]=1;//overlapping cell - } - else - minAndMax[2]=0; - } - else - minAndMax[2]=0; - return minAndMax; - } - - /** - * Finds the max and min values of the hit cell - * Also tests and sets the min and max indicies for eta and phi - * - * @param currentDetector ACalorimeterDetector current detector - * @param minEta double min eta of cell to draw - * @param maxEta double max eta of cell to draw - * @param phiIndex short index of phi values - * - * @return minAndMax[0] double minEta of cell - * @return minAndMax[1] double maxEta of cell - * @return minAndMax[2] double minPhi of cell - * @return minAndMax[3] double maxPhi of cell - */ - protected static double[] findMinAndMax(ACalorimeterDetector currentDetector, double minEta, double maxEta, short phiIndex) - { - double realEtaBin=etaBin, realPhiBin=phiBin; - //if using split binning - if(splitBinning()) - { - //if eta is in inner section - if(minEta>=parameterStore.get("YX", "SplitEta").getD()) - { - realEtaBin=0.2; - realPhiBin=(2*Math.PI/32); - } - } - //find cell size in eta and phi - double deta=currentDetector.getDeltaEta(); - double dphi=currentDetector.getDeltaPhi(); - double minPhi,maxPhi; - //check for overlaping cells in eta and phi - if(deta>realEtaBin) - { - if(realEtaBin==etaBin) - { - minEta=Math.floor(minEta/realEtaBin); - maxEta=Math.floor(maxEta/realEtaBin); - } - else - { - //inside split binning - double belowSplit=parameterStore.get("YX", "SplitEta").getD()/0.1; - double aboveSplit=(minEta-parameterStore.get("YX", "SplitEta").getD())/0.2; - minEta=Math.floor(belowSplit+aboveSplit); - aboveSplit=(maxEta-parameterStore.get("YX", "SplitEta").getD())/0.2; - maxEta=Math.floor(belowSplit+aboveSplit); - } - } - else - { - if(realEtaBin==etaBin) - { - minEta=Math.floor(minEta/realEtaBin); - } - else - { - //split binning - double belowSplit=parameterStore.get("YX", "SplitEta").getD()/0.1; - double aboveSplit=(minEta-parameterStore.get("YX", "SplitEta").getD())/0.2; - minEta=Math.floor(belowSplit+aboveSplit); - } - maxEta=minEta;//there is only 1 cell - } - if(dphi>realPhiBin) - { - minPhi=Math.abs(currentDetector.getPhiMin(phiIndex)); - minPhi=Math.floor(minPhi/realPhiBin); - maxPhi=Math.floor(minPhi+(dphi/realPhiBin)); - } - else - { - minPhi=Math.abs(currentDetector.getPhi(phiIndex)); - minPhi=Math.floor(minPhi/realPhiBin); - maxPhi=minPhi;//there is only 1 cell - } - //check for exceeding array limits - if(maxPhi>=(64/binvalue)) - { - maxPhi=(64/binvalue)-1; - if(minPhi>=(64/binvalue)-1) - minPhi=(64/binvalue)-1; - } - if(minPhi<0) - { - minPhi=0; - if(maxPhi<0) - maxPhi=0; - } - //check not out of eta array size range - if(maxEta>=(36/binvalue)) - { - maxEta=(36/binvalue)-1; - if(minEta>=(36/binvalue)) - minEta=(36/binvalue)-1; - } - //check physical eta conditions - if(maxEta>LargestEtaBinNumber) - { - maxEta=LargestEtaBinNumber; - if(minEta>LargestEtaBinNumber) - minEta=LargestEtaBinNumber; - } - if(minEta<SmallestEtaBinNumber) - { - minEta=SmallestEtaBinNumber; - if(maxEta<SmallestEtaBinNumber) - maxEta=SmallestEtaBinNumber; - } - //find min and max eta and phi indices - if(minEta<minEtaIndex) - minEtaIndex=(int)minEta; - if(maxEta>maxEtaIndex) - maxEtaIndex=(int)maxEta; - if(minPhi<minPhiIndex) - minPhiIndex=(int)minPhi; - if(maxPhi>maxPhiIndex) - maxPhiIndex=(int)maxPhi; - //now store in variable to return - double[] minAndMax=new double[4]; - minAndMax[0]= minEta; - minAndMax[1]= maxEta; - minAndMax[2]= minPhi; - minAndMax[3]= maxPhi; - return minAndMax; - } - - /** - * Finds the number of cells in the new binning - * - * @param minmax array containing: minEta, maxEta, minPhi, maxPhi - */ - protected static int findNumberOfCells(double[] minmax) - { - int numOfEtaCells=0; - int numOfPhiCells=0; - double minEta=minmax[0]; - double maxEta=minmax[1]; - double minPhi=minmax[2]; - double maxPhi=minmax[3]; - //calculate the number of cells - //add one as difference in index is 1 less than number of cells - numOfEtaCells+=maxEta-minEta+1; - numOfPhiCells+=maxPhi-minPhi+1; - //get total number of cells - int totNumOfCells = numOfEtaCells*numOfPhiCells; - return totNumOfCells; - } - - /** - * Adds on the energy to EndcapBinnedEnergy and then returns it - * - * @param EndcapBinnedEnergy double[][] energy listing of cells [eta][phi] - * @param cellEnergy double energy of each new cell - * @param minmax double[] min and max of cell in eta and phi - * - * @return EndcapBinnedEnergy double[][] altered energy listing of cells [eta][phi] - */ - protected static double[][] AddOnToEnergy(double[][] EndcapBinnedEnergy, double cellEnergy, double[] minmax) - { - //now loop over the min to max for eta and phi - for(int a= (int) minmax[0]; a<=(int) minmax[1]; a++) - { - for(int b=(int) minmax[2]; b<=(int) minmax[3]; b++) - { - //add to cell count if no energy already stored in cell - if(EndcapBinnedEnergy[a][b]==0.0) - numCombinedCells++; - //add energy to cell - EndcapBinnedEnergy[a][b]+= cellEnergy; - } - } - return EndcapBinnedEnergy; - } - - /** - * Calculates the cell geometry from its eta and phi bin numbers - * - * @param a int eta bin number - * @param b int phi bin number - * - * @return coord Acoord cell coords - */ - protected static ACoord calculateCellGeometry(int a, int b) - { - double realEtaBin=etaBin, realPhiBin=phiBin; - double eta=a*etaBin; - double phi=b*phiBin; - //if using split binning and eta is in inner section - if(splitBinning() && eta>=parameterStore.get("YX", "SplitEta").getD()) - { - realEtaBin=0.2; - realPhiBin=(2*Math.PI/32); - double belowSplit=parameterStore.get("YX", "SplitEta").getD()/0.1; - double aboveSplit=a-belowSplit; - eta=aboveSplit*0.2+belowSplit*0.1; - phi=b*realPhiBin; - } - double[][] temphv = new double[2][]; - - //all drawn on the front plane of the detector - double newrMax=SmallestZMin/Math.sinh(eta); - double newrMin=SmallestZMin/Math.sinh(eta+realEtaBin); - //store the cell coords - temphv[0] = new double[] {newrMax*Math.cos(phi), newrMax*Math.cos(phi+realPhiBin), - newrMin*Math.cos(phi+realPhiBin), newrMin*Math.cos(phi)}; - temphv[1] = new double[] {newrMax*Math.sin(phi), newrMax*Math.sin(phi+realPhiBin), - newrMin*Math.sin(phi+realPhiBin), newrMin*Math.sin(phi)}; - return new ACoord(temphv); - } - - /** - * Converts cells to FR using normal convertYXtoFR - * Then adds on data above and below so loops in phi - * - * @param YXData ACoord data in YX projection - * @param window AWindow current window - * - * @return coord Acoord cell coords - */ - protected static ACoord convertToFR(ACoord YXData, AWindow window) - { - //convert to FR then have to loop data - YXData.convertYXToFR(); - //new hv to store the values at + and - 2pi - double[][][] FRhv=new double[2][3*numCombinedCells][YXData.hv[0][0].length]; - //get corners and then shift data to be inside corners - double phiTop = window.getUserCorners()[0].y; - double phiBottom = window.getUserCorners()[2].y; - int factor=0; - if(phiTop>720.0) - //-2 as already draws upto 720 so doensn't need this extra 2*360 - factor=(int) Math.ceil(phiTop/360.0)-2; - if(phiBottom<-360.0) - //-1 as already draws down to -360 so doensn't need this extra -1*360 - factor=(int) Math.floor(phiBottom/360.0)-1; - for(int j=0; j<numCombinedCells;j++) - for(int k=0; k<YXData.hv[0][j].length; k++) - { - FRhv[1][j][k]=YXData.hv[1][j][k]+360.0*(factor-1); - FRhv[1][numCombinedCells+j][k]=YXData.hv[1][j][k]+360.0*factor; - FRhv[1][(2*numCombinedCells)+j][k]=YXData.hv[1][j][k]+360.0*(factor+1); - FRhv[0][j][k]=YXData.hv[0][j][k]; - FRhv[0][numCombinedCells+j][k]=YXData.hv[0][j][k]; - FRhv[0][(2*numCombinedCells)+j][k]=YXData.hv[0][j][k]; - } - //now store into data to be used to draw - return new ACoord(FRhv); - } - - /** - * Draws the cells - * - * @param ag AGraphics graphics to draw on - * @param data ACoord cell geometries - * @param EndcapBinnedEnergyList double[] energy of each cell - */ - protected static void drawCells(AWindow window, AGraphics ag, ACoord data, double[] EndcapBinnedEnergyList) - { - //Storage of parameters to be used later - Color[] colorMap = AColorMap.getColors(); - //AParameter frame = parameterStore.get(name, "Frame"); - boolean drawFrame = parameterStore.get(name, "Frame").getStatus(); - int frameColor = parameterStore.get(name, "Frame").getI(); - //only draw frames for Grey/BW color maps if is selected to draw frames - if(drawFrame && AColorMap.drawFrames()) - drawFrame=true; - else - drawFrame=false; - AParameter cellGeometry = parameterStore.get(name, "CellGeometry"); - // Draw frames for the filled cells. - if (drawFrame && cellGeometry.getStatus()) - { - for (int j = 0; j < numCombinedCells; j++) - { - ag.setColor(colorMap[frameColor]); - ag.drawPolygon(data.hv[0][j], data.hv[1][j], data.hv[0][j].length); - } - } - // Draw the cell geometry. - AParameter cellOutline = parameterStore.get(name, "CellOutline"); - // Draw filled cells. - if (cellGeometry.getStatus()) - { - for (int j = 0; j < numCombinedCells; j++) - { - ag.setColor(colorMap[cellGeometry.getI()]); - ag.fillPolygon(data.hv[0][j], data.hv[1][j], data.hv[0][j].length); - } - } - // Draw cell outlines. - if (cellOutline.getStatus()) - { - ag.updateDrawParameters(new ADrawParameters(true, cellOutline.getI(), 0, 1, 0, 0, false, 1, 0)); - for (int j = 0; j < numCombinedCells; ++j) - { - ag.drawPolygon(data.hv[0][j], data.hv[1][j], data.hv[0][j].length); - } - } - //Scale the cell polygons. - data = scaleEndcapPolygons(EndcapBinnedEnergyList, data, minCellEnergy, maxCellEnergy); - //Get the colours of the cells - byte[] EndcapColor= internalEndcapColor(EndcapBinnedEnergyList, minCellEnergy, maxCellEnergy); - // And draw them. - AParameter colorFunction = parameterStore.get(name, "ColorFunction"); - if (colorFunction.getI() == ACalorimeterData.COLOR_FUNC_ENERGY) - { - switch (AColorMap.getColorMap()) - { - case AColorMap.COLOR_MAP_DEFAULT1: - case AColorMap.COLOR_MAP_DEFAULT2: - case AColorMap.COLOR_MAP_M4M5: - case AColorMap.COLOR_MAP_GRAYDET: - case AColorMap.COLOR_MAP_ORIGINAL: - // Use colors. - colorMap = AColorMap.getColors(AColorMap.COLOR_MAP_HITCOL); - break; - case AColorMap.COLOR_MAP_GRAY: - case AColorMap.COLOR_MAP_BW: - // Use grayscale. - colorMap = AColorMap.getColors(AColorMap.COLOR_MAP_GRAY_HITCOL); - break; - } - //draw the legend - if(ALegendWindow.exists()) - { - if (AColorMap.getColorMap() != AColorMap.COLOR_MAP_BW) - { - double[] colorEnergy = energyOfEndcapColor(minCellEnergy,maxCellEnergy); - ALegendWindow.getInstance().addEnergyText(window, colorEnergy,maxCellEnergy, colorMap); - } - else - ALegendWindow.getInstance().addEnergyText(window, minCellEnergy,maxCellEnergy); - } - } - else if(ALegendWindow.exists()) - ALegendWindow.getInstance().clearText(window); - //draw filled cell - for (int j = 0; j < numCombinedCells; j++) - { - ag.setColor(colorMap[EndcapColor[j]]); - ag.fillPolygon(data.hv[0][j],data.hv[1][j], data.hv[0][j].length); - } - //draw frame around cell - if (drawFrame && !cellGeometry.getStatus()) - { - for (int j = 0; j < numCombinedCells; j++) - { - ag.setColor(colorMap[frameColor]); - ag.drawPolygon(data.hv[0][j], data.hv[1][j], data.hv[0][j].length); - } - } - } - - /** - * Scales a series of polygons according to the user settings. - * Used for summing over layer in the Endcaps in the YX projection - * - * @param cellEnergy double[] list of each cells energy - * @param coord ACoord polygons to be scaled - * @param minEnergy double min Energy in a cell - * @param maxEnergy double max Energy in a cell - * - * @return ACoord scaled polygons - */ - protected static ACoord scaleEndcapPolygons(double[] cellEnergy, ACoord coord, double minEnergy, double maxEnergy) - { - int energyMode = parameterStore.get(name, "EnergyMode").getI(); - - for (int i = 0; i < cellEnergy.length; i++) - { - if (cellEnergy[i] == 0) - continue; - - double factor; - if (parameterStore.get(name, "ColorFunction").getI() != ACalorimeterData.COLOR_FUNC_ENERGY) - { - // The user has (implicitly) selected energy scaling. - - //each cell is scaled to the new 0.1*0.1 binning so - //density for each just depends on energy - double density = cellEnergy[i]; - double minDensity = minEnergy; - double maxDensity = maxEnergy; - - switch (energyMode) - { - case ACalorimeterData.ENERGY_MODE_MAX_LIN: - case ACalorimeterData.ENERGY_MODE_SUM_LIN: - factor = Math.sqrt(density / maxDensity); - break; - - case ACalorimeterData.ENERGY_MODE_MAX_LOG: - case ACalorimeterData.ENERGY_MODE_SUM_LOG: - double magnitude = Math.floor(Math.log10(Math.sqrt(maxDensity / minDensity)) + 1.0); - factor = (Math.log10(Math.sqrt(density / maxDensity)) + magnitude) / magnitude; - break; - - case ACalorimeterData.ENERGY_MODE_MAX_SQRT: - case ACalorimeterData.ENERGY_MODE_SUM_SQRT: - factor = Math.sqrt(Math.sqrt(density / maxDensity)); - break; - - default: - factor = ACalorimeterData.getNonScalingFactor(); - } - } - else - { - // No energy scaling, scale all cells by the same factor. - factor = ACalorimeterData.getNonScalingFactor(); - } - - if (factor <= 1.0) - { - APolygon.scale(coord.hv[0][i], coord.hv[1][i], factor); - } - } - return coord; - } - - /** - * Determines the color for each hit according to the color function set by - * the user. Used for summing over layer in the Endcaps in the YX projection - * - * @param cellEnergy double[] list of each cells energy - * @param minEnergy double min Energy in a cell - * @param maxEnergy double max Energy in a cell - * - * @return byte[] colors for each energy - */ - protected static byte[] internalEndcapColor(double[] cellEnergy, double minEnergy, double maxEnergy) - { - byte[] EndcapColor= new byte[cellEnergy.length]; - - int colorFunction = parameterStore.get(name, "ColorFunction").getI(); - int constantColor = parameterStore.get(name, "Constant").getI(); - switch (colorFunction) - { - case ACalorimeterData.COLOR_FUNC_CONSTANT: - //colorByConstant(); - for(int i = 0; i < cellEnergy.length; i++) - EndcapColor[i] = (byte) constantColor; - break; -/* case COLOR_FUNC_SUBDET: - colorBy(sub); - break; - - case COLOR_FUNC_CLUSTER: - colorBy(getClusters()); - break; - - case COLOR_FUNC_SAMPLING: - colorBy(sampling); - break; -*/ - case ACalorimeterData.COLOR_FUNC_ENERGY: - EndcapColor=colorEndcapByEnergy( cellEnergy, minEnergy, maxEnergy); - break; -/* - case COLOR_FUNC_JET: - colorBy(getJets()); - break; -*/ - default: - for(int i = 0; i < cellEnergy.length; i++) - EndcapColor[i] = (byte) constantColor; - } - - return EndcapColor; - } - - /** - * Color cells by energy. - * Used for summing over layer in the Endcaps in the YX projection - * - * @param cellEnergy double[] list of each cells energy - * @param minEnergy double min Energy in a cell - * @param maxEnergy double max Energy in a cell - * - * @return byte[] colors for each energy - */ - protected static byte[] colorEndcapByEnergy(double[] cellEnergy, double minEnergy, double maxEnergy) - { - byte[] EndcapColor= new byte[cellEnergy.length]; - int numColors = 17; - for (int i = 0; i < cellEnergy.length; i++) - { - if (AColorMap.getColorMap() == AColorMap.COLOR_MAP_BW) - { - // Black and white colormap. - EndcapColor[i] = AColorMap.BK; - } - else - { - // We have numColors colors available. - switch (parameterStore.get(name, "EnergyMode").getI()) - { - case ACalorimeterData.ENERGY_MODE_MAX_LIN: - case ACalorimeterData.ENERGY_MODE_SUM_LIN: - EndcapColor[i] = (byte) (numColors * (cellEnergy[i] - minEnergy) / (maxEnergy - minEnergy)); - break; - case ACalorimeterData.ENERGY_MODE_MAX_LOG: - case ACalorimeterData.ENERGY_MODE_SUM_LOG: - EndcapColor[i] = (byte) (numColors * (Math.log(cellEnergy[i]) - Math.log(minEnergy)) / (Math.log(maxEnergy) - Math.log(minEnergy))); - break; - case ACalorimeterData.ENERGY_MODE_MAX_SQRT: - case ACalorimeterData.ENERGY_MODE_SUM_SQRT: - EndcapColor[i] = (byte) (numColors * Math.sqrt((cellEnergy[i] - minEnergy) / (maxEnergy - minEnergy))); - break; - } - if (EndcapColor[i] >= numColors) - EndcapColor[i] = (byte) (numColors - 1); - } - } - return EndcapColor; - } - - /** - * Energy of each color. - * Used for summing over layer in the Endcaps in the YX projection - * - * @param minEnergy double min Energy in a cell - * @param maxEnergy double max Energy in a cell - * - * @return byte[] colors for each energy - */ - protected static double[] energyOfEndcapColor(double minEnergy, double maxEnergy) - { - int numColors = 17; - double[] colorEnergy= new double[numColors]; - for (int i = 0; i < numColors; i++) - { - // We have numColors colors available. - switch (parameterStore.get(name, "EnergyMode").getI()) - { - case ACalorimeterData.ENERGY_MODE_MAX_LIN: - case ACalorimeterData.ENERGY_MODE_SUM_LIN: - colorEnergy[i] = ((i * (maxEnergy - minEnergy))/numColors)+minEnergy; - break; - case ACalorimeterData.ENERGY_MODE_MAX_LOG: - case ACalorimeterData.ENERGY_MODE_SUM_LOG: - colorEnergy[i] = Math.exp(((i * (Math.log(maxEnergy) - Math.log(minEnergy)))/numColors)+Math.log(minEnergy)); - break; - case ACalorimeterData.ENERGY_MODE_MAX_SQRT: - case ACalorimeterData.ENERGY_MODE_SUM_SQRT: - colorEnergy[i] = (Math.pow(i/numColors,2) * (maxEnergy - minEnergy))+minEnergy; - break; - } - //may need check to see if lower or higher than min or max - if (colorEnergy[i] >= numColors) - colorEnergy[i] = (byte) (numColors -1); - } - return colorEnergy; - } - -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/canvas/AGLGraphics.java b/graphics/AtlantisJava/src/atlantis/canvas/AGLGraphics.java deleted file mode 100644 index ee0c032ad052d752fcc214b43c40737f0bf640c9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/AGLGraphics.java +++ /dev/null @@ -1,486 +0,0 @@ -package atlantis.canvas; - -import atlantis.graphics.AAbstractGraphics2D; -import com.sun.opengl.util.BufferUtil; -import java.awt.*; -import java.awt.RenderingHints.Key; -import java.awt.color.ColorSpace; -import java.awt.geom.AffineTransform; -import java.awt.geom.PathIterator; -import java.awt.geom.Rectangle2D; -import java.awt.image.BufferedImage; -import java.awt.image.ComponentColorModel; -import java.awt.image.DataBuffer; -import java.awt.image.DataBufferByte; -import java.awt.image.ImageObserver; -import java.awt.image.Raster; -import java.awt.image.WritableRaster; -import java.nio.ByteBuffer; -import java.nio.IntBuffer; -import java.text.AttributedCharacterIterator; -import javax.media.opengl.*; - -/** - * - * This class is an implementation of Graphics2D (although it actually subclasses - * AAbstractGraphics2D). It wraps a GLAutoDrawable object to allow Swing based - * components to paint and have their calls translated into OpenGL calls on the - * underlying context. - * - * Obviously emulating all the functionality of Graphics2D is a challenge - * so expect some visual issues initially... - * - * @author Adam Davison - */ -public class AGLGraphics extends AAbstractGraphics2D { - - private int m_clipx = 0; - private int m_clipy = 0; - private int m_clipw = 0; - private int m_cliph = 0; - private Color m_color = Color.BLACK; - private GLAutoDrawable m_d; - private GL m_gl; - private int m_depth = 1; - private ComponentColorModel m_colorModel = - new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), - new int[]{8, 8, 8, 8}, true, false, ComponentColorModel.TRANSLUCENT, - DataBuffer.TYPE_BYTE); - - public AGLGraphics(AGLGraphics old) { - m_d = old.m_d; - m_gl = m_d.getGL(); - } - - /* - * Draw shapes, don't actually implement cubic or quadratic curves yet. - * For now we only draw straight lines. - * Having said that Atlantis uses such a huge number of segments that this - * doesn't seem to be an issue for visual quality as of yet... - */ - @Override - public void draw(Shape z) { - PathIterator pi = z.getPathIterator(null); - float[] c = new float[6]; - float xpos = 0.0f; - float ypos = 0.0f; - while (!pi.isDone()) { - int type = pi.currentSegment(c); - switch (type) { - case PathIterator.SEG_MOVETO: - xpos = c[0]; - ypos = c[1]; - break; - case PathIterator.SEG_CLOSE: - // Ignoring close lines for now I guess... - break; - case PathIterator.SEG_CUBICTO: - drawLine(c[2], c[3], c[4], c[5]); - case PathIterator.SEG_QUADTO: - drawLine(c[0], c[1], c[2], c[3]); - case PathIterator.SEG_LINETO: - // Just do lines... - drawLine(xpos, ypos, c[0], c[1]); - xpos = c[0]; - ypos = c[1]; - break; - } - pi.next(); - } - //super.draw(z); - } - - public AGLGraphics(GLAutoDrawable d) { - m_d = d; - m_gl = m_d.getGL(); - } - - /* - * This implementation of create()/dispose() is highly thread unsafe - * Since it's not trivial to duplicate the GL context we do the best we can - * and hopefully it's ok for Atlantis. - * - * Essentially where Java2D would create a whole new object which would then - * have it's own state, we push the modelview stack. This means that - * we can perform transformations and then pop the modelview stack in dispose - * to emulate this functionality. - * - * Obviously if you call create twice in two separate threads then one of - * you is destroying the other one's modelview matrix... - */ - @Override - public Graphics create() { - m_gl.glMatrixMode(GL.GL_MODELVIEW_MATRIX); - m_gl.glPushMatrix(); - m_depth++; - //System.err.println("PUSH: " + depth); - //return new AGLGraphics(this); //????? - return this; - } - - @Override - public void translate(int x, int y) { - m_gl.glMatrixMode(GL.GL_MODELVIEW_MATRIX); - m_gl.glTranslatef(x, y, 0.0f); - return; - } - - @Override - public Color getColor() { - return m_color; - } - - @Override - public void setColor(Color c) { - m_color = c; - //System.out.println(c.toString()); - float r = ((float) c.getRed()) / 255.0f; - float g = ((float) c.getGreen()) / 255.0f; - float b = ((float) c.getBlue()) / 255.0f; - float a = ((float) c.getAlpha()) / 255.0f; - m_d.getGL().glColor4f(r, g, b, a); - } - - @Override - public void setPaintMode() { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setXORMode(Color c1) { - throw new UnsupportedOperationException("Not supported yet."); - } - - private Font m_font = Font.decode("Arial-BOLD-18"); - - @Override - public Font getFont() { - return m_font; - } - - @Override - public void setFont(Font font) { - m_font = font; - } - - @Override - public FontMetrics getFontMetrics(Font f) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Rectangle getClipBounds() { - return new Rectangle(m_clipx, m_clipy, m_clipw, m_cliph); - } - - @Override - public void clipRect(int x, int y, int width, int height) { - throw new UnsupportedOperationException("Not supported yet."); - } - - /* - * Sort of ignoring clip here... - */ - @Override - public void setClip(int x, int y, int width, int height) { - m_clipx = x; - m_clipy = y; - m_clipw = width; - m_cliph = height; - //System.out.println("Who cares about clip for now??"); - //throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Shape getClip() { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setClip(Shape clip) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void copyArea(int x, int y, int width, int height, int dx, int dy) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void drawLine(int x1, int y1, int x2, int y2) { - drawLine((float) x1, (float) y1, (float) x2, (float) y2); - } - - public void drawLine(float x1, float y1, float x2, float y2) { - m_gl.glBegin(m_gl.GL_LINES); - m_gl.glVertex2f(x1, y1); - m_gl.glVertex2f(x2, y2); - m_gl.glEnd(); - } - - @Override - public void fillRect(int x, int y, int width, int height) { - GL gl = m_d.getGL(); - - gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL); - - gl.glBegin(gl.GL_QUADS); - gl.glVertex2f(x, y); - gl.glVertex2f(x + width, y); - gl.glVertex2f(x + width, y + height); - gl.glVertex2f(x, y + height); - gl.glEnd(); - } - - @Override - public void clearRect(int x, int y, int width, int height) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void drawOval(int x, int y, int width, int height) { - throw new UnsupportedOperationException("Not supported yet."); - - } - - @Override - public void fillOval(int x, int y, int width, int height) { - //throw new UnsupportedOperationException("Not supported yet."); - return; - } - - @Override - public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { - m_gl.glPolygonMode(m_gl.GL_FRONT_AND_BACK, m_gl.GL_LINE); - - m_gl.glBegin(m_gl.GL_POLYGON); - - for (int i = 0; i < nPoints; i++) { - m_gl.glVertex2f(xPoints[i], yPoints[i]); - } - - m_gl.glEnd(); - } - - public void fillPolygon(double[] xPoints, double[] yPoints, int nPoints) { - - m_gl.glPolygonMode(m_gl.GL_FRONT_AND_BACK, m_gl.GL_FILL); - - m_gl.glBegin(m_gl.GL_POLYGON); - - for (int i = 0; i < nPoints; i++) { - m_gl.glVertex2d(xPoints[i], yPoints[i]); - } - - m_gl.glEnd(); - } - - /* - * Bear in mind that although Java2D is capable of filling arbitrary - * polygons, OpenGL/graphics cards in general use a very simple fill - * algorithm which is only guaranteed to be valid for convex polygons - * If you want to render a concave polygon you have to tessellate it down - * into convex ones. - * - * So far I've been able to do this by modifying the way geometry is - * represented but you can also have a go at tessellating automatically - * using GLUT if you really need to... - */ - @Override - public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) { - - // Prototype code for vertex arrays, actually slower for single polys - // but will definitely improve importance if we start passing in big - // arrays of polygons, say for complex geometry - if (false) { - IntBuffer ib = BufferUtil.newIntBuffer(nPoints * 2); - for (int i = 0; i < nPoints; i++) { - ib.put(xPoints[i]); - ib.put(yPoints[i]); - } - ib.rewind(); - m_gl.glEnableClientState(GL.GL_VERTEX_ARRAY); - m_gl.glVertexPointer(2, GL.GL_INT, 0, ib); - m_gl.glDrawArrays(GL.GL_POLYGON, 0, nPoints); - } else { - // Draw the simple way - - m_gl.glPolygonMode(m_gl.GL_FRONT_AND_BACK, m_gl.GL_FILL); - m_gl.glBegin(m_gl.GL_POLYGON); - - for (int i = 0; i < nPoints; i++) { - m_gl.glVertex2f(xPoints[i], yPoints[i]); - } - - m_gl.glEnd(); - } - } - - @Override - public Stroke getStroke() { - return null; - } - - @Override - public void setStroke(Stroke z) { - //super.setStroke(z); - } - - @Override - public void drawString(String str, int x, int y) { - //FontRenderContext frc = new FontRenderContext(null, true, true); - //GlyphVector gv = m_font.layoutGlyphVector(frc, str.toCharArray(), - // 0, str.length(), Font.LAYOUT_LEFT_TO_RIGHT); - //int ng = gv.getNumGlyphs(); - //Rectangle2D r = gv.getVisualBounds(); - //m_gl.glColor3f(1.0f, 0.0f, 0.0f); - //this.fillRect((int) r.getX(), (int) r.getY(), (int) r.getWidth(), (int) r.getHeight()); - //this.setColor(m_color); - - WritableRaster test = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, - 32, 32, 4, null); - BufferedImage testi = new BufferedImage(m_colorModel, test, false, null); - Graphics testg = testi.getGraphics(); - FontMetrics fm = testg.getFontMetrics(m_font); - Rectangle2D r = fm.getStringBounds(str, testg); - - WritableRaster raster = - Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, - (int)r.getWidth(), (int)r.getHeight(), 4, null); - - BufferedImage bi = new BufferedImage(m_colorModel, raster, false, null); - - Graphics big = bi.getGraphics(); - //big.setColor(Color.GREEN); - //big.fillRect(0, 0, bi.getWidth(), bi.getHeight()); - big.setColor(m_color); - big.setFont(m_font); - big.drawString(str, -(int)r.getX(), -(int)r.getY()); - drawImage(bi, x, (int)(y - r.getHeight()), null); - } - - @Override - public void drawString(AttributedCharacterIterator iterator, int x, int y) { - //throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean drawImage(Image img, int x, int y, ImageObserver observer) { - WritableRaster raster = - Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, - img.getWidth(observer), img.getHeight(observer), 4, null); - - BufferedImage bi = new BufferedImage(m_colorModel, raster, false, null); - - Graphics2D g = bi.createGraphics(); - //g.setColor(Color.WHITE); - //g.drawLine(0, 0, bi.getWidth(), bi.getHeight()); - AffineTransform gt = new AffineTransform(); - gt.translate(0, img.getHeight(observer)); - gt.scale(1, -1d); - g.transform(gt); - g.drawImage(img, null, null); - - DataBufferByte imgbuf = (DataBufferByte) raster.getDataBuffer(); - - m_gl.glRasterPos2i(x, y + bi.getHeight()); - //System.out.println(img.getWidth(observer) + ":" + img.getHeight(observer)); - m_gl.glDrawPixels(img.getWidth(observer), img.getHeight(observer), - m_gl.GL_RGBA, m_gl.GL_UNSIGNED_BYTE, ByteBuffer.wrap(imgbuf.getData())); - - //System.out.println("Ignoring drawImage for now..."); - return true; - //throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) { - // Needed to render JComponent backgrounds - //throw new UnsupportedOperationException("Not supported yet."); - return true; - } - - @Override - public Object getRenderingHint(Key z) { - return null; - } - - @Override - public void setRenderingHint(Key a, Object z) { - return; - } - - @Override - public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void dispose() { - m_depth--; - if (m_depth == 0) { - m_depth = 1; - // This happens when the object is really finally destroyed... - // When this is actually happening if we pop we'll cause a crash... - //System.err.println("DISPOSE CALLED TWICE ON ONE OBJECT!!!"); - //(new Exception()).printStackTrace(); - } else { - m_gl.glMatrixMode(GL.GL_MODELVIEW_MATRIX); - m_gl.glPopMatrix(); - } - return; - // We didn't create so no need to dispose... probably bad... - //throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void rotate(double a, double b, double z) { - super.rotate(a, b, z); - } - - @Override - public void rotate(double z) { - m_gl.glMatrixMode(GL.GL_MODELVIEW_MATRIX); - m_gl.glRotated(z * 360 / (2 * Math.PI), 0.0, 0.0, 1.0); - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/canvas/ALayout.java b/graphics/AtlantisJava/src/atlantis/canvas/ALayout.java deleted file mode 100755 index 7710aff90f88b177e9c0f9c89e0effae2fc23056..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/ALayout.java +++ /dev/null @@ -1,231 +0,0 @@ -package atlantis.canvas; - - -import java.util.Hashtable; -import java.util.Enumeration; -import java.awt.Rectangle; -import java.awt.Dimension; -import org.w3c.dom.*; - - -/** - * This class is not an Layout Manager! It contains the possible window - * configuration - i.e. the possible subdivision of the canvas area in windows. - * Layouts are identified by names such as "SQUARE","FULL_SCREEN". - * Windows are identified by single characters such as "W","1", etc. - * Windows are furthermore grouped in pages such that they do not overlap. - * Pages are identified by the sum of the windows they contain, such as "Full","Vert" - * This class is used mainly by ACanvas and AWindowControl. - */ - -public class ALayout { - //The name of the layout - private String name; - //A table of the window constraints (i.e. corners) for all windows - private Hashtable windowConstraints; - //A table of the pages - private Hashtable pages; - //The default top window for this layout - private String startupWindow; - //The list of window names that by default are - //on the top in this layout - private String[] startupSequence; - - - /** - * Default constructor - * - * @param node XML node with the configuration - */ - public ALayout(Node node) { - //Create new hashtables for window corners and pages - windowConstraints=new Hashtable(); - pages=new Hashtable(); - - // reading the layout attributes - NamedNodeMap attributes=node.getAttributes(); - name=attributes.getNamedItem("name").getNodeValue(); - startupWindow=attributes.getNamedItem("startupWindow").getNodeValue(); - startupSequence=decompose(attributes.getNamedItem("startup").getNodeValue()); - - // reading all the content of Layout node - // - i.e pages and window settings - NodeList childrens=node.getChildNodes(); - for(int i=0; i<childrens.getLength(); i++) { - //get the subnode - Node child=childrens.item(i); - //read in window or page information - if(child.getNodeType()==Node.ELEMENT_NODE) { - //check wether it is a window or page configuration - String nodeName=child.getNodeName(); - if(nodeName.equals("Window")) - readWindow(child); - else if(nodeName.equals("Page")) - readPage(child); - } - } - } - - /** - * Read the window configuration (name/size/position) from an XML node - * - * @param node XML node with the configuration - */ - private void readWindow(Node child) { - //Get the nodes attributes - NamedNodeMap attributes=child.getAttributes(); - //retrieve window information - String name=attributes.getNamedItem("name").getNodeValue(); - int hPos=Integer.parseInt(attributes.getNamedItem("hPos").getNodeValue()); - int vPos=Integer.parseInt(attributes.getNamedItem("vPos").getNodeValue()); - int width=Integer.parseInt(attributes.getNamedItem("width").getNodeValue()); - int height=Integer.parseInt(attributes.getNamedItem("height").getNodeValue()); - //Check if this is a valid window name - if(!ACanvas.getCanvas().isValidWindowName(name)) - throw new Error("Undefined window name: "+name); - //Check if this window has been defined before - if(windowConstraints.containsKey(name)) - throw new Error("Multiple usage of window name: "+name); - //Validate window size and position - if((hPos<0)||(vPos<0)||(width<0)||(height<0)) - throw new Error("Wrong window constraints"); - //Add window constraints to the list - windowConstraints.put(name, new Rectangle(hPos, vPos, width, height)); - } - - /** - * Read the page configuration (windows it contains) from the XML node - */ - private void readPage(Node child) { - //get the attributes - NamedNodeMap attributes=child.getAttributes(); - //retrieve page configuration - String name=attributes.getNamedItem("name").getNodeValue(); - String content=attributes.getNamedItem("content").getNodeValue(); - - //Check if this page exists before - if(pages.containsKey(name)) - throw new Error("Redefinition of page: "+name); - //Split the list of windows in single window names - //('S789' -> 'S','7','8','9') - String[] wContent=decompose(content); - - //Check that each of this is a valid window - for(int i=0; i<wContent.length; i++) - if(!ACanvas.getCanvas().isValidWindowName(wContent[i])) - throw new Error("Unknown window name: "+wContent[i]); - //Add this page - pages.put(name, wContent); - } - - /** - * Break up a string of window names into a list of single window names - * - * @param s the string to break up - */ - private String[] decompose(String s) { - String[] strings=new String[s.length()]; - char[] characters=s.toCharArray(); - - for(int i=0; i<characters.length; i++) - strings[i]=new String(new char[] {characters[i]}); - - return strings; - } - - /** - * Return the layout name - */ - public String getName() { - return name; - } - - /** - * Return the window selected on startup - */ - public String getStartupWindow() { - return startupWindow; - } - - /** - * Return the list of window names that are on top by default - */ - public String[] getStartupSequence() { - return startupSequence; - } - - /** - * Check if window is part of this layout - */ - public boolean hasWindow(String wName) { - return windowConstraints.containsKey(wName); - } - - /** - * Return window names in this layout - */ - public String[] getWindowNames() { - // Loop over the window constraints and retrieve - // window names. - Enumeration wn=windowConstraints.keys(); - int size=windowConstraints.size(); - String[] names=new String[size]; - //Add them all to the array - for(int i=0; i<size; i++) - names[i]=(String)wn.nextElement(); - - return names; - } - - /** - * Return the constraints (i.e. position and size) - * for a particular window - * - * @param wName the name of the window - */ - public Rectangle getWindowConstraints(String wName) { - return(Rectangle)windowConstraints.get(wName); - } - - /** - * Calculate the size of the layout from all its subwindows - */ - public Dimension getSize() { - - Enumeration myenum=windowConstraints.elements(); - int w=0, h=0; - //Loop over all windows - while(myenum.hasMoreElements()) { - Rectangle r=(Rectangle)myenum.nextElement(); - //Check if they exceed the current size - if(r.x+r.width>w) - w=r.x+r.width; - if(r.y+r.height>h) - h=r.y+r.height; - } - - return new Dimension(w, h); - } - - /** - * Return a list of the page names - */ - public String[] getPageNames() { - Enumeration myenum=pages.keys(); - int size=pages.size(); - String[] names=new String[size]; - - for(int i=0; i<size; i++) - names[i]=(String)myenum.nextElement(); - - return names; - } - - /** - * Return a list of the windows that a certain page consists of - */ - public String[] getPageContent(String pageName) { - return(String[])pages.get(pageName); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/ALayoutChangeListener.java b/graphics/AtlantisJava/src/atlantis/canvas/ALayoutChangeListener.java deleted file mode 100644 index 521e31440d1ea790441437d484726acddc565620..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/ALayoutChangeListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package atlantis.canvas; - -/** - * Interface for all LayoutChangeListener classes. Each time the layout is - * changed, the layoutChanged method is called with the layout as an argument - * @author maillard - */ -public interface ALayoutChangeListener { - - /** - * This method gets called each time the layout is changed. - * @param canvas the canvas - */ - abstract public void layoutChanged(ACanvas canvas); - -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/ALegendWindow.java b/graphics/AtlantisJava/src/atlantis/canvas/ALegendWindow.java deleted file mode 100755 index b6397cf61f94e11d3aa99fd57ef5b97448ae7ead..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/ALegendWindow.java +++ /dev/null @@ -1,197 +0,0 @@ -package atlantis.canvas; - -import java.awt.Color; -import java.awt.Component; -import java.awt.GridLayout; -import java.awt.Toolkit; - -import javax.swing.JFrame; -import javax.swing.JTextField; - -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.graphics.colormap.AColorMap; - -/** - * The legend window appears when selected in the preferences menu - * It displays the energy scale for the summed endcaps as these do not - * have the pick interaction. - * - * Moved from package atlantis.gui to atlantis.canvas because of closer - * coupling with classes in atlantis.canvas and atlantis.data. Could move - * back later if can be decoupled. (Ben Waugh, 2011-10-01) - * - * @author Mark Stockton - */ -public class ALegendWindow extends JFrame -{ - private static JTextField[] titleField = new JTextField[2]; - private static JTextField[] textField; - private static ALegendWindow instance = null; - - public static ALegendWindow getInstance() - { - if (instance == null) - instance = new ALegendWindow(); - return instance; - } - - /** - * Check if ALegendWindow instance exists, without creating it if not. - * @return true if ALegendWindow instance exists - */ - public static boolean exists() { - return (instance != null); - } - - public void addEnergyText(AWindow window, double[] Energies, double Energy, Color[] colorMap) - { - if(window.equals(ACanvas.getCanvas().getCurrentWindow())) - { - getContentPane().removeAll(); - validate(); - getContentPane().setLayout(new GridLayout(Energies.length+titleField.length,1)); - - titleField[0].setText("Color Energy thresholds:"); - getContentPane().add(titleField[0]); - if(titleField[1]==null) - titleField[1]=new JTextField(); - titleField[1].setEditable(false); - titleField[1].setBackground(Color.white); - titleField[1].setForeground(Color.black); - titleField[1].setText("Maximum Cell Energy: " + (Math.rint(1000. * Energy)/1000) + " GeV "); - getContentPane().add(titleField[1]); - - String s=""; - for(int i=Energies.length-1;i>=0;i--) - { - if(textField[i]==null) - textField[i]=new JTextField(); - textField[i].setEditable(false); - //to even out the line spacing - if(i<10) - s="0" + i; - else - s="" + i; - s ="Color " + s + " Energy from: " + (Math.rint(1000. * Energies[i])/1000) + " GeV"; - textField[i].setText(s); - textField[i].setBackground(colorMap[i]); - //find out if too dark for black text - if( colorMap[i].getRed() + colorMap[i].getGreen() + - colorMap[i].getBlue()<=128) - textField[i].setForeground(Color.white); - else - textField[i].setForeground(Color.black); - getContentPane().add(textField[i]); - } - invalidate(); - pack(); - setVisible(true); - } - } - - public void addEnergyText(AWindow window, double minEnergy, double maxEnergy) - { - if(window.equals(ACanvas.getCanvas().getCurrentWindow())) - { - getContentPane().removeAll(); - validate(); - getContentPane().setLayout(new GridLayout(3,1)); - titleField[0].setText("Color Energy thresholds:"); - getContentPane().add(titleField[0]); - if(titleField[1]==null) - titleField[1]=new JTextField(); - titleField[1].setEditable(false); - titleField[1].setBackground(Color.white); - titleField[1].setForeground(Color.black); - titleField[1].setText("Maximum Cell Energy: " + (Math.rint(1000. * maxEnergy)/1000) + " GeV "); - getContentPane().add(titleField[1]); - - if(textField[0]==null) - textField[0]=new JTextField(); - textField[0].setEditable(false); - textField[0].setText("Minimum Cell Energy: " + (Math.rint(1000. * minEnergy)/1000) + " GeV "); - textField[0].setBackground(Color.white); - textField[0].setForeground(Color.black); - getContentPane().add(textField[0]); - invalidate(); - pack(); - setVisible(true); - } - } - - public void clearText(AWindow window) - { - if(!titleField[0].getText().equals("Select colour by Energy to bring up scale") - && window.equals(ACanvas.getCanvas().getCurrentWindow())) - { - getContentPane().removeAll(); - validate(); - getContentPane().setLayout(new GridLayout(1,1)); - titleField[0].setText("Select colour by Energy to bring up scale"); - getContentPane().add(titleField[0]); - invalidate(); - pack(); - setVisible(true); - } - } - - public void nothingToDisplay(AWindow window) - { - if(!titleField[0].getText().equals("Select LAr/HEC Summed and colour by Energy to bring up scale") - && window.equals(ACanvas.getCanvas().getCurrentWindow())) - { - getContentPane().removeAll(); - validate(); - getContentPane().setLayout(new GridLayout(1,1)); - titleField[0].setText("Select LAr/HEC Summed and colour by Energy to bring up scale"); - getContentPane().add(titleField[0]); - invalidate(); - pack(); - setVisible(true); - } - - } - - private ALegendWindow() - { - this.setTitle("Legend"); - AIcon.setIconImage(this); - this.setResizable(false); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - int numColors = AColorMap.getNumColors(); - getContentPane().setLayout(new GridLayout(1,1)); - textField = new JTextField[numColors]; - titleField[0] =new JTextField(); - titleField[0].setEditable(false); - titleField[0].setBackground(Color.white); - titleField[0].setForeground(Color.black); - titleField[0].setText("Select LAr/HEC Summed and colour by Energy to bring up scale"); - getContentPane().add(titleField[0]); - - // set the initial location - Component gui = AGlobals.instance().getGuiFrame(); - int guiWidth = gui.getWidth(); - int guiHeight = gui.getHeight(); - int guiX = gui.getX(); - int dialogWidth = (int) this.getPreferredSize().getWidth(); - int dialogHeight = (int) this.getPreferredSize().getHeight(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit() - .getScreenSize().getWidth()); - if (guiX + guiWidth + (dialogWidth - guiWidth) / 2 > screenWidth) - this.setLocation(Math.max(0, screenWidth - dialogWidth), Math.max( - 0, (guiHeight - dialogHeight) / 3)); - else - this.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), - Math.max(0, (guiHeight - dialogHeight) / 3)); - - pack(); - setVisible(true); - } - - public void dispose() - { - instance = null; - super.dispose(); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/AOverlay.java b/graphics/AtlantisJava/src/atlantis/canvas/AOverlay.java deleted file mode 100644 index f4147695a9134eb8fcc278f04284205469b518f7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/AOverlay.java +++ /dev/null @@ -1,193 +0,0 @@ -package atlantis.canvas; - -import java.awt.Color; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; - -import javax.swing.ImageIcon; -import javax.swing.JPanel; - -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.globals.AGlobals; -import atlantis.graphics.AGraphics; -import atlantis.parameters.APar; -import atlantis.utils.AUtilities; - -/** - * AOverlay should be used within a GlassPane in the ACanvas. - * The overlay acts as a canvas on which images can be drawn over the existing display. - * This is currently only used to draw the ATLAS logo and Run/Event info as a floating image. - * Any drawing should be done with the paintComponent method, which is called as the Canvas is drawn. - * @author Tom McLaughlan - */ -public class AOverlay extends JPanel { - - protected static APar parameterStore = APar.instance(); - - public AOverlay() { - setOpaque(false); - } - - /** - * When the ACanvas GlassPane contains an Overlay instance, this is called - * after the Canvas is drawn. - */ - @Override public void paintComponent(Graphics g) { - super.paintComponent(g); - if(parameterStore.get("Logo","ShowATLAS").getStatus()) - drawATLASLogo(g); - } - - /** - * Draws a scaled version of the ATLAS PNG in the Overlay - * @param g The Graphics instance to draw to - */ - protected void drawATLASLogo(Graphics g) { - - int windowWidth = getWidth(); - int windowHeight = getHeight(); - - int logoWidth = 0; - int logoHeight = 0; - - double size = parameterStore.get("Logo", "LogoSize").getD(); - - logoWidth = (int) (windowWidth*size); - logoHeight = (int) (logoWidth*0.6); - - int logoX = 0; - int logoY = 0; - - double hpos = parameterStore.get("Logo", "LogoHPos").getD(); - logoX = (int) ((hpos * (windowWidth-logoWidth))); - - double vpos = parameterStore.get("Logo", "LogoVPos").getD(); - - int heightOffset = 0; - if(parameterStore.get("Prefs", "CanvasTitle").getStatus()) { - windowHeight = this.getParent().getHeight() - 40; - heightOffset = 40; - } - logoY = (int) ((vpos * (windowHeight-logoHeight))) + heightOffset; - - - long EventNumber = 0; - long RunNumber = 0; - String DateTime = ""; - Color textColor = Color.white, - backgroundColor = Color.black; - - AEvent event = AEventManager.instance().getCurrentEvent(); - - if (event != null) { - RunNumber = event.getRunNumber(); - EventNumber = event.getEventNumber(); - DateTime = event.getDateTime(); - } - - // Begin drawing - AGraphics ag = AGraphics.makeAGraphics(g); - // Fill the background - ag.setColor(backgroundColor); - //ag.fillRect(logoX, logoY, logoWidth, logoHeight); - - String iconPath = AGlobals.instance().getHomeDirectory() + "img" + System.getProperty("file.separator"); - - ImageIcon i = AUtilities.getFileAsImageIcon(iconPath + "atlas_logo_shadow.png"); - - - // Determine height and width of current window, and width of ATLAS logo - // These are then used to determine a scaling factor which is used in the - // scale function. - // - - int iwidth = i.getIconWidth(); - double factor = (double) logoWidth / (double) iwidth; - - // Call scale function to scale image to window size - ImageIcon iscale = AUtilities.scale(i.getImage(), factor, parameterStore.get("Prefs", "AntiAlias").getStatus()); - // x, y calculated to position image exactly centred - int x = (logoWidth / 2) - (iscale.getIconWidth() / 2); - int y = (logoHeight / 2) - ((3 * iscale.getIconHeight()) / 4); - - x += logoX; - y += logoY; - - int dpi = 72; - - // Set a scaling font size with window width - int fontSize = (int) Math.round(3.0 * logoWidth / (double) dpi) - 2; - - Font f = new Font("SansSerif", Font.PLAIN, fontSize); - - ag.drawImage(iscale.getImage(), x, y); - - ag.setColor(textColor); // Set colour for text - ag.updateColor(); // Update current colour for drawing - - String DateString = "", RunEventString = ""; - if (event != null) { - DateString = "Date: " + DateTime; - RunEventString = "Run Number: " + RunNumber + ", Event Number: " + EventNumber; - } else { - RunEventString = "No event data available"; - } - - FontMetrics fm = g.getFontMetrics(f); - int DateWidth = fm.stringWidth(DateString); - int RunEventWidth = fm.stringWidth(RunEventString); - - // Check if font is wider than the window and scale down til it fits. - while ((RunEventWidth > logoWidth - 20) || (DateWidth > logoWidth - 20)) - { - - fontSize = fontSize - 1; - f = new Font("SansSerif", Font.PLAIN, fontSize); - fm = g.getFontMetrics(f); - RunEventWidth = fm.stringWidth(RunEventString); - DateWidth = fm.stringWidth(DateString); - } - - ag.setFont(f); // set font as defined above - - if (event != null) { - drawStrokedString(ag, RunEventString, logoX + (logoWidth / 2) - RunEventWidth / 2, (int) (y + (1.1 * iscale.getIconHeight())), Color.WHITE, Color.BLACK); - //ag.drawString(RunEventString, - // logoX + (logoWidth / 2) - RunEventWidth / 2, y + (1.1 * iscale.getIconHeight())); - - if(!DateTime.equals("") && !DateTime.equals("n/a")) { - // If event contains Date/Time data, draw Run Number, Event Number and Date/Time - // and position text in centre of window - drawStrokedString(ag, DateString, logoX + (logoWidth / 2) - DateWidth / 2, (int) (y + (1.3 * iscale.getIconHeight())), Color.WHITE, Color.BLACK); - - //ag.drawString(DateString, - // logoX + (logoWidth / 2) - DateWidth / 2, y + (1.3 * iscale.getIconHeight())); - } - } - } - - /** - * Draws text with an outline, crudely. - * @param ag The AGraphics instance to draw to - * @param str The String to draw - * @param x x position of the string - * @param y y position of the string - * @param fg Text foreground colour - * @param bg Text outline colour - */ - protected void drawStrokedString(AGraphics ag, String str, int x, int y, Color fg, Color bg) { - ag.setColor(Color.BLACK); - ag.updateColor(); - ag.drawString(str, x-1, y-1); - ag.drawString(str, x+1, y+1); - ag.drawString(str, x+1, y-1); - ag.drawString(str, x-1, y+1); - ag.setColor(fg); - ag.updateColor(); - ag.drawString(str, x, y); - } - - -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/AScale.java b/graphics/AtlantisJava/src/atlantis/canvas/AScale.java deleted file mode 100644 index 8359fe7cc7cc3e197bef5bab380a767d8dd8d127..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/AScale.java +++ /dev/null @@ -1,356 +0,0 @@ -package atlantis.canvas; - -import java.awt.geom.GeneralPath; - -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjection; - -/** - * This class contains static methods which are useful for the - * AScaleBorder class and any potential subclasses. - * - * @author Charles Loomis, Ben Waugh - **/ -public class AScale { - final GeneralPath primaryTicks; - final GeneralPath secondaryTicks; - final double[] labelValues; // units are cm - final double[] labelPositions; // after transform - - final static public int LEFT_TICKS=0; - final static public int RIGHT_TICKS=1; - final static public int BOTH_TICKS=2; - - /** - * The size in pixels of the primary tick marks. This is a global - * property for all scales. */ - private static float primaryTickSize=8.f; - - /** - * The size in pixels of the secondary tick marks. This is a - * global property for all scales. */ - private static float secondaryTickSize=5.f; - - private AScale(GeneralPath primaryTicks, GeneralPath secondaryTicks, - double[] label, double[] position) { - this.primaryTicks = primaryTicks; - this.secondaryTicks = secondaryTicks; - this.labelValues = label; - this.labelPositions = position; - } - - /** - * Set the tick sizes (in pixels) for the primary and secondary - * tick marks. */ - static public void setTickSizes(float primaryTickSize, - float secondaryTickSize) { - AScale.primaryTickSize=primaryTickSize; - AScale.secondaryTickSize=secondaryTickSize; - } - - /** - * Get the primary tick size (in pixels). */ - static public float getPrimaryTickSize() { - return AScale.primaryTickSize; - } - - /** - * Get the secondary tick size (in pixels). */ - static public float getSecondaryTickSize() { - return AScale.secondaryTickSize; - } - - /** - * A utility method to add a tick mark to the given GeneralPath at - * the given position. */ - static private void addTickMark(GeneralPath gp, - int location, - float tickPosition, - float tickLength) { - - switch(location) { - - case(AScale.RIGHT_TICKS): - gp.moveTo(tickPosition, 0.f); - gp.lineTo(tickPosition, tickLength); - break; - - case(AScale.LEFT_TICKS): - gp.moveTo(tickPosition, 0.f); - gp.lineTo(tickPosition, -tickLength); - break; - - case(AScale.BOTH_TICKS): - gp.moveTo(tickPosition, -tickLength); - gp.lineTo(tickPosition, tickLength); - break; - } - } - - /** - * Get scale with given parameters. - * - * @param minValueTransformed min value after (fish-eye) transformation - * @param maxValueTransformed max value after (fish-eye) transformation - * @param scaleSize length of the scale border - * @param minPrimary minimum number of primary tick marks - * @param minSeparation minimum separation between tick marks - * @param location left,right,top,bottom - * @param isVertical whether this is a horizontal or vertical scale - * @param proj the projection this scale is drawn for - * @return - */ - public static AScale calculateScale( - double minValueTransformed, - double maxValueTransformed, - int scaleSize, - int minPrimary, - int minSeparation, - int location, - int isVertical, - AProjection proj - ){ - // Setup the two paths which will contain the primary and secondary tick marks. - GeneralPath primaryTicks = new GeneralPath(); - GeneralPath secondaryTicks = new GeneralPath(); - resetScale(primaryTicks,scaleSize); - resetScale(secondaryTicks,scaleSize); - - double minValue = invertTransformation(minValueTransformed,proj,isVertical); - double maxValue = invertTransformation(maxValueTransformed,proj,isVertical); - - double[] labelValues; - double[] labelPositions; - double[] intervals = getScaleIntervals(minValue,maxValue); - if (intervals!=null) { - double labelInterval = intervals[0]; - double primarySpacing = intervals[1]; - double secondarySpacing = intervals[2]; - addTickMarks(primaryTicks, proj, minValue, maxValue, primarySpacing, isVertical, location, primaryTickSize, scaleSize); - addTickMarks(secondaryTicks, proj, minValue, maxValue, secondarySpacing, isVertical, location, secondaryTickSize, scaleSize); - - // Now the labels with the correct precision must be made. - labelValues = getScaleValues(minValue,maxValue,labelInterval); - int numLabels = labelValues.length; - labelPositions = new double[numLabels]; - int ndigits=(int)(Math.floor(Math.log10(primarySpacing))); - ndigits=-Math.min(ndigits, 0); - - for (int i=0; i<labelValues.length; ++i) { - double valueTrans = applyTransformation(labelValues[i],proj,isVertical); - labelPositions[i] = (double) interpolate(valueTrans, scaleSize, minValueTransformed, maxValueTransformed); - } - } else { - labelValues = new double[] {}; - labelPositions = new double[] {}; - } - - return new AScale(primaryTicks,secondaryTicks,labelValues,labelPositions); - } - - /** - * Add tick marks at multiples of given spacing. - * - * @param path - * @param proj - * @param min - * @param max - * @param spacing - * @param isVertical - * @param location - * @param tickSize - * @param scaleSize - */ - private static void addTickMarks(GeneralPath path, - AProjection proj, double min, double max, double spacing, int isVertical, int location, float tickSize, double scaleSize) { - int minMultiplier = (int) Math.ceil(min/spacing); - int maxMultiplier = (int) Math.floor(max/spacing); - double minTrans = applyTransformation(min,proj,isVertical); - double maxTrans = applyTransformation(max,proj,isVertical); - for (int i=minMultiplier; i<=maxMultiplier; ++i) { - double value = i * spacing; - double valTrans = applyTransformation(value,proj,isVertical); - float tickPosition=interpolate(valTrans, scaleSize, minTrans, maxTrans); - addTickMark(path, location, tickPosition, tickSize); - } - - } - - private static void resetScale(GeneralPath path, double length) { - path.reset(); - path.moveTo(0.f, 0.f); - path.lineTo((float)length, 0.f); - } - - /** - * Convert from physical detector coordinate to transformed (fish-eye) coordinate. - * - * @param value - * @param proj - * @param isVertical - * @return - */ - private static double applyTransformation(double value, AProjection proj, int isVertical) { - double valueTransformed = value; - //Apply non-linear transforms if necessary - if (proj instanceof AProjection2D) { - if (isVertical==1) { - valueTransformed = ((AProjection2D)proj).nonLinearTransform(0,value).getY(); - } else { - valueTransformed = ((AProjection2D)proj).nonLinearTransform(value,0).getX(); - } - } - return valueTransformed; - } - - /** - * Convert from transformed (fish-eye) coordinate back to physical detector coordinate. - * - * @param valueTransformed - * @param proj - * @param isVertical - * @return - */ - private static double invertTransformation(double valueTransformed, AProjection proj, int isVertical) { - double value = valueTransformed; - //Apply non-linear transforms if necessary - if (proj instanceof AProjection2D) { - if (isVertical==1) { - value = ((AProjection2D)proj).inverseNonLinearTransform(0,valueTransformed).getY(); - } else { - value = ((AProjection2D)proj).inverseNonLinearTransform(valueTransformed,0).getX(); - } - } - return value; - } - - static float interpolate(double value, double size, - double value0, double value1) { - return(float)(size*(value-value0)/(value1-value0)); - } - - /** - * Title is put between last two value labels on axis. - * @return the position for the title on the scale - */ - public double getTitlePosition() { - double axisPosition; - int numLabels = labelPositions.length; - if (numLabels>=2) { - axisPosition = 0.5 * (labelPositions[numLabels-1] + labelPositions[numLabels-2]); - } else { - axisPosition = 0.0; // default to 0 if only one label (shouldn't happen) - } - return axisPosition; - } - - /** - * Get array of three intervals to use on scale. - * @param min minimum value on scale - * @param max maximum value on scale - * @return intervals to use for [labels, primary tick marks, secondary tick marks] - */ - static double[] getScaleIntervals(double min, double max) { - if (min>=max) return null; - boolean rangeIncludesZero = (min<0.0 && max>0.0); - double labelInterval; - double labelIntervalUnit; - int labelIntervalMultiplier; - if (rangeIncludesZero) { - double maxAbsValue = Math.max(Math.abs(min), Math.abs(max)); - double m=Math.floor(Math.log10(maxAbsValue)); - labelIntervalUnit = Math.pow(10., m); - labelInterval = getRoundNumber(maxAbsValue); - labelIntervalMultiplier = (int) Math.round(labelInterval / labelIntervalUnit); - if (labelIntervalMultiplier==2 && 2*labelInterval<maxAbsValue) { - labelIntervalMultiplier = 4; - labelInterval = labelIntervalMultiplier * labelIntervalUnit; - } - } else { - double range = Math.abs(max-min); - labelInterval = getRoundNumber(range); - int minMultiplier = (int) Math.ceil(min/labelInterval); - int maxMultiplier = (int) Math.floor(max/labelInterval); - while (maxMultiplier==minMultiplier) { - labelInterval = getRoundNumber(labelInterval*0.99); - minMultiplier = (int) Math.ceil(min/labelInterval); - maxMultiplier = (int) Math.floor(max/labelInterval); - } - double m=Math.floor(Math.log10(labelInterval)); - labelIntervalUnit = Math.pow(10., m); - minMultiplier = (int) Math.ceil(min/labelInterval); - maxMultiplier = (int) Math.floor(max/labelInterval); - labelIntervalMultiplier = (int) (labelInterval/labelIntervalUnit); - } - - double primaryInterval, secondaryInterval; - switch (labelIntervalMultiplier) { - case 1: - primaryInterval = labelIntervalUnit * 0.5; - secondaryInterval = labelIntervalUnit * 0.1; - break; - case 2: - primaryInterval = labelIntervalUnit * 1.0; - secondaryInterval = labelIntervalUnit * 0.2; - break; - case 3: - primaryInterval = labelIntervalUnit * 0.2; - secondaryInterval = labelIntervalUnit * 0.1; - break; - case 4: - primaryInterval = labelIntervalUnit * 2.0; - secondaryInterval = labelIntervalUnit * 0.5; - break; - case 5: - primaryInterval = labelIntervalUnit * 1.0; - secondaryInterval = labelIntervalUnit * 0.5; - break; - default: // Should not happen - primaryInterval = labelIntervalUnit * 0.5; - secondaryInterval = labelIntervalUnit * 0.1; - } - return new double[] {labelInterval, primaryInterval, secondaryInterval}; - } - - /** - * Get array of multiples of the given interval that lie in the given range. - * @param minValue minimum value on scale - * @param maxValue maximum value on scale - * @param labelInterval interval between values - * @return array of calculate values - */ - static double[] getScaleValues(double minValue, double maxValue, - double interval) { - int min = (int) Math.ceil(minValue/interval); - int max = (int) Math.floor(maxValue/interval); - int numValues = 1 + max - min; - double[] values = new double[numValues]; - for (int i=0; i<numValues; ++i) { - values[i] = (min + i) * interval; - } - return values; - } - - /** - * Rounds number towards zero to nearest "round number", i.e. a power of ten - * multiplied by 1, 2 or 5. - * - * @param d number to round - * @return next round number towards zero from input - */ - static double getRoundNumber(double d) { - double magnitude = Math.abs(d); - double m=Math.floor(Math.log10(magnitude)); - double unit = Math.pow(10., m); - double multIn = magnitude / unit; - double multOut; - if (multIn >= 5.0) multOut = 5.0; - else if (multIn >= 2.0) multOut = 2.0; - else multOut = 1.0; - double magRound = unit * multOut; - double round; - if (d<0.0) round = -magRound; - else round = magRound; - return round; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/AScaleBorder.java b/graphics/AtlantisJava/src/atlantis/canvas/AScaleBorder.java deleted file mode 100755 index 8610ee38bfa55cee552847b4b0a56a3d7c213547..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/AScaleBorder.java +++ /dev/null @@ -1,1282 +0,0 @@ -package atlantis.canvas; - -import atlantis.graphics.AAbstractGraphics2D; -import atlantis.graphics.ACursorFactory; - -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Component; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.Rectangle; -import java.awt.Stroke; -import java.awt.Image; -import java.awt.geom.AffineTransform; -import java.awt.geom.NoninvertibleTransformException; -import java.awt.geom.Point2D; - -import javax.swing.border.Border; - -import atlantis.gui.APreferencesControl; -import atlantis.parameters.AEnumeratorParameter; -import atlantis.parameters.ALinkParameter; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.projection.AProjectionEventInfo; -import atlantis.projection.AProjectionNGE; -import atlantis.projection.AProjectionTrackResidual; -import atlantis.utils.AMath; -import java.awt.RenderingHints; - -/** - * This class implements a Border in which the left and bottom sides contain - * numerical scales. - * - * @author Charles Loomis, Sebastian Boeser - */ -public class AScaleBorder implements Border -{ - // Constants giving horizontal and vertical index of the data arrays. - final static private int HORIZONTAL = 0; - final static private int VERTICAL = 1; - - /** - * Constant describing a transform in which the transformed x and y axes are - * parallel (or antiparallel) to the original axes. - */ - final static public int TYPE_PARALLEL_TRANSFORM = 0; - - /** - * Constant describing a transform in which the transformed x and y axes are - * parallel (or antiparallel) to the original y and x axes, respectively. - */ - final static public int TYPE_SWITCHED_TRANSFORM = 1; - - /** - * Constant describing a transform in which the transformed x-axis is - * parallel (or antiparallel) to the original x-axis and the transformed - * y-axis forms a non-zero angle with the original one. - */ - final static public int TYPE_X_SKEW_TRANSFORM = 2; - - /** - * Constant describing a transform in which the transformed y-axis is - * parallel (or antiparallel) to the original y-axis and the transformed - * x-axis forms a non-zero angle with the original one. - */ - final static public int TYPE_Y_SKEW_TRANSFORM = 3; - - /** - * Constant describing a transform in which the transformed x-axis is - * parallel (or antiparallel) to the original y-axis and the transformed - * y-axis forms a non-zero angle with the original x-axis. - */ - final static public int TYPE_SWITCHED_X_SKEW_TRANSFORM = 4; - - /** - * Constant describing a transform in which the transformed y-axis is - * parallel (or antiparallel) to the original x-axis and the transformed - * x-axis forms a non-zero angle with the original y-axis. - */ - final static public int TYPE_SWITCHED_Y_SKEW_TRANSFORM = 5; - - /** - * Constant describing a transform which does not fall into one of the other - * categories. - */ - final static public int TYPE_GENERAL_TRANSFORM = 6; - - /** - * Constant indicating that a string should be aligned vertically with the - * baseline of the text. This is the default in drawString calls which do - * not specify an alignment. - */ - public static final int TEXT_BASELINE = 0; - - /** - * Constant indicating that a string should be aligned vertically with the - * top of the text. - */ - public static final int TEXT_TOP = 1; - - /** - * Constant indicating that a string should be aligned vertically with the - * bottom of the text. - */ - public static final int TEXT_BOTTOM = 3; - - /** - * Constant indicating that a string should be aligned by the center. This - * is used for both horizontal and vertical alignment. - */ - public static final int TEXT_CENTER = 2; - - /** - * Constant indicating that a string should be aligned horizontally with the - * left side of the text. This is the default for drawString calls which do - * not specify an alignment. - */ - public static final int TEXT_LEFT = 1; - - /** - * Constant indicating that the string should be aligned horizontally with - * the right side of the text. - */ - public static final int TEXT_RIGHT = 3; - - private AScale horizontalScale; // holds tick marks and labels - private AScale verticalScale; - - /** - * String giving the axis labels. - */ - private String[] axisLabels = new String[2]; - - /** - * String giving the axis units. - */ - private String[] axisUnits = new String[2]; - - /** - * The initial font size for labeling. - */ - private int fontSize = 12; - - /** - * The initial font to use. - */ - private Font labelFont = new Font("SansSerif", Font.BOLD, 12); - - /** - * The width of the line used for the secondary tick marks. - */ - final static private Stroke thinStroke = new BasicStroke(1.f); - - /** - * The width of the line used for the primary tick marks. - */ - final static private Stroke thickStroke = new BasicStroke(2.f); - - /** - * An array to hold temporary point values for transformation. - */ - private double[] axisPts = new double[6]; - - /** - * Flag to indicate that the scale has changed and that it needs to be - * redrawn. - */ - private boolean scaleChanged; - - - /** - * The current width of the horizontal scale. - */ - private int currentWidth; - - /** - * The current width of the vertical scale. - */ - private int currentHeight; - - /** - * Minimum value on the horizontal axis. - */ - private double minHoriz; - - /** - * Maximum value of the horizontal axis. - */ - private double maxHoriz; - - /** - * Minimum value of the vertical axis. - */ - private double minVert; - - /** - * Maximum value on the vertical axis. - */ - private double maxVert; - - /** - * The calculated Insets for this border. - */ - private Insets insets; - - private boolean selected; - - /** - * Wether to draw the scales for this window or not - */ - private boolean drawScaleBorder; - - /** - * Wether to draw the scales for this window or not - * independant of the projection being displayed - */ - private boolean drawScaleBorder_preference; - - - /** - * The window this scale is drawn in. - */ - private final AWindow aWindow; - - /** - * Constructs a AScaleBorder - * @param theWindow the window this scale belongs to - */ - public AScaleBorder(AWindow theWindow) - { - aWindow = theWindow; - - // Give default values for the size of the axes. - minHoriz = 0.; - maxHoriz = 0.; - minVert = 0.; - maxVert = 0.; - - // Make the new insets. - resetInsets(); - - // Set the current width and height. - currentWidth = 0; - currentHeight = 0; - scaleChanged = false; - - selected = false; - drawScaleBorder = true; - drawScaleBorder_preference = true; - } - - public void forceDraw() - { - scaleChanged = true; - } - - public void toggleScale() - { - drawScaleBorder_preference = !drawScaleBorder_preference; - //only actually toggle scale if on a window with scale - AProjection p = aWindow.getProjection(); - - if(p instanceof AProjectionLegoPlot || p instanceof AProjectionNGE || p instanceof AProjectionEventInfo) - return; - - drawScaleBorder = !drawScaleBorder; - scaleChanged = true; - resetInsets(); - } - - public void hideScale() - { - //upon window change of projection check if scales need to hide or not - AProjection p = aWindow.getProjection(); - - // Check global 'Hide Scales' option (in preferences menu) - // If hiding scales, set all scales to false - // - if(APreferencesControl.getHideScalesMenuItem()) - { - drawScaleBorder=false; - resetInsets(); - } - else - if(p instanceof AProjectionLegoPlot || p instanceof AProjectionNGE || p instanceof AProjectionEventInfo){ - if(drawScaleBorder){ - drawScaleBorder=false; - resetInsets(); - } - }else if(drawScaleBorder!=drawScaleBorder_preference){ - drawScaleBorder=drawScaleBorder_preference; - resetInsets(); - } - } - - public boolean getScaleStatus() - { - return drawScaleBorder_preference; - } - - /** - * Set the font for the labels. - */ - public void setLabelFont(Font labelFont) - { - this.labelFont = labelFont; - fontSize = labelFont.getSize(); - resetInsets(); - } - - public void setSelected() - { - selected = true; - } - - public void setDeselected() - { - selected = false; - } - - /** - * Get the current font for the labels. - */ - public Font getLabelFont() - { - return labelFont; - } - - /** - * Set the horizontal and vertical limits for the scales. - */ - public void setLimits(double minHoriz, double maxHoriz, double minVert, double maxVert) - { - this.minHoriz = minHoriz; - this.maxHoriz = maxHoriz; - this.minVert = minVert; - this.maxVert = maxVert; - scaleChanged = true; - } - - /** - * Set the axis labels. - */ - public void setAxisLabels(String horizontalLabel, String verticalLabel) - { - axisLabels[HORIZONTAL] = horizontalLabel; - axisLabels[VERTICAL] = verticalLabel; - } - - public String getHorizontalAxisLabel() - { - return axisLabels[HORIZONTAL]; - } - - public String getVerticalAxisLabel() - { - return axisLabels[VERTICAL]; - } - - /** - * Set the axis units. - */ - public void setAxisUnits(String horizontalUnits, String verticalUnits) - { - if (horizontalUnits != null) - { - axisUnits[HORIZONTAL] = horizontalUnits; - } - else - { - axisUnits[HORIZONTAL] = ""; - } - - if (verticalUnits != null) - { - axisUnits[VERTICAL] = verticalUnits; - } - else - { - axisUnits[VERTICAL] = ""; - } - } - - /** - * Returns the insets of this border. - */ - @Override - public Insets getBorderInsets(Component c) - { - return (Insets) insets.clone(); - } - - /** - * Returns whether or not the border is opaque. This always returns true. - */ - @Override - public boolean isBorderOpaque() {return true;} - - /** - * Paints the border and window decorations for the specified component with the specified graphics - * context, position, and size. - */ - @Override - public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) - { - //Get the graphics context - Graphics2D vg = (Graphics2D) g; - //Sanity check - if (vg==null) return; - - //Select background and frame colors - Color bg = AWindow.BORDER_BACKGROUND_COLOR ; - - //Paint the border frame - paintBorderFrame(vg,bg,width,height); - - //If drawing the border draw scales - if (drawScaleBorder) - { - //Now check which projection we have - AProjection p = aWindow.getProjection(); - - // Set the flag indicating that the scales must be remade. - scaleChanged = (scaleChanged || width != currentWidth || height != currentHeight); - - //set the Scales - setScales(p.getXLabel(), p.getYLabel(), p.getXUnits(), p.getYUnits(), makeTransform(aWindow.getUserCorners()), aWindow.getWidth(), aWindow.getHeight()); - - //Paint the grid if there is one for this projection - paintGrid(vg,p,width,height); - - //Paint the scales themselves - paintScales(vg,p,width,height); - - // Reset the current width and height. - currentWidth = width; - currentHeight = height; - scaleChanged = false; - } - - //Check whether Window Title needs to be drawn - if(APreferencesControl.getWindowTitleMenuItem()) { - paintWindowTitle(g, width, height,true); - } - - //Check whether FishEye Indicator needs to be drawn - if(APreferencesControl.getFisheyeIndicatorMenuItem()) { - paintFishEyeIndicator(g, false, width, height); - } - } - - /** - * Paints the part of the border that appears when the window is printed - */ - void printBorder(Component c, Graphics g, int x, int y, int width, int height) - { - paintBorder(c,g,x,y,width,height); - } - - - /** - * Draw the part of the scales that shows up in printing - */ - private void paintScales(Graphics2D g, AProjection p, int width, int height){ - APar parameterStore = APar.instance(); - - // Make our own graphics contex, so we don't cause trouble elsewhere - Graphics2D svg = (Graphics2D) g.create(); - - Color foregroundColour = selected ? AWindow.BORDER_SELECTED_FOREGROUND_COLOR : AWindow.BORDER_FOREGROUND_COLOR; - - // Get the horizontal scale. - if (scaleChanged) - { - int scaleLength = width - (insets.left + insets.right); - horizontalScale = AScale.calculateScale(minHoriz, maxHoriz, scaleLength, 3, 7, AScale.RIGHT_TICKS, - HORIZONTAL, p); - } - - svg.translate(insets.left, height - insets.bottom + 2); - - svg.setColor(foregroundColour); - svg.setFont(new Font("SansSerif", Font.BOLD, 12)); - - // Draw the primary and secondary tick marks. - svg.setStroke(thickStroke); - svg.draw(horizontalScale.primaryTicks); - svg.setStroke(thinStroke); - svg.draw(horizontalScale.secondaryTicks); - - ScaleUnits hScaleUnits = new ScaleUnits(axisUnits[HORIZONTAL],minHoriz,maxHoriz); - double factorH = hScaleUnits.scaleFactor; - String unitsH = hScaleUnits.units; - - ScaleUnits vScaleUnits = new ScaleUnits(axisUnits[VERTICAL],minVert,maxVert); - double factorV = vScaleUnits.scaleFactor; - String unitsV = vScaleUnits.units; - - // Paint the tick labels. - int numLabelsH = horizontalScale.labelValues.length; - for (int i = 0; i < numLabelsH; i++) - { - double valueScaled = horizontalScale.labelValues[i] * factorH; - int nDecPlaces = getNumDecimalPlaces(valueScaled); - String label = String.format("%."+nDecPlaces+"f", valueScaled); - drawString(svg, label, - (float) horizontalScale.labelPositions[i], AScale.getPrimaryTickSize() + 0.2f * fontSize, TEXT_CENTER, TEXT_TOP, width - insets.left - insets.right); - } - - // Paint the axis label. - float axisPositionX = (float) horizontalScale.getTitlePosition(); - drawString(svg, axisLabels[HORIZONTAL] + " " + unitsH, axisPositionX, AScale.getPrimaryTickSize() + 0.2f * fontSize, TEXT_CENTER, TEXT_TOP, width - insets.left - insets.right); - - // End this context. - svg.dispose(); - - // Now create a new graphics context for the vertical axis. - svg = (Graphics2D) (g.create()); - - // Create the vertical scale. - if (scaleChanged) - { - int scaleLength = height - (insets.top + insets.bottom); - verticalScale = AScale.calculateScale(minVert, maxVert, scaleLength, 3, 7, AScale.LEFT_TICKS, - VERTICAL, p); - } - - svg.translate(insets.left - 2, height - insets.bottom); - svg.rotate(-Math.PI / 2.); - - svg.setColor(foregroundColour); - svg.setFont(new Font("SansSerif", Font.BOLD, 12)); - - // Draw the primary and secondary tick marks. - svg.setStroke(thickStroke); - svg.draw(verticalScale.primaryTicks); - svg.setStroke(thinStroke); - svg.draw(verticalScale.secondaryTicks); - - // Paint the tick labels. - int numLabelsV = verticalScale.labelValues.length; - for (int i = 0; i < numLabelsV; i++) - { - double valueScaled = verticalScale.labelValues[i] * factorV; - int nDecPlaces = getNumDecimalPlaces(valueScaled); - String label = String.format("%."+nDecPlaces+"f", valueScaled); - if(p instanceof AProjectionTrackResidual && parameterStore.get("TrackResidual", "Scale").getI() == 1) - { - if(!label.equals("0")) - { - long tmp = Math.round(((AProjectionTrackResidual)p).getResidual().getLogMagnitudeMin() + Math.abs(Double.parseDouble(label))); - if(label.indexOf("-") == -1) //positive - label = "1E" + tmp; - else - label = "-1E" + tmp; - } - } - drawString(svg, label, (float) verticalScale.labelPositions[i], -(AScale.getPrimaryTickSize() + 0.2f * fontSize), TEXT_CENTER, TEXT_BOTTOM, height - insets.top - insets.bottom); - } - - // Paint the axis label. - float axisPositionY = (float) verticalScale.getTitlePosition(); - drawString(svg, axisLabels[VERTICAL] + " " + unitsV, axisPositionY, -(AScale.getPrimaryTickSize() + 0.2f * fontSize), TEXT_CENTER, TEXT_BOTTOM, height - insets.top - insets.bottom); - - // End this context. - svg.dispose(); - - } - - /** - * Calculate number of decimal places needed in formatting number. - * @param x number to format - * @return number of decimal places needed - */ - static int getNumDecimalPlaces(double x) { - int m = - (int) Math.floor(Math.log10(Math.abs(x))); - return Math.max(0, m); - } - - /** - * Draw the grid for the V-Plot - **/ - private void paintGrid(Graphics2D g, AProjection p, int width, int height){ - - // Make our own graphics contex, so we don't cause trouble elsewhere - Graphics2D svg = (Graphics2D) g.create(); - - // next part draws the grid for the V-plot - if (p.getName().equals("VP")) - { - //Set color for grid lines - svg.setColor(Color.LIGHT_GRAY); - - // eta grid projections values - these particular values - // will be useful for calo people to see the eta grid lines at - float[] etaGridPositions = { -4.9f, -3.2f, -2.5f, -1.375f, -0.8f, - 0.8f, 1.375f, 2.5f, 3.2f, 4.9f }; - - for(int i = 0; i < etaGridPositions.length; i++) - { - if (etaGridPositions[i] > minHoriz && etaGridPositions[i] < maxHoriz) { - Point2D.Double startp = aWindow.calculateDisplay(etaGridPositions[i],minVert); - Point2D.Double endp = aWindow.calculateDisplay(etaGridPositions[i],maxVert); - svg.drawLine((int)startp.x,(int)startp.y,(int)endp.x,(int)endp.y); - } - } - - for (int i = (int)Math.ceil(minVert/90.)*90; i <= maxVert; i += 90) - { - Point2D.Double startp = aWindow.calculateDisplay(minHoriz,i); - Point2D.Double endp = aWindow.calculateDisplay(maxHoriz,i); - if (Math.abs(i) % 360 == 0) { - svg.setColor(Color.WHITE); - svg.setStroke(thickStroke); - } else { - svg.setColor(Color.LIGHT_GRAY); - svg.setStroke(thinStroke); - } - svg.drawLine((int)startp.x,(int)startp.y,(int)endp.x,(int)endp.y); - } - } - - svg.dispose(); - - } - - /** - * This bit of the frame that is drawn when printing (appart from scales) - */ - private void printBorderFrame(Graphics2D g, Color bg, int width, int height){ - - // Make our own graphics contex, so we don't cause trouble elsewhere - Graphics2D svg = (Graphics2D) g.create(); - - svg.setColor(bg); - //simply draw rectangles all around window - svg.fillRect(0, 0, width, insets.top); - // Added -insets.bottom because sometimes this stuff is transparent -Adam - svg.fillRect(0, 0, insets.left, height - insets.bottom); - svg.fillRect(width - insets.right, 0, insets.right, height); - svg.fillRect(0, height - insets.bottom, width, insets.bottom); - - svg.dispose(); - } - - /** - * Paint the Frame of the border with the given colors - */ - private void paintBorderFrame(Graphics2D g, Color bg, int width, int height){ - //Draw the frame same as for printing - printBorderFrame(g,bg,width,height); - - // Make our own graphics contex, so we don't cause trouble elsewhere - Graphics2D svg = (Graphics2D) g.create(); - - // Add a bit of GUI-look-and-feel frame - if (selected){ - //white triangle bottom left corner - clears any background colour - svg.setColor(AWindow.BORDER_SELECTED_FRAMELIGHT_COLOR); - int xp[]={0,0,11,0}; - int yp[]={height-12,height,height,height-12}; - svg.fillPolygon(xp,yp,4); - //blue border around window - svg.setColor(AWindow.BORDER_SELECTED_FRAME_COLOR); - svg.drawLine(0, 0, width-1, 0); - svg.drawLine(0, 0, 0, height-10); - svg.drawLine(width-1, 0, width-1, height-1); - svg.drawLine(10, height-1, width-1, height-1); - svg.drawLine(0, height-10, 9, height-1); - //white inner border - svg.setColor(AWindow.BORDER_SELECTED_FRAMELIGHT_COLOR); - svg.drawLine(10, height-2, width-2, height-2); - svg.drawLine(1, 1, 1, height-10); - //grey triangle bottom left corner - svg.setColor(AWindow.BORDER_BACKGROUND_COLOR); - xp[2]=8; - yp[0]=height-9; - yp[3]=height-9; - svg.fillPolygon(xp,yp,4); - } - - svg.dispose(); - } - - /** - * Paint a small box at the top of each window to describe what is on the window - */ - private void paintWindowTitle(Graphics g, int width, int height, boolean highlight) - { - APar parameterStore = APar.instance(); - - // Make our own graphics contex, so we don't cause trouble elsewhere - Graphics2D svg = (Graphics2D) g.create(); - //Get Mode parameter - String s=aWindow.getProjection().getName(); - parameterStore.selectWindowParameters(aWindow.getName()); - AParameter param=parameterStore.get(s, "Mode"); - int mode=param.getI(); - s=aWindow.getProjection().getScreenName(); - s+=" Projection"; - //Add mode text if not on standard view - if (param != null) - { - if(mode != 0) - { - s+=" viewing: "; - if(param instanceof ALinkParameter){ - s+=((ALinkParameter) param).getCurrentText(); - }else{ - s+=((AEnumeratorParameter) param).getCurrentText(); - } - } - } - parameterStore.restoreWindowParameters(); - //Offset if indicator to window frame - int Offset=2; - - int boxsize,y; - // get the width of the text - boxsize = svg.getFontMetrics().stringWidth(s)+Offset*2; - //Get y position from offset - y = Offset+svg.getFontMetrics().getHeight(); - - //Get the x position from width of window - int x = insets.left + (int) Math.round(((width-insets.left-boxsize)/2.0)); - //Draw background box and set text color - //highlighting the active window if desired - if(selected&&highlight) - { - //If selected and not printing eps - //add a bit of GUI-look-and-feel frame - svg.setColor(AWindow.BORDER_SELECTED_BACKGROUND_COLOR); - svg.fillRect(x-2, 1, boxsize+4, y+1); - svg.setColor(AWindow.BORDER_SELECTED_FRAME_COLOR); - svg.fillRect(x-1, 0, boxsize+2, y+1); - svg.setColor(AWindow.BORDER_SELECTED_FRAMELIGHT_COLOR); - svg.fillRect(x, 1, boxsize, y-1); - svg.setColor(AWindow.BORDER_SELECTED_BACKGROUND_COLOR); - svg.fillRect(x+1, 1, boxsize-1, y-2); - svg.setColor(AWindow.BORDER_SELECTED_FOREGROUND_COLOR); - } - else - { - //If not selected draw background box - svg.setColor(AWindow.BORDER_BACKGROUND_COLOR); - svg.fillRect(x-2, 0, boxsize+4, y+2); - svg.setColor(AWindow.BORDER_FOREGROUND_COLOR); - } - //Draw text - svg.drawString(s, x+Offset, y-3); - //cleanup - svg.dispose(); - } - - /** - * Paint a small FishEye Indicator if FishEye projection is active. - * At the moment, the indicator is drawn in the top right corner of the canvas. - * One might as well put it in on the scale. Eventually, if the scales shows - * proper fisheyed coordinates, it might not be needed anymore at all. - */ - private void paintFishEyeIndicator(Graphics g, boolean forceText, int width, int height){ - APar parameterStore = APar.instance(); - - //Probe for fishEye status - boolean fishEyeStatus=false; - - //Check if FishEye is on for this particular window - parameterStore.selectWindowParameters(aWindow.getName()); - - //Get FishEye parameter - AParameter fishEyePar = parameterStore.get(aWindow.getProjection().getName(), "FishEye"); - - //Check if there is a fish-eye parameter for this projection, and get status (enabled or not) - if (fishEyePar != null) fishEyeStatus=fishEyePar.getStatus(); - - //Restore to active window - parameterStore.restoreWindowParameters(); - - // Now draw indicator if fisheye was on - if (fishEyeStatus){ - - // Make our own graphics contex, so we don't cause trouble elsewhere - Graphics2D svg = (Graphics2D) g.create(); - //Offset if indicator to window frame - int Offset=4; - //Check if we have custom cursors - only then use indicator image - if (!forceText ){ - //FishEye indicator image is provided by ACursorFactory as it is the same - //as the cursor used in FishEye transformation. - Image IndicatorImg = ACursorFactory.getInstance().getFishEyeIndicator(); - //Get the x position from width of window and width of image - int x = width-Offset-IndicatorImg.getWidth(null); - //Get y position from offset - int y = Offset; - //Draw an fisheye indicator in top right corner with some space - svg.drawImage(IndicatorImg,x,y,null); - } else { - int x,y; - //Get the x position from width of window and width of image - x = width-Offset-svg.getFontMetrics().stringWidth("FishEye"); - //Get y position from offset - y = Offset+svg.getFontMetrics().getHeight(); - //Set color to red - svg.setColor(Color.red); - //Use small label to indicate fisheye - svg.drawString("FishEye",x,y); - - } - //cleanup - svg.dispose(); - } - } - - /** - * Recalculate the insets based on the current font size. - */ - private void resetInsets() - { - int lb = (int) (2 + 2 + AScale.getPrimaryTickSize() + 1.5 * fontSize); - // int tr = (int) (2+2+AScale.getPrimaryTickSize()); - int tr = 2; - - if (drawScaleBorder) - insets = new Insets(tr, lb, lb, tr); - else - insets = new Insets(tr, tr, tr, tr); - } - - /** - * Set the scale labels taking into account the given linear transformation. - */ - public void setScales(String horizLabel, String vertLabel, String horizUnits, String vertUnits, AffineTransform transform, int panelWidth, int panelHeight) - { - - // Determine the type of the tranform. - int type = classifyTransform(transform); - - switch (type) - { - case TYPE_PARALLEL_TRANSFORM: - setAxisLabels(horizLabel, vertLabel); - setAxisUnits(horizUnits, vertUnits); - break; - - case TYPE_SWITCHED_TRANSFORM: - setAxisLabels(vertLabel, horizLabel); - setAxisUnits(vertUnits, horizUnits); - break; - - case TYPE_Y_SKEW_TRANSFORM: - setAxisLabels(horizLabel + AMath.PRIME, AMath.DELTA + vertLabel); - if (horizUnits.equals(vertUnits)) - { - setAxisUnits(horizUnits, vertUnits); - } - else - { - setAxisUnits(horizUnits + AMath.DOT + vertUnits, vertUnits); - } - break; - - case TYPE_X_SKEW_TRANSFORM: - setAxisLabels(AMath.DELTA + horizLabel, vertLabel + AMath.PRIME); - if (vertUnits.equals(horizUnits)) - { - setAxisUnits(horizUnits, vertUnits); - } - else - { - setAxisUnits(horizUnits, vertUnits + AMath.DOT + horizUnits); - } - break; - - case TYPE_SWITCHED_Y_SKEW_TRANSFORM: - setAxisLabels(vertLabel + AMath.PRIME, AMath.DELTA + horizLabel); - if (vertUnits.equals(horizUnits)) - { - setAxisUnits(vertUnits, horizUnits); - } - else - { - setAxisUnits(vertUnits + AMath.DOT + horizUnits, horizUnits); - } - break; - - case TYPE_SWITCHED_X_SKEW_TRANSFORM: - setAxisLabels(AMath.DELTA + vertLabel, horizLabel + AMath.PRIME); - if (horizUnits.equals(vertUnits)) - { - setAxisUnits(vertUnits, horizUnits); - } - else - { - setAxisUnits(vertUnits, horizUnits + AMath.DOT + vertUnits); - } - break; - - default: - setAxisLabels(horizLabel + AMath.PRIME, vertLabel + AMath.PRIME); - if (horizUnits.equals(vertUnits)) - { - setAxisUnits(horizUnits, vertUnits); - } - else - { - setAxisUnits(horizUnits + AMath.DOT + vertUnits, vertUnits + AMath.DOT + horizUnits); - } - break; - } - - // Get the size of the scales. - axisPts[0] = 0.; - axisPts[1] = panelHeight; - axisPts[2] = 0.; - axisPts[3] = panelHeight; - axisPts[4] = panelWidth; - axisPts[5] = 0.; - try - { - // Avoid using the following call because of a bug in - // AffineTransform. Instead create the inverse matrix - // explicitly as done below. - // transform.inverseTransform(physicsPt,0,physicsPt,0,3); - AffineTransform ixform = transform.createInverse(); - - ixform.transform(axisPts, 0, axisPts, 0, 1); - ixform.deltaTransform(axisPts, 2, axisPts, 2, 2); - - // Calculate the values for the vertical axis and the distance. - double vdy = axisPts[3]; - double vdx = axisPts[2]; - double vdist = Math.sqrt(vdx * vdx + vdy * vdy); - - // Calculate the values for the horizontal axis and the distance. - double hdy = axisPts[5]; - double hdx = axisPts[4]; - double hdist = Math.sqrt(hdx * hdx + hdy * hdy); - - // Initialize the endpoints of the axes. - double vmin = 0.; - double vmax = 0.; - double hmin = 0.; - double hmax = 0.; - - // Do what is necessary for the different types of transformations. - switch (type) - { - case (TYPE_PARALLEL_TRANSFORM): - { - double vsign = (vdy < 0.) ? 1. : -1.; - - vmin = axisPts[1]; - vmax = axisPts[1] + vsign * vdist; - - double hsign = (hdx > 0.) ? 1. : -1.; - - hmin = axisPts[0]; - hmax = axisPts[0] + hsign * hdist; - break; - } - - case (TYPE_SWITCHED_TRANSFORM): - { - double hsign = (hdy > 0.) ? 1. : -1.; - - hmin = axisPts[1]; - hmax = axisPts[1] + hsign * hdist; - - double vsign = (vdx < 0.) ? 1. : -1.; - - vmin = axisPts[0]; - vmax = axisPts[0] + vsign * vdist; - break; - } - - case (TYPE_Y_SKEW_TRANSFORM): - { - double vsign = (vdy > 0.) ? 1. : -1.; - - vmax = -vsign * vdist / 2.; - vmin = -vmax; - - hmin = 0.; - hmax = hdist; - break; - } - - case (TYPE_X_SKEW_TRANSFORM): - { - double hsign = (hdx > 0.) ? 1. : -1.; - - hmax = hsign * hdist / 2.; - hmin = -hmax; - - vmin = 0.; - vmax = vdist; - break; - } - - case (TYPE_SWITCHED_Y_SKEW_TRANSFORM): - { - double vsign = (vdx > 0.) ? 1. : -1.; - - vmax = -vsign * vdist / 2.; - vmin = -vmax; - - hmin = 0.; - hmax = hdist; - break; - } - - case (TYPE_SWITCHED_X_SKEW_TRANSFORM): - { - double hsign = (hdy > 0.) ? 1. : -1.; - - hmax = hsign * hdist / 2.; - hmin = -hmax; - - vmin = 0.; - vmax = vdist; - break; - } - - default: - { - vmin = 0.; - vmax = 0.; - hmin = 0.; - hmax = 0.; - break; - } - } - - // Actually set the limits. - setLimits(hmin, hmax, vmin, vmax); - } - catch (NoninvertibleTransformException e) - { - setLimits(0., 0., 0., 0.); - } - } - - /** - * This is a protected utility method which classifies the given transform - * into seven categories: parallel, switched, x-skew, y-skew, switched - * x-skew, switched y-skew, and general. The parallel category describes - * transformations in which the transformed x and y axes are parallel or - * antiparallel to the original x and y axes, respectively. The switched - * category describes transformations in which the transformed x and y axes - * are parallel or antiparallel to the original y and x axes, respectively. - * That is, the x and y axes have been switched. The x-skew describes - * transformations in which the transformed x-axis is parallel (or - * antiparallel) to the original one while the transformed y-axis forms some - * non-zero angle to the original one. The y-skew is similar; the switch - * skews are just rotated (counter)clockwise by 90 degrees. The general - * category encompasses all transforms not falling into one of the other - * categories. - */ - static protected int classifyTransform(AffineTransform xform) - { - // Set the default return type to a general matrix. - int category = TYPE_GENERAL_TRANSFORM; - - // Get the four non-translation quantities from the transformation. - double sx = xform.getScaleX(); - double sy = xform.getScaleY(); - double kx = xform.getShearX(); - double ky = xform.getShearY(); - - // Check the type. - if (kx == 0. && ky == 0.) - { - category = TYPE_PARALLEL_TRANSFORM; - } - else if (sx == 0. && sy == 0.) - { - category = TYPE_SWITCHED_TRANSFORM; - } - else if (kx == 0.) - { - category = TYPE_Y_SKEW_TRANSFORM; - } - else if (ky == 0.) - { - category = TYPE_X_SKEW_TRANSFORM; - } - else if (sx == 0.) - { - category = TYPE_SWITCHED_Y_SKEW_TRANSFORM; - } - else if (sy == 0.) - { - category = TYPE_SWITCHED_X_SKEW_TRANSFORM; - } - - // Return the transformtion type. - return category; - } - - /** - * A utility which makes an AffineTransform given three corner - * points. The first point must be the upper, left-hand corner - * point, the second, the upper, right-hand corner point, and the - * third, the lower, right-hand corner point. - * - * @return AffineTransform which does the appropriate mapping */ - protected AffineTransform makeTransform(Point2D.Double[] corners) - { - double x0 = corners[0].x; - double y0 = corners[0].y; - double x1 = corners[1].x; - double y1 = corners[1].y; - double x2 = corners[2].x; - double y2 = corners[2].y; - - double sx = 0.; - double kx = 0.; - double tx = 0.; - double sy = 0.; - double ky = 0.; - double ty = 0.; - - double delta = (x2 * (y1 - y0) - x1 * (y2 - y0) + x0 * (y2 - y1)); - - if (delta == 0) - { - // cannot successfully create an AffineTransform - System.err.println("Fatal Error: AffineTransform creating failed."); - System.err.println("Possible cause: wrong user corner values are set."); - System.exit(1); - return null; - } - else - { - delta = 1. / delta; - - double w = aWindow.getWidth(); - double h = aWindow.getHeight(); - - sx = -(delta * w) * (y2 - y1); - kx = (delta * w) * (x2 - x1); - tx = -(x0 * sx + y0 * kx); - - ky = (delta * h) * (y1 - y0); - sy = -(delta * h) * (x1 - x0); - ty = -(x0 * ky + y0 * sy); - - return new AffineTransform(sx, ky, kx, sy, tx, ty); - } - - } - - public void drawString(Graphics2D g, String str, double x, double y, int horizontal, int vertical, int maxSize) - { - drawString(g, str, x, y, horizontal, vertical, false, null, 0, false, null, maxSize); - } - - private void drawString(Graphics2D g, String str, double x, double y, int horizontal, int vertical, boolean framed, Color frameColor, double frameWidth, boolean banner, Color bannerColor, int maxSize) - { - Font sf = g.getFont(); - int width = sf.getSize(); - int descent = 0; - int height = sf.getSize(); - int adjustment = 0; - - // The metrics stuff did not work, so I made a work around and now - // even ps-printing works (CT 27/7/2004) - double xx = Math.min(x, maxSize - width / 2); - Rectangle textSize = new Rectangle(0, descent - height, width, height); - Point2D textUL = drawFrameAndBanner(xx, y, textSize, adjustment, framed, frameColor, frameWidth, banner, bannerColor, horizontal, vertical); - - if (g instanceof AAbstractGraphics2D) { - // No antialiasing support needed for EPS output. - g.drawString(str, (int) textUL.getX(), (int) textUL.getY()); - } else { - // For pixel graphics, switch on antialiasing for text. - g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g.drawString(str, (int) textUL.getX(), (int) textUL.getY()); - g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - } - } - - /** Draws frame and banner around a string. The method calculates and returns - * the point to which the text curser should be set before drawing the string. */ - private Point2D drawFrameAndBanner(double x, double y, Rectangle textSize, int adjustment, boolean framed, Color frameColor, double frameWidth, boolean banner, Color bannerColor, int horizontal, int vertical) - { - double descent = textSize.y + textSize.height; - x = getXalignment(x, textSize.width, horizontal); - y = getYalignment(y, textSize.height, (int) descent, vertical); - return new Point2D.Double(x, y); - } - - private static double getYalignment(double y, int ascent, int descent, int alignment) - { - // vertical alignment - switch (alignment) - { - case TEXT_TOP: - y = y + ascent - descent; - break; - - case TEXT_CENTER: - y = y + ((ascent + descent) / 2) - descent; - break; - - case TEXT_BOTTOM: - y = y - descent; - break; - - case TEXT_BASELINE: - default: - break; - } - return y; - } - - private static double getXalignment(double x, int width, int alignment) - { - // horizontal alignment - switch (alignment) - { - case TEXT_CENTER: - x = x - (width / 2); - break; - - case TEXT_RIGHT: - x = x - width; - break; - - case TEXT_LEFT: - default: - break; - } - return x; - } - - /** - * Encapsulates units and range for an axis. - * Used for m->cm->mm->um autoscaling. - */ - private static class ScaleUnits { - final String units; - final double scaleFactor; - - ScaleUnits(String units, double min, double max) { - double maxMod = Math.max(Math.abs(max), Math.abs(min)); - if (!units.equals("(cm)")) { - this.units = units; - this.scaleFactor = 1.0; - return; - } - else { - if (maxMod > 200.) - { - this.scaleFactor= 0.01; - this.units = "(m) "; - } - else if (maxMod > 2.) - { - this.scaleFactor = 1.0; - this.units = "(cm)"; - } - else if (maxMod > .2) - { - this.scaleFactor = 10.; - this.units = "(mm)"; - } - else - { - this.scaleFactor = 10000.; - this.units = "(" + AMath.MICRO + "m)"; - } - } - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/ATitleMenuBar.java b/graphics/AtlantisJava/src/atlantis/canvas/ATitleMenuBar.java deleted file mode 100755 index 85ad9daab256de493a9ca669c9f36ce0b9402d6b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/ATitleMenuBar.java +++ /dev/null @@ -1,92 +0,0 @@ -package atlantis.canvas; - -import javax.swing.JLabel; -import javax.swing.JMenuBar; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; - -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.graphics.AGraphics; -import atlantis.parameters.APar; - - -public class ATitleMenuBar extends JMenuBar -{ - - public ATitleMenuBar() - { - // just to set the height of the title bar - - JLabel atlas = new JLabel(" Atlantis "); - atlas.setFont(new Font("Courier", Font.PLAIN, 25)); - add(atlas); - } - - @Override - public void paint(Graphics g) - { - AEventManager eventManager = AEventManager.instance(); - AEvent event = eventManager.getCurrentEvent(); - Font titleFont=new Font("Dialog", Font.BOLD, 15); - int availableSpace = (int) Math.floor(getWidth()-10); - FontMetrics fm = ACanvas.getCanvas().getFontMetrics(titleFont); - - AGraphics ag=AGraphics.makeAGraphics(g); - ag.setColor(AWindow.BORDER_BACKGROUND_COLOR); - ag.fillRect(0, 0, getWidth(), getHeight()); - ag.setColor(AWindow.BORDER_FOREGROUND_COLOR); - ag.updateColor(); - ag.setFont(titleFont); - availableSpace -= fm.stringWidth("ATLAS Atlantis"); - ag.drawString("ATLAS ", 5, getHeight()-10); - ag.drawString(" Atlantis", getWidth()-fm.stringWidth(" Atlantis")-5, getHeight()-10); - - String[] titleSections = new String[6]; - if(event != null) - { - titleSections[0] = !event.getDateTime().equals("n/a") ? event.getDateTime() : ""; - titleSections[1] = " source:" + event.getSourceName(); - int extension_dot = titleSections[1].toLowerCase().lastIndexOf("."); - if(extension_dot > 0) - titleSections[1] = titleSections[1].substring(0,extension_dot); - titleSections[2] = " run:" + event.getRunNumber(); - titleSections[3] = " ev:" + event.getEventNumber(); - titleSections[4] = " lumiBlock:" + event.getLumiBlock(); - titleSections[5] = " eventProperties: " + event.getEventProperties(); - } - else - { - titleSections[0]=""; - titleSections[1]=" event:n/a"; - titleSections[2]=" run:n/a"; - titleSections[3]=" ev:n/a"; - titleSections[4]=""; - titleSections[5]=""; - } - - - //for masterclass turn off some of the canvas title parts - APar parameterStore = APar.instance(); - if(parameterStore.get("Minerva","hiderun").getStatus()) - titleSections[2]=""; - if(parameterStore.get("Minerva","hideev").getStatus()) - titleSections[3]=""; - - - StringBuilder outputString = new StringBuilder(); - int titleSectionSize=0; - for(int i=0; i<6; i++) - { - if(titleSectionSize+fm.stringWidth(titleSections[i])<availableSpace) - { - if(!titleSections[i].endsWith("default")){ - titleSectionSize+=fm.stringWidth(titleSections[i]); - outputString.append(titleSections[i]); - } - } - } - ag.drawString(outputString.toString(), (getWidth()-titleSectionSize)/2, getHeight()-10); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/AWindow.java b/graphics/AtlantisJava/src/atlantis/canvas/AWindow.java deleted file mode 100755 index 159623e227c79fbe81e025864ac519a3d2c160c8..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/AWindow.java +++ /dev/null @@ -1,1549 +0,0 @@ -package atlantis.canvas; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.GraphicsEnvironment; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.RenderingHints; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.Transferable; -import java.awt.dnd.DnDConstants; -import java.awt.dnd.DragGestureEvent; -import java.awt.dnd.DragGestureListener; -import java.awt.dnd.DragSource; -import java.awt.dnd.DragSourceDragEvent; -import java.awt.dnd.DragSourceDropEvent; -import java.awt.dnd.DragSourceEvent; -import java.awt.dnd.DragSourceListener; -import java.awt.dnd.DropTarget; -import java.awt.dnd.DropTargetDragEvent; -import java.awt.dnd.DropTargetDropEvent; -import java.awt.dnd.DropTargetEvent; -import java.awt.dnd.DropTargetListener; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.geom.Point2D; -import java.awt.geom.Point2D.Double; -import java.awt.image.BufferedImage; -import java.awt.image.DataBuffer; - -import java.util.Hashtable; -import java.util.LinkedList; -import java.util.Stack; -import java.util.Vector; - -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JSeparator; -import javax.swing.JToolTip; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.dnd.ACallBack; -import atlantis.graphics.dnd.ADnDLabel; -import atlantis.graphics.dnd.AObjectTransferable; -import atlantis.gui.AColorHelpDialog; -import atlantis.gui.AInteractionToolBar; -import atlantis.gui.APreferencesControl; -import atlantis.interactions.AInteraction; -import atlantis.interactions.AInteractionsManager; -import atlantis.interactions.ASelection; -import atlantis.interactions.ARectangleVPSelection; -import atlantis.interactions.ARectangleYXSelection; -import atlantis.interactions.AZMRInteraction; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.APar; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionNPhysics; -import atlantis.projection.AProjectionTrackResidual; -import atlantis.projection.AProjectionsManager; -import atlantis.utils.AMath; - -import atlantis.utils.ALogger; -import java.awt.BorderLayout; -import javax.swing.JComponent; - -/** - * The objects of this class are single windows managed by ACanvas - * This class manages the painting of each picture and is always - * called by the java awt event thread. Programatic requests for - * picture updates are handled by calls to repaintFromScratch() which - * adds requests to the awt event thread. - * It paints first into an off-screen buffer which is then copied - * onto the screen. - * It handles the linear transformation from user to display - * coordinates and vice-versa. Non-linear transformations are handled by - * by the projections. Windows have a scale (and scale border) which - * may be visible or not. Each window has an associated projection - * and an interactionManager which knows about the current interaction - * and the state of all other interactions for this window. - * - * @author taylorg - */ -public class AWindow extends JPanel implements DropTargetListener, - DragSourceListener, DragGestureListener, ACallBack -{ - - private static ALogger logger = ALogger.getLogger(AWindow.class); - private static AGlobals globals = AGlobals.instance(); - - //Whether horizontal or vertical scale is copied when window is dragged - private static enum dragActionType { COPY_VERTICAL_SCALE, COPY_HORIZONTAL_SCALE }; - - //these colors are used on the scale border and title bar - static final Color BORDER_FOREGROUND_COLOR = new Color(48,48,48); - static final Color BORDER_SELECTED_FOREGROUND_COLOR = new Color(48,48,48); - static final Color BORDER_SELECTED_FRAME_COLOR = new Color(99,130,191); - static final Color BORDER_SELECTED_FRAMELIGHT_COLOR = new Color(255,255,255); - // These ones must be public and cannot be final because AOpenGLControl messes with them. - public static Color BORDER_BACKGROUND_COLOR = new Color(224,224,224); - public static Color BORDER_SELECTED_BACKGROUND_COLOR = new Color(200,221,242); - private dragActionType dragAction; - private boolean canCopyScales = false; - private DragSource dragSource = null; - private Graphics2D backingGraphics = null; - private BufferedImage backingImage = null; - private Dimension backingDimension = new Dimension(); - - /** - * The border of the window holds a scale with units - **/ - private AScaleBorder scaleBorder; - - private boolean bufferValid = false; - private boolean borderValid = false; - private Insets insets = new Insets(0, 0, 0, 0); - private double m00, m01, m02, m10, m11, m12, n00, n01, n02, n10, n11, n12; - private AInteractionsManager interactionsManager; - private Hashtable<String, Double[]> corners; - private Point2D.Double[] userCorners; - private Point2D.Double[] defaultCorners; - private AProjection projection; - private String group; - private String defaultGroup; - private String defaultProjectionName; - private int index; - boolean finalized; - private Stack<Point2D.Double[]> cornersHistory = new Stack<Point2D.Double[]>(); - private AProjection projectionHistory = null; - private Stack<Integer> zoomSummed = new Stack<Integer>(); - private Stack<Integer> zoomLayers = new Stack<Integer>(); - private Stack<Integer> zoomCalo = new Stack<Integer>(); - private Stack<Integer> zoomCaloLAr = new Stack<Integer>(); - private Stack<Integer> modeHistory = new Stack<Integer>(); - private Stack<Integer> cutHistoryLAr = new Stack<Integer>(); - private Stack<Integer> cutHistoryHEC = new Stack<Integer>(); - private Stack<Integer> layoutHistory = new Stack<Integer>(); - private boolean locked; - private static JPopupMenu popupMenu; - private final static String LOCK = "Freeze"; - private final static String UNLOCK = "Unfreeze"; - private final static String HORIZONTAL_FLIP = "Horizontal Flip"; - private final static String VERTICAL_FLIP = "Vertical Flip"; - private final static String ROTATE_BY_90_CLOCKWISE = "Rotate by 90"; - private final static String ROTATE_BY_90_ANTICLOCKWISE = "Rotate by -90"; - private final static String TOGGLE_SCALE = "Toggle Scale"; - private final static String RESTORE_DEFAULTS = "Restore Initial Size"; - - private JComponent m_view = null; - - static - { - popupMenu = new JPopupMenu(); - ActionListener actionListener = new PopupMenuActionListener(); - popupMenu.add(HORIZONTAL_FLIP).addActionListener(actionListener); - popupMenu.add(VERTICAL_FLIP).addActionListener(actionListener); - popupMenu.add(new JSeparator()); - popupMenu.add(ROTATE_BY_90_CLOCKWISE).addActionListener(actionListener); - popupMenu.add(ROTATE_BY_90_ANTICLOCKWISE).addActionListener( - actionListener); - popupMenu.add(new JSeparator()); - popupMenu.add(TOGGLE_SCALE).addActionListener(actionListener); - popupMenu.add(RESTORE_DEFAULTS).addActionListener(actionListener); - popupMenu.add(LOCK).addActionListener(actionListener); - popupMenu.add(UNLOCK).addActionListener(actionListener); - } - - - private static class PopupMenuActionListener - implements ActionListener - { - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - AWindow window = ACanvas.getCanvas().getCurrentWindow(); - if(action.equals(LOCK)) - { - window.setLocked(true); - } - else if(action.equals(UNLOCK)) - { - window.setLocked(false); - } - else if(action.equals(TOGGLE_SCALE)) - { - window.toggleScale(); - } - // temporary fix to avoid crashes - if(window.getProjection() instanceof AProjection2D) - { - if(action.equals(RESTORE_DEFAULTS)) - { - window.unzoomFull(); - } - else if(action.equals(HORIZONTAL_FLIP)) - { - AZMRInteraction.performFlip(AZMRInteraction. - getMiddleVerticalLine(window), - window); - } - else if(action.equals(VERTICAL_FLIP)) - { - AZMRInteraction.performFlip(AZMRInteraction. - getMiddleHorizontalLine(window), - window); - } - else if(action.equals(ROTATE_BY_90_CLOCKWISE)) - { - AZMRInteraction.performPlus90Rotation(window); - } - else if(action.equals(ROTATE_BY_90_ANTICLOCKWISE)) - { - AZMRInteraction.performMinus90Rotation(window); - } - } - } - } - - /** - * Construct AWindow using information in XML configuration file. - * - * @param node the XML configuration node for this window - * @param index identifier for the window - * @return the constructed window - */ - static AWindow createFromXMLConfigNode(Node node, int index) { - NamedNodeMap attributes = node.getAttributes(); - String name = attributes.getNamedItem("name").getNodeValue(); - String defaultProjectionName = attributes.getNamedItem("projection"). - getNodeValue(); - String defaultGroup = attributes.getNamedItem("group").getNodeValue(); - return new AWindow(name,defaultProjectionName,defaultGroup,index); - } - - /** - * Construct AWindow with given name, default projection and group name. - * Only non-private in order to allow test code to create an AWindow instance. - * - * @param name title of window - * @param defaultProjection name of default projection - * @param defaultGroup name of group - * @param index identifier for window - */ - AWindow(String name, String defaultProjection, String defaultGroup, int index) - { - super(new BorderLayout()); - setName(name); - this.defaultProjectionName = defaultProjection; - this.defaultGroup = defaultGroup; - setOpaque(false); - if (!globals.getUseOpenGL()) { - m_view = new AWindowSwingView(this); - } else { - m_view = new AWindowGLView(this); - } - this.index = index; - scaleBorder = new AScaleBorder(this); - scaleBorder.setLabelFont(new Font("Dialog", Font.PLAIN, 12)); - m_view.setBorder(scaleBorder); - add(m_view, BorderLayout.CENTER); - finalized = false; - - if (!AGlobals.isAtlantisHeadless()) { - dragSource = new DragSource(); - dragSource.createDefaultDragGestureRecognizer(this, - DnDConstants.ACTION_MOVE, this); - - this.setDropTarget(new DropTarget(this, this)); - } - } - - /** - * Perform the steps that have to follow the ACanvas initialization. - * Despite its name, this method is called from ACanvas.setCurrentLayout() - * so may be called multiple times on the same window. - */ - void finalizeConstruction() - { - setInteractionManager(new AInteractionsManager(this)); - corners = new Hashtable<String, Double[]>(); - String[] pName = AProjectionsManager.getKnownProjectionNames(); - Point2D.Double[] pCorners; - ALayout l = ACanvas.getCanvas().getCurrentLayout(); - Dimension size = l.getWindowConstraints(getName()).getSize(); - for(int i = 0; i < pName.length; i++) - { - AProjection proj = AProjectionsManager.getProjection(pName[i]); - if(proj instanceof AProjection2D) - { - pCorners = ((AProjection2D) proj).calculateNoZoomCorners(size); - corners.put(pName[i], pCorners); - } - } - AProjection defaultProjection = AProjectionsManager.getProjection( - defaultProjectionName); - setGroup(defaultGroup); - setProjection(defaultProjection); - - if (!AGlobals.isAtlantisHeadless()) { - interactionsManager.setContext(getInteractionToolBar().getSelectedGroup()); - } - - finalized = true; - } - - - void restoreDefaults() - { - if(finalized) - { - corners = new Hashtable<String, Double[]>(); - String[] pName = AProjectionsManager.getKnownProjectionNames(); - Point2D.Double[] pCorners; - ALayout l = ACanvas.getCanvas().getCurrentLayout(); - Rectangle r = l.getWindowConstraints(getName()); - Dimension size = new Dimension(1, 1); - if(r != null) - size = r.getSize(); - for(int i = 0; i < pName.length; i++) - { - AProjection proj = AProjectionsManager.getProjection(pName[i]); - if(proj instanceof AProjection2D) - { - if(pName[i].equals(defaultProjectionName) && defaultCorners != null) - pCorners = getDefaultCorners(); - else - pCorners = ((AProjection2D) proj).calculateNoZoomCorners(size); - corners.put(pName[i], pCorners); - } - } - AProjection defaultProjection = AProjectionsManager.getProjection( - defaultProjectionName); - setGroup(defaultGroup); - projection = null; - setProjection(defaultProjection); - getInteractionManager().forgetContext(); - AInteractionToolBar itb = getInteractionToolBar(); - if (itb != null) { - itb.setDefaultGroup(); - interactionsManager.setContext(itb.getSelectedGroup()); - } - setScaleStatus(true); - } - } - - - public boolean isCurrent() - { - return ACanvas.getCanvas().getCurrentWindowName().equals(getName()); - } - - - public static JPopupMenu getPopupMenu() - { - return popupMenu; - } - - - public int getIndex() - { - return index; - } - - - public String getGroupName() - { - return group; - } - - - public void setGroup(String group) - { - this.group = group; - this.fireGroupChange(); - } - - - public synchronized AProjection getProjection() - { - return projection; - } - - - public AInteractionToolBar getInteractionToolBar() - { - return AInteractionToolBar.getInteractionToolBar(getName(), - projection.getName()); - } - - - public synchronized void setProjection(AProjection newProjection) - { - if((projection == null) || (!newProjection.equals(projection)) - || (newProjection instanceof AProjectionTrackResidual) - || (newProjection instanceof AProjectionNPhysics)) - { - if(projection != null && projection instanceof AProjection2D) - corners.put(projection.getName(), userCorners); - this.projection = newProjection; - if(projection instanceof AProjection2D) - userCorners = (Point2D.Double[]) corners.get(projection.getName()); - //check to see if the scales need hiding or not - this.scaleBorder.hideScale(); - this.repaintFromScratch(); - this.fireProjectionChange(); - } - } - - - private Point2D.Double[] clonedCopy(Point2D.Double[] corners) - { - if(corners == null)return null; - Point2D.Double[] newCorners = new Point2D.Double[corners.length]; - for(int i = 0; i < corners.length; i++) - newCorners[i] = new Point2D.Double(corners[i].x, corners[i].y); - return newCorners; - } - - - public synchronized void setUserCorners(Point2D.Double[] corners) - { - if(projection != null) - { - Point2D.Double[] validCorners = null; - try - { - validCorners = ((AProjection2D) projection).validateCorners( - clonedCopy(corners)); - } - catch(ClassCastException e) - { - logger.error("Not a 2D projection..."); - validCorners = corners; - } - if(validCorners != null) - { - this.userCorners = validCorners; - if(ACanvas.getCanvas().customisedCorner) - { - this.defaultCorners = validCorners; - } - repaintFromScratch(); - } - } - } - - - public boolean getUnzoomPossible() - { - if(zoomSummed.size()>0 && ((Integer) zoomSummed.peek()).intValue()==cornersHistory.size()) - return false; - else if(zoomLayers.size()>0 && ((Integer) zoomLayers.peek()).intValue()==cornersHistory.size()) - return false; - else if(zoomCalo.size()>0 && ((Integer) zoomCalo.peek()).intValue()==cornersHistory.size()) - return false; - else if(zoomCaloLAr.size()>0 && ((Integer) zoomCaloLAr.peek()).intValue()==cornersHistory.size()) - return false; - else - return projection == projectionHistory && cornersHistory.size() > 0; - } - - public boolean getUnzoomFullPossible() - { - return projection == projectionHistory && cornersHistory.size() > 0; - } - - - public boolean getUnzoomAllPossible(String typeOfZoom) - { - if(cornersHistory.size()<=0) - return false; - else if(ARectangleVPSelection.ZOOM_LAR.equals(typeOfZoom) || - ARectangleVPSelection.ZOOM_CALORIMETERS.equals(typeOfZoom)) - { - int indexOfZoomCalo=-1; - if(zoomCalo.size()>0) - indexOfZoomCalo=((Integer) zoomCalo.peek()).intValue(); - int indexOfZoomCaloLAr=-1; - if(zoomCaloLAr.size()>0) - indexOfZoomCaloLAr=((Integer) zoomCaloLAr.peek()).intValue(); - //make sure summed/layers is last in list - if(ARectangleVPSelection.ZOOM_CALORIMETERS.equals(typeOfZoom) && - indexOfZoomCalo > indexOfZoomCaloLAr) - { - return true; - } - else if(typeOfZoom.equals(ARectangleVPSelection.ZOOM_LAR) && - indexOfZoomCaloLAr > indexOfZoomCalo) - { - return true; - } - else - return false; - } - else - { - int indexOfZoomSummed=-1; - if(zoomSummed.size()>0) - indexOfZoomSummed=((Integer) zoomSummed.peek()).intValue(); - int indexOfZoomLayers=-1; - if(zoomLayers.size()>0) - indexOfZoomLayers=((Integer) zoomLayers.peek()).intValue(); - //make sure summed/layers is last in list - if(typeOfZoom.equals(ARectangleYXSelection.ZOOM_SUMMED) && indexOfZoomSummed>indexOfZoomLayers) - { - return true; - } - else if(typeOfZoom.equals(ARectangleYXSelection.ZOOM_LAYERS) && indexOfZoomLayers>indexOfZoomSummed) - { - return true; - } - else - return false; - } - } - - - public void unzoom(String typeOfZoom) - { - //do unzoom of which item is selected - int numberOfWindows=0,indexOfZoom; - if(typeOfZoom.equals(ARectangleVPSelection.ZOOM_LAR) || - typeOfZoom.equals(ARectangleYXSelection.ZOOM_SUMMED)) - { - numberOfWindows=4; - } - else if(ARectangleVPSelection.ZOOM_CALORIMETERS.equals(typeOfZoom) || - typeOfZoom.equals(ARectangleYXSelection.ZOOM_LAYERS)) - { - numberOfWindows=8; - } - int numberOfUnlayouts=0; - for (int i = 0; i < numberOfWindows; i++) - { - String wName = Integer.toString(i+1); - AWindow w = ACanvas.getCanvas().getWindow(wName); - //find if can do unzoom and what index it is - indexOfZoom=findUnzoomIndex(typeOfZoom, w); - if(indexOfZoom>0) - { - //do all unzooms upto and including index of this zoom to unzoom - while(w.cornersHistory.size()>=indexOfZoom) - w.unzoom(); - //also need to reset parameters - setParameters(typeOfZoom, w, wName); - //find out how many unlayouts to do - int count=0; - while(w.layoutHistory.size()>0 && ((Integer)w.layoutHistory.peek()).intValue()>=indexOfZoom) - { - w.layoutHistory.pop(); - count++; - } - if(count>numberOfUnlayouts) - numberOfUnlayouts=count; - } - } - //do as many unlayouts as needed - for(int i=0; i<numberOfUnlayouts; i++) - ACanvas.getCanvas().unlayout(); - } - - - private int findUnzoomIndex(String typeOfZoom, AWindow w) - { - int indexOfZoom=0;//if returns 0 then no unzoom is to be performed - if(ARectangleVPSelection.ZOOM_CALORIMETERS.equals(typeOfZoom)) - { - if(w.zoomCalo.size()==0) - indexOfZoom=0; - else - { - indexOfZoom=((Integer) w.zoomCalo.pop()).intValue(); - //check if other zooms done on this window - while(w.zoomCaloLAr.size()>0 && ((Integer) w.zoomCaloLAr.peek()).intValue()>indexOfZoom) - { - w.zoomCaloLAr.pop(); - w.modeHistory.pop(); - } - } - } - else if(typeOfZoom.equals(ARectangleVPSelection.ZOOM_LAR)) - { - if(w.zoomCaloLAr.size()==0) - indexOfZoom=0; - else - { - indexOfZoom=((Integer) w.zoomCaloLAr.pop()).intValue(); - while(w.zoomCalo.size()>0 && ((Integer) w.zoomCalo.peek()).intValue()>indexOfZoom) - { - w.zoomCalo.pop(); - w.modeHistory.pop(); - } - } - } - if(typeOfZoom.equals(ARectangleYXSelection.ZOOM_SUMMED)) - { - if(w.zoomSummed.size()==0) - indexOfZoom=0; - else - { - indexOfZoom=((Integer) w.zoomSummed.pop()).intValue(); - //check if other zooms done on this window - while(w.zoomLayers.size()>0 && ((Integer) w.zoomLayers.peek()).intValue()>indexOfZoom) - { - w.zoomLayers.pop(); - w.modeHistory.pop(); - w.cutHistoryHEC.pop(); - w.cutHistoryLAr.pop(); - } - } - } - else if(typeOfZoom.equals(ARectangleYXSelection.ZOOM_LAYERS)) - { - if(w.zoomLayers.size()==0) - indexOfZoom=0; - else - { - indexOfZoom=((Integer) w.zoomLayers.pop()).intValue(); - while(w.zoomSummed.size()>0 && ((Integer) w.zoomSummed.peek()).intValue()>indexOfZoom) - { - w.zoomSummed.pop(); - w.modeHistory.pop(); - w.cutHistoryHEC.pop(); - w.cutHistoryLAr.pop(); - } - } - } - return indexOfZoom; - } - - - private void setParameters(String typeOfZoom, AWindow w, String wName) - { - APar parameterStore = APar.instance(); - parameterStore.selectWindowParameters(wName); - if(ARectangleVPSelection.ZOOM_LAR.equals(typeOfZoom) || - ARectangleVPSelection.ZOOM_CALORIMETERS.equals(typeOfZoom)) - { - parameterStore.get("VP", "Mode").setI( w.modeHistory.pop() ); - } - else - { - parameterStore.get("YX", "Mode").setI( w.modeHistory.pop() ); - parameterStore.get("CutsCalo","HEC").setI( w.cutHistoryHEC.pop() ); - parameterStore.get("CutsCalo","LAr").setI( w.cutHistoryLAr.pop() ); - } - parameterStore.restoreWindowParameters(); - } - - - public void saveParameters(String typeOfZoom) - { - APar parameterStore = APar.instance(); - //save window parameters of current windows - if(typeOfZoom.equals(ARectangleYXSelection.ZOOM_SUMMED) || typeOfZoom.equals(ARectangleYXSelection.ZOOM_LAYERS)) - { - parameterStore.selectWindowParameters(this.getName()); - this.modeHistory.push(new Integer(parameterStore.get("YX", "Mode").getI())); - this.cutHistoryHEC.push(new Integer(parameterStore.get("CutsCalo","HEC").getI())); - this.cutHistoryLAr.push(new Integer(parameterStore.get("CutsCalo","LAr").getI())); - parameterStore.restoreWindowParameters(); - } - else if(ARectangleVPSelection.ZOOM_CALORIMETERS.equals(typeOfZoom) || - ARectangleVPSelection.ZOOM_LAR.equals(typeOfZoom)) - { - parameterStore.selectWindowParameters(this.getName()); - this.modeHistory.push(new Integer(parameterStore.get("VP", "Mode").getI())); - parameterStore.restoreWindowParameters(); - } - } - - - public void unzoomFull() - { - //perform unzoom to initial state - setUserCorners(((AProjection2D) getProjection()).calculateNoZoomCorners(getSize())); - //clear all variables for this window - cornersHistory.clear(); - zoomSummed.clear(); - zoomLayers.clear(); - zoomCaloLAr.clear(); - zoomCalo.clear(); - layoutHistory.clear(); - modeHistory.clear(); - cutHistoryHEC.clear(); - cutHistoryLAr.clear(); - } - - - public void unzoom() - { - if(projection == projectionHistory && cornersHistory.size() > 0) - { - setUserCorners((Point2D.Double[]) (cornersHistory.pop())); - } - } - - - public void saveLayout() - { - if(userCorners != null) - { - ACanvas.getCanvas().saveLayout(); - } - } - - - public void saveCorners() - { - if(projection != projectionHistory) - { - cornersHistory.clear(); - String wName = this.getName(); - int temp; - if(wName.equals("1") || wName.equals("2") || wName.equals("3") || wName.equals("4") || - wName.equals("5") || wName.equals("6") || wName.equals("7") || wName.equals("8")) - { - zoomSummed.clear(); - zoomLayers.clear(); - zoomCaloLAr.clear(); - zoomCalo.clear(); - layoutHistory.clear(); - //will have already done saveParameters so only - //want the last saved parameters of mode and cuts - if(modeHistory.size()>0) - { - temp = ((Integer) modeHistory.pop()).intValue(); - modeHistory.clear(); - modeHistory.push(new Integer(temp)); - } - - if(cutHistoryHEC.size()>0) - { - temp = ((Integer) cutHistoryHEC.pop()).intValue(); - cutHistoryHEC.clear(); - cutHistoryHEC.push(new Integer(temp)); - } - - if(cutHistoryLAr.size()>0) - { - temp = ((Integer) cutHistoryLAr.pop()).intValue(); - cutHistoryLAr.clear(); - cutHistoryLAr.push(new Integer(temp)); - } - } - } - projectionHistory = projection; - if(userCorners != null) - { - cornersHistory.push(clonedCopy(userCorners)); - } - } - - - public void saveCorners(String typeOfZoom) - { - saveCorners(); - //save zoom just done - if(userCorners != null) - { - if(typeOfZoom.equals(ARectangleYXSelection.ZOOM_SUMMED)) - { - zoomSummed.push(new Integer(cornersHistory.size())); - } - else if(typeOfZoom.equals(ARectangleYXSelection.ZOOM_LAYERS)) - { - zoomLayers.push(new Integer(cornersHistory.size())); - } - else if(ARectangleVPSelection.ZOOM_CALORIMETERS.equals(typeOfZoom)) - { - zoomCalo.push(new Integer(cornersHistory.size())); - } - else if(ARectangleVPSelection.ZOOM_LAR.equals(typeOfZoom)) - { - zoomCaloLAr.push(new Integer(cornersHistory.size())); - } - layoutHistory.push(new Integer(cornersHistory.size())); - } - } - - - public void setUserCornersNoRepaint(Point2D.Double[] corners) - { - Point2D.Double[] validCorners = ((AProjection2D) projection). - validateCorners(clonedCopy(corners)); - if(validCorners != null) - { - this.userCorners = validCorners; - } - } - - - public void setUserCorners(double x0, double x1, double y0, double y1) - { - Point2D.Double[] corners = new Point2D.Double[3]; - corners[0] = new Point2D.Double(x0, y1); - corners[1] = new Point2D.Double(x1, y1); - corners[2] = new Point2D.Double(x1, y0); - if(projection instanceof AProjection2D) corners = ((AProjection2D) - projection).validateCorners(corners); - if(corners != null) - this.userCorners = corners; - } - - - public Point2D.Double[] getDefaultCorners() - { - return clonedCopy(defaultCorners); - } - - - public Point2D.Double[] getUserCorners() - { - return clonedCopy(userCorners); - } - - - public void setInteractionManager(AInteractionsManager interactionsManager) - { - this.interactionsManager = interactionsManager; - //Make the interactions Manager aware of canvas changes - ACanvas.getCanvas().addParentWindowFocusListener(interactionsManager); - } - - - public void setScaleStatus(boolean statusWanted) - { - if(getScaleStatus() != statusWanted) toggleScale(); - } - - - public boolean getScaleStatus() - { - return scaleBorder.getScaleStatus(); - } - - - private void toggleScale() - { - scaleBorder.toggleScale(); - repaintFromScratch(); - } - - - public AInteractionsManager getInteractionManager() - { - return interactionsManager; - } - - - public void paintComponent(Graphics g) { - // Don't draw anything for ourself - } - - void paintWindow(Graphics g, boolean doubleBuffer) - { - if(!ACanvas.getCanvas().isReallyOnScreen(this)) - return; - //Why is this checked in paintComponent, and not already in - //setProjection() ? FIXIT / CLEANUP S.B - if(projection instanceof AProjectionTrackResidual) - { - if (((AProjectionTrackResidual) projection).getResidual() != null) - userCorners = ((AProjectionTrackResidual)projection).calculateNoZoomCorners(); - else - { - AOutput.append("\nTrackResidual Projection is not available, using YX instead in window " - + this.getName() + ".\n", ALogInterface.WARNING); - projection = AProjectionsManager.getProjection("YX"); - userCorners = (Point2D.Double[]) corners.get(projection.getName()); - } - } - - //Make sure the offscreen buffer is there if we need one - Graphics paint = g; - if (doubleBuffer) { - createOffScreenBuffer(); - paint = backingGraphics; - } - - // Means either we're using g or backingGraphics was something valid - if (paint != null) - { - if(!bufferValid) - { - setLocked(false); - paintWindowFromScratch(paint); - LinkedList<AInteraction> interactions = interactionsManager.getInteractions(); - for (int i = 0; i < interactions.size(); i++) { - if (interactions.get(i) instanceof ASelection) { - ((ASelection) interactions.get(i)).invalidate(); - } - } - bufferValid = true; - - } - - if (!isLocked() && !borderValid) { - //m_view.getBorder().paintBorder(paint); - borderValid = true; - } - - } - - // If we painted into a context which wasn't the target graphics context - // then we need to paint our buffer to the screen - if (g != paint) { - imageComponent(g); - } - - LinkedList<AInteraction> interactions = interactionsManager.getInteractions(); - for(int i = 0; i < interactions.size(); i++) - ((AInteraction) interactions.get(i)).paint((Graphics2D) g); - } - - // I suppose this function is intended to be called before every printing, - // but it is actually only called for EPS printing!!! FIX / CLEANUP S.B. - public void printComponent(Graphics g) - { - setLocked(false); - if(!ACanvas.getCanvas().isReallyOnScreen(this)) - return; - ((AScaleBorder) getView().getBorder()).forceDraw(); - //Double border painting needed here for EPS - probably something wrong in - //projection drawing -> graphics context left unclean? FIXIT. S.B. - ((AScaleBorder) getView().getBorder()).printBorder(this,g,this.getX(),this.getY(),this.getWidth(),this.getHeight()); - paintWindowFromScratch(g); - ((AScaleBorder) getView().getBorder()).printBorder(this,g,this.getX(),this.getY(),this.getWidth(),this.getHeight()); - borderValid = true; - LinkedList<AInteraction> interactions = interactionsManager.getInteractions(); - for(int i = 0; i < interactions.size(); i++) - { - AInteraction inter = (AInteraction) interactions.get(i); - if(inter.isPrintable()) - inter.paint((Graphics2D) g); - } - } - - - public void printBorder(Graphics g){} - - - // must call paint border myself since the border is backed too - public void paintBorder(Graphics g) - {} - - - public void repaintFromScratch() - { - if(locked)return; - bufferValid = false; - borderValid = false; - - // Check whether to draw scales on repaint - scaleBorder.hideScale(); - - // For some reason need to repaint the view too when using heavyweight - // component inside... - Adam - repaint(); - m_view.repaint(); - - } - - - // Attention: for efficiency this routine overwrites and returns its input - public ACoord calculateUser(ACoord user) - { - double[] h; - double[] v; - double hTemp; - double vTemp; - if(validTransform()) - { - for(int j = 0; j < user.hv[0].length; ++j) - { - h = user.hv[0][j]; - v = user.hv[1][j]; - for(int i = 0; i < h.length; ++i) - { - hTemp = h[i]; - vTemp = v[i]; - h[i] = m00 * hTemp + m01 * vTemp + m02; - v[i] = m10 * hTemp + m11 * vTemp + m12; - } - } - } - else - { - for(int j = 0; j < user.hv[0].length; ++j) - { - h = user.hv[0][j]; - v = user.hv[1][j]; - for(int i = 0; i < h.length; ++i) - { - h[i] = 0.; - v[i] = 0.; - } - } - } - return user; - } - - - public Point2D.Double calculateUser(double x, double y) - { - double[][][] hv = new double[2][1][1]; - hv[0][0][0] = x; - hv[1][0][0] = y; - ACoord p = calculateUser(new ACoord(hv)); - return new Point2D.Double(p.hv[0][0][0], p.hv[1][0][0]); - } - - - public Point2D.Double calculateUser(Point2D.Double p) - { - return calculateUser(p.x, p.y); - } - - - public Point2D.Double calculateUser(Point p) - { - return calculateUser(p.x, p.y); - } - - - // Attention! For efficiency this routine overwrites and returns its input - public ACoord calculateDisplay(ACoord user) - { - if(user == null) - return null; - double[] h; - double[] v; - double hTemp; - double vTemp; - if(validTransform()) - { - for(int j = 0; j < user.hv[0].length; ++j) - { - h = user.hv[0][j]; - v = user.hv[1][j]; - for(int i = 0; i < h.length; ++i) - { - hTemp = h[i]; - vTemp = v[i]; - h[i] = n00 * hTemp + n01 * vTemp + n02; - v[i] = n10 * hTemp + n11 * vTemp + n12; - } - } - } - else - { - for(int j = 0; j < user.hv[0].length; ++j) - { - h = user.hv[0][j]; - v = user.hv[1][j]; - for(int i = 0; i < h.length; ++i) - { - h[i] = 0.; - v[i] = 0.; - } - } - } - return user; - } - - - public Point2D.Double calculateDisplay(double x, double y) - { - double[][][] hv = new double[2][1][1]; - hv[0][0][0] = x; - hv[1][0][0] = y; - ACoord p = calculateDisplay(new ACoord(hv)); - return new Point2D.Double(p.hv[0][0][0], p.hv[1][0][0]); - } - - - public Point2D.Double calculateDisplay(Point2D.Double p) - { - return calculateDisplay(p.x, p.y); - } - - /** - * Called when the window is selected - */ - void select() - { - scaleBorder.setSelected(); - //redraw border to indicate this window is selected - borderValid = false; - repaint(); - } - - /** - * Called when the window is deselected - */ - void deselect() - { - scaleBorder.setDeselected(); - //redraw border to indicate this window is deselected - borderValid = false; - repaint(); - } - - /** - * Draws the image from the backup buffer on screen - */ - private void imageComponent(Graphics g) - { - Graphics2D g2d = (Graphics2D) g; - if(g2d != null) - { - Rectangle clipRect = g2d.getClipBounds(); - // Repaint only what is necessary. Except when running on MacOSX Tiger. - // (see http://lists.apple.com/archives/Java-dev/2005/Jun/msg00611.html) - if(clipRect != null && !(System.getProperty("os.name").equals("Mac OS X") - && System.getProperty("os.version").startsWith("10.4."))) - { - int x = clipRect.x; - int y = clipRect.y; - int w = clipRect.width; - int h = clipRect.height; - BufferedImage subImage = backingImage.getSubimage(x, y, w, h); - g2d.drawImage(subImage, x, y, this); - } - else - { - g2d.drawImage(backingImage, 0, 0, this); - } - } - } - - - public Rectangle getCurrDisp() - { - int width = m_view.getWidth(); - int height = m_view.getHeight(); - insets = m_view.getInsets(insets); - int x = insets.left; - int y = insets.top; - int w = width - insets.left - insets.right; - int h = height - insets.top - insets.bottom; - return new Rectangle(x, y, w, h); - } - - - public void paintWindowFromScratch(Graphics g) - { - APar parameterStore = APar.instance(); - ACanvas.getCanvas().setPaintingWindow(this); - parameterStore.selectWindowParameters(getName()); - Rectangle currDisp = getCurrDisp(); - int x = (int) Math.rint(currDisp.getX()); - int y = (int) Math.rint(currDisp.getY()); - int width = (int) Math.rint(currDisp.getWidth()); - int height = (int) Math.rint(currDisp.getHeight()); - g.setClip(x, y, width, height); - Graphics2D g2 = (Graphics2D)g; - if(APreferencesControl.getAliasMenuItem()) - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - else - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - - projection.paint(this, g); - - g.setClip(0, 0, m_view.getWidth(), m_view.getHeight()); - parameterStore.restoreWindowParameters(); - ACanvas.getCanvas().setPaintingWindow(null); - - if(AColorHelpDialog.getInstance() != null && AColorHelpDialog.getInstance().isVisible()) - AColorHelpDialog.getInstance().update(); - } - - - private void createOffScreenBuffer() - { - int w = m_view.getWidth(); - int h = m_view.getHeight(); - Dimension dim = new Dimension(w, h); - // Check that the current size is positive. - if(w > 0 && h > 0) - { - if(!backingDimension.equals(dim)) - { - // Usinig ABufferedPixelGraphics is not a good idea in MacOSX Tiger. - // So instead we use createGraphics() to create a normal Graphics2D - // object to draw on. - if(System.getProperty("os.name").equals("Mac OS X") - && System.getProperty("os.version").startsWith("10.4.")) - { - backingImage = getGraphicsConfiguration().createCompatibleImage(w, h); - } else if(GraphicsEnvironment.getLocalGraphicsEnvironment(). - getDefaultScreenDevice().getDefaultConfiguration(). - getColorModel().getTransferType() - == DataBuffer.TYPE_USHORT) - { - backingImage = new BufferedImage(w, h, - BufferedImage.TYPE_USHORT_565_RGB); - } - else - { - if(System.getProperty("os.name").equals("Mac OS X")) - backingImage = new BufferedImage(w, h, - BufferedImage.TYPE_INT_ARGB_PRE); - else - backingImage = new BufferedImage(w, h, - BufferedImage.TYPE_INT_RGB); - } - backingGraphics = backingImage.createGraphics(); - backingDimension.setSize(dim); - bufferValid = false; - borderValid = false; - } - } - else - { - backingImage = null; - backingGraphics = null; - } - } - - - public Point2D.Double[] getDisplayCorners() - { - Point2D.Double[] corners = new Point2D.Double[3]; - insets = m_view.getInsets(insets); - int x = insets.left; - int y = insets.top; - int w = m_view.getWidth() - insets.left - insets.right; - int h = m_view.getHeight() - insets.top - insets.bottom; - Point2D.Double upperLeft = new Point2D.Double(x, y); - Point2D.Double lowerRight = new Point2D.Double(x + w, y + h); - Point2D.Double upperRight = new Point2D.Double(x + w, y); - corners[0] = upperLeft; - corners[1] = upperRight; - corners[2] = lowerRight; - return corners; - } - - - private boolean validTransform() - { - double x1, y1, x2, y2, x3, y3, u1, v1, u2, v2, u3, v3; - x1 = userCorners[0].x; - y1 = userCorners[0].y; - x2 = userCorners[1].x; - y2 = userCorners[1].y; - x3 = userCorners[2].x; - y3 = userCorners[2].y; - Point2D.Double[] displayCorners = getDisplayCorners(); - u1 = displayCorners[0].x; - v1 = displayCorners[0].y; - u2 = displayCorners[1].x; - v2 = displayCorners[1].y; - u3 = displayCorners[2].x; - v3 = displayCorners[2].y; - if(v1 * (u3 - u2) + v2 * (u1 - u3) + v3 * (u2 - u1) == 0.)return false; - if((u1 - u2) == 0.)return false; - m01 = (u1 * (x2 - x3) + u2 * (x3 - x1) + u3 * (x1 - x2)) / - (v1 * (u3 - u2) + v2 * (u1 - u3) + v3 * (u2 - u1)); - m00 = ((x1 - x2) - m01 * (v1 - v2)) / (u1 - u2); - m02 = x1 - m00 * u1 - m01 * v1; - m11 = (u1 * (y2 - y3) + u2 * (y3 - y1) + u3 * (y1 - y2)) / - (v1 * (u3 - u2) + v2 * (u1 - u3) + v3 * (u2 - u1)); - m10 = ((y1 - y2) - m11 * (v1 - v2)) / (u1 - u2); - m12 = y1 - m10 * u1 - m11 * v1; - if((x1 - x2) == 0.) - { - n01 = (u2 - u1) / (y2 - y1); - n11 = (v2 - v1) / (y2 - y1); - n00 = ((u3 - u2) - n01 * (y3 - y2)) / (x3 - x1); - n10 = ((v3 - v2) - n11 * (y3 - y2)) / (x3 - x1); - n02 = u1 - n00 * x1 - n01 * y1; - n12 = v1 - n10 * x1 - n11 * y1; - return true; - } - else - { - if(y1 * (x3 - x2) + y2 * (x1 - x3) + y3 * (x2 - x1) == 0.)return false; - n01 = (x1 * (u2 - u3) + x2 * (u3 - u1) + x3 * (u1 - u2)) / - (y1 * (x3 - x2) + y2 * (x1 - x3) + y3 * (x2 - x1)); - n00 = ((u1 - u2) - n01 * (y1 - y2)) / (x1 - x2); - n02 = u1 - n00 * x1 - n01 * y1; - n11 = (x1 * (v2 - v3) + x2 * (v3 - v1) + x3 * (v1 - v2)) / - (y1 * (x3 - x2) + y2 * (x1 - x3) + y3 * (x2 - x1)); - n10 = ((v1 - v2) - n11 * (y1 - y2)) / (x1 - x2); - n12 = v1 - n10 * x1 - n11 * y1; - return true; - } - } - - - public JToolTip createToolTip() - { - JToolTip tip = new JToolTip(); - tip.setFont(new Font(null, Font.PLAIN, 20)); - return tip; - } - - - // implementation of DropTargetListener - - // Called when a drag operation has encountered the DropTarget. - public void dragEnter(DropTargetDragEvent dtde) - { - dtde.acceptDrag(DnDConstants.ACTION_MOVE); - } - - - // The drag operation has departed the DropTarget without dropping. - public void dragExit(DropTargetEvent dte) - {} - - - // Called when a drag operation is ongoing on the DropTarget. - public void dragOver(DropTargetDragEvent dtde) - {} - - - // The drag operation has terminated with a drop on this DropTarget. - public void drop(DropTargetDropEvent dtde) - { - try - { - Transferable transferable = dtde.getTransferable(); - DataFlavor javaObjectDataFlavor = new DataFlavor(DataFlavor. - javaJVMLocalObjectMimeType); - if(transferable.isDataFlavorSupported(javaObjectDataFlavor)) - { - dtde.acceptDrop(DnDConstants.ACTION_MOVE); - Object object = transferable.getTransferData( - javaObjectDataFlavor); - if(object instanceof ACallBack) - ((ACallBack) object).callBack(this); - else - ACanvas.getCanvas().copyWindowSettings(((ADnDLabel) object).getText(), - getName()); - dtde.getDropTargetContext().dropComplete(true); - } - else - AOutput.append("Cannot accept drop\n", ALogInterface.BAD_COMMAND); - } - catch(Exception e) - { - e.printStackTrace(); - dtde.rejectDrop(); - } - } - - - // Called if the user has modified the current drop gesture. - public void dropActionChanged(DropTargetDragEvent dtde) - {} - - - private Vector<ChangeListener> projectionChangeListeners = new Vector<ChangeListener>(); - public void addProjectionChangeListener(ChangeListener listener) - { - projectionChangeListeners.addElement(listener); - listener.stateChanged(new ChangeEvent(this)); - } - - - private void fireProjectionChange() - { - ChangeEvent changeEvent = new ChangeEvent(this); - for(int i = 0; i < projectionChangeListeners.size(); i++) - { - ChangeListener changeListener = (ChangeListener) - projectionChangeListeners.elementAt( - i); - changeListener.stateChanged(changeEvent); - } - } - - - private Vector<ChangeListener> groupChangeListeners = new Vector<ChangeListener>(); - public void addGroupChangeListener(ChangeListener listener) - { - groupChangeListeners.addElement(listener); - listener.stateChanged(new ChangeEvent(this)); - } - - - private void fireGroupChange() - { - ChangeEvent changeEvent = new ChangeEvent(this); - for(int i = 0; i < groupChangeListeners.size(); i++) - { - ChangeListener changeListener = (ChangeListener) - groupChangeListeners.elementAt(i); - changeListener.stateChanged(changeEvent); - } - } - - - // implementation of DragSourceListener - - // This method is invoked to signify that the Drag and Drop operation is complete. - public void dragDropEnd(DragSourceDropEvent dsde) - {} - - - // Called as the hotspot enters a platform dependent drop site. - public void dragEnter(DragSourceDragEvent dsde) - { - dsde.getDragSourceContext().setCursor(ADnDLabel.DROP_INVALID); - } - - - // Called as the hotspot exits a platform dependent drop site. - public void dragExit(DragSourceEvent dse) - { - dse.getDragSourceContext().setCursor(ADnDLabel.DROP_INVALID); - } - - - // Called as the hotspot moves over a platform dependent drop site. - public void dragOver(DragSourceDragEvent dsde) - { - dsde.getDragSourceContext().setCursor(ADnDLabel.DROP_VALID); - } - - - // Called when the user has modified the drop gesture. - public void dropActionChanged(DragSourceDragEvent dsde) - {} - - - // implementation of DragGestureListener - - public void dragGestureRecognized(DragGestureEvent dge) - { - if(!canCopyScales)return; - Point p = dge.getDragOrigin(); - Insets i = m_view.getInsets(); - int w = m_view.getWidth(); - int h = m_view.getHeight(); - Rectangle vScale = new Rectangle(0, 0, i.left, h - i.bottom); - Rectangle hScale = new Rectangle(i.left, h - i.bottom, w - i.left, - i.bottom); - if(vScale.contains(p)) - dragAction = dragActionType.COPY_VERTICAL_SCALE; - else if(hScale.contains(p)) - dragAction = dragActionType.COPY_HORIZONTAL_SCALE; - else - return; - dragSource.startDrag(dge, ADnDLabel.DROP_INVALID, - new AObjectTransferable(this), this); - } - - - public void setScaleCopyStatus(boolean canCopyScales) - { - this.canCopyScales = canCopyScales; - } - - - public void callBack(Object to) - { - AWindow targetWindow; - if(to instanceof ADnDLabel) - targetWindow = ACanvas.getCanvas().getWindow(((ADnDLabel) to). - getText()); - else if(to instanceof AWindow) - targetWindow = (AWindow) to; - else - return; - if(dragAction == dragActionType.COPY_VERTICAL_SCALE) - { - String labelSource = ((AScaleBorder) getBorder()). - getVerticalAxisLabel(); - String labelTarget = ((AScaleBorder) (targetWindow.getBorder())). - getVerticalAxisLabel(); - if(labelSource.equals(labelTarget) && labelSource.equals(AMath.PHI)) - { - Point2D.Double[] sourceCorners = getUserCorners(); - Point2D.Double[] targetCorners = targetWindow.getUserCorners(); - for(int i = 0; i < sourceCorners.length; ++i) - targetCorners[i].setLocation(targetCorners[i].getX(), - sourceCorners[i].getY()); - targetWindow.setUserCorners(targetCorners); - AOutput.append("Copy " + AMath.PHI + " Scale from " + getName() + - " to " + targetWindow.getName() + "\n", - ALogInterface.NORMAL); - } - } - else if(dragAction == dragActionType.COPY_HORIZONTAL_SCALE) - { - String labelSource = ((AScaleBorder) getBorder()). - getHorizontalAxisLabel(); - String labelTarget = ((AScaleBorder) targetWindow.getBorder()). - getHorizontalAxisLabel(); - if(labelSource.equals(labelTarget) && labelSource.equals("Z")) - { - Point2D.Double[] sourceCorners = getUserCorners(); - Point2D.Double[] targetCorners = targetWindow.getUserCorners(); - for(int i = 0; i < sourceCorners.length; ++i) - targetCorners[i].setLocation(sourceCorners[i].getX(), - targetCorners[i].getY()); - targetWindow.setUserCorners(targetCorners); - AOutput.append("Copy Z Scale from " + getName() + " to " + - targetWindow.getName() + "\n", - ALogInterface.NORMAL); - } - } - } - - - private void setLocked(boolean locked) - { - if(locked == this.locked)return; - boolean wasLocked = this.locked; - this.locked = locked; - ACanvas.getCanvas().fireLockChange(); - if(wasLocked && !locked) - this.repaintFromScratch(); - ACanvas.getCanvas().fireLockChange(); - } - - - public boolean isLocked() - { - return locked; - } - - public JComponent getView() { - return m_view; - } - - public void invalidateQuietly() { - // When you get told to paint in OpenGL you better paint otherwise - // you're going to get your empty backbuffer painted to screen a lot - // of the time ... could fix this by managing our buffer swaps by hand - // see AWindowGLView.display() for more... - Adam - bufferValid = false; - borderValid = false; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/AWindowGLView.java b/graphics/AtlantisJava/src/atlantis/canvas/AWindowGLView.java deleted file mode 100644 index bd94b9013755d517b2199317a710a124cd235008..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/AWindowGLView.java +++ /dev/null @@ -1,337 +0,0 @@ -package atlantis.canvas; - -import atlantis.interactions.AInteractionsManager; -import atlantis.utils.ALogger; -import java.awt.BorderLayout; -import java.awt.BufferCapabilities; -import java.awt.Canvas; -import java.awt.Component; -import java.awt.Graphics; -import java.awt.GraphicsEnvironment; -import java.awt.event.MouseListener; -import java.lang.ref.WeakReference; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import javax.media.opengl.AWTGraphicsDevice; -import javax.media.opengl.DefaultGLCapabilitiesChooser; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCanvas; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesChooser; -import javax.media.opengl.GLContext; -import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.GLJPanel; -import javax.media.opengl.glu.GLU; -import javax.swing.JPanel; -import javax.swing.border.Border; - -/** - * This class provides an OpenGL context. When the parent AWindow repaints - * this is propagated down to this view component, which then calls back to - * the parent AWindow requesting everything be copied in. - * - * @author Adam Davison - */ -public class AWindowGLView extends JPanel implements GLEventListener { - - private static ALogger logger = ALogger.getLogger(AWindowGLView.class); - - private GLCanvas m_panel; - //private JPanel m_children; - private long m_start = 0; - private int m_count = 0; - private AWindow m_parent; - private Graphics m_g = null; - - private static GLContext m_ocontext; - - // Keep track of all initialized OpenGL contexts without forcing them - // to stay in memory when we aren't using them any more... - // This is a debugging thing - private static ArrayList<WeakReference> m_all = new ArrayList<WeakReference>(); - - private static int m_maxFSAA = -1; - private static int m_FSAA = 0; - - public static int getCurrentFSAA() { - return m_FSAA; - } - - public static void setCurrentFSAA(int FSAA) { - logger.info("Changing anti-aliasing to " + FSAA + "x"); - m_FSAA = FSAA; - for (int i = 0; i < m_all.size(); i++) { - AWindowGLView v = (AWindowGLView)(m_all.get(i).get()); - if (v != null) { - v.restartDisplay(); - } - } - } - - public static int getMaxFSAA() { - return m_maxFSAA; - } - - public void restartDisplay() { - System.out.println("RESTART DISPLAY!"); - remove(m_panel); - m_panel = null; - startDisplay(); - validate(); - m_panel.setBounds(0, 0, getWidth(), getHeight()); - } - - private void startDisplay() { - GLCapabilities cap = new GLCapabilities(); - - if (m_FSAA > 0) { - cap.setSampleBuffers(true); - cap.setNumSamples(m_FSAA); - logger.info("Requesting " + m_FSAA + "x"); - } - - cap.setDoubleBuffered(true); - - if (m_ocontext != null) { - m_panel = new GLCanvas(cap, null, m_ocontext, null); - } else { - m_panel = new GLCanvas(cap); - } - - m_ocontext = m_panel.getContext(); - - m_panel.addGLEventListener(this); - - //m_FSAA = m_panel.getChosenGLCapabilities().getNumSamples(); - - //m_children = new JPanel(); - - add(m_panel, BorderLayout.CENTER); - - } - - public AWindowGLView(AWindow parent) { - m_parent = parent; - setLayout(null); - - startDisplay(); - //m_panel.add(m_but); - //add(m_but, BorderLayout.NORTH); - - - m_all.add(new WeakReference(this)); - - } - - private void checkListeners() { - AInteractionsManager lt = m_parent.getInteractionManager(); - MouseListener[] lr = m_panel.getMouseListeners(); - boolean found = false; - for (int i = 0; i < lr.length; i++) { - if (lr[i] == lt) { - found = true; - } - } - - if (!found) { - m_panel.addMouseListener(lt); - m_panel.addMouseMotionListener(lt); - } - } - - public void init(GLAutoDrawable drawable) { - - System.out.println("INIT CALLED!"); - System.out.println(getWidth() + ":" + getHeight()); - //(new Exception()).printStackTrace(); - - checkListeners(); - - //drawable.setGL(new TraceGL(drawable.getGL(), System.err)); - GL gl = drawable.getGL(); - logger.debug("INIT GL IS: " + gl.getClass().getName()); - - int[] buffer = new int[2]; - gl.glGetIntegerv(GL.GL_MAX_SAMPLES_EXT, buffer, 0); - m_maxFSAA = buffer[0]; - logger.debug("Graphics card supports max anti-alias of: " + buffer[0] + "x"); - - BufferCapabilities bc = m_panel.getGraphicsConfiguration().getBufferCapabilities(); - boolean frontacc = bc.getFrontBufferCapabilities().isAccelerated(); - boolean backacc = bc.getBackBufferCapabilities().isAccelerated(); - logger.info("OpenGL Acceleration Status: Front - " + frontacc + " and Back - " + backacc); - - // All polygons in Atlantis are uniformly coloured, this speeds things up in theory at least... - gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - gl.glShadeModel(GL.GL_FLAT); - - // Old style antialiasing like this is apparently not supported by - // modern graphics cards although we may want to enable it on older - // hardware where people do not have FSAA but still want AA - /*gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); - gl.glEnable(gl.GL_POLYGON_SMOOTH); - gl.glHint(gl.GL_LINE_SMOOTH_HINT, gl.GL_NICEST); - gl.glEnable(gl.GL_LINE_SMOOTH);*/ - - // We do our own Z-ordering - gl.glDisable(gl.GL_DEPTH_TEST); - - // Enable transparency, even if nothing in Atlantis is actually - // transparent yet... - gl.glEnable(gl.GL_BLEND); - gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA); - - } - - private static int countContexts() { - int count = 0; - for (int i = 0; i < m_all.size(); i++) { - if (m_all.get(i).get() != null) { - count++; - } - // Could throw away dead weak refs here... - } - return count; - } - - public void display(GLAutoDrawable d) { - - /*if (m_parent.isValid()) { - System.out.println("VALID PARENT - RETURNING"); - return; - }*/ - // Perhaps we could not do this and turn off buffer swaps? - // Currently we're probably doing some unnecessary repaints when - // you change window - m_parent.invalidateQuietly(); - - GL gl = d.getGL(); - //System.out.println("DISPLAY " + this); - //System.out.println("ACTIVE: " + countContexts()); - gl.glMatrixMode(GL.GL_MODELVIEW); - gl.glLoadIdentity(); - - // Can we avoid this? We probably fill with bg colour later anyway... - gl.glColor4f(1.0f, 1.0f, 1.0f, 0.5f); - gl.glClear(gl.GL_COLOR_BUFFER_BIT); - - if (m_parent != null) { - AGLGraphics glg = new AGLGraphics(d); - m_parent.paintWindow(glg, false); - super.paintBorder(glg); - /*for (int i = 0; i < m_panel.getComponentCount(); i++) { - m_panel.getComponent(i).paint(glg); - }*/ - } - - gl.glFlush(); - - m_count++; - long tnow = System.currentTimeMillis(); - if (tnow - 1000 > m_start) { - logger.info("OpenGL FPS: " + m_count); - m_count = 0; - m_start = tnow; - } - } - - /*@Override - public Graphics getGraphics() { - if (m_g == null) { - System.out.println("PAINT OUT OF VALID"); - return new ADummyGraphics2D(); - } else { - return m_g; - } - }*/ - public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { - //System.out.println("GLRESIZE: " + x + ":" + y + ":" + width + ":" + height); - GL gl = drawable.getGL(); - GLU glu = new GLU(); - - if (height <= 0) // avoid a divide by zero error! - { - height = 1; - } - final float h = (float) width / (float) height; - gl.glViewport(0, 0, width, height); - gl.glMatrixMode(GL.GL_PROJECTION); - gl.glLoadIdentity(); - gl.glOrtho(x, x + width, y + height, y, -100.0, 100.0); - //gl.glOrtho(-10.0, 10.0, -10.0, 10.0, -10.0, 10.0); - - gl.glMatrixMode(GL.GL_MODELVIEW); - gl.glLoadIdentity(); - - m_count = 0; - m_start = System.currentTimeMillis(); - } - - // Should implement this for multi-screen people some time... - public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) { - //throw new UnsupportedOperationException("Not supported yet."); - } - - public void setBounds(int x, int y, int width, int height) { - //Border b = getBorder(); - //setBorder(null); - super.setBounds(x, y, width, height); - m_panel.setBounds(0, 0, getWidth(), getHeight()); - //setBorder(b); - //System.out.println("RESIZE " + x + ":" + y + ":" + width + ":" + height); - } - - // Need to paint our own border to make sure it gets drawn in GL - public void paintBorder(Graphics g) { - - } - - // Need to make sure our heavyweight child is invalidated - public void repaint() { - super.repaint(); - if (m_panel != null) { - m_panel.repaint(); - } - } - - public Component getRealPanel() { - return m_panel; - } -} - -class OurGLCapChooser implements GLCapabilitiesChooser { - - private int m_maxAA; - private boolean m_canAA; - - public OurGLCapChooser() { - } - - public int chooseCapabilities(GLCapabilities req, GLCapabilities[] all, int recommended) { - System.out.println("CALLED!"); - m_canAA = false; - m_maxAA = 0; - - for (int i = 0; i < all.length; i++) { - System.out.println(all[i]); - if (all[i].getSampleBuffers()) { - m_canAA = true; - if (all[i].getNumSamples() > m_maxAA) { - m_maxAA = all[i].getNumSamples(); - } - } - } - - return (new DefaultGLCapabilitiesChooser()).chooseCapabilities(req, all, recommended); - } - - public boolean getCanAA() { - return m_canAA; - } - - public int getMaxAA() { - return m_maxAA; - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/canvas/AWindowSwingView.java b/graphics/AtlantisJava/src/atlantis/canvas/AWindowSwingView.java deleted file mode 100644 index cc27fad13af3f42f8d1f6300cc7cec8ff5ac1691..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/AWindowSwingView.java +++ /dev/null @@ -1,57 +0,0 @@ -package atlantis.canvas; - -import atlantis.globals.AGlobals; - -import java.awt.Graphics; -import javax.swing.JPanel; - -/** - * - * This class provides an Java2D/Swing context. When the parent AWindow repaints - * this is propagated down to this view component, which then calls back to - * the parent AWindow requesting everything be copied in. - * - * @author Adam Davison - */ -public class AWindowSwingView extends JPanel { - - private AWindow m_parent; - - public AWindowSwingView(AWindow parent) { - setLayout(null); - m_parent = parent; - } - - @Override - protected void paintComponent(Graphics g) { - //System.out.println(getX() + ":" + getY() + ":" + getWidth() + ":" + getHeight()); - g.setClip(0, 0, getWidth(), getHeight()); - //g.setColor(Color.RED); - //g.fillRect(10, 10, getWidth() - 10, getHeight() - 10); - if (AGlobals.isAtlantisHeadless()) { - // Don't need to paint to a backing buffer ever in headless - // since we're already painting offscreen - m_parent.paintWindow(g, false); - } else { - m_parent.paintWindow(g, true); - } - } - - @Override - protected void printComponent(Graphics g) { - //System.out.println(getX() + ":" + getY() + ":" + getWidth() + ":" + getHeight()); - g.setClip(0, 0, getWidth(), getHeight()); - //g.setColor(Color.RED); - //g.fillRect(10, 10, getWidth() - 10, getHeight() - 10); - m_parent.printComponent(g); - } - - @Override - public void setBounds(int x, int y, int width, int height) { - super.setBounds(x, y, width, height); - //System.out.println("RESIZE " + x + ":" + y + ":" + width + ":" + height); - } - - - -} diff --git a/graphics/AtlantisJava/src/atlantis/canvas/package.html b/graphics/AtlantisJava/src/atlantis/canvas/package.html deleted file mode 100644 index c09fd6d63f20e9be844c81cea3d2da0a24e2a85c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/canvas/package.html +++ /dev/null @@ -1,23 +0,0 @@ -<html> -<head></head> -<body> -<p>Provides classes representing the Atlantis canvas and the windows - displayed within it.</p> -<p>The ACanvas is a JFrame containing a JlayeredPane of AWindows. Windows -are placed into the JLayeredPane depending on the current layout. The -canvas class contains a HashTable of all possible windows and a -HashTable of all available layouts. Windows needed by the current -layout are added to the JLayeredPane according to the size and the -order defined by the layout. An AWindow is a JPanel into which the -Atlantis graphics are drawn. Each window has an associated projection -and also an interaction manager. The interaction manager is a mouse -listener which deals with all mouse events on the window. The window -manages the drawing of the Atlantis picture and deals with the linear -transformations from user to display co-ordinates. Non-linear -transformations are dealt with by the projection. ALayout defines the -size and position (in the 3x3 grid layout scheme of the layered pane) -of each window, and also describes combinations of these windows -called pages. pages is an array of characters where each character -represents a window.</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/config/AConfig.java b/graphics/AtlantisJava/src/atlantis/config/AConfig.java deleted file mode 100755 index f35dbb07ed52727d10d1806a96c76bfd1116fdcb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/config/AConfig.java +++ /dev/null @@ -1,432 +0,0 @@ -package atlantis.config; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import atlantis.Atlantis; -import atlantis.utils.xml.AXMLErrorHandler; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; - -/** - * AConfig acts as a container of the configuration file. - * The whole file can be accessed through a tree structure. - * - * @author ql - * - */ - -// by Zdenek, remark, 2008-08-14 -// since the attributes are stored in something like HashMap -// their order is not ensured?, e.g. having in WindowCorners source -// configuration (master copy according to which synchronization is done) -// <CORNERS windowName="W" x0="-1320.0" y0="1320.0" x1="1320.0" y1="1320.0" x2="1320.0" y2="-1320.0"/> -// line order this way, after updating it result in something like this -// <CORNERS x2="1320.0" windowName="W" y0="1320.0" x1="1320.0" y2="-1320.0" y1="1320.0" x0="-1320.0"/> -// the same data, but the order of attributes is not the same -public class AConfig -{ - private static ALogger logger = ALogger.getLogger(AConfig.class); - - // A map defining the key attribute for each modifiable element - static Hashtable keyMap; - - // Define modifiable attributes - public static String[] CANVAS_ATT = {"startupLayout", "aspectRatio"}; //<Canvas> - public static String[] WINDOW_ATT = {"projection", "group"}; //<UsedWindow> - public static String[] LAYOUT_ATT = {"startup", "startupWindow"}; //<Layout> - public static String[] PAR_ATT = {"va", "st", "dop", "scope", "ul"}; //<Others> - public static String[] GROUP_ATT = {"userLevel"}; //<Group> - - // Define used greek letters in configuration file - static String[] GREEK_LETTER = {"\u03B7", "\u03C1", "\u03A6", "\u0394", "\u03BB", "\u03C3"}; - static String[] GREEK_ENTITY = {"η", "ρ", "φ", "δ", "λ", "σ"}; - - // The name of the configuration file - private String filename; - - // If isCustomised is true, the configuration file contains two exclusive - // blocks, <ParameterDifferences> and <WindowCorners>. - private boolean isCustomised; - - // This field contains the whole DTD section of the configuration file. - private String dtdSection = null; - - // Root node of the configuration tree - private AConfigNode rootNode; - - // A list containing all element nodes in the file - private ArrayList nodeList; - - // A list containing all user exclusive element nodes in the file - // <ParameterDifferences> and <WindowCorners> - private ArrayList userExclusiveNodeList; - - public AConfig(String configFilename, boolean isCustomised) throws Exception - { - if(AConfig.keyMap == null) - AConfig.createKeyMap(); - this.filename = configFilename; - this.isCustomised = isCustomised; - parseXML(); - } - - /** - * @return Returns the dtdSection. - */ - public String getDtdSection() throws Exception - { - if(this.dtdSection == null) - createDTDSection(this.filename); - return this.dtdSection; - } - - public Iterator getIterator() - { - return nodeList.iterator(); - } - - void addNode(AConfigNode node) - { - nodeList.add(node); - } - - void addUserExclusiveNode(AConfigNode node) - { - userExclusiveNodeList.add(node); - } - - /** - * initialise <code>keyMap</code>. - */ - private static void createKeyMap() - { - keyMap = new Hashtable(); - keyMap.put("Canvas", "startupLayout"); - keyMap.put("UsedWindow", "name"); - keyMap.put("Layout", "name"); - keyMap.put("ENUM", "fn"); - keyMap.put("SENUM", "fn"); - keyMap.put("ICUT", "fn"); - keyMap.put("SICUT", "fn"); - keyMap.put("FCUT", "fn"); - keyMap.put("SFCUT", "fn"); - keyMap.put("INT", "fn"); - keyMap.put("SINT", "fn"); - keyMap.put("FLOAT", "fn"); - keyMap.put("SFLOAT", "fn"); - keyMap.put("LINT", "fn"); - keyMap.put("SLINT", "fn"); - keyMap.put("COLOR", "fn"); - keyMap.put("SCOLOR", "fn"); - keyMap.put("STATUS", "fn"); - } - - /** - * initialise <code>dtdSection</code> based on the dtd part from the - * configuration file. - */ - private void createDTDSection(String configFilename) throws Exception - { - String dtdStart = "<?xml version=\"1.0\"?>"; - String dtdEnd = "]>"; - String LINE_SEPAR = System.getProperty("line.separator"); - - this.dtdSection = ""; - try - { - - InputStream is = AUtilities.getFileAsStream(configFilename); - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - - String currentLine; - boolean isInsideDTD = false; - while(true) - { - currentLine = br.readLine(); - if(currentLine == null) return; - if(dtdStart.equals(currentLine.trim())) - { - isInsideDTD = true; - this.dtdSection += currentLine + LINE_SEPAR; - } - else if(dtdEnd.equals(currentLine.trim())) - { - isInsideDTD = false; - this.dtdSection += currentLine + LINE_SEPAR; - } - else if(isInsideDTD) - { - this.dtdSection += currentLine + LINE_SEPAR; - } - } - } - catch(FileNotFoundException e) - { - String m = "File " + configFilename + " not found, fatal."; - throw new Exception(m); - } - catch(IOException e) - { - String m = "I/O exception while reading file " + configFilename; - throw new Exception(m); - } - } - - public void createConfigTree(Element rootElement) - { - this.nodeList = new ArrayList(); - if(this.isCustomised) - this.userExclusiveNodeList = new ArrayList(); - this.rootNode = new AConfigNode(null, rootElement, 0, this); - } - - public void parseXML() throws Exception - { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setValidating(true); - DocumentBuilder parser; - try - { - parser = factory.newDocumentBuilder(); - parser.setErrorHandler(new AXMLErrorHandler()); - - InputStream isConfig = AUtilities.getFileAsStream(this.filename); - Document xmlConfigDoc = parser.parse(isConfig); - createConfigTree(xmlConfigDoc.getDocumentElement()); - } - catch (Exception e) - { - throw e; - } - } - - // Find a node match the sampleNode in the configuration file - // Return the node if found, null otherwise - public AConfigNode find(AConfigNode sampleNode) - { - for(int i=0; i<nodeList.size(); ++i) - { - AConfigNode testNode = (AConfigNode) nodeList.get(i); - if("Canvas".equals(sampleNode.getNodeName()) - && (testNode.getFullNodeName().equals(sampleNode.getFullNodeName()))) - { - return testNode; - } - else if((testNode.getFullNodeName().equals(sampleNode.getFullNodeName())) - && (testNode.getKeyValue().equals(sampleNode.getKeyValue()))) - { - return testNode; - } - } - return null; - } - - // Find a node based on the node name, attribute name and value - // Return the node if found, null otherwise - public AConfigNode find(String name, String attName, String attValue) - { - for(int i=0; i<nodeList.size(); ++i) - { - AConfigNode testNode = (AConfigNode) nodeList.get(i); - if(name.equals(testNode.getNodeName()) - && attValue.equals(testNode.getAttValue(attName))) - return testNode; - } - return null; - } - - // Find a node based on the node name, attribute name and value, - // and its parent's node name, attribute name and value. - // Return the node if found, null otherwise - public AConfigNode find(String name, String attName, String attValue, - String parName, String parAttName, String parAttValue) - { - for(int i=0; i<nodeList.size(); ++i) - { - AConfigNode testNode = (AConfigNode) nodeList.get(i); - if(name.equals(testNode.getNodeName()) - && attValue.equals(testNode.getAttValue(attName))) - { - AConfigNode parNode = testNode.getParent(); - - if(parName.equals(parNode.getNodeName()) - && parAttValue.equals(parNode.getAttValue(parAttName))) - return testNode; - } - } - return null; - } - - // Find a parameter node based on the attribute name and value, - // and its group's name - // Return the node if found, null otherwise - // - // NB: This method is for finding a parameter node with uncertain - // parameter type, but with a certain parent node name - public AConfigNode findPar(String attName, String attValue, String parAttValue) - { - for(int i=0; i<nodeList.size(); ++i) - { - AConfigNode testNode = (AConfigNode) nodeList.get(i); - if(attValue.equals(testNode.getAttValue(attName))) - { - AConfigNode parNode = testNode.getParent(); - - // <StatusRoot> and <StatusGroup> are skipped when finding parent node - while("StatusRoot".equals(parNode.getNodeName()) - || "StatusGroup".equals(parNode.getNodeName())) - { - parNode = parNode.getParent(); - } - - if("Group".equals(parNode.getNodeName()) - && parAttValue.equals(parNode.getAttValue("name"))) - return testNode; - } - } - return null; - } - - /** - * validate the attribute value - */ - public boolean validate(AConfigNode node, String attName, String attValue) - { - if("Canvas".equals(node.getNodeName()) && "startupLayout".equals(attName)) - { - if(find("Layout", "name", attValue) == null) - return false; - } - else if("UsedWindow".equals(node.getNodeName()) && "projection".equals(attName)) - { - if(find("Group", "name", attValue, "SuperGroup", "name", "Projection") == null) - return false; - } - else if("UsedWindow".equals(node.getNodeName()) && "group".equals(attName)) - { - if(find("Group", "name", attValue) == null) - return false; - } - else if("Layout".equals(node.getNodeName())) - { - int numWindows = attValue.length(); - for(int i=0; i<numWindows; ++i) - { - String windowName = attValue.substring(i, i+1); - if(find("Window", "name", windowName, "Layout", "name", node.getKeyValue()) == null) - return false; - } - } - return true; - } - - public void validateUserExclusiveNode(AConfigNode node) - { - if("ParameterDifferences".equals(node.getNodeName())) - { - // check validity of each child of <ParameterDifferences> - Iterator it = node.getChildren().iterator(); - while(it.hasNext()) - { - // a <DIFFERENCE> node - AConfigNode childNode = (AConfigNode) it.next(); - String group = childNode.getAttValue("group"); - String window = childNode.getAttValue("windowName"); - String parameter = childNode.getAttValue("name"); - if(find("UsedWindow", "name", window) == null) - it.remove(); - else - { - if(find("Group", "name", group) == null) - it.remove(); - else - { - if(findPar("fn", parameter, group) == null) - it.remove(); - } - } - } - } - else if("WindowCorners".equals(node.getNodeName())) - { - // check validity of each child of <WindowCorners> - Iterator it = node.getChildren().iterator(); - while(it.hasNext()) - { - // a <CORNERS> node - AConfigNode childNode = (AConfigNode) it.next(); - String window = childNode.getAttValue("windowName"); - if(find("UsedWindow", "name", window) == null) - it.remove(); - } - } - } - - /** - * Replace the greek letters in the source string with UTF entities - * - * @param testStr a source string - * @return the resulting string - */ - static String replaceGreekLetter(String testStr) - { - for (int i=0; i<GREEK_LETTER.length; ++i) - { - if (testStr.indexOf(GREEK_LETTER[i]) >= 0) - testStr = testStr.replaceAll(GREEK_LETTER[i], GREEK_ENTITY[i]); - } - - return testStr; - } - - /** - * Converts to a string representing the xml data in this configuration - * file. - */ - public String convertToString() throws Exception - { - return getDtdSection() + "\n\n" + this.rootNode.toString(); - } - - /** - * Converts to a string representing the xml data in this configuration - * file plus the user exclusive section fom <code>userConfig</code>. - */ - public String convertToString(AConfig userConfig) throws Exception - { - if(!this.isCustomised && userConfig.isCustomised) - { - StringBuffer str = new StringBuffer("\n"); - for(int i=0; i<userConfig.userExclusiveNodeList.size(); ++i) - { - AConfigNode userExclusiveNode = (AConfigNode) userConfig.userExclusiveNodeList.get(i); - validateUserExclusiveNode(userExclusiveNode); - str.append(userExclusiveNode.toString()); - str.append("\n"); - } - return getDtdSection() + "\n\n" + this.rootNode.toString(str.toString()); - } - else - { - // only add user exclusive section to non-customized configuration - return toString(); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/config/AConfigNode.java b/graphics/AtlantisJava/src/atlantis/config/AConfigNode.java deleted file mode 100755 index 751ae988505664ed71488abf93ef865147bd4290..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/config/AConfigNode.java +++ /dev/null @@ -1,263 +0,0 @@ -package atlantis.config; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.jar.Attributes; - -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class AConfigNode -{ - private String nodeName; - - // use fullNodeName combined with keyValue to uniquely identify a parameter - // in the configuration file - // NB: keyValue is not empty only if attributes is not empty - private String fullNodeName; - private String keyValue = null; - - // Layer 0 represents the root node of the xml file, - // and layer 1 reprensents the layer inside layer 0, - // and so on. - private int layer; - - private Attributes attributes = null; - private ArrayList children = null; - private AConfigNode parent = null; - - // if parent is null, elementNode is the root node - AConfigNode(AConfigNode parent, Node elementNode, int layer, AConfig configObject) - { - // add this node into the node list - configObject.addNode(this); - this.layer = layer; - - // set the full name - this.parent = parent; - String parentName = (this.parent != null) ? this.parent.getFullNodeName() + "-" : ""; - this.nodeName = elementNode.getNodeName(); - if("ParameterDifferences".equals(this.nodeName) - || "WindowCorners".equals(this.nodeName)) - configObject.addUserExclusiveNode(this); - this.fullNodeName = parentName + this.nodeName; - - // set the attributes map - if(elementNode.hasAttributes()) - { - NamedNodeMap attMap = elementNode.getAttributes(); - int numAttributes = attMap.getLength(); - this.attributes = new Attributes(numAttributes); - for(int i=0; i<numAttributes; ++i) - { - // each node returned from item(i) is an Attr - String name = attMap.item(i).getNodeName(); - String value = attMap.item(i).getNodeValue(); - // replace special math operator characters with entity references - if("=".equals(value)) - value = "&intEqual;"; - else if(">".equals(value)) - value = ">"; - else if("<".equals(value)) - value = "<"; - else if("<,>".equals(value)) - value = "ℜ"; - else if("<=".equals(value)) - value = "≤"; - else if(">=".equals(value)) - value = "≥"; - else if("=,!=,<,<=,>,>=".equals(value)) - value = "∫"; - - // replace greek letters with entity references - value = AConfig.replaceGreekLetter(value); - - this.attributes.putValue(name, value); - } - } - - // set the key value - String keyAttr = (String) AConfig.keyMap.get(this.nodeName); - if(keyAttr != null) - { - String groupName = this.parent.getAttValue("name"); - this.keyValue = ((groupName == null) ? "" : (groupName + "-")) + this.attributes.getValue(keyAttr); - } - - // set the children list - if(elementNode.hasChildNodes()) - { - NodeList childList = elementNode.getChildNodes(); - int numChildren = childList.getLength()/2; - this.children = new ArrayList(numChildren); - int idx = 0; - for(int i=0; i<childList.getLength(); ++i) - { - // each node returned from item(i) is an Attr - Node childNode = childList.item(i); - if (childNode.getNodeType() == Node.ELEMENT_NODE) - { - this.children.add(idx++, new AConfigNode(this, childNode, this.layer+1, configObject)); - } - } - } - } - - /** - * @return Returns the nodeName. - */ - public String getNodeName() - { - return this.nodeName; - } - - /** - * @return Returns the fullNodeName. - */ - public String getFullNodeName() - { - return this.fullNodeName; - } - - /** - * @return Returns the parent. - */ - public AConfigNode getParent() - { - return this.parent; - } - - /** - * @return Returns the children. - */ - public List getChildren() - { - return this.children; - } - - /** - * @return Returns the keyValue. - */ - public String getKeyValue() - { - return this.keyValue; - } - - /** - * @return Returns the string value of the specified attribute name, - * or null if not found. - */ - public String getAttValue(String name) - { - if(this.attributes != null) - return this.attributes.getValue(name); - else - return null; - } - - public String setAttValue(String name, String value) - { - return this.attributes.putValue(name, value); - } - - // the start line of this xml node - // e.g. <Nodename att1="value1" att2="value2"> - private String selfStartString() - { - StringBuffer str = new StringBuffer(); - for(int i=0; i<this.layer; ++i) - { - str.append("\t"); - } - str.append("<"); - str.append(this.nodeName); - if(this.attributes != null) - { - Set attSet = this.attributes.keySet(); - Iterator it = attSet.iterator(); - while(it.hasNext()) - { - String attName = it.next().toString(); - String attValue = this.attributes.getValue(attName); - str.append(" "); - str.append(attName); - str.append("=\""); - str.append(attValue); - str.append("\""); - } - } - if(this.children == null) - { - str.append("/>"); - } - return str.toString(); - } - - private String selfEndString() - { - StringBuffer str = new StringBuffer(); - if(this.children == null) - { - // if no children, use simplified format (<.../>) - // so selfStartString contains everything about this node - return ""; - } - else - { - for(int i=0; i<this.layer; ++i) - { - str.append("\t"); - } - str.append("</"); - str.append(this.nodeName); - str.append(">"); - } - return str.toString(); - } - - private String childrenString() - { - StringBuffer str = new StringBuffer(); - if(this.children == null) - { - return ""; - } - else - { - str.append(">\n"); - for(int i=0; i<this.children.size(); ++i) - { - AConfigNode child = (AConfigNode) this.children.get(i); - str.append(child.toString()); - str.append("\n"); - } - } - return str.toString(); - } - - /** - * Converts to a string representing the xml data containing this node and - * all its children. - */ - public String toString() - { - return selfStartString()+childrenString()+selfEndString(); - } - - // userExclusiveSection is noly under root node (layer 0) - public String toString(String userExclusiveSection) - { - if(this.layer == 0) - { - return selfStartString()+childrenString()+userExclusiveSection+selfEndString(); - } - else - { - return toString(); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/config/AConfigUpdater.java b/graphics/AtlantisJava/src/atlantis/config/AConfigUpdater.java deleted file mode 100644 index ee87efb78bcd3723b7463e77976caf13621e038e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/config/AConfigUpdater.java +++ /dev/null @@ -1,405 +0,0 @@ -package atlantis.config; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.OutputStream; -import java.io.InputStream; - -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; - -import java.util.Iterator; - -import atlantis.utils.AUtilities; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; - - - -/** - * This class encapsulates a few static methods which ensure updating - * of the user's customised Atlantis configuration (or special Atlantis - * configurations) according to the base Atlantis configuration file - * configuration/config.xml - * - * Updating means synchronising special / customised configurations if - * XML elements were added/removed from the base configuration file while - * keeping unchanged specially defined user cuts, views, projections, etc. - * - * Methods in this class are also called by an external configuration - * synchronization tool, so methods should remain static, special treatment - * of logger, etc. - * - * @author - * Zdenek Maxa - initial update mechanism, creating this extra class, refactoring - * Qiang Lu - improved reliable updating mechanism as done in AConfig - * - */ -public final class AConfigUpdater -{ - // when AConfigUpdater is called from Atlantis code, logger would behave - // as configured there. If AConfigUpdater is called externally, logger - // should be initialised with default values from ALogger - private static ALogger logger = ALogger.getLogger(AConfigUpdater.class); - - - - - /** - * Methods creates checksum file (name in fileNameChk) of a given file - * (file name in fileName). - */ - public static void createChecksumFile(String fileName, String fileNameChk) - throws AAtlantisException - { - try - { - logger.debug("Creating checksum file " + fileNameChk + - " of a file " + fileName); - byte[] chk = calculateChecksum(fileName); - File fileChk = new File(fileNameChk); - OutputStream os = new FileOutputStream(fileChk); - os.write(chk); - os.close(); - } - catch(AAtlantisException ae) - { - String m = "Error while creating MD5 checksum file, reason: " + - ae.getMessage(); - throw new AAtlantisException(m); - } - catch(FileNotFoundException fnfe) - { - String m = "File not found exception: " + fnfe.getMessage(); - throw new AAtlantisException(m); - } - catch(IOException ioe) - { - String m = "I/O error while creating file " + fileNameChk; - throw new AAtlantisException(m); - } - - } // createChecksumFile() ----------------------------------------------- - - - - /** - * Calculates checksum of a file fileName. - */ - private static byte[] calculateChecksum(String fileName) - throws AAtlantisException - { - InputStream fis = null; - try - { - logger.debug("Calculating checksum of file: " + fileName); - fis = AUtilities.getFileAsStream(fileName); - } - catch(AAtlantisException ae) - { - throw ae; - } - - MessageDigest complete = null; - - try - { - byte[] buffer = new byte[1024]; - complete = MessageDigest.getInstance("MD5"); - int numRead; - do - { - numRead = fis.read(buffer); - if (numRead > 0) - { - complete.update(buffer, 0, numRead); - } - } while (numRead != -1); - - fis.close(); - } - catch(IOException ioe) - { - throw new AAtlantisException("Error while reading data from file " + - fileName); - } - catch(NoSuchAlgorithmException nsae) - { - throw new AAtlantisException(nsae.getMessage()); - } - - logger.debug("Checksum calculated."); - return complete.digest(); - - } // calculateChecksum() ------------------------------------------------ - - - - /** - * Method checks the checksum of input file fileName if its checksum matches - * checksum stored in the checksum file fileNameChk. - * Return true if matches, false otherwise. - */ - public static boolean compareChecksums(String fileName, String fileNameChk) - throws AAtlantisException - { - boolean result = false; - try - { - // checksum of the input file - byte[] inputFileChecksum = calculateChecksum(fileName); - // checksum to read stored checksum from file fileNameChk - // assume the lenght is the same as of the input data file - byte[] storedChecksum = new byte[inputFileChecksum.length]; - File fileChk = new File(fileNameChk); - InputStream is = new FileInputStream(fileChk); - is.read(storedChecksum); - - // compare both checksums - if(new String(storedChecksum).equals(new String(inputFileChecksum))) - { - result = true; - } - else - { - result = false; - } - - is.close(); - } - catch(Exception e) - { - String m = "Error while checking MD5 checksum file, reason: " + - e.getMessage(); - throw new AAtlantisException(m); - } - - return result; - - } // compareChecksums() ------------------------------------------------- - - - - /** - * @param distConfig - configuration instance from Atlantis distribution - * (master copy) - * @param userConfig - user's customised or special configuration which - * gets updated according to distribution configuration - */ - private static void updateConfiguration(AConfig distConfig, AConfig userConfig) - { - logger.debug("Updating customised configuration ..."); - Iterator distIt = distConfig.getIterator(); - while(distIt.hasNext()) - { - // For each key node (keyValue is not empty) inside distConfig, - // test if there is a same node in userConfig. - AConfigNode testDistNode = (AConfigNode) distIt.next(); - if(testDistNode.getKeyValue() != null) - { - AConfigNode matchUserNode = userConfig.find(testDistNode); - if(matchUserNode != null) - { - // update testDistNode based on matchUserNode - updateNode(distConfig, testDistNode, matchUserNode); - } - } - } - - logger.debug("Update finished."); - - } // updateConfiguration() ---------------------------------------------- - - - - /** - * Update a node from configuration. - */ - private static void updateNode(AConfig distConfig, - AConfigNode distNode, AConfigNode userNode) - { - String[] attStrArray = null; - if("Canvas".equals(distNode.getNodeName())) - { - attStrArray = AConfig.CANVAS_ATT; - } - else if("UsedWindow".equals(distNode.getNodeName())) - { - attStrArray = AConfig.WINDOW_ATT; - } - else if("Layout".equals(distNode.getNodeName())) - { - attStrArray = AConfig.LAYOUT_ATT; - } - else - { - //check the parent Group values - if(distNode.getParent().getNodeName().equals("Group")){ - attStrArray = AConfig.GROUP_ATT; - //update the value - for(int i = 0; i < attStrArray.length; ++i) - { - String att = attStrArray[i]; - String distValue = distNode.getParent().getAttValue(att); - String userValue = userNode.getParent().getAttValue(att); - - if(distValue != null && userValue != null && !distValue.equals(userValue)) - { - if(distConfig.validate(distNode.getParent(), att, userValue)) - { - distNode.getParent().setAttValue(att, userValue); - } - } - } - } - - //now update parameters inside the Group - attStrArray = AConfig.PAR_ATT; - } - - // update the value - for(int i = 0; i < attStrArray.length; ++i) - { - String att = attStrArray[i]; - String distValue = distNode.getAttValue(att); - String userValue = userNode.getAttValue(att); - if(distValue != null && userValue != null && !distValue.equals(userValue)) - { - if(distConfig.validate(distNode, att, userValue)) - { - distNode.setAttValue(att, userValue); - } - } - } - - } // updateNode() ------------------------------------------------------- - - - - private static void writeUpdatedConfigurationFile(AConfig distConfig, - AConfig userConfig, - String filename) - throws Exception - { - FileOutputStream fo = null; - fo = new FileOutputStream(filename); - String updatedConfiguration = distConfig.convertToString(userConfig); - fo.write(updatedConfiguration.getBytes()); - fo.close(); - - } // writeUpdatedConfigurationFile() ------------------------------------ - - - - /** - * Updates customised configuration file to be consistent with the - * distribution configuration file. - * @param fileNameDist - distribution configuration file path - * @param fileNameCustom - customised configuration file path - * @throws AAException - */ - public static void updateConfigurationFile(String fileNameDist, - String fileNameCustom) - throws AAtlantisException - { - - logger.info("Updating configuration - master " + - "configuration: " + fileNameDist); - logger.info("Updating configuration - customised (being updated) " + - "configuration: " + fileNameCustom); - - AConfig distConfig = null; - AConfig customConfig = null; - - // read master (distribution) and customised configurations - try - { - distConfig = new AConfig(fileNameDist, false); // false - is not customised - } - catch(Exception e) - { - // these however seem to be never thrown because of AXMLErrorHandler - // in AConfig - String m = "Could not read/parse distribution configuration " + - fileNameDist + " reason: " + e.getMessage(); - throw new AAtlantisException(m); - } - - try - { - customConfig = new AConfig(fileNameCustom, true); // true - is customised - } - catch(Exception e) - { - // these however seem to be never thrown because of AXMLErrorHandler - // in AConfig - String m = "Could not read/parse customised configuration " + - fileNameCustom + " reason: " + e.getMessage(); - throw new AAtlantisException(m); - } - - - // actual update - try - { - updateConfiguration(distConfig, customConfig); - } - catch(Throwable t) - { - String m = "Updating customised configuration failed, reason: " + - t.getMessage(); - logger.debug(m, t); - throw new AAtlantisException(m); - } - - - // write updated data, first create backup of the source file - - logger.info("Creating backup of the customised configuration file ..."); - // file name to backup (rename) the file to - String fileNameUserBackup = fileNameCustom + "-backup_on_" + - AUtilities.getDateTimeString(); - File fileCustom = new File(fileNameCustom); - File fileBackup = new File(fileNameUserBackup); - boolean renameResult = fileCustom.renameTo(fileBackup); - if(! renameResult) - { - String m = "Could not backup customised configuration " + - "file, updating configuration failed."; - - // if fileNameDist path starts with "//", then it is run from within - // JAR archive via webstart. update process can't be performed in this - // case - can't create a backup copy of the fileNameCustom (and can't - // create an updated file when all is packed in a single JAR file either) - if(fileNameDist.startsWith("//")) - { - m += " Running via webstart, update can't be perfomed in this mode."; - } - throw new AAtlantisException(m); - } - logger.info(fileNameCustom + " backup created: " + fileNameUserBackup); - - - try - { - writeUpdatedConfigurationFile(distConfig, customConfig, - fileNameCustom); - } - catch(Throwable t) - { - String m = "Saving updated customised configuration into file " + - "failed, reason: " + t.getMessage(); - logger.debug(m, t); - throw new AAtlantisException(m); - } - - - logger.info(fileNameCustom + " configuration was successfully updated."); - - } // updateConfigurationFile() ------------------------------------------ - - -} // class AConfigUpdater =================================================== \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/config/ADefaultValues.java b/graphics/AtlantisJava/src/atlantis/config/ADefaultValues.java deleted file mode 100755 index b2e764499cd2bed428170c5679a81b2c81a8d034..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/config/ADefaultValues.java +++ /dev/null @@ -1,206 +0,0 @@ -package atlantis.config; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.FileReader; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.regex.Pattern; -import java.util.regex.Matcher; - -import atlantis.globals.AGlobals; -import atlantis.utils.ALogger; - -/** - * The class maintains a few values which are to be remembered - * from session to session. The class tries to read in values from runtime - * configuration file $HOME/.Atlantis-runtime_values.txt. The values are - * stored in a Hashtable and are used as default initialize values. This - * Hashtable is updated whenever user changes these values. Values are - * into file at the end of Atlantis session. - * - * TODO: - * last used geometry (will be simpler when TB mode (and Atlantis.mode in - * general is discontinued), geometry names will be considered - * after '_' up to the file extension (.xml) - * last event file - * - * @author Zdenek Maxa - */ -public class ADefaultValues -{ - // file where the cross-session runtime values are stored - public static final String CONFIGFILE = System.getProperty("user.home") + - System.getProperty("file.separator") + - ".Atlantis-runtime_values.txt"; - // main attribute which holds all data - private static Hashtable v = new Hashtable(); - - private static ALogger logger = ALogger.getLogger(ADefaultValues.class); - - private ADefaultValues() {} - - - - /** - * Variables controled by this class and their default values if the - * runtime config does not exist or if some values are missing in the file. - */ - private static void setDefaultValues() - { - String FILE_SEPAR = System.getProperty("file.separator"); - String homeDirectory = AGlobals.instance().getHomeDirectory(); - v.put("LastEventFilesSourceDir", homeDirectory + "events" + FILE_SEPAR); - v.put("LastEventFilesSaveDir", homeDirectory); - v.put("LastCanvasPlotSaveDir", homeDirectory); - v.put("JiveXMLServerName", ""); - v.put("JiveXMLServerPort", "48965"); - v.put("GeometryName", ""); - - } // setDefaultValues() ------------------------------------------------- - - - - private static Hashtable readRuntimeConfigFile() - { - Hashtable helpTable = null; - String line = null; - String[] l = null; - String patternLine = ".*=.*"; - Pattern pattern = Pattern.compile(patternLine); - - try - { - BufferedReader in = new BufferedReader(new FileReader(CONFIGFILE)); - helpTable = new Hashtable(); - logger.info("Atlantis runtime configuration file: " + CONFIGFILE); - - while((line = in.readLine()) != null) - { - Matcher matcher = pattern.matcher(line); - if(matcher.matches()) - { - l = line.split("="); - if(l != null && l.length == 2) - { - logger.debug("Configuration value: " + - l[0] + " : " + l[1] + " read in"); - - // remove quotes - l[1] = l[1].replaceAll("\"", ""); - helpTable.put(l[0].trim(), l[1].trim()); - } - else - { - logger.warn("Line: " + line + " from runtime " + - "configuration file: " + CONFIGFILE + - " does not match, line is ignored"); - } - } - } // while - - // file is successfully read in a helper Hash table - in.close(); - - return helpTable; - - } // try - catch(FileNotFoundException ex) - { - logger.warn("Runtime configuration file: " + CONFIGFILE + - " not found, using default runtime values"); - } - catch(IOException ex) - { - logger.error("I/O error while reading " + CONFIGFILE + - " file, using default runtime values"); - } - - return null; - - } // readRuntimeConfigFile() -------------------------------------------- - - - - public static void readRuntimeValues() - { - setDefaultValues(); - Hashtable help = readRuntimeConfigFile(); - if(help != null) - { - for(Enumeration e = v.keys() ; e.hasMoreElements() ;) - { - String s = (String) e.nextElement(); - if(help.containsKey(s)) - { - // keys match, update the value - v.remove(s); - v.put(s, help.get(s)); - } - } - } - - } // readRuntimeValues() ------------------------------------------------ - - - - public static void saveRuntimeValues() - { - try - { - // if exists, shall be overwritten - BufferedWriter out = new BufferedWriter(new FileWriter(CONFIGFILE)); - - for(Enumeration e = v.keys() ; e.hasMoreElements() ;) - { - String s = (String) e.nextElement(); - out.write(s + " = \"" + v.get(s) + "\"\n"); - } - out.close(); - } - catch(IOException ex) - { - logger.error("Can't open " + CONFIGFILE + " for writing, runtime " + - "configuration values not saved"); - } - - } // saveRuntimeValues() ------------------------------------------------ - - - - public static String get(String key) - { - if(v.containsKey(key)) - { - return(String) v.get(key); - } - else - { - logger.warn("Runtime configuration value: " + key + " does not exist", new Exception()); - return null; - } - - } // get() -------------------------------------------------------------- - - - - public static void set(String key, String value) - { - if(v.containsKey(key)) - { - v.remove(key); - v.put(key, value); - } - else - { - logger.warn("Runtime configuration value: " + key + " does not exist", new Exception()); - } - - } // set() -------------------------------------------------------------- - - - -} // class ADefaultValues =================================================== diff --git a/graphics/AtlantisJava/src/atlantis/config/package.html b/graphics/AtlantisJava/src/atlantis/config/package.html deleted file mode 100644 index 96bd70b4cacf27b711bac576fffc0029c639f737..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/config/package.html +++ /dev/null @@ -1,6 +0,0 @@ -<html> -<head></head> -<body> -<p>Classes for handling the configuration file and its contents.</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/data/A3DPointData.java b/graphics/AtlantisJava/src/atlantis/data/A3DPointData.java deleted file mode 100755 index b4354b3e564f3a797a189848c3d5b954e84a23b9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/A3DPointData.java +++ /dev/null @@ -1,254 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.*; -import atlantis.utils.*; - - -public abstract class A3DPointData extends AHitData { - - protected float[] rho; - protected float[] phi; - protected float[] z; - protected float[] x; - protected float[] y; - - - A3DPointData(AHashMap p, AEvent e) { - super(p,e); - if(p.get("x")!=null) { - x=p.getFloatArray("x"); - y=p.getFloatArray("y"); - z=p.getFloatArray("z"); - rho=new float[numData]; - phi=new float[numData]; - - // this is needed for the moment so that S3D sub and layer can be - // calculated from rph,phi,z rho phi from x y - for(int i=0; i<rho.length; ++i) { - double dx=x[i]; - double dy=y[i]; - - rho[i]=(float)(Math.sqrt(dx*dx+dy*dy)); - phi[i]=(float)(Math.atan2(dy, dx)); - if(phi[i]<0.) phi[i]+=AMath.TWO_PI; - } - } else { - rho=p.getFloatArray("rho"); - phi=p.getFloatArray("phi"); - z=p.getFloatArray("z"); - x=new float[numData]; - y=new float[numData]; - calculateXY(rho, phi, x, y); - } - } - - - public float[] getRho() - { - return rho; - } - - - public float[] getPhi() - { - return phi; - } - - - public float[] getX() - { - return x; - } - - - public float[] getY() - { - return y; - } - - - public float[] getZ() - { - return z; - } - - - protected void calculateRhoPhi() - { - calculateRhoPhi(x, y, rho, phi); - } - - protected ACoord getYXUser() { - makeDrawList(); - double[] h=new double[numDraw]; - double[] v=new double[numDraw]; - int[] index=new int[numDraw]; - - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - h[i]=x[list]; - v[i]=y[list]; - index[i]=list; - } - return new ACoord(h, v, index, this); - } - - protected ACoord getRZUser() { - makeDrawList(); - double[] h=new double[numDraw]; - double[] v=new double[numDraw]; - int[] index=new int[numDraw]; - - double phiMid=Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - if(phiMid>AMath.TWO_PI) phiMid-=AMath.TWO_PI; - - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - h[i]=z[list]; - double phiDiff=Math.abs(phi[list]-phiMid); - if(phiDiff<Math.PI/2.||phiDiff>3*Math.PI/2.) - { - v[i] = rho[list]; - } - else - { - v[i] = -rho[list]; - } - index[i]=list; - - } - return new ACoord(h, v, index, this); - } - - protected ACoord getXZUser() { - makeDrawList(); - double[] h=new double[numDraw]; - double[] v=new double[numDraw]; - int[] index=new int[numDraw]; - - double phi0=Math.toRadians(AProjectionXZ.getPhi()); - double cosPhi0=Math.cos(phi0); - double sinPhi0=Math.sin(phi0); - - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - h[i]=z[list]; - v[i]=x[list]*cosPhi0+y[list]*sinPhi0; - index[i]=list; - } - return new ACoord(h, v, index, this); - } - - protected ACoord getYZUser() { - makeDrawList(); - double[] h=new double[numDraw]; - double[] v=new double[numDraw]; - int[] index=new int[numDraw]; - - double phi0=Math.toRadians(AProjectionXZ.getPhi()); - double cosPhi0=Math.cos(phi0); - double sinPhi0=Math.sin(phi0); - - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - h[i]=z[list]; - v[i]=y[list]*cosPhi0-x[list]*sinPhi0; - index[i]=list; - } - return new ACoord(h, v, index, this); - } - - protected ACoord get3DUser() { - makeDrawList(); - double[][] hvo=AProjection3D.getRotated(numDraw, listdl, x, y, z); - double[] h=hvo[0]; - double[] v=hvo[1]; - int[] index=new int[numDraw]; - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - index[i]=list; - } - return new ACoord(h, v, index, this); - } - -// does not fit in normal scheme - public double[][] get3DPoints() { - makeDrawList(); - double[][] xyz =new double[numDraw][3]; - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - xyz[i][0]=x[list]; - xyz[i][1]=y[list]; - xyz[i][2]=z[list]; - } - return xyz; - } - -// does not fit in normal scheme - public int[] get3DPointsIndex() { - makeDrawList(); - int[] index=new int[numDraw]; - for(int i=0; i<numDraw; i++) - index[i]=listdl[i]; - return index; - } - - protected ACoord getFZUser() { - makeDrawList(); - double[] h=new double[numDraw]; - double[] v=new double[numDraw]; - int[] index=new int[numDraw]; - - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - h[i]=z[list]; - v[i]=Math.toDegrees(phi[list]); - index[i]=list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FZ"); - } - - protected ACoord getFRUser() { - makeDrawList(); - double[] h=new double[numDraw]; - double[] v=new double[numDraw]; - int[] index=new int[numDraw]; - - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - h[i]=rho[list]; - v[i]=Math.toDegrees(phi[list]); - index[i]=list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FR"); - } - - protected ACoord getVPUser() { - makeDrawList(); - // each point is drawn twice - int numTotal=2*numDraw; - double[] h=new double[numTotal]; - double[] v=new double[numTotal]; - int[] index=new int[numTotal]; - - double[] sign=new double[] {-1., 1.}; - int num=0; - - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - double eta=AParameterUtilities.eta(z[list], rho[list]); - double delEta=AProjectionVP.getDeltaEta(rho[list], z[list]); - for(int j=0; j<2; j++) { - h[num]=eta+sign[j]*delEta; - v[num]=AParameterUtilities.phi(x[list], y[list]); - index[num]=list; - num++; - } - } - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AAODData.java b/graphics/AtlantisJava/src/atlantis/data/AAODData.java deleted file mode 100644 index 8c412fd11398eba62070ac531a4ff2dc0c14bb9c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AAODData.java +++ /dev/null @@ -1,359 +0,0 @@ -package atlantis.data; - -import atlantis.event.AData; -import atlantis.event.*; -import java.util.Vector; - -import atlantis.canvas.AWindow; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionVP; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -public abstract class AAODData extends AData -{ - protected float[] eta; - protected float[] phi; - protected float[] pT; - - AAODData(AHashMap p, AEvent e) - { - super(p,e); - eta = p.getFloatArray("eta"); - phi = p.getFloatArray("phi"); - pT = p.getFloatArray("pt"); - int[] pdgId = p.getUnsureIntArray("pdgId"); - if(pdgId != null) - { - for(int i=0; i<pT.length; i++) - pT[i] *= -AMath.getSign(pdgId[i]); - } - - if (p.get("clusterKey") != null) - { - int[] clusterLinkCount = p.getUnsureIntArray("clusterLinkCount"); - event.getAssociationManager().add(new AObjectsAssociation(getFullName(), "Cluster", - p.getStringArray("clusterKey"), p.getIntArray("clusterIndex"), clusterLinkCount, event)); - } - if (p.get("trackKey") != null) - { - int[] trackLinkCount = p.getUnsureIntArray("trackLinkCount"); - event.getAssociationManager().add(new AObjectsAssociation(getFullName(), "Track", - p.getStringArray("trackKey"), p.getIntArray("trackIndex"), trackLinkCount, event)); - } - } - - - public float getEta(int index) - { - return eta[index]; - } - - - public float getPhi(int index) - { - return phi[index]; - } - - - public float getPT(int index) - { - return pT[index]; - } - - - public float[] getEta() - { - return eta; - } - - - public float[] getPhi() - { - return phi; - } - - - public float[] getPT() - { - return pT; - } - - - protected int internalColor() - { - int colorFunction=parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if(colorFunction==0) - colorByConstant(); - else if(colorFunction==1) - colorByIndex(); - - return 1; - } - - public String getNameScreenName() - { - return getParameterGroup(); - } - - protected int getDrawOrFill() - { - return AGraphics.FILL; - } - - protected void applyCuts() - { - cutIndex(); - cutPhi(phi); - cutEta(eta); - } - - // info on AOD data contained in V-Plot rubberband selection - public String getVPHitInfo() - { - makeDrawList(); - if (numDraw == 0) - return ""; - double sumP = 0.; - double sumPt = 0.; - - for (int i = 0; i < numDraw; ++i) - { - sumPt += Math.abs(pT[listdl[i]]); - sumP += Math.abs(pT[listdl[i]] / Math.cos(AMath.lambda(eta[listdl[i]]))); - } - - StringBuffer msg = new StringBuffer(""); - msg.append(numDraw); - msg.append(" "); - msg.append(getFullName()); - msg.append(" sum(PT) = "); - msg.append(String.format("%.1f", sumPt)); - msg.append(" sum(P) = "); - msg.append(String.format("%.1f",sumP)); - - return msg.toString(); - } - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if(projection instanceof AProjectionVP) - { - drawVP(window, ag, projection); - } - else - { - super.draw(window, ag, projection); - } - } - - protected ACoord getYXUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - double dphi = Math.toRadians(0.5); - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiPlus = phi[list] + dphi; - double phiMinus = phi[list] - dphi; - double cosPlus = Math.cos(phiPlus); - double sinPlus = Math.sin(phiPlus); - double cosMinus = Math.cos(phiMinus); - double sinMinus = Math.sin(phiMinus); - //same rhoMax/Minus values used in AJetData - double rhoMax = 1200; - double rhoMinus = 400; - //if no composite particles increase AOD size - Vector<String> keys = event.getCollections().get("CompositeParticle"); - if(keys == null || !parameterStore.get("Data", "CompositeParticle").getStatus()) - rhoMax=1200; - else if(PARAMETER_GROUP.equals("CompositeParticle")) - { - // display composite particle outside of normal AOD data - rhoMax=1200; - rhoMinus=800; - } - - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double rhoPlus = rhoMax; - double s = 10; - if(Math.abs(pT[list]) < maxEnergy) - rhoPlus = rhoMinus + (rhoMax - rhoMinus) * s *Math.abs(pT[list]) / maxEnergy; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = rhoMinus * cosPlus; - hv[1][i][0] = rhoMinus * sinPlus; - // x1, y1 - hv[0][i][1] = rhoPlus * cosPlus; - hv[1][i][1] = rhoPlus * sinPlus; - // x2, y2 - hv[0][i][2] = rhoPlus * cosMinus; - hv[1][i][2] = rhoPlus * sinMinus; - // x3, y3 - hv[0][i][3] = rhoMinus * cosMinus; - hv[1][i][3] = rhoMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - - protected ACoord getFRUser() - { - ACoord coordFR = getYXUser().convertYXToFR().includePhiWrapAround("FR"); - return coordFR; - } - - protected ACoord getRZUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - double dtheta = Math.toRadians(0.5); - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi[list]-phiMid); - double rSign; - if (phiDiff > Math.PI/2. && phiDiff <= 3*Math.PI/2.) - rSign = -1; - else - rSign = 1; - - // calculate theta based on the eta value - double theta = Math.atan(Math.exp(-Math.abs(eta[list]))) * 2.0; - if ((eta[list] > 0.) && (rSign == -1)) - theta = 2 * Math.PI - theta; - else if ((eta[list] < 0.) && (rSign == -1)) - theta += Math.PI; - else if ((eta[list] < 0.) && (rSign == 1)) - theta = Math.PI - theta; - - double thetaPlus = theta + dtheta; - double thetaMinus = theta - dtheta; - double cosPlus = Math.cos(thetaPlus); - double sinPlus = Math.sin(thetaPlus); - double cosMinus = Math.cos(thetaMinus); - double sinMinus = Math.sin(thetaMinus); - - // decide the region based on the theta value - final byte TOP_BOTTOM = 0; - final byte LEFT_RIGHT = 1; - byte region = TOP_BOTTOM; - // hard-coded value is based on the values in Geometry - if(Math.abs(Math.tan(theta)) < 0.8) - region = LEFT_RIGHT; - - double radiusMinus = 0.; - switch(region) - { - case TOP_BOTTOM: - if(PARAMETER_GROUP.equals("CompositeParticle")) - radiusMinus = 750 / Math.abs(Math.sin(theta)); - else - radiusMinus = 550 / Math.abs(Math.sin(theta)); - break; - case LEFT_RIGHT: - if(PARAMETER_GROUP.equals("CompositeParticle")) - radiusMinus = 850 / Math.abs(Math.cos(theta)); - else - radiusMinus = 700 / Math.abs(Math.cos(theta)); - break; - } - //same rhoMax/Minus values used in AJetData - double radiusMax = radiusMinus + 500; - //if no composite particles increase AOD size - Vector keys = (Vector) event.getCollections().get("CompositeParticle"); - if(keys == null || !parameterStore.get("Data", "CompositeParticle").getStatus()) - radiusMax+=200; - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double radiusPlus = radiusMax; - double s = 10; - if(Math.abs(pT[list]) < maxEnergy) - radiusPlus = radiusMinus + (radiusMax - radiusMinus) * s * Math.abs(pT[list]) / maxEnergy; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = radiusMinus * cosPlus; - hv[1][i][0] = radiusMinus * sinPlus; - // x1, y1 - hv[0][i][1] = radiusPlus * cosPlus; - hv[1][i][1] = radiusPlus * sinPlus; - // x2, y2 - hv[0][i][2] = radiusPlus * cosMinus; - hv[1][i][2] = radiusPlus * sinMinus; - // x3, y3 - hv[0][i][3] = radiusMinus * cosMinus; - hv[1][i][3] = radiusMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - - protected ACoord getVPUser() - { - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index=new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list=listdl[i]; - h[i]=eta[list]; - v[i]=Math.toDegrees(phi[list]); - index[i]=list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - } - - private void drawVP(AWindow window, AGraphics ag, AProjection2D projection) - { - ACoord centers = window.calculateDisplay(getUser(projection)); - int[] drawlist = centers.index; - double eLimit = 0.025; - int numPoints = 25; - if(PARAMETER_GROUP.equals("CompositeParticle")) - numPoints = 5; - double[][][] hv = new double[2][drawlist.length][numPoints]; //circle - // a cross at centre - double[][][] hv_cross1 = new double[2][drawlist.length][2]; - double[][][] hv_cross2 = new double[2][drawlist.length][2]; - int crossLength = 6; - - for(int i=0; i<drawlist.length; ++i) - { - int list = drawlist[i]; - double e; - e = Math.abs(pT[list]); - int d = (int)(Math.sqrt((e/eLimit)/Math.PI)); - if(d == 0) d = 1; - for(int j=0; j<numPoints; j++) - { - hv[0][i][j]=centers.hv[0][0][i]+d*Math.cos(Math.PI*2*j/(numPoints-1)); - hv[1][i][j]=centers.hv[1][0][i]+d*Math.sin(Math.PI*2*j/(numPoints-1)); - } - for(int j=0; j<2; j++) - { - hv_cross1[0][i][j]=centers.hv[0][0][i]+crossLength/2*Math.cos(Math.PI*(1+4*j)/4); - hv_cross1[1][i][j]=centers.hv[1][0][i]+crossLength/2*Math.sin(Math.PI*(1+4*j)/4); - hv_cross2[0][i][j]=centers.hv[0][0][i]+crossLength/2*Math.cos(Math.PI*(3+4*j)/4); - hv_cross2[1][i][j]=centers.hv[1][0][i]+crossLength/2*Math.sin(Math.PI*(3+4*j)/4); - } - } - ag.draw(new ACoord(hv, drawlist, this, ACoord.POLYLINES)); - ag.draw(new ACoord(hv_cross1, drawlist, this, ACoord.POLYLINES)); - ag.draw(new ACoord(hv_cross2, drawlist, this, ACoord.POLYLINES)); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ABJetData.java b/graphics/AtlantisJava/src/atlantis/data/ABJetData.java deleted file mode 100755 index 7c047a26efa95e7928e03b5903b05ba7db29419f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ABJetData.java +++ /dev/null @@ -1,134 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; -import atlantis.utils.A3Vector; -import atlantis.utils.A4Vector; - -/** - * Reconstructed B-Jet - */ -public class ABJetData extends AAODData -{ - private float[] lhSig; - private float[] weight; - private String[] label; - private float[] mass; - //Variable to ensure backwards compatability - protected boolean has4Vect = false; - - ABJetData(AHashMap p, AEvent e) - { - super(p,e); - lhSig=p.getFloatArray("lhSig"); - weight=p.getFloatArray("weight"); - label=p.getUnsureStringArray("label"); - if (p.get("mass") != null) { - mass=p.getFloatArray("mass"); - has4Vect = true; - } - } - - public String getParameterGroup() - { - return "BJet"; - } - - public float getweight(int index) - { - return weight[index]; - } - - public float getlhSig(int index) - { - return lhSig[index]; - } - - public String getLabel(int index) - { - return label[index]; - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - if(has4Vect){ - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A4Vector start = new A4Vector(); - start.setPtEtaPhiM(pT[k],eta[k],phi[k],mass[k]); - sum.add(start); - } - }else{ - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A3Vector start = A3Vector.fromRhoPhiZ(0., 0., 0.); - double tL = AMath.tanLambda(eta[k]); - A3Vector stop = A3Vector.fromRhoPhiZ(1., phi[k], tL); - A3Vector v = (stop.subtract(start)).normalize(); - double p = pT[k] / Math.sqrt(1. - v.z * v.z); - sum.add(new A4Vector(v.scale(p), 0.)); - } - } - return sum; - } - - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsObjects", "BJetPt", " |ET|", pT); - cut("CutsObjects", "BJetlhSig", " |lhSig|", lhSig); - cut("CutsObjects", "BJetweight", " |weight|", weight); - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n PT="+String.format("%.3f",pT[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",phi[index])+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Px="+String.format("%.3f",pT[index]*Math.cos(phi[index]))+" GeV "+ - "\n Py="+String.format("%.3f",pT[index]*Math.sin(phi[index]))+" GeV "+ - "\n Pz="+String.format("%.3f",pT[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - if(label != null) - { - msg.append("\n label = "); - msg.append(label[index]); - } - msg.append("\n PT = "); - msg.append(String.format("%.3f",pT[index])); - msg.append(" GeV\n P = "); - msg.append(String.format("%.3f",Math.abs(pT[index]/Math.cos(AMath.lambda(eta[index]))))); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",phi[index])); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - msg.append("\n lhSig = "); - msg.append(lhSig[index]); - msg.append("\n weight = "); - msg.append(weight[index]); - - return msg.toString(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ACSCDData.java b/graphics/AtlantisJava/src/atlantis/data/ACSCDData.java deleted file mode 100755 index d724dfe7fc75a4d4af42dd257477295d9e02bbd9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ACSCDData.java +++ /dev/null @@ -1,304 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.ALogger; - -public class ACSCDData extends AMuonHitData -{ - private static final double CSC_TILT_ANGLE = Math.toRadians(-11.59); - - float[] charge; - float[] length; - int[] gasGap; - - private static ALogger logger = ALogger.getLogger(ACSCDData.class); - - public String getParameterGroup() - { - return "CSC"; - } - - public String getName() - { - return "CSCD"; - } - - public String getNameScreenName() - { - return "CSC Digits"; - } - - ACSCDData(AHashMap p, AEvent e) - { - super(p,e); - - if (p.get("length") != null) { - length=p.getFloatArray("length"); - } else { - // If no length is given, just use an arbitrary minimum length - length = new float[numData]; - for (int i=0; i<numData; i++) - length[i] = 10.f; - } - - charge=p.getFloatArray("charge"); - - gasGap = new int[numData]; - for (int i=0; i<numData; i++) { - try { - gasGap[i] = AIdHelper.cscWireLayer(id[i]); - } catch (AAtlantisException aex) { - gasGap[i] = 0; - } - } - } - - protected int getStation(int index) - { - return 0; - } - - protected int getSub(int index) - { - try { - if (AIdHelper.stationEta(id[index]) < 0) { - return 0; - } else { - return 1; - } - - } catch (AAtlantisException e) { - logger.error("Problem decoding TGC identifier", e); - } - - return 0; - } - - public int getSector(int index) - { - try { - String stationName = AIdHelper.stationName(id[index]); - - if (stationName.charAt(2) == 'L') { - return 2 * (AIdHelper.stationPhi(id[index]) - 1); - } else { - return 2 * (AIdHelper.stationPhi(id[index]) - 1) + 1; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding CSCD identifier", e); - } - - return 0; - } - - protected boolean getMeasuresPhi(int index) - { - try { - if (AIdHelper.cscMeasuresPhi(id[index]) == 1) { - return true; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding CSCD identifier", e); - } - - return false; - } - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsMuon", "Charge", " Charge", charge); - cutPhi(phi); - cutEta(rho, z); - } - - protected int getDrawOrFill() - { - return AGraphics.FILL; - } - - protected ACoord getYXUser() - { - makeDrawList(); - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_MDT_INNER) - return ACoord.NO_DATA; - - AParameter cscGasGap = parameterStore.get("YX", "CSCGasGap"); - if (cscGasGap.getStatus()) - cutArray(gasGap, cscGasGap.getI(), "CSC Gas Gap"); - - double[][][] hv = new double[2][numDraw][2]; - int index[] = new int[numDraw]; - - try { - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - index[i] = j; - - if (AIdHelper.cscMeasuresPhi(id[j]) == 1) { - double phi = Math.atan2(y[j], x[j]); - double rho = Math.sqrt(x[j]*x[j] + y[j]*y[j]); - double drho = length[j]/2.; - - hv[0][i][0] = (rho - Math.cos(CSC_TILT_ANGLE) * drho) * Math.cos(phi); - hv[1][i][0] = (rho - Math.cos(CSC_TILT_ANGLE) * drho) * Math.sin(phi); - hv[0][i][1] = (rho + Math.cos(CSC_TILT_ANGLE) * drho) * Math.cos(phi); - hv[1][i][1] = (rho + Math.cos(CSC_TILT_ANGLE) * drho) * Math.sin(phi); - } else { - double phi = Math.atan2(y[j], x[j]); - double rho = Math.sqrt(x[j]*x[j] + y[j]*y[j] + length[j]*length[j]/4.); - double dphi = Math.asin((length[j]/2.) / rho); - - hv[0][i][0] = rho * Math.cos(phi - dphi); - hv[1][i][0] = rho * Math.sin(phi - dphi); - hv[0][i][1] = rho * Math.cos(phi + dphi); - hv[1][i][1] = rho * Math.sin(phi + dphi); - } - } - - return new ACoord(hv, index, this); - } catch (AAtlantisException e) { - AOutput.append("Error decoding CSC identifier: " + e.getMessage(), ALogInterface.BAD_COMMAND); - return ACoord.NO_DATA; - } - } - - protected ACoord getFRUser() - { - return getYXUser().convertYXToFR().includePhiWrapAround("FR"); - } - - protected ACoord getXZRZUser(int sign[]) - { - double[][][] hv = new double[2][numDraw][]; - int index[] = new int[numDraw]; - - try { - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - index[i] = j; - - double rho = Math.sqrt(x[j]*x[j] + y[j]*y[j]); - - if (AIdHelper.cscMeasuresPhi(id[j]) == 1) { - double drho = length[j]/2.; - if(z[j] < 0){ - hv[0][i] = new double[] {z[j] - sign[i]*Math.sin(CSC_TILT_ANGLE) * drho, - z[j] + sign[i]*Math.sin(CSC_TILT_ANGLE) * drho }; - - hv[1][i] = new double[] { sign[i] * (rho + sign[i]*Math.cos(CSC_TILT_ANGLE) * drho), - sign[i] * (rho - sign[i]*Math.cos(CSC_TILT_ANGLE) * drho) }; - - }else{ - hv[0][i] = new double[] {z[j] - Math.sin(CSC_TILT_ANGLE) * drho, - z[j] + Math.sin(CSC_TILT_ANGLE) * drho }; - - - hv[1][i] = new double[] { sign[i] * (rho - Math.cos(CSC_TILT_ANGLE) * drho), - sign[i] * (rho + Math.cos(CSC_TILT_ANGLE) * drho) }; - } - - - - } else { - hv[0][i] = new double[] { z[j] }; - hv[1][i] = new double[] { sign[i] * rho }; - } - - } - - return new ACoord(hv, index, this); - } - catch (AAtlantisException e) { - AOutput.append("Error decoding CSC identifier: " + e.getMessage(), ALogInterface.BAD_COMMAND); - return ACoord.NO_DATA; - } - - } - - - - - protected ACoord getXZUser() { - makeDrawList(); - cutMuonSector(sector); - - int[] sign = new int[numDraw]; - int sect = (int) Math.round(parameterStore.get("XZ", "Phi").getD() / 22.5); - - for(int i=0; i<numDraw; i++) { - if (sector[listdl[i]] == sect) - sign[i] = 1; - else - sign[i] = -1; - } - - return getXZRZUser(sign); - } - - protected ACoord getRZUser() { - makeDrawList(); - - int[] sign = new int[numDraw]; - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - sign[i] = AParameterUtilities.getRhoSign(x[j], y[j]); - } - - return getXZRZUser(sign); - } - - protected ACoord getFZUser() - { - double[][][] hv = new double[2][numDraw][]; - int index[] = new int[numDraw]; - - try { - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - index[i] = j; - - double rho = Math.sqrt(x[j]*x[j] + y[j]*y[j]); - double phi = Math.toDegrees(Math.atan2(y[j], x[j])); - - if (AIdHelper.cscMeasuresPhi(id[j]) == 1) { - double drho = length[j]/2.; - - hv[0][i] = new double[] { z[j] - Math.sin(CSC_TILT_ANGLE) * drho, - z[j] + Math.sin(CSC_TILT_ANGLE) * drho }; - hv[1][i] = new double[] { phi, phi }; - } else { - double dphi = Math.toDegrees(Math.atan2(length[j]/2., rho)); - - hv[0][i] = new double[] { z[j], z[j] }; - hv[1][i] = new double[] { phi-dphi, phi+dphi }; - } - } - - return new ACoord(hv, index, this); - } catch (AAtlantisException e) { - AOutput.append("Error decoding CSCD identifier: " + e.getMessage(), ALogInterface.BAD_COMMAND); - return ACoord.NO_DATA; - } - } - - // only constant color possible for the strips - protected int internalColor() - { - int constantColor=parameterStore.get(PARAMETER_GROUP, "Strip").getI(); - for(int i=0; i<numData; i++) - color[i]=(byte)constantColor; - return 0; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ACSCData.java b/graphics/AtlantisJava/src/atlantis/data/ACSCData.java deleted file mode 100755 index 5149a5133bd3d52cbb6e3a3d21d006eec96de89d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ACSCData.java +++ /dev/null @@ -1,197 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.ALogger; - -public class ACSCData extends AMuonHitData -{ - float[] sigma; - - private static ALogger logger = ALogger.getLogger(ACSCData.class); - - public String getParameterGroup() - { - return "CSC"; - } - - public String getName() - { - return "CSC"; - } - - public String getNameScreenName() - { - return "CSC"; - } - - ACSCData(AHashMap p, AEvent e) - { - super(p,e); - sigma=p.getFloatArray("sigma"); - } - - protected int getStation(int index) - { - return 0; - } - - protected int getSub(int index) - { - try { - if (AIdHelper.stationEta(id[index]) < 0) { - return 0; - } else { - return 1; - } - - } catch (AAtlantisException e) { - logger.error("Problem decoding TGC identifier", e); - } - - return 0; - } - - public int getSector(int index) - { - try { - String stationName = AIdHelper.stationName(id[index]); - - if (stationName.charAt(2) == 'L') { - return 2 * (AIdHelper.stationPhi(id[index]) - 1); - } else { - return 2 * (AIdHelper.stationPhi(id[index]) - 1) + 1; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding CSC identifier", e); - } - - return 0; - } - - protected boolean getMeasuresPhi(int index) - { - try { - if (AIdHelper.cscMeasuresPhi(id[index]) == 1) { - return true; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding CSC identifier", e); - } - - return false; - } - - protected void applyCuts() - { - super.applyCuts(); - cutPhi(phi); - cutEta(rho, z); - } - - protected ACoord getYXUser() - { - makeDrawList(); - int mode=parameterStore.get("YX", "Mode").getI(); - if(mode!=5) - numDraw=0; - - double[] h=new double[numDraw]; - double[] v=new double[numDraw]; - int[] index=new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list=listdl[i]; - h[i]=x[list]; - v[i]=y[list]; - index[i]=list; - } - return new ACoord(h, v, index, this); - } - - protected ACoord getXZRZUser(int[] sign) - { - int numPoints=2; - - double[][][] hv=new double[2][numDraw][numPoints]; - int[] index=new int[numDraw]; - - // space point resolution is 60um in rz and 5mm in rphi (due to no uniform b field) - // from muonTDR page 201 - // double dRho=0.254; - // double dZMax=1.25; - - double alpha=-11.59; - double sinAlphaCopy=Math.sin(Math.toRadians(alpha)); - double cosAlphaCopy=Math.cos(Math.toRadians(alpha)); - - for(int i=0; i<numDraw; i++) - { - int list=listdl[i]; - - double rMid=sign[i]*getSectorRho(sector[list], rho[list], phi[list]); - double zMid=z[list]; - // double dZ = 2. * dZMax * Math.min(charge[list] / (25. * 75000.), 0.9); - double dRho=sigma[list]; - - double sinAlpha=sinAlphaCopy; - double cosAlpha=cosAlphaCopy; - - if(zMid>0.) - cosAlpha*=-1.; - if(rMid<0.) - sinAlpha*=-1.; - - hv[0][i][0]=zMid-sinAlpha*dRho; - hv[0][i][1]=zMid+sinAlpha*dRho; - hv[1][i][0]=rMid+cosAlpha*dRho; - hv[1][i][1]=rMid-cosAlpha*dRho; - index[i]=list; - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - } - - protected int getDrawOrFill() - { - return AGraphics.DRAW; - } - - protected ACoord getRZUser() - { - makeDrawList(); - int[] sign=new int[numDraw]; - double phiMid=Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - - for(int i=0; i<numDraw; i++) - { - double phiDiff=Math.abs(phi[listdl[i]]-phiMid); - - sign[i]=-1; - if(phiDiff<Math.PI/2.||phiDiff>3*Math.PI/2.) - sign[i]=1; - } - return getXZRZUser(sign); - } - - protected ACoord getXZUser() - { - makeDrawList(); - cutMuonSector(sector); - int[] sign=new int[numDraw]; - int sect=(int)Math.round(parameterStore.get("XZ", "Phi").getD() / 22.5); - - for(int i=0; i<numDraw; i++) - { - sign[i]=1; - if(sector[listdl[i]]!=sect) - sign[i]=-1; - } - return getXZRZUser(sign); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ACalorimeterData.java b/graphics/AtlantisJava/src/atlantis/data/ACalorimeterData.java deleted file mode 100644 index e82e3d4a07efb99304969748103bfd430b79a138..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ACalorimeterData.java +++ /dev/null @@ -1,2662 +0,0 @@ -package atlantis.data; - -import atlantis.event.AEvent; -import java.awt.Color; -import java.util.Vector; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.ADrawCalorimeterSummedEndcaps; -import atlantis.canvas.ALegendWindow; -import atlantis.canvas.AWindow; -import atlantis.event.AData; -import atlantis.geometry.ABarrelCalorimeterDetector; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.geometry.AEndcapCalorimeterDetector; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.ADrawParameters; -import atlantis.graphics.ADrawnGraphics2D; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionYX; -import atlantis.utils.A4Vector; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.AMath; -import atlantis.utils.APolygon; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; - -/** - * The superclass of all the ATLAS calorimeters. Contains also methods for - * drawing groups of calorimeters together. Calorimeters can not be drawn - * individually due to coupling of energy scale and the standard v-plot picture. - * Each calorimeter also provides histograms. - * - * @author Eric Jansen - */ -public abstract class ACalorimeterData extends AHitData implements AHistogramData -{ - private static ALogger logger = ALogger.getLogger(ACalorimeterData.class); - - // Constants as defined in the configuration file. - // Energy mode options. - public static final int ENERGY_MODE_SUM_LIN = 0; - public static final int ENERGY_MODE_MAX_LIN = 1; - public static final int ENERGY_MODE_SUM_LOG = 2; - public static final int ENERGY_MODE_MAX_LOG = 3; - public static final int ENERGY_MODE_SUM_SQRT = 4; - public static final int ENERGY_MODE_MAX_SQRT = 5; - - // Energy calibration options. - public static final int ENERGY_CALIB_UNKNOWN = -1; - public static final int ENERGY_CALIB_OVERALL = 0; - public static final int ENERGY_CALIB_BY_TYPE = 1; - public static final int ENERGY_CALIB_BY_CALO = 2; - - // Color functions. - public static final int COLOR_FUNC_CONSTANT = 0; - public static final int COLOR_FUNC_SUBDET = 1; - public static final int COLOR_FUNC_CLUSTER = 2; - public static final int COLOR_FUNC_SAMPLING = 3; - public static final int COLOR_FUNC_ENERGY = 4; - public static final int COLOR_FUNC_JET = 5; - public static final int COLOR_FUNC_TYPE = 6; - public static final int COLOR_FUNC_TIME = 7; - - private static final float SCALE_FACTOR_VPLOT = 20; - - public String CALORIMETER_NAME; - - // Properties needed for the histograms. - protected double innerR; - protected double outerR; - protected double innerZ; - protected double outerZ; - protected double outerEta; - - protected double phiGranularity = 0.0; - protected double etaGranularity = 0.0; - protected AParameter histoScale; - - // This constant contains the highest phi or eta index for this data type. - // Its value determines the amount of memory that is allocated for certain - // data structures. - protected short MAX_HIT_INDEX = 512; - protected static final double NON_SCALING_FACTOR = 0.85; - - protected float[] phi; - protected float[] eta; - protected float[] dphi; - protected float[] deta; - protected float[] energy; - protected float[] et; - protected float[] etSum; - - // Et is more useful than pure Energy, so use Et to replace Energy - // protected float[] energySum; - - protected byte[] side; - protected short[] etaIndex; - protected short[] phiIndex; - protected int[] sampling; - protected short[] detector; - - private int[][] cellTable; - - protected double minDensityECAL; - protected double maxDensityECAL; - protected double minDensityHCAL; - protected double maxDensityHCAL; - - // following attributes occur at majority of calorimeter subdetectors - // which inherit from here, but not at all of them (TILE is usually - // the exception), checks are always done, so it's save ; - // retrieving the data from XML is pre-checked so that not to spit out - // unnecessary complaints - protected int[] feedThrough = null; - protected int[] channel = null; - protected int[] slot = null; - protected int[] BadCell = null; - - - ACalorimeterData(AHashMap p, AEvent e) - { - super(p,e); - - CALORIMETER_NAME = getName(); - - energy = p.getFloatArray("energy"); - et = new float[numData]; - - phi = new float[numData]; - eta = new float[numData]; - deta = new float[numData]; - dphi = new float[numData]; - - // energySum = new float[numData]; - etSum = new float[numData]; - - side = new byte[numData]; - etaIndex = new short[numData]; - phiIndex = new short[numData]; - sampling = new int[numData]; - detector = new short[numData]; - - histoScale = parameterStore.get(CALORIMETER_NAME, "HistoScale"); - - // using AHashMap.getUnsureIntArray() does not complain if key is - // not found - these parameters may not be present in all calorimetry - // classes inherited from ACalorimeterData and using this call - // also covers backwards compatibility, and is safe - null is returned - // if key does not exist - feedThrough = p.getUnsureIntArray("feedThrough"); - channel = p.getUnsureIntArray("channel"); - slot = p.getUnsureIntArray("slot"); - BadCell = p.getUnsureIntArray("BadCell"); - - } - - /** - * Get the name used for associating this datatype/collection. For the - * calorimeter cells no storegate key is used. - * @return - */ - public String getFullName() { - return getName(); - } - - /** - * getADCCountsData() - * reads in adcCounts array from XML data. This method is currently used - * for LAr, FCAL, HEC and MBTS (TILE has two adcCounts arrays) - * @param p AHashMap - */ - protected int[][] getADCCountsData(AHashMap p) - { - int[][] adcCounts = null; - int[] adc = (p.get("adcCounts") != null) ? p.getIntArray("adcCounts") : null; - if(adc != null) - { - adcCounts = new int[numData][0]; - // multiple numbers are associated with each cell - int multiple = adc.length / numData; - int num = 0; - for(int i = 0; i < numData; i++) - { - adcCounts[i] = new int[multiple]; - for (int j = 0; j < multiple; j++) - { - adcCounts[i][j] = adc[num]; // fill in array for each cell - num++; - } - } - } // if(adc != null) - - return adcCounts; - - } // getADCCountsData() ------------------------------------------------- - - - - /** - * Class used to merge ACoord[] objects. - */ - public static class ACoordArray - { - private Vector<ACoord> v = new Vector<ACoord>(); - - public void add(ACoord[] c) - { - for (int i = 0; i < c.length; i++) - { - v.addElement(c[i]); - } - } - - public ACoord[] getArray() - { - ACoord[] c = new ACoord[v.size()]; - for (int i = 0; i < v.size(); i++) - { - c[i] = (ACoord) v.elementAt(i); - } - return c; - } - } - - - - /** - * Assigns the hits to a geometry object. - */ - public void makeHitToGeometryMapping() - { - int numNotFound = 0; - - // In detector[] we store the hit-to-geometry object mapping. - for (int i = 0; i < numData; i++) - { - detector[i] = (short) ACalorimeterDetector.getDetectorIndex(id[i]); - - if (detector[i] >= 0) - { - eta[i] = (float) ACalorimeterDetector.get(detector[i]).getEta(etaIndex[i], side[i]); - deta[i] = (float) ACalorimeterDetector.get(detector[i]).getDeltaEta(); - phi[i] = (float) ACalorimeterDetector.get(detector[i]).getPhi(phiIndex[i]); - dphi[i] = (float) ACalorimeterDetector.get(detector[i]).getDeltaPhi(); - } - else if (!CALORIMETER_NAME.equals("FCAL")) - { - eta[i] = 0.0f; - deta[i] = 0.0f; - phi[i] = 0.0f; - dphi[i] = 0.0f; - numNotFound++; - } - } - if (numNotFound > 0) - { - System.err.println(numNotFound + "/" + numData + " cells in " + - CALORIMETER_NAME + " not mapped to a geometry object. These will not be drawn."); - } - - // This depends on the number of geometry objects. - cellTable = new int[2 * ACalorimeterDetector.count()][2 * MAX_HIT_INDEX]; - } - - /** - * Returns the name of the calorimeter this data object belongs to. - * - * @return calorimeter name - */ - public String getCalorimeterName() - { - return CALORIMETER_NAME; - } - - - /** - * Method is called from APickInteraction and plots pulse shapes plots - * for a cell when picked. - * @param index int - */ - public void plotPulseShapes(int index, boolean withcurve) { - int[][] adc = getADCCounts(index); - if (adc == null) { - logger.warn("Pulse shape plot requested but no adc data available"); - return; - } - - if (!withcurve) { - APulseShapePlot.plotADCCounts(adc, getPulseTitleString(index), null); - } else { - double[][] ps = getPulseShape(index); - if (ps == null) { - logger.warn("No pulse shape information available, just plotting adc instead"); - APulseShapePlot.plotADCCounts(adc, getPulseTitleString(index), null); - } else { - APulseShapePlot.plotRealPulseShapes(adc, ps, - getPulseStep(index), getPulseSubtitle(index), getPulseTitleString(index)); - } - } - } - - /** - * - */ - protected int[][] getADCCounts(int index) { return null; } - - protected double[][] getPulseShape(int index) { return null; } - - protected double getPulseStep(int index) { return 1.0; } - - protected String[] getPulseSubtitle(int index) { return null; } - - /** - * Returns calorimeter type (ECAL or HCAL) of a certain hit. - * - * @param index int hit index - * @return String calorimeter type - */ - public abstract String getCalorimeterType(int index); - - /** - * Returns the ACalorimeterDetector of a certain hit. - * - * @param index int hit index - * @return ACalorimeterDetector - */ - public ACalorimeterDetector getDetector(int index) { - return ACalorimeterDetector.get(detector[index]); - } - - /** - * Recalculates eta from r and z in case the user wants to have their eta - * with respect to the primary vertex instead of 0. The calculation is a - * little different from the other calorimeter classes because this one - * contains both barrel and endcap data. - * - * @param index int index of hit in data - * @return double eta value - */ - public double getEta(int index) - { - double r, z; - - if (!parameterStore.get("VP", "EtaVertex").getStatus() || detector[index] < 0) - { - return this.eta[index]; - } - - if (ACalorimeterDetector.get(detector[index]) instanceof ABarrelCalorimeterDetector) - { - r = ACalorimeterDetector.get(detector[index]).getR(); - z = r * AMath.tanLambda(eta[index]); - } - else - { - z = ACalorimeterDetector.get(detector[index]).getZ(); - r = z / AMath.tanLambda(eta[index]); - } - - return AParameterUtilities.eta(z, r); - } - - /** - * Returns the calorimeter sampling (or layer) of a certain hit. - * - * @param index int hit index - * @return int sampling/layer - */ - public int getSampling(int index) - { - return sampling[index]; - } - - /** - * Returns the side of the calorimeter of a certain hit. - * - * @param index int hit index - * @return int side - */ - public int getSide(int index) - { - return side[index]; - } - - /** - * Returns the cell size in eta of a certain hit. - * - * @param index int hit index - * @return double cell size in eta - */ - public double getdEta(int index) - { - return deta[index]; - } - - /** - * Returns the cell size in phi of a certain hit. - * - * @param index int hit index - * @return double cell size in phi - */ - public double getdPhi(int index) - { - return dphi[index]; - } - - /** - * Returns the phi coordinate of a certain hit. - * - * @param index int hit index - * @return double phi coordinate. - */ - public double getPhi(int index) - { - return phi[index]; - } - - /** - * Returns the transverse energy of a hit. - * - * @param index int hit index - * @return float transverse energy - */ - public float getET(int index) - { - return et[index]; - } - - /** - * Returns the transverse energy of a list of hits. - * - * @param index int[] list of hit indices - * @return float[] list of transverse energies - */ - public float[] getET(int[] index) - { - float[] temp = new float[index.length]; - - for (int i = 0; i < index.length; i++) - { - temp[i] = et[index[i]]; - } - return temp; - } - - /** - * Returns the calorimeter sampling (or layer) of a list of hits. - * - * @param index int[] list of hit indices - * @return int[] list of samplings - */ - public int[] getSampling(int[] index) - { - int[] temp = new int[index.length]; - - for (int i = 0; i < index.length; i++) - { - temp[i] = sampling[index[i]]; - } - return temp; - } - - /** - * Returns the energy of a hit. - * - * @param index int hit index - * @return float energy - */ - public float getEnergy(int index) - { - return energy[index]; - } - - /** - * Returns the depositied energy of a list of hits. - * - * @param index int[] list of hit indices - * @return float[] list of energies - */ - public float[] getEnergy(int[] index) - { - float[] temp = new float[index.length]; - - for (int i = 0; i < index.length; i++) - { - temp[i] = energy[index[i]]; - } - return temp; - } - - public static double getNonScalingFactor() - { - return NON_SCALING_FACTOR; - } - - /** - * Returns the lowest density for the cell type of the specified hit. - * - * @param index int hit index - * @return double minimum density - */ - protected double getMinDensity(int index) - { - return getMinDensity(getCalorimeterType(index)); - } - - /** - * Returns the lowest densityfor the specified calorimeter type. - * - * @param type String either "ECAL", "HCAL" or "ALL" - * @return double minimum density - */ - protected double getMinDensity(String type) - { - if (type.equals("ECAL")) - { - return minDensityECAL; - } - else if (type.equals("HCAL")) - { - return minDensityHCAL; - } - else if (type.equals("ALL")) - { - // Return the lowest non-zero value. - if (minDensityECAL == 0.0 || minDensityHCAL == 0.0) - { - return Math.max(minDensityECAL, minDensityHCAL); - } - else - { - return Math.min(minDensityECAL, minDensityHCAL); - } - } - else - { - return 0.0; - } - } - - /** - * Returns the highest density for the cell type of the specified hit. - * - * @param index int hit index - * @return double maximum density - */ - protected double getMaxDensity(int index) - { - return getMaxDensity(getCalorimeterType(index)); - } - - /** - * Returns the highest densityfor the specified calorimeter type. - * - * @param type String either "ECAL", "HCAL" or "ALL" - * @return double maximum density - */ - protected double getMaxDensity(String type) - { - if (type.equals("ECAL")) - { - return maxDensityECAL; - } - else if (type.equals("HCAL")) - { - return maxDensityHCAL; - } - else if (type.equals("ALL")) - { - return Math.max(maxDensityECAL, maxDensityHCAL); - } - else - { - return 0.0; - } - } - - /** - * Sets the minimum density for the specified calorimeter type. - * - * @param type String either "ECAL", "HCAL" or "ALL" - * @param density double minimum density to set - */ - protected void setMinDensity(String type, double density) - { - if (type.equals("ECAL")) - { - minDensityECAL = density; - } - else if (type.equals("HCAL")) - { - minDensityHCAL = density; - } - else if (type.equals("ALL")) - { - minDensityECAL = density; - minDensityHCAL = density; - } - } - - /** - * Sets the maximum density for the specified calorimeter type. - * - * @param type String either "ECAL", "HCAL" or "ALL" - * @param density double maximum density to set - */ - protected void setMaxDensity(String type, double density) - { - if (type.equals("ECAL")) - { - maxDensityECAL = density; - } - else if (type.equals("HCAL")) - { - maxDensityHCAL = density; - } - else if (type.equals("ALL")) - { - maxDensityECAL = density; - maxDensityHCAL = density; - } - - parameterStore.get(CALORIMETER_NAME, "Area/Energy").setD(1. / Math.max(maxDensityECAL, maxDensityHCAL)); - } - - /** - * Returns the data that needs to be drawn in the specificied projection. - * - * @param projection AProjection projection - * @return ACoord data to be drawn - */ - protected ACoord getUserNoTransform(AProjection projection) - { - if (CALORIMETER_NAME.equals("FCAL") || CALORIMETER_NAME.equals("MBTS")) - { - // FCAL and MBTS data are not linked to the geometry objects, so use the old method. - return super.getUserNoTransform(projection); - } - else - { - // For all the other types we can simply get the geometry from the - // geometry objects. - makeDrawList(); - filterDrawList(projection); - double[][][] hv = new double[2][numDraw][0]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - if (detector[j] >= 0) - { - ACoord coord = ACalorimeterDetector.get(detector[j]).getCell(projection, etaIndex[j], phiIndex[j], side[j]); - if (coord.hv[0].length > 0) - { - hv[0][i] = coord.hv[0][0]; - hv[1][i] = coord.hv[1][0]; - } - } - else - { - // Alternative setups compatibility mode based on eta, deta, - // r or z, dr or dz, phi, dphi from event file could be - // implemented here. - } - index[i] = j; - } - - // Apply the wrap arounds for phi in certain projections. - if (projection instanceof AProjectionVP) - { - return new ACoord(hv, index, this).includePhiWrapAround("VP"); - } - else if (projection instanceof AProjectionFR) - { - return new ACoord(hv, index, this).includePhiWrapAround("FR"); - } - else if (projection instanceof AProjectionFZ) - { - return new ACoord(hv, index, this).includePhiWrapAround("FZ"); - } - else - { - return new ACoord(hv, index, this); - } - } - } - - /** - * Returns the data points for the "standard" mode v-plot. - * - * @return ACoord v-plot points - */ - public ACoord getVPPoints() - { - makeDrawList(); - double[][] hv = new double[2][numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - hv[0][i] = getEta(j); - hv[1][i] = Math.toDegrees(phi[j]); - index[i] = j; - } - return new ACoord(hv, index, this, ACoord.SYMBOLS).includePhiWrapAround("VP"); - } - - /** - * Cleans up the drawList. From all cells that are drawn at a certain place - * only the one that has the highest deposited transverse energy will remain. - * It also sums the transverse energy of the cells it removes. This is stored - * in etSum[] at the index of the "most energetic" cell. - * - * @param projection AProjection projection to be drawn - */ - protected void filterDrawList(AProjection projection) - { - // In the v-plot every cell is drawn, unless we're in one of the special - // modes. - if (projection instanceof AProjectionVP) - { - switch (parameterStore.get("VP", "Mode").getI()) - { - case AProjectionVP.MODE_STANDARD: - // Everything is drawn in the standard mode v-plot. - return; - case AProjectionVP.MODE_ECAL_LAYER_0: - case AProjectionVP.MODE_ECAL_LAYER_1: - case AProjectionVP.MODE_ECAL_LAYER_2: - case AProjectionVP.MODE_ECAL_LAYER_3: - if (!CALORIMETER_NAME.equals("LAr")) - { - // Don't draw HCAL in ECAL mode. - numDraw = 0; - } - return; - case AProjectionVP.MODE_HCAL_LAYER_0: - case AProjectionVP.MODE_HCAL_LAYER_1: - case AProjectionVP.MODE_HCAL_LAYER_2: - case AProjectionVP.MODE_HCAL_LAYER_3: - if (!CALORIMETER_NAME.equals("TILE") && !CALORIMETER_NAME.equals("HEC")) - { - // Don't draw ECAL in HCAL mode. - numDraw = 0; - } - return; - default: - numDraw = 0; - return; - } - } - - // The phi-z projection has special modes as well. - if (projection instanceof AProjectionFZ) - { - if (parameterStore.get(projection.getName(), "Mode").getI() != AProjectionYX.MODE_STANDARD) - { - numDraw = 0; - return; - } - } - // Also the y-x and phi-rho projections have special modes (they share the same mode list). - int mode = parameterStore.get("YX", "Mode").getI(); - if (projection instanceof AProjectionYX || projection instanceof AProjectionFR) - { - if (mode != AProjectionYX.MODE_STANDARD && - (mode < AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER || mode > AProjectionYX.MODE_HEC_SUMMED)) - { - numDraw = 0; - return; - } - else if (mode >= AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER && mode <= AProjectionYX.MODE_HEC_SUMMED) - { - if ((mode >= AProjectionYX.MODE_HEC_1 && mode <= AProjectionYX.MODE_HEC_4 && !CALORIMETER_NAME.equals("HEC")) || - (mode < AProjectionYX.MODE_HEC_1 && !CALORIMETER_NAME.equals("LAr")) || - (mode == AProjectionYX.MODE_HEC_SUMMED && !CALORIMETER_NAME.equals("HEC")) || - (mode == AProjectionYX.MODE_LAR_ENDCAP_SUMMED && !CALORIMETER_NAME.equals("LAr"))) - { - numDraw = 0; - return; - } - } - else if(mode == AProjectionYX.MODE_MBTS && !CALORIMETER_NAME.equals("MBTS")) - { - numDraw = 0; - return; - } - } - - float[][] etTable = new float[2 * ACalorimeterDetector.count()][2 * MAX_HIT_INDEX]; - for (int i = 0; i < 2 * ACalorimeterDetector.count(); i++) - { - for (int j = 0; j < 2 * MAX_HIT_INDEX; j++) - { - cellTable[i][j] = -1; - etTable[i][j] = 0.0f; - } - } - - for (int i = 0; i < numDraw; i++) - { - int detIndex = getDetectorIndex(listdl[i]); - int hitIndex = getHitIndex(listdl[i], projection); - - if (detIndex >= 0 && hitIndex >= 0) - { - etTable[detIndex][hitIndex] += et[listdl[i]]; - if (cellTable[detIndex][hitIndex] < 0 || et[cellTable[detIndex][hitIndex]] < et[listdl[i]]) - cellTable[detIndex][hitIndex] = listdl[i]; - } - } - - numDraw = 0; - for (int i = 0; i < 2 * ACalorimeterDetector.count(); i++) - { - for (int j = 0; j < 2 * MAX_HIT_INDEX; j++) - { - if (cellTable[i][j] > 0) - { - listdl[numDraw] = cellTable[i][j]; - etSum[listdl[numDraw]] = etTable[i][j]; - numDraw++; - } - } - } - } - - /** - * This function maps a hit to an index. This index is such that two hits - * get the same index when they are in the same detector and on the same - * side. - * - * @param index int number of the hit in the current dataset - * @return int detector index - */ - protected int getDetectorIndex(int index) - { - if (detector[index] >= 0) - { - if (side[index] > 0) - { - return ACalorimeterDetector.count() + detector[index]; - } - else - { - return detector[index]; - } - } - return -1; - } - - /** - * This function maps a hit to an index. This index is such that two hits in - * the same detector will receive the same index if they will be drawn in - * the same place. - * - * @param index int number of the hit in the current dataset - * @param projection AProjection projection the hit index should be - * calculated for - * @return int hit index - */ - protected int getHitIndex(int index, AProjection projection) - { - if (detector[index] >= 0) - { - if (projection instanceof AProjectionYX) - { - return phiIndex[index]; - } - else if (projection instanceof AProjectionRZ) - { - if (ACalorimeterDetector.get(detector[index]).getRSign(phiIndex[index]) > 0) - { - return MAX_HIT_INDEX + etaIndex[index]; - } - else - { - return etaIndex[index]; - } - } - else if (projection instanceof AProjectionFR) - { - return phiIndex[index]; - } - else if (projection instanceof AProjectionFZ) - { - return phiIndex[index]; - } - } - return -1; - } - - /** - * Returns the histograms for this projection. - * - * @param projection AProjection2D current projection - * @return ACoord[] polygons representing histograms - */ - protected ACoord[] getUserHistograms(AProjection2D projection) - { - return ACoord.NO_HISTOGRAMS; - } - - /** - * Returns the histograms in the YX projection. - * - * @return ACoord[] histograms - */ - public ACoord[] getYXHistograms() - { - AHistogram hist = new AHistogram(0., 2. * Math.PI, phiGranularity, histoScale.getD(), this); - int mode = parameterStore.get("YX", "Mode").getI(); - double newInnerR = innerR; - boolean hasAddedToHistogram = false; - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - if (detector[j] >= 0) - { - if ((mode == AProjectionYX.MODE_STANDARD && ACalorimeterDetector.get(detector[j]) instanceof ABarrelCalorimeterDetector) || - (mode != AProjectionYX.MODE_STANDARD && ACalorimeterDetector.get(detector[j]) instanceof AEndcapCalorimeterDetector)) - { - String name = ACalorimeterDetector.get(detector[j]).getName(); - if (mode == AProjectionYX.MODE_STANDARD || (mode == AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER && (name.equals("LAr Endcap Presampler")||name.equals("LAr_EC_Presampler"))) || - (name.equals("LAr Outer Endcap") && getSampling(j) == mode - AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER) || - (name.equals("LAr Inner Endcap") && getSampling(j) == mode - AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER - 1) || - (name.equals("HEC") && getSampling(j) == mode - AProjectionYX.MODE_HEC_1) || - (mode == AProjectionYX.MODE_LAR_ENDCAP_SUMMED && name.indexOf("LAr") >= 0) || (mode == AProjectionYX.MODE_HEC_SUMMED && name.equals("HEC"))) - { - hasAddedToHistogram = true; - double phiMin = ACalorimeterDetector.get(detector[j]).getPhiMin(phiIndex[j]); - double phiMax = ACalorimeterDetector.get(detector[j]).getPhiMax(phiIndex[j]); - - if (phiMin < -1e-9 && phiMax > 1e-9) - { - hist.fill(phiMin + 2. * Math.PI, 2. * Math.PI, etSum[j] / 2.); - hist.fill(0., phiMax, etSum[j] / 2.); - } - else - { - hist.fill(phiMin, phiMax, etSum[j]); - } - if (mode != AProjectionYX.MODE_STANDARD) - { - if (name.equals("HEC")) - { - if (mode != AProjectionYX.MODE_HEC_SUMMED) - { - //can use the get RMin accurately for the HEC - newInnerR = ACalorimeterDetector.get(detector[j]).getRMin(); - } - else if (ACalorimeterDetector.get(detector[j]).getRMin() < newInnerR) - { - //only want to assign HEC ALL minimum if is smaller - newInnerR = ACalorimeterDetector.get(detector[j]).getRMin(); - } - } - else - { - //calculate RMin as not accurate in geometry file - double etaMax = ACalorimeterDetector.get(detector[j]).getEtaMax(); - double zMin = ACalorimeterDetector.get(detector[j]).getZMin(); - double temp = zMin / Math.sinh(etaMax); - //save calculated if smallest - if (temp < newInnerR) - newInnerR = temp; - } - } - } - } - } - } - if (hasAddedToHistogram) - return new ACoord[] { hist.getYXUser(newInnerR) }; - else - return ACoord.NO_HISTOGRAMS; - } - - /** - * Returns the histograms in the phi-rho projection. - * - * @return ACoord[] histograms - */ - public ACoord[] getFRHistograms() - { - AHistogram hist = new AHistogram(0., 2. * Math.PI, phiGranularity, histoScale.getD(), this); - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - if (detector[j] >= 0) - { - if (ACalorimeterDetector.get(detector[j]) instanceof ABarrelCalorimeterDetector) - { - double phiMin = ACalorimeterDetector.get(detector[j]).getPhiMin(phiIndex[j]); - double phiMax = ACalorimeterDetector.get(detector[j]).getPhiMax(phiIndex[j]); - - if (phiMin < -1e-9 && phiMax > 1e-9) - { - hist.fill(phiMin + 2. * Math.PI, 2. * Math.PI, etSum[j] / 2.); - hist.fill(0., phiMax, etSum[j] / 2.); - } - else - { - hist.fill(phiMin, phiMax, etSum[j]); - } - } - } - } - return new ACoord[] { hist.getFRUser(innerR).includePhiWrapAround("FR") }; - } - - /** - * Returns the histograms in the RZ projection. - * - * @return ACoord[] histograms - */ - public ACoord[] getRZHistograms() - { - AHistogram histUp = new AHistogram(-outerEta, outerEta, etaGranularity, histoScale.getD(), this); - AHistogram histDown = new AHistogram(-outerEta, outerEta, etaGranularity, histoScale.getD(), this); - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - if (detector[j] >= 0) - { - int sign = ACalorimeterDetector.get(detector[j]).getRSign(phiIndex[j]); - double etaMin = ACalorimeterDetector.get(detector[j]).getEtaMin(etaIndex[j], side[j]); - double etaMax = ACalorimeterDetector.get(detector[j]).getEtaMax(etaIndex[j], side[j]); - - if (sign > 0) - { - histUp.fill(etaMin, etaMax, etSum[j]); - } - else - { - histDown.fill(etaMin, etaMax, etSum[j]); - } - } - } - - ACoordArray c = new ACoordArray(); - c.add(histUp.getRZUser(outerZ, outerR, AHistogram.UP)); - c.add(histDown.getRZUser(outerZ, outerR, AHistogram.DOWN)); - return c.getArray(); - } - - /** - * Returns the histograms in the phi-z projection. - * - * @return ACoord[] histograms - */ - public ACoord[] getFZHistograms() - { - AHistogram hist; - AHistogram histLeft = new AHistogram(0., 2. * Math.PI, phiGranularity, histoScale.getD(), this); - AHistogram histRight = new AHistogram(0., 2. * Math.PI, phiGranularity, histoScale.getD(), this); - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - if (detector[j] >= 0) - { - if (ACalorimeterDetector.get(detector[j]) instanceof AEndcapCalorimeterDetector) - { - double phiMin = ACalorimeterDetector.get(detector[j]).getPhiMin(phiIndex[j]); - double phiMax = ACalorimeterDetector.get(detector[j]).getPhiMax(phiIndex[j]); - - if (side[j] > 0) - { - hist = histRight; - } - else - { - hist = histLeft; - } - - if (phiMin < -1e-9 && phiMax > 1e-9) - { - hist.fill(phiMin + 2. * Math.PI, 2. * Math.PI, etSum[j] / 2.); - hist.fill(0., phiMax, etSum[j] / 2.); - } - else - { - hist.fill(phiMin, phiMax, etSum[j]); - } - } - } - } - - return new ACoord[] { histLeft.getFZUser(innerZ, AHistogram.LEFT).includePhiWrapAround("FZ"), - histRight.getFZUser(innerZ, AHistogram.RIGHT).includePhiWrapAround("FZ") }; - } - - /** - * Returns the histograms in the x'-z projection. - * - * @return ACoord[] histograms - */ - public ACoord[] getXZHistograms() - { - return ACoord.NO_HISTOGRAMS; - } - - /** - * Returns the histograms in the y'-z projection. - * - * @return ACoord[] histograms - */ - public ACoord[] getYZHistograms() - { - return ACoord.NO_HISTOGRAMS; - } - - /** - * Returns the histograms in the eta-phi projection. - * - * @return ACoord[] histograms - */ - public ACoord[] getVPHistograms() - { - return ACoord.NO_HISTOGRAMS; - } - - /** - * Sets the type of the hits (associated, unassociated). - */ - protected void setType() - { - int[][] cluster = event.getAssociationManager().get(getName(), "Cluster"); - for (int i = 0; i < numData; i++) - { - if (cluster != null && cluster[i] != null) - { - type[i] = 1; - } - else - { - type[i] = 0; - } - } - } - - /** - * Determines if the cells need to be scaled by energy or not. This will be - * true for most cases, but not if the user has selected the color by energy - * color function. - * - * @return boolean true for energy scaling, false for constant cell size - */ - protected boolean energyScaling() - { - return parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI() != COLOR_FUNC_ENERGY; - } - - /** - * Determines the color for each hit according to the color function set by - * the user. - * - * @return int number of coloring options? - */ - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - switch (colorFunction) - { - case COLOR_FUNC_CONSTANT: - colorByConstant(); - break; - - case COLOR_FUNC_SUBDET: - colorBy(sub); - break; - - case COLOR_FUNC_CLUSTER: - colorBy(getClusters()); - break; - - case COLOR_FUNC_SAMPLING: - colorBy(sampling); - break; - - case COLOR_FUNC_ENERGY: - colorByEnergy(); - break; - - case COLOR_FUNC_JET: - if(parameterStore.get("Jet", "ColorFunction").getI()!=1) - { - parameterStore.get("Jet", "ColorFunction").setI(1); - String msg = "Coloring Calo by jet so "; - msg += "ATLAS->Jet->Color Function changed to color by index"; - AOutput.append("\n" + msg + "\n", ALogInterface.WARNING); - } - colorBy(getJets()); - break; - - case COLOR_FUNC_TYPE: - colorByType(); - break; - - case COLOR_FUNC_TIME: - colorByTime(); - break; - } - - return colorFunction + 8; - } - - /** - * Colors cells by energy. - */ - protected void colorByEnergy() - { - double min = 0.0, max = 0.0; - boolean first = true; - int numColors = 17; - float[] en = null; - - switch (parameterStore.get(CALORIMETER_NAME, "EnergyMode").getI()) - { - case ENERGY_MODE_SUM_LIN: - case ENERGY_MODE_SUM_LOG: - case ENERGY_MODE_SUM_SQRT: - en = etSum; - break; - - case ENERGY_MODE_MAX_LIN: - case ENERGY_MODE_MAX_LOG: - case ENERGY_MODE_MAX_SQRT: - en = et; - break; - } - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - if (first) - { - min = en[j]; - max = en[j]; - first = false; - } - - if (en[j] > max) - max = en[j]; - if (en[j] < min) - min = en[j]; - } - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - if (AColorMap.getColorMap() == AColorMap.COLOR_MAP_BW) - { - // Black and white colormap. - color[j] = AColorMap.BK; - } - else - { - int colorIndex = 0; - - // We have numColors colors available. - switch (parameterStore.get(CALORIMETER_NAME, "EnergyMode").getI()) - { - case ENERGY_MODE_MAX_LIN: - case ENERGY_MODE_SUM_LIN: - colorIndex = (int) (numColors * (en[j] - min) / (max - min)); - break; - case ENERGY_MODE_MAX_LOG: - case ENERGY_MODE_SUM_LOG: - colorIndex = (int) (numColors * (Math.log(en[j]) - Math.log(min)) / (Math.log(max) - Math.log(min))); - break; - case ENERGY_MODE_MAX_SQRT: - case ENERGY_MODE_SUM_SQRT: - colorIndex = (int) (numColors * Math.sqrt((en[j] - min) / (max - min))); - break; - } - - if (colorIndex >= numColors) - colorIndex = (byte) (numColors - 1); - - color[j] = (byte) colorIndex; - } - } - } - - /** - * Colors cells by type (ECAL/HCAL). - */ - protected void colorByType() - { - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - String cellType = getCalorimeterType(j); - //Use detector color but add on 12 to get different shade of same color - color[j] = (byte) (parameterStore.get("Det", cellType + "Fill").getI() + 12); - } - } - - //Gets the measured time for a calorimeter cell. - //It's 0 by default, but can and should be overriden by subclasses. - protected double getTime(int hit) - { - return 0.0; - } - - //Color cells by their measured time, on a blue-red scale. - //Unmeasured cells are grey. - protected void colorByTime() - { - double min = 0.0, max = 0.0; - boolean first = true; - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - double t=getTime(j); - if (t==0.0) continue;//ignore unmeasured hits - if (first) - { - min = t; max = t; - first = false; - } - - if (t > max) max = t; - if (t < min) min = t; - } - - int numColors = 127; - double scale = (max - min); - if (scale<5) scale=5;//smallest scale is 5 ns - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - double t = getTime(j); - - int colorIndex = (int) (numColors * (t-min) / scale); - if (colorIndex >= numColors) { - colorIndex = numColors;//red - } - if (colorIndex < 1) { - colorIndex = 1;//blue - } - - if (t==0.0) colorIndex=0;//gets grey color - color[j] = (byte) colorIndex; - - } - } - - /** - * Applies cuts to the data. - */ - protected void applyCuts() - { - cutIndex(); - cut("CutsCalo", "Layer", "Layer", sampling); - cut("CutsCalo", "CellQuality", "CellQuality", BadCell); - cutPhi(phi, dphi); - cutEtaDEta(eta, deta); - } - - /** - * Performs the local density calibration. This function determines the - * highest and lowest energy density values ans stores them. - * - * @param index int[] hits to be used in calibration - * @param area double[] cell areas - */ - public void calibrateLocalDensity(int[] index, double[] area) - { - float[] en = null; - double density; - boolean firstECAL = true; - boolean firstHCAL = true; - - AParameter par = parameterStore.get(CALORIMETER_NAME, "Area/Energy"); - if (par.getStatus() && par.getD() > 0) - { - minDensityECAL = 0.0; - minDensityHCAL = 0.0; - maxDensityECAL = 1. / par.getD(); - maxDensityHCAL = 1. / par.getD(); - } - else - { - // Otherwise we need to do calculate it ourselves. - switch (parameterStore.get(CALORIMETER_NAME, "EnergyMode").getI()) - { - case ENERGY_MODE_SUM_LIN: - case ENERGY_MODE_SUM_LOG: - case ENERGY_MODE_SUM_SQRT: - en = etSum; - break; - - case ENERGY_MODE_MAX_LIN: - case ENERGY_MODE_MAX_LOG: - case ENERGY_MODE_MAX_SQRT: - en = et; - break; - } - - // The default for an empty list of cells or only zero area cells is - // 0.0. - minDensityECAL = 0.0; - maxDensityECAL = 0.0; - minDensityHCAL = 0.0; - maxDensityHCAL = 0.0; - - // Calculate density and determine the highest and lowest values. - for (int i = 0; i < index.length; i++) - { - if (area[i] > 0) - { - density = (en[index[i]] / area[i]); - - if (density > 0) - { - if (getCalorimeterType(index[i]).equals("ECAL")) - { - if (firstECAL) - { - // First cell with a sensible density, take this - // as initial value. - minDensityECAL = density; - maxDensityECAL = density; - firstECAL = false; - } - - if (density < minDensityECAL) - minDensityECAL = density; - if (density > maxDensityECAL) - maxDensityECAL = density; - - } - else if (getCalorimeterType(index[i]).equals("HCAL")) - { - if (firstHCAL) - { - // First cell with a sensible density, take this - // as initial value. - minDensityHCAL = density; - maxDensityHCAL = density; - firstHCAL = false; - } - - if (density < minDensityHCAL) - minDensityHCAL = density; - if (density > maxDensityHCAL) - maxDensityHCAL = density; - } - } - } - } - } - } - - /** - * - */ - public double[] getScaleFactors(int[] dl, double[] area) { - double[] factors = new double[area.length]; - - float[] en = null; - int energyMode = parameterStore.get(CALORIMETER_NAME, "EnergyMode").getI(); - - switch (energyMode) - { - case ENERGY_MODE_SUM_LIN: - case ENERGY_MODE_SUM_LOG: - case ENERGY_MODE_SUM_SQRT: - en = etSum; - break; - - case ENERGY_MODE_MAX_LIN: - case ENERGY_MODE_MAX_LOG: - case ENERGY_MODE_MAX_SQRT: - en = et; - break; - } - - for (int i = 0; i < area.length; i++) - { - factors[i] = 1.0f; - - if (area[i] == 0) - continue; - - if (energyScaling()) - { - // The user has (implicitly) selected energy scaling. - double density = en[dl[i]] / area[i]; - double minDensity = getMinDensity(dl[i]); - double maxDensity = getMaxDensity(dl[i]); - - switch (energyMode) - { - case ENERGY_MODE_MAX_LIN: - case ENERGY_MODE_SUM_LIN: - factors[i] = Math.sqrt(density / maxDensity); - break; - - case ENERGY_MODE_MAX_LOG: - case ENERGY_MODE_SUM_LOG: - double magnitude = Math.floor(Math.log10(Math.sqrt(maxDensity / minDensity)) + 1.0); - factors[i] = (Math.log10(Math.sqrt(density / maxDensity)) + magnitude) / magnitude; - break; - - case ENERGY_MODE_MAX_SQRT: - case ENERGY_MODE_SUM_SQRT: - factors[i] = Math.sqrt(Math.sqrt(density / maxDensity)); - break; - - default: - factors[i] = NON_SCALING_FACTOR; - } - } - else - { - // No energy scaling, scale all cells by the same factor. - factors[i] = NON_SCALING_FACTOR; - } - - if (factors[i] > 1.0) { - factors[i] = 1.0; - } - } - - return factors; - } - - /** - * Scales a series of polygons according to the user settings. - * - * @param coord ACoord polygons to be scaled - * @param area double[] surface area of these polygons - * @return ACoord scaled polygons - */ - protected ACoord scalePolygons(ACoord coord, double[] area) - { - double[] factors = getScaleFactors(coord.index, area); - - for (int i = 0; i < area.length; i++) - { - if (area[i] == 0) - continue; - - APolygon.scale(coord.hv[0][i], coord.hv[1][i], factors[i]); - } - return coord; - } - - private String getCellString(int index, String idstr) { - StringBuffer msg = new StringBuffer(); - msg.append(CALORIMETER_NAME + " cell"); - msg.append(" (id: " + idstr + " index: " + index + ")"); - return msg.toString(); - } - - private String getHitString(int index) { - StringBuffer msg = new StringBuffer(); - - msg.append("\n E Max = "); - msg.append(String.format("%.2f",energy[index])); - msg.append(" GeV\n ET Max = "); - msg.append(String.format("%.2f",et[index])); - msg.append(" GeV\n ET Sum = "); - msg.append(String.format("%.2f",etSum[index])); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.4f",eta[index])); - msg.append(" "); - msg.append(AMath.PLUSMINUS); - msg.append(" "); - // deta is step (i.e. size of a cell), with +- we want to see half of it - msg.append(String.format("%.3f",deta[index] / 2.0)); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.1f",Math.toDegrees(phi[index]))); - msg.append(" " + AMath.PLUSMINUS + " "); - // dphi is step (i.e. size of a cell), with +- we want to see half of it - msg.append(String.format("%.1f",Math.toDegrees(dphi[index] / 2.0))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.1f",phi[index]) + " "); - msg.append(AMath.PLUSMINUS + " " + String.format("%.1f",dphi[index] / 2.0) + " rad)"); - - if(feedThrough != null && slot != null && channel != null) - { - String s = "\n feed through/slot/channel = " + - feedThrough[index] + "/" + slot[index] + "/" + - channel[index]; - msg.append(s); - } - if(BadCell != null){ - if(BadCell[index] == 0) - msg.append("\n Cell is good"); - if(BadCell[index] == 1) - msg.append("\n Cell is bad"); - if(BadCell[index] == -1) - msg.append("\n Cell is below 50 MeV"); - } - - return msg.toString(); - } - - /** - * Getting title string for pulse shape windows - * - * Relies on decodedId[1] being some useful high level string describing - * the calorimeter part. This isn't the case for ATILEData where this function - * is overridden to do something different. - * - * Maybe this is a slightly unreasonable plan... but then the first thing - * you decode out of the id should usually be the "biggest" sort of division... - * - Adam - */ - protected String getPulseTitleString(int index) { - - String[] decodedId = AIdHelper.getFullIdentifier(id[index]); - - String title = null; - - if (feedThrough == null || slot == null || channel == null) { - // Old style title - logger.warn("Calo FT/slot/channel info not available, using old style title"); - title = decodedId[1] + " cell: " + decodedId[0]; - } else { - // New title as requested by Andre N. Aug 09 - title = decodedId[1] + " cell: " + - this.feedThrough[index] + "/" + this.slot[index] + - "/" + this.channel[index]; - } - - return title; - } - - // Some calo stuff wants to decode the id it's own way... - public String getHitInfoNoDecode(int index) { - - String[] decodedId = AIdHelper.getFullIdentifier(id[index]); - return getCellString(index, decodedId[0]) + getHitString(index); - - } - - /** - * Returns information about a certain hit for display in the information - * box. - * - * @param index int hit index - * @return String hit information - */ - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n ET="+String.format("%.3f",et[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Ex="+String.format("%.3f",et[index]*Math.cos(phi[index]))+" GeV "+ - "\n Ey="+String.format("%.3f",et[index]*Math.sin(phi[index]))+" GeV "+ - "\n Ez="+String.format("%.3f",et[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String[] decodedId = AIdHelper.getFullIdentifier(id[index]); - StringBuffer msg = new StringBuffer(); - msg.append(getCellString(index, decodedId[0])); - // iterate over decodedId to get further details (if available), - // first item [0] was already printed out above, thus start from 1 - for(int i = 1; i < decodedId.length; i++) - { - msg.append("\n " + decodedId[i]); - } - - msg.append(getHitString(index)); - // by zdenek 2009-01-20 - // layer is already present as sampling in the decodedId - // sub[] should gradually be removed, don't print it for now - // (see mess in AHashMap - !name.equals("sub")) grrrr - /* - msg.append("\n "); - msg.append("layer = " + sampling[index]); - msg.append("\n "); - msg.append("subdetector = " + sub[index]); - */ - - return msg.toString(); - } - - /** - * Returns the total transverse energy for this data type. - * - * @return double total transverse energy - */ - public double getTotalTransverseEnergy() - { - double sumEt = 0.; - for (int i = 0; i < numData; i++) - { - sumEt += et[i]; - } - return sumEt; - } - - /** - * Returns information about the drawn hits, used for the v-plot. - * - * @return String information - */ - public String getVPHitInfo() - { - applyCuts(); - if (numDraw == 0) - return ""; - double sumE = 0.; - double sumEt = 0.; - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - sumEt += et[j]; - sumE += energy[j]; - } - - String msg = numDraw + " " + getNameScreenName(); - msg += " sum(ET) = " + String.format("%.1f",sumEt) + " sum(E) = " + String.format("%.1f",sumE); - return msg; - } - - /** - * Returns the specified hits in the form of a four vector. Used by the list - * manager. - * - * @param num int number of hits - * @param list int[] indices of the hits - * @return A4Vector four vector - */ - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - - for (int i = 0; i < num; ++i) - { - int j = list[i]; - double lambda = AMath.lambda(eta[j]); - - double pt = energy[j] * Math.cos(lambda); - double pz = energy[j] * Math.sin(lambda); - - double px = pt * Math.cos(phi[j]); - double py = pt * Math.sin(phi[j]); - - sum.add(px, py, pz, 0.); - } - return sum; - } - - /** - * Calorimeter cells can be drawn either explicitly or implicitly. In most - * views cells that are located behind eachother are consolidated and only - * the most energetic one is drawn explicitly. The other cells are drawn - * implicitly, since their energy value is still added to the energy sum of - * the explicitly drawn cell. The list manager does not know about the - * implicitly drawn cells though, so this poses a problem when the user - * requests information about a certain area of the canvas. This is solved - * using this method. This function receives the list of explicitly drawn - * cells and then adds the ones that were implicitly drawn in this - * selection. - * - * @param drawn boolean[] initial drawn list containing only the explicitly - * drawn cells - * @return boolean[] drawn list containing the explicitly and the implicitly - * drawn cells. - */ - public boolean[] expandDrawn(boolean[] drawn) - { - makeDrawList(); - AProjection projection = ACanvas.getCanvas().getCurrentWindow().getProjection(); - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - - if (drawn[j]) - continue; - - int detIndex = getDetectorIndex(j); - int hitIndex = getHitIndex(j, projection); - - if (detIndex >= 0 && hitIndex >= 0) { - if (cellTable != null && detIndex < cellTable.length - && hitIndex < cellTable[detIndex].length) { - - int mappedTo = cellTable[detIndex][hitIndex]; - - if (mappedTo >= 0 && drawn[mappedTo] == true) { - drawn[j] = true; - } - } - } - } - - return drawn; - } - - /** - * Rebuilds the hit to geometry mapping for all calorimeters. Used when the - * user has loaded a different geometry file. - */ - public static void remakeHitToGeometryMapping() - { - //Get current event - AEvent event = eventManager.getCurrentEvent(); - if (event != null){ - ACalorimeterData[] calorimeters = new ACalorimeterData[event.getCalorimeters().size()]; - event.getCalorimeters().toArray(calorimeters); - for (int i = 0; i < calorimeters.length; i++) - { - calorimeters[i].makeHitToGeometryMapping(); - } - } - } - - /** - * Draws the calorimeters. This method is called from AProjection2D.paint(). - * - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - * @param event AEvent drawn event reference - */ - public static void drawCalorimeters(AWindow window, AGraphics ag, AProjection2D projection, AEvent event) - { - int mode = parameterStore.get(projection.getName(), "Mode").getI(); - - if(projection instanceof AProjectionYX || projection instanceof AProjectionFR) - { - //only grey out the GUI if relevant for the current window - boolean changeGUI = false; - if(window.equals(ACanvas.getCanvas().getCurrentWindow())) - changeGUI = true; - - //grey out draw FCAL option if not on right layer of HEC - AParameter drawFCAL = parameterStore.get("YX", "DrawFCAL"); - if(changeGUI) - { - if(!drawFCAL.isInitialized()) - drawFCAL.initialize(); - if(mode < AProjectionYX.MODE_HEC_2 || mode > AProjectionYX.MODE_HEC_4) - drawFCAL.getNameComponent().setEnabled(false); - else - drawFCAL.getNameComponent().setEnabled(true); - } - - - //grey out split ETA, LAr bin and HEC bin options if not on summed endcaps option - AParameter splitEta = parameterStore.get("YX", "SplitEta"); - AParameter LArBin = parameterStore.get("YX", "LArBin"); - AParameter HECBin = parameterStore.get("YX", "HECBin"); - if(changeGUI) - { - if(!HECBin.isInitialized()) - HECBin.initialize(); - if(!LArBin.isInitialized()) - LArBin.initialize(); - if(!splitEta.isInitialized()) - splitEta.initialize(); - } - //Summed Endcaps has a different draw method - if(mode == AProjectionYX.MODE_LAR_ENDCAP_SUMMED || mode == AProjectionYX.MODE_HEC_SUMMED) - { - if(changeGUI) - { - LArBin.getValueComponent().setEnabled(true); - HECBin.getValueComponent().setEnabled(true); - LArBin.getNameComponent().setEnabled(true); - HECBin.getNameComponent().setEnabled(true); - if(LArBin.getI()==3 || HECBin.getI()==3) - { - splitEta.getValueComponent().setEnabled(true); - splitEta.getNameComponent().setEnabled(true); - } - else - { - splitEta.getValueComponent().setEnabled(false); - splitEta.getNameComponent().setEnabled(false); - } - } - ACalorimeterData[] calorimeters = new ACalorimeterData[event.getCalorimeters().size()]; - event.getCalorimeters().toArray(calorimeters); - for (int i = 0; i < calorimeters.length; i++) - { - //check if in right calorimeter - if ((mode == AProjectionYX.MODE_LAR_ENDCAP_SUMMED && !calorimeters[i].getName().equals("LAr")) || - (mode == AProjectionYX.MODE_HEC_SUMMED && !calorimeters[i].getName().equals("HEC"))) - continue; - ADrawCalorimeterSummedEndcaps.drawCalorimeterSummedEndcaps(window, - ag, projection, calorimeters[i], calorimeters[i].etaIndex, - calorimeters[i].phiIndex, calorimeters[i].side); - } - return; - } - else - { - if(changeGUI) - { - LArBin.getValueComponent().setEnabled(false); - HECBin.getValueComponent().setEnabled(false); - splitEta.getValueComponent().setEnabled(false); - LArBin.getNameComponent().setEnabled(false); - HECBin.getNameComponent().setEnabled(false); - splitEta.getNameComponent().setEnabled(false); - } - if (ALegendWindow.exists()) - ALegendWindow.getInstance().nothingToDisplay(window); - } - } - else if (ALegendWindow.exists()) - ALegendWindow.getInstance().nothingToDisplay(window); - - if (projection instanceof AProjectionVP && mode == 0) - { - // The standard mode of the v-plot uses a different function. - drawCalorimetersVPlot(window, ag, projection, event); - return; - } - - ACalorimeterData[] calorimeters = new ACalorimeterData[event.getCalorimeters().size()]; - event.getCalorimeters().toArray(calorimeters); - ACoord[] data = new ACoord[calorimeters.length]; - double[][] area = new double[calorimeters.length][]; - - for (int i = 0; i < calorimeters.length; i++) - { - // Retrieve the cell coordinates. - data[i] = calorimeters[i].getUserNoTransform(projection); - - // Calculate the cell areas. - area[i] = new double[data[i].index.length]; - for (int j = 0; j < data[i].index.length; j++) - { - area[i][j] = APolygon.getArea(data[i].hv[0][j], data[i].hv[1][j]); - } - - // Let the calorimeter determine its minimum and maximum energy - // density. - calorimeters[i].calibrateLocalDensity(data[i].index, area[i]); - } - - if (window.getProjection() instanceof AProjectionVP) - { - // In case of the v-plot we force the overall energy density - // calibration. - calibrateDensity(calorimeters, ENERGY_CALIB_OVERALL); - } - else - { - // Calibrate the energy density according to the user settings. - calibrateDensity(calorimeters, ENERGY_CALIB_UNKNOWN); - } - - for (int i = 0; i < calorimeters.length; i++) - { - // Apply the non linear transforms and convert to screen - // coordinates. - data[i] = window.calculateDisplay(projection.nonLinearTransform(data[i])); - - // Draw the cell frames. - if (parameterStore.get(calorimeters[i].getName(), "Cells").getStatus()) - { - drawFrames(calorimeters[i], data[i], window, ag); - } - } - - for (int i = 0; i < calorimeters.length; i++) - { - // Draw the cell geometry. - if (parameterStore.get(calorimeters[i].getName(), "Cells").getStatus()) - { - drawGeometry(calorimeters[i], data[i], window, ag); - } - } - - String[] histograms = { "TILE", "HEC", "LAr", "FCAL", "MBTS" }; - for (int j = 0; j < histograms.length; j++) - { - for (int i = 0; i < calorimeters.length; i++) - { - if (calorimeters[i].getCalorimeterName().equals(histograms[j])) - { - // Draw the histograms. - drawHistogram(calorimeters[i], window, ag, projection); - } - } - } - for (int j = 0; j < histograms.length; j++) - { - for (int i = 0; i < calorimeters.length; i++) - { - if (calorimeters[i].getCalorimeterName().equals(histograms[j])) - { - // Draw the frames for the histograms. - frameHistogram(calorimeters[i], window, ag, projection); - } - } - } - - for (int i = 0; i < calorimeters.length; i++) - { - if (parameterStore.get(calorimeters[i].getName(), "Cells").getStatus()) - { - // Scale the cell polygons. - data[i] = calorimeters[i].scalePolygons(data[i], area[i]); - // And draw them. - drawHits(calorimeters[i], data[i], window, ag); - } - } - - } - - /** - * Draws the calorimeters in the standard mode v-plot. This method is called - * from drawCalorimeters and should not be used directly. - * - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - * @param event AEvent drawn event reference - */ - private static void drawCalorimetersVPlot(AWindow window, AGraphics ag, AProjection2D projection, AEvent event) - { - ACalorimeterData[] calorimeters = new ACalorimeterData[event.getCalorimeters().size()]; - event.getCalorimeters().toArray(calorimeters); - - float[][] energies = new float[calorimeters.length][]; - int[] sizes = new int[calorimeters.length]; - ACoord[] points = new ACoord[calorimeters.length]; - Color[] colorMap = AColorMap.getColors(); - //if color by energy use different colormap - for (int i = 0; i < calorimeters.length; i++) - { - if(calorimeters[i].CALORIMETER_NAME.equals("MBTS")) continue; - if (parameterStore.get(calorimeters[i].getParameterGroup(), "ColorFunction").getI() - == ACalorimeterData.COLOR_FUNC_ENERGY) { - switch (AColorMap.getColorMap()) { - case AColorMap.COLOR_MAP_DEFAULT1: - case AColorMap.COLOR_MAP_DEFAULT2: - case AColorMap.COLOR_MAP_M4M5: - case AColorMap.COLOR_MAP_GRAYDET: - case AColorMap.COLOR_MAP_ORIGINAL: - // Use colors. - colorMap = AColorMap.getColors(AColorMap.COLOR_MAP_HITCOL); - break; - case AColorMap.COLOR_MAP_GRAY: - case AColorMap.COLOR_MAP_BW: - // Use grayscale. - colorMap = AColorMap.getColors(AColorMap.COLOR_MAP_GRAY_HITCOL); - break; - } - } else if (parameterStore.get(calorimeters[i].getParameterGroup(), "ColorFunction").getI() == COLOR_FUNC_TIME) { - colorMap = AColorMap.getShades(128); - } - - points[i] = window.calculateDisplay(calorimeters[i].getVPPoints()); - energies[i] = calorimeters[i].getET(points[i].index); - sizes[i] = energies[i].length; - calorimeters[i].color(); - } - - for (int i = 0; i < calorimeters.length; i++) - { - for (int j = 0; j < sizes[i]; j++) - { - int size = (int) Math.sqrt(energies[i][j] * SCALE_FACTOR_VPLOT); - if (size == 0) - size++; - - int cellColor = calorimeters[i].color[points[i].index[j]]; - ag.setColor(colorMap[cellColor]); - ag.drawPoint(calorimeters[i], points[i].index[j], points[i].hv[0][0][j], - points[i].hv[1][0][j], size, size); - } - } - - } - - /** - * Calibrating involves finding the minimum and maximum energy density - * values. This function takes the local (per calorimeter) values and - * calculates the overall values (if needed). - * - * @param calorimeters ACalorimeterData[] calorimeter data objects - * @param mode int calibration mode, use APar.EN_CALIB_UNKNOWN to retrieve - * the user setting - */ - protected static void calibrateDensity(ACalorimeterData[] calorimeters, int mode) - { - if (mode == ENERGY_CALIB_UNKNOWN) - { - mode = parameterStore.get("LAr", "EnergyCalibration").getI(); - } - - // This array contains the calorimeter "types" to combine in the - // calibration. - String types[]; - switch (mode) - { - case ENERGY_CALIB_OVERALL: - types = new String[] { "ALL" }; - break; - - case ENERGY_CALIB_BY_TYPE: - types = new String[] { "ECAL", "HCAL" }; - break; - - case ENERGY_CALIB_BY_CALO: - default: - // Nothing to be done here. - types = new String[0]; - break; - } - - for (int i = 0; i < types.length; i++) - { - boolean first = true; - double min = 0.0; - double max = 0.0; - for (int j = 0; j < calorimeters.length; j++) - { - if (calorimeters[j].getMaxDensity(types[i]) > 0) - { - if (first) - { - min = calorimeters[j].getMinDensity(types[i]); - max = calorimeters[j].getMaxDensity(types[i]); - first = false; - } - - if (calorimeters[j].getMinDensity(types[i]) < min) - { - min = calorimeters[j].getMinDensity(types[i]); - } - if (calorimeters[j].getMaxDensity(types[i]) > max) - { - max = calorimeters[j].getMaxDensity(types[i]); - } - } - } - for (int j = 0; j < calorimeters.length; j++) - { - calorimeters[j].setMinDensity(types[i], min); - calorimeters[j].setMaxDensity(types[i], max); - } - } - } - - /** - * Draws the frame for the cell geometry of a calorimeter. All frames are - * drawn before drawing the cells themselves. This way a frame can never be - * put on top of a cell from another calorimeter. - * - * @param calorimeter ACalorimeterData data collection to which this - * function applies - * @param display ACoord cell coordinates to be drawn - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - */ - protected static void drawFrames(ACalorimeterData calorimeter, ACoord display, AWindow window, AGraphics ag) - { - - String name = calorimeter.getCalorimeterName(); - Color[] colorMap = AColorMap.getColors(); - int[] index = display.index; - int[] type = calorimeter.getType(index); - - boolean drawCellGeometry = parameterStore.get(name, "CellGeometry").getStatus(); - boolean drawFrame = parameterStore.get(name, "Frame").getStatus(); - int frameColor = parameterStore.get(name, "Frame").getI(); - //only draw frames for Grey/BW color maps if is selected to draw frames - if(drawFrame && AColorMap.drawFrames()) - drawFrame=true; - else - drawFrame=false; - - // For the v-plot we override these settings. - if (window.getProjection() instanceof AProjectionVP) - { - drawCellGeometry = parameterStore.get("VP", "VPlotIsland").getStatus(); - drawFrame = true; - frameColor = AColorMap.WH; - } - - // Draw frames for the filled cells. - if (drawFrame && drawCellGeometry) - { - for (int i = 0; i < index.length; i++) - { - ag.updateDrawParameters(calorimeter.getDrawParameters(0, type[i])); - ag.setColor(colorMap[frameColor]); - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - } - - /** - * Draws the frame for the cell geometry and outline of a calorimeter. All - * frames are drawn before drawing the cells themselves. This way a frame - * can never be put on top of a cell from another calorimeter. - * - * @param calorimeter ACalorimeterData data collection to which this - * function applies - * @param display ACoord cell coordinates to be drawn - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - */ - protected static void drawGeometry(ACalorimeterData calorimeter, ACoord display, AWindow window, AGraphics ag) - { - String name = calorimeter.getCalorimeterName(); - Color[] colorMap = AColorMap.getColors(); - int[] index = display.index; - int[] type = calorimeter.getType(index); - - boolean drawCellGeometry = parameterStore.get(name, "CellGeometry").getStatus(); - boolean drawCellOutline = parameterStore.get(name, "CellOutline").getStatus(); - boolean cutByLayer = false; - int cellGeometryColor = parameterStore.get(name, "CellGeometry").getI(); - int cellOutlineColor = parameterStore.get(name, "CellOutline").getI(); - int cutLayer = 0; - - // For the v-plot we override some of these settings. - if (window.getProjection() instanceof AProjectionVP) - { - drawCellGeometry = parameterStore.get("VP", "VPlotIsland").getStatus(); - cellGeometryColor = parameterStore.get("VP", "VPlotIsland").getI(); - - int mode = parameterStore.get("VP", "Mode").getI(); - - if (mode >= AProjectionVP.MODE_HCAL_LAYER_0) - { - cutByLayer = true; - cutLayer = mode - AProjectionVP.MODE_HCAL_LAYER_0; - } - else if (mode >= AProjectionVP.MODE_ECAL_LAYER_0) - { - cutByLayer = true; - cutLayer = mode - AProjectionVP.MODE_ECAL_LAYER_0; - } - } - - // Draw filled cells. - if (drawCellGeometry) - { - for (int i = 0; i < index.length; i++) - { - ag.updateDrawParameters(calorimeter.getDrawParameters(1, type[i])); - ag.setColor(colorMap[cellGeometryColor]); - ag.fillPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - - // Draw cell outlines. - if (drawCellOutline) - { - ag.updateDrawParameters(new ADrawParameters(true, cellOutlineColor, 0, 1, 0, 0, false, 1, 0)); - for (int i = 0; i < index.length; ++i) - { - if (!cutByLayer || calorimeter.getSampling(index[i]) == cutLayer) - { - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - } - } - - /** - * Draws the calorimeter hits. - * - * @param calorimeter ACalorimeterData calorimeter object the hits belong to - * @param display ACoord cell coordinates to be drawn - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - */ - protected static void drawHits(ACalorimeterData calorimeter, ACoord display, AWindow window, AGraphics ag) - { - String name = calorimeter.getCalorimeterName(); - int[] index = display.index; - int[] color = calorimeter.getColor(index); - int[] type = calorimeter.getType(index); - int[] sampling = calorimeter.getSampling(index); - - // This cut is performed just before drawing the hits, the geometry has - // been drawn already. - // This results in the irregular v-plot islands that help the user - // locate a certain position in different views. - boolean cutByLayer = false; - int cutLayer = 0; - - if (window.getProjection() instanceof AProjectionVP) - { - int mode = parameterStore.get("VP", "Mode").getI(); - - if (mode >= AProjectionVP.MODE_HCAL_LAYER_0) - { - cutByLayer = true; - cutLayer = mode - AProjectionVP.MODE_HCAL_LAYER_0; - } - else if (mode >= AProjectionVP.MODE_ECAL_LAYER_0) - { - cutByLayer = true; - cutLayer = mode - AProjectionVP.MODE_ECAL_LAYER_0; - } - } - - AParameter cellGeometry = parameterStore.get(name, "CellGeometry"); - AParameter colorFunction = parameterStore.get(name, "ColorFunction"); - boolean drawFrame = parameterStore.get(name, "Frame").getStatus(); - int frameColor = parameterStore.get(name, "Frame").getI(); - //only draw frames for Grey/BW color maps if is selected to draw frames - if(drawFrame && AColorMap.drawFrames()) - drawFrame=true; - else - drawFrame=false; - - Color[] colorMap = AColorMap.getColors(); - if (colorFunction.getI() == COLOR_FUNC_ENERGY) - { - switch (AColorMap.getColorMap()) - { - case AColorMap.COLOR_MAP_DEFAULT1: - case AColorMap.COLOR_MAP_DEFAULT2: - case AColorMap.COLOR_MAP_M4M5: - case AColorMap.COLOR_MAP_GRAYDET: - case AColorMap.COLOR_MAP_ORIGINAL: - // Use colors. - colorMap = AColorMap.getColors(AColorMap.COLOR_MAP_HITCOL); - break; - case AColorMap.COLOR_MAP_GRAY: - case AColorMap.COLOR_MAP_BW: - // Use grayscale. - colorMap = AColorMap.getColors(AColorMap.COLOR_MAP_GRAY_HITCOL); - break; - } - } - else if (colorFunction.getI() == COLOR_FUNC_TIME) - { - colorMap = AColorMap.getShades(128); - } - - if (drawFrame && !cellGeometry.getStatus()) - { - for (int i = 0; i < index.length; i++) - { - if (!cutByLayer || sampling[i] == cutLayer) - { - ag.updateDrawParameters(calorimeter.getDrawParameters(0, type[i])); - ag.setColor(colorMap[frameColor]); - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - } - - for (int i = 0; i < index.length; i++) - { - if (!cutByLayer || sampling[i] == cutLayer) - { - ag.updateDrawParameters(calorimeter.getDrawParameters(1, type[i])); - ag.setColor(colorMap[color[i]]); - ag.fillPolygon(calorimeter, index[i], display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - } - - /** - * Draws the calorimeter histograms. - * - * @param calorimeter ACalorimeterData calorimeter object the histograms - * belong to - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - */ - protected static void drawHistogram(ACalorimeterData calorimeter, AWindow window, AGraphics ag, AProjection2D projection) - { - String name = calorimeter.getCalorimeterName(); - if (!parameterStore.get(name, "Histogram").getStatus()) - return; - - ACoord[] histograms = calorimeter.getUserHistograms(projection); - for (int i = 0; i < histograms.length; i++) - { - ACoord display = window.calculateDisplay(histograms[i]); - AHistogram hist = (AHistogram) histograms[i].source; - hist.completeTowers(display); - - // for rubberband "new list" or "summarize" feature - if (ag.getGraphics2D() instanceof ADrawnGraphics2D) - ((ADrawnGraphics2D) ag.getGraphics2D()).addHistogramData(hist); - - boolean onTop; - if (parameterStore.getUnknown(name, "OnTopHistoFrame") != null) - { - onTop = parameterStore.get(name, "OnTopHistoFrame").getStatus(); - } - else - { - onTop = false; - } - - // Draw frame for the histogram. - if (parameterStore.get(name, "HistoFrame").getStatus() && !onTop) - { - int frameColor = parameterStore.get(name, "HistoFrame").getI(); - - ag.updateDrawParameters(new ADrawParameters(true, frameColor, 0, 0, 1, 0)); - for (int j = 0; j < display.hv[0].length; j++) - { - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - - // Draw histogram towers. - int fillColor = parameterStore.get(name, "Histogram").getI(); - ag.updateDrawParameters(new ADrawParameters(true, fillColor, 0, 1, 0, 0)); - for (int j = 0; j < display.hv[0].length; j++) - { - ag.fillPolygon(hist, display.index[j], display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - - /** - * Draws the calorimeter histogram frames. - * - * @param calorimeter ACalorimeterData calorimeter object the histograms - * belong to - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - */ - protected static void frameHistogram(ACalorimeterData calorimeter, AWindow window, AGraphics ag, AProjection2D projection) - { - String name = calorimeter.getCalorimeterName(); - if (!parameterStore.get(name, "Histogram").getStatus()) - return; - - ACoord[] histograms = calorimeter.getUserHistograms(projection); - for (int i = 0; i < histograms.length; i++) - { - ACoord display = window.calculateDisplay(histograms[i]); - AHistogram hist = (AHistogram) display.source; - - hist.completeTowers(display); - - boolean onTop = false; - if (parameterStore.getUnknown(name, "OnTopHistoFrame") != null) - { - onTop = parameterStore.get(name, "OnTopHistoFrame").getStatus(); - } - - // Draw frame for the histogram. - if (parameterStore.get(name, "HistoFrame").getStatus() && onTop) - { - int frameColor = parameterStore.get(name, "HistoFrame").getI(); - - ag.updateDrawParameters(new ADrawParameters(true, frameColor, 0, 1, 0, 0)); - for (int j = 0; j < display.hv[0].length; j++) - { - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - } - - public static void drawEndcapHistogram(ACalorimeterData calorimeter, AWindow window, AGraphics ag, AProjection2D projection) - { - //filter the draw list for the histograms - calorimeter.filterDrawList(projection); - //Draw the histograms. - drawHistogram(calorimeter, window, ag, projection); - // Draw the frames for the histograms. - frameHistogram(calorimeter, window, ag, projection); - } - - - - /** - * getLookupTableArray() parses String[][] s with comma separated values - * (CSV) and converts each number to float lookup table value which is used - * for calorimeter real pulse shapes plots - * @param s String[][] - * @param numLookupTableValues int - * @return float[] - * @throws AAtlantisException - */ - protected static float[] getLookupTableArray(String[][] s, int numLookupTableValues) - throws AAtlantisException - { - float[] r = new float[numLookupTableValues]; - int i = 0; - for(int k = 0; k < s.length; k++) - { - for(int l = 0; l < s[k].length; l++) - { - if("".equals(s[k][l])) - { - // command and new line results into empty value - ignore - continue; - } - try - { - // there shouldn't be more than NUMBER_OF_LOOKUP_VALUES - // i.e. numLookupTableValues - if(i >= numLookupTableValues) - { - String m = "more lookup values than NUMBER_OF_LOOKUP_VALUES: " + - i + " >= " + numLookupTableValues; - throw new AAtlantisException(m); - } - r[i] = Float.valueOf(s[k][l]).floatValue(); - i++; - } - catch(NumberFormatException ex) - { - throw new AAtlantisException("number format exception: " + s[k][l]); - } - } - } - - // now the i counter shall be equal to numLookupTableValues - if(i != numLookupTableValues) - { - throw new AAtlantisException("incorrect number to items (" + i + ") " + - "in the lookup table, should be " + numLookupTableValues); - } - - // all right, return the result float array - return r; - - } // getLookupTableArray() ---------------------------------------------- - - - - /** - * Calculate real pulse shapes values based on the values in the - * lookup tables (parameters amplitude and time, etc) - - * @param xTime double - * @param cellTime double - * @param cellPedestal double - * @param energy double - * @param amplitude float[] lookup table - * @param time float[] lookup table - * @param numerOfLookupValues int - * @return double - * @throws AAtlantisException - */ - protected double getPhysicsPulseShape(double localTime, - double cellPedestal, double energy, - float[] amplitude, float[] time, - int numerOfLookupValues) - throws AAtlantisException - { - double tdiv = 0.0; - int lookup = 0; - double xpulse = 0.0; - - tdiv = time[1] - time[0]; - lookup = (int) ((localTime - time[0]) / tdiv); - - if(lookup < 0) - { - lookup = 0; - } - if(lookup >= numerOfLookupValues - 1) - { - lookup = numerOfLookupValues - 2; // -1 was off by 1 - } - - try - { - if(lookup == 0 || lookup == numerOfLookupValues - 2) - { - xpulse = amplitude[lookup]; - } - else - { - xpulse = amplitude[lookup] + ((amplitude[lookup + 1] - - amplitude[lookup]) / tdiv) * (localTime - time[lookup]); - } - } - catch(ArrayIndexOutOfBoundsException ex) - { - String m = CALORIMETER_NAME + " getPhysicsPulseShape():\n" + - " lookup index out of bound: lookup = " + lookup; - throw new AAtlantisException(m); - } - - return (xpulse * energy) + cellPedestal; - - } // getPhysicsPulseShape() --------------------------------------------- - - - - /** - * - * Events from DPD don't contain all necessary data - * if all adc counts are 0, then print info message and - * no pulse shape plot window as it may lead to confusion. - * This method is aimed to check availability of adc counts digits. - * - * @param adcCountsLocal - * @return true if any ADC counts are non-zero - */ - protected static boolean checkADCCountsAvailability(int[][] adcCountsLocal) - { - boolean adcCountsAvailable = false; - - for(int x = 0; x < adcCountsLocal.length; x++) - { - for(int y = 0; y < adcCountsLocal[0].length; y++) - { - if(adcCountsLocal[x][y] != 0) - { - adcCountsAvailable = true; - break; - } - } - if(adcCountsAvailable) - { - break; - } - } - - return adcCountsAvailable; - - } // checkADCCountsAvailability() --------------------------------------- - - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ACalorimeterRPSPLT.java b/graphics/AtlantisJava/src/atlantis/data/ACalorimeterRPSPLT.java deleted file mode 100644 index 9f8890bec80c96dc8d1c5bd907ca875c132382a8..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ACalorimeterRPSPLT.java +++ /dev/null @@ -1,260 +0,0 @@ -package atlantis.data; - -import java.util.HashMap; - -import atlantis.utils.ALogger; -import atlantis.utils.AAtlantisException; - -/** - * - * Calorimeter Real Pulse Shape Plot Lookup - * Tables. The class accommodates lookup tables (arrays) for the Tile and LAr, - * FCAL and HEC calorimeters. If the real pulse shape plots data are found in - * the event files, the corresponding arrays within this class are initialised - * from A[TILE|LAr|FCAL|HEC]Data class(es). The arrays are initialised from - * CSV (comma separated values files) just once per Atlantis session. - * - * @author Zdenek Maxa - */ -public final class ACalorimeterRPSPLT -{ - private static ALogger logger = ALogger.getLogger(ACalorimeterRPSPLT.class); - - // TILE calorimeter, lookup table time values - protected static float[] TILE_TIME = null; - // TILE calorimeter, lookup table amplitude values - protected static float[] TILE_AMPLITUDE = null; - - - // FCAL calorimeter, lookup table time values - protected static float[] FCAL_TIME = null; - // FCAL calorimeter, lookup table layer 0, amplitude values - protected static float[] FCAL_LAYER0_AMPLITUDE = null; - // FCAL calorimeter, lookup table layer 1, amplitude values - protected static float[] FCAL_LAYER1_AMPLITUDE = null; - // FCAL calorimeter, lookup table layer 2, amplitude values - protected static float[] FCAL_LAYER2_AMPLITUDE = null; - - - // HEC calorimeter, lookup table time values - protected static float[] HEC_TIME = null; - // HEC calorimeter, lookup table amplitude values - protected static float[] HEC_AMPLITUDE = null; - - - - - // LAr calorimeter, lookup tables - // for time (the same array for both - // barrel/endcap, all layer and regions and eta ranges - // currently (2009-02-11) there are 58 various arrays for LAr, it - // is not sustainable to have all these in separate arrays - for LAr - // there will be defined a container - keys are lookup tables names - // as defined in the lookup table file and values are float[] arrays - private static HashMap<String, float[]> larTables = null; - - // set the LAr table keys in a static block - // explanation of the LAr lookup tables names (the names are identical - // to comma separated values array names as in the look up table file): - // LAR_TIME - time constants - used for barrel/endcap, all layers, - // all regions, all eta ranges - // LAR_BARREL_L1_R0_AMPLITUDE - barrel, layer 1, region 0, etc, etc - // LAR_ENDCAP_L0_R0_ETA0_AMPLITUDE - endcap, layer 0, region 0, eta - // range 0 - very many of these - // bother to define the array names here to be really safe ... otherwise - // could just rely on the CSV file ... - static - { - larTables = new HashMap<String, float[]>(70); // not more arrays than 70 - - larTables.put("LAR_TIME", null); - larTables.put("LAR_BARREL_LAYER1_REGION0_AMPLITUDE", null); - larTables.put("LAR_BARREL_LAYER1_REGION1_AMPLITUDE", null); - larTables.put("LAR_BARREL_LAYER2_REGION0_AMPLITUDE", null); - larTables.put("LAR_BARREL_LAYER2_REGION1_AMPLITUDE", null); - larTables.put("LAR_BARREL_LAYER3_REGION0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER0_REGION0_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION0_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION0_ETA1_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION0_ETA2_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION0_ETA3_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION0_ETA4_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION0_ETA5_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION0_ETA6_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION0_ETA7_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION1_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION2_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION2_ETA1_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION2_ETA2_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION2_ETA3_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION3_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION3_ETA1_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION3_ETA2_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION4_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION4_ETA1_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION4_ETA2_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION4_ETA3_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION4_ETA4_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER1_REGION5_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION0_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION0_ETA1_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION0_ETA2_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION0_ETA3_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION0_ETA4_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION0_ETA5_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION0_ETA6_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION0_ETA7_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA1_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA2_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA3_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA4_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA5_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA6_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA7_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA8_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA9_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER2_REGION1_ETA10_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA0_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA1_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA2_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA3_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA4_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA5_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA6_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA7_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA8_AMPLITUDE", null); - larTables.put("LAR_ENDCAP_LAYER3_REGION0_ETA9_AMPLITUDE", null); - } - - - - - public static boolean areFCALLookupTablesInitialized() - { - if(FCAL_LAYER0_AMPLITUDE != null && - FCAL_LAYER1_AMPLITUDE != null && - FCAL_LAYER2_AMPLITUDE != null && - FCAL_TIME != null) - { - return true; - } - else - { - return false; - } - - } // areFCALLookupTablesInitialized() ----------------------------------- - - - - public static boolean areHECLookupTablesInitialized() - { - if(HEC_TIME != null && HEC_AMPLITUDE != null) - { - return true; - } - else - { - return false; - } - - } // areHECLookupTablesInitialized() ------------------------------------ - - - - public static boolean areTileLookupTablesInitialized() - { - if(TILE_TIME != null && TILE_AMPLITUDE != null) - { - return true; - } - else - { - return false; - } - - } // areTileLookupTablesInitialized() ----------------------------------- - - - - /** - * Method is called at LAr constructor, i.e. at the beginning of each - * event to check if all lookup tables for LAr are properly initialised. - * The check is performed only when other necessary LAr are is available - * in a given event file. - * @return true if all float arrays were properly initialised - */ - public static boolean areLarLookupTablesInitialized() - { - // iterate over all keys in the container and check if all - // float arrays were properly initialised - for(String key : larTables.keySet()) - { - if(larTables.get(key) == null) - { - logger.error("LAr real pulse shapes plots lookup table " + - "\"" + key + "\" was not initialised."); - return false; - } - } - - return true; - - } // areLarLookupTablesInitialized() ------------------------------------ - - - - public static void setLarTable(String key, float[] array) throws AAtlantisException - { - logger.debug("Setting LAr pulse shapes lookup table \"" + key + "\""); - - if(larTables.containsKey(key)) - { - // it certainly already should contain the key (defined above) - if(larTables.get(key) != null) - { - throw new AAtlantisException("LAr pulse shapes lookup table \"" + - key + "\" has already been defined."); - } - else - { - larTables.put(key, array); - } - } - else - { - throw new AAtlantisException("LAr pulse shapes lookup table - " + - "entry \"" + key + "\" has not been created."); - } - - } // setLarTable() ------------------------------------------------------ - - - - public static float[] getLarTable(String key) throws AAtlantisException - { - logger.debug("Getting LAr pulse shapes lookup table \"" + key + "\""); - if(larTables.containsKey(key)) - { - float[] r = larTables.get(key); - if(r == null) - { - throw new AAtlantisException("LAr pulse shape lookup table " + - "key \"" + key + "\" is null."); - } - else - { - return r; - } - } - else - { - throw new AAtlantisException("LAr pulse shape lookup table " + - "entry \"" + key + "\" has not been created."); - } - - } // getLarTable() ------------------------------------------------------ - - -} // class ACalorimeterRPSPLT =============================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/AClusterData.java b/graphics/AtlantisJava/src/atlantis/data/AClusterData.java deleted file mode 100644 index 9428320eec970424e373db4c04bb5ad156c50025..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AClusterData.java +++ /dev/null @@ -1,385 +0,0 @@ -package atlantis.data; - -import atlantis.canvas.AWindow; -import atlantis.event.AAssociation; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionVP; -import atlantis.utils.A3Vector; -import atlantis.utils.A4Vector; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -/** - * Calo Clusters for the moment made from LAr cells - * - * Also contain AOD Calo Clusters from 24/10/2006 - */ -public class AClusterData extends AData -{ - protected float[] eT; - protected float[] eta; - protected float[] phi; - - public String getParameterGroup() - { - return "Cluster"; - } - - @Override - public String getName() - { - return "Cluster"; - } - - public String getNameScreenName() - { - return "Cluster"; - } - - public float getET(int index) - { - return eT[index]; - } - - public float getEta(int index) - { - return eta[index]; - } - - public float getPhi(int index) - { - return phi[index]; - } - - AClusterData(AHashMap p, AEvent e) - { - super(p,e); - - eta = p.getFloatArray("eta"); - phi = p.getFloatArray("phi"); - if (p.get("et") != null) - eT = p.getFloatArray("et"); - else - { - float[] energy = p.getFloatArray("energy"); - eT = new float[numData]; - for (int i = 0; i < numData; ++i) - eT[i] = (float) Math.abs(energy[i] * Math.cos(AMath.lambda(eta[i]))); - } - - String assocKey = getName() + getStoreGateKey(); - if (p.get("numCells") != null) - { - event.getAssociationManager().add(new AAssociation(assocKey, "LAr", p.getIntArray("numCells"), p.getIntArray("cells"),event)); - event.getAssociationManager().add(new AAssociation(assocKey, "TILE", p.getIntArray("numCells"), p.getIntArray("cells"),event)); - } - } - - protected int getDrawOrFill() - { - return AGraphics.FILL; - } - - protected void applyCuts() - { - cutIndex(); - cut("CutsCalo", "ClusterET", " |ET|", eT); - cutPhi(phi); - cutEta(eta); - } - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - switch (colorFunction) - { - case 0: // by constant - colorByConstant(); - break; - case 1: // by index - colorByIndex(); - break; - case 2: // by objects - colorByObjects(); - break; - } - return 3; - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n ET="+String.format("%.3f",eT[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Ex="+String.format("%.3f",eT[index]*Math.cos(phi[index]))+" GeV "+ - "\n Ey="+String.format("%.3f",eT[index]*Math.sin(phi[index]))+" GeV "+ - "\n Ez="+String.format("%.3f",eT[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n storegate key: "); - msg.append(sgKey); - msg.append("\n ET = "); - msg.append(String.format("%.3f",eT[index])); - msg.append(" GeV\n E = "); - msg.append(String.format("%.3f",Math.abs(eT[index]/Math.cos(AMath.lambda(eta[index]))))); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",Math.toDegrees(phi[index])) + AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - - return msg.toString(); - } - - public String getVPHitInfo() - { - makeDrawList(); - if (numDraw == 0) - return ""; - double sumE = 0.; - double sumET = 0.; - - for (int i = 0; i < numDraw; ++i) - { - sumET += Math.abs(eT[listdl[i]]); - sumE += Math.abs(eT[listdl[i]] / Math.cos(AMath.lambda(eta[listdl[i]]))); - } - - StringBuffer msg = new StringBuffer(""); - msg.append(numDraw); - msg.append(" "); - msg.append(getStoreGateKey() != null ? getStoreGateKey() : getNameScreenName()); - msg.append(" sum(ET) = "); - msg.append(String.format("%.1f",sumET)); - msg.append(" sum(E) = "); - msg.append(String.format("%.1f",sumE)); - - return msg.toString(); - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A3Vector start = A3Vector.fromRhoPhiZ(0., 0., 0.); - double tL = AMath.tanLambda(eta[k]); - A3Vector stop = A3Vector.fromRhoPhiZ(1., phi[k], tL); - A3Vector v = (stop.subtract(start)).normalize(); - double p = eT[k] / Math.sqrt(1. - v.z * v.z); - sum.add(new A4Vector(v.scale(p), 0.)); - } - - return sum; - } - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if(projection instanceof AProjectionVP) - { - drawVP(window, ag, projection); - } - else - { - super.draw(window, ag, projection); - } - } - - private void drawVP(AWindow window, AGraphics ag, AProjection2D projection) - { - ACoord centers=window.calculateDisplay(getUser(projection)); - int[] drawlist=centers.index; - double eLimit=0.025; - int numPoints=25; - double[][][] hv=new double[2][drawlist.length][numPoints]; //circle - - for(int i=0; i<drawlist.length; ++i) - { - int list=drawlist[i]; - double e; - e = Math.abs(eT[list]); - int d=(int)(Math.sqrt((e/eLimit)/Math.PI)); - if(d==0) d=1; - for(int j=0; j<numPoints; j++) - { - hv[0][i][j]=centers.hv[0][0][i]+d*Math.cos(Math.PI*2*j/(numPoints-1)); - hv[1][i][j]=centers.hv[1][0][i]+d*Math.sin(Math.PI*2*j/(numPoints-1)); - } - } - ag.draw(new ACoord(hv, drawlist, this, ACoord.POLYLINES)); - } - - protected ACoord getVPUser() - { - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index=new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list=listdl[i]; - h[i]=eta[list]; - v[i]=Math.toDegrees(phi[list]); - index[i]=list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - } - - protected ACoord getYXUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - double dphi = Math.toRadians(0.5); - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiPlus = phi[list] + dphi; - double phiMinus = phi[list] - dphi; - double cosPlus = Math.cos(phiPlus); - double sinPlus = Math.sin(phiPlus); - double cosMinus = Math.cos(phiMinus); - double sinMinus = Math.sin(phiMinus); - - // Rho range of LAr Detector (EM) is about between [148.175, 198.47] - // Rho range of TILE Detector (Had) is about between [229, 386] - double rhoMax = 380; - double rhoMinus = 155; - - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double rhoPlus = rhoMax; - if(Math.abs(eT[list]) < maxEnergy) - rhoPlus = rhoMinus + (rhoMax - rhoMinus) * Math.abs(eT[list]) / maxEnergy; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = rhoMinus * cosPlus; - hv[1][i][0] = rhoMinus * sinPlus; - // x1, y1 - hv[0][i][1] = rhoPlus * cosPlus; - hv[1][i][1] = rhoPlus * sinPlus; - // x2, y2 - hv[0][i][2] = rhoPlus * cosMinus; - hv[1][i][2] = rhoPlus * sinMinus; - // x3, y3 - hv[0][i][3] = rhoMinus * cosMinus; - hv[1][i][3] = rhoMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - - protected ACoord getFRUser() - { - return getYXUser().convertYXToFR().includePhiWrapAround("FR"); - } - - protected ACoord getRZUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - double dtheta = Math.toRadians(0.5); - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi[list]-phiMid); - double rSign; - if (phiDiff > Math.PI/2. && phiDiff <= 3*Math.PI/2.) - rSign = -1; - else - rSign = 1; - - // calculate theta based on the eta value - double theta = Math.atan(Math.exp(-Math.abs(eta[list]))) * 2.0; - if ((eta[list] > 0.) && (rSign == -1)) - theta = 2 * Math.PI - theta; - else if ((eta[list] < 0.) && (rSign == -1)) - theta += Math.PI; - else if ((eta[list] < 0.) && (rSign == 1)) - theta = Math.PI - theta; - - double thetaPlus = theta + dtheta; - double thetaMinus = theta - dtheta; - double cosPlus = Math.cos(thetaPlus); - double sinPlus = Math.sin(thetaPlus); - double cosMinus = Math.cos(thetaMinus); - double sinMinus = Math.sin(thetaMinus); - - // decide the region based on the theta value - final byte LAR = 0; - final byte LAR_ENDCAP = 1; - final byte FCAL_EM = 2; - byte region = LAR; - // hard-coded value is based on the values in AGeometry.xml - if(Math.abs(Math.tan(theta)) >= 0.0778 && Math.abs(Math.tan(theta)) < 0.4828) - region = LAR_ENDCAP; - else if(Math.abs(Math.tan(theta)) < 0.0778) - region = FCAL_EM; - - double radiusMinus = 0.; - switch(region) - { - // use fixed rho/z to determine the lower radius value - case LAR: - radiusMinus = 155 / Math.abs(Math.sin(theta)); - break; - case LAR_ENDCAP: - radiusMinus = 380 / Math.abs(Math.cos(theta)); - break; - case FCAL_EM: - radiusMinus = 470 / Math.abs(Math.cos(theta)); - break; - } - double radiusMax = radiusMinus + 200; - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double radiusPlus = radiusMax; - if(Math.abs(eT[list]) < maxEnergy) - radiusPlus = radiusMinus + (radiusMax - radiusMinus) * Math.abs(eT[list]) / maxEnergy; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = radiusMinus * cosPlus; - hv[1][i][0] = radiusMinus * sinPlus; - // x1, y1 - hv[0][i][1] = radiusPlus * cosPlus; - hv[1][i][1] = radiusPlus * sinPlus; - // x2, y2 - hv[0][i][2] = radiusPlus * cosMinus; - hv[1][i][2] = radiusPlus * sinMinus; - // x3, y3 - hv[0][i][3] = radiusMinus * cosMinus; - hv[1][i][3] = radiusMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ACompositeParticleData.java b/graphics/AtlantisJava/src/atlantis/data/ACompositeParticleData.java deleted file mode 100755 index 5537e5b0331f2416d521b5b01c8c236319ecab1b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ACompositeParticleData.java +++ /dev/null @@ -1,114 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -/** - * Reconstructed CompositeParticle - */ -public class ACompositeParticleData extends AAODData -{ - private int[] pdgId; - private float[] charge; - private String[] label; - private String[] typeEV; - - ACompositeParticleData(AHashMap p, AEvent e) - { - super(p,e); - pdgId = p.getUnsureIntArray("pdgId"); - charge=p.getUnsureFloatArray("charge"); - label=p.getStringArray("label"); - typeEV=p.getStringArray("typeEV"); - } - - public String getParameterGroup() - { - return "CompositeParticle"; - } - - @Override - public String getName() - { - return "CompositeParticle"; - } - - public int getPdgId(int index) - { - return pdgId[index]; - } - - public float getCharge(int index) - { - return charge[index]; - } - - public String getLabel(int index) - { - return label[index]; - } - - public String getTypeEV(int index) - { - return typeEV[index]; - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n PT="+String.format("%.3f",pT[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Px="+String.format("%.3f",pT[index]*Math.cos(phi[index]))+" GeV "+ - "\n Py="+String.format("%.3f",pT[index]*Math.sin(phi[index]))+" GeV "+ - "\n Pz="+String.format("%.3f",pT[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" = "); - msg.append(id[index]); - msg.append("\n storegate key: "); - msg.append(sgKey); - msg.append("\n PT = "); - msg.append(String.format("%.3f",pT[index])); - msg.append(" GeV\n P = "); - msg.append(String.format("%.3f",Math.abs(pT[index]/Math.cos(AMath.lambda(eta[index]))))); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",Math.toDegrees(phi[index]))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - - if (charge != null) - { - msg.append("\n Charge = "); - msg.append(charge[index]); - } - if(pdgId != null) - { - if(pdgId[index]!=0) - msg.append("\n Type = " + APDGTable.getName(pdgId[index]) + " (type code " + pdgId[index] + ")" ); - else - msg.append("\n Type = unknown (type code " + pdgId[index] + ")" ); - } - msg.append("\n TypeEV = " + typeEV[index]); - if (label != null) - msg.append("\n Label = " + label[index]); - return msg.toString(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ADHelix.java b/graphics/AtlantisJava/src/atlantis/data/ADHelix.java deleted file mode 100755 index 6e1228528da961a623534f83a5a4e259dfb17823..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ADHelix.java +++ /dev/null @@ -1,539 +0,0 @@ -package atlantis.data; - -import java.awt.geom.Point2D; -import java.util.Vector; -import java.awt.Rectangle; - -import atlantis.canvas.AWindow; -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.graphics.ACoord; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjection3D; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionXZ; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; - -/** - * Helix in a format suitable for drawing given as a circle with - * centre point and radius etc. - * - * phi is the angle seen from the primary vertex - * a = alpha = the angle as seen for the center of the circle - * - */ -public class ADHelix -{ - private final static ALogger logger = ALogger.getLogger(ADHelix.class); - - // parameters used internally - private static final APar parameterStore = APar.instance(); - private static final AParameter rToPar = parameterStore.get("RTr", "RadiusTr"); - private static final AParameter lToPar = parameterStore.get("RTr", "LineTr"); - private static final AParameter zToPar = parameterStore.get("RTr", "ZTr"); - private static final int callDepthCut = parameterStore.get("RTr", "CallDepth").getI();; - - /** The associated helix object. */ - public final AHelix helix; - - // description of helix - private final double rC, xC, yC, ch, a0, x0, y0, z0, bz, cosA0, sinA0; - // position along helix - private final double aStart, aEnd; - - /** Attempt to encapsulate the "current position" variables. */ - private static class HelixPoint { - double x, y, z, rho, phi; - } - - private double startPhi; // the phi value of starting point of "v" - // TODO: Would prefer this not to be part of the state of the helix object. - private boolean startMark; // true when calculating start point, false otherwise - - ADHelix(AOldHelix h) { - this(new AHelix(h)); - } - - ADHelix(AHelix h) - { - helix = h; - double[] perigee = h.getPar(); // d0, z0, phi0, cotanTheta, q/pT - - AParameter curvatureParameter = parameterStore.get("Event", "Curvature"); - if (curvatureParameter != null) { - rC = curvatureParameter.getD() / Math.abs(perigee[4]); - } else { - rC = (100/0.6) / Math.abs(perigee[4]); - } - ch = AMath.getSign(perigee[4]); - a0 = Math.toDegrees(perigee[2]) + ch * 90.; - double a0Rad = Math.toRadians(a0); - cosA0 = Math.cos(a0Rad); - sinA0 = Math.sin(a0Rad); - z0 = perigee[1]; - double d0 = perigee[0]; - double signD0 = ch; - d0 *= signD0; - x0 = d0 * cosA0; - y0 = d0 * sinA0; - double SD0 = 1.; - double SRC = 1.; - double r0 = SD0 * d0 - SRC * rC; - xC = r0 * cosA0; - yC = r0 * sinA0; - bz = rC * Math.toRadians(perigee[3]); - double rTo = rToPar.getD(); - //Check if track is limited by end vertex - if ( helix.getRhoEndVertex() > 0. ) - rTo = Math.min(rTo,helix.getRhoEndVertex()); - double zTo = zToPar.getD(); - /*******************************************************************************/ - //Adrian Vatchinsky, Andy Haas (NYU) - //Import the coordinates of the primary vertex in order to calculate new starting angle - AEventManager eventManager = AEventManager.instance(); - AEvent currentEvent = eventManager.getCurrentEvent(); - if (helix.getRho(helix.getAlphaMin())!=0 || currentEvent==null) { // FIXME: doubles compared for equality - aStart = helix.getAlphaMin(); // old, DCA to 0,0 - } else { // new, DCA to PV - double[] primaryVertex = currentEvent.getPrimaryVertex(); - double xV = primaryVertex[0]; double yV = primaryVertex[1]; - aStart = helix.getAlphaMin() + ch*Math.toDegrees(Math.atan2(yC,xC)-Math.atan2(yC-yV,xC-xV)); - } - /*******************************************************************************/ - HelixPoint point = pointAt(aStart); - // don't draw tracks starting outside the tracking region - if(Math.abs(point.rho) > rTo || Math.abs(point.z) > zTo) - { - this.aEnd = aStart; - return; - } - //Calculate max phi angle -> no track can have more than 180 deg - double aEndMax = Math.min(aStart + 180., 180.); - //Also the track should not stick out of the rTo zylinder - double aEndR = intersectWithRadialCylinder(rTo, aStart, aEndMax); - // nor should it go beyond the max. z-extension - double aEndZ = intersectWithZPlanes(zTo, aStart, aEndMax); // or beyond the end-vertex radius, if given - double aEndTmp = Math.min(aEndMax, aEndR); - if(aEndZ > aStart) aEndTmp = Math.min(aEndTmp, aEndZ); - this.aEnd = Math.min(aEndTmp, aEndMax); - } - - - // calculate phi on track at intersection - // Cylinder is infinite in Z direction - public double intersectWithRadialCylinder(double rCyl, double aStart, - double aEnd) - { - if(rC <= 0.) return aStart; - double r0 = Math.sqrt(xC * xC + yC * yC); - double bb = (rCyl * rCyl - rC * rC - r0 * r0) / (2. * rC * r0); - double rhoStart = getRho(aStart); - double rhoEnd = getRho(aEnd); - if(rCyl >= rhoStart && rCyl >= rhoEnd) return aEnd; - if(rCyl <= rhoStart && rCyl <= rhoEnd) return aStart; - if(Math.abs(bb) > 1.) - { - // needs to be understood better (Hans) - // event file: acr_muontrack_problem_event.xml - logger.warn("Bug in ADHelix " + rCyl + " " + rhoStart + " " + rhoEnd); - return aEnd; - } - double cc = Math.toDegrees(Math.acos(bb)); - if(Math.abs(cc) > 360) - throw new Error("error in cc in dhelix"); - double gA = Math.toDegrees(Math.atan2(yC, xC)); - double a1 = ch * (a0 - gA + cc); - double a2 = ch * (a0 - gA - cc); - if(a1 < 0.) a1 += 360.; - if(a2 < 0.) a2 += 360.; - if(a1 >= 360.) a1 -= 360.; - if(a2 >= 360.) a2 -= 360.; - return Math.min(a1, a2); - } - - - // calculate phi on track at intersection - public double intersectWithZPlanes(double zCyl, double aStart, double aEnd) - { - double zMin = 20.; - double aZ = aEnd; - if(zCyl >= zMin && bz != 0.) - { - double aZPlus = (zCyl - z0) / bz; - double aZMinus = ( -zCyl - z0) / bz; - if(aZPlus < aZ && aZPlus > aStart) aZ = aZPlus; - if(aZMinus < aZ && aZMinus > aStart) aZ = aZMinus; - } - return aZ; - } - - - // calculate phi on track at intersection - // cylinder finite in Z - public double intersectWithCylinder(boolean useR, double rCyl, boolean useZ, - double zCyl) - { - double aStart = 0.; - double aEndMax = 180.; - double zMin = 20.; - double aEndR = 0.; - if(useR) - aEndR = intersectWithRadialCylinder(rCyl, aStart, aEndMax); - double aEndZ = 0.; - if(useZ && zCyl >= zMin && bz != 0.) - { - aEndZ = intersectWithZPlanes(zCyl, aStart, aEndMax); - return Math.min(aEndR, aEndZ); - } - else - return aEndR; - } - - - // a... angle in deg starting with 0 meaning point of closest approach - private HelixPoint pointAt(double a) - { - HelixPoint point = new HelixPoint(); - double aRad = Math.toRadians(a0 - ch * a); - point.x = x0 + rC * (Math.cos(aRad) - cosA0); - point.y = y0 + rC * (Math.sin(aRad) - sinA0); - point.z = z0 + bz * a; - double[] primaryVtx = AParameterUtilities.getPrimaryVertex(); - double dx = point.x - primaryVtx[0]; - double dy = point.y - primaryVtx[1]; - point.rho = Math.sqrt(dx * dx + dy * dy); - double phi0 = Math.toDegrees(Math.atan2(dy, dx)); - double phiMid2 = parameterStore.get("RZ", "Phi").getD(); - point.phi = AMath.nearestPhiDegrees(phi0,phiMid2); - return point; - } - - - // s1 and s2 are the extreme values of phi - // used to avoid tracks being drawn with phi discontinuity - // in phi projections - // = FiMid in atlantis fortran ask Hans Drevermann - public double setPhiStart(double s1, double s2) - { - double phi1 = getPhi(s1); - double phi2 = getPhi(s2); - double phiM = getPhi((s1 + s2) / 2); - // doesn't work for all tracks but for most - if(Math.abs(phi1 - phi2) > 180. || Math.abs(phi1 - phiM) > 180. || - Math.abs(phi2 - phiM) > 180.) - { - if(phi1 - phiM > 180.) phi1 -= 360.; - if(phi2 - phiM > 180.) phi2 -= 360.; - if(phi1 - phiM < -180.) phi1 += 360.; - if(phi2 - phiM < -180.) phi2 += 360.; - - // must be something wrong here, phiM is the same using the - // following code, then why use if ... else ... - if(phi1 < phiM && phiM < phi2) - phiM = (phi1 + phi2) / 2.; - else if(phi1 > phiM && phiM > phi2) - phiM = (phi1 + phi2) / 2.; - else - { - phiM = (phi1 + phi2) / 2.; - } - } - if(phiM > 360.) - phiM -= 360.; - if(phiM < 0.) - phiM += 360.; - return phiM; - } - - - public double getAStart() - { - return aStart; - } - - - public double getAEnd() - { - return aEnd; - } - - - public ACoord getYXPoint(double a) - { - HelixPoint point = pointAt(a); - return new ACoord(point.x, point.y, -1); - } - - - public ACoord getRZPoint(double a) - { - HelixPoint point = pointAt(a); - double phiMid2 = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(Math.toRadians(point.phi) - phiMid2); - if(phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - return new ACoord(point.z, point.rho, -1); - else - return new ACoord(point.z, -point.rho, -1); - } - - - public ACoord get3DPoint(double a) - { - HelixPoint point = pointAt(a); - double[] point3D = {point.x,point.y,point.z}; - point3D = AProjection3D.getRotated(point3D); - return new ACoord(point3D[0], point3D[1], -1); - } - - - public double[] get3DPointAsArray(double a) - { - HelixPoint point = pointAt(a); - double[] point3D = new double[] {point.x, point.y, point.z }; - point3D = AProjection3D.getRotated(point3D); - return point3D; - } - - - public ACoord getXZPoint(double a) - { - HelixPoint point = pointAt(a); - double phiC = AProjectionXZ.getPhi(); - return new ACoord(point.z, point.rho * Math.cos(Math.toRadians(point.phi - phiC)), -1); - } - - - public ACoord getYZPoint(double a) - { - HelixPoint point = pointAt(a); - double phiC = AProjectionXZ.getPhi(); - return new ACoord(point.z, point.rho * Math.sin(Math.toRadians(point.phi - phiC)), -1); - } - - - public ACoord getFZPoint(double a) - { - HelixPoint point = pointAt(a); - double temp = Math.toDegrees(AParameterUtilities.getPhiStereo(point.rho, Math.toRadians(point.phi), point.z)); - return new ACoord(point.z, temp, -1); - } - - - public ACoord getFRPoint(double a) - { - HelixPoint point = pointAt(a); - double temp = Math.toDegrees(AParameterUtilities.getPhiStereo(point.rho, Math.toRadians(point.phi), point.z)); - return new ACoord(point.rho, temp, -1); - } - - - public ACoord getVPPoint(double a, int sign) - { - HelixPoint point = pointAt(a); - if(startMark) // start point - { - startPhi = point.phi; // phi is between 0 and 360 - } - else - { - point.phi = AMath.nearestPhiDegrees(point.phi, startPhi); - } - return new ACoord(AParameterUtilities.eta(point.z, point.rho) + - sign * AProjectionVP.getDeltaEta(point.rho, point.z), point.phi, -1); - } - - - public ACoord getLEGOPoint(double a) - { - //added by Mark Stockton - HelixPoint point = pointAt(a); - double temp = Math.toDegrees(AParameterUtilities.getPhiStereo(point.rho, Math.toRadians(point.phi), point.z)); - return new ACoord(AParameterUtilities.eta(point.z, point.rho), temp, -1); - } - - - public double getPhi(double a) - { - HelixPoint point = pointAt(a); - return point.phi; - } - - - public double getEta(double a) - { - HelixPoint point = pointAt(a); - return AParameterUtilities.eta(point.z, point.rho); - } - - - private double getRho(double a) - { - HelixPoint point = pointAt(a); - return point.rho; - } - - - /** Draw helix in display space in an iterative manner. */ - public ACoord drawHelix(AWindow window, AProjection2D projection, double s1, double s2) - { - Vector<Point2D.Double> pointsOnHelix = new Vector<Point2D.Double>(100); - double dPrevious = 999.; - int callDepth = 0; - // get the point at the beginning and end of the helix, defined by the phi-values (s1,s2) - startMark = true; - ACoord d1 = window.calculateDisplay(projection.getUserPoint(this, s1)); - double h1 = d1.hv[0][0][0]; - double v1 = d1.hv[1][0][0]; - startMark = false; - ACoord d2 = window.calculateDisplay(projection.getUserPoint(this, s2)); - double h2 = d2.hv[0][0][0]; - double v2 = d2.hv[1][0][0]; - pointsOnHelix.add(new Point2D.Double(h1, v1)); - // We are simply adding points here, in the end the helix is drawn as a polyline - drawHelix(pointsOnHelix, window, projection, s1, h1, v1, s2, h2, v2, - dPrevious, callDepth); - int numPoints; - if(projection instanceof AProjectionVP) - { - numPoints = pointsOnHelix.size(); - } - else - { - numPoints = pointsOnHelix.size() + 1; // add 1 to add a point for the line - } - double[][][] hv = new double[2][1][numPoints]; - int[] index = new int[1]; - Point2D.Double p; - if(projection instanceof AProjectionVP) - { - for(int k = 0; k < numPoints; ++k) - { - p = (Point2D.Double) pointsOnHelix.elementAt(k); - hv[0][0][k] = p.getX(); - hv[1][0][k] = p.getY(); - } - } - else - { - for(int k = 0; k < numPoints - 1; ++k) - { - p = (Point2D.Double) pointsOnHelix.elementAt(k); - hv[0][0][k] = p.getX(); - hv[1][0][k] = p.getY(); - } // first attempt for line... - if(numPoints > 2) - { - double dx = hv[0][0][numPoints - 2] - hv[0][0][numPoints - 3]; - double dy = hv[1][0][numPoints - 2] - hv[1][0][numPoints - 3]; - double x0 = hv[0][0][numPoints - 2] - hv[0][0][0]; - double y0 = hv[1][0][numPoints - 2] - hv[1][0][0]; - - // InDet -> Track -> Rho Track linearly is 0 by default - // and the value is meant beyond Rho Track as Helix parameter, - // hence rToPar + lToPar is used instead of former lToPar only - double dtopar = ( (rToPar.getD() + lToPar.getD()) / rToPar.getD()) * - Math.sqrt(x0 * x0 + y0 * y0); - double cophi = dx / Math.sqrt(dx * dx + dy * dy); - double siphi = dy / Math.sqrt(dx * dx + dy * dy); - double addl = Math.sqrt((y0 * siphi + x0 * cophi) * - (y0 * siphi + x0 * cophi) - - x0 * x0 - y0 * y0 + dtopar * dtopar); - double addlen = Math.min(Math.abs( -(y0 * siphi + x0 * cophi) + - addl), - Math.abs( -(y0 * siphi + x0 * cophi) - - addl)); - hv[0][0][numPoints - 1] = x0 + addlen * cophi + hv[0][0][0]; - hv[1][0][numPoints - 1] = y0 + addlen * siphi + hv[1][0][0]; - } - } - return new ACoord(hv, index); - } - - - /** Called recursively. */ - private void drawHelix(Vector<Point2D.Double> pointsOnHelix, AWindow window, AProjection2D projection, - double s1, double h1, double v1, double s2, double h2, double v2, - double dPrevious, int callDepth) - { - double D_MAX = 1.; - double h21 = h2 - h1; - double v21 = v2 - v1; - // nothing left to draw - if(h21 == 0. && v21 == 0.) - return; - // calculate midpoint - double sM = 0.5 * (s1 + s2); - ACoord dispM = window.calculateDisplay(projection.getUserPoint(this, sM)); - double hM = dispM.hv[0][0][0]; - double vM = dispM.hv[1][0][0]; - - // For speed reasons we make sure we aren't doing a lot of subdivison - // on helix segments outside the view area - boolean isinview = true; - - if (callDepth > 2) { - // Check if bounding box of segment is on the screen anywhere - // Don't try this until we've divided a few times just in case we - // have a really curly helix to deal with - Rectangle wdim = window.getCurrDisp(); - - int left = (int)h1; - int top = (int)v1; - int width = (int)(h2 - h1); - int height = (int)(v2 - v1); - - // Make sure the box isn't upside down or zero in size as this - // seemed to be causing a few problems - if (width < 0) { left += width; width = -width; } - if (height < 0) { top += height; height = -height; } - if (width == 0) { width = 1; } - if (height == 0) { height = 1; } - - Rectangle bound = new Rectangle(left, top, width, height); - - if (!wdim.intersects(bound)) { - // Prevent any further sub-division - isinview = false; - } - } - - // calculate distance of midpoint from straight line approximation - double hM1 = hM - h1; - double vM1 = vM - v1; - double temp = (v21 * hM1 - h21 * vM1); - double dM = temp * temp / (v21 * v21 + h21 * h21); - // this iteration and previous one within tolerance - if(dPrevious < D_MAX && dM < D_MAX) - { - pointsOnHelix.add(new Point2D.Double(h2, v2)); - } - else - { - if(callDepth < callDepthCut && isinview) - { - // split track in two and iterate - drawHelix(pointsOnHelix, window, projection, s1, h1, v1, sM, hM, - vM, dM, callDepth + 1); - drawHelix(pointsOnHelix, window, projection, sM, hM, vM, s2, h2, - v2, dM, callDepth + 1); - } - else - { - pointsOnHelix.add(new Point2D.Double(hM, vM)); - pointsOnHelix.add(new Point2D.Double(h2, v2)); - } - } - } - - public double getxC() { - return xC; - } - - public double getyC() { - return yC; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AETMisData.java b/graphics/AtlantisJava/src/atlantis/data/AETMisData.java deleted file mode 100644 index 2bba9e11185bc0f365dba5192f7e5658cce25e72..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AETMisData.java +++ /dev/null @@ -1,562 +0,0 @@ -package atlantis.data; - -import atlantis.event.AData; -import atlantis.canvas.AWindow; -import atlantis.event.AEvent; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -import java.awt.Stroke; -import java.awt.BasicStroke; -import java.awt.geom.Point2D; - -/** - * AETMisData - Missing ET class implementation. Although it is always - * supposed that there will be only 1 item of the datatype, it's now done - * generically as a normal datatype (assuming there is numData items, this - * numData shall always be 1 for ETMis) - */ -public class AETMisData extends AData { - // data read in from the event file - - protected float[] et; - protected float[] etx; - protected float[] ety; - // calculated data - protected float[] sumet; - protected float[] phi; // in radians - protected final int YX_NUMPOINTS = 200; - - AETMisData(AHashMap p, AEvent e) throws AAtlantisException { - super(p, e); - - sumet = p.getFloatArray("et"); - etx = p.getFloatArray("etx"); - ety = p.getFloatArray("ety"); - - et = new float[numData]; - phi = new float[numData]; - for (int i = 0; i < numData; i++) { - et[i] = (float) Math.sqrt(etx[i] * etx[i] + ety[i] * ety[i]); - - phi[i] = (float) Math.atan2(ety[i], etx[i]); - if (phi[i] < 0.0) { - phi[i] += AMath.TWO_PI; - } - } - - } // AETMisData() ------------------------------------------------------- - - /** - * Assuming there is only one item in the ETMis datatype which shall - * always be, but the rest of the class is more generic (the 0 index) - * @return float - */ - public float getET() { - return et[0]; - - } // getET() ------------------------------------------------------------ - - /** - * Assuming there is only one item in the ETMis datatype which shall - * always be, but the rest of the class is more generic (the 0 index) - * @return float - */ - public float getETx() { - return etx[0]; - - } // getETx() ----------------------------------------------------------- - - /** - * Assuming there is only one item in the ETMis datatype which shall - * always be, but the rest of the class is more generic (the 0 index) - * @return float - */ - public float getETy() { - return ety[0]; - - } // getETy() ----------------------------------------------------------- - - /** - * Assuming there is only one item in the ETMis datatype which shall - * always be, but the rest of the class is more generic (the 0 index) - * @return float - */ - public float getPhi() { - return phi[0]; - - } // getPhi() ----------------------------------------------------------- - - /** - * Returns info string for picking. - * @param index - * @return info string - */ - public String getHitInfo(int index) { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if (simpleOutput > 0) { - String output = getNameScreenName() + " index: " + index; - if (simpleOutput == 1 || simpleOutput == 3) { - output += "\n ET=" + String.format("%.3f", et[index]) + " GeV\n " - + AMath.PHI + " = " + String.format("%.3f", Math.toDegrees(phi[index])) + AMath.DEGREES; - } - if (simpleOutput == 2 || simpleOutput == 3) { - output += "\n Ex=" + String.format("%.3f", et[index] * Math.cos(phi[index])) + " GeV " - + "\n Ey=" + String.format("%.3f", et[index] * Math.sin(phi[index])) + " GeV "; - } - return output; - } - - String msg; - - msg = getNameScreenName() + "\n"; - msg += " storegate key: "; - msg += (storeGateKey == null ? "n/a" : storeGateKey) + "\n"; - msg += " Sum-ET = " + String.format("%.3f", sumet[index]) + " GeV" + "\n" - + " ET-Mis = " + String.format("%.3f", et[index]) + " GeV" + "\n" - + " ETx-Mis = " + String.format("%.3f", etx[index]) + " GeV" + "\n" - + " ETy-Mis = " + String.format("%.3f", ety[index]) + " GeV" + "\n" - + " " + AMath.PHI + " = " - + String.format("%.3f", Math.toDegrees(phi[index])) - + AMath.DEGREES + " (" + String.format("%.3f", phi[index]) + " rad)"; - - return msg; - - } // getHitInfo() ------------------------------------------------------- - - /** - * Info on ETMis contained in v-plot rubberband selection - * @return String - */ - public String getVPHitInfo() { - makeDrawList(); - if (numDraw == 0) { - return ""; - } - - double sumEt = 0.0; - for (int i = 0; i < numDraw; i++) { - sumEt += Math.abs(et[i]); - } - - String key = getStoreGateKey(); - String msg = numDraw + " " + (key != null ? "" + key : getNameScreenName()); - msg += " ET = " + String.format("%.1f", sumEt); - return msg; - - } // getVPHitInfo() ----------------------------------------------------- - - /** - * getParameterGroup() - * @return parameter group - */ - public String getParameterGroup() { - return "ETMis"; - - } // getParameterGroup() ------------------------------------------------ - - public String getName() { - return "ETMis"; - - } // getName() ---------------------------------------------------------- - - public String getNameScreenName() { - return "ETMis"; - - } // getNameScreenName() ------------------------------------------------ - - /** - * internalColor() - * Implement this atlantis.event.AData method - * Coloring of the graphical object on the canvas - * @return number of color types - */ - protected int internalColor() { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if (colorFunction == 0) { - colorByConstant(); - } else if (colorFunction == 1) { - colorByIndex(); - } else if (colorFunction == 2) { - colorByCollection(); - } - - return 3; - - } // internalColor() ---------------------------------------------------- - - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - //option to scale line width by energy - Stroke origStroke = ag.getGraphics2D().getStroke(); - if(parameterStore.getUnknown("ETMis", "LineWidth").getI()==0){ - float factor=0.f; - if(et[0]<5){ - factor=1.0f; - }else if(et[0]<10.){ - factor=1.5f; - }else if(et[0]<15.){ - factor=2.0f; - }else if(et[0]<20.){ - factor=2.5f; - }else if(et[0]<25.){ - factor=3.0f; - }else if(et[0]<30.){ - factor=3.5f; - }else if(et[0]<35.){ - factor=4.0f; - }else if(et[0]<40.){ - factor=4.5f; - }else{ - factor=5.0f; - } - ag.getGraphics2D().setStroke(new BasicStroke(factor)); - } - - if(projection instanceof AProjectionYX) - { - // check config whether to draw as arrow or dashed line.. - if(parameterStore.get("ETMis", "Drawas").getI() == 0) // Arrow = 0, Dashed = 1 - { - drawArrow(window, ag, projection); - } - else - { - drawDashed(window, ag, projection); - } - } - else if(projection instanceof AProjectionVP) - { - // Draw ETMis in VPlot... - ACoord centers = window.calculateDisplay(getUser(projection)); - int[] drawlist = centers.index; - double eLimit = 0.05; - final int numPoints = 25; - // hv will contain all the coordinates - // [2] - x and y value - // [drawlist.length] - should be "3" for ET Miss object by default - // after the PhiWrap - // [numPoints] - number of points required for drawing Et missing - // object in V-Plot - double[][][] hv = new double[2][drawlist.length][numPoints]; - - for(int i = 0; i < drawlist.length; ++i) - { - int list = drawlist[i]; - - int d = (int) (Math.sqrt((this.et[list] / eLimit) / Math.PI)); - if(d == 0) - { - d = 1; - } - - for(int j = 0; j < numPoints; j++) - { - hv[0][i][j] = centers.hv[0][list][i] + - d * Math.cos(Math.PI * 2 * j / (numPoints - 1)); - hv[1][i][j] = centers.hv[1][list][i] + - d * Math.sin(Math.PI * 2 * j / (numPoints - 1)); - } - } - ag.draw(new ACoord(hv, drawlist, this, ACoord.DOTTED_POLYGONS)); - } - else - { - super.draw(window, ag, projection); - } - //reset stroke if have changed to scale with energy - if(parameterStore.getUnknown("ETMis", "LineWidth").getI()==0) - ag.getGraphics2D().setStroke(origStroke); - } - - /** - * drawArrow() - * Method performs the drawing of the object on the canvas as arrow. - * @param window - * @param ag - * @param projection - */ - public void drawArrow(AWindow window, AGraphics ag, AProjection2D projection) - { - ACoord centers = window.calculateDisplay(getUser(projection)); - - int[] drawlist = centers.index; // draw everything in array - - // scale the arrowhead with zoom... - double zoomScaling=0; - Point2D.Double[] corners = window.getUserCorners(); - double widthx=corners[1].x-corners[0].x; - double widthy=corners[0].y-corners[2].y; - //average width of window - double width=Math.sqrt(widthx*widthx+widthy*widthy); - //calculate scaling (100 is arbitrary constant) - zoomScaling=100/width; - double arrowheadScale = 10+10*zoomScaling*Math.log(et[0]+1); - - // phiPrime represents the angle of the missingET arrow - double phiPrime = -1*Math.atan2(ety[0],etx[0]); - - // arrowMain contains the start point and end point of the arrow - double[][][]arrowMain = new double[2][drawlist.length][2]; - - // scale arrow length with etmiss - double arrowScale = et[0]*et[0]/250.0; //arbitrary scaling factor - double arrowCenter = 2.02; // this sets the starting point of the arrow. 2.02 ~ edge of ID - if (arrowScale > 8) { - arrowScale = 8; - } - for (int i = 0; i < drawlist.length; i++) { - for (int j = 0; j < 2; j++) { - arrowMain[0][i][j] = centers.hv[0][i][0] + (arrowCenter + arrowScale * j)*(centers.hv[0][i][1]-centers.hv[0][i][0]); - arrowMain[1][i][j] = centers.hv[1][i][0] + (arrowCenter + arrowScale * j)*(centers.hv[1][i][1]-centers.hv[1][i][0]); - } - } - double[][][]arrowHead1 = new double[2][drawlist.length][2]; - double[][][]arrowHead2 = new double[2][drawlist.length][2]; - for(int i = 0; i < drawlist.length; i++) - { - for(int j=0;j<2;j++) - { - // set the points for the two parts of the arrow head - // 2.591 and 3.691 are the factors to add to the arrow's angle for the correct arrowhead orientation... - arrowHead1[0][i][j] = arrowMain[0][0][1] + j*(arrowheadScale*Math.cos(2.591+phiPrime)); - arrowHead1[1][i][j] = arrowMain[1][0][1] + j*(arrowheadScale*Math.sin(2.591+phiPrime)); - arrowHead2[0][i][j] = arrowMain[0][0][1] + j*(arrowheadScale*Math.cos(3.691+phiPrime)); - arrowHead2[1][i][j] = arrowMain[1][0][1] + j*(arrowheadScale*Math.sin(3.691+phiPrime)); - } - } - // draw arrow, 3 parts, main arrow body and two lines for arrowhead - ag.draw(new ACoord(arrowMain, drawlist, this, ACoord.DOTTED_POLYGONS)); - ag.draw(new ACoord(arrowHead1, drawlist, this, ACoord.DOTTED_POLYGONS)); - ag.draw(new ACoord(arrowHead2, drawlist, this, ACoord.DOTTED_POLYGONS)); - - } // drawArrow() ------------------------------------------------------------- - - /** - * drawDashed() - * Method performs the drawing of the object on the canvas as a dashed line. - * @param window - * @param ag - * @param projection - */ - public void drawDashed(AWindow window, AGraphics ag, AProjection2D projection) - { - //Stop Etmiss being scaled by Fisheye - boolean origStatus = parameterStore.get(projection.getName(), "FishEye").getStatus(); - parameterStore.get(projection.getName(), "FishEye").setStatus(false); - ACoord centers = window.calculateDisplay(getUser(projection)); - if(origStatus) parameterStore.get(projection.getName(), "FishEye").setStatus(origStatus); - - int[] drawlist = centers.index; // draw everything in array - // hv will contain all the the coordinates - // [2] - x and y value - // [numData] - should be "1" for ETMis datatype - // [YX_NUMPOINTS] - number of points required for ET Miss object - - // length of drawlist should always be 1 -> only 1 iteration - double[][][] hv = new double[2][drawlist.length][YX_NUMPOINTS]; - for(int i = 0; i < drawlist.length; i++) - { - for(int j = 0; j < YX_NUMPOINTS; j++) - { - hv[0][i][j] = centers.hv[0][i][j]; // x - hv[1][i][j] = centers.hv[1][i][j]; // y - } - } - ag.draw(new ACoord(hv, drawlist, this, ACoord.DOTTED_POLYGONS)); - - } // drawDashed() ------------------------------------------------------------- - /** - * getYXUser() - * calculates coordinates for the Et missing graphical object which - * consists of one arrowed line, i.e. one line and two smaller lines - * forming the arrow, all together NUM_POINTS points - * @return coordinates - */ - protected ACoord getYXUser() - { - if (etx[0] == 0.f && ety[0] == 0.f) return ACoord.NO_DATA; - - makeDrawList(); // applycuts will be called here - - // Et missing graphical object consists of one dashed line from center - // to the border of canvas, or an arrow. - - // hv will contain all the coordinates - // [2] - x and y value - // [numData] - should be "1" for ETMis datatype - // YX_NUMPOINTS - number of points required for ET Miss object - double[][][] hv = new double[2][numDraw][YX_NUMPOINTS]; - int[] index = new int[numDraw]; - // i counter, here should have just one item in the coordinate array - // (index.length = 1), numDraw should be 1 - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - // main line (dashed) - // to be properly done: geting border values over canvas/window - double inc = 10000 / YX_NUMPOINTS; - double x = Math.cos(phi[list]); - double y = Math.sin(phi[list]); - for(int ii = 0; ii < YX_NUMPOINTS; ii++) - { - hv[0][i][ii] = x * (inc * ii); - hv[1][i][ii] = y * (inc * ii); - } - - index[i] = list; - } - return new ACoord(hv, index, this); - - } // getYXUser() -------------------------------------------------------- - - @Override - protected ACoord getRZUser() { - if (etx[0] == 0.f && ety[0] == 0.f) return ACoord.NO_DATA; - - double s = 1+Math.sqrt(et[0]);//4*parameterStore.get("ETMis", "Scale").getD(); - if (0 == s || parameterStore.get("ETMis", "Drawas").getI() == 1) { - return ACoord.NO_DATA; - } - makeDrawList(); // applycuts will be called here - double[][][] hv = new double[2][numDraw][YX_NUMPOINTS + 4]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) { - int list = listdl[i]; - double rhoMinus = 500; - double rhoMax = 1500; - double inc = 1. / YX_NUMPOINTS; - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double rhoPlus = rhoMax; - if (Math.abs(et[list]) < maxEnergy) { - rhoPlus = (rhoMax - rhoMinus) * s * Math.abs(et[list]) / maxEnergy; - } - - double updown = 0; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - if (phiMid > AMath.TWO_PI) { - phiMid -= AMath.TWO_PI; - } - double phiDiff = Math.abs(phi[list] - phiMid); - if (phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) { - updown = 1; - } else { - updown = -1; - } - - //double y = rhoPlus*Math.cos(phiDiff);//to change with cos of phiDiff - double y = rhoPlus * updown;//to change just by up or down - for (int ii = 0; ii <= YX_NUMPOINTS; ii++) { - hv[0][i][ii] = 0; - hv[1][i][ii] = rhoMinus * updown + y * (inc * ii); - } - hv[0][i][YX_NUMPOINTS + 1] = rhoMinus * .1; - hv[1][i][YX_NUMPOINTS + 1] = rhoMinus * updown + 0.8 * y; - hv[0][i][YX_NUMPOINTS + 2] = -rhoMinus * .1; - hv[1][i][YX_NUMPOINTS + 2] = rhoMinus * updown + 0.8 * y; - hv[0][i][YX_NUMPOINTS + 3] = 0; - hv[1][i][YX_NUMPOINTS + 3] = rhoMinus * updown + y; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - - } // getRZUser() -------------------------------------------------------- - - /** - * calculate coordinates for the Et missing graphical object - * in V-Plot (eta-phi projection) - * @return coordinates - */ - protected ACoord getVPUser() - { - if (etx[0] == 0.f && ety[0] == 0.f) return ACoord.NO_DATA; - - makeDrawList(); // applycuts will be called here - - // numDraw for ET Miss object should be 1 - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - h[0] = 0.0; // h[0] is the eta value, ETMis always drawn in the - // centre of VPlot - at eta 0 - v[0] = Math.toDegrees(phi[list]); // v[0] is the phi value - index[i] = list; - } - - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - - } // getVPUser() -------------------------------------------------------- - - /** - * this method is defined as an abstract method in AData, so must be - * implemented in this child class - */ - protected void applyCuts() { - - // no need to cut index (always 0), and transverse momentum for ET Miss - // assuming only 1 item in the ETMis datatype, thus index 0 - cutPhi(phi[0]); - - // eta value for ET Miss is 0 - cutEta(0.0f); - - // cut on ETMiss (default cut of 15 GeV) - cut("CutsObjects", "ETMis", " |ETMis|", et); - - } // applyCuts() -------------------------------------------------------- - - /** - * phi cut implementation for ETMis object - * @param phi float - */ - protected void cutPhi(float phi) { - AParameter par = parameterStore.get("CutsATLAS", "CutPhi"); - boolean usePhiCut = par.getStatus(); - if (usePhiCut) { - double phiCut = Math.toRadians(Math.abs(par.getD())); - double phiMid = Math.toRadians( - AMath.nearestPhiDegrees(parameterStore.get("CutsATLAS", "PhiMiddle").getD())); - double phiDiff = Math.abs(AMath.nearestPhiRadians(phi, phiMid) - - phiMid); - - if (phiDiff - phiCut > 1.0e-6) { - numDraw = 0; - } - } - - } // cutPhi() ----------------------------------------------------------- - - /** - * eta cut implementation for ETMis object - * @param eta float - */ - protected void cutEta(float eta) { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - boolean useEtaCut = par.getStatus(); - if (useEtaCut) { - double etaCut = Math.abs(par.getD()); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaDiff = Math.abs(eta - etaMid); - if (etaDiff - etaCut > 1.0e-6) { - numDraw = 0; - } - } - - } // cutEta() ----------------------------------------------------------- -} // class AETMisData ======================================================= - diff --git a/graphics/AtlantisJava/src/atlantis/data/AElectronData.java b/graphics/AtlantisJava/src/atlantis/data/AElectronData.java deleted file mode 100755 index 29967a8fc3411f177c4c74da3d18e541abdfed8e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AElectronData.java +++ /dev/null @@ -1,180 +0,0 @@ -package atlantis.data; - -import java.util.Vector; -import atlantis.utils.A4Vector; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -/** - * Reconstructed Electron - */ -public class AElectronData extends AHelixAODData -{ - private enum isEMe { TightPP, Tight, Medium, Loose, none } - - private int[] isEM; - private Vector<Enum> isEMEnum = new Vector<Enum>(); - private String[] label; - private float[] eOverp; - private int[] hasTrack; - - AElectronData(AHashMap p, AEvent e) - { - super(p,e); - isEM=p.getUnsureIntArray("isEM"); - String[] isEMString=p.getUnsureStringArray("isEMString"); - eOverp = p.getUnsureFloatArray("eOverp"); - hasTrack=p.getUnsureIntArray("hasTrack"); - label=p.getUnsureStringArray("label"); - - if(isEMString!=null) - { - for(String s : isEMString) - { - try { - isEMEnum.add(isEMe.valueOf(s)); - } - catch(IllegalArgumentException q) { - isEMEnum.add(isEMe.none); - } - } - } - else - { - for(int i=0;i<numData;i++) - { - isEMEnum.add(isEMe.none); - } - } - } - - public String getParameterGroup() - { - return "Electron"; - } - - public float geteOverp(int index) - { - return eOverp[index]; - } - - public String getisEMEnum(int index) - { - return isEMEnum.get(index).toString(); - } - - public int getisEM(int index) - { - return isEM[index]; - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A4Vector start = new A4Vector(); - start.setPtEtaPhiM((double)pT[k],(double)eta[k],(double)phi[k],0.00051); - sum.add(start); - } - - return sum; - } - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsObjects", "ElectronPt", " |ET|", pT); - - // because of the retriever bug, currently 2048 means 0 for isEM - // remove this for block when the bug is fixed - if(isEM != null) - { - for(int i=0; i<isEM.length; i++) - { - if(isEM[i]==2048) - isEM[i] = 0; - } - } - - cut("CutsObjects", "ElectronisEM", " isEM", isEM); - - if (parameterStore.get("CutsObjects", "ElectronisEMString").getStatus()) - { - int cutSub = parameterStore.get("CutsObjects", "ElectronisEMString").getI(); - - cutArrayEnum(isEMEnum, cutSub, "Electron isEMString"); - } - - cut("CutsObjects", "ElectroneOverp", " |eOverp|", eOverp); - if (parameterStore.get("CutsObjects", "ElectronhasTrack").getStatus() && hasTrack!=null) - cutArray(hasTrack, 1, "hasTrack"); - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n PT="+String.format("%.3f",pT[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Px="+String.format("%.3f",pT[index]*Math.cos(phi[index]))+" GeV "+ - "\n Py="+String.format("%.3f",pT[index]*Math.sin(phi[index]))+" GeV "+ - "\n Pz="+String.format("%.3f",pT[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n storegate key: "); - msg.append(sgKey); - msg.append("\n PT = "); - msg.append(String.format("%.3f",pT[index])); - msg.append(" GeV\n P = "); - msg.append(String.format("%.3f",Math.abs(pT[index]/Math.cos(AMath.lambda(eta[index]))))); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",Math.toDegrees(phi[index]))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - - - if (isEM != null) - { - msg.append("\n isEM = "); - msg.append(isEM[index]); - } - if (label != null) - { - msg.append("\n label = "); - msg.append(label[index]); - } - if (eOverp != null) - { - msg.append("\n eOverp = "); - msg.append(eOverp[index]); - } - if (hasTrack != null) - { - msg.append("\n hasTrack = "); - msg.append(hasTrack[index]); - } - - return msg.toString(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AEmTauROIData.java b/graphics/AtlantisJava/src/atlantis/data/AEmTauROIData.java deleted file mode 100755 index a2c8dc64699b95ff9b80ec461486eb653ab06c75..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AEmTauROIData.java +++ /dev/null @@ -1,34 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.utils.AHashMap; - -/** - * - * Em Tau Region Of Interest - * - * @author Zdenek Maxa, Qiang Lu - */ -public class AEmTauROIData extends AROIData -{ - AEmTauROIData(AHashMap p, AEvent e) - { - super(p,e); - } // AEmTauROIData() ---------------------------------------------------- - - public String getParameterGroup() - { - return "EmTauROI"; - } - - public String getName() - { - return "EmTauROI"; - } - - public String getNameScreenName() - { - return "EmTauROI"; - } - -} // class AEmTauROIData ==================================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/AEventFromXML.java b/graphics/AtlantisJava/src/atlantis/data/AEventFromXML.java deleted file mode 100755 index b89196931d3d2553d5c42c785dfb85515d587945..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AEventFromXML.java +++ /dev/null @@ -1,786 +0,0 @@ -package atlantis.data; - -import java.io.InputStream; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import javax.xml.parsers.SAXParserFactory; - -import org.xml.sax.Attributes; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.DefaultHandler; - -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.event.AEventSource.ReadEventException; -import atlantis.globals.AGlobals; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; -import atlantis.utils.xml.AArrayParser; -import atlantis.utils.xml.AFloatArrayParser; -import atlantis.utils.xml.AIntArrayParser; -import atlantis.utils.xml.AStringArrayParser; -import atlantis.utils.xml.AXMLErrorHandler; -import atlantis.utils.xml.AXMLErrorHandler.ErrorState; -import java.util.Iterator; -import javax.xml.parsers.ParserConfigurationException; -import org.xml.sax.SAXNotRecognizedException; - - -/** - * The reader which is used to read XML Event Files. The reader function creates - * and returns an AEvent class. Event comes with tags which are arrays of - * numbers. These arrays are treated by xml as character strings. The conversion - * of the character strings to arrays of number is done here. - */ -public class AEventFromXML extends DefaultHandler { - - //the logger - private final static ALogger logger = ALogger.getLogger(AEventFromXML.class); - - // Create an instance of this object - this makes sure the constructor is called. - // FIXME: should not use constructor to initialize static state. - private static final AEventFromXML instance = new AEventFromXML(); - - //We also have our private error handler - private static final AXMLErrorHandler xmlErrorHandler = new AXMLErrorHandler(); - - //Parsing states at different XML levels - private enum ParseState { - WAITING_EVENT, - WAITING_DATA, - WAITING_ARRAY - } - private static ParseState parseState; - - //The XMLReader object - private static XMLReader xmlReader; - //The event that is being build - private static AEvent event = null; - //the source name - private static String sourceName = null; - - //non-static parsing data members - private AHashMap parameters = null; - private String currentDataName = null; - private String currentArrayName = null; - private String currentFullName = null; - private int arrayLength = 0; - private int currentArraySize = 0; - private String storeGateKey = null; - private AArrayParser arrayParser = null; - - private static boolean HLTIgnoredWarning = false; - - - /** - * Constructor - * Creates an instance of AEventFromXML. It just sets up the XML reading - * stuff but does not do any parsing of any XML file. - */ - private AEventFromXML() { - - try { - //setup all the xml reader stuff - SAXParserFactory factory = SAXParserFactory.newInstance(); - factory.setValidating(true); - factory.setNamespaceAware(true); - xmlReader = factory.newSAXParser().getXMLReader(); - xmlReader.setErrorHandler(xmlErrorHandler); - xmlReader.setEntityResolver(this); - xmlReader.setContentHandler(this); - } catch (ParserConfigurationException pce){ - logger.error("Unable to initialize XML reader!", pce); - } catch (SAXException sxe){ - logger.error("Unable to initialize XML reader!", sxe); - } - } // AEventFromXML() ---------------------------------------------------- - - - /** - * Checks if there was an error. - * @return true or false - */ - private boolean hasError() { - return (xmlErrorHandler.getErrorState() != ErrorState.NO_ERROR); - } - - - /** - * Reads an XML event data (from files, from string converted to stream) and - * returns the coresponding AEvent object. - * - * @param eventInputStream the XML data input stream. - * @param sourceName the name of the event source that provided this data - * @return an AEvent object containing all the data found in the file. - * @throws ReadEventException - */ - public static AEvent read(InputStream eventInputStream, String sourceName) throws ReadEventException { - - //be verbose - logger.info("Parsing event from " + sourceName); - - //set the initial error state - xmlErrorHandler.setError(ErrorState.NO_ERROR,null); - - //store the source Name - AEventFromXML.sourceName = sourceName; - - //Try to parse input stream - try { - xmlReader.parse(new InputSource(eventInputStream)); - } catch (Exception e) { - //In case of an error repackage as ReadEventException - logger.error("Parsing exception " + e.getMessage(),e); - throw new ReadEventException("XML parsing exception", e); - } - - //Finally construct the full event (including associations, etc.) - //Check for runtime exceptions here in case we fail to finalize the event - try { - event.finalizeEvent(); - } catch (RuntimeException rte) { - //rethrow as can not read event exception - throw new ReadEventException("Inconsistent event data",rte); - } - - return event; - } - - /** - * DefaultHandler Implementation (have a look at - * org.xml.sax.helpers.DefaultHandler for more info) - */ - @Override - public void startDocument() { - - //if we are already in error state return immediately - if (hasError()) return; - - //Clean up all local variables - event = null; - parameters = null; - currentDataName = null; - currentArrayName = null; - currentFullName = null; - arrayLength = 0; - currentArraySize = 0; - storeGateKey = null; - arrayParser = null; - - //Set parse state to new event - parseState = ParseState.WAITING_EVENT; - - //be verbose - logger.debug("Start parsing document"); - - } // startDocument() ---------------------------------------------------- - - @Override - public void endDocument() { - - //if we are already in error state return immediatly - if (hasError()) return; - - //be verbose - logger.debug("Finished parsing document w/o error"); - - } - - /** - * Implementation of DefaultHandler: start a new xml element - * @param namespaceURI the namespace - * @param localName the local name - * @param qName the qualified name - * @param atts the default or specified attributes - */ - @Override - public void startElement(String namespaceURI, String localName, - String qName, Attributes atts) throws SAXException { - - //stop here if errors have occured before - if (hasError()) return; - - try { - //Now act depending on parse state - switch (parseState) { - - //Waiting for an event to begin - case WAITING_EVENT: - //Try to read in event data - if (localName.equals("Event")) { - - //Create a new event - event = new AEvent(atts.getValue("eventNumber"), - atts.getValue("runNumber"), - atts.getValue("dateTime"), - sourceName, - atts.getValue("lumiBlock"), - atts.getValue("eventProperty")); - - - //create a new data hashmap - parameters = new AHashMap(15); - - //Advance to next parsing state - parseState = ParseState.WAITING_DATA; - - } else { - //The Event tag does not seem to be the first tag in this event - logger.warn("Encountered tag "+localName+ " while waiting for <event/>!"); - } - //Done waiting for event - break; - - //Waiting for a data tag - case WAITING_DATA: - - //Store the current object name - currentDataName = localName; - //Get number of entries expected here - arrayLength = Integer.parseInt(atts.getValue("count")); - - // if storegate key doesn't exists as an attribute - // at datatype, an empty string "" is retrieved (not null) - storeGateKey = atts.getValue("storeGateKey"); - //Construct full name from datatype name and storeGateKey - currentFullName = currentDataName + "-" + storeGateKey; - - // ignore data with storeGateKey containing "HLTAutoKey" - // Its important that parseState is not set before, - // so we arrive waiting for a new data tag when this error is cleared - if (!AGlobals.instance().showHLTAutoKeys() && storeGateKey.indexOf("HLTAutoKey") >= 0) { - //Set appropiate error state and continue - xmlErrorHandler.setError(ErrorState.IGNORED_DATA, new Exception("Ignored HLTAutoKey data "+currentFullName)); - return; - } - - parameters.clear(); - // add numData - number of data within the subtags, - // extracted from count attribute - parameters.put("numData", new Integer(arrayLength)); - parameters.put("storeGateKey", storeGateKey); - parseState = ParseState.WAITING_ARRAY; - break; - - //Waiting for an data value array - case WAITING_ARRAY: - - //store name of the array we are looking at - currentArrayName = localName; - - if ((atts.getValue("type") == null) || - (atts.getValue("multiple") == null)) - throw new SAXNotRecognizedException("No array type or multiplicity available for "+localName); - - String type = atts.getValue("type"); - - //get multiplicity if needed - float multiple = Float.parseFloat(atts.getValue("multiple")); - currentArraySize = Math.round(arrayLength * multiple); - - - //Instanciate a new array parser - if (type.equals("FLOAT")) { - arrayParser = new AFloatArrayParser(currentArraySize); - } else if (type.equals("INT")) { - arrayParser = new AIntArrayParser(currentArraySize); - } else if (type.equals("STRING")) { - arrayParser = new AStringArrayParser(currentArraySize); - } else { - throw new SAXNotRecognizedException("Invalid array type: " + type); - } - - break; - - } // switch - } catch (SAXNotRecognizedException sre){ - //Catch unknown array tags - xmlErrorHandler.setError(ErrorState.INVALID_DATA,sre); - logger.debug("Encountered invalid subtag "+localName, sre); - } catch (Exception e) { - //Catch any other error here: - String msg = "Error reading file at " + currentFullName + ":" + currentArrayName; - xmlErrorHandler.setError(ErrorState.FATAL_ERROR,e); - logger.debug(msg, e); - //Rethrow readevent exception with proper cause - throw new SAXException(msg, e); - } - - } - - /** - * Called at the end of each tag - this is where we actually construct the data - * @param namespaceURI - the current namespace - * @param localName - the local element name - * @param qName - the qualified element name - */ - @Override - public void endElement(String namespaceURI, String localName, String qName) throws SAXException { - - /** - * Check if an error had occured reading this element - */ - if (hasError()) { - - String msg = null; - - switch (xmlErrorHandler.getErrorState()) { - - case UNKNOWN_TAG: - //Ignore unknown tags, but show an error - - if (parseState == ParseState.WAITING_DATA) - msg = "Unknown or obsolete data type <" + currentDataName + "> found"; - else if (parseState == ParseState.WAITING_ARRAY) - //rely on exception error message for this one - msg = xmlErrorHandler.getErrorCause().getMessage(); - else - //unknown tag at event level - msg = "Unknown tag <" + currentDataName + "> while waiting for event."; - - //Clear the error state and continue - xmlErrorHandler.setError(ErrorState.NO_ERROR, null); - break; - - case INVALID_DATA: - msg = "Invalid data encountered reading "+currentDataName; - //Clear the error state and continue - xmlErrorHandler.setError(ErrorState.NO_ERROR, null); - break; - - case IGNORED_DATA: - - //Only show warning message in the LogPane once - if (!HLTIgnoredWarning) { - AOutput.append("\"HLTAutoKey\" data is hidden, option '-a' to see them.", - ALogInterface.WARNING); - //tell about each one also in the log - logger.warn(xmlErrorHandler.getErrorCause().getMessage()); - HLTIgnoredWarning = true; - } - - //Clear the error only when we reach the end of the data tag - if (localName.equals(currentDataName)) - xmlErrorHandler.setError(ErrorState.NO_ERROR, null); - - break; - } - - //If there was a message, show it - if (msg != null){ - // Now show this error in the log pane and console output - logger.warn(msg,xmlErrorHandler.getErrorCause()); - } - //Return to parsing (if error cleared) or stop - return; - } - - /** - * No error so far - check what we have been parsing - */ - switch (parseState) { - - case WAITING_ARRAY: - - /** - * End of data array - add to parameter list - */ - if (localName.equals(currentArrayName)) { - - //Check for proper Array size - if (arrayParser.getCount() != currentArraySize) { - - xmlErrorHandler.setError(ErrorState.INVALID_DATA, new Exception("Invalid array size")); - - String msg = "The number of data in <" + currentFullName + ">-<" + currentArrayName + "> is different than declared"; - logger.error(msg); - AOutput.append("\n"+msg+"\n", ALogInterface.WARNING); - return; - } - //Otherwise add to parameter list - parameters.put(currentArrayName, arrayParser.getArray()); - - //done with that, return - return; - } - - /** - * End of data tag - construct object - */ - if (localName.equals(currentDataName)) { - try { - // Calo and muon datatypes sometimes provide a - // storeGateKey, thus are (incorrectly !) - // regarded as multiple collection datatypes - // -> remove this storeGateKey - if ("TILE".equals(currentDataName) || - "LAr".equals(currentDataName) || - "HEC".equals(currentDataName) || - "FCAL".equals(currentDataName) || - "MBTS".equals(currentDataName) || - "MDT".equals(currentDataName) || - "CSC".equals(currentDataName) || - "RPC".equals(currentDataName) || - "TGC".equals(currentDataName)) { - parameters.put("storeGateKey", null); - } - - // RDOs originally implemented as multiple collections, - // then changed to non-mul-col. this is for backwards - // compatibility with events where storeGateKey is - // provided for PixelRDO and SCTRDO - if ("PixelRDO".equals(currentDataName) || - "SCTRDO".equals(currentDataName)) { - parameters.put("storeGateKey", null); - } - - checkPhiRange(parameters, currentFullName); - - if (currentDataName.equals("STr")) { - event.add(new ASVxData(ASVxData.createSVx(parameters), event)); - event.add(new ASTrData(ASTrData.createSTr(parameters), event)); - event.add(new ASNPData(ASNPData.createSNP(parameters), event)); - } // STC - silicon cluster datatype - else if (currentDataName.equals("STC")) { - event.add(new ASiClusterData(parameters, event)); - } // SCTRDO - silicon cluster raw data object - // discrepancy in naming STC x SCT ... - else if (currentDataName.equals("SCTRDO")) { - event.add(new ASiClusterRDOData(parameters, event)); - } // PixCluster - pixel cluster datatype - else if (currentDataName.equals("PixCluster")) { - event.add(new APixelClusterData(parameters, event)); - } - // ETMis backwards compatibility (after ETMis collections) - // datatypes ETMis, CaloETMis, MuonETMis - storeGateKey - // attribute is added here - else if (currentDataName.equals("ETMis") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "ETMis"); - event.add(new AETMisData(parameters, event)); - } else if (currentDataName.equals("CaloETMis")) { - parameters.put("storeGateKey", "CaloETMis"); - event.add(new AETMisData(parameters, event)); - } else if (currentDataName.equals("MuonETMis")) { - parameters.put("storeGateKey", "MuonETMis"); - event.add(new AETMisData(parameters, event)); - } // Track collections, backwards compatibility for - // IDScan, iPat, xKal datatypes - storeGateKey attribute - // is added here - else if (currentDataName.equals("Track")) { - - String key = (String) parameters.get("storeGateKey"); - if (key != null) { - if (key.toLowerCase().indexOf("mboy") >= 0 || key.toLowerCase().indexOf("mugirl") >=0 || key.toLowerCase().indexOf("moore") >= 0 || key.toLowerCase().indexOf("momu") >= 0 || key.toLowerCase().indexOf("muon") >= 0 || key.toLowerCase().indexOf("staco") >= 0 || key.toLowerCase().indexOf("muid") >= 0 || key.toLowerCase().indexOf("mutag") >= 0 ) { - event.add(new AMuonTrackData(parameters, event)); - } else { - event.add(new AInDetTrackData(parameters, event)); - } - } else { - int[] trackAuthor = parameters.getUnsureIntArray("trackAuthor"); - if (trackAuthor != null && trackAuthor.length > 0) { - if ((trackAuthor[0] >= 7 && trackAuthor[0] <= 9) || (trackAuthor[0] >= 13 && trackAuthor[0] <= 17)) { - event.add(new AMuonTrackData(parameters, event)); - } else { - event.add(new AInDetTrackData(parameters, event)); - } - } else { - event.add(new AInDetTrackData(parameters, event)); - } - } - } else if (currentDataName.equals("IDScan")) { - parameters.put("storeGateKey", "TrigInDetTrack"); - event.add(new AInDetTrackData(parameters, event)); - } else if (currentDataName.equals("iPat")) { - parameters.put("storeGateKey", "iPatTrack"); - event.add(new AInDetTrackData(parameters, event)); - } else if (currentDataName.equals("xKal")) { - parameters.put("storeGateKey", "xKalTrack"); - event.add(new AInDetTrackData(parameters, event)); - } else if (currentDataName.equals("RTr")) // old tag - { - parameters.put("storeGateKey", "RTrTrack"); - event.add(new AInDetTrackData(parameters, event)); - } else if (currentDataName.equals("RMTr")) // old tag - { - parameters.put("storeGateKey", "RMTrTrack"); - event.add(new AMuonTrackData(parameters, event)); - } // ParticleJet backwards compatibility - else if (currentDataName.equals("ParticleJet") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "ParticleJet cone4"); - // treat PatricleJet as Jet (JetRecJet) - event.add(new AJetData(parameters, event)); - } else if (currentDataName.equals("Jet") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "JetRecJet"); - event.add(new AJetData(parameters, event)); - } // MSeg backwards compatibility - else if (currentDataName.equals("MSeg")) { - parameters.put("storeGateKey", "MooreSegment"); - - // Instead of cotan(theta) we store theta itself. - float[] cotTheta = parameters.getFloatArray("cotTheta"); - float[] theta = new float[cotTheta.length]; - for (int i = 0; i < cotTheta.length; i++) { - theta[i] = (float) Math.atan(1. / cotTheta[i]); - } - parameters.put("theta", theta); - - // And phi0 is now called phi - parameters.put("phi", parameters.getFloatArray("phi0")); - - event.add(new AMuonSegmentData(parameters, event)); - } // Segment backwards compatibility - else if (currentDataName.equals("Segment")) { - String key = (String) parameters.get("storeGateKey"); - if (key != null) { - if (key.toLowerCase().indexOf("mboy") >= 0 || key.toLowerCase().indexOf("moore") >= 0 || key.toLowerCase().indexOf("momu") >= 0 || key.toLowerCase().indexOf("mdt") >= 0 || key.toLowerCase().indexOf("muon") >= 0) { - event.add(new AMuonSegmentData(parameters, event)); - } else { - event.add(new AInDetSegmentData(parameters, event)); - } - } - } // Cluster backwards compatibility - // datatypes Cluster - storeGateKey attribute is added - else if (currentDataName.equals("Cluster") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "DefaultCluster"); - event.add(new AClusterData(parameters, event)); - } //Electron backwards compatibility - else if (currentDataName.equals("Electron") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "ElectronCollection"); - event.add(new AElectronData(parameters, event)); - } //Muon backwards compatibility - else if (currentDataName.equals("Muon") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "MuonCollection"); - event.add(new AMuonData(parameters, event)); - } //Photon backwards compatibility - else if (currentDataName.equals("Photon") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "PhotonCollection"); - event.add(new APhotonData(parameters, event)); - } //BJet backwards compatibility - else if (currentDataName.equals("BJet") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "BJetCollection"); - event.add(new ABJetData(parameters, event)); - } //TauJet backwards compatibility - else if (currentDataName.equals("TauJet") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "TauJetCollection"); - event.add(new ATauJetData(parameters, event)); - } //CompositeParticle backwards compatibility - else if (currentDataName.equals("CompositeParticle") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "CompositeParticleCollection"); - event.add(new ACompositeParticleData(parameters, event)); - } //LVL1Result backwards compatibility - else if (currentDataName.equals("LVL1Result") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "LVL1Result"); - event.add(new ALVL1ResultData(parameters, event)); - } //LVL1TriggerTower backwards compatibility - else if (currentDataName.equals("LVL1TriggerTower") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "LVL1TriggerTower"); - event.add(new ALVL1TriggerTowerData(parameters, event)); - } //LVL1JetElement backwards compatibility - else if (currentDataName.equals("LVL1JetElement") && - "".equals(storeGateKey)) { - parameters.put("storeGateKey", "LVL1JetElement"); - event.add(new ALVL1JetElementData(parameters, event)); - } else { - //try to autoconstruct the corresponding data type - //First of all get all constructors for this class name - Constructor[] cons = Class.forName("atlantis.data.A" + currentDataName + "Data").getDeclaredConstructors(); - //Flag if we found on - boolean foundConstructor = false; - //Now loop over constructors and pick the one that fits - for (Constructor constructor : cons) { - //Check for parameters - Class[] params = constructor.getParameterTypes(); - if (params.length != 2) { - continue; - //Check both types - } - if (!params[0].getName().endsWith("AHashMap")) { - continue; - } - if (!params[1].getName().endsWith("AEvent")) { - continue; - //seems we found the proper constructor - go and build the class - } - foundConstructor = true; - event.add((AData) constructor.newInstance(new Object[]{parameters, event})); - //also end the loop here - break; - } - if (!foundConstructor) { - throw new ClassNotFoundException("Found no valid constructor for data type " + currentDataName); - } - } // End of autoconstructor - - - //Collect all possible errors here - } catch (Throwable t) { - //Will hold the error message - String msg = null; - - //Could not find a class for this data type - if (t instanceof ClassNotFoundException) { - msg = "Class handling the type " + currentDataName + " not found"; - xmlErrorHandler.setError(ErrorState.INVALID_DATA, t); - //Ran out ouf memory - } else if (t instanceof OutOfMemoryError) { - msg = "Atlantis ran out of memory while\n" + "reading in event data"; - xmlErrorHandler.setError(ErrorState.FATAL_ERROR, t); - //Some weird Atlantis exception - check its error state - } else if (t instanceof AAtlantisException) { - msg = t.getMessage(); - //check Atlantis exception level - if (((AAtlantisException)t).isFatal()) - xmlErrorHandler.setError(ErrorState.FATAL_ERROR, t); - else - xmlErrorHandler.setError(ErrorState.OTHER_ERROR, t); - } else if (t instanceof InvocationTargetException) { - msg = "Error when constructing " + currentFullName; - xmlErrorHandler.setError(ErrorState.OTHER_ERROR, t); - } else { - msg = "Caught exception "+t.toString()+ " while constructing "+currentFullName; - xmlErrorHandler.setError(ErrorState.OTHER_ERROR, t); - } - - AOutput.append("\n" + msg + "\n", ALogInterface.WARNING); - logger.error(msg, t); - } - - /** - * Now handle potential errors - */ - //if we can proceed processing, throw an error - if (xmlErrorHandler.getErrorState() == ErrorState.FATAL_ERROR) - throw new SAXException("Error parsing event at tag <"+currentDataName+">", - (Exception)xmlErrorHandler.getErrorCause()); - - //Otherwise clear error state and continue - xmlErrorHandler.setError(ErrorState.NO_ERROR, null); - parseState = ParseState.WAITING_DATA; - return; - } - - } - } - - /** - * xml calls this routine whenever it finds CONTENT of type character array - * (CDATA) this routine fills an array stored in the arrayParser * - * - * @param ch char[] - * @param start int - * @param length int - */ - @Override - public void characters(char[] ch, int start, int length) { - - //return immediately if we had an error before - if (hasError()) return; - - //Make sure an arrayParser has been set before - if (arrayParser == null){ - xmlErrorHandler.setError(ErrorState.FATAL_ERROR,new NullPointerException("ArrayParser object not defined")); - logger.error("arrayParser is NULL in SAX DefaultHandler:characters"); - return; - } - - //try to parse the value array - try { - arrayParser.parse(ch, start, length); - } catch (NumberFormatException nfe) { - xmlErrorHandler.setError(ErrorState.INVALID_DATA,nfe); - String msg = "Data in <" + currentFullName + ">-<" + currentArrayName + - "> contains invalid character \'" + nfe.getMessage() + "\'"; - logger.error(msg); - - } catch (IndexOutOfBoundsException oob) { - xmlErrorHandler.setError(ErrorState.INVALID_DATA,oob); - String msg = "The number of data in <" + currentFullName + ">-<" - + currentArrayName + "> is more than declared"; - logger.error(msg); - } - - } // characters() -------------------------------------------------------- - - /** - * Returns an entity resolver - should be event.dtd in case we read an event file - * otherwise return null to use the default - * @param publicId - * @param systemId - * @return an input source for the entity resolver - */ - @Override - public InputSource resolveEntity(String publicId, String systemId) { - InputSource inputSource = null; - String FILE_SEPAR = System.getProperty("file.separator"); - - if (systemId.endsWith("event.dtd")) { - String dtdFile = AGlobals.instance().getHomeDirectory() + "events" + FILE_SEPAR + "event.dtd"; - try { - InputStream is = AUtilities.getFileAsStream(dtdFile); - inputSource = new InputSource(is); - } catch (AAtlantisException ae) { - logger.error("reading " + dtdFile + " error: " + ae.getMessage(), ae); - } - } - - return inputSource; - - } // resolveEntity() ---------------------------------------------------- - - /** - * Corrects the Phi values to be in the range (0:2pi). - * NOTE: This can still be done much nicer - but have you seen what it looked like before?! - * @param p The AHashMap containing the float arrays to be checked. - */ - private static void checkPhiRange(AHashMap p, String fullDataName) { - - //Loop over all keys in the Hashmap - Iterator keyIter = p.keySet().iterator(); - while (keyIter.hasNext()) { - //Check if this is a phi collection - String keyName = (String) keyIter.next(); - //Only run on phi value arrays - if (!keyName.startsWith("phi")) { - continue; - //Now get the actual array of values - } - float[] phi = null; - try { - phi = (float[]) p.get(keyName); - } catch (ClassCastException cce) { - //ignore any non-floar arrays that start with "phi" - continue; - } - //Check that we didn't get an empty entry - if (phi == null) { - continue; //Now loop over all entries and correct them - } - for (int i = 0; i < phi.length; i++) { - //Bring it down to the modulus of 2*Pi - phi[i] = phi[i] % (float)AMath.TWO_PI; - //Smaller zero is still possible - if (phi[i] < 0.) phi[i] += AMath.TWO_PI; - } - } - } // checkPhiRange() ----------------------------------------------------- -} // class AEventFromXML ==================================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/AFCALData.java b/graphics/AtlantisJava/src/atlantis/data/AFCALData.java deleted file mode 100755 index 9e8d233d12e200e64df10fd6ed1ff6b014416841..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AFCALData.java +++ /dev/null @@ -1,1228 +0,0 @@ -package atlantis.data; - -import atlantis.canvas.ACanvas; -import atlantis.event.AEvent; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.AMath; -import atlantis.utils.AUtilities; -import atlantis.utils.ALogger; -import java.io.IOException; -import com.Ostermiller.util.CSVParser; -import java.io.StringReader; -import java.io.InputStream; -import java.io.FileNotFoundException; - -/** - * The Forward calorimeter implementation. - * - * @author Eric Jansen - */ -public class AFCALData extends ACalorimeterData -{ - private static ALogger logger = ALogger.getLogger(AFCALData.class); - - protected float[] x; - protected float[] y; - protected float[] z; - protected float[] r; - protected float[] dx; - protected float[] dy; - protected float[] dz; - protected float[] dr; - - private int[][] cellTable; - - // data for real pulse shapes plots - private int numSamplings = 0; - private int[][] adcCounts = null; - private float[] cellTime = null; - private int[] cellGain = null; - private float[] cellPedestal = null; - private float[] adc2Mev = null; - private static boolean pulseShapesDataAvailable = false; - private static final String LOOKUP_TABLE_FILE = - AGlobals.instance().getHomeDirectory() + "configuration" + - System.getProperty("file.separator") + - "rpsplt_fcal.csv"; - // number of lookup table values for real pulse shapes plots calculation - private static final short NUMBER_OF_LOOKUP_VALUES = 600; - - - - AFCALData(AHashMap p, AEvent e) - { - super(p,e); - - x = p.getFloatArray("x"); - dx = p.getFloatArray("dx"); - y = p.getFloatArray("y"); - dy = p.getFloatArray("dy"); - - r = new float[numData]; - dr = new float[numData]; - - cellTable = new int[MAX_HIT_INDEX][MAX_HIT_INDEX]; - - for (int i = 0; i < numData; i++) - { - try - { - side[i] = (byte) AIdHelper.larBarrelEndcap(id[i]); - etaIndex[i] = (short) AIdHelper.larEta(id[i]); - phiIndex[i] = (short) AIdHelper.larPhi(id[i]); - sampling[i] = 0; //AIdHelper.larSampling(id[i]); - } - catch (AAtlantisException ex) - { - logger.error("Problem decoding ID " + id[i] + " in " + - CALORIMETER_NAME + ": " + ex.getMessage()); - side[i] = 0; - etaIndex[i] = -1; - phiIndex[i] = -1; - sampling[i] = -1; - } - } - - // Events produced by older JiveXML versions don't have z and dz yet. - // Use the old hardcoded values in that case for backwards - // compatibility. - if (p.get("z") == null || p.get("dz") == null) - { - z = new float[numData]; - dz = new float[numData]; - for (int i = 0; i < numData; i++) - { - switch (sampling[i]) - { - case 0: - z[i] = (side[i] / Math.abs(side[i])) * 489.4f; - dz[i] = 45.2f; - break; - case 1: - z[i] = (side[i] / Math.abs(side[i])) * 534.8f; - dz[i] = 45.0f; - break; - case 2: - z[i] = (side[i] / Math.abs(side[i])) * 582.2f; - dz[i] = 45.0f; - break; - } - } - } - else - { - z = p.getFloatArray("z"); - dz = p.getFloatArray("dz"); - } - - float drMin = 0.0f, zMin = 0.0f, zMax = 0.0f, rMin = 0.0f, rMax = 0.0f; - for (int i = 0; i < numData; i++) - { - - if (side[i] < 0) - { - sub[i] = 0; - } - else - { - sub[i] = 1; - } - - float etaMin = (float) AMath.etaAbs(z[i], Math.sqrt(Math.pow(Math.abs(x[i]) - dx[i], 2) + - Math.pow(Math.abs(y[i]) - dy[i], 2))); - float etaMax = (float) AMath.etaAbs(z[i], Math.sqrt(Math.pow(Math.abs(x[i]) + dx[i], 2) + - Math.pow(Math.abs(y[i]) + dy[i], 2))); - eta[i] = (etaMin + etaMax) / 2.f; - //TODO check calculation original: deta[i] = etaMax - etaMin; - deta[i] = Math.abs(etaMax - etaMin); - phi[i] = (float) Math.atan2(y[i], x[i]); - dphi[i] = (float) Math.abs(Math.atan2(y[i] + dy[i], x[i] - dx[i]) - - Math.atan2(y[i] - dy[i], x[i] + dx[i])); - if (phi[i] < 0) - { - phi[i] += 2. * Math.PI; - } - - r[i] = (float) Math.sqrt(x[i] * x[i] + y[i] * y[i]); - dr[i] = (float) Math.sqrt(dx[i] * dx[i] + dy[i] * dy[i]); - - // Collect some constants needed for binning the histograms. - if (rMin == 0.0 || Math.abs(r[i]) - dr[i] / 2. < rMin) - { - rMin = Math.abs(r[i]) - dr[i] / 2.f; - } - if (rMax == 0.0 || Math.abs(r[i]) + dr[i] / 2. > rMax) - { - rMax = Math.abs(r[i]) + dr[i] / 2.f; - } - if (zMax == 0.0 || Math.abs(z[i]) + dz[i] / 2. > zMax) - { - zMax = Math.abs(z[i]) + dz[i] / 2.f; - } - if (zMin == 0.0 || Math.abs(z[i]) - dz[i] / 2. < zMin) - { - zMin = Math.abs(z[i]) - dz[i] / 2.f; - } - if (drMin == 0.0 || dr[i] < drMin) - { - drMin = dr[i]; - } - } - - etaGranularity = AParameterUtilities.eta(zMin, rMax - drMin) - AParameterUtilities.eta(zMin, rMax); - outerEta = AParameterUtilities.eta(zMax, rMin); - - // Collect some constants needed for drawing the histograms. - for (int i = 0; i < ACalorimeterDetector.count(); i++) - { - if (outerR == 0.0 || ACalorimeterDetector.get(i).getRMax() > outerR) - { - outerR = ACalorimeterDetector.get(i).getRMax(); - } - if (outerZ == 0.0 || ACalorimeterDetector.get(i).getZMax() > outerZ) - { - outerZ = ACalorimeterDetector.get(i).getZMax(); - } - } - - for (int i = 0; i < et.length; ++i) - { - et[i] = Math.abs(energy[i] / (float) Math.cosh(eta[i])); - } - - // read in FCAL data from real pulse shapes plots - readPulseShapePlotData(p); - - } - - - - /** - * readLookupTableFile() reads in comma separated values (CSV) file - * with FCAL real pulse shapes plots time and amplitude lookup values - * @param fileName String - * @throws AAtlantisException - */ - private void readLookupTableFile() throws AAtlantisException - { - try - { - InputStream is = AUtilities.getFileAsStream(LOOKUP_TABLE_FILE); - CSVParser parser = new CSVParser(is); - parser.setCommentStart("#"); - String arrayName = null; - - while((arrayName = parser.nextValue()) != null) - { - String valueArray = parser.nextValue(); // shall now contain all values - CSVParser parserArray = new CSVParser(new StringReader(valueArray)); - String[][] s = parserArray.getAllValues(); - - if("FCAL_LAYER0_AMPLITUDE".equals(arrayName)) - { - ACalorimeterRPSPLT.FCAL_LAYER0_AMPLITUDE = - getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - } - else if("FCAL_LAYER1_AMPLITUDE".equals(arrayName)) - { - ACalorimeterRPSPLT.FCAL_LAYER1_AMPLITUDE = - getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - } - else if("FCAL_LAYER2_AMPLITUDE".equals(arrayName)) - { - ACalorimeterRPSPLT.FCAL_LAYER2_AMPLITUDE = - getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - } - else if("FCAL_TIME".equals(arrayName)) - { - ACalorimeterRPSPLT.FCAL_TIME = - getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - } - } // while - } - catch(FileNotFoundException e) - { - throw new AAtlantisException("could not find file: " + - LOOKUP_TABLE_FILE); - } - catch(IOException e) - { - throw new AAtlantisException("exception while reading file: " + - LOOKUP_TABLE_FILE); - } - catch(AAtlantisException e) - { - throw e; - } - - } // readLookupTableFile() ---------------------------------------------- - - - - private void readPulseShapePlotData(AHashMap p) - { - // read ADCCounts and cell data for real pulse shapes plots - adcCounts = super.getADCCountsData(p); - - // read LAr digits (cell data) for real pulse shapes plots - cellTime = (p.get("cellTime") != null) ? p.getFloatArray("cellTime") : null; - cellGain = (p.get("cellGain") != null) ? p.getIntArray("cellGain") : null; - cellPedestal = (p.get("cellPedestal") != null) ? p.getFloatArray("cellPedestal") : null; - adc2Mev = (p.get("adc2Mev") != null) ? p.getFloatArray("adc2Mev") : null; - - pulseShapesDataAvailable = false; - if(adcCounts != null && cellTime != null && cellGain != null && - cellPedestal != null && adc2Mev != null) - { - pulseShapesDataAvailable = true; - numSamplings = adcCounts[0].length; - - logger.debug(CALORIMETER_NAME + - ": data for real pulse shape plots available"); - - - if(ACalorimeterRPSPLT.areFCALLookupTablesInitialized()) - { - logger.debug(CALORIMETER_NAME + - ": lookup tables have already been read in"); - } - else - { - logger.debug(CALORIMETER_NAME + - ": lookup table values have not been read in yet\n" + - " trying to read file: " + LOOKUP_TABLE_FILE); - try - { - readLookupTableFile(); - - logger.debug(CALORIMETER_NAME + - ": values from " + LOOKUP_TABLE_FILE + - " successfully read in"); - - } - catch(AAtlantisException ex) - { - logger.debug(CALORIMETER_NAME + - ": reading " + LOOKUP_TABLE_FILE + - " failed, real pulse shapes plots will not " + - "be available, reason: " + ex.getMessage(), ex); - pulseShapesDataAvailable = false; - } - } - } - - } // readPulseShapePlotData() ------------------------------------------- - - - - - /** - * Returns the name of the parameter group. - * - * @return String parameter group - */ - public String getParameterGroup() - { - return "FCAL"; - } - - /** - * Returns the name of the datatype. - * - * @return String datatype - */ - public String getName() - { - return "FCAL"; - } - - /** - * Returns the name of the datatype. - * - * @return String datatype - */ - public String getNameScreenName() - { - return "FCAL"; - } - - /** - * Returns the type of calorimeter (ECAL/HCAL) for a hit. - * - * @param index int hit index - * @return String calorimeter type - */ - public String getCalorimeterType(int index) - { - if (sampling[index] == 0) - { - return "ECAL"; - } - else - { - return "HCAL"; - } - } - - /** - * Calorimeter cells can be drawn either explicitly or implicitly. In most - * views cells that are located behind eachother are consolidated and only - * the most energetic one is drawn explicitly. The other cells are drawn - * implicitly, since their energy value is still added to the energy sum of - * the explicitly drawn cell. The list manager does not know about the - * implicitly drawn cells though, so this poses a problem when the user - * requests information about a certain area of the canvas. This is solved - * using this method. This function receives the list of explicitly drawn - * cells and then adds the ones that were implicitly drawn in this - * selection. - * - * @param drawn boolean[] initial drawn list containing only the explicitly - * drawn cells - * @return boolean[] drawn list containing the explicitly and the implicitly - * drawn cells. - */ - public boolean[] expandDrawn(boolean[] drawn) - { - AProjection projection = ACanvas.getCanvas().getCurrentWindow().getProjection(); - - if (projection instanceof AProjectionYX) - { - return expandDrawnYX(drawn); - } - else if (projection instanceof AProjectionRZ) - { - return expandDrawnRZ(drawn); - } - else - { - return drawn; - } - } - - /** - * Filters the drawList for the y-x projection. Hits from both endcaps are - * combined. - */ - protected void filterDrawListYX() - { - float etTable[][] = new float[MAX_HIT_INDEX][MAX_HIT_INDEX]; - for (int i = 0; i < MAX_HIT_INDEX; i++) - { - for (int j = 0; j < MAX_HIT_INDEX; j++) - { - cellTable[i][j] = -1; - etTable[i][j] = 0.0f; - } - } - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - int eta = etaIndex[j]; - int phi = phiIndex[j]; - etTable[eta][phi] += et[j]; - if (cellTable[eta][phi] < 0 || et[cellTable[eta][phi]] < et[j]) - cellTable[eta][phi] = j; - } - - numDraw = 0; - for (int i = 0; i < MAX_HIT_INDEX; i++) - { - for (int j = 0; j < MAX_HIT_INDEX; j++) - { - if (cellTable[i][j] > 0) - { - listdl[numDraw] = cellTable[i][j]; - etSum[listdl[numDraw]] = etTable[i][j]; - numDraw++; - } - } - } - } - - /** - * See expandDrawn. - * - * @param drawn boolean[] initial drawn list containing only the explicitly - * drawn cells - * @return boolean[] drawn list containing the explicitly and the implicitly - * drawn cells. - */ - private boolean[] expandDrawnYX(boolean[] drawn) - { - makeDrawList(); - - int mode = parameterStore.get("YX", "Mode").getI(); - if (parameterStore.get("YX", "DrawFCAL").getStatus() && mode >= AProjectionYX.MODE_HEC_2 && - mode <= AProjectionYX.MODE_HEC_4) - { - cutArray(sampling, mode - AProjectionYX.MODE_HEC_2, "Layer"); - } - else if (mode >= AProjectionYX.MODE_FCAL_EM || mode <= AProjectionYX.MODE_FCAL_HAD_2) - { - cutArray(sampling, mode - AProjectionYX.MODE_FCAL_EM, "Layer"); - } - else - { - return drawn; - } - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - - if (drawn[j]) - continue; - - int eta = etaIndex[j]; - int phi = phiIndex[j]; - - if (eta >= 0 && phi >= 0) - { - int mappedTo = cellTable[eta][phi]; - - if (mappedTo >= 0 && drawn[mappedTo] == true) - { - drawn[j] = true; - } - } - } - - return drawn; - } - - /** - * The rho-z projection is a bit difficult for FCAL. Because of the y-x - * geometry of the cells there isn't really a nice way to project them in - * rho-z. This prodedure takes the most energetic cell and the consolidates - * it with all cells that overlap it. This is repeated until all cells are - * assigned to such a most energetic cell. We are then left with a series of - * "important" cells that do not overlap in rho-z. These can be drawn - * nicely. - */ - protected void filterDrawListRZ() - { - boolean available[] = new boolean[numDraw]; - int numCells = numDraw; - int newNumDraw = 0; - - // Initialize the variables. - for (int i = 0; i < numDraw; i++) - { - available[i] = true; - } - for (int i = 0; i < numData; i++) - { - etSum[i] = 0.0f; - } - - while (numCells > 0) - { - - // Loop through all available cells and find the highest energy. - int max = -1; - for (int i = 0; i < numDraw; i++) - { - if (available[i]) - { - if (max < 0 || et[listdl[i]] > et[listdl[max]]) - max = i; - } - } - - // This is a cell we want to draw, store it and remove it from the - // available cells list. - available[max] = false; - numCells--; - listdl[newNumDraw++] = listdl[max]; - - // Now find all available cells that overlap this one. This loop - // will be processed - // quite a lot, so it is very important to do the "easy" rejects - // first. - for (int i = 0; i < numDraw; i++) - { - if (available[i]) - { - int j = listdl[i]; - - double zDist = Math.abs(z[j] - z[listdl[max]]); - if (zDist >= (dz[j] + dz[listdl[max]]) / 2.) - continue; - - double rDist = Math.abs(r[j] - r[listdl[max]]); - if (rDist >= (dr[j] + dr[listdl[max]]) / 2.) - continue; - - if (AParameterUtilities.getRhoSign(x[j], y[j]) != AParameterUtilities.getRhoSign(x[listdl[max]], y[listdl[max]])) - continue; - - available[i] = false; - etSum[listdl[max]] += et[j]; - numCells--; - } - } - } - - numDraw = newNumDraw; - } - - /** - * See expandDrawn. - * - * @param drawn boolean[] initial drawn list containing only the explicitly - * drawn cells - * @return boolean[] drawn list containing the explicitly and the implicitly - * drawn cells. - */ - private boolean[] expandDrawnRZ(boolean[] drawn) - { - makeDrawList(); - - boolean available[] = new boolean[numDraw]; - int numCells = numDraw; - - // Initialize the variables. - for (int i = 0; i < numDraw; i++) - { - available[i] = true; - } - - while (numCells > 0) - { - - // Loop through all available cells and find the highest energy. - int max = -1; - for (int i = 0; i < numDraw; i++) - { - if (available[i]) - { - if (max < 0 || et[listdl[i]] > et[listdl[max]]) - max = i; - } - } - - // This is a cell we want to draw, store it and remove it from the - // available cells list. - available[max] = false; - numCells--; - - // Now find all available cells that overlap this one. This loop - // will be processed - // quite a lot, so it is very important to do the "easy" rejects - // first. - for (int i = 0; i < numDraw; i++) - { - if (available[i]) - { - int j = listdl[i]; - - double zDist = Math.abs(z[j] - z[listdl[max]]); - if (zDist >= (dz[j] + dz[listdl[max]]) / 2.) - continue; - - double rDist = Math.abs(r[j] - r[listdl[max]]); - if (rDist >= (dr[j] + dr[listdl[max]]) / 2.) - continue; - - if (AParameterUtilities.getRhoSign(x[j], y[j]) != AParameterUtilities.getRhoSign(x[listdl[max]], y[listdl[max]])) - continue; - - available[i] = false; - if (drawn[listdl[max]]) - drawn[j] = true; - numCells--; - } - } - } - - return drawn; - } - - /** - * Draws the FCAL data in the y-x projection. - * - * @return ACoord cell geometry polygons - */ - protected ACoord getYXUser() - { - makeDrawList(); - - int mode = parameterStore.get("YX", "Mode").getI(); - if (parameterStore.get("YX", "DrawFCAL").getStatus() && mode >= AProjectionYX.MODE_HEC_2 && - mode <= AProjectionYX.MODE_HEC_4) - { - cutArray(sampling, mode - AProjectionYX.MODE_HEC_2, "Layer"); - } - else if (mode >= AProjectionYX.MODE_FCAL_EM || mode <= AProjectionYX.MODE_FCAL_HAD_2) - { - cutArray(sampling, mode - AProjectionYX.MODE_FCAL_EM, "Layer"); - } - else - { - return ACoord.NO_DATA; - } - - filterDrawListYX(); - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - double xMin = x[j] - dx[j] / 2.; - double xMax = x[j] + dx[j] / 2.; - double yMin = y[j] - dy[j] / 2.; - double yMax = y[j] + dy[j] / 2.; - - hv[0][i] = new double[] { xMax, xMin, xMin, xMax }; - hv[1][i] = new double[] { yMax, yMax, yMin, yMin }; - - index[i] = j; - } - - return new ACoord(hv, index, this); - } - - /** - * Draws the FCAL data in the rho-z projection. See the description of - * filterDrawListRZ() for an explanation of the drawing method. - * - * @return ACoord cell geometry polygons - */ - protected ACoord getRZUser() - { - makeDrawList(); - filterDrawListRZ(); - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - - double zMin = z[j] - dz[j] / 2.; - double zMax = z[j] + dz[j] / 2.; - double rMin = Math.sqrt(Math.pow(Math.abs(x[j]) - Math.abs(dx[j] / 2.), 2) + Math.pow(Math.abs(y[j]) - Math.abs(dy[j] / 2.), 2)); - double rMax = Math.sqrt(Math.pow(Math.abs(x[j]) + Math.abs(dx[j] / 2.), 2) + Math.pow(Math.abs(y[j]) + Math.abs(dy[j] / 2.), 2)); - - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi[j] - phiMid); - if (phiDiff > Math.PI / 2. && phiDiff <= 3 * Math.PI / 2.) - { - rMin *= -1; - rMax *= -1; - } - - hv[0][i] = new double[] { zMax, zMin, zMin, zMax }; - hv[1][i] = new double[] { rMax, rMax, rMin, rMin }; - - index[i] = j; - } - - return new ACoord(hv, index, this); - } - - /** - * Applies cuts to the data. - */ - protected void applyCuts() - { - super.applyCuts(); - cut("CutsCalo", "FCALET", "FCALET", et); - cut("CutsCalo", "FCALEnergy", "FCALEnergy", energy); - - int cutSub = parameterStore.get("CutsCalo", "FCAL").getI(); - if(cutSub != -1) - { - cutArray(sub, cutSub, "Endcap"); - } - } - - /** - * Returns the data in the phi-rho projection. - * - * @return ACoord polygons representing calorimeter cells - */ - public ACoord getFRUser() - { - return getYXUser().convertYXToFR().includePhiWrapAround("FR"); - } - - /** - * Returns the data in the phi-eta projection. - * - * @return ACoord polygons representing calorimeter cells - */ - protected ACoord getVPUser() - { - makeDrawList(); - - switch (parameterStore.get("VP", "Mode").getI()) - { - case AProjectionVP.MODE_ECAL_LAYER_0: - case AProjectionVP.MODE_ECAL_LAYER_1: - case AProjectionVP.MODE_ECAL_LAYER_2: - case AProjectionVP.MODE_ECAL_LAYER_3: - cutArray(sampling, 0, "EM"); - break; - case AProjectionVP.MODE_HCAL_LAYER_0: - case AProjectionVP.MODE_HCAL_LAYER_1: - case AProjectionVP.MODE_HCAL_LAYER_2: - case AProjectionVP.MODE_HCAL_LAYER_3: - cutArrayOR(sampling, 1, 2, "Hadronic"); - break; - default: - return ACoord.NO_DATA; - } - - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - etSum[j] = et[j]; - - double eta0 = AMath.etaAbs(z[j], (float) Math.sqrt(Math.pow(x[j] + dx[j] / 2., 2) + Math.pow(y[j] + dy[j] / 2., 2))); - double eta1 = AMath.etaAbs(z[j], (float) Math.sqrt(Math.pow(x[j] - dx[j] / 2., 2) + Math.pow(y[j] + dy[j] / 2., 2))); - double eta2 = AMath.etaAbs(z[j], (float) Math.sqrt(Math.pow(x[j] - dx[j] / 2., 2) + Math.pow(y[j] - dy[j] / 2., 2))); - double eta3 = AMath.etaAbs(z[j], (float) Math.sqrt(Math.pow(x[j] + dx[j] / 2., 2) + Math.pow(y[j] - dy[j] / 2., 2))); - - // Calculate phi between 0 and 360. - double phi0 = Math.toDegrees(Math.atan2(y[j] + dy[j] / 2., x[j] + dx[j] / 2.) + 360.) % 360.; - double phi1 = Math.toDegrees(Math.atan2(y[j] + dy[j] / 2., x[j] - dx[j] / 2.) + 360.) % 360.; - double phi2 = Math.toDegrees(Math.atan2(y[j] - dy[j] / 2., x[j] - dx[j] / 2.) + 360.) % 360.; - double phi3 = Math.toDegrees(Math.atan2(y[j] - dy[j] / 2., x[j] + dx[j] / 2.) + 360.) % 360.; - - // Some code to prevent problems with cells going across the 0/360 - // border. - if (phi1 - phi0 > 180.) - phi1 -= 360.; - else if (phi0 - phi1 > 180.) - phi1 += 360; - if (phi2 - phi1 > 180.) - phi2 -= 360.; - else if (phi1 - phi2 > 180.) - phi2 += 360; - if (phi3 - phi2 > 180.) - phi3 -= 360.; - else if (phi2 - phi3 > 180.) - phi3 += 360; - - hv[0][i] = new double[] { eta0, eta1, eta2, eta3 }; - hv[1][i] = new double[] { phi0, phi1, phi2, phi3 }; - - index[i] = j; - } - - return new ACoord(hv, index, this).includePhiWrapAround("VP"); - } - - /** - * Returns the histograms in the RZ projection. - * - * @return ACoord[] histograms - */ - public ACoord[] getRZHistograms() - { - AHistogram histUp = new AHistogram(-outerEta, outerEta, etaGranularity, histoScale.getD(), this); - AHistogram histDown = new AHistogram(-outerEta, outerEta, etaGranularity, histoScale.getD(), this); - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - int sign = AParameterUtilities.getRhoSign(x[j], y[j]); - double etaMin; - double etaMax; - - if (side[j] < 0) - { - etaMin = AParameterUtilities.eta(z[j] + dz[j] / 2.f, r[j] - dr[j] / 2.f); - etaMax = AParameterUtilities.eta(z[j] - dz[j] / 2.f, r[j] + dr[j] / 2.f); - } - else - { - etaMin = AParameterUtilities.eta(z[j] - dz[j] / 2.f, r[j] + dr[j] / 2.f); - etaMax = AParameterUtilities.eta(z[j] + dz[j] / 2.f, r[j] - dr[j] / 2.f); - } - - if (sign > 0) - { - histUp.fill(etaMin, etaMax, etSum[j]); - } - else - { - histDown.fill(etaMin, etaMax, etSum[j]); - } - } - - ACoordArray c = new ACoordArray(); - c.add(histUp.getRZUser(outerZ, outerR, AHistogram.UP)); - c.add(histDown.getRZUser(outerZ, outerR, AHistogram.DOWN)); - return c.getArray(); - } - - - -// /** -// * Determines adc2Mev factor value for a cell. The number either comes -// * with the event file (adc2Mev subtag), but sometimes is not available -// * in Athena (in the database) which is indicated by -1 in the event file -// * for a particular cell. In this case, use predefined constant in this -// * method. -// * -// * zdenek (2008-09-15): -// * These predefined values (which are used if adc2Mev factor is -1) should -// * no longer be used. if the factor is not present, do not plot the pulse -// * shape, just the ADC counts as these values are non-sense. The method -// * and references to it should be removed after some time (if calo people -// * don't change their mind to pre-define some other values and use those) -// * -// * @param index int -// * @return String -// */ - /* - private float getADC2MevFactorPredefined(int index) - { - int layer = sampling[index]; - float r = Float.NaN; - switch(layer) - { - case 0: r = 87.0f; - break; - case 1: r = 117.0f; - break; - case 2: r = 193.0f; - break; - } - - return r; - - } // getADC2MevFactorPredefined() --------------------------------------- - */ - - - /** - * Returns info about a selected hit (for picking) - * - * @param index int hit index - * @return String info - */ - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n ET="+String.format("%.3f",et[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Ex="+String.format("%.3f",et[index]*Math.cos(phi[index]))+" GeV "+ - "\n Ey="+String.format("%.3f",et[index]*Math.sin(phi[index]))+" GeV "+ - "\n Ez="+String.format("%.3f",et[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String t = ""; - String cellInfo = ""; - - t = super.getHitInfo(index); - cellInfo += "\n x = " + x[index] + " cm"; - cellInfo += "\n y = " + y[index] + " cm"; - - cellInfo += "\n cell time = "; - cellInfo += (cellTime != null) ? Float.toString(cellTime[index]) + - " ns" : "n/a"; - cellInfo += "\n cell gain = "; - cellInfo += (cellGain != null) ? Integer.toString(cellGain[index]) : "n/a"; - cellInfo += "\n cell pedestal = "; - cellInfo += (cellPedestal != null) ? Float.toString(cellPedestal[index]) + - " ADC counts" : "n/a"; - - cellInfo += "\n ADC 2 MeV = "; - if(adc2Mev == null) - { - cellInfo += "n/a"; - } - else - { - // subtag adc2Mev was available in the event file - if(adc2Mev[index] != -1) - { - // other than -1: the factor was available in - // Athena (database) for this particular cell - cellInfo += Float.toString(adc2Mev[index]) + " (from database)"; - } - else - { - // -1 -> the factor wasn't available in Athena (database), - // use hardcoded constant for this particular cell - cellInfo += "-1 (n/a in database)"; - // see comment at the getADC2MevFactorPredefined() method - // (was printing the predefined value) using predefined " + - // Float.toString(getADC2MevFactorPredefined(index)); - } - } - - cellInfo += pulseShapesDataAvailable ? "" : - "\n data for real pulse shapes plot n/a"; - - return t + cellInfo; - - } // getHitInfo() ------------------------------------------------------- - - @Override //ACalorimeterData - //Gives the hit time for this cell - protected double getTime(int hit) - { - if (cellTime == null) return 0.0; - else return cellTime[hit]; - } - - /** - * Recalculates eta from r and z in case the user wants to have their eta - * with respect to the primary vertex instead of 0. The calculation is a - * little different from the other calorimeter classes because this one - * contains both barrel and endcap data. - * - * @param index int index of hit in data - * @return double eta value - */ - public double getEta(int index) - { - if (!parameterStore.get("VP", "EtaVertex").getStatus()) - { - return this.eta[index]; - } - - return AParameterUtilities.eta(z[index], Math.sqrt(x[index] * x[index] + y[index] * y[index])); - } - - /** - * Returns the histograms for this projection. - * - * @param projection AProjection2D current projection - * @return ACoord[] polygons representing histograms - */ - protected ACoord[] getUserHistograms(AProjection2D projection) - { - ACoord[] data = ACoord.NO_HISTOGRAMS; - if (projection instanceof AProjectionRZ) - data = getRZHistograms(); - return projection.nonLinearTransform(data); - } - - - -// /** -// * Call util class which plots cell pulse shapes provided that -// * all real pulse shapes data is available -// * Functions calculates values of real pulse shape calculated in the method -// * getPhysicsPulseShape(). -// * This method is called from pick interaction. -// * -// * @param index int -// */ - /*public void plotPulseShapes(int index) - { - - if(pulseShapesDataAvailable) - { - String title = getPulseTitleString(index); - - int[][] adcCountsLocal = new int[][] { adcCounts[index] }; - - if(super.checkADCCountsAvailability(adcCountsLocal)) - { - // adc counts are available - logger.debug(CALORIMETER_NAME + " adc counts (digits) are " + - "available for pulse shapes plots for this cell."); - } - else - { - AOutput.append("\nADC counts are not available for this cell, " + - "can't plot pulse shapes.", ALogPane.WARNING); - return; - } - - - float[] time = ACalorimeterRPSPLT.FCAL_TIME; // lookup tables - float[] amplitude = null; // lookup tables - switch(sampling[index]) - { - // use correct amplitude lookup table for this layer (sampling) - case 0: amplitude = ACalorimeterRPSPLT.FCAL_LAYER0_AMPLITUDE; - break; - case 1: amplitude = ACalorimeterRPSPLT.FCAL_LAYER1_AMPLITUDE; - break; - case 2: amplitude = ACalorimeterRPSPLT.FCAL_LAYER2_AMPLITUDE; - break; - default: AOutput.append("\nADC counts plot only, pulse shape " + - "plot not implemented for " + - CALORIMETER_NAME + " layer " + - sampling[index] + "\n", ALogPane.WARNING); - APulseShapePlot.plotADCCounts(adcCountsLocal, title, null); - return; - } - - // step - starting from 1, need to get step numbers within - // number of ADC samples (adcCounts[0].length) - double step = (adcCounts[0].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - double[][] realPulse = new double[1][NUMBER_OF_LOOKUP_VALUES]; // 1 channel - double d = 1.0; - // if adc2Mev != -1 -> use value from event file, otherwise predefined value - // see comment at the getADC2MevFactorPredefined() method - // factor variable is used as a flag whether or not to plot pulse shape, - // if is -1 (adc2Mev not available), then want to see only the adc counts - // and don't calculate the pulse shapes - // getADC2MevFactorPredefined(index) is no longer in use, see comment at it - float factor = adc2Mev[index]; - - double energyLocal = energy[index] * 1000.0 / factor; - try - { - if(factor != -1) - { - for(int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) - { - d += step; - realPulse[0][i] = super.getPhysicsPulseShape(d, cellTime[index], - cellPedestal[index], energyLocal, - amplitude, time, NUMBER_OF_LOOKUP_VALUES); - } - } - } - catch(AAtlantisException aaex) - { - AOutput.append(aaex.getMessage(), ALogPane.WARNING); - return; - } - - if(factor != -1) - { - logger.debug("adc2Mev factor available, plotting full plot."); - APulseShapePlot.plotRealPulseShapes(adcCountsLocal, realPulse, - step, null, title); - } - else - { - logger.debug("adc2Mev factor not available, plotting just adc counts."); - APulseShapePlot.plotADCCounts(adcCountsLocal, title, null); - } - - } // if(pulseShapesDataAvailable) - else - { - return; - } - - }*/ // plotPulseShapes() -------------------------------------------------- - - @Override - protected int[][] getADCCounts(int index) { - - if (pulseShapesDataAvailable) { - return new int[][]{adcCounts[index]}; - } else { - return null; - } - } - - /** - * Calculate local time for pulse shape plots - */ - protected double getLocalTime(double xTime, double cellTime, int numSamplings) { - int nominalPeakSample = (int)(numSamplings / 2.); - return ((xTime - nominalPeakSample + 3) * 25.0) - cellTime; - } - - @Override - protected double[][] getPulseShape(int index) { - - float[] time = ACalorimeterRPSPLT.FCAL_TIME; // lookup tables - float[] amplitude = null; // lookup tables - switch(sampling[index]) - { - // use correct amplitude lookup table for this layer (sampling) - case 0: amplitude = ACalorimeterRPSPLT.FCAL_LAYER0_AMPLITUDE; - break; - case 1: amplitude = ACalorimeterRPSPLT.FCAL_LAYER1_AMPLITUDE; - break; - case 2: amplitude = ACalorimeterRPSPLT.FCAL_LAYER2_AMPLITUDE; - break; - default: AOutput.append("\nADC counts plot only, pulse shape " + - "plot not implemented for " + - CALORIMETER_NAME + " layer " + - sampling[index] + "\n", ALogInterface.WARNING); - return null; - } - - // step - starting from 1, need to get step numbers within - // number of ADC samples (adcCounts[0].length) - double step = getPulseStep(index); - double[][] realPulse = new double[1][NUMBER_OF_LOOKUP_VALUES]; // 1 channel - double d = 1.0; - // if adc2Mev != -1 -> use value from event file, otherwise predefined value - // see comment at the getADC2MevFactorPredefined() method - // factor variable is used as a flag whether or not to plot pulse shape, - // if is -1 (adc2Mev not available), then want to see only the adc counts - // and don't calculate the pulse shapes - // getADC2MevFactorPredefined(index) is no longer in use, see comment at it - float factor = adc2Mev[index]; - - double energyLocal = energy[index] * 1000.0 / factor; - try - { - if(factor != -1) - { - for(int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) - { - d += step; - double localTime = getLocalTime(d, cellTime[index], this.numSamplings); - realPulse[0][i] = super.getPhysicsPulseShape(localTime, - cellPedestal[index], energyLocal, - amplitude, time, NUMBER_OF_LOOKUP_VALUES); - } - } - } - catch(AAtlantisException aaex) - { - AOutput.append(aaex.getMessage(), ALogInterface.WARNING); - return null; - } - - if(factor != -1) - { - logger.debug("adc2Mev factor available, plotting full plot."); - return realPulse; - } - else - { - logger.debug("adc2Mev factor not available, plotting just adc counts."); - return null; - } - - } - - @Override - protected double getPulseStep(int index) { - return (adcCounts[0].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AG4StepData.java b/graphics/AtlantisJava/src/atlantis/data/AG4StepData.java deleted file mode 100755 index 7f962718d03bc8bb297d4b621cb90215a61ebee7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AG4StepData.java +++ /dev/null @@ -1,559 +0,0 @@ -package atlantis.data; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.FileReader; -import java.io.InputStreamReader; -import java.util.Enumeration; -import java.util.Scanner; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -import atlantis.parameters.AParameterUtilities; -import atlantis.canvas.ACanvas; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.utils.AAtlantisException; -import atlantis.event.ABufferedEventSource; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.utils.AHashMap; - -/** - * This class holds the data from GEANT4 (G4) steps which - * represent the path of simulated particles. The steps - * are read in from a (zipped) text file via the File menu - * or by pressing "/". - * The file (named "G4Atlantis_run_event.txt(.zip)") can be - * made by running AtlasG4 with a special plugin: - * AtlasG4_trf.py postInitInclude="G4UserActions/G4AtlantisDumper_options.py" - * - * @author Andy Haas (ahaas) - */ -public class AG4StepData extends AData { - - protected int[] nsteps; - protected int[] gid; - protected int[] pid; - protected int[] fs; - protected int[] ls; - protected int[] stepn; - protected String[] pn; - protected int[] nsec; - protected float[] tedep; - protected float[] tnedep; - protected float[] length; - protected int[] pdg; - protected float[] mass; - protected float[] charge; - protected float[] x1; - protected float[] y1; - protected float[] z1; - protected float[] t1; - protected float[] x2; - protected float[] y2; - protected float[] z2; - protected float[] t2; - protected float[] px1; - protected float[] py1; - protected float[] pz1; - protected float[] ke1; - protected float[] px2; - protected float[] py2; - protected float[] pz2; - protected float[] ke2; - - protected float[] eta1; - protected float[] p1; - - public AG4StepData(AHashMap p, AEvent e) { - super(p, e); - - nsteps = p.getIntArray("nsteps"); - gid = p.getIntArray("id"); - pid = p.getIntArray("pid"); - fs = p.getIntArray("fs"); - ls = p.getIntArray("ls"); - stepn = p.getIntArray("stepn"); - pn = p.getStringArray("pn"); - nsec= p.getIntArray("nsec"); - tedep = p.getFloatArray("tedep"); - tnedep = p.getFloatArray("tnedep"); - length = p.getFloatArray("length"); - pdg = p.getIntArray("pdg"); - mass = p.getFloatArray("mass"); - charge = p.getFloatArray("charge"); - x1 = p.getFloatArray("x1"); - y1 = p.getFloatArray("y1"); - z1 = p.getFloatArray("z1"); - t1 = p.getFloatArray("t1"); - x2 = p.getFloatArray("x2"); - y2 = p.getFloatArray("y2"); - z2 = p.getFloatArray("z2"); - t2 = p.getFloatArray("t2"); - px1 = p.getFloatArray("px1"); - py1 = p.getFloatArray("py1"); - pz1 = p.getFloatArray("pz1"); - ke1 = p.getFloatArray("ke1"); - px2 = p.getFloatArray("px2"); - py2 = p.getFloatArray("py2"); - pz2 = p.getFloatArray("pz2"); - ke2 = p.getFloatArray("ke2"); - - eta1 = new float[numData]; - p1 = new float[numData]; - for (int i=0; i<numData; ++i) { - eta1[i]=(float)(-1.0*Math.log(Math.tan( - Math.acos( z1[i]/Math.sqrt(x1[i]*x1[i]+y1[i]*y1[i]+z1[i]*z1[i]) )/2.0 - ))); - p1[i]=(float)Math.sqrt(px1[i]*px1[i]+py1[i]*py1[i]+pz1[i]*pz1[i]); - } - } - - /** - * The color of the step displayed... mostly determined - * by the particle type (pdgid) for now. - */ - @Override - protected void colorByIndex() { - int numColors = parameterStore.get("HitColors", "Number").getI(); - if (numColors<6) return;//not enough colors! - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for (int i = 0; i < numData; i++) { - - if (charge[i]==0) color[i] = (byte)col[0];//neutral - else color[i] = (byte)col[1];//charged - - if (pdg[i]==22) color[i] = (byte)col[2];//photons - if (Math.abs(pdg[i])==11) color[i] = (byte)col[3];//electrons - if (Math.abs(pdg[i])==13) color[i] = (byte)col[4];//muons - if (Math.abs(pdg[i])>=1000000000) color[i] = (byte)col[5];//nuclei - } - } - - /** - * Can choose to color by constant color, or using the - * function above (by type / index). - */ - protected int internalColor() { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - switch (colorFunction) { - case 0: - colorByConstant(); - break; - case 1: - colorByIndex(); - break; - } - return 1; - } - - /** - * Cuts on the particle type, energy, etc. - * Adjusted via the gui, and in the config-G4.xml file. - */ - protected void applyCuts() { - cutIndex(); - - cut("CutsObjects", "G4StepKE1", " ke1", ke1);//starting kinetic energy (MeV) - cut("CutsObjects", "G4StepP1", " p1", p1);//starting momentum (MeV) - - cut("CutsObjects", "G4StepPhotons", " |pdg|", pdg);//22 - cut("CutsObjects", "G4StepElectrons", " |pdg|", pdg);//11 - cut("CutsObjects", "G4StepMuons", " |pdg|", pdg);//13 - cut("CutsObjects", "G4StepPions", " |pdg|", pdg);//211 - cut("CutsObjects", "G4StepProtons", " |pdg|", pdg);//2212 - cut("CutsObjects", "G4StepNeutrons", " |pdg|", pdg);//2112 - - // Nuclear codes are given as 10-digit numbers +-10LZZZAAAI. - // For a nucleus consisting of np protons and nn neutrons - // A = np + nn +nlambda and Z = np and L = nlambda - // I gives the isomer level, with I = 0 corresponding to the ground state and I >0 to excitations - cut("CutsObjects", "G4StepNuclei", " |pdg|", pdg);//1000000000 - - } - - /** - * Prints out stuff when you select a step using the hand. - */ - public String getHitInfo(int index) { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if (simpleOutput > 0) { - return getNameScreenName() + " index: " + index + "\n"; - } - - String name = "none"; - try { - name = APDGTable.getName(pdg[index]); - - } catch(APDGTable.ParticleNotFoundError e) { - name = "unknown"; - } - - return getName() + " (index: " + index + ") : " - + " storegate key = " + storeGateKey + "\n" - + " total step # = " + nsteps[index] + " \n" - + " geant/parent id = " + gid[index]+"/"+ pid[index] + " \n" - + " first/last step? " + fs[index] +"/"+ ls[index] + " / step#="+stepn[index]+"\n" - + " process = " + pn[index] + " / # secondaries = " + nsec[index] + " \n" - + " energy/NI deposited = " + tedep[index]+" / "+tnedep[index]+" MeV\n" - + " length = " + length[index] + " cm / " +"eta1 = "+eta1[index]+"\n" - + " pdg = " + pdg[index] + " ("+name+")\n" - + " mass / charge = " + mass[index]+" MeV"+" / "+charge[index]+"\n" - + " x1 y1 z1 = " + String.format("%.3f", x1[index])+" "+String.format("%.3f", y1[index])+" "+String.format("%.3f", z1[index])+" cm\n" - + " t1 = " + String.format("%.3f", t1[index]) + " ns\n" - + " x2 y2 z2 = " + String.format("%.3f", x2[index])+" "+String.format("%.3f", y2[index])+" "+String.format("%.3f", z2[index])+" cm\n" - + " t2 = " + String.format("%.3f", t2[index]) + " ns\n" - + " px1 py1 pz1 = " + String.format("%.3f", px1[index])+" "+String.format("%.3f", py1[index])+" "+String.format("%.3f", pz1[index])+" MeV\n" - + " ke1 = " + String.format("%.3f", ke1[index]) + " MeV\n" - + " px2 py2 pz2 = " + String.format("%.3f", px2[index])+" "+String.format("%.3f", py2[index])+" "+String.format("%.3f", pz2[index])+" MeV\n" - + " ke2 = " + String.format("%.3f", ke2[index]) + " MeV\n" - + " p1 = " + String.format("%.3f", p1[index]) + " MeV\n" - ; - } - - /** - * Make some cuts for drawing in the YX view. - */ - @Override - protected ACoord getYXUser() { - //System.out.print("numData="+numData+", numDraw="+numDraw); - makeDrawList(); - //System.out.print(" "+numDraw); - - //cut on |eta1| - int num = 0; - double AbsEtaXYcut = parameterStore.get(PARAMETER_GROUP, "AbsEtaXYcut").getD(); - if (AbsEtaXYcut >= 0.0) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(eta1[listdl[i]]) < AbsEtaXYcut) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - //System.out.print(" "+numDraw); - - //cut on |z1| - num = 0; - double AbszXYcut = parameterStore.get(PARAMETER_GROUP, "AbszXYcut").getD(); - if (AbszXYcut >= 0.0) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(z1[listdl[i]]) < AbszXYcut) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - //System.out.println(" "+numDraw); - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - //double length = parameterStore.get(PARAMETER_GROUP, "SegmentLength").getD(); - for (int i = 0; i < numDraw; i++) { - int j = listdl[i]; - hv[0][i] = new double[]{x1[j], x2[j]}; - hv[1][i] = new double[]{y1[j], y2[j]}; - index[i] = j; - } - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES); - } - - /** - * Make some cuts for drawing in the FR view. - */ - @Override - protected ACoord getFRUser() { - return getYXUser().convertYXToFR().includePhiWrapAround("FR"); - } - - /** - * Make some cuts for drawing in the RZ view. - */ - @Override - protected ACoord getRZUser() { - makeDrawList(); - - //cut on |eta1| - int num = 0; - double AbsEtaRZcut = parameterStore.get(PARAMETER_GROUP, "AbsEtaRZcut").getD(); - if (AbsEtaRZcut >= 0.0) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(eta1[listdl[i]]) < AbsEtaRZcut) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - //cut on |z1| - num = 0; - double AbszRZcut = parameterStore.get(PARAMETER_GROUP, "AbszRZcut").getD(); - if (AbszRZcut >= 0.0) { - for (int i = 0; i < numDraw; i++) { - if ( - Math.abs(z1[listdl[i]]) < AbszRZcut && - Math.sqrt(x1[listdl[i]]*x1[listdl[i]]+y1[listdl[i]]*y1[listdl[i]]) < 1200 - ) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - //double length = parameterStore.get(PARAMETER_GROUP, "SegmentLength").getD(); - for (int i = 0; i < numDraw; i++) { - int j = listdl[i]; - double s = AParameterUtilities.getRhoSign(x1[j], y1[j]);//use same for both points to avoid ugliness - double r1 = s * Math.sqrt(x1[j] * x1[j] + y1[j] * y1[j]); - double r2 = s * Math.sqrt(x2[j] * x2[j] + y2[j] * y2[j]); - hv[0][i] = new double[]{z1[j], z2[j]}; - hv[1][i] = new double[]{r1, r2}; - index[i] = j; - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - } - - @Override - public String getName() { - return "G4Step"; - } - - @Override - public String getNameScreenName() { - return "G4Step"; - } - - @Override - public String getParameterGroup() { - return "G4Step"; - } - - /** - * Read in the corresponding G4Atlantis_run_event.txt(.zip) file. - * It needs to be in the same directory as the JiveXML_run_event.xml file - * that is currently being viewed. - */ - public static void ReadG4Steps(){ - AEvent ev = eventManager.getCurrentEvent(); - String source = eventManager.getEventSource().getSourceName(); - System.out.println("Source="+source); - String filename = source; - if (source.contains("\\")) filename+="\\G4Atlantis_"+ev.getRunNumber()+"_"+ev.getEventNumber()+".txt"; - else filename += "/G4Atlantis_" + ev.getRunNumber() + "_" + ev.getEventNumber() + ".txt"; - System.out.println("Reading G4 file: " + filename); - Scanner inFile = null; - int maxnstepsinthisevent = 4000000;//max allowed - int nstepsinfile = maxnstepsinthisevent;//will be set to actual number of steps in file, if lower than maximum - try { - inFile = new Scanner(new FileReader(filename)); - - //try to get the number of steps that are in the file - try { - FileInputStream in = new FileInputStream(filename); - BufferedReader br = new BufferedReader(new InputStreamReader(in)); - String strLine = null, tmp; - while ((tmp = br.readLine()) != null) { strLine = tmp; } - String lastLine = strLine; - System.out.println(lastLine); - in.close(); - - Scanner lastlinescanner = new Scanner(lastLine); - String llach = lastlinescanner.next(); - String _llach = "ACH_G4Step"; - if (!llach.equals(_llach)) { - System.out.println("??ach in lastline = " + llach); - } - nstepsinfile = lastlinescanner.nextInt()+1; - - } catch (IOException ex) { - Logger.getLogger(AG4StepData.class.getName()).log(Level.SEVERE, null, ex); - } - - } catch (FileNotFoundException ex) { - //Logger.getLogger(AEventQueue.class.getName()).log(Level.SEVERE, null, ex); - System.out.println("Could not open "+filename); - } - - if (inFile == null) { - ZipFile zipfile = null; - try { - System.out.println("Reading G4 file: " + filename+".zip"); - zipfile = new ZipFile(filename + ".zip"); - } catch (IOException ex) { - //Logger.getLogger(AEventQueue.class.getName()).log(Level.SEVERE, null, ex); - System.out.println("Could not open "+filename+".zip either"); - } - if (zipfile != null) { - BufferedInputStream is = null; - ZipEntry entry; - Enumeration e = zipfile.entries(); - while (e.hasMoreElements()) { - entry = (ZipEntry) e.nextElement(); - System.out.println("Extracting: " + entry); - try { - is = new BufferedInputStream(zipfile.getInputStream(entry)); - BufferedReader br = new BufferedReader(new InputStreamReader(is)); - String strLine = null, tmp; - while ((tmp = br.readLine()) != null) { - strLine = tmp; - } - String lastLine = strLine; - System.out.println(lastLine); - - Scanner lastlinescanner = new Scanner(lastLine); - String llach = lastlinescanner.next(); - String _llach = "ACH_G4Step"; - if (!llach.equals(_llach)) { - System.out.println("??ach in lastline = " + llach); - } - nstepsinfile = lastlinescanner.nextInt() + 1; - - is = new BufferedInputStream(zipfile.getInputStream(entry)); - inFile = new Scanner(is); - } catch (IOException ex) { - Logger.getLogger(AG4StepData.class.getName()).log(Level.SEVERE, null, ex); - } - - } - } - } - - if (inFile != null) { - - System.out.print("nsteps in file should be "+nstepsinfile+"... "); - if (nstepsinfile>maxnstepsinthisevent) nstepsinfile=maxnstepsinthisevent; - System.out.println(" and will read "+nstepsinfile+" steps."); - - try { - AHashMap para = new AHashMap(100); - float[] x1 = new float[nstepsinfile]; - float[] y1 = new float[nstepsinfile]; - float[] z1 = new float[nstepsinfile]; - float[] t1 = new float[nstepsinfile]; - float[] x2 = new float[nstepsinfile]; - float[] y2 = new float[nstepsinfile]; - float[] z2 = new float[nstepsinfile]; - float[] t2 = new float[nstepsinfile]; - float[] px1 = new float[nstepsinfile]; - float[] py1 = new float[nstepsinfile]; - float[] pz1 = new float[nstepsinfile]; - float[] ke1 = new float[nstepsinfile]; - float[] px2 = new float[nstepsinfile]; - float[] py2 = new float[nstepsinfile]; - float[] pz2 = new float[nstepsinfile]; - float[] ke2 = new float[nstepsinfile]; - int[] nsteps = new int[nstepsinfile]; - int[] id = new int[nstepsinfile]; - int[] pid = new int[nstepsinfile]; - int[] fs = new int[nstepsinfile]; - int[] ls = new int[nstepsinfile]; - int[] stepn = new int[nstepsinfile]; - String[] pn = new String[nstepsinfile]; - int[] nsec = new int[nstepsinfile]; - float[] tedep = new float[nstepsinfile]; - float[] tnedep = new float[nstepsinfile]; - float[] length = new float[nstepsinfile]; - int[] pdg = new int[nstepsinfile]; - float[] mass = new float[nstepsinfile]; - float[] charge = new float[nstepsinfile]; - - int n = 0; - String _ach = "ACH_G4Step"; - while (inFile.hasNext() && n<nstepsinfile){ - String ach = inFile.next(); - if (!ach.equals(_ach)) { - System.out.println("??ach = " + ach); - } - nsteps[n] = inFile.nextInt(); - id[n] = inFile.nextInt(); - pid[n] = inFile.nextInt(); - fs[n] = inFile.nextInt(); - ls[n] = inFile.nextInt(); - stepn[n] = inFile.nextInt(); - pn[n] = inFile.next(); - nsec[n] = inFile.nextInt(); - tedep[n] = inFile.nextFloat(); - tnedep[n] = inFile.nextFloat(); - length[n] = inFile.nextFloat()/10.0f; - pdg[n] = inFile.nextInt(); - //System.out.println("pdg="+pdg); - mass[n] = inFile.nextFloat(); - charge[n] = inFile.nextFloat(); - x1[n] = inFile.nextFloat()/10.0f; - y1[n] = inFile.nextFloat()/10.0f; - z1[n] = inFile.nextFloat()/10.0f; - t1[n] = inFile.nextFloat(); - px1[n] = inFile.nextFloat(); - py1[n] = inFile.nextFloat(); - pz1[n] = inFile.nextFloat(); - ke1[n] = inFile.nextFloat(); - x2[n] = inFile.nextFloat()/10.0f; - y2[n] = inFile.nextFloat()/10.0f; - z2[n] = inFile.nextFloat()/10.0f; - t2[n] = inFile.nextFloat(); - px2[n] = inFile.nextFloat(); - py2[n] = inFile.nextFloat(); - pz2[n] = inFile.nextFloat(); - ke2[n] = inFile.nextFloat(); - ++n; - if (n%100000==0) System.out.println("Read "+n+" steps"); - } - System.out.println("Read "+n+" steps"); - inFile.close(); - System.out.println("Closed file."); - - para.put("nsteps",nsteps); - para.put("id",id); - para.put("pid",pid); - para.put("fs",fs); - para.put("ls",ls); - para.put("stepn",stepn); - para.put("pn",pn); - para.put("nsec",nsec); - para.put("tedep",tedep); - para.put("tnedep",tnedep); - para.put("length",length); - para.put("pdg",pdg); - para.put("mass",mass); - para.put("charge",charge); - para.put("x1", x1); - para.put("y1", y1); - para.put("z1", z1); - para.put("t1", t1); - para.put("x2", x2); - para.put("y2", y2); - para.put("z2", z2); - para.put("t2", t2); - para.put("px1", px1); - para.put("py1", py1); - para.put("pz1", pz1); - para.put("ke1", ke1); - para.put("px2", px2); - para.put("py2", py2); - para.put("pz2", pz2); - para.put("ke2", ke2); - para.put("numData", n); - //para.put("storeGateKey", "G4"); - - ABufferedEventSource.maxNumberOfEvents=1;//otherwise we run out of heap - AG4StepData g4d = new AG4StepData(para, ev); - ev.add(g4d); - } catch (AAtlantisException ex) { - Logger.getLogger(AG4StepData.class.getName()).log(Level.SEVERE, null, ex); - } - catch (OutOfMemoryError oom) { - Logger.getLogger(AG4StepData.class.getName()).log(Level.SEVERE,"Ran out of memory while trying to read G4Step data"); - } - ACanvas.getCanvas().repaintAllFromScratch(); - }//inFile!=null - - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AHECData.java b/graphics/AtlantisJava/src/atlantis/data/AHECData.java deleted file mode 100755 index 2b1efe56a62558ca5441439232d1ae8abe16cecf..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AHECData.java +++ /dev/null @@ -1,574 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.AMath; -import atlantis.utils.AUtilities; -import atlantis.utils.ALogger; -import java.io.IOException; -import com.Ostermiller.util.CSVParser; - -import java.io.InputStream; -import java.io.StringReader; -import java.io.FileNotFoundException; - - -/** - * The Hadronic End Cap calorimeter. - * - * @author Eric Jansen - */ -public class AHECData extends ACalorimeterData -{ - private static ALogger logger = ALogger.getLogger(AHECData.class); - - // data for real pulse shapes plots - private int numSamplings = 0; - private int[][] adcCounts = null; - private float[] cellTime = null; - private int[] cellGain = null; - private float[] cellPedestal = null; - private float[] adc2Mev = null; - private static boolean pulseShapesDataAvailable = false; - private static final String LOOKUP_TABLE_FILE = - AGlobals.instance().getHomeDirectory() + "configuration" + - System.getProperty("file.separator") + - "rpsplt_hec.csv"; - // number of lookup table values for real pulse shapes plots calculation - private static final short NUMBER_OF_LOOKUP_VALUES = 800; - - - - AHECData(AHashMap p, AEvent e) - { - super(p,e); - - for (int i = 0; i < numData; i++) - { - try - { - side[i] = (byte) AIdHelper.larBarrelEndcap(id[i]); - etaIndex[i] = (short) AIdHelper.larEta(id[i]); - phiIndex[i] = (short) AIdHelper.larPhi(id[i]); - sampling[i] = AIdHelper.larSampling(id[i]); - } - catch (AAtlantisException ex) - { - logger.error("Problem decoding ID " + id[i] + " in " + CALORIMETER_NAME + ": " + ex.getMessage()); - side[i] = 0; - etaIndex[i] = -1; - phiIndex[i] = -1; - sampling[i] = -1; - } - } - - makeHitToGeometryMapping(); - for (int i = 0; i < et.length; ++i) - { - et[i] = Math.abs(energy[i] / (float) Math.cosh(eta[i])); - } - - // Collect some constants we need for the histograms. - for (int i = 0; i < ACalorimeterDetector.count(); i++) - { - - if (ACalorimeterDetector.get(i).getName().indexOf(CALORIMETER_NAME) >= 0) - { - if (innerR == 0.0 || ACalorimeterDetector.get(i).getRMin() < innerR) - { - innerR = ACalorimeterDetector.get(i).getRMin(); - } - if (innerZ == 0.0 || ACalorimeterDetector.get(i).getZMin() < innerZ) - { - innerZ = ACalorimeterDetector.get(i).getZMin(); - } - if (phiGranularity == 0.0 || ACalorimeterDetector.get(i).getDeltaPhi() < phiGranularity) - { - phiGranularity = ACalorimeterDetector.get(i).getDeltaPhi(); - } - if (etaGranularity == 0.0 || ACalorimeterDetector.get(i).getDeltaEta() < etaGranularity) - { - etaGranularity = ACalorimeterDetector.get(i).getDeltaEta(); - } - if (outerEta == 0.0 || ACalorimeterDetector.get(i).getEtaMax() > outerEta) - { - outerEta = ACalorimeterDetector.get(i).getEtaMax(); - } - } - - if (outerR == 0.0 || ACalorimeterDetector.get(i).getRMax() > outerR) - { - outerR = ACalorimeterDetector.get(i).getRMax(); - } - if (outerZ == 0.0 || ACalorimeterDetector.get(i).getZMax() > outerZ) - { - outerZ = ACalorimeterDetector.get(i).getZMax(); - } - } - - // Add a little bit of extra margin to prevent binning errors due to - // rounding of numbers. - outerEta += etaGranularity; - - // read in HEC data from real pulse shapes plots - readPulseShapePlotData(p); - - } - - - - private void readPulseShapePlotData(AHashMap p) - { - // read ADCCounts and cell data for real pulse shapes plots - adcCounts = super.getADCCountsData(p); - - // read LAr digits (cell data) for real pulse shapes plots - cellTime = (p.get("cellTime") != null) ? p.getFloatArray("cellTime") : null; - cellGain = (p.get("cellGain") != null) ? p.getIntArray("cellGain") : null; - cellPedestal = (p.get("cellPedestal") != null) ? p.getFloatArray("cellPedestal") : null; - adc2Mev = (p.get("adc2Mev") != null) ? p.getFloatArray("adc2Mev") : null; - - pulseShapesDataAvailable = false; - if(adcCounts != null && cellTime != null && cellGain != null && - cellPedestal != null && adc2Mev != null) - { - pulseShapesDataAvailable = true; - numSamplings = adcCounts[0].length; - - logger.debug(CALORIMETER_NAME + - ": data for real pulse shape plots available"); - - if(ACalorimeterRPSPLT.areHECLookupTablesInitialized()) - { - logger.debug(CALORIMETER_NAME + - ": lookup tables have already been read in"); - } - else - { - logger.debug(CALORIMETER_NAME + - ": lookup table values have not been read in yet\n" + - " trying to read file: " + LOOKUP_TABLE_FILE); - - try - { - readLookupTableFile(); - logger.debug(CALORIMETER_NAME + - ": values from " + LOOKUP_TABLE_FILE + - " successfully read in"); - } - catch(AAtlantisException ex) - { - logger.debug(CALORIMETER_NAME + - ": reading " + LOOKUP_TABLE_FILE + - " failed, real pulse shapes plots will not " + - "be available, reason: " + ex.getMessage(), ex); - pulseShapesDataAvailable = false; - } - } - } - - } // readPulseShapePlotData() ------------------------------------------- - - - - /** - * Returns info about a selected hit (for picking) - * - * @param index int hit index - * @return String info - */ - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n ET="+String.format("%.3f",et[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Ex="+String.format("%.3f",et[index]*Math.cos(phi[index]))+" GeV "+ - "\n Ey="+String.format("%.3f",et[index]*Math.sin(phi[index]))+" GeV "+ - "\n Ez="+String.format("%.3f",et[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String t = ""; - String cellInfo = ""; - - t = super.getHitInfo(index); - - cellInfo += "\n cell time = "; - cellInfo += (cellTime != null) ? Float.toString(cellTime[index]) + - " ns" : "n/a"; - cellInfo += "\n cell gain = "; - cellInfo += (cellGain != null) ? Integer.toString(cellGain[index]) : "n/a"; - cellInfo += "\n cell pedestal = "; - cellInfo += (cellPedestal != null) ? Float.toString(cellPedestal[index]) + - " ADC counts" : "n/a"; - - cellInfo += "\n ADC 2 MeV = "; - if(adc2Mev == null) - { - cellInfo += "n/a"; - } - else - { - // subtag adc2Mev was available in the event file - if(adc2Mev[index] != -1) - { - // other than -1: the factor was available in - // Athena (database) for this particular cell - cellInfo += Float.toString(adc2Mev[index]) + " (from database)"; - } - else - { - // -1 -> the factor wasn't available in Athena (database), - // use hardcoded constant for this particular cell - cellInfo += "-1 (n/a in database)"; - // see comment at the getADC2MevFactorPredefined() method - //, using predefined " + - // Float.toString(getADC2MevFactorPredefined()); - } - } - - cellInfo += pulseShapesDataAvailable ? "" : - "\n data for real pulse shapes plot n/a"; - - return t + cellInfo; - - } // getHitInfo() ------------------------------------------------------- - - @Override //ACalorimeterData - //Gives the hit time for this cell - protected double getTime(int hit) - { - if (cellTime == null) return 0.0; - else return cellTime[hit]; - } - -// /** -// * Determines adc2Mev factor value for a cell. The number either comes -// * with the event file (adc2Mev subtag), but sometimes is not available -// * in Athena (in the database) which is indicated by -1 in the event file -// * for a particular cell. In this case, use predefined constant in this -// * method. -// * -// * zdenek (2008-09-15): -// * These predefined values (which are used if adc2Mev factor is -1) should -// * no longer be used. if the factor is not present, do not plot the pulse -// * shape, just the ADC counts as these values are non-sense. The method -// * and references to it should be removed after some time (if calo people -// * don't change their mind to pre-define some other values and use those) -// -// * @param index int -// * @return String -// */ - /* - private float getADC2MevFactorPredefined() - { - - float r = 13.9f; - return r; - - } // getADC2MevFactorPredefined() --------------------------------------- - */ - - - - /** - * readLookupTableFile() reads in comma separated values (CSV) file - * with HEC real pulse shapes plots time and amplitude lookup values - * @param fileName String - * @throws AAtlantisException - */ - private void readLookupTableFile() throws AAtlantisException - { - try - { - InputStream is = AUtilities.getFileAsStream(LOOKUP_TABLE_FILE); - CSVParser parser = new CSVParser(is); - parser.setCommentStart("#"); - String arrayName = null; - - while((arrayName = parser.nextValue()) != null) - { - String valueArray = parser.nextValue(); // shall now contain all values - CSVParser parserArray = new CSVParser(new StringReader(valueArray)); - String[][] s = parserArray.getAllValues(); - if("HEC_AMPLITUDE".equals(arrayName)) - { - ACalorimeterRPSPLT.HEC_AMPLITUDE = - getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - } - else if("HEC_TIME".equals(arrayName)) - { - ACalorimeterRPSPLT.HEC_TIME = - getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - } - } - } - catch(FileNotFoundException e) - { - throw new AAtlantisException("could not find file: " + - LOOKUP_TABLE_FILE); - } - catch(IOException e) - { - throw new AAtlantisException("exception while reading file: " + - LOOKUP_TABLE_FILE); - } - catch(AAtlantisException e) - { - throw e; - } - - } // readLookupTableFile() ---------------------------------------------- - - - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsCalo", "HECET", "HECET", et); - cut("CutsCalo", "HECEnergy", "HECEnergy", energy); - - int cutSub = parameterStore.get("CutsCalo", "HEC").getI(); - if(cutSub != -1) - { - cutArray(side, cutSub, "Endcap"); - } - - } - - /** - * Returns the name of the parameter group. - * - * @return String parameter group - */ - public String getParameterGroup() - { - return "HEC"; - } - - /** - * Returns the name of the datatype. - * - * @return String datatype - */ - public String getName() - { - return "HEC"; - } - - /** - * Returns the displayed name of datatype - * - * @return String screen name - */ - public String getNameScreenName() - { - return "HEC"; - } - - /** - * Returns the type of calorimeter (ECAL/HCAL) for a hit. - * - * @param index int hit index - * @return String calorimeter type - */ - public String getCalorimeterType(int index) - { - return "HCAL"; - } - - /** - * Returns the histograms for this projection. - * - * @param projection AProjection2D current projection - * @return ACoord[] polygons representing histograms - */ - protected ACoord[] getUserHistograms(AProjection2D projection) - { - ACoord[] data = ACoord.NO_HISTOGRAMS; - int mode = parameterStore.get("YX", "Mode").getI(); - if (projection instanceof AProjectionRZ) - data = getRZHistograms(); - else if (projection instanceof AProjectionFZ) - data = getFZHistograms(); - else if ((projection instanceof AProjectionYX) && (mode == AProjectionYX.MODE_HEC_1 || - mode == AProjectionYX.MODE_HEC_2 || mode == AProjectionYX.MODE_HEC_3 || - mode == AProjectionYX.MODE_HEC_4 || mode == AProjectionYX.MODE_HEC_SUMMED)) - data = getYXHistograms(); - return projection.nonLinearTransform(data); - } - - - -// /** -// * Call util class which plots cell pulse shapes provided that -// * all real pulse shapes data is available -// * Functions calculates values of real pulse shape calculated in the method -// * getPhysicsPulseShape(). -// * This method is called from pick interaction. -// * -// * @param index int -// */ - /*public void plotPulseShapes(int index) - { - - if(pulseShapesDataAvailable) - { - String title = getPulseTitleString(index); - - int[][] adcCountsLocal = new int[][] { adcCounts[index] }; - - if(super.checkADCCountsAvailability(adcCountsLocal)) - { - // adc counts are available - logger.debug(CALORIMETER_NAME + " adc counts (digits) are " + - "available for pulse shapes plots for this cell."); - } - else - { - AOutput.append("\nADC counts are not available for this cell, " + - "can't plot pulse shapes.", ALogPane.WARNING); - return; - } - - - float[] time = ACalorimeterRPSPLT.HEC_TIME; // lookup tables - float[] amplitude = ACalorimeterRPSPLT.HEC_AMPLITUDE; // lookup tables - - // step - starting from 1, need to get step numbers within - // number of ADC samples (adcCounts[0].length) - double step = (adcCounts[0].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - double[][] realPulse = new double[1][NUMBER_OF_LOOKUP_VALUES]; // 1 channel - double d = 1.0; - // if adc2Mev != -1 -> use value from event file, otherwise predefined value - // see comment at the getADC2MevFactorPredefined() method - // factor variable is used as a flag whether or not to plot pulse shape, - // if is -1 (adc2Mev not available), then want to see only the adc counts - // and don't calculate the pulse shapes - // getADC2MevFactorPredefined(index) is no longer in use, see comment at it - float factor = adc2Mev[index]; - - double energyLocal = energy[index] * 1000.0 / factor; - try - { - if(factor != -1) - { - for(int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) - { - d += step; - realPulse[0][i] = super.getPhysicsPulseShape(d, cellTime[index], - cellPedestal[index], energyLocal, - amplitude, time, NUMBER_OF_LOOKUP_VALUES); - } - } - } - catch(AAtlantisException aaex) - { - AOutput.append(aaex.getMessage(), ALogPane.WARNING); - return; - } - - if(factor != -1) - { - logger.debug("adc2Mev factor available, plotting full plot."); - APulseShapePlot.plotRealPulseShapes(adcCountsLocal, realPulse, - step, null, title); - } - else - { - logger.debug("adc2Mev factor not available, plotting just adc counts."); - APulseShapePlot.plotADCCounts(adcCountsLocal, title, null); - } - - } // if(pulseShapesDataAvailable) - else - { - return; - } - - }*/ // plotPulseShapes() -------------------------------------------------- - - @Override - protected int[][] getADCCounts(int index) { - - if (pulseShapesDataAvailable) { - return new int[][]{adcCounts[index]}; - } else { - return null; - } - } - - /** - * Calculate local time for pulse shape plots - */ - protected double getLocalTime(double xTime, double cellTime, int numSamplings) { - int nominalPeakSample = (int)(numSamplings / 2.); - return ((xTime - nominalPeakSample + 3) * 25.0) - cellTime; - } - - @Override - protected double[][] getPulseShape(int index) { - - float[] time = ACalorimeterRPSPLT.HEC_TIME; // lookup tables - float[] amplitude = ACalorimeterRPSPLT.HEC_AMPLITUDE; // lookup tables - - // step - starting from 1, need to get step numbers within - // number of ADC samples (adcCounts[0].length) - double step = getPulseStep(index); - double[][] realPulse = new double[1][NUMBER_OF_LOOKUP_VALUES]; // 1 channel - double d = 1.0; - // if adc2Mev != -1 -> use value from event file, otherwise predefined value - // see comment at the getADC2MevFactorPredefined() method - // factor variable is used as a flag whether or not to plot pulse shape, - // if is -1 (adc2Mev not available), then want to see only the adc counts - // and don't calculate the pulse shapes - // getADC2MevFactorPredefined(index) is no longer in use, see comment at it - float factor = adc2Mev[index]; - - double energyLocal = energy[index] * 1000.0 / factor; - try { - if (factor != -1) { - for (int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) { - d += step; - double localTime = getLocalTime(d, cellTime[index], this.numSamplings); - realPulse[0][i] = super.getPhysicsPulseShape(localTime, - cellPedestal[index], energyLocal, - amplitude, time, NUMBER_OF_LOOKUP_VALUES); - } - } - } catch (AAtlantisException aaex) { - AOutput.append(aaex.getMessage(), ALogInterface.WARNING); - return null; - } - - if (factor != -1) { - logger.debug("adc2Mev factor available, plotting full plot."); - return realPulse; - } else { - logger.debug("adc2Mev factor not available, plotting just adc counts."); - return null; - } - } - - @Override - protected double getPulseStep(int index) { - return (adcCounts[0].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AHelix.java b/graphics/AtlantisJava/src/atlantis/data/AHelix.java deleted file mode 100644 index 98e397b2275ee38e5be6ffcb0f4b946e1afc6a3a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AHelix.java +++ /dev/null @@ -1,854 +0,0 @@ -package atlantis.data; - -import atlantis.globals.AGlobals; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjectionVP; -import atlantis.utils.A3Vector; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; - -/** - * Base class for tracks with perigee parameters. Includes code for drawing - * helices as a function of the helix angle alpha. - * - * @author Eric Jansen - */ -public class AHelix { - - private final static ALogger logger = ALogger.getLogger(AHelix.class); - - // Constants - public static final double MIN_RADIUS_PHI = 2.; - public static final double TRACKER_RADIUS = 108.; - public static final double TRACKER_LENGTH = 270.; - public static final double SOLENOID_RADIUS = 125.; - public static final double SOLENOID_LENGTH = 280.; - protected static final int NUM_HELIX_POINTS = 30; - - // Parameters from the config/GUI we need - private static double curvature = -1; - - // Vertex w.r.t. which we define the perigee parameters - private float xVtx, yVtx, zVtx; - - // Perigee parameters for the track - private float d0, phi0, z0, cotanTheta, pt; - - // Additional space points outside the solenoid (muon tracks) - private float extraX[] = null; - private float extraY[] = null; - private float extraZ[] = null; - - // Covariance matrix - private double[][] cov = null; - - // Center point, radius and correction factors for the helix - private double xC, yC, R, dr1, dr2, dz1; - - // Sign of alpha, determines direction of curvature of the helix - private float S; - - // Alpha value where the helix crosses MIN_RADIUS_PHI. This is the starting - // value for all the phi-based projections, since phi is undefined at rho=0. - private double alphaMin = 0.; - - // Alpha value at which the helix meets its last space point or where it - // exits the tracker if no space points were defined. - private double alphaMax = Math.PI; - - // Alpha value at which the helix leaves the solenoidal field. When helices - // are drawn beyond this value, for example when extrapolating to the - // calorimeters, they switch from a helix to a straight line here. - private double alphaSolenoid = Math.PI; - - private static final APar parameterStore = APar.instance(); - - AHelix(AOldHelix helix) { - this((float)helix.d0, (float)helix.z0, (float)helix.phi0, (float)helix.tL, (float)helix.pT); - } - - AHelix(float rhoVertex, float phiVertex, float zVertex, - float pTTrack, float phiTrack, float etaTrack, int charge, float rhoEndVertex) { - - this(rhoVertex, phiVertex, zVertex, pTTrack, phiTrack, etaTrack, charge); - this.alphaMax = getAlphaExtrapolated(rhoEndVertex, TRACKER_LENGTH); - } - - AHelix(float rhoVertex, float phiVertex, float zVertex, - float pTTrack, float phiTrack, float eta, int charge) { - - this(0.f, 0.f, phiTrack, (float)AMath.tanLambda(eta), charge*Math.abs(pTTrack), - (float)(rhoVertex*Math.cos(phiVertex)), (float)(rhoVertex*Math.sin(phiVertex)), zVertex); - } - - AHelix(float d0, float z0, float phi0, float tL, float pT, float[][] cov) { - this(d0, z0, phi0, tL, pT); - this.setCovariance(cov); - } - - AHelix(float d0, float z0, float phi0, float cotanTheta, float pt) { - this(d0, z0, phi0, cotanTheta, pt, 0.f, 0.f, 0.f); - } - - /** - * Construct a new track from its perigee parameters. - * @param d0 transverse impact parameter - * @param z0 longitudinal impact parameter - * @param phi0 phi of the point of closest approach in degrees - * @param cotanTheta cotan(theta), angle of the track in the RZ-plane - * @param pt signed transverse momentum, sign encodes charge - * @param xVtx vertex x-coordinate - * @param yVtx vertex y-coordinate - * @param zVtx vertex z-coordinate - */ - AHelix(float d0, float z0, float phi0, float cotanTheta, float pt, - float xVtx, float yVtx, float zVtx) { - - this.xVtx = xVtx; - this.yVtx = yVtx; - this.zVtx = zVtx; - this.d0 = d0; - this.z0 = z0; - this.phi0 = (float)Math.toRadians(phi0); - this.cotanTheta = cotanTheta; // cotan(theta) = tan(lambda) - this.pt = Math.abs(pt); - this.S = -Math.signum(pt); - this.dr1 = 0; - this.dr2 = 0; - this.dz1 = 0; - - // Curvature/pT relation, magnetic field strength. - if (AHelix.curvature <= 0) { - AParameter curvatureParameter = parameterStore.get("Event", "Curvature"); - if (curvatureParameter != null) { - AHelix.curvature = curvatureParameter.getD(); - } else { - AHelix.curvature = 100/0.6; - logger.error("Curvature parameter not found," - + " defaulting to " + AHelix.curvature); - } - } - - // Radius and center point of the helix. The radius is limited to 1e6, - // which on the scale of our tracker corresponds to a straight line. - // This allows cosmics without B-field to be drawn with the same code. - this.R = Math.min(AHelix.curvature * this.pt, 1e6); - this.xC = xVtx - (this.S*this.R + this.d0) * Math.sin(this.phi0); - this.yC = yVtx + (this.S*this.R + this.d0) * Math.cos(this.phi0); - - // The alpha value from which the helix start. - this.alphaMin = 0.; - - // Calculate when this helix leaves the tracker. This is either (1) - // through the barrel or (2) through the endcap. The endcap expression - // is just the function getZ(alpha) reversed. Take the minumum of the - // two, so whatever happens first. - this.alphaMax = getAlphaCylinder(TRACKER_RADIUS, TRACKER_LENGTH); - - // Same as above, but now for the solenoid. - this.alphaSolenoid = getAlphaCylinder(SOLENOID_RADIUS, SOLENOID_LENGTH); - } - - /** - * Fit the radius of the helix to the given points. The radius is described - * by R + dr1 * alpha + dr2 * alpha^2. - * @param x array of x coordinates of points on the helix - * @param y array of y coordinates of points on the helix - * @param z array of z coordinates of points on the helix - */ - public double setPoints(float[] x, float[] y, float[] z, int numPoints) { - - this.dr1 = 0.; - this.dr2 = 0.; - this.dz1 = 0.; - - // Points outside the solenoid are taken as is and added to the end of the track - while (numPoints > 0 && (z[numPoints-1] > SOLENOID_LENGTH - || Math.hypot(x[numPoints-1], y[numPoints-1]) > SOLENOID_RADIUS)) { - - numPoints--; - } - - if (x.length > numPoints) { - extraX = new float[x.length - numPoints]; - extraY = new float[y.length - numPoints]; - extraZ = new float[z.length - numPoints]; - - for(int i=0; i<x.length - numPoints; i++) { - extraX[i] = x[numPoints+i]; - extraY[i] = y[numPoints+i]; - extraZ[i] = z[numPoints+i]; - } - } - - if (numPoints == 1) { - - // Just one point, only do a linear in/decrease of R and Z - double alpha = getAlpha(x[0], y[0]); - this.dr1 = (getRadius(x[0], y[0]) - this.R) / alpha; - this.dz1 = (z[0] - getZ(alpha)) / alpha; - - // Draw helix until this point - this.alphaMax = alpha; - - } else { - - // Several points, perform a least-squares fit using the functions - // R = R + dr1 * alpha + dr2 * alpha^2 and Z = Z + dz1 * alpha. - double a2 = 0., a3 = 0., a4 = 0.; - double dRa = 0., dRa2 = 0., dZa = 0.; - for (int i=0; i<numPoints; i++) { - double alpha = getAlpha(x[i], y[i]); - double rho = getRadius(x[i], y[i]); - - //a1 += alpha; - a2 += Math.pow(alpha, 2.); - a3 += Math.pow(alpha, 3.); - a4 += Math.pow(alpha, 4.); - dRa += (rho - this.R) * alpha; - dRa2 += (rho - this.R) * alpha * alpha; - - dZa += (z[i] - getZ(alpha)) * alpha; - - if (i == 0 || alpha > this.alphaMax) { - this.alphaMax = alpha; - } - } - - // Quadratic - this.dr1 = (dRa / a3 - dRa2 / a4) / (a2 / a3 - a3 / a4); - this.dr2 = (dRa / a2 - dRa2 / a3) / (a3 / a2 - a4 / a3); - - // Linear - this.dz1 = dZa / a2; - - } - - // Return relative correction; distance from the original position at - // the end point, divided by the length of the curve. - double change = Math.hypot(this.dr1 + this.alphaMax*this.dr2, this.dz1) / this.R; - logger.debug("Fitting changed R(maxAlpha) by " + change); - return change; - } - - /** - * Sets the covariance matrix of the track. - * @param cov new covariance matrix - */ - public final void setCovariance(float[][] cov) { - - // Covariance needs to be double[][] for the fitting classes - this.cov = new double[cov.length][cov[0].length]; - - for (int i=0; i<cov.length; i++) { - for (int j=0; j<cov[i].length; j++) { - this.cov[i][j] = cov[i][j]; - } - } - } - - /** - * Sets the covariance matrix of the track. - * @param cov new covariance matrix - */ - public final void setCovariance(double[][] cov) { - this.cov = cov; - } - - /** - * Returns the starting alpha value for the phi-based projections. - * @return alpha value - */ - public double getAlphaMin() { - return alphaMin; - } - - /** - * Returns the alpha value at the end of the helix - * @return alpha value - */ - public double getAlphaMax() { - return alphaMax; - } - - /** - * Returns the alpha value at which the track exits the solenoidal field - * @return alpha value - */ - public double getAlphaSolenoid() { - return alphaSolenoid; - } - - /** - * Calculates the alpha coordinate for a specific point. Alpha is the angle - * from the center point of the helix to the point. For the helix The angle - * should be positive and alpha=0 is the perigee. Returns negative values - * for points before the perigee point. - * @param x x coordinate of a point - * @param y y coordinate of a point - * @return alpha - */ - public double getAlpha(double x, double y) { - // Get the alpha parameter for this point, in the range 0-2*pi - double alpha = AMath.nearestPhiRadians(this.S * (Math.atan2((y - this.yC), (x - this.xC)) - this.phi0) + Math.PI/2.); - - // When dealing with a real space point, alpha can of course be slightly negative - if (alpha > 3./2. * Math.PI) alpha -= 2.*Math.PI; - - return alpha; - } - - /** - * Calculates the alpha coordinate where the helix has the given distance - * from the origin. Alpha is the angle from the center point of the helix to - * the point. The angle is always positive and alpha=0 is the perigee. - * @param rho radius with respect to the origin - * @return alpha - */ - public final double getAlphaCylinder(double rho, double z) { - - double alphaZ, alphaRho; - if (this.cotanTheta == 0) { - alphaZ = Math.PI; - } else { - alphaZ = zVtx + (Math.signum(this.cotanTheta)*z - this.z0) / (this.cotanTheta * this.R + this.dz1); - } - - // We take a circle centered around (0,0) with the requested radius - // (rho) and intersect it with the helix (circle around (xC,yC) with - // radius R. The distance between the centers of the two circles is D. - double D = Math.hypot(this.xC, this.yC); - - // By equating the intersection points in both circles we obtain the - // position of the intersection points as a distance d from (xC,yC) - // along the line from center to center. - double d = (this.R * this.R - rho * rho + D * D) / (2 * D); - - if (d >= this.R) { - // Helix is fully outside the requested radius, return 0. - alphaRho = 0; - } else if (d <= -this.R) { - // Helix is fully inside the requested radius, return pi. - alphaRho = Math.PI; - } else { - // Helix needs to be stopped when it reaches requested radius. - // Now the angle alpha is just the angle between the center-center - // line and the line from (xC,yC) to the intersection point. The - // helix is such that alpha is always taken positive, so it doesn't - // matter which of the two intersection points we take. The cosine - // of alpha is then simply the division of d by the radius of the - // circle R. This method should never return an alpha outside the - // solenoid, for the extrapolation there is getAlphaExtrapolated(). - alphaRho = Math.min(Math.acos(d / this.R), alphaSolenoid); - } - - return Math.min(alphaRho, alphaZ); - } - - /** - * Calculates the pseudo alpha coordinate and if necessary extrapolates - * beyond the curved part up to the given radius. Inside the solenoid this - * method falls back to getAlphaCylinder, so it can be used for any radius. - * The pseudo alpha coordinate is such that the distance along the curve is - * R*alpha also for the straight part. This parameterization allow the - * description of z to remain the same for any alpha. - * @param rho radius to extrapolate to - * @param z distance along the beam axis to extrapolate to - * @return alpha - */ - public final double getAlphaExtrapolated(double rho, double z) { - - // Check if the track actually makes it to the solenoid. - if (this.alphaSolenoid >= Math.PI) { - // If not, return the max alpha inside the tracker instead. - return getAlphaCylinder(rho, z); - } - - // Calculate the coordinates (xL,yL) of the last point inside the solenoid. - double xL = getX(this.alphaSolenoid); - double yL = getY(this.alphaSolenoid); - - // Check if we are actually outside the solenoid at this rho value - if (rho < Math.hypot(xL, yL)) { - // If not, return the normal alpha instead. For tracks that exit the - // solenoid through the endcap this is also fine, z(alpha) is the - // same inside and outside the field. So the max value returned is - // valid either way. - return getAlphaCylinder(rho, z); - } - - double alphaZ, alphaRho; - if (this.cotanTheta == 0) { - alphaZ = Math.PI; - } else { - alphaZ = zVtx + (Math.signum(this.cotanTheta)*z - this.z0) / (this.cotanTheta * this.R + this.dz1); - } - - // Calculate the direction of the track at the last point inside the solenoid, - // this is the direction in which it will be extrapolated through the calorimeters. - double dx = Math.cos(this.phi0 + this.S * this.alphaSolenoid); - double dy = Math.sin(this.phi0 + this.S * this.alphaSolenoid); - - // Now we have for a point on the extrapolated track - // x(alpha) = xL + dx * (alpha-this.alphaCurve) - // y(alpha) = yL + dy * (alpha-this.alphaCurve) - // Setting x^2+y^2 = rho^2 and solving for alpha then gives: - double D = rho*rho - (xL*dy - yL*dx)*(xL*dy - yL*dx); - if (D > 0) { - alphaRho = this.alphaSolenoid - (xL*dx + yL*dy)/this.R + Math.sqrt(D)/this.R; - } else { - return Math.PI; - } - - return Math.min(alphaRho, alphaZ); - } - - /** - * Calculate the distance between a point and the center of the helix. - * @param x x coordinate of the point - * @param y y coordinate of the point - * @return distance between (x,y) and the center of the helix - */ - private double getRadius(double x, double y) { - return Math.hypot(x - xC, y - yC); - } - - /** - * Returns the x coordinate for a point on the helix parameterized by alpha. - * @param alpha helix angular parameter - * @return x coordinate - */ - public double getX(double alpha) { - // Correct the radius using the values obtained from the fit and calculate x - double localR = R + dr1 * alpha + dr2 * alpha * alpha; - if (alpha <= alphaSolenoid) { - return xC - S * localR * Math.cos(phi0 + S * alpha + Math.PI/2.); - } else { - double xL = xC - S * localR * Math.cos(phi0 + S * alphaSolenoid + Math.PI/2.); - return xL + R*Math.cos(phi0 + this.S * alphaSolenoid) * (alpha-alphaSolenoid); - } - } - - /** - * Returns the y coordinate for a point on the helix parameterized by alpha. - * @param alpha helix angular parameter - * @return y coordinate - */ - public double getY(double alpha) { - // Correct the radius using the values obtained from the fit and calculate y - double localR = R + dr1 * alpha + dr2 * alpha * alpha; - if (alpha <= alphaSolenoid) { - return yC - S * localR * Math.sin(phi0 + S * alpha + Math.PI/2.); - } else { - double yL = yC - this.S * localR * Math.sin(phi0 + this.S * alphaSolenoid + Math.PI/2.); - return yL + R*Math.sin(phi0 + S * alphaSolenoid) * (alpha-alphaSolenoid); - } - } - - /** - * Returns the rho coordinate for a point on the helix parameterized by alpha. - * @param alpha helix angular parameter - * @return rho coordinate - */ - public double getRho(double alpha) { - return Math.hypot(getX(alpha), getY(alpha)); - } - - public double getRhoVtx() { - return Math.hypot(xVtx, yVtx); - } - - /** - * Returns the z coordinate for a point on the helix parameterized by alpha. - * @param alpha helix angular parameter - * @return z coordinate - */ - public double getZ(double alpha) { - // For z we don't use the corrected R, since it was calculated against - // the uncorrected one. - return z0 + cotanTheta * R * alpha + dz1 * alpha; - } - - public double getZVtx() { - return zVtx; - } - - /** - * Returns the phi coordinate of a point on the helix parameterized by alpha. - * @param alpha helix angular parameter - * @param useVertex calculate phi w.r.t. the primary vertex - * @return phi coordinate - */ - public double getPhi(double alpha, boolean useVertex) { - if (useVertex) { - return AParameterUtilities.phi(getX(alpha), getY(alpha)); - } else { - return Math.toDegrees(Math.atan2(getY(alpha), getX(alpha))); - } - } - - /** - * Return eta coordinate for a point on the helix parameterized by alpha. - * @param alpha helix angular parameter - * @param vsign side (-1/+1) of the split track in the v-plot, 0 for true eta - * @return eta coordinate - */ - public double getEta(double alpha, int vsign) { - double rho = getRho(alpha); - double z = getZ(alpha); - double deta = Math.abs(AProjectionVP.getDeltaEta(rho, z)); - - return AParameterUtilities.eta(z, rho) + vsign*deta; - } - - /** - * Returns an array representing the x coordinates of the helix between - * alpha1 and alpha2. - * @param alpha1 start alpha - * @param alpha2 end alpha - * @return x coordinates - */ - public double[] getX(double alpha1, double alpha2) { - int numPoints = NUM_HELIX_POINTS; - if (alpha2 >= alphaMax && extraX != null) { - numPoints += extraX.length; - } - double[] x = new double[numPoints]; - - double dalpha = (alpha2 - alpha1) / (NUM_HELIX_POINTS-1); - for (int i=0; i<NUM_HELIX_POINTS; i++) { - x[i] = getX(alpha1 + i*dalpha); - } - - for (int i=0; i<numPoints-NUM_HELIX_POINTS; i++) { - x[NUM_HELIX_POINTS+i] = extraX[i]; - } - - return x; - } - - /** - * Returns an array representing the y coordinates of the helix between - * alpha1 and alpha2. - * @param alpha1 start alpha - * @param alpha2 end alpha - * @return y coordinates - */ - public double[] getY(double alpha1, double alpha2) { - int numPoints = NUM_HELIX_POINTS; - if (alpha2 >= alphaMax && extraY != null) { - numPoints += extraY.length; - } - double[] y = new double[numPoints]; - - double dalpha = (alpha2 - alpha1) / (NUM_HELIX_POINTS-1); - for (int i=0; i<NUM_HELIX_POINTS; i++) { - y[i] = getY(alpha1 + i*dalpha); - } - - for (int i=0; i<numPoints-NUM_HELIX_POINTS; i++) { - y[NUM_HELIX_POINTS+i] = extraY[i]; - } - - return y; - } - - /** - * Returns an array representing the z coordinates of the helix between - * alpha1 and alpha2. - * @param alpha1 start alpha - * @param alpha2 end alpha - * @return z coordinates - */ - public double[] getZ(double alpha1, double alpha2) { - int numPoints = NUM_HELIX_POINTS; - if (alpha2 >= alphaMax && extraZ != null) { - numPoints += extraZ.length; - } - double[] z = new double[numPoints]; - - double dalpha = (alpha2 - alpha1) / (NUM_HELIX_POINTS-1); - for (int i=0; i<NUM_HELIX_POINTS; i++) { - z[i] = getZ(alpha1 + i*dalpha); - } - - for (int i=0; i<numPoints-NUM_HELIX_POINTS; i++) { - z[NUM_HELIX_POINTS+i] = extraZ[i]; - } - return z; - } - - /** - * Returns an array representing the rho coordinates of the helix between - * alpha1 and alpha2. - * @param alpha1 start alpha - * @param alpha2 end alpha - * @param signed return signed rho values for use in RZ - * @return rho coordinates - */ - public double[] getRho(double alpha1, double alpha2, boolean signed) { - int numPoints = NUM_HELIX_POINTS; - if (alpha2 >= alphaMax && extraX != null && extraY != null) { - numPoints += extraX.length; - } - double[] rho = new double[numPoints]; - - double sign = 1.; - if (signed) { - AParameter phiPar = parameterStore.get("RZ", "Phi"); - if (phiPar != null) { - double phi = getPhi((alpha1+alpha2)/2, false); - double diff = Math.toRadians(Math.abs(phi - phiPar.getD())); - if (diff > Math.PI / 2. && diff <= 3 * Math.PI / 2.) { - sign = -1.; - } - } else { - logger.error("Could not read RZ cutting plane parameter"); - } - } - - double dalpha = (alpha2 - alpha1) / (NUM_HELIX_POINTS-1); - for (int i=0; i<NUM_HELIX_POINTS; i++) { - rho[i] = sign * getRho(alpha1 + i*dalpha); - } - - for (int i=0; i<numPoints-NUM_HELIX_POINTS; i++) { - rho[NUM_HELIX_POINTS+i] = sign * Math.hypot(extraX[i], extraY[i]); - } - - return rho; - } - - /** - * Returns an array representing the phi coordinates of the helix between - * alpha1 and alpha2. - * @param alpha1 start alpha - * @param alpha2 end alpha - * @param vplot return all points twice for use in the v-plot - * @return phi coordinates - */ - public double[] getPhi(double alpha1, double alpha2, boolean vplot) { - int numPoints = NUM_HELIX_POINTS; - if (vplot) { - numPoints += NUM_HELIX_POINTS-1; - } else if (alpha2 >= alphaMax && extraX != null && extraY != null) { - numPoints += extraX.length; - } - double[] phi = new double[numPoints]; - - double dalpha = (alpha2 - alpha1) / (NUM_HELIX_POINTS-1); - for (int i=0; i<NUM_HELIX_POINTS; i++) { - phi[i] = getPhi(alpha1 + i*dalpha, true); - if (vplot) phi[numPoints-i-1] = phi[i]; - } - - if (!vplot) { - for (int i=0; i<numPoints-NUM_HELIX_POINTS; i++) { - phi[NUM_HELIX_POINTS+i] = AParameterUtilities.phi(extraX[i], extraY[i]); - } - } - - // Minimise distance from one point to the next to avoid phi wrapping - // around: use {25, 10, -5} and not {25, 10, 355}. - for (int i=1; i<phi.length; i++) { - phi[i] = AMath.nearestPhiDegrees(phi[i], phi[i-1]); - } - - return phi; - } - - /** - * Returns an array representing the eta coordinates of the helix between - * alpha1 and alpha2. - * @param alpha1 start alpha - * @param alpha2 end alpha - * @return eta coordinates - */ - public double[] getEta(double alpha1, double alpha2) { - double[] eta = new double[2*NUM_HELIX_POINTS - 1]; - double dalpha = (alpha2 - alpha1) / (NUM_HELIX_POINTS-1); - - for (int i=0; i<NUM_HELIX_POINTS; i++) { - double alpha = alpha1 + i*dalpha; - eta[i] = getEta(alpha, -1); - eta[2*NUM_HELIX_POINTS-2-i] = getEta(alpha, +1); - } - - return eta; - } - - /** - * Track momentum at perigee, x component - * @return px - */ - public double pX() { - return this.pt * Math.cos(this.phi0); - } - - /** - * Track momentum at perigee, y component - * @return py - */ - public double pY() { - return this.pt * Math.sin(this.phi0); - } - - /** - * Track momentum at perigee, z component - * @return pz - */ - public double pZ() { - return this.pt * this.cotanTheta; - } - - /** - * Signed transverse momentum at perigee - * @return pt - */ - public double pT() { - return -this.S * this.pt; - } - - public A3Vector p() { - return new A3Vector(pX(), pY(), pZ()); - } - - /** - * Pseudorapidity of track from perigee - * @return eta - */ - public double eta() { - return -Math.log(Math.hypot(cotanTheta, 1.) - cotanTheta); - } - - /** - * Phi of perigee - * @return phi0 - */ - public double phi0() { - return (float)Math.toDegrees(phi0); - } - - /** - * Returns the parameters of this helix in the "old" format. This is still - * used by the AFit class to fit secondary vertices in Atlantis. - * @return helix parameters - */ - public double[] getPar() { // Used by unit tests and AVertexFit - return new double[] { - d0, - z0, - phi0 < 0 ? phi0 + 2*Math.PI : phi0, - cotanTheta, - -S/pt - }; - } - - /** - * Returns the covariance matrix of this helix as a an array of double. - * @return covariance matrix - */ - public double[][] getCovariance() { - return cov; - } - - public double getRhoEndVertex() { - return getRho(alphaMax); - } - - public void setPhiStartByXYPoint(double Vx, double Vy) { - alphaMin = this.getAlpha(Vx, Vy); - } - - public float d0() { - return d0; - } - - public float z0() { - return z0; - } - - public float cotanTheta() { - return cotanTheta; - } - - public double getXc() { - return xC; - } - - public double getYc() { - return yC; - } - - /** - * Helper method for toString, formats a single line of information. - * @param name variable name - * @param value variable value - * @param uncertainty variable uncertainty - * @param units variable units - * @return formatted string - */ - private String formatInfo(String name, double value, double uncertainty, String units) { - return formatInfo(name, String.format("%.3f", value), - uncertainty > 0 ? String.format("%.3f", uncertainty) : null, units); - } - - /** - * Helper method for toString, formats a single line of information. - * @param name variable name - * @param value variable value - * @param uncertainty variable uncertainty - * @param units variable units - * @return formatted string - */ - private String formatInfo(String name, String value, String uncertainty, String units) { - String output = "\n "; - output += name + " = " + value; - if (uncertainty != null) - output += " " + AMath.PLUSMINUS + " " + uncertainty; - if (units != null) - output += " " + units; - - return output; - } - - @Override - public String toString() { - String output = ""; - - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if (simpleOutput > 0) { - if (simpleOutput == 1 || simpleOutput == 3) { - output += formatInfo("PT", pt, 0., "GeV"); - output += formatInfo(AMath.ETA, eta(), 0., null); - output += formatInfo(AMath.PHI, phi0(), 0., AMath.DEGREES); - } - if (simpleOutput == 2 || simpleOutput == 3) { - output += formatInfo("Px", pt*Math.cos(phi0), 0., "GeV"); - output += formatInfo("Py", pt*Math.sin(phi0), 0., "GeV"); - output += formatInfo("Pz", pt*Math.sinh(eta()), 0., "GeV"); - output += formatInfo("Charge", S < 0 ? "+1" : "-1", null, null); - } - - return output; - - } else { - - output += formatInfo("d0", d0, cov != null ? Math.sqrt(cov[0][0]) : 0., "cm"); - output += formatInfo("z0", z0, cov != null ? Math.sqrt(cov[1][1]) : 0., "cm"); - - double pv[] = AParameterUtilities.getPrimaryVertex(); - output += formatInfo("|z0-zVtx|", Math.abs(z0-pv[2]), 0., "cm"); - output += formatInfo("phi0", phi0(), cov != null ? Math.toDegrees(Math.sqrt(cov[2][2])) : 0., AMath.DEGREES); - output += formatInfo(" ", phi0, cov != null ? Math.sqrt(cov[2][2]) : 0., "rad"); - output += formatInfo("cotan(theta)", cotanTheta, cov != null ? Math.sqrt(cov[3][3]) : 0., null); - output += formatInfo(AMath.ETA, eta(), cov != null ? Math.sqrt(cov[3][3] / (cotanTheta * cotanTheta + 1.0)) : 0., null); - output += formatInfo("pT", pT(), 0., "GeV"); - output += formatInfo("p", AMath.getPFromPttL(pt, cotanTheta), 0., "GeV"); - - return output; - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AHelixAODData.java b/graphics/AtlantisJava/src/atlantis/data/AHelixAODData.java deleted file mode 100755 index 0c3934033e960b39a77fae73f635639ba0d443fe..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AHelixAODData.java +++ /dev/null @@ -1,178 +0,0 @@ -package atlantis.data; - -import atlantis.canvas.AWindow; -import atlantis.event.AEvent; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionVP; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -public abstract class AHelixAODData extends AAODData -{ - protected AHelix[] h = null; - - AHelixAODData(AHashMap p, AEvent e) - { - super(p,e); - h = new AHelix[numData]; - float[] d0 = new float[numData]; - float[] z0 = new float[numData]; - float[] tl = new float[numData]; - for (int i = 0; i < numData; i++) - { - d0[i] = 0.0f; - z0[i] = 0.0f; - tl[i] = (float) AMath.tanLambda((double)eta[i]); - h[i] = new AHelix(d0[i], z0[i], (float) Math.toDegrees(phi[i]), tl[i], pT[i]); - } - } - - private void drawHelix(AWindow window, AGraphics ag, AProjection2D projection) - { - int drawnAs = parameterStore.get("InDetTrack", "DrawnAs").getI(); - if (drawnAs == ATrackData.DRAW_NEWHELIX) { - - boolean showS3D = parameterStore.get("Data", "S3D").getStatus(); - AParameter shortV = parameterStore.get("VP", "ShortV"); - - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - index[i] = j; - - double alphaMin = h[j].getAlphaExtrapolated(projection.getMinRho(), AHelix.TRACKER_LENGTH); - double alphaMax = h[j].getAlphaExtrapolated(AProjectionVP.getRhoVPlot(), AHelix.TRACKER_LENGTH); - if (shortV.getStatus() && !showS3D) { - alphaMin = alphaMax - shortV.getD() * (alphaMax - alphaMin); - } - - hv[0][i] = h[j].getEta(alphaMin, alphaMax); - hv[1][i] = h[j].getPhi(alphaMin, alphaMax, true); - } - - ag.draw(window.calculateDisplay(new ACoord(hv, index, this, ACoord.POLYLINES))); - - } else { - // borrow the implementation in for tracks - // phi wrap around is done in user coordinates, so we convert to user coordinates, - // do the phi wrap around and convert back to display coordinates - ag.draw(window.calculateDisplay(window.calculateUser( - getVPDisplayHelices(window, projection)).includePhiWrapAround(projection.getName()) - )); - } - } - - // give back Drawable helices - private ADHelix[] getHelices() - { - makeDrawList(); - ADHelix[] tempList = new ADHelix[numDraw]; - - for (int i = 0; i < numDraw; i++) - if (h != null && h[listdl[i]] != null) - { - tempList[i] = new ADHelix(h[listdl[i]]); - if (tempList[i].getAStart() == tempList[i].getAEnd()) - { - tempList[i] = null; - } - } - else - tempList[i] = null; - return tempList; - } - - private ACoord getVPDisplayHelices(AWindow window, AProjection2D projection) - { - boolean drawApex = parameterStore.get("VP", "DrawApex").getStatus(); - ADHelix[] dhelix = getHelices(); - int size = 2 * dhelix.length; - if (drawApex) - size = 3 * dhelix.length; - double[][][] hv = new double[2][size][0]; - int[] index = new int[size]; - int[] indexIn = getDrawList(); - int num = 0; - - for (int j = 0; j < dhelix.length; ++j) - if (dhelix[j] != null) - { - double s1 = dhelix[j].getAStart(); - double s2 = 179.; - - s1 = dhelix[j].intersectWithRadialCylinder(projection.getMinRho(), s1, s2); - double sEnd = dhelix[j].intersectWithCylinder(true, AProjectionVP.getRhoVPlot(), true, AProjectionVP.getZVPlot()); - - s2 = Math.max(Math.min(s2, sEnd), s1); - // if the whole helix is to be drawn (which are unusual - // helices, shorten it a little to avoid wraparound problems - if (s1 == 0. && s2 == 180.) - s2 = 179.; - if (parameterStore.get("VP", "ShortV").getStatus() && !parameterStore.get("Data", "S3D").getStatus()) - s1 = s2 - parameterStore.get("VP", "ShortV").getD() * (s2 - s1); - if (s2 > s1) - { - int signMin = -1; - int signMax = 1; - double h = 0; - double v = 0; - for (int sign = signMin; sign <= signMax; sign += 2) - { - // ugly must change structure at some point - AProjectionVP.sign = sign; - ACoord pointsOnHelix = dhelix[j].drawHelix(window, projection, s1, s2); - hv[0][num] = pointsOnHelix.hv[0][0]; - hv[1][num] = pointsOnHelix.hv[1][0]; - index[num] = indexIn[j]; - h = hv[0][num][hv[0][num].length - 1]; - v = hv[1][num][hv[0][num].length - 1]; - num++; - } - if (drawApex) - { - int a = 3; - int b = 7; - hv[0][num] = new double[] { h - a, h + a, h, h, h - a, h + a }; - hv[1][num] = new double[] { v - b, v - b, v - b, v + b, v + b, v + b }; - index[num] = indexIn[j]; - num++; - } - } - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - } - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if(projection instanceof AProjectionVP) - { - // since no d0 and z0 data is provided for AOD Electron and Muon - // from event file, they are set to 0 manually, which is not - // compatible with the primary vertex calculated in Atlantis, and - // it will cause a wide and bizarre shape of 'v' drawn in V-Plot. - // So the temparary solution is to set primary vertex to (0,0,0) - // before drawing AOD Electron and Muon in V-Plot, and then restore - // their values after. - double[] primaryVtx=event.getPrimaryVertex(); - parameterStore.get("Event", "XVtx").setD(0.0); - parameterStore.get("Event", "YVtx").setD(0.0); - parameterStore.get("Event", "ZVtx").setD(0.0); - // super.draw(window, ag, projection); - drawHelix(window, ag, projection); - parameterStore.get("Event", "XVtx").setD(primaryVtx[0]); - parameterStore.get("Event", "YVtx").setD(primaryVtx[1]); - parameterStore.get("Event", "ZVtx").setD(primaryVtx[2]); - } - else - { - super.draw(window, ag, projection); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AHistogram.java b/graphics/AtlantisJava/src/atlantis/data/AHistogram.java deleted file mode 100755 index 082b97de978d590dc2c6f5e47bbc7f64def64473..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AHistogram.java +++ /dev/null @@ -1,422 +0,0 @@ -package atlantis.data; - -import atlantis.event.AData; -import atlantis.graphics.ACoord; -import atlantis.utils.AHashMap; -import atlantis.utils.ALogger; -import atlantis.utils.AVector; - -/** - * Used to create, fill, and draw the calorimeter histograms. - */ -public class AHistogram extends AData -{ - private static ALogger logger = ALogger.getLogger(AHistogram.class); - - public static final int UP = 0; - public static final int DOWN = 1; - - public static final int HORIZONTAL = 0; - public static final int VERTICAL = 1; - - public final static int RIGHT = 0; - public final static int LEFT = 1; - - private float leftLimit; - private float rightLimit; - private float gran; - private float granSafety; - private float[] towers; - - private double eta0, z, r; - private double factor; - private AData detector; - - - AHistogram(double leftLimit, double rightLimit, double gran, double factor, AData detector) - { - super(new AHashMap(1).put("numData", 0),detector.getEvent()); - - this.leftLimit = (float) leftLimit; - this.rightLimit = (float) rightLimit; - this.gran = (float) gran; - this.factor = factor; - this.detector = detector; - granSafety = (float) (this.gran * 0.1); - towers = new float[(int) Math.abs(Math.round((rightLimit - leftLimit) / gran))]; - numData = towers.length; - } - - public float getGranularity() - { - return gran; - } - - public int getTowersCount() - { - return towers.length; - } - - public float[] getTowers() - { - return towers; - } - - public void fill(double v1, double v2, double q) - { - int t1 = (int) ((v1 + granSafety - leftLimit) / gran); - int t2 = (int) ((v2 - granSafety - leftLimit) / gran); - int i = -999; - - if (Math.min(t1, t2) < 0 || Math.max(t1, t2) >= towers.length) - { - logger.error("Histogram binning problem " + t1 + " " + t2 + " " + towers.length + " " + v1 + " " + v2); - return; - } - - if (t1 == t2) - towers[t1] += q; - else - for (i = t1; i <= t2; i++) - towers[i] += q / (t2 - t1 + 1); - } - - public void setGranularity(double newGran) - { - AHistogram newHist = new AHistogram(leftLimit, rightLimit, newGran, factor, detector); - - for (int i = 0; i < towers.length; i++) - newHist.fill(leftLimit + i * gran, leftLimit + (i + 1) * gran, towers[i]); - gran = (float) newGran; - towers = newHist.towers; - } - - public void add(AHistogram h) - { - float min = Math.min(leftLimit, h.leftLimit); - float max = Math.max(rightLimit, h.rightLimit); - - AHistogram sum = new AHistogram(min, max, gran, factor, detector); - - // first I add this histogram - for (int i = 0; i < towers.length; i++) - sum.fill(leftLimit + i * gran, leftLimit + (i + 1) * gran, towers[i]); - - // and the "h" histogram - for (int i = 0; i < h.towers.length; i++) - sum.fill(h.leftLimit + i * h.gran, h.leftLimit + (i + 1) * h.gran, h.towers[i]); - - // copy the sum histogram parameters into old ones - towers = sum.towers; - leftLimit = min; - rightLimit = max; - } - - public AHistogram getRegion(double v1, double v2) - { - AHistogram hRegion = new AHistogram(v1, v2, gran, factor, detector); - - int n1 = (int) Math.round((v1 - leftLimit) / gran); - int n2 = (int) Math.round((v2 - leftLimit) / gran); - - for (int i = n1; i < n2; i++) - hRegion.fill(v1 + (i - n1) * gran, v1 + (i - n1 + 1) * gran, towers[i]); - - return hRegion; - } - - private int getCode() - { - int c1, c2; - - if (leftLimit < -eta0) - c1 = 1; - else if (leftLimit > +eta0) - c1 = 3; - else - c1 = 2; - - if (rightLimit < -eta0) - c2 = 1; - else if (rightLimit > +eta0) - c2 = 3; - else - c2 = 2; - - return c1 * c2; - } - - public ACoord[] getRZUser(double z1, double r1, int upORdown) - { - this.z = z1; - this.r = r1; - double expEta0, k = z / r; - int N; - - eta0 = Math.abs(Math.log(k + Math.sqrt(k * k + 1))); - - switch (getCode()) - { - case 1: - return new ACoord[] { getRZVerticalUser(z, upORdown) }; - - case 4: - return new ACoord[] { getRZHorizontalUser(r, upORdown) }; - - case 9: - return new ACoord[] { getRZVerticalUser(z, upORdown) }; - - case 2: - N = (int) Math.abs(Math.round((eta0 - leftLimit) / gran)); - eta0 = leftLimit + N * gran; - expEta0 = Math.exp(eta0); - this.r = 2 * this.z / (expEta0 - 1 / expEta0); - - return new ACoord[] { getRegion(leftLimit, -eta0).getRZVerticalUser(z, upORdown), getRegion(-eta0, rightLimit).getRZHorizontalUser(r, upORdown) }; - - case 6: - N = (int) Math.abs(Math.round((eta0 - leftLimit) / gran)); - eta0 = leftLimit + N * gran; - expEta0 = Math.exp(eta0); - this.r = 2 * this.z / (expEta0 - 1 / expEta0); - - return new ACoord[] { getRegion(leftLimit, +eta0).getRZHorizontalUser(r, upORdown), getRegion(+eta0, rightLimit).getRZVerticalUser(z, upORdown) }; - - case 3: - // FIXME -- round() replaced by floor() here to make sure - // histograms do not end up inside the calorimeter outline. - // They should be right at the edge regardless of the binning - // though. This should be changed. -- EJ - N = (int) Math.abs(Math.floor((eta0 - leftLimit) / gran)); - eta0 = leftLimit + N * gran; - expEta0 = Math.exp(eta0); - this.r = 2 * this.z / (expEta0 - 1 / expEta0); - - return new ACoord[] { getRegion(leftLimit, -eta0).getRZVerticalUser(z, upORdown), getRegion(-eta0, +eta0).getRZHorizontalUser(r, upORdown), getRegion(+eta0, rightLimit).getRZVerticalUser(z, upORdown) }; - - default: - return null; - } - } - - public ACoord getRZHorizontalUser(double r, int place) - { - double[][][] hv = new double[2][towers.length][4]; - int[] index = new int[towers.length]; - double eta, exp1, exp2, zSign, rSign; - - for (int i = 0; i < towers.length; i++) - { - exp1 = Math.exp(leftLimit + i * gran); - exp2 = Math.exp(leftLimit + (i + 1) * gran); - rSign = (int) Math.pow(-1, place); - - eta = leftLimit + (i + 0.5) * gran; - if (eta != 0) - zSign = eta / Math.abs(eta); - else - zSign = 1; - - hv[0][i][0] = zSign * Math.abs(r * (exp1 - 1 / exp1) / 2); - hv[1][i][0] = rSign * r; - - hv[0][i][1] = zSign * Math.abs(r * (exp2 - 1 / exp2) / 2); - hv[1][i][1] = rSign * r; - - hv[0][i][2] = 0; - hv[1][i][2] = 0; - - index[i] = i; - } - - ACoord c = new ACoord(hv, index); - - c.source = this; - return c; - } - - public ACoord getRZVerticalUser(double z, int place) - { - double[][][] hv = new double[2][towers.length][4]; - int[] index = new int[towers.length]; - double exp1, exp2, zSign, rSign; - - for (int i = 0; i < towers.length; i++) - { - exp1 = Math.exp(leftLimit + i * gran); - exp2 = Math.exp(leftLimit + (i + 1) * gran); - rSign = (int) Math.pow(-1, place); - - if ((leftLimit > 0) && (rightLimit > 0)) - zSign = +1; - else - zSign = -1; - - hv[0][i][0] = zSign * z; - hv[1][i][0] = rSign * Math.abs(2 * z / (exp2 - 1 / exp2)); - - hv[0][i][1] = zSign * z; - hv[1][i][1] = rSign * Math.abs(2 * z / (exp1 - 1 / exp1)); - - hv[0][i][2] = 0; - hv[1][i][2] = 0; - - index[i] = i; - } - - ACoord c = new ACoord(hv, index); - - c.source = this; - return c; - } - - protected ACoord getYXUser(double r) - { - int n = towers.length; - double[][][] hv = new double[2][n][4]; - int[] index = new int[n]; - - for (int i = 0; i < n; i++) - { - double phi1 = leftLimit + i * gran; - double phi2 = leftLimit + (i + 1) * gran; - - // first point - hv[0][i][0] = r * Math.cos(phi1); - hv[1][i][0] = r * Math.sin(phi1); - - // second point - hv[1][i][1] = r * Math.sin(phi2); - hv[0][i][1] = r * Math.cos(phi2); - - // third point (the center) - hv[0][i][2] = 0; - hv[1][i][2] = 0; - - index[i] = i; - } - - ACoord c = new ACoord(hv, index); - - c.source = this; - return c; - } - - public ACoord completeTowers(ACoord c) - { - AVector u = new AVector(0, 0); - - for (int i = 0; i < c.hv[0].length; i++) - { - double x0 = (c.hv[0][i][0] + c.hv[0][i][1]) / 2; - double y0 = (c.hv[1][i][0] + c.hv[1][i][1]) / 2; - double f = factor * towers[c.index[i]]; - - u.set(x0 - c.hv[0][i][2], y0 - c.hv[1][i][2]).makeUnitary().scale(f); - - c.hv[0][i][2] = c.hv[0][i][1] + u.dx; - c.hv[1][i][2] = c.hv[1][i][1] + u.dy; - - c.hv[0][i][3] = c.hv[0][i][0] + u.dx; - c.hv[1][i][3] = c.hv[1][i][0] + u.dy; - } - - return c; - } - - protected ACoord getFRUser(double r) - { - int n = towers.length; - double[][][] hv = new double[2][n][4]; - int[] index = new int[n]; - - for (int i = 0; i < n; i++) - { - hv[0][i][0] = r; - hv[1][i][0] = Math.toDegrees(leftLimit + i * gran); - - hv[0][i][1] = r; - hv[1][i][1] = Math.toDegrees(leftLimit + (i + 1) * gran); - - hv[0][i][2] = 0; - hv[1][i][2] = Math.toDegrees(leftLimit + (i + 0.5) * gran); - - index[i] = i; - } - - ACoord c = new ACoord(hv, index); - - c.source = this; - return c; - } - - protected ACoord getFZUser(double z, int alignment) - { - int n = towers.length; - double[][][] hv = new double[2][n][4]; - int[] index = new int[n]; - - double zSign = Math.pow(-1, alignment); - - for (int i = 0; i < n; i++) - { - hv[0][i][0] = zSign * z; - hv[1][i][0] = Math.toDegrees(leftLimit + i * gran); - - hv[0][i][1] = zSign * z; - hv[1][i][1] = Math.toDegrees(leftLimit + (i + 1) * gran); - - hv[0][i][2] = 0; - hv[1][i][2] = Math.toDegrees(leftLimit + (i + 0.5) * gran); - - index[i] = i; - } - - ACoord c = new ACoord(hv, index); - - c.source = this; - return c; - } - - // implementation of AData - public String getParameterGroup() - { - return null; - } - - public String getName() - { - return null; - } - - public String getNameScreenName() - { - return detector.getParameterGroup() + " Histogram Tower"; - } - - protected int internalColor() - { - return 0; - } - - protected void applyCuts() - {} - - public String getHitInfo(int index) - { - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (index: " + index + ")"); - msg.append("\n ET = "); - msg.append(String.format("%.2f",towers[index])); - msg.append(" GeV"); - - return msg.toString(); - } - - public int getIdFromIndex(int index) - { - // Histograms have only an internal ID, override this method here to avoid problems - return index; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AHistogramData.java b/graphics/AtlantisJava/src/atlantis/data/AHistogramData.java deleted file mode 100644 index c216d458266702b4f20d4590a1e8833903553d21..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AHistogramData.java +++ /dev/null @@ -1,15 +0,0 @@ -package atlantis.data; - - -import atlantis.graphics.ACoord; - - -public interface AHistogramData { - ACoord[] getYXHistograms(); - ACoord[] getRZHistograms(); - ACoord[] getFRHistograms(); - ACoord[] getFZHistograms(); - ACoord[] getXZHistograms(); - ACoord[] getYZHistograms(); - ACoord[] getVPHistograms(); -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AHitData.java b/graphics/AtlantisJava/src/atlantis/data/AHitData.java deleted file mode 100644 index b27c824660afbb8ea174f4bff73af4d654156675..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AHitData.java +++ /dev/null @@ -1,487 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.graphics.colormap.AColorMap; -import atlantis.list.AListManager; -import atlantis.parameters.AEnumeratorParameter; -import atlantis.utils.AHashMap; -import java.util.Vector; -import atlantis.utils.ALogger; - -public abstract class AHitData extends AData -{ - private static ALogger logger = ALogger.getLogger(AHitData.class); - - protected byte[] type; - // sub should be removed at some point - protected int[] sub; - // linked list - protected int[] ll; - protected int[] llStart; - protected int[] llNum; - - // for "new Truth" (2006-08-08) implementation of barcode management - // (association to truth tracks) - protected int[] barcode = null; // old style barcode - protected int[] barcodes = null; // new style barcodes - protected int[] numBarcodes = null; // new style numBarcodes - - @Override - public final int getNumTypes(){ - return 2; - } - - private static final int NOISE = 0; - private static final int GOOD = 1; - - - - AHitData(AHashMap p, AEvent e) - { - super(p,e); - - sub = p.getUnknownIntArray("sub"); - type = new byte[numData]; - ll = new int[numData]; - llStart = new int[getNumTypes()]; - llNum = new int[getNumTypes()]; - - AAssociation assoc = null; - if (p.get("barcode") != null) - { - // old style truth (1-to-1 barcode association) - barcode = p.getUnknownIntArray("barcode"); - - assoc = new AAssociation(getFullName(), "STr", null, barcode, event); - event.getAssociationManager().add(assoc); - } - else if(p.get("barcodes") != null && p.get("numBarcodes") != null) - { - // new style truth (1-to-n barcodes, numBarcodes association) - barcodes = p.getUnknownIntArray("barcodes"); - numBarcodes = p.getUnknownIntArray("numBarcodes"); - - // getFullName() should return hit datatype name + storegate key - assoc = new AAssociation(getFullName(), "STr", numBarcodes, barcodes,event); - event.getAssociationManager().add(assoc); - } - - } // AHitData() --------------------------------------------------------- - - - - public String getHitInfo(int index) - { - StringBuilder r = new StringBuilder(); - if(this.barcode != null) - { - // old style truth association - 1 barcode associated with a hit - r.append("\n barcode = " + barcode[index]); - } - else if(this.barcodes != null && this.numBarcodes != null) - { - // new style truth association - N barcodes associated with a hit - - int[][] barcodes = event.getAssociationManager().get(getFullName(), "STr"); - if(barcodes[index] != null) - { - r.append("\n barcode(s) = "); - for(int i = 0; i < barcodes[index].length; i++) - { - r.append(barcodes[index][i] + " "); - } - } - else - { - r.append("\n no STr associated"); - } - } - - return r.toString(); - - } // getHitInfo() ------------------------------------------------------- - - - - /** - * Calculates actual association via - SiCluster for the datatype - * (SpacePoint (S3D) and TrigSpacePoint) to InDetTrack* (inner detector - * reconstructed track collection) - * @param to String - * @param via String - * @return int[][] - */ - private int[][] calculateAssociation(String to, String via) - { - String infoMsg = " association from: " + this.getName() + " to: " + - to + " via: " + via; - - logger.debug("AData.calculateAssociation()\n" + infoMsg); - - int[][] clusters = event.getAssociationManager().get(getFullName(), via); - int[][] recon = event.getAssociationManager().get(via, to); - AData source = event.get(via); - if(clusters == null || recon == null || source == null) - { - return null; - } - - int[][] ass = new int[numData][]; - - // iterate over all data items of this datatype - for(int i = 0; i < numData; ++i) - { - if(clusters[i] != null && clusters[i].length == 2) - { - // this is a SCT hit which has two clusters - int index1 = source.getIndexFromId(clusters[i][0]); - int index2 = source.getIndexFromId(clusters[i][1]); - if(index1 != -1 && index2 != -1 && - recon[index1] != null && recon[index2] != null) - { - int[] temp = new int[recon[index1].length]; - int matches = 0; - for(int k = 0; k < recon[index1].length; ++k) - { - for(int j = 0; j < recon[index2].length; ++j) - { - if(recon[index1][k] == recon[index2][j]) - { - // IndexOutOfBound protection - if(matches < recon[index1].length) - { - temp[matches] = recon[index1][k]; - matches++; - } - else - { - logger.warn("Association problem:\n" + infoMsg); - } - } - } - } - if(matches == 0) - { - ass[i] = null; - } - else if(matches == temp.length) - { - ass[i] = temp; - } - else - { - int[] dest = new int[matches]; - System.arraycopy(temp, 0, dest, 0, matches); - ass[i] = dest; - } - } - } - else if(clusters[i] != null && clusters[i].length == 1) - { - // this is pixel hit which has one cluster only (second number was - // -1 and was ignored in the datatypes (S3D, TrigS3D) constuctor - - // although this method calculates association via SiCluster - // there are no SiClusters for Pixel and this is a Pixel hit - // -> need to calculate the SpacePoint - Track association directly - // based on Track:hits (which has got id of non-existing SiCluster - // hits) and SpacePoint:cluster which also has Pixel cluster - // references (more see email on 2007-09-20 association problems ...) - // can't use above block as source (SiCluster) doesn't exists, there - // are no SiCluster in Pixel, thus source.getIndexFromId(clusters[i][0]) - // can't work ... - - // AAssociationManager.get(via, to); would return recalculated - // inverted association containing indices. - - // this returns the direct array saved in InDetTrackData() constructor - // AAssociationManager.add(new AAssociation(assocKey, "SiCluster", numHits, hits)); - int[][] directRecon = event.getAssociationManager().getAssociation(to, via).getData(); - - for(int x = 0; x < directRecon.length; x++) - { - if(directRecon[x] != null) - { - for(int y = 0; y < directRecon[x].length; y++) - { - // if the SpacePoint cluster ID is the same as id in - // Track:hits, then it's an associated hit - if(clusters[i][0] == directRecon[x][y]) - { - if(ass[i] == null) - { - // current association, x is associated track index - ass[i] = new int[] { x }; - } - else - { - // some tracks before were already associated - // copy the array and add current track index - int[] temp = new int[ass[i].length + 1]; - System.arraycopy(ass[i], 0, temp, 0, ass[i].length); - temp[ass[i].length] = x; // current association - ass[i] = new int[temp.length]; - System.arraycopy(temp, 0, ass[i], 0, temp.length); - } - - } - } // for(int y = 0; y < directRecon[x].length; y++) - } - } // loop over x (x is all track indices) - } // else - pixel cluster found - - } // for(int i = 0; i < numData; ++i) - loop over all current datatype items - - return ass; - - } // calculateAssociation() --------------------------------------------- - - - - /* - * This method uses clusters array (association with SiCluster) which - * is accessed in calculateAssociation() and creates - * TrigS3D - Track association and S3D - Track association (via SiCluster) - */ - protected void calculateAssociationViaClusters() - { - Vector<String> keys = event.getCollections().get("InDetTrack"); - int[][] recon = null; - int[][] recon2 = null; - AAssociation assoc = null; - String[] trackCollec = null; - - if(keys != null) - { - trackCollec = (String[]) keys.toArray(new String[keys.size()]); - for(int j = 0; j < trackCollec.length; j++) - { - String trackCollecFull = "InDetTrack" + trackCollec[j]; - recon = event.getAssociationManager().get(getFullName(), trackCollecFull); - recon2 = calculateAssociation(trackCollecFull, "SiCluster"); - if(recon != null && recon2 != null) - { - for(int i = 0; i< numData; i++) - { - if(recon2[i] != null) - { - // using array reference here - association array is corrected - recon[i] = recon2[i]; - } - } - assoc = event.getAssociationManager().getAssociation(getName(), trackCollecFull); - event.getAssociationManager().add(assoc.invert()); - } - } - } - - } // calculateAssociationViaClusters() --------------------------------- - - - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if (colorFunction == 0) - { - colorByConstant(); - } - else if (colorFunction == 1) - { - colorBy("STr"); - } - else if (colorFunction == 2) - { - colorBy(getReconstructedTracks()); - } - else if (colorFunction == 3) - { - colorBy(sub); - } - - return 3; - - } // internalColor() ---------------------------------------------------- - - - - protected String getSegments() - { - AEnumeratorParameter key = (AEnumeratorParameter) parameterStore.get("InDetSegment", "InDetSegmentCollections"); - - return "InDetSegment" + key.getCurrentText(); - } - - - - public void constructDefaultDrawlist() - { - // make seperate lists of noise and good hits - makeNoiseList(0, 0); - - if (!parameterStore.get("CutsATLAS", "ByList").getStatus()) - { - // put noise and/or good hits in drawlist according to HitType - // parameter - // if both are drawn noise is drawn first - makeDrawList(parameterStore.get("CutsInDet", "HitType").getI()); - - // if some hits are on a list they must be drawn last - int[][] temp = AListManager.getInstance().getColorMapping(this); - int[] index = temp[0]; - int[] ctemp = temp[1]; - if (index.length > 0) - { - int[] c = new int[numData]; - final int NONE = -999; - // color is not used at this time - for (int i = 0; i < c.length; ++i) - c[i] = NONE; - - for (int i = 0; i < index.length; ++i) - c[index[i]] = ctemp[i]; - - int[] newListdl = new int[numData]; - int num = 0; - for (int t = 0; t < getNumTypes(); t++) - { - for (int i = 0; i < numDraw; ++i) - if (t == type[listdl[i]] && c[listdl[i]] == NONE) - newListdl[num++] = listdl[i]; - for (int i = 0; i < numDraw; ++i) - if (t == type[listdl[i]] && c[listdl[i]] != NONE && c[listdl[i]] != AColorMap.INVISIBLE) - newListdl[num++] = listdl[i]; - } - listdl = newListdl; - numDraw = num; - } - } - else - { - boolean[] selected = AListManager.getInstance().getSelection(this); - numDraw = 0; - for (int t = 0; t < getNumTypes(); t++) - for (int i = 0; i < numData; ++i) - if (t == type[i] && selected[i]) - listdl[numDraw++] = i; - } - } - - - /** - * define noise and good hits type = 0 means noise - * noise hits - hits associated neither with Track not STr - * good hits - hits associated either with Track or with STr - */ - protected void setType() - { - int[][] assocSTr = event.getAssociationManager().get(getFullName(), "STr"); - int[][] assocRTr = event.getAssociationManager().get(getName(), getReconstructedTracks()); - - for (int i = 0; i < numData; i++) - { - if((assocSTr != null && assocSTr[i] != null) || - (assocRTr != null && assocRTr[i] != null)) - { - type[i] = 1; - } - else - { - type[i] = 0; - } - } - - } // setType() ---------------------------------------------------------- - - - - protected void makeNoiseList(int a, int b) - { - setType(); - - for (int i = 0; i < getNumTypes(); i++) - { - llStart[i] = -1; - llNum[i] = 0; - } - - for (int i = numData - 1; i >= 0; i--) - { - ll[i] = llStart[type[i]]; - llStart[type[i]] = i; - llNum[type[i]]++; - } - } - - private void makeDrawList(int hitType) - { - int start, end; - - numDraw = 0; - if (hitType == 0) - { - start = end = NOISE; - } - else if (hitType == 1) - { - start = end = GOOD; - } - else - { - start = NOISE; - end = GOOD; - } - - for (int i = start; i <= end; i++) - { - int n = llStart[i]; - - for (int j = 0; j < llNum[i]; j++) - { - listdl[numDraw++] = n; - n = ll[n]; - } - } - } - - - - public int[] getType(int[] dl) - { - int[] temp = new int[dl.length]; - - for (int i = 0; i < temp.length; i++) - temp[i] = type[dl[i]]; - return temp; - } - - - - /** - * cut hits if connected/unconnected to simulated tracks - */ - protected void cutSimulatedTracks() - { - int cutOption = parameterStore.get("CutsInDet", "HitsBySTr").getI(); - cutByAssociationTo("STr", getFullName(), cutOption); - } - - /** - * cut hits if connected/unconnected to reconstructed tracks - */ - protected void cutReconstructedTracks() - { - int cutOption = parameterStore.get("CutsInDet", "HitsByRTr").getI(); - cutByAssociationTo(getReconstructedTracks(), getName(), cutOption); - } - - /** - * cut hits if connected/unconnected to reconstructed segments - */ - protected void cutSegments() - { - int cutOption = parameterStore.get("CutsInDet", "HitsBySegment").getI(); - cutByAssociationTo(getSegments(), getName(), cutOption); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AInDetSegmentData.java b/graphics/AtlantisJava/src/atlantis/data/AInDetSegmentData.java deleted file mode 100755 index e7d97508d648ffba5052ae2712caca2114824bb3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AInDetSegmentData.java +++ /dev/null @@ -1,30 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.utils.AHashMap; - -/** - * - * @author Eric Jansen - */ -public class AInDetSegmentData extends ASegmentData { - - /** Creates a new instance of AInDetSegmentData */ - AInDetSegmentData(AHashMap p, AEvent e) { - super(p,e); - - event.getAssociationManager().add(new AAssociation(getFullName(), "TRT", numHits, hits,event)); - } - - public String getParameterGroup() { - return "InDetSegment"; - } - - public String getName() { - return "InDetSegment"; - } - - public String getNameScreenName() { - return "InDetSegment"; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AInDetTrackData.java b/graphics/AtlantisJava/src/atlantis/data/AInDetTrackData.java deleted file mode 100644 index 05e5bda343d26eb202e652816d406df4bb1d31ad..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AInDetTrackData.java +++ /dev/null @@ -1,164 +0,0 @@ -package atlantis.data; - -import atlantis.event.AAssociation; -import atlantis.event.AEvent; -import atlantis.event.AData; -import atlantis.globals.AGlobals; -import atlantis.utils.AHashMap; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AIdHelper; -import atlantis.utils.ALogger; - -/** - * - * @author Eric Jansen - */ - -public class AInDetTrackData extends ATrackData { - - private int[] author = null; - - protected int numBLayerHits[] = null; - protected int numPixelHits[] = null; - protected int numSCTHits[] = null; - protected int numTRTHits[] = null; - - private static ALogger logger = ALogger.getLogger(ATrackData.class); - - /** Creates a new instance of AInDetTrackData */ - AInDetTrackData(AHashMap p, AEvent e) throws AAtlantisException { - super(p,e); - - author = p.getUnsureIntArray("trackAuthor"); //Change added 17/02/2010 - - numBLayerHits = p.getUnsureIntArray("nBLayerHits"); - numPixelHits = p.getUnsureIntArray("nPixHits"); - numSCTHits = p.getUnsureIntArray("nSCTHits"); - numTRTHits = p.getUnsureIntArray("nTRTHits"); - - String assocKey = getFullName(); - if (p.get("numHits") != null) { - int[] numHits = p.getIntArray("numHits"); - int[] hits = p.getIntArray("hits"); - - // This was added into TrkJiveXML-00-01-24, July 2010. For backwards - // compatibilty, we can also fill these arrays from the association - if (numPixelHits == null && numSCTHits == null && numTRTHits == null) { - numPixelHits = new int[numData]; - numSCTHits = new int[numData]; - numTRTHits = new int[numData]; - for (int i=0, num=0; i<numData; i++) { - numPixelHits[i] = numSCTHits[i] = numTRTHits[i] = 0; - - for (int j=0; j<numHits[i]; j++, num++) { - try { - // Negative identifiers are pixels, the rest we can decode using AIdHelper - if (numHits[i] > 0 && (hits[num] < 0 || AIdHelper.subDetector(hits[num]) == 2)) { - switch(hits[num] < 0 ? 1 : AIdHelper.indetPart(hits[num])) { - case 1: - numPixelHits[i]++; - break; - case 2: - numSCTHits[i]++; - break; - case 3: - numTRTHits[i]++; - break; - } - } - } catch (AAtlantisException ex) { - logger.warn("Problem decoding hit identifier: " + ex.getMessage()); - } - } - } - } - - int[] driftSign = null; - int[] isOutlier = null; - if (p.get("driftSign") != null && p.get("isOutlier") != null) { - driftSign = p.getIntArray("driftSign"); - isOutlier = p.getIntArray("isOutlier"); - } - - event.getAssociationManager().add(new AAssociation(assocKey, "TRT", numHits, hits,event)); - if (driftSign != null) { - event.getAssociationManager().add(new AAssociation(assocKey + "Drift", "TRT", numHits, driftSign,event)); - } - if (isOutlier != null) { - event.getAssociationManager().add(new AAssociation(assocKey + "Outlier", "TRT", numHits, isOutlier,event)); - } - event.getAssociationManager().add(new AAssociation(assocKey, "SiCluster", numHits, hits,event)); - event.getAssociationManager().add(new AAssociation(assocKey, "PixelCluster", numHits, hits,event)); - - - // although these two following associations directly doesn't exist - // in the event file (e.g. Track:numHits,hits - S3D:id) because it - // is calculated over SiCluster, the association has to be - // established here and corrected later on in - // AS3D.finalizeConstruction() -> AHitData.calculateAssociationViaClusters() - event.getAssociationManager().add(new AAssociation(assocKey, "S3D", numHits, hits,event)); - event.getAssociationManager().add(new AAssociation(assocKey, "TrigS3D", numHits, hits,event)); - } - } - - public String getParameterGroup() { - return "InDetTrack"; - } - - public String getName() { - return "InDetTrack"; - } - - public String getNameScreenName() { - return "InDetTrack"; - } - - public String getHitInfo(int index) { - String msg = super.getHitInfo(index); - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) - return getNameScreenName()+" index: " + index + ((h!=null)?h[index].toString():""); // output for Minerva - if (numBLayerHits != null) { - msg += "\n numBLayerHits = " + numBLayerHits[index]; - } - if (numPixelHits != null) { - msg += "\n numPixelHits = " + numPixelHits[index]; - } - if (numSCTHits != null) { - msg += "\n numSCTHits = " + numSCTHits[index]; - } - if (numTRTHits != null) { - msg += "\n numTRTHits = " + numTRTHits[index]; - } - return msg; - } - - protected void applyCuts() { - cut("CutsInDet", "RTrIndex", " RTr id", id); - cut("CutsInDet", "trackAuthor", " Author", author); - - if (numBLayerHits != null) { - cut("CutsInDet", "NumBLayer", "Num BLayer", numBLayerHits); - } - if (numPixelHits != null) { - cut("CutsInDet", "NumPixel", "Num Pixel", numPixelHits); - } - if (numSCTHits != null) { - cut("CutsInDet", "NumSCT", "Num SCT", numSCTHits); - } - if (numTRTHits != null) { - cut("CutsInDet", "NumTRT", "Num TRT", numTRTHits); - } - - super.applyCuts(); - - if (polylinedTrack && parameterStore.get(PARAMETER_GROUP, "DrawnAs").getI() == DRAW_HELIX) { - // if reconstructed tracks are drawn as helices, check for tracks - // with rhoVertex beyond the diameter of InDet and don't draw those - // super.rhoVertex array was calculated only if Track provided - // polyline data, otherwise rhoVertex is null and this method would - // cause NullPointerException - super.cutRhoVertexAfterInDetRadius(); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AJetData.java b/graphics/AtlantisJava/src/atlantis/data/AJetData.java deleted file mode 100644 index d2e1743a92b33ce864e74ff4865fa88fa1bae0b9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AJetData.java +++ /dev/null @@ -1,782 +0,0 @@ -package atlantis.data; - -import java.util.ArrayList; -import java.util.List; - -import atlantis.event.AAssociation; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.event.AObjectsAssociation; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.parameters.APar; -import atlantis.utils.AMath; -import atlantis.utils.A3Vector; -import atlantis.utils.A4Vector; -import atlantis.utils.AHashMap; -import atlantis.canvas.AWindow; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionVP; -import atlantis.graphics.AGraphics; - -/** - * Jet class - class handling multiple Jet datatypes - * (multiple collections) from various Jet alrogithms - * (JetRecJet, ParticleJet, etc) - */ -public class AJetData extends AData -{ - protected float[] eT; - protected float[] eta; - protected float[] phi; - protected float[] mass; - protected float[] pT; - protected float[] px; - protected float[] py; - protected float[] pz; - //Transition variable to ensure backwards compatability - protected boolean has4Vect = false; - //variables for jet quality information - protected float[] quality = null; - protected float[] qualityLAr = null; - protected float[] qualityTile = null; - protected float[] time = null; - protected float[] timeClusters = null; - protected int[] n90cells = null; - protected int[] n90const = null; - protected float[] hecf = null; - protected float[] emfrac = null; - protected float[] tileGap3f = null; - protected float[] fcorCell = null; - protected float[] fcorDotx = null; - protected float[] fcorJet = null; - protected float[] fcorJetForCell = null; - protected int[] nbadcells = null; - protected float[] fracSamplingMax = null; - protected float[] sMax = null; - protected float[] OutOfTimeEfrac = null; - protected float[] isGood = null; - protected float[] isBad = null; - protected float[] isUgly = null; - protected String[] bTagName = null; //new bTagname variable - protected float[] bTagValue = null; //new bTagValue variable - protected float[] weight = null; - protected float[] jvf = null; - //Transition variable to ensure backwards compatability - protected boolean hasJvf = true; - - String[] caloSample = { "EMB0", "EMB1", "EMB2", "EMB3", "EME0", "EME1", "EME2", "EME3", "HEC0", "HEC1", "HEC2", "HEC3", "TileBar0", "TileBar1", "TileBar2", "TileGap1", "TileGap2", "TileGap3", "TileExt0", "TileExt1", "TileExt2", "FCAL0", "FCAL1", "FCAL2", "Unknown" }; - - - AJetData(AHashMap p, AEvent e) - { - super(p,e); - if (p.get("et") != null) - { - eT = p.getFloatArray("et"); - } - else - { - eT = p.getFloatArray("pt"); - } - - - if(p.get("mass") != null) - { - mass = p.getFloatArray("mass"); - px = p.getFloatArray("px"); - py = p.getFloatArray("py"); - pz = p.getFloatArray("pz"); - has4Vect = true; - } - eta = p.getFloatArray("eta"); - phi = p.getFloatArray("phi"); - - if(p.get("emfrac") != null) - { - emfrac = p.getFloatArray("emfrac"); - } - - float forwardJVF = 10.0f; - float initJVF = 1.0f; - if(p.get("jvf") != null) - { - jvf = p.getFloatArray("jvf"); - for(int i=0; i<(jvf.length); i++) - { - if( jvf[i] == -1.0 ) - jvf[i] = forwardJVF; // forward-jets have jvf=-1 - } - } - else // dummy values for older xml-files - { - hasJvf = false; - jvf = new float[eta.length]; // for array size - for(int i=0; i<(jvf.length); i++) - { - jvf[i] = initJVF; // need to assign dummy value to allow cut - } - } - - //Getting BTagNames and BTagValues from xml - if(p.get("bTagValue") != null) - { - bTagValue = p.getFloatArray("bTagValue"); - bTagName = p.getUnsureStringArray("bTagName"); - weight = new float[eta.length]; - for(int i=0; i<(eta.length); i++) - weight[i] = bTagValue[i*(bTagValue.length/eta.length) + 0]; - // 0 is the first instance of JetFitterNNComb - // we take this as default for now... - } - - if(has4Vect) - { - float[] pTtemp = new float[mass.length]; - for(int i = 0; i < mass.length; i++){ - pTtemp[i] = (float) (new A4Vector(px[i],py[i],pz[i],mass[i]) ).getPt(); - } - pT = pTtemp; - } - - if(p.get("quality") != null) - quality = p.getFloatArray("quality"); - if(p.get("qualityLAr") != null){ - qualityLAr = p.getFloatArray("qualityLAr"); - qualityTile = p.getFloatArray("qualityTile"); - time = p.getFloatArray("time"); - timeClusters = p.getFloatArray("timeClusters"); - n90cells = p.getIntArray("n90cells"); - n90const = p.getIntArray("n90const"); - hecf = p.getFloatArray("hecf"); - tileGap3f = p.getFloatArray("tileGap3f"); - fcorCell = p.getFloatArray("fcorCell"); - fcorDotx = p.getFloatArray("fcorDotx"); - fcorJet = p.getFloatArray("fcorJet"); - fcorJetForCell = p.getFloatArray("fcorJetForCell"); - nbadcells = p.getIntArray("nbadcells"); - fracSamplingMax = p.getFloatArray("fracSamplingMax"); - sMax = p.getFloatArray("sMax"); - OutOfTimeEfrac = p.getFloatArray("OutOfTimeEfrac"); - isGood = p.getFloatArray("isGood"); - isBad = p.getFloatArray("isBad"); - isUgly = p.getFloatArray("isUgly"); - } - - String assocKey = getFullName(); - // create Jet - Calo associations if cells information is available - if(p.get("numCells") != null) - { - event.getAssociationManager().add(new AAssociation(assocKey, "LAr", p.getIntArray("numCells"), p.getIntArray("cells"),event)); - event.getAssociationManager().add(new AAssociation(assocKey, "TILE", p.getIntArray("numCells"), p.getIntArray("cells"),event)); - event.getAssociationManager().add(new AAssociation(assocKey, "HEC", p.getIntArray("numCells"), p.getIntArray("cells"),event)); - event.getAssociationManager().add(new AAssociation(assocKey, "FCAL", p.getIntArray("numCells"), p.getIntArray("cells"),event)); - } - - if (p.get("clusterKey") != null) - { - int[] clusterLinkCount = p.getUnsureIntArray("clusterLinkCount"); - event.getAssociationManager().add(new AObjectsAssociation(assocKey, "Cluster", - p.getStringArray("clusterKey"), p.getIntArray("clusterIndex"), clusterLinkCount, event)); - } - if (p.get("trackKey") != null) - { - int[] trackLinkCount = p.getUnsureIntArray("trackLinkCount"); - event.getAssociationManager().add(new AObjectsAssociation(assocKey, "Track", - p.getStringArray("trackKey"), p.getIntArray("trackIndex"), trackLinkCount, event)); - } - } - - - public String getParameterGroup() - { - return "Jet"; - } - - - public String getName() - { - return "Jet"; - } - - - public String getNameScreenName() - { - return "Jet"; - } - - - public float getET(int index) - { - return eT[index]; - } - - - public float getEta(int index) - { - return eta[index]; - } - - - public float getPhi(int index) - { - return phi[index]; - } - - - public float[] getET() - { - return eT; - } - - - public float[] getEta() - { - return eta; - } - - - public float[] getPhi() - { - return phi; - } - - public float[] getPt() - { - if(has4Vect){ - return pT; - }else{ - return eT; - } - } - - @SuppressWarnings("unused") - // TODO: these cuts are from Nikolina - // using the wrong indices? - private float[] getfCorJetLevel() - { - // Tom - problem here with inconsistent indices? - // this code is not used yet, but the Jet people want it eventually - // i is the total data index, but we need to get that from the draw list, listdl[i]. - float[] temp = new float[numDraw]; - for (int i = 0; i < numDraw; i++) - temp[i] = (float) (fcorCell[i] - fcorJet[i]); - return temp; - } - - @SuppressWarnings("unused") - // TODO: these cuts are from Nikolina - // using the wrong indices? - private float[] getHECfQ() - { - float[] temp = new float[numDraw]; - for (int i = 0; i < numDraw; i++) - temp[i] = (float) (Math.abs(hecf[i]) + Math.abs(quality[i])); - return temp; - } - - /* - * Return an ordered list of the btaggers available in the event. - * If using an older XML file without btaggers available, an empty list is returned. - * Ordering is important to be consistent with the BTag Weights, which are ordered the same. - */ - public List<String> getBTaggers() { - - List<String> taggers = new ArrayList<String>(); - - if(bTagName == null) - return taggers; - - for(String tagger : bTagName) { - if(!taggers.contains(tagger)) { - taggers.add(tagger); - } - } - - return taggers; - } - - protected void applyCuts() - { - cutIndex(); - cut("CutsObjects", "JetET", " |ET|", eT); - cutPhi(phi); - cutEta(eta); - cut("CutsObjects", "JetEMfraction", " |EM fraction|", emfrac); - cut("CutsObjects", "JetVxFraction", " |Vx Fraction|", jvf); - - /* Placeholder for jet quality cuts (added by Nikolina Ilic) - cut("CutsObjects", "JetTime", " |dt(jet,coll)|", time); - cut("CutsObjects", "JetTileGap3F", " TileGap3F", tileGap3f); - cut("CutsObjects", "JetfCORRcell", " Already corrected cell level correction", fcorCell); - cut("CutsObjects", "JetfCORRjetLevel", " Correction by jet level estimation", getfCorJetLevel()); - cut("CutsObjects", "JetHECfQ", " HECf-Quality", getHECfQ()); - cut("CutsObjects", "JetOOTEf", " Out-Of-Time Energy frac", OutOfTimeEfrac); - */ - } - - public void colorbyBJets() { - //Initialy color all jets with constant color - for (int i = 0; i < numData; i++) { - int constantColor2 = parameterStore.get("Jet", "Constant").getI(); - color[i] = (byte) constantColor2; - } - - //Read necessary information to colour Jets - int bTagValue_user = parameterStore.get("CutsObjects", "JetBTagger").getI(); //getting user B-tagger preference - int constantColor = parameterStore.get("BJet", "Constant").getI(); - int constantColor2 = parameterStore.get("Jet", "Constant").getI(); - - //if b-tagging information is contained in xml file - if(bTagValue != null) { - int mod = bTagValue.length / eta.length; //Number of Btaggers - eta.length is the number of Jets - double s = parameterStore.get("CutsObjects", "JetBTagweight").getD(); - for (int i = 0; i < eta.length; i++) { - color[i] = (byte) constantColor2; - if(bTagValue[bTagValue_user + i*mod]>s){ - color[i] = (byte) constantColor; - } - } - } - } - - - - - protected int internalColor() - { - int colorFunction = APar.instance().get(PARAMETER_GROUP, "ColorFunction").getI(); - - if (colorFunction == 0) - { - colorByConstant(); - } - else if(colorFunction == 1) - { - colorByIndex(); - } - else if(colorFunction == 2) - { - colorByCollection(); - } - else if (colorFunction == 3) - { - colorbyBJets(); - } - return 3; - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n ET="+String.format("%.3f",eT[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Ex="+String.format("%.3f",eT[index]*Math.cos(phi[index]))+" GeV "+ - "\n Ey="+String.format("%.3f",eT[index]*Math.sin(phi[index]))+" GeV "+ - "\n Ez="+String.format("%.3f",eT[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String msg; - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - String printPt = ""; - if(has4Vect){ - printPt = "\n PT = " + String.format("%.3f",pT[index]) + " GeV"; - } - msg = getNameScreenName() + " (id: " + id[index] + " index: " + index + ")\n" + - " storegate key: " + sgKey + printPt + "\n ET = " + - String.format("%.3f",eT[index]) + " GeV" + "\n E = " + - String.format("%.3f",Math.abs(eT[index] / Math.cos(AMath.lambda(eta[index])))) + - " GeV" + "\n " + AMath.ETA + " = " + String.format("%.3f",eta[index]) + "\n " + - AMath.PHI + " = " + String.format("%.3f",Math.toDegrees(phi[index])) + - AMath.DEGREES + " (" + String.format("%.3f",phi[index]) + " rad)"; - - if(isGood != null) msg += "\n Selection: isGood =" + isGood[index] + "(isBad = " + isBad[index] + ", isUgly = " + isUgly[index] + ")"; - if(hecf != null) msg += "\n hecf = " + String.format("%.2f",hecf[index])+ ", n90cells = " + n90cells[index] + " (n90const = " + n90const[index] + ")"; - if (emfrac != null) msg += "\n emfrac = " + String.format("%.2f",emfrac[index]); - if (quality != null) msg += "\n quality = " + String.format("%.2f",quality[index]); - if (qualityLAr != null) msg += "(qLAr = " + String.format("%.2f",qualityLAr[index]) + ")"; - - if (hasJvf) - { - msg += "\n jvf = " + String.format("%.2f",jvf[index]); - } - else - { - msg += "\n jvf n/a "; - } - if (weight != null) msg += " b-weight = " + String.format("%.2f",weight[index]); - // Displaying bTagValues and bTagnames to the outputscreen - if(bTagValue != null) - { - //calculating "multiple" number - int Div = (bTagValue.length)/(eta.length); - msg += "\n b-Taggers: "; - for (int s=0;s<Div;s++) - { - msg += bTagName[index*Div + s] + "=" + String.format("%.2f",bTagValue[index*Div + s]) + ", "; - } - } - if (time != null) msg += "\n time = " + String.format("%.2f",time[index]) + " ns (clus time = " + String.format("%.2f",timeClusters[index]) + " ns)"; - if (OutOfTimeEfrac != null) msg += "\n Out-Of-Time Energy fraction = " + String.format("%.2f", OutOfTimeEfrac[index]); - if (fracSamplingMax != null) msg += "\n fracSamplingMax = " + String.format("%.2f",fracSamplingMax[index]) + " (sMax = " + caloSample[(int) sMax[index]] + ")"; - if (tileGap3f != null) msg += "\n tileGap3f = " + String.format("%.2f",tileGap3f[index]) + ", fcorCell=" + String.format("%.2f",fcorCell[index]) + ", fcorJet=" + String.format("%.2f",fcorJet[index]); - if (fcorDotx != null) msg += "\n fcorDotx=" + String.format("%.2f",fcorDotx[index]) + " (not implemented yet)"; - - return msg; - } - - // info on Jet collections contained in v-plot rubberband selection - public String getVPHitInfo() - { - makeDrawList(); - if (numDraw == 0) - return ""; - double sumE = 0.; - double sumEt = 0.; - - for (int i = 0; i < numDraw; ++i) - { - sumEt += Math.abs(eT[listdl[i]]); - sumE += Math.abs(eT[listdl[i]] / Math.cos(AMath.lambda(eta[listdl[i]]))); - } - - String key = getFullName(); - String msg = numDraw + " " + (key != null ? "" + key : getNameScreenName()); - msg += " sum(ET) = " + String.format("%.1f",sumEt) + " sum(E) = " + String.format("%.1f",sumE); - - return msg; - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - if(has4Vect){ - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A4Vector start = new A4Vector(); - start.setPtEtaPhiM(pT[k],eta[k],phi[k],mass[k]); - sum.add(start); - } - }else{ - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A3Vector start = A3Vector.fromRhoPhiZ(0., 0., 0.); - double tL = AMath.tanLambda(eta[k]); - A3Vector stop = A3Vector.fromRhoPhiZ(1., phi[k], tL); - A3Vector v = (stop.subtract(start)).normalize(); - double p = eT[k] / Math.sqrt(1. - v.z * v.z); - sum.add(new A4Vector(v.scale(p), 0.)); - } - } - return sum; - } - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if (projection instanceof AProjectionVP) - { - ACoord centers = window.calculateDisplay(getUser(projection)); - int[] drawlist = centers.index; - double eLimit = 0.05; - int numPoints = 25; - double[][][] hv = new double[2][drawlist.length][numPoints]; - - for (int i = 0; i < drawlist.length; ++i) - { - int list = drawlist[i]; - int jetMode = parameterStore.get("VP", "Jet").getI(); - double e; - if (jetMode == 0) - // showing jet in ET - e = Math.abs(eT[list]); - else - // showing jet in E - e = Math.abs(eT[list] / Math.cos(AMath.lambda(eta[list]))); - int d = (int) (Math.sqrt((e / eLimit) / Math.PI)); - if (d == 0) - d = 1; - for (int j = 0; j < numPoints; j++) - { - hv[0][i][j] = centers.hv[0][0][i] + d * Math.cos(Math.PI * 2 * j / (numPoints - 1)); - hv[1][i][j] = centers.hv[1][0][i] + d * Math.sin(Math.PI * 2 * j / (numPoints - 1)); - } - } - ag.draw(new ACoord(hv, drawlist, this, ACoord.POLYLINES)); - } - else - { - super.draw(window, ag, projection); - } - } - - protected int getDrawOrFill() - { - return AGraphics.FILL; - } - - protected ACoord getVPUser() - { - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - h[i] = eta[list]; - v[i] = Math.toDegrees(phi[list]); - index[i] = list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - } - - @Override - protected ACoord getYXUser() - { - int coneSmooth = 20; - makeDrawList(); - double[][][] hv = new double[2][numDraw][(2*coneSmooth)]; - int[] index = new int[numDraw]; - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - - double dphi = 0.4; - - if(sgKey.contains("Kt6")) - dphi = 0.6; - if(sgKey.contains("Kt1")) - dphi = 1.0; - - double rhoMinus = parameterStore.get("Jet","Innerdrawradius").getD(); - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double s = parameterStore.get("Jet", "Scale").getD(); - double rhoMax = s*1000; - if (0==s) return ACoord.NO_POLYLINES; - - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiPlus = phi[list] + dphi; - double phiMinus = phi[list] - dphi; - - //if no composite particles increase jet size - //Vector keys = (Vector) event.getCollections().get("CompositeParticle"); - //if (keys == null || !parameterStore.get("Data", "CompositeParticle").getStatus()) rhoMax=1000;//1800; - - double rhoPlus = rhoMax; - if(Math.abs(eT[list]) < maxEnergy) { - if(parameterStore.get("Jet", "ScaleType").getI() == 1) //sq root - rhoPlus = rhoMinus + rhoMax * (Math.sqrt (Math.abs(eT[list])/maxEnergy)); - if(parameterStore.get("Jet", "ScaleType").getI() == 0) // linear - rhoPlus = rhoMinus + rhoMax * (Math.abs(eT[list])/maxEnergy); - } - - double vx = parameterStore.get("Event", "XVtx").getD(); - double vy = parameterStore.get("Event", "YVtx").getD(); - - double h_shift = vx; - double v_shift = vy; - - // the loop interpolates between the inner and outer edge of the jet to draw the arc - - // draw the outer arc - for(int j=0; j<coneSmooth; j++){ - float f = ((float)j)/(coneSmooth-1); - hv[0][i][j] = h_shift + (rhoPlus) * Math.cos(((1-f)*phiPlus + (f)*phiMinus)); - hv[1][i][j] = v_shift + (rhoPlus) * Math.sin(((1-f)*phiPlus + (f)*phiMinus)); - } - - // draw the inner arc - for(int j=coneSmooth; j<(2*coneSmooth); j++){ - float f = ((float)j-coneSmooth)/(coneSmooth-1); - hv[0][i][j] = h_shift + (rhoMinus) * Math.cos(((1-f)*phiMinus + (f)*phiPlus)); - hv[1][i][j] = v_shift + (rhoMinus) * Math.sin(((1-f)*phiMinus + (f)*phiPlus)); - } - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.TRANSPARENT_POLYGONS); - } - - protected ACoord getFRUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - - double dphi = 0.4; - - if(sgKey.contains("Kt6")) - dphi = 0.6; - if(sgKey.contains("Kt1")) - dphi = 1.0; - - double s = parameterStore.get("Jet", "Scale").getD(); - double rhoMax = s*1500; - double rhoMinus = parameterStore.get("Jet","Innerdrawradius").getD(); - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - if (0==s) return ACoord.NO_POLYLINES; - - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiPlus = phi[list] + dphi; - double phiMinus = phi[list] - dphi; - - //if no composite particles increase jet size - //Vector keys = (Vector) event.getCollections().get("CompositeParticle"); - //if (keys == null || !parameterStore.get("Data", "CompositeParticle").getStatus()) rhoMax=1000;//1800; - - double rhoPlus = rhoMinus + rhoMax; - if(Math.abs(eT[list]) < maxEnergy) { - if(parameterStore.get("Jet", "ScaleType").getI() == 1) //sq root - rhoPlus = rhoMinus + rhoMax * (Math.sqrt (Math.abs(eT[list])/maxEnergy)); - if(parameterStore.get("Jet", "ScaleType").getI() == 0) // linear - rhoPlus = rhoMinus + rhoMax * (Math.abs(eT[list])/maxEnergy); - } - - hv[0][i][0] = rhoMinus; - hv[1][i][0] = Math.toDegrees(phiMinus); - - hv[0][i][1] = rhoMinus; - hv[1][i][1] = Math.toDegrees(phiPlus); - - hv[0][i][2] = rhoPlus; - hv[1][i][2] = Math.toDegrees(phiPlus); - - hv[0][i][3] = rhoPlus; - hv[1][i][3] = Math.toDegrees(phiMinus); - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.TRANSPARENT_POLYGONS).includePhiWrapAround("FR"); - } - - protected double Theta (double eta, int rSign) - { - // calculate theta based on the eta value - double theta = Math.atan(Math.exp(-Math.abs(eta))) * 2.0; - if ((eta > 0.) && (rSign == -1)) - theta = 2 * Math.PI - theta; - else if ((eta < 0.) && (rSign == -1)) - theta += Math.PI; - else if ((eta < 0.) && (rSign == 1)) - theta = Math.PI - theta; - - return theta; - } - - protected ACoord getRZUser() - { - int coneSmooth = 20; - double s = parameterStore.get("Jet", "Scale").getD(); - if (0==s) return ACoord.NO_POLYLINES; - makeDrawList(); - double[][][] hv = new double[2][numDraw][(2*coneSmooth)]; - int[] index = new int[numDraw]; - - double innerRadius = parameterStore.get("Jet","Innerdrawradius").getD(); - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - - double deta = 0.4; - - if(sgKey.contains("Kt6")) - deta = 0.6; - if(sgKey.contains("Kt1")) - deta = 1.0; - - - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi[list]-phiMid); - int rSign; - if (phiDiff > Math.PI/2. && phiDiff <= 3*Math.PI/2.) - rSign = -1; - else - rSign = 1; - - double theta = Theta(eta[list],rSign); - double thetaPlus = Theta(eta[list] + deta, rSign); - double thetaMinus = Theta(eta[list] - deta, rSign); - - // decide the region based on the theta value - final byte TOP_BOTTOM = 0; - final byte LEFT_RIGHT = 1; - byte region = TOP_BOTTOM; - // hard-coded value is based on the values in Geometry - if(Math.abs(Math.tan(theta)) < 0.8) - region = LEFT_RIGHT; - - double radiusMinus = 0.; - - switch(region) - { - case TOP_BOTTOM: - radiusMinus = innerRadius / Math.abs(Math.sin(theta)); - break; - case LEFT_RIGHT: - radiusMinus = innerRadius / Math.abs(Math.cos(theta)); - break; - } - //compare to AAODData for rhoMax/Minus values - double radiusMax = s*2500.; - - //if no composite particles increase jet size - //Vector keys = (Vector) event.getCollections().get("CompositeParticle"); - //if (keys == null || !parameterStore.get("Data", "CompositeParticle").getStatus()) radiusMax+=200; - - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double radiusPlus = radiusMinus + radiusMax; - if(Math.abs(eT[list] / Math.cos(AMath.lambda(eta[list]))) < maxEnergy) - { - if(parameterStore.get("Jet", "ScaleType").getI() == 1) //sq root - radiusPlus = radiusMinus + radiusMax * (Math.sqrt (Math.abs(eT[list] / Math.cos(AMath.lambda(eta[list])))/maxEnergy)); - if(parameterStore.get("Jet", "ScaleType").getI() == 0) // linear - radiusPlus = radiusMinus + radiusMax *((Math.abs(eT[list] / Math.cos(AMath.lambda(eta[list]))))/maxEnergy); - } - - double vx = parameterStore.get("Event", "XVtx").getD(); - double vy = parameterStore.get("Event", "YVtx").getD(); - double vz = parameterStore.get("Event", "ZVtx").getD(); - - double h_shift = vz; - double v_shift = Math.sqrt(vx*vx + vy*vy); - - // the loop interpolates between the inner and outer edge of the jet to draw the arc - // draw the outer arc - for(int j=0; j<coneSmooth; j++){ - float f = ((float)j)/(coneSmooth-1); - hv[0][i][j] = h_shift + (radiusPlus) * Math.cos(((1-f)*thetaPlus + (f)*thetaMinus)); - hv[1][i][j] = v_shift + (radiusPlus) * Math.sin(((1-f)*thetaPlus + (f)*thetaMinus)); - } - - // draw the inner arc - for(int j=coneSmooth; j<(2*coneSmooth); j++){ - float f = ((float)j-coneSmooth)/(coneSmooth-1); - hv[0][i][j] = h_shift + (radiusMinus) * Math.cos(((1-f)*thetaMinus + (f)*thetaPlus)); - hv[1][i][j] = v_shift + (radiusMinus) * Math.sin(((1-f)*thetaMinus + (f)*thetaPlus)); - } - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.TRANSPARENT_POLYGONS); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AJetROIData.java b/graphics/AtlantisJava/src/atlantis/data/AJetROIData.java deleted file mode 100755 index c47c2ce92990478ddf6bff81848c09bd0a838d83..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AJetROIData.java +++ /dev/null @@ -1,38 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.utils.AHashMap; - -/** - * - * Jet Region Of Interest - * - * @author Zdenek Maxa, Qiang Lu - */ -public class AJetROIData extends AROIData -{ - - AJetROIData(AHashMap p, AEvent e) - { - super(p,e); - } // AJetROIData() ------------------------------------------------------ - - - public String getParameterGroup() - { - return "JetROI"; - } // getParameterGroup() ------------------------------------------------ - - - public String getName() - { - return "JetROI"; - } // getName() ---------------------------------------------------------- - - - public String getNameScreenName() - { - return "JetROI"; - } // getNameScreenName() ------------------------------------------------ - -} // class AJetROIData ====================================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/ALArData.java b/graphics/AtlantisJava/src/atlantis/data/ALArData.java deleted file mode 100644 index 7b0efc9cd77c6bd3aa91666db1e9b5d34b358ab8..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ALArData.java +++ /dev/null @@ -1,1032 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import com.Ostermiller.util.CSVParser; - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; -import java.io.FileNotFoundException; - -import atlantis.geometry.ABarrelCalorimeterDetector; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.AMath; -import atlantis.utils.AUtilities; -import atlantis.parameters.AParameter; -import atlantis.utils.ALogger; - - -/** - * The Liquid Argon ElectroMagnetic Calorimeter - * - * @author Eric Jansen - */ -public class ALArData extends ACalorimeterData -{ - private static ALogger logger = ALogger.getLogger(ALArData.class); - - // data for real pulse shapes plots - private int numSamplings = 0; - private int[][] adcCounts = null; - private float[] cellTime = null; - private int[] cellGain = null; - private float[] cellPedestal = null; - private float[] adc2Mev = null; - private static boolean pulseShapesDataAvailable = false; - private static final String LOOKUP_TABLE_FILE = - AGlobals.instance().getHomeDirectory() + "configuration" + - System.getProperty("file.separator") + - "rpsplt_lar.csv"; - // number of lookup table values for real pulse shapes plots calculation - private static final short NUMBER_OF_LOOKUP_VALUES = 799; - - - - ALArData(AHashMap p, AEvent e) - { - super(p,e); - - for (int i = 0; i < numData; i++) - { - try - { - side[i] = (byte) AIdHelper.larBarrelEndcap(id[i]); - etaIndex[i] = (short) AIdHelper.larEta(id[i]); - phiIndex[i] = (short) AIdHelper.larPhi(id[i]); - sampling[i] = AIdHelper.larSampling(id[i]); - } - catch (AAtlantisException aex) - { - logger.warn("Problem decoding ID " + id[i] + " in " + - CALORIMETER_NAME + ": " + aex.getMessage(), aex); - side[i] = 0; - etaIndex[i] = -1; - phiIndex[i] = -1; - sampling[i] = -1; - } - } - - makeHitToGeometryMapping(); - for (int i = 0; i < et.length; ++i) - { - et[i] = Math.abs(energy[i] / (float) Math.cosh(eta[i])); - } - - // Collect some constants we need for the histograms. - for (int i = 0; i < ACalorimeterDetector.count(); i++) - { - - if (ACalorimeterDetector.get(i).getName().indexOf(CALORIMETER_NAME) >= 0) - { - if (ACalorimeterDetector.get(i) instanceof ABarrelCalorimeterDetector) - { - if (innerR == 0.0 || ACalorimeterDetector.get(i).getRMin() < innerR) - { - innerR = ACalorimeterDetector.get(i).getRMin(); - } - } - else - { - if (innerZ == 0.0 || ACalorimeterDetector.get(i).getZMin() < innerZ) - { - innerZ = ACalorimeterDetector.get(i).getZMin(); - } - } - if (outerR == 0.0 || ACalorimeterDetector.get(i).getRMax() > outerR) - { - outerR = ACalorimeterDetector.get(i).getRMax(); - } - if (outerZ == 0.0 || ACalorimeterDetector.get(i).getZMax() > outerZ) - { - outerZ = ACalorimeterDetector.get(i).getZMax(); - } - if (outerEta == 0.0 || ACalorimeterDetector.get(i).getEtaMax() > outerEta) - { - outerEta = ACalorimeterDetector.get(i).getEtaMax(); - } - if (phiGranularity == 0.0 || ACalorimeterDetector.get(i).getDeltaPhi() < phiGranularity) - { - phiGranularity = ACalorimeterDetector.get(i).getDeltaPhi(); - } - if (etaGranularity == 0.0 || ACalorimeterDetector.get(i).getDeltaEta() < etaGranularity) - { - etaGranularity = ACalorimeterDetector.get(i).getDeltaEta(); - } - } - } - - // Add a little bit of extra margin to prevent binning errors due to - // rounding of numbers. - outerEta += etaGranularity; - - readPulseShapePlotData(p); - - } // ALArData() --------------------------------------------------------- - - - - private void readPulseShapePlotData(AHashMap p) - { - // read ADCCounts and cell data for real pulse shapes plots - adcCounts = super.getADCCountsData(p); - - // read LAr digits (cell data) for real pulse shapes plots - cellTime = (p.get("cellTime") != null) ? p.getFloatArray("cellTime") : null; - cellGain = (p.get("cellGain") != null) ? p.getIntArray("cellGain") : null; - cellPedestal = (p.get("cellPedestal") != null) ? p.getFloatArray("cellPedestal") : null; - adc2Mev = (p.get("adc2Mev") != null) ? p.getFloatArray("adc2Mev") : null; - - pulseShapesDataAvailable = false; - if(adcCounts != null && cellTime != null && cellGain != null && - cellPedestal != null && adc2Mev != null) - { - pulseShapesDataAvailable = true; - numSamplings = adcCounts[0].length; - - logger.debug(CALORIMETER_NAME + - ": data for real pulse shape plots available"); - - if(ACalorimeterRPSPLT.areLarLookupTablesInitialized()) - { - logger.debug(CALORIMETER_NAME + - ": lookup tables have already been read in"); - } - else - { - logger.debug(CALORIMETER_NAME + - ": lookup table values have not been read in yet\n" + - " trying to read file: " + LOOKUP_TABLE_FILE); - - try - { - readLookupTableFile(); - - logger.debug(CALORIMETER_NAME + - ": values from " + LOOKUP_TABLE_FILE + - " successfully read in"); - } - catch(AAtlantisException ex) - { - logger.error(CALORIMETER_NAME + - ": reading " + LOOKUP_TABLE_FILE + - " failed, real pulse shapes plots will not " + - "be available, reason: " + ex.getMessage(), ex); - pulseShapesDataAvailable = false; - } - } - } - - } // readPulseShapePlotData() ------------------------------------------- - - - - /** - * readLookupTableFile() reads in comma separated values (CSV) file - * with LAr real pulse shapes plots time and amplitude lookup values - * @param fileName String - * @throws AAtlantisException - */ - private void readLookupTableFile() throws AAtlantisException - { - try - { - InputStream is = AUtilities.getFileAsStream(LOOKUP_TABLE_FILE); - CSVParser parser = new CSVParser(is); - parser.setCommentStart("#"); - String arrayName = null; - - while((arrayName = parser.nextValue()) != null) - { - String valueArray = parser.nextValue(); // shall now contain all values - CSVParser parserArray = new CSVParser(new StringReader(valueArray)); - String[][] s = parserArray.getAllValues(); - - float[] array = getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - ACalorimeterRPSPLT.setLarTable(arrayName, array); - } // while - } - catch(FileNotFoundException e) - { - throw new AAtlantisException("could not find file: " + - LOOKUP_TABLE_FILE); - } - catch(IOException e) - { - throw new AAtlantisException("exception while reading file: " + - LOOKUP_TABLE_FILE); - } - catch(AAtlantisException e) - { - throw e; - } - - } // readLookupTableFile() ---------------------------------------------- - - - - /** - * - * @param index int - * @param lookupTablesInfo String - * Debug info method in order to make sure that correct lookup table - * is used given barrel/endcap, sampling and region of LAr. - */ - private void pulseShapePlotsDebugInfo(int index, String lookupTableName) - { - String msg = null; - try { - msg = "\n barrel/endcap value: " + - AIdHelper.larBarrelEndcap(id[index]); - msg += " is "; - msg += AIdHelper.larIsBarrel(id[index]) ? "barrel" : "endcap"; - msg += "\n sampling/layer: " + sampling[index]; - msg += "\n region: " + AIdHelper.larRegion(id[index]); - msg += "\n lookup table used: " + lookupTableName; - logger.debug(msg + "\n"); - } catch (AAtlantisException aaex) { - logger.debug("\n exception: " + aaex.getMessage(), aaex); - } - } // pulseShapePlotsDebugInfo() ----------------------------------------- - - - - /** - * This method is used when calculating real pulse shapes plots. - * It is called from getLookupTableForPulseShapesPlots() - * It calculates index of the 0.1 eta bin the argument eta - * (eta of a cell) falls into. Thus it determines which eta - * range a cell belongs to (eta ranges are last level of cells - * division from barrel/endcap, layer, region. - * startIndex argument tells which eta range we start counting from - * (given the eta ranges division it may not necessarily be from 0). - * If eta doesn't fall into a specified interval, empty String - * is returned - then missing ETAx suffix will cause retrieving - * of the float[] will fail. - * - * @param etaFrom - * @param etaTo - * @return - */ - private static String getEtaBinIndex(float etaFrom, float etaTo, - float cellEta, int startIndex) - { - float step = 0.1f; // step, size of the eta bins - float absEta = Math.abs(cellEta); - int index = startIndex; - - for(float f = etaFrom; f < etaTo; f += step, index++) - { - if(absEta > f && absEta < f + step) - { - logger.debug("eta range calculation: cell eta = " + cellEta + " " + - "etaFrom = " + etaFrom + " etaTo = " + etaTo); - logger.debug("eta range index result: " + index + - " (index offset was: " + startIndex + ")"); - return "ETA" + index + "_" ; - } - } - - // calculating bin failed, retrieving the array will fail later - return ""; - - } // calculateEtaBinIndex() --------------------------------------------- - - - - /** - * Method returns correct float[] array for amplitude lookup table - * depending whether a cell (determined by index, resp. id[index]) is in - * barrel, endcap, which layer and which region or which eta range. - * This method accesses ACalorimeterRPSPLT - * Methods contains constant value defining parts of LAr detector - * (as used in AIdHelper) and also eta range constants provided by - * the LAr community. - * - * @param index int - * @return float[] - */ - private float[] getLookupTableForPulseShapesPlots(int index) throws AAtlantisException - { - float[] amplitude = null; // lookup table amplitude values - - // helper variable - absolute value of eta - for checking of the eta range - float absEta = Math.abs(eta[index]); - - // the key for ACalorimeterRPSPLT.getLarTable(key) will gradually be - // constructed depending on barrel/endcap, layer, region and eta range - String lookupTableKey = "LAR_"; // start of the name all LAR_ tables - - - if(AIdHelper.larIsBarrel(id[index])) - { - // it is barrel - lookupTableKey += "BARREL_"; - switch(sampling[index]) - { - case 0: // layer 0 - // plot ADC counts only for this layer - String[] decodedId = AIdHelper.getFullIdentifier(id[index]); - String title = "LAr cell: " + decodedId[0]; - int[][] data = { adcCounts[index] }; - APulseShapePlot.plotADCCounts(data, title, null); - throw new AAtlantisException("ADC counts plot only, pulse shape plot not " + - "implemented for LAr barrel, layer 0"); - case 1: - lookupTableKey += "LAYER1_"; // layer 1 - switch(AIdHelper.larRegion(id[index])) - { - case 0: - lookupTableKey += "REGION0_"; - break; - case 1: - lookupTableKey += "REGION1_"; - break; - default: - AOutput.append("\npulse shape plots - LAr barrel, " + - "layer 1, region > 1. Using layer 1, " + - "region 1 lookup table\n", ALogInterface.WARNING); - lookupTableKey += "REGION1_"; - } - break; - case 2: // layer 2 - lookupTableKey += "LAYER2_"; // layer 2 - switch(AIdHelper.larRegion(id[index])) - { - case 0: - lookupTableKey += "REGION0_"; - break; - case 1: - lookupTableKey += "REGION1_"; - break; - default: - AOutput.append("\npulse shape plots - LAr barrel, " + - "layer 2, region > 1. Using layer 2, " + - "region 1 lookup table\n", ALogInterface.WARNING); - lookupTableKey += "REGION1_"; - } - break; - case 3: // layer 3 - lookupTableKey += "LAYER3_REGION0_"; - break; - } - } // if(AIdHelper.larIsBarrel(id[index])) - else - { - // we are in the endcap - lookupTableKey += "ENDCAP_"; - switch(sampling[index]) - { - case 0: // layer 0 - // only one region and one eta range on this layer - lookupTableKey += "LAYER0_REGION0_ETA0_"; - break; - case 1: // layer 1 - lookupTableKey += "LAYER1_"; - switch(AIdHelper.larRegion(id[index])) - { - case 0: - lookupTableKey += "REGION0_"; - if(absEta > 1.375f && absEta < 1.425f) - { - lookupTableKey += "ETA0_"; // first eta range - } - else - { - // eta ranges with step 0.1 provided by Andre - // start index counting from 1, 0 range is used above - lookupTableKey += getEtaBinIndex(2.5f, 3.2f, eta[index], 1); - } - break; - case 1: - lookupTableKey += "REGION1_ETA0_"; // no eta subdivision - break; - case 2: - lookupTableKey += "REGION2_"; - // starting from first range, startIndex 0 - lookupTableKey += getEtaBinIndex(1.5f, 1.8f, eta[index], 0); - break; - case 3: - lookupTableKey += "REGION3_"; - lookupTableKey += getEtaBinIndex(1.8f, 2.0f, eta[index], 0); - break; - case 4: - lookupTableKey += "REGION4_"; - lookupTableKey += getEtaBinIndex(2.0f, 2.4f, eta[index], 0); - break; - case 5: - lookupTableKey += "REGION5_"; - if(absEta > 2.4f && absEta < 2.5f) - { - lookupTableKey += "ETA0_"; - } - break; - default: - AOutput.append("\npulse shape plots - LAr endcap, " + - "layer 1, region > 5. Using layer 1, " + - "region 5, eta range 0 lookup table\n", - ALogInterface.WARNING); - lookupTableKey += "REGION5_ETA0_"; - } - break; - case 2: // layer 2 - lookupTableKey += "LAYER2_"; - switch(AIdHelper.larRegion(id[index])) - { - case 0: - lookupTableKey += "REGION0_"; - if(absEta > 1.375f && absEta < 1.425f) - { - lookupTableKey += "ETA0_"; // first eta range - } - else - { - // eta ranges with step 0.1 provided by Andre - // start index counting from 1, 0 range is used above - lookupTableKey += getEtaBinIndex(2.5f, 3.2f, eta[index], 1); - } - break; - case 1: - lookupTableKey += "REGION1_"; - lookupTableKey += getEtaBinIndex(1.425f, 2.5f, eta[index], 0); - break; - } - break; - case 3: // layer 3 - lookupTableKey += "LAYER3_"; - lookupTableKey += "REGION0_"; - lookupTableKey += getEtaBinIndex(1.5f, 2.5f, eta[index], 0); - break; - } - } // else (endcap) - - lookupTableKey += "AMPLITUDE"; - pulseShapePlotsDebugInfo(index, lookupTableKey); - amplitude = ACalorimeterRPSPLT.getLarTable(lookupTableKey); - - return amplitude; - - } // getLookupTableForPulseShapesPlots() ------------------------------- - - - - /** - * This method plots only the ADC counts and no pulse shape plot for a - * given cell. This is useful when the pulse shape plot is not correct - * but ADC count plot is still needed. The method is called from pick - * interaction with D (digits only), see APickInteraction.pressed() - * It is supposedly a temporary solution until LAr real pulse shapes - * lookup tables are corrected / finalized and propagated to Atlantis. - * @param index - */ - public void plotADCCounts(int index) - { - if(pulseShapesDataAvailable) - { - String title = getPulseTitleString(index); - - int[][] adcCountsLocal = new int[][] { adcCounts[index] }; - - logger.debug("Plotting only ADC counts plot ... "); - APulseShapePlot.plotADCCounts(adcCountsLocal, title, null); - - } // if(pulseShapesDataAvailable) - else - { - return; - } - - } // plotADCCounts() ---------------------------------------------------- - - - -// /** -// * Call util class which plots cell pulse shapes provided that -// * all real pulse shapes data is available -// * Functions calculates values of real pulse shape calculated in the method -// * getPhysicsPulseShape(). -// * This method is called from pick interaction. -// * -// * @param index int -// */ - /*public void plotPulseShapes(int index) - { - if(pulseShapesDataAvailable) - { - String title = getPulseTitleString(index); - - int[][] adcCountsLocal = new int[][] { adcCounts[index] }; - - - if(super.checkADCCountsAvailability(adcCountsLocal)) - { - // adc counts are available - logger.debug(CALORIMETER_NAME + " adc counts (digits) are " + - "available for pulse shapes plots for this cell."); - } - else - { - String m = "ADC counts are not available for this cell, " + - "can't plot pulse shapes."; - AOutput.append("\n" + m, ALogPane.WARNING); - logger.warn(m); - return; - } - - - float[] amplitude = null; // amplitude lookup table - float[] time = null; // time lookup table - try - { - time = ACalorimeterRPSPLT.getLarTable("LAR_TIME"); - amplitude = getLookupTableForPulseShapesPlots(index); - } - catch(AAtlantisException ex) - { - AOutput.append("\n" + ex.getMessage(), ALogPane.WARNING); - logger.error(ex.getMessage()); - return; - } - - // 1 .. 32 range (32 values of ADC counts, i.e. 32 samples), need to - // get NUMBER_OF_LOOKUP_VALUES (769) within this range (starts from 1!). - // Real data will have (probably) only 5 samples per cell - double step = (adcCounts[0].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - double[][] realPulse = new double[1][NUMBER_OF_LOOKUP_VALUES]; // 1 channel - double d = 1.0; - // if adc2Mev != -1 -> use value from event file, otherwise predefined value - // see comment at the getADC2MevFactorPredefined() method - // factor variable is used as a flag whether or not to plot pulse shape, - // if is -1 (adc2Mev not available), then want to see only the adc counts - // and don't calculate the pulse shapes - // getADC2MevFactorPredefined(index) is no longer in use, see comment at it - float factor = adc2Mev[index]; - - double energyLocal = energy[index] * 1000.0 / factor; - try - { - if(factor != -1) - { - for(int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) - { - d += step; - realPulse[0][i] = super.getPhysicsPulseShape(d, cellTime[index], - cellPedestal[index], energyLocal, - amplitude, time, NUMBER_OF_LOOKUP_VALUES); - } - } - } - catch(AAtlantisException aaex) - { - AOutput.append(aaex.getMessage(), ALogPane.WARNING); - logger.error(aaex.getMessage()); - return; - } - - if(factor != -1) - { - logger.debug("adc2Mev factor available, plotting full plot."); - APulseShapePlot.plotRealPulseShapes(adcCountsLocal, realPulse, - step, null, title); - } - else - { - logger.debug("adc2Mev factor not available, plotting just adc counts."); - APulseShapePlot.plotADCCounts(adcCountsLocal, title, null); - } - - } // if(pulseShapesDataAvailable) - else - { - return; - } - - } */// plotPulseShapes() -------------------------------------------------- - - @Override - protected int[][] getADCCounts(int index) { - if (pulseShapesDataAvailable) { - for (int adc : adcCounts[index]) { - // Only return something if it is non-zero - if (adc != 0) return new int[][] { adcCounts[index] }; - } - } - return null; - } - - /** - * Calculate local time for pulse shape plots - */ - protected double getLocalTime(double xTime, double cellTime, int numSamplings) { - int nominalPeakSample = (int)(numSamplings / 2.); - return ((xTime - nominalPeakSample + 3) * 25.0) - cellTime; - } - - @Override - protected double[][] getPulseShape(int index) { - - float[] amplitude = null; // amplitude lookup table - float[] time = null; // time lookup table - try - { - time = ACalorimeterRPSPLT.getLarTable("LAR_TIME"); - amplitude = getLookupTableForPulseShapesPlots(index); - } - catch(AAtlantisException ex) - { - AOutput.append("\n" + ex.getMessage(), ALogInterface.WARNING); - logger.error(ex.getMessage()); - return null; - } - - // 1 .. 32 range (32 values of ADC counts, i.e. 32 samples), need to - // get NUMBER_OF_LOOKUP_VALUES (769) within this range (starts from 1!). - // Real data will have (probably) only 5 samples per cell - double step = getPulseStep(index); - double[][] realPulse = new double[1][NUMBER_OF_LOOKUP_VALUES]; // 1 channel - double d = 1.0; - // if adc2Mev != -1 -> use value from event file, otherwise predefined value - // see comment at the getADC2MevFactorPredefined() method - // factor variable is used as a flag whether or not to plot pulse shape, - // if is -1 (adc2Mev not available), then want to see only the adc counts - // and don't calculate the pulse shapes - // getADC2MevFactorPredefined(index) is no longer in use, see comment at it - float factor = adc2Mev[index]; - - double energyLocal = energy[index] * 1000.0 / factor; - try - { - if(factor != -1) - { - for(int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) - { - d += step; - double localTime = getLocalTime(d, cellTime[index], this.numSamplings); - realPulse[0][i] = super.getPhysicsPulseShape(localTime, - cellPedestal[index], energyLocal, - amplitude, time, NUMBER_OF_LOOKUP_VALUES); - } - } - } - catch(AAtlantisException aaex) - { - AOutput.append(aaex.getMessage(), ALogInterface.WARNING); - logger.error(aaex.getMessage()); - return null; - } - - if(factor != -1) - { - logger.debug("adc2Mev factor available, plotting full plot."); - return realPulse; - } - else - { - return null; - } - } - - @Override - protected double getPulseStep(int index) { - return (adcCounts[0].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - } - -// /** -// * Determines adc2Mev factor value for a cell. The number either comes -// * with the event file (adc2Mev subtag), but sometimes is not available -// * in Athena (in the database) which is indicated by -1 in the event file -// * for a particular cell. In this case, use predefined constant in this -// * method. -// * -// * zdenek (2008-09-15): -// * These predefined values (which are used if adc2Mev factor is -1) should -// * no longer be used. if the factor is not present, do not plot the pulse -// * shape, just the ADC counts as these values are non-sense. The method -// * and references to it should be removed after some time (if calo people -// * don't change their mind to pre-define some other values and use those) -// -// * @param index int -// * @return String -// */ - /* - private float getADC2MevFactorPredefined(int index) - { - boolean barrel = false; - int layer = sampling[index]; - - try - { - barrel = AIdHelper.larIsBarrel(id[index]); - } - catch (AAtlantisException e) - { - AOutput.append("Problem decoding ID " + id[index] + - " in " + CALORIMETER_NAME + ": " + e.getMessage(), - ALogPane.WARNING); - return Float.NEGATIVE_INFINITY; - } - - float r = Float.NEGATIVE_INFINITY; - if(barrel) - { - switch(layer) - { - case 0: r = 7.0f; - break; - case 1: r = 2.5f; - break; - case 2: r = Math.abs(this.eta[index]) < 0.8 ? 10.0f : 18.0f; - break; - case 3: r = 9.0f; - break; - } - } - else - { - r = 16.0f; - } - - return r; - - } // getADC2MevFactor() ------------------------------------------------- - */ - - - /** - * Returns calo hit info - * - * @param index int - * @return String - */ - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n ET="+String.format("%.3f",et[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Ex="+String.format("%.3f",et[index]*Math.cos(phi[index]))+" GeV "+ - "\n Ey="+String.format("%.3f",et[index]*Math.sin(phi[index]))+" GeV "+ - "\n Ez="+String.format("%.3f",et[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String t = ""; - String cellInfo = ""; - - // if decoded ID is required and implemented for LAr ... - // String decodedId = AIdHelper.getDecodedTileIndentifier(id[index]); - // t = decodedId + " " + super.getHitInfo(index); - t = super.getHitInfo(index); - - cellInfo += "\n cell time = "; - cellInfo += (cellTime != null) ? Float.toString(cellTime[index]) + - " ns" : "n/a"; - cellInfo += "\n cell gain = "; - cellInfo += (cellGain != null) ? Integer.toString(cellGain[index]) : "n/a"; - cellInfo += "\n cell pedestal = "; - cellInfo += (cellPedestal != null) ? Float.toString(cellPedestal[index]) + - " ADC counts" : "n/a"; - - cellInfo += "\n ADC 2 MeV = "; - if(adc2Mev == null) - { - cellInfo += "n/a"; - } - else - { - // subtag adc2Mev was available in the event file - if(adc2Mev[index] != -1) - { - // other than -1: the factor was available in - // Athena (database) for this particular cell - cellInfo += Float.toString(adc2Mev[index]) + " (from database)"; - } - else - { - // -1 -> the factor wasn't available in Athena (database), - // use hardcoded constant for this particular cell - cellInfo += "-1 (n/a in database)"; - // see comment at getADC2MevFactorPredefined() method - // using predefined " + - // Float.toString(getADC2MevFactorPredefined(index)); - } - } - - cellInfo += pulseShapesDataAvailable ? "" : - "\n data for real pulse shapes plot n/a"; - - return t + cellInfo; - - } // getHitInfo() ------------------------------------------------------- - - @Override //ACalorimeterData - //Gives the hit time for this cell - protected double getTime(int hit) - { - if (cellTime == null) return 0.0; - else return cellTime[hit]; - } - - private void cutEnergyByLayer(String groupName, String parameterName, - String text, float[] array, int[] sampling, int currSampling) - { - AParameter par = parameterStore.get(groupName, parameterName); - - if(par.getStatus() && array != null) - { - double value = par.getD(); - String operator = par.getOperator(); - int num = 0; - - // this special cut shall have isMod="YES" attribute set, so - // par.isModulus() is true, thus only Math.abs() values are considered - if(operator.equals("<")) - { - for(int i = 0; i < numDraw; i++) - { - if(sampling[listdl[i]] == currSampling) - { - if(Math.abs(array[listdl[i]]) < value) - { - listdl[num++] = listdl[i]; - } - } - else - { - // don't check energy for other layers and don't cut - listdl[num++] = listdl[i]; - } - } - } - else if(operator.equals(">")) - { - // '>' really means '>=' for reals since they are real in - // from ascii file and don't have full precison - for(int i = 0; i < numDraw; i++) - { - if(sampling[listdl[i]] == currSampling) - { - if(Math.abs(array[listdl[i]]) >= value) - { - listdl[num++] = listdl[i]; - } - } - else - { - // don't check energy for other layers and don't cut - listdl[num++] = listdl[i]; - } - } - } - else - { - throw new Error(operator + " operator not sensible for floats"); - } - - numDraw = num; - } - - } // cutEnergyByLayer() ------------------------------------------------- - - - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsCalo", "LArET", "LArET", et); - cut("CutsCalo", "LArEnergy", "LArEnergy", energy); - - // energy cut (E) per layers - cutEnergyByLayer("CutsCalo", "LArEnergyLayer0", "LArEnergyLayer0", - energy, sampling, 0); - cutEnergyByLayer("CutsCalo", "LArEnergyLayer1", "LArEnergyLayer1", - energy, sampling, 1); - cutEnergyByLayer("CutsCalo", "LArEnergyLayer2", "LArEnergyLayer2", - energy, sampling, 2); - cutEnergyByLayer("CutsCalo", "LArEnergyLayer3", "LArEnergyLayer3", - energy, sampling, 3); - - // cut by LAr region (+- EndCap, All) - int cutSub = parameterStore.get("CutsCalo", "LAr").getI(); - if(cutSub != -1) - { - - int num = 0; - for(int i = 0; i < numDraw; i++) - { - - switch(cutSub){ - case 0: - if(side[listdl[i]] == -2 || side[listdl[i]] == -3){ - listdl[num++] = listdl[i]; - } - break; - case 1: - if(side[listdl[i]] == 2 || side[listdl[i]] == 3){ - listdl[num++] = listdl[i]; - } - break; - case 2: - if(Math.abs(side[listdl[i]]) != 1){ - listdl[num++] = listdl[i]; - } - break; - case 3: - if(Math.abs(side[listdl[i]]) == 1){ - listdl[num++] = listdl[i]; - } - break; - default: - break; - - - } - } - numDraw = num; - - } - } // applyCuts() -------------------------------------------------------- - - - /** - * Returns the name of the parameter group. - * - * @return String parameter group - */ - public String getParameterGroup() - { - return "LAr"; - } - - /** - * Returns the name of the datatype. - * - * @return String datatype - */ - public String getName() - { - return "LAr"; - } - - /** - * Returns the name of the datatype. - * - * @return String datatype - */ - public String getNameScreenName() - { - return "LAr"; - } - - /** - * Returns the type of calorimeter (ECAL/HCAL) for a hit. - * - * @param index int hit index - * @return String calorimeter type - */ - public String getCalorimeterType(int index) - { - return "ECAL"; - } - - /** - * Returns the histograms for this projection. - * - * @param projection AProjection2D current projection - * @return ACoord[] polygons representing histograms - */ - protected ACoord[] getUserHistograms(AProjection2D projection) - { - ACoord[] data = ACoord.NO_HISTOGRAMS; - int mode = parameterStore.get("YX", "Mode").getI(); - if ((projection instanceof AProjectionYX) && (mode == AProjectionYX.MODE_STANDARD || - mode == AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER || - mode == AProjectionYX.MODE_LAR_ENDCAP_1 || - mode == AProjectionYX.MODE_LAR_ENDCAP_2 || - mode == AProjectionYX.MODE_LAR_ENDCAP_3 || - mode == AProjectionYX.MODE_LAR_ENDCAP_SUMMED)) - data = getYXHistograms(); - else if (projection instanceof AProjectionFR) - data = getFRHistograms(); - else if (projection instanceof AProjectionRZ) - data = getRZHistograms(); - else if (projection instanceof AProjectionFZ) - data = getFZHistograms(); - return projection.nonLinearTransform(data); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ALVL1JetElementData.java b/graphics/AtlantisJava/src/atlantis/data/ALVL1JetElementData.java deleted file mode 100644 index a4aa50b1eaa69d4f8fbec6cb8b3355fe79f37b57..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ALVL1JetElementData.java +++ /dev/null @@ -1,446 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import java.awt.Color; - -import atlantis.canvas.AWindow; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.ADrawParameters; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionVP; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; -import atlantis.utils.APolygon; - -public class ALVL1JetElementData extends AData -{ - private float[] energy; - private float[] eta; - private float[] deta; - private float[] phi; - private float[] dphi; - - ALVL1JetElementData(AHashMap p, AEvent e) - { - super(p,e); - - phi = p.getFloatArray("phi"); - eta = p.getFloatArray("eta"); - // here energy is actually Et - energy = p.getFloatArray("energy"); - - deta = new float[numData]; - dphi = new float[numData]; - - fillGranularity(); - } - - private void fillGranularity() - { - for(int i = 0; i < numData; ++i) - { - float positiveEta = Math.abs(eta[i]); - if(positiveEta <= 2.4) - { - deta[i] = 0.1f; - dphi[i] = (float) (Math.PI / 32.); - } - else if(positiveEta <= 2.7) - { - deta[i] = 0.15f; - dphi[i] = (float) (Math.PI / 32.); - } - else if(positiveEta <= 2.9) - { - deta[i] = 0.1f; - dphi[i] = (float) (Math.PI / 32.); - } - else if(positiveEta <= 3.2) - { - deta[i] = 0.15f; - dphi[i] = (float) (Math.PI / 32.); - } - else - { - deta[i] = 0.9f; - dphi[i] = (float) (Math.PI / 16.); - } - } - } - - public double getEta(int index) - { - return eta[index]; - } - - public double getdEta(int index) - { - return deta[index]; - } - - public double getPhi(int index) - { - return phi[index]; - } - - public double getdPhi(int index) - { - return dphi[index]; - } - - public double getET(int index) - { - return energy[index]; - } - - public String getNameScreenName() - { - return "LVL1JetElement"; - } - - public String getParameterGroup() - { - return "LVL1JetElement"; - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+ - "\n E="+String.format("%.3f",energy[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n Energy = "); - msg.append(String.format("%.3f",energy[index])); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",phi[index])); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - - return msg.toString(); - } - - protected void applyCuts() - { - cutIndex(); - cut("CutsCalo", "LVL1TriggerET", " ET", energy); - cutPhi(phi, dphi); - cutEtaDEta(eta, deta); - } - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if(colorFunction == 0) - colorByConstant(); - - return 1; - } - - protected int getDrawOrFill() - { - return AGraphics.FILL; - } - - protected ACoord getYXUser() - { - makeDrawList(); - - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiPlus = phi[list] + dphi[list]; - double phiMinus = phi[list] - dphi[list]; - double cosPlus = Math.cos(phiPlus); - double sinPlus = Math.sin(phiPlus); - double cosMinus = Math.cos(phiMinus); - double sinMinus = Math.sin(phiMinus); - - // Rho range of Calo Detector is about between [148.175, 386] - double rhoMax = 380; - double rhoMinus = 155; - - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double rhoPlus = rhoMax; - if(Math.abs(energy[list]) < maxEnergy) - rhoPlus = rhoMinus + (rhoMax - rhoMinus) * Math.abs(energy[list]) / maxEnergy; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = rhoMinus * cosPlus; - hv[1][i][0] = rhoMinus * sinPlus; - // x1, y1 - hv[0][i][1] = rhoPlus * cosPlus; - hv[1][i][1] = rhoPlus * sinPlus; - // x2, y2 - hv[0][i][2] = rhoPlus * cosMinus; - hv[1][i][2] = rhoPlus * sinMinus; - // x3, y3 - hv[0][i][3] = rhoMinus * cosMinus; - hv[1][i][3] = rhoMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - - protected ACoord getFRUser() - { - ACoord coordFR = getYXUser().convertYXToFR().includePhiWrapAround("FR"); - return coordFR; - } - - protected ACoord getRZUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi[list]-phiMid); - double rSign; - if (phiDiff > Math.PI/2. && phiDiff <= 3*Math.PI/2.) - rSign = -1; - else - rSign = 1; - - // calculate theta based on the eta value - double theta = Math.atan(Math.exp(-Math.abs(eta[list]))) * 2.0; - double thetaPlus = Math.atan(Math.exp(-(Math.abs(eta[list]) - deta[list]))) * 2.0; - double thetaMinus = Math.atan(Math.exp(-(Math.abs(eta[list]) + deta[list]))) * 2.0; - - if ((eta[list] > 0.) && (rSign == -1)) - { - theta = 2 * Math.PI - theta; - thetaPlus = 2 * Math.PI - thetaPlus; - thetaMinus = 2 * Math.PI - thetaMinus; - } - else if ((eta[list] < 0.) && (rSign == -1)) - { - theta += Math.PI; - thetaPlus += Math.PI; - thetaMinus += Math.PI; - } - else if ((eta[list] < 0.) && (rSign == 1)) - { - theta = Math.PI - theta; - thetaPlus = Math.PI - thetaPlus; - thetaMinus = Math.PI - thetaMinus; - } - - double cosPlus = Math.cos(thetaPlus); - double sinPlus = Math.sin(thetaPlus); - double cosMinus = Math.cos(thetaMinus); - double sinMinus = Math.sin(thetaMinus); - - // decide the region based on the theta value - final byte LAR = 0; - final byte LAR_ENDCAP = 1; - final byte FCAL_EM = 2; - byte region = LAR; - // hard-coded value is based on the values in AGeometry.xml - if(Math.abs(Math.tan(theta)) >= 0.0778 && Math.abs(Math.tan(theta)) < 0.4828) - region = LAR_ENDCAP; - else if(Math.abs(Math.tan(theta)) < 0.0778) - region = FCAL_EM; - - double radiusMinus = 0.; - switch(region) - { - // use fixed rho/z to determine the lower radius value - case LAR: - radiusMinus = 155 / Math.abs(Math.sin(theta)); - break; - case LAR_ENDCAP: - radiusMinus = 380 / Math.abs(Math.cos(theta)); - break; - case FCAL_EM: - radiusMinus = 470 / Math.abs(Math.cos(theta)); - break; - } - double radiusMax = radiusMinus + 200; - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double radiusPlus = radiusMax; - if(Math.abs(energy[list]) < maxEnergy) - radiusPlus = radiusMinus + (radiusMax - radiusMinus) * Math.abs(energy[list]) / maxEnergy; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = radiusMinus * cosPlus; - hv[1][i][0] = radiusMinus * sinPlus; - // x1, y1 - hv[0][i][1] = radiusPlus * cosPlus; - hv[1][i][1] = radiusPlus * sinPlus; - // x2, y2 - hv[0][i][2] = radiusPlus * cosMinus; - hv[1][i][2] = radiusPlus * sinMinus; - // x3, y3 - hv[0][i][3] = radiusMinus * cosMinus; - hv[1][i][3] = radiusMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - - protected ACoord getVPUser() - { - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index=new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list=listdl[i]; - h[i]=eta[list]; - v[i]=Math.toDegrees(phi[list]); - index[i]=list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - } - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if(projection instanceof AProjectionVP) - { - ACoord centers=getUser(projection); - - int[] drawlist=centers.index; - double[] density = new double[drawlist.length]; - double maxDensity = 0.0; - double[][][] hv=new double[2][drawlist.length][4]; // cell - int[] index = new int[drawlist.length]; - ACoord geoCell; - - for(int i=0; i<drawlist.length; ++i) - { - int list=drawlist[i]; - // y coordinate of four cell corners - hv[1][i][0] = centers.hv[1][0][i] + Math.toDegrees(getdPhi(list)); - hv[1][i][1] = centers.hv[1][0][i] - Math.toDegrees(getdPhi(list)); - hv[1][i][2] = centers.hv[1][0][i] - Math.toDegrees(getdPhi(list)); - hv[1][i][3] = centers.hv[1][0][i] + Math.toDegrees(getdPhi(list)); - // x coordinate of four cell corners - hv[0][i][0] = centers.hv[0][0][i] - getdEta(list); - hv[0][i][1] = centers.hv[0][0][i] - getdEta(list); - hv[0][i][2] = centers.hv[0][0][i] + getdEta(list); - hv[0][i][3] = centers.hv[0][0][i] + getdEta(list); - - index[i] = list; - - // calculate density for all cells, and find min and max density - density[i] = Math.abs(energy[list]) / (getdPhi(list) * getdEta(list)); - if(i == 0) - maxDensity = density[i]; - else - { - if (density[i] > maxDensity) - maxDensity = density[i]; - } - } - - geoCell = window.calculateDisplay(new ACoord(hv, index, this, ACoord.POLYGONS)); - drawGeometry(geoCell, window, ag); - for (int i = 0; i < density.length; i++) - { - double factor = Math.sqrt(density[i] / maxDensity); - APolygon.scale(geoCell.hv[0][i], geoCell.hv[1][i], factor); - } - - drawHits(geoCell, window, ag); - } - else - { - super.draw(window, ag, projection); - } - } - - private void drawGeometry(ACoord display, AWindow window, AGraphics ag) - { - Color[] colorMap = AColorMap.getColors(); - boolean drawCellGeometry = parameterStore.get(getParameterGroup(), "CellGeometry").getStatus(); - boolean drawCellOutline = parameterStore.get(getParameterGroup(), "CellOutline").getStatus(); - int cellGeometryColor = parameterStore.get(getParameterGroup(), "CellGeometry").getI(); - int cellOutlineColor = parameterStore.get(getParameterGroup(), "CellOutline").getI(); - boolean drawFrame = parameterStore.get(getParameterGroup(), "Frame").getStatus(); - int frameColor = parameterStore.get(getParameterGroup(), "Frame").getI(); - int frameWidth = parameterStore.get(getParameterGroup(), "FrameWidth").getI(); - //only draw frames for Grey/BW color maps if is selected to draw frames - if(drawFrame && AColorMap.drawFrames()) - drawFrame=true; - else - drawFrame=false; - - if(!drawCellGeometry && !drawCellOutline) - return; - - // Draw geometry - for(int i=0; i<display.hv[0].length; ++i) - { - if(drawCellGeometry) - { - if(drawFrame) - { - ag.updateDrawParameters(new ADrawParameters(true, frameColor, 1, 0, frameWidth, 0)); - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - ag.updateDrawParameters(new ADrawParameters(true, cellGeometryColor, 1, 0, 0, 0)); - ag.fillPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - if(drawCellOutline) - { - ag.setColor(colorMap[cellOutlineColor]); - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - } - - private void drawHits(ACoord display, AWindow window, AGraphics ag) - { - int[] color = this.getColor(display.index); - - boolean drawCellGeometry = parameterStore.get(getParameterGroup(), "CellGeometry").getStatus(); - boolean drawFrame = parameterStore.get(getParameterGroup(), "Frame").getStatus(); - int frameColor = parameterStore.get(getParameterGroup(), "Frame").getI(); - int frameWidth = parameterStore.get(getParameterGroup(), "FrameWidth").getI(); - - // draw frame - if (drawFrame && !drawCellGeometry) - { - for (int i = 0; i < display.hv[0].length; i++) - { - ag.updateDrawParameters(new ADrawParameters(true, frameColor, 1, 0, frameWidth, 0)); - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - - // draw hits - for(int i=0; i<display.hv[0].length; ++i) - { - int lineWidth = parameterStore.get(getParameterGroup(), "LineWidth").getI(); - ag.updateDrawParameters(new ADrawParameters(true, color[i], 1, lineWidth, 0, 0)); - ag.fillPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ALVL1ResultData.java b/graphics/AtlantisJava/src/atlantis/data/ALVL1ResultData.java deleted file mode 100755 index db7dc97e2b1d1fe2c907aa4e87f0df8f1b634aef..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ALVL1ResultData.java +++ /dev/null @@ -1,292 +0,0 @@ -package atlantis.data; - -import atlantis.event.AData; -import atlantis.event.*; -import atlantis.utils.AHashMap; - -public class ALVL1ResultData extends AData -{ - private String[] ctpItemList; - private String[] itemListL2; - private String[] itemListEF; - private int[] ctpWord0; - private int[] ctpWord1; - private int[] ctpWord2; - private float[] energyEtMiss; - //private float[] energyEx; - //private float[] energyEy; - private float[] energySumEt; - private int[] passedL1; - private int[] passedL2; - private int[] passedEF; - private int[] passedTrigger; - private String[] prescaleListEF; - private String[] prescaleListL1; - private String[] prescaleListL2; - - ALVL1ResultData(AHashMap p, AEvent e) - { - super(p,e); - - ctpItemList = p.getStringArray("ctpItemList"); - itemListL2 = p.getStringArray("itemListL2"); - itemListEF = p.getStringArray("itemListEF"); - ctpWord0 = p.getUnknownIntArray("ctpWord0"); - ctpWord1 = p.getUnknownIntArray("ctpWord1"); - ctpWord2 = p.getUnknownIntArray("ctpWord2"); - energyEtMiss = p.getUnknownFloatArray("energyEtMiss"); - //energyEx = p.getUnknownFloatArray("energyEx"); - //energyEy = p.getUnknownFloatArray("energyEy"); - energySumEt = p.getUnknownFloatArray("energySumEt"); - passedL1 = p.getUnknownIntArray("passedL1"); - passedL2 = p.getUnknownIntArray("passedL2"); - passedEF = p.getUnknownIntArray("passedEF"); - passedTrigger = p.getUnknownIntArray("passedTrigger"); - //check for backward compatibility - prescaleListEF = (p.get("prescaleListEF") != null) ? p.getStringArray("prescaleListEF"): null; - prescaleListL1 = (p.get("prescaleListL1") != null) ? p.getStringArray("prescaleListL1"): null; - prescaleListL2 = (p.get("prescaleListL2") != null) ? p.getStringArray("prescaleListL2"): null; - } - - protected void applyCuts() - {} - - public String getHitInfo(int index) - { - return "LVL1Result"; - } - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if(colorFunction == 0) - colorByConstant(); - - return 3; - } - - public String getParameterGroup() - { - return "LVL1Result"; - } - - public String getNameScreenName() - { - return "LVL1Result"; - } - - public String getCtpItemList(int index) - { - return ctpItemList[index]; - } - - /** - * Returns the individual parts of the list seperated by - - * By using cleanup removes L1 from the item - */ - public String[] getCtpItemListSplit(int index, boolean cleanUp) - { - if(ctpItemList!=null) - { - if(cleanUp) - return splitItems(ctpItemList[index], "L1"); - else - return splitItems(ctpItemList[index]); - } - else - return null; - } - - public String getitemListL2(int index) - { - return itemListL2[index]; - } - - /** - * Returns the individual parts of the list seperated by - - * By using cleanup removes L2 from the item - */ - public String[] getitemListL2Split(int index, boolean cleanUp) - { - if(itemListL2!=null) - { - if(cleanUp) - return splitItems(itemListL2[index], "L2"); - else - return splitItems(itemListL2[index]); - } - else - return null; - } - - public String getitemListEF(int index) - { - return itemListEF[index]; - } - - /** - * Returns the individual parts of the list seperated by - - * By using cleanup removes EF from the item - */ - public String[] getitemListEFSplit(int index, boolean cleanUp) - { - if(itemListEF!=null) - { - if(cleanUp) - return splitItems(itemListEF[index], "EF"); - else - return splitItems(itemListEF[index]); - } - else - return null; - } - - public int getCtpWord0(int index) - { - return ctpWord0[index]; - } - - public String getBinaryCtpWord0(int index) - { - return Integer.toBinaryString(ctpWord0[index]); - } - - public int getCtpWord1(int index) - { - return ctpWord1[index]; - } - - public int getCtpWord2(int index) - { - return ctpWord2[index]; - } - - /** - * This method is needed for backward compatibility - * New xml files store this in ATriggerInfoData - */ - public float getEnergyEtMiss(int index) - { - return energyEtMiss[index]; - } - - /*public float getEnergyEx(int index) - { - return energyEx[index]; - } - public float getEnergyEy(int index) - { - return energyEy[index]; - }*/ - - /** - * This method is needed for backward compatibility - * New xml files store this in ATriggerInfoData - */ - public float getEnergySumEt(int index) - { - return energySumEt[index]; - } - - public int getPassedL1(int index) - { - return passedL1[index]; - } - - public int getPassedL2(int index) - { - return passedL2[index]; - } - - public int getPassedEF(int index) - { - return passedEF[index]; - } - - public int getPassedTrigger(int index) - { - return passedTrigger[index]; - } - - public String getPrescaleListEF(int index) - { - return prescaleListEF[index]; - } - - /** - * Returns the individual parts of the list seperated by - - */ - public String[] getPrescaleListEFSplit(int index) - { - if(prescaleListEF!=null) - return splitItems(prescaleListEF[index]); - else - return null; - } - - public String getPrescaleListL1(int index) - { - return prescaleListL1[index]; - } - - /** - * Returns the individual parts of the list seperated by - - */ - public String[] getPrescaleListL1Split(int index) - { - if(prescaleListL1!=null) - return splitItems(prescaleListL1[index]); - else - return null; - } - - public String getPrescaleListL2(int index) - { - return prescaleListL2[index]; - } - - /** - * Returns the individual parts of the list seperated by - - */ - public String[] getPrescaleListL2Split(int index) - { - if(prescaleListL2!=null) - return splitItems(prescaleListL2[index]); - else - return null; - } - - /** - * Function that seperates an item list and carries out cleanup - */ - private String[] splitItems(String origItems, String level) - { - //string array to hold individual items - String[] newItems=splitItems(origItems); - //remove letters from start of item and duplicated names - char[] levelChar = level.toCharArray(); - for(int i=0; i<newItems.length; i++) - { - char[] newItemsChar = newItems[i].toCharArray(); - if(newItemsChar[0]==levelChar[0] && newItemsChar[1]==levelChar[1]) - { - if(newItemsChar[2]=='_') - newItems[i]=newItems[i].substring(3); - else - newItems[i]=newItems[i].substring(2); - //get rid of duplicated parts of name - char[] newItemsChar2 = newItems[i].toCharArray(); - for(int j=0; j<newItemsChar2.length-1; j++) - { - if(newItemsChar2[j]==levelChar[0] && newItemsChar2[j+1]==levelChar[1]) - { - newItems[i]=newItems[i].substring(0, j); - break; - } - } - } - } - return newItems; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ALVL1TriggerTowerData.java b/graphics/AtlantisJava/src/atlantis/data/ALVL1TriggerTowerData.java deleted file mode 100644 index 9cfef10134281a7ee7345217f497c1b4c6f6bc0c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ALVL1TriggerTowerData.java +++ /dev/null @@ -1,800 +0,0 @@ -package atlantis.data; - -import java.util.Arrays; - -import atlantis.canvas.AWindow; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.ADrawParameters; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.list.AListManager; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; -import atlantis.utils.APolygon; - -public class ALVL1TriggerTowerData extends AData -{ - public static final boolean ELECTROMAGNETIC = true; - public static final boolean HADRONIC = false; - - // here energy is actually Et - private float[] emEnergy; - private float[] hadEnergy; - private float[] sumEnergy; - private float[] eta; - private float[] deta_em; - private float[] deta_had; - private float[] phi; - private float[] dphi_em; - private float[] dphi_had; - private int[] numADC; - private int[][] hadADC; - private int[][] emADC; - private int[] emBCID; - private int[] hadBCID; - private int[] isEMSaturated; - private int[] isHadSaturated; - - ALVL1TriggerTowerData(AHashMap p, AEvent e) - { - super(p,e); - - phi = p.getFloatArray("phi"); - eta = p.getFloatArray("eta"); - emEnergy = p.getFloatArray("emEnergy"); - hadEnergy = p.getFloatArray("hadEnergy"); - sumEnergy = p.getFloatArray("sumEnergy"); - - deta_em = new float[numData]; - deta_had = new float[numData]; - dphi_em = new float[numData]; - dphi_had = new float[numData]; - - fillGranularity(); - - numADC = p.getIntArray("numADC"); - emADC = fillADC(p.getIntArray("emADC")); - hadADC = fillADC(p.getIntArray("hadADC")); - emBCID = p.getIntArray("emBCID"); - hadBCID = p.getIntArray("hadBCID"); - isEMSaturated = p.getIntArray("isEMSaturated"); - isHadSaturated = p.getIntArray("isHadSaturated"); - } - - private void fillGranularity() - { - for(int i = 0; i < numData; ++i) - { - float positiveEta = Math.abs(eta[i]); - if(positiveEta <= 2.4) - { - deta_em[i] = 0.05f; - dphi_em[i] = (float) (Math.PI / 64.); - deta_had[i] = 0.05f; - dphi_had[i] = (float) (Math.PI / 64.); - } - else if(positiveEta <= 2.5) - { - deta_em[i] = 0.05f; - dphi_em[i] = (float) (Math.PI / 64.); - deta_had[i] = 0.1f; - dphi_had[i] = (float) (Math.PI / 32.); - } - else if(positiveEta <= 3.0) - { - deta_em[i] = 0.1f; - dphi_em[i] = (float) (Math.PI / 32.); - deta_had[i] = 0.1f; - dphi_had[i] = (float) (Math.PI / 32.); - } - else if(positiveEta <= 3.1) - { - deta_em[i] = 0.1f; - dphi_em[i] = (float) (Math.PI / 32.); - deta_had[i] = 0.05f; - dphi_had[i] = (float) (Math.PI / 32.); - } - else if(positiveEta <= 3.2) - { - deta_em[i] = 0.05f; - dphi_em[i] = (float) (Math.PI / 32.); - deta_had[i] = 0.2f; - dphi_had[i] = (float) (Math.PI / 16.); - } - else if(positiveEta <= 4.3) - { - deta_em[i] = 0.2f; - dphi_em[i] = (float) (Math.PI / 16.); - deta_had[i] = 0.2f; - dphi_had[i] = (float) (Math.PI / 16.); - } - else if(positiveEta <= 4.4) - { - deta_em[i] = 0.2f; - dphi_em[i] = (float) (Math.PI / 16.); - deta_had[i] = 0.35f; - dphi_had[i] = (float) (Math.PI / 16.); - } - else - { - deta_em[i] = 0.3f; - dphi_em[i] = (float) (Math.PI / 16.); - deta_had[i] = 0.35f; - dphi_had[i] = (float) (Math.PI / 16.); - } - } - } - - public int[][] fillADC(int[] tempADC) - { - int[][] ADC=null; - if(tempADC!=null) - { - ADC= new int[numADC.length][0]; - int num=0; - for(int i=0; i<numADC.length; i++) - { - // multiple numbers are associated with each cell - ADC[i]=new int[numADC[i]]; - for(int j=0; j<numADC[i]; j++) - { - ADC[i][j]=tempADC[num]; // fill in array for each cell - num++; - } - } - } // if(ADC != null) - return ADC; - } - - public void plotPulseShapes(int index) - { - if(emADC!=null && hadADC!=null) - { - //int[][] data={hadADC[index],emADC[index]}; - String[] labels={"EM trigger ADC counts","HAD trigger ADC counts","Sum trigger ADC counts"}; - int[] sumADC= new int[emADC[index].length]; - String[] axis= new String[3]; - String[] colors = new String[3]; - //EM plot - if(isEMSaturated[index]==0) - colors[0]="blue"; - else - colors[0]="red"; - axis[0]="index (BCID="+emBCID[index]+")"; - //HAD plot - if(isHadSaturated[index]==0) - colors[1]="blue"; - else - colors[0]="red"; - axis[1]="index (BCID="+hadBCID[index]+")"; - //Sum plot - colors[2]="blue"; - axis[2]="index"; - for(int i=0; i<emADC[index].length; i++) - { - sumADC[i]=emADC[index][i]+hadADC[index][i]; - } - int[][] data={emADC[index],hadADC[index],sumADC}; - String title="LVL1TriggerTower " + id[index] + " ADC counts"; - APulseShapePlot.plotADCCounts(data, title, axis, labels, colors); - } - else - { - if(emADC!=null) - { - int[][] data={emADC[index]}; - String[] axis={"index"}; - APulseShapePlot.plotADCCounts(data, "EM trigger ADC counts", axis); - } - if(hadADC!=null) - { - int[][] data={hadADC[index]}; - String[] axis={"index"}; - APulseShapePlot.plotADCCounts(data, "HAD trigger ADC counts", axis); - } - } - } - - public double getEta(int index) - { - return eta[index]; - } - - public double getdEta(int index, boolean emOrHad) - { - if(emOrHad == ELECTROMAGNETIC) - return deta_em[index]; - else - return deta_had[index]; - } - - public double getPhi(int index) - { - return phi[index]; - } - - public double getdPhi(int index, boolean emOrHad) - { - if(emOrHad == ELECTROMAGNETIC) - return dphi_em[index]; - else - return dphi_had[index]; - } - - public double getET(int index, boolean emOrHad) - { - if(emOrHad == ELECTROMAGNETIC) - return emEnergy[index]; - else - return hadEnergy[index]; - } - - public double getSumET(int index) - { - return sumEnergy[index]; - } - - public String getNameScreenName() - { - return "LVL1TriggerTower"; - } - - public String getParameterGroup() - { - return "LVL1TriggerTower"; - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+ - "\n E="+String.format("%.3f",sumEnergy[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n EM Energy = "); - msg.append(String.format("%.3f",emEnergy[index])); - msg.append(" GeV\n Had Energy = "); - msg.append(String.format("%.3f",hadEnergy[index])); - msg.append(" GeV\n Sum Energy = "); - msg.append(String.format("%.3f",sumEnergy[index])); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",Math.toDegrees(phi[index]))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - - return msg.toString(); - } - - protected void applyCuts() - { - cutIndex(); - cut("CutsCalo", "LVL1TriggerET", " ET", sumEnergy); - } - - public void applyEMCuts() - { - cutPhi(phi, dphi_em); - cutEtaDEta(eta, deta_em); - } - - public void applyHadCuts() - { - cutPhi(phi, dphi_had); - cutEtaDEta(eta, deta_had); - } - - public byte[] getColor(boolean emOrHad) - { - internalColor(emOrHad); - coloring(); - byte[] temp = new byte[id.length]; - for(int i = 0; i < temp.length; i++) - temp[i] = color[getIndexFromId(id[i])]; - return temp; - } - - /* - * Returns the colours of the trigger tower cells - * If this method is used then internalColor(boolean emOrHad) - * must be called first elsewhere - */ - public int[] getColor(int[] dl) - { - coloring(); - int[] temp = new int[dl.length]; - - for(int i = 0; i < temp.length; i++) - temp[i] = color[dl[i]]; - return temp; - } - - /* - * Colour the cells if in lists or picked - * If this method is used then internalColor(boolean emOrHad) - * must be called first elsewhere - */ - public void coloring() - { - int[][] temp = AListManager.getInstance().getColorMapping(this); - int[] index = temp[0]; - int[] c = temp[1]; - // now add in colours specified in lists - - for(int i = 0; i < index.length; ++i) - if(c[i] >= 0) - color[index[i]] = (byte) c[i]; - int others = AListManager.getInstance().getColorOfOthers(); - // need to check if this data could have been picked - // so that colouring of hits by STr works even if STr - // is not in list because it wasn't on.... - if(others >= 0 && parameterStore.get("Data", getName()).getStatus()) - { - boolean[] inList = new boolean[numData]; - for(int i = 0; i < index.length; ++i) - inList[index[i]] = true; - - for(int i = 0; i < numData; ++i) - if(!inList[i]) - color[i] = (byte) others; - } - } - - protected int internalColor() - { - colorByConstant(); - return 1; - } - - protected int internalColor(boolean emOrHad) - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - if(colorFunction == 0) - colorByConstant(); - else if(colorFunction ==1) - { - if(emOrHad == ELECTROMAGNETIC) - Arrays.fill(color, (byte) (parameterStore.get("Det", "ECALFill").getI() + 12)); - else - Arrays.fill(color, (byte) (parameterStore.get("Det", "HCALFill").getI() + 12)); - } - return 1; - } - - protected int getDrawOrFill() - { - return AGraphics.FILL; - } - - private void drawVP(AWindow window, AGraphics ag, boolean emOrHad) - { - ACoord centers = getVPUser(emOrHad); - - if(centers == null) - return; - - int[] drawlist = centers.index; - double[] density = new double[drawlist.length]; - double[] sumDensity = new double[drawlist.length]; - double maxDensity = 0.0; - double[][][] hv = new double[2][drawlist.length][4]; // cell - int[] index = new int[drawlist.length]; - ACoord geoCell; - - for(int i=0; i<drawlist.length; ++i) - { - int list = drawlist[i]; - // y coordinate of four cell corners - hv[1][i][0] = centers.hv[1][0][i] + Math.toDegrees(getdPhi(list, emOrHad)); - hv[1][i][1] = centers.hv[1][0][i] - Math.toDegrees(getdPhi(list, emOrHad)); - hv[1][i][2] = centers.hv[1][0][i] - Math.toDegrees(getdPhi(list, emOrHad)); - hv[1][i][3] = centers.hv[1][0][i] + Math.toDegrees(getdPhi(list, emOrHad)); - // x coordinate of four cell corners - hv[0][i][0] = centers.hv[0][0][i] - getdEta(list, emOrHad); - hv[0][i][1] = centers.hv[0][0][i] - getdEta(list, emOrHad); - hv[0][i][2] = centers.hv[0][0][i] + getdEta(list, emOrHad); - hv[0][i][3] = centers.hv[0][0][i] + getdEta(list, emOrHad); - - index[i] = list; - - // calculate density for all cells, and find min and max density - density[i] = Math.abs(getET(list, emOrHad)) / (getdPhi(list, emOrHad) * getdEta(list, emOrHad)); - sumDensity[i] = Math.abs(getSumET(list)) / (getdPhi(list, emOrHad) * getdEta(list, emOrHad)); - if(i == 0) - maxDensity = sumDensity[i]; - else - { - if (sumDensity[i] > maxDensity) - maxDensity = sumDensity[i]; - } - } - - geoCell = window.calculateDisplay(new ACoord(hv, index, this, ACoord.POLYGONS)); - drawGeometry(geoCell, window, ag, density); - for (int i = 0; i < density.length; i++) - { - double factor = Math.sqrt(density[i] / maxDensity); - APolygon.scale(geoCell.hv[0][i], geoCell.hv[1][i], factor); - } - - drawHits(geoCell, window, ag, density); - } - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - int energyType = parameterStore.get(PARAMETER_GROUP, "EnergyType").getI(); - if(projection instanceof AProjectionYX) - { - if(energyType == 0 || energyType == 2) - { - internalColor(ELECTROMAGNETIC); - ag.draw(window.calculateDisplay(projection.nonLinearTransform(getYXUser(ELECTROMAGNETIC)))); - } - if(energyType == 1 || energyType == 2) - { - internalColor(HADRONIC); - ag.draw(window.calculateDisplay(projection.nonLinearTransform(getYXUser(HADRONIC)))); - } - } - else if(projection instanceof AProjectionFR) - { - if(energyType == 0 || energyType == 2) - { - internalColor(ELECTROMAGNETIC); - ag.draw(window.calculateDisplay(projection.nonLinearTransform(getFRUser(ELECTROMAGNETIC)))); - } - if(energyType == 1 || energyType == 2) - { - internalColor(HADRONIC); - ag.draw(window.calculateDisplay(projection.nonLinearTransform(getFRUser(HADRONIC)))); - } - } - else if(projection instanceof AProjectionRZ) - { - if(energyType == 0 || energyType == 2) - { - internalColor(ELECTROMAGNETIC); - ag.draw(window.calculateDisplay(projection.nonLinearTransform(getRZUser(ELECTROMAGNETIC)))); - } - if(energyType == 1 || energyType == 2) - { - internalColor(HADRONIC); - ag.draw(window.calculateDisplay(projection.nonLinearTransform(getRZUser(HADRONIC)))); - } - } - else if(projection instanceof AProjectionVP) - { - if(energyType == 0 || energyType == 2) - { - internalColor(ELECTROMAGNETIC); - drawVP(window, ag, ELECTROMAGNETIC); - } - if(energyType == 1 || energyType == 2) - { - internalColor(HADRONIC); - drawVP(window, ag, HADRONIC); - } - } - else - { - super.draw(window, ag, projection); - } - } - - private ACoord getYXUser(boolean emOrHad) - { - makeDrawList(); - if(emOrHad == ELECTROMAGNETIC) - applyEMCuts(); - else - applyHadCuts(); - - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double et = getET(list, emOrHad); - if(et == 0.0) - continue; - double dphi = getdPhi(list, emOrHad); - double phiPlus = phi[list] + dphi; - double phiMinus = phi[list] - dphi; - double cosPlus = Math.cos(phiPlus); - double sinPlus = Math.sin(phiPlus); - double cosMinus = Math.cos(phiMinus); - double sinMinus = Math.sin(phiMinus); - - double rhoMax; - double rhoMinus; - - if(emOrHad == ELECTROMAGNETIC) - { - // Rho range of LAr Detector (EM) is about between [148.175, 198.47] - rhoMax = 195; - rhoMinus = 155; - } - else - { - // Rho range of TILE Detector (Had) is about between [229, 386] - rhoMax = 380; - rhoMinus = 235; - } - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double rhoPlus = rhoMax; - if(Math.abs(et) < maxEnergy) - rhoPlus = rhoMinus + (rhoMax - rhoMinus) * Math.abs(et) / maxEnergy; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = rhoMinus * cosPlus; - hv[1][i][0] = rhoMinus * sinPlus; - // x1, y1 - hv[0][i][1] = rhoPlus * cosPlus; - hv[1][i][1] = rhoPlus * sinPlus; - // x2, y2 - hv[0][i][2] = rhoPlus * cosMinus; - hv[1][i][2] = rhoPlus * sinMinus; - // x3, y3 - hv[0][i][3] = rhoMinus * cosMinus; - hv[1][i][3] = rhoMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - - protected ACoord getFRUser(boolean emOrHad) - { - ACoord coordFR = getYXUser(emOrHad).convertYXToFR().includePhiWrapAround("FR"); - return coordFR; - } - - protected ACoord getRZUser(boolean emOrHad) - { - makeDrawList(); - if(emOrHad == ELECTROMAGNETIC) - applyEMCuts(); - else - applyHadCuts(); - - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - double et = getET(list, emOrHad); - if(et == 0.0) - continue; - - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi[list]-phiMid); - double rSign; - if (phiDiff > Math.PI/2. && phiDiff <= 3*Math.PI/2.) - rSign = -1; - else - rSign = 1; - - // calculate theta based on the eta value - double theta = Math.atan(Math.exp(-Math.abs(eta[list]))) * 2.0; - double deta = getdEta(list, emOrHad); - double thetaPlus = Math.atan(Math.exp(-(Math.abs(eta[list]) - deta))) * 2.0; - double thetaMinus = Math.atan(Math.exp(-(Math.abs(eta[list]) + deta))) * 2.0; - - if ((eta[list] > 0.) && (rSign == -1)) - { - theta = 2 * Math.PI - theta; - thetaPlus = 2 * Math.PI - thetaPlus; - thetaMinus = 2 * Math.PI - thetaMinus; - } - else if ((eta[list] < 0.) && (rSign == -1)) - { - theta += Math.PI; - thetaPlus += Math.PI; - thetaMinus += Math.PI; - } - else if ((eta[list] < 0.) && (rSign == 1)) - { - theta = Math.PI - theta; - thetaPlus = Math.PI - thetaPlus; - thetaMinus = Math.PI - thetaMinus; - } - - double cosPlus = Math.cos(thetaPlus); - double sinPlus = Math.sin(thetaPlus); - double cosMinus = Math.cos(thetaMinus); - double sinMinus = Math.sin(thetaMinus); - - // decide the region based on the theta value - final byte LAR = 0; - final byte LAR_ENDCAP = 1; - final byte FCAL_EM = 2; - byte region = LAR; - // hard-coded value is based on the values in AGeometry.xml - if(Math.abs(Math.tan(theta)) >= 0.0778 && Math.abs(Math.tan(theta)) < 0.4828) - region = LAR_ENDCAP; - else if(Math.abs(Math.tan(theta)) < 0.0778) - region = FCAL_EM; - - double radiusMinus = 0.; - double radiusMax = 0.; - switch(region) - { - // use fixed rho/z to determine the lower radius value - case LAR: - if(emOrHad == ELECTROMAGNETIC) - { - radiusMax = 195 / Math.abs(Math.sin(theta)); - radiusMinus = 155 / Math.abs(Math.sin(theta)); - } - else - { - radiusMax = 380 / Math.abs(Math.sin(theta)); - radiusMinus = 235 / Math.abs(Math.sin(theta)); - } - break; - case LAR_ENDCAP: - if(emOrHad == ELECTROMAGNETIC) - { - radiusMax = 420 / Math.abs(Math.cos(theta)); - radiusMinus = 380 / Math.abs(Math.cos(theta)); - } - else - { - radiusMax = 585 / Math.abs(Math.cos(theta)); - radiusMinus = 440 / Math.abs(Math.cos(theta)); - } - break; - case FCAL_EM: - if(emOrHad == ELECTROMAGNETIC) - { - radiusMax = 510 / Math.abs(Math.cos(theta)); - radiusMinus = 470 / Math.abs(Math.cos(theta)); - } - else - { - radiusMax = 600 / Math.abs(Math.cos(theta)); - radiusMinus = 520 / Math.abs(Math.cos(theta)); - } - break; - } - - double maxEnergy = parameterStore.get("Projection", "EnergyMax").getD(); - double radiusPlus = radiusMax; - if(Math.abs(et) < maxEnergy) - radiusPlus = radiusMinus + (radiusMax - radiusMinus) * Math.abs(et) / maxEnergy; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = radiusMinus * cosPlus; - hv[1][i][0] = radiusMinus * sinPlus; - // x1, y1 - hv[0][i][1] = radiusPlus * cosPlus; - hv[1][i][1] = radiusPlus * sinPlus; - // x2, y2 - hv[0][i][2] = radiusPlus * cosMinus; - hv[1][i][2] = radiusPlus * sinMinus; - // x3, y3 - hv[0][i][3] = radiusMinus * cosMinus; - hv[1][i][3] = radiusMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - - protected ACoord getVPUser(boolean emOrHad) - { - makeDrawList(); - if(emOrHad == ELECTROMAGNETIC) - applyEMCuts(); - else - applyHadCuts(); - - if(numDraw == 0) - return null; - - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index=new int[numDraw]; - - for(int i=0; i<numDraw; i++) - { - int list=listdl[i]; - h[i]=eta[list]; - v[i]=Math.toDegrees(phi[list]); - index[i]=list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - } - - private void drawGeometry(ACoord display, AWindow window, AGraphics ag, double[] density) - { - boolean drawCellGeometry = parameterStore.get(getParameterGroup(), "CellGeometry").getStatus(); - boolean drawCellOutline = parameterStore.get(getParameterGroup(), "CellOutline").getStatus(); - int cellGeometryColor = parameterStore.get(getParameterGroup(), "CellGeometry").getI(); - int cellOutlineColor = parameterStore.get(getParameterGroup(), "CellOutline").getI(); - boolean drawFrame = parameterStore.get(getParameterGroup(), "Frame").getStatus(); - int frameColor = parameterStore.get(getParameterGroup(), "Frame").getI(); - int frameWidth = parameterStore.get(getParameterGroup(), "FrameWidth").getI(); - //only draw frames for Grey/BW color maps if is selected to draw frames - if(drawFrame && AColorMap.drawFrames()) - drawFrame = true; - else - drawFrame = false; - - if(!drawCellGeometry && !drawCellOutline) - return; - - // Draw geometry - for(int i=0; i<display.hv[0].length; ++i) - { - if(density[i] == 0.0) - continue; - - if(drawCellGeometry) - { - if(drawFrame) - { - ag.updateDrawParameters(new ADrawParameters(true, frameColor, 1, 0, frameWidth, 0)); - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - ag.updateDrawParameters(new ADrawParameters(true, cellGeometryColor, 1, 0, 0, 0)); - ag.fillPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - if(drawCellOutline) - { - ag.updateDrawParameters(new ADrawParameters(true, cellOutlineColor, 0, 1, 0, 0, false, 1, 0)); - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - } - } - - private void drawHits(ACoord display, AWindow window, AGraphics ag, double[] density) - { - int[] color = this.getColor(display.index); - - boolean drawCellGeometry = parameterStore.get(getParameterGroup(), "CellGeometry").getStatus(); - boolean drawFrame = parameterStore.get(getParameterGroup(), "Frame").getStatus(); - int frameColor = parameterStore.get(getParameterGroup(), "Frame").getI(); - int frameWidth = parameterStore.get(getParameterGroup(), "FrameWidth").getI(); - int lineWidth = parameterStore.get(getParameterGroup(), "LineWidth").getI(); - - for(int i=0; i<display.hv[0].length; ++i) - { - if(density[i] == 0.0) - continue; - - // draw frame - if (drawFrame && !drawCellGeometry) - { - ag.updateDrawParameters(new ADrawParameters(true, frameColor, 1, 0, frameWidth, 0)); - ag.drawPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - } - - // draw hits - ag.updateDrawParameters(new ADrawParameters(true, color[i], 1, lineWidth, 0, 0)); - ag.setCurrentDataAndIndex(this, display.index[i]); - ag.fillPolygon(display.hv[0][i], display.hv[1][i], display.hv[0][i].length); - ag.clearCurrentDataAndIndex(); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ALegoData.java b/graphics/AtlantisJava/src/atlantis/data/ALegoData.java deleted file mode 100755 index 9c2593e53eda8073c9157b2fbdd3d3ae64f7ed89..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ALegoData.java +++ /dev/null @@ -1,1042 +0,0 @@ -package atlantis.data; - -import atlantis.event.AData; -import atlantis.event.*; -import java.awt.Color; -import java.awt.geom.Point2D; - -import java.util.Iterator; -import java.util.List; -import java.util.Stack; - -import atlantis.canvas.AWindow; -import atlantis.graphics.AGraphics; -import atlantis.graphics.ALegoDraw; -import atlantis.parameters.APar; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; - -public class ALegoData -{ - private static ALogger logger = ALogger.getLogger(ALegoData.class); - - private static APar parameterStore = APar.instance(); - - /** - * This function loops over the cell data to find the maxEt. - * It also rescales the height of the cells if different scales are selected - * @param lego the tower heights - * @return maxEt the heighest tower height - */ - public static double findMaxEt(double[][][] lego) - { - double maxEt = 0.0; - double[][] legosum = new double[lego.length][lego[0].length]; - //find colors to loop over - int largestColourIndex=0; - int lowestColourIndex=AProjectionLegoPlot.nLayers; - Iterator colorIterator = AProjectionLegoPlot.colorset.iterator(); - while(colorIterator.hasNext()) - { - int currentColor = ((Integer) colorIterator.next()).intValue(); - if(currentColor>largestColourIndex) - largestColourIndex=currentColor; - if(currentColor<lowestColourIndex) - lowestColourIndex=currentColor; - } - for (int x = AProjectionLegoPlot.nPhiCells - 1; x >= 0; --x) - { - for (int y = 0; y < AProjectionLegoPlot.nEtaCells; ++y) - { - for(int z=largestColourIndex; z>=lowestColourIndex; z--) - { - legosum[x][y] += lego[x][y][z]; - } - if(legosum[x][y] > maxEt) - maxEt = legosum[x][y]; - } - } - if(maxEt>0) - { - if (AProjectionLegoPlot.defaultScale ==1 ) - { - for (int x = AProjectionLegoPlot.nPhiCells - 1; x >= 0; --x) - { - for (int y = 0; y < AProjectionLegoPlot.nEtaCells; ++y) - { - for(int z=largestColourIndex; z>=lowestColourIndex; z--) - { - if(Math.log10(legosum[x][y])>=AProjectionLegoPlot.minimumofLogScale) - { - //if multiple colors then each take linear amount of full log - double fraction=(lego[x][y][z]/legosum[x][y]); - lego[x][y][z]=fraction*(Math.log10(legosum[x][y])-AProjectionLegoPlot.minimumofLogScale); - } - else - { - //if not above minimum of log scale then don't draw - lego[x][y][z]=0.0; - } - } - } - } - } - else if (AProjectionLegoPlot.defaultScale ==2 ) - { - for (int x = AProjectionLegoPlot.nPhiCells - 1; x >= 0; --x) - { - for (int y = 0; y < AProjectionLegoPlot.nEtaCells; ++y) - { - for(int z=largestColourIndex; z>=lowestColourIndex; z--) - { - //if multiple colors then each take linear amount of full sqrt - double fraction=(lego[x][y][z]/legosum[x][y]); - lego[x][y][z]=fraction*Math.sqrt(legosum[x][y]); - } - } - } - } - } - return maxEt; - } - - public static double findAODMaxEt(AEvent event) - { - double AODmaxEt = 0.0; - //From the caloCluster - String[] colCluster=event.getActiveCollectionNames("Cluster"); - for(int i=0;i<colCluster.length;i++) - { - AClusterData cluster = (AClusterData) event.get(colCluster[i]); - if (!parameterStore.get("Data", "Cluster").getStatus()) - cluster = null; - if (cluster != null) - { - cluster.makeDrawList(); - for (int m = 0; m < cluster.getNumDraw(); ++m) - { - int list = cluster.getDrawIndex(m); - float et = Math.abs(cluster.getET(list)); - if (et > AODmaxEt) - AODmaxEt = et; - } - } - } - //From the Jets - Added code to make th e jet considered in the AOD scaling - String[] colJet=event.getActiveCollectionNames("Jet"); - for(int i=0;i<colJet.length;i++) - { - AJetData jets = (AJetData) event.get(colJet[i]); - if (!parameterStore.get("Data", "Jet").getStatus()) - jets = null; - if (jets != null) - { - jets.makeDrawList(); - for (int m = 0; m < jets.getNumDraw(); ++m) - { - int list = jets.getDrawIndex(m); - float pt = Math.abs(jets.getPt()[list]); - if (pt > AODmaxEt) - AODmaxEt = pt; - } - } - } - // From the muons - String[] colMuon=event.getActiveCollectionNames("Muon"); - for(int i=0;i<colMuon.length;i++) - { - AMuonData muons = (AMuonData) event.get(colMuon[i]); - if (!parameterStore.get("Data", "Muon").getStatus()) - muons = null; - if (muons != null) - { - muons.makeDrawList(); - for (int m = 0; m < muons.getNumDraw(); ++m) - { - int list = muons.getDrawIndex(m); - float pt = Math.abs(muons.getPT(list)); - if (pt > AODmaxEt) - AODmaxEt = pt; - } - } - } - // From the electrons - String[] colElectron=event.getActiveCollectionNames("Electron"); - for(int i=0;i<colElectron.length;i++) - { - AElectronData electrons = (AElectronData) event.get(colElectron[i]); - if (!parameterStore.get("Data", "Electron").getStatus()) - electrons = null; - if (electrons != null) - { - - electrons.makeDrawList(); - for (int e = 0; e < electrons.getNumDraw(); ++e) - { - int list = electrons.getDrawIndex(e); - float pt = Math.abs(electrons.getPT(list)); - if (pt > AODmaxEt) - AODmaxEt = pt; - } - } - } - // From the photons - String[] colPhoton=event.getActiveCollectionNames("Photon"); - for(int i=0;i<colPhoton.length;i++) - { - APhotonData photons = (APhotonData) event.get(colPhoton[i]); - if (!parameterStore.get("Data", "Photon").getStatus()) - photons = null; - if (photons != null) - { - photons.makeDrawList(); - for (int p = 0; p < photons.getNumDraw(); ++p) - { - int list = photons.getDrawIndex(p); - float pt = Math.abs(photons.getPT(list)); - if (pt > AODmaxEt) - AODmaxEt = pt; - } - } - } - //From the compositeParticles - String[] colCompPart=event.getActiveCollectionNames("CompositeParticle"); - for(int i=0;i<colCompPart.length;i++) - { - ACompositeParticleData compositeParticles = (ACompositeParticleData) event.get(colCompPart[i]); - if (!parameterStore.get("Data", "CompositeParticle").getStatus()) - compositeParticles = null; - if (compositeParticles != null) - { - compositeParticles.makeDrawList(); - for (int e = 0; e < compositeParticles.getNumDraw(); ++e) - { - int list = compositeParticles.getDrawIndex(e); - float pt = Math.abs(compositeParticles.getPT(list)); - if (pt > AODmaxEt) - AODmaxEt = pt; - } - } - } - - return AODmaxEt; - } - - public static double findMissingEt(AWindow window, double[][][] lego, AEvent event) - { - double met = 0.; - List hitsAndTracks = event.getHitsAndTracks(window.getProjection()); - for (int h = 0; h < hitsAndTracks.size(); h++) - { - AData datatype = ((AData) hitsAndTracks.get(h)); - if (datatype.getName().equals("ETMis")) - { - AETMisData mis = (AETMisData) datatype; - mis.makeDrawList(); - if (mis.getNumDraw() > 0) - { - double temp = Math.sqrt(mis.getETx() * mis.getETx() + mis.getETy() * mis.getETy()); - if(temp>met) - met=temp; - } - } - } - return met; - } - - public static void fillHistograms(AEvent event, double[][][] lego) - { - AProjectionLegoPlot.colorset.clear(); - if (AProjectionLegoPlot.mode == 0) - { - // Calorimeter Lego - fillCaloLego(event, lego); - } - else if (AProjectionLegoPlot.mode == 1) - { - // Trigger Tower Lego - fillTriggerTowerLego(event, lego); - } - else - { - // Jet Elements Lego - fillJetElementLego(event, lego); - } - } - - private static void fillCaloLego(AEvent event, double[][][] lego) - { - List detectors = event.getCalorimeters(); - for (int det = 0; det < detectors.size(); det++) - { - ACalorimeterData calorimeter = (ACalorimeterData) detectors.get(det); - String calname=calorimeter.getName(); - if (!calname.equals("TILE") && !calname.equals("FCAL") - && !calname.equals("HEC") && !calname.equals("LAr") - && !calname.equals("MBTS")) - { - logger.warn("Unknown calorimeter name for LegoPlot: " + calorimeter.getName()); - } - - calorimeter.makeDrawList(); - // for coloring - byte[] c = calorimeter.getColor(); - for (int i = 0; i < calorimeter.getNumDraw(); ++i) - { - int list = calorimeter.getDrawIndex(i); - double et = calorimeter.getET(list); - //MBTS energy is in MeV not GeV - if(calname.equals("MBTS")) et/=1000.; - double phi = calorimeter.getPhi(list); - double eta = calorimeter.getEta(list); - if (eta > 5 || eta < -5 || et == 0.0) - continue; - double dphi = calorimeter.getdPhi(list); - double deta = calorimeter.getdEta(list); - phietabinsLoop("calo", phi, dphi, eta, deta, c[list], et, lego); - }// loop over that calorimeter's cells - }// loop over the calorimeters - } - - private static void fillTriggerTowerLego(AEvent event, double[][][] lego) - { - //will draw even if data status is off - String[] colTT=event.getCollectionNames("LVL1TriggerTower"); - for(int k=0;k<colTT.length;k++) - { - ALVL1TriggerTowerData lvl1TriggerTower = (ALVL1TriggerTowerData) event.get(colTT[k]); - if (lvl1TriggerTower == null) - continue; - - byte[] ttColor; - for (int j = 0; j < 2; ++j) - { - int energyType = parameterStore.get(lvl1TriggerTower.getParameterGroup(), "EnergyType").getI(); - if((j == 0 && energyType == 1) || (j == 1 && energyType == 0)) - continue; - lvl1TriggerTower.makeDrawList(); - - boolean emOrHad; - if (j == 0) - { - emOrHad = ALVL1TriggerTowerData.ELECTROMAGNETIC; - lvl1TriggerTower.applyEMCuts(); - } - else - { - emOrHad = ALVL1TriggerTowerData.HADRONIC; - lvl1TriggerTower.applyHadCuts(); - } - ttColor = lvl1TriggerTower.getColor(emOrHad); - for (int i = 0; i < lvl1TriggerTower.getNumDraw(); ++i) - { - int list = lvl1TriggerTower.getDrawIndex(i); - double et = lvl1TriggerTower.getET(list, emOrHad); - double phi = lvl1TriggerTower.getPhi(list); - double eta = lvl1TriggerTower.getEta(list); - if (eta > 5 || eta < -5 || et == 0.0) - continue; - double dphi = lvl1TriggerTower.getdPhi(list, emOrHad); - double deta = lvl1TriggerTower.getdEta(list, emOrHad); - phietabinsLoop("trigger", phi, dphi, eta, deta, ttColor[list], et, lego); - }// loop over that triggerTower's cells - } - } - } - - private static void fillJetElementLego(AEvent event, double[][][] lego) - { - //will draw even if data status is off - String[] colJE=event.getCollectionNames("LVL1JetElement"); - for(int k=0;k<colJE.length;k++) - { - ALVL1JetElementData lvl1JetElement = (ALVL1JetElementData) event.get(colJE[k]); - if (lvl1JetElement == null) - continue; - byte[] jeColor = lvl1JetElement.getColor(); - lvl1JetElement.makeDrawList(); - for (int i = 0; i < lvl1JetElement.getNumDraw(); ++i) - { - int list = lvl1JetElement.getDrawIndex(i); - double et = lvl1JetElement.getET(list); - double phi = lvl1JetElement.getPhi(list); - double eta = lvl1JetElement.getEta(list); - if (eta > 5 || eta < -5 || et == 0.0) - continue; - double dphi = lvl1JetElement.getdPhi(list); - double deta = lvl1JetElement.getdEta(list); - phietabinsLoop("jetElement", phi, dphi, eta, deta, jeColor[list], et, lego); - }// loop over that jetElement's cells - } - } - - /** - * Is used to loop over the phi and eta bins to fill the lego "sender" - * histogram - * - * @param sender name of histogram that was sent for output message - * @param phi - * @param dphi - * @param eta - * @param deta - * @param color - * @param et - * @param lego - */ - private static void phietabinsLoop(String sender, double phi, double dphi, double eta, double deta, byte color, double et, double[][][] lego) - { - if (color >= AProjectionLegoPlot.nLayers) - color = (byte) (color % AProjectionLegoPlot.nLayers); - AProjectionLegoPlot.colorset.add(new Integer(color)); - - int highphibin = 0, lowphibin = 0; - - double phibinsize = (AMath.TWO_PI / AProjectionLegoPlot.nPhiCells); - highphibin = (int) ((phi + dphi) /phibinsize); - lowphibin = (int) ((phi - dphi) /phibinsize); - - int highetabin = 0, lowetabin = 0; - double etabinsize = 10.0 / AProjectionLegoPlot.nEtaCells; - highetabin = (int) ((eta + deta + 5.0) /etabinsize); - lowetabin = (int) ((eta - deta + 5.0) /etabinsize); - //check eta values - if (lowetabin < 0) - { - lowetabin=0; - if (highetabin < 0) - highetabin=0; - } - if (highetabin >= AProjectionLegoPlot.nEtaCells) - { - highetabin =AProjectionLegoPlot.nEtaCells-1; - if (lowetabin >= AProjectionLegoPlot.nEtaCells) - lowetabin =AProjectionLegoPlot.nEtaCells-1; - } - - for (int phibin = lowphibin; phibin <= highphibin; ++phibin) - { - double phiweight = 0; - if (lowphibin == highphibin) - phiweight = 1.0; - else if (phibin == lowphibin) - phiweight = (lowphibin + 1 - ((phi - dphi) / phibinsize)) * (phibinsize/(2 * dphi)); - else if (phibin == highphibin) - phiweight = (((phi + dphi) / phibinsize) - highphibin) * (phibinsize/(2 * dphi)); - else - phiweight = phibinsize/(2 * dphi); - if (phiweight > 1 || phiweight < 0) - { - logger.error("huh(" + sender + ")? how is phiweight...? " + phiweight); - } - - for (int etabin = lowetabin; etabin <= highetabin; ++etabin) - { - double etaweight = 0; - if (lowetabin == highetabin) - etaweight = 1.0; - else if (etabin == lowetabin) - etaweight = (lowetabin + 1 - ((eta - deta + 5.0) / etabinsize)) * (etabinsize/(2 * deta)); - else if (etabin == highetabin) - etaweight = (((eta + deta + 5.0) / etabinsize) - highetabin) * (etabinsize/(2 * deta)); - else - etaweight = etabinsize/(2 * deta); - if (etaweight > 1 || etaweight < 0) - { - logger.error("huh(" + sender + ")? how is etaweight...? " + etaweight); - } - - int wphibin = phibin;// for phi wrapping - while (wphibin >= AProjectionLegoPlot.nPhiCells) - wphibin -= AProjectionLegoPlot.nPhiCells; - while (wphibin < 0) - wphibin += AProjectionLegoPlot.nPhiCells; - int retabin = etabin; - if (AProjectionLegoPlot.reverse) - retabin = AProjectionLegoPlot.nEtaCells - etabin - 1; - - // add to the legoplot - lego[wphibin][retabin][color] += et * phiweight * etaweight; - }// loop over etabins - }// loop over phibins - }// end of phietabinsloop - - /** - * If the user has a different scale selected then this updates the value - */ - public static double scaleValue(double value) - { - if(value==0) - return 0; - if (AProjectionLegoPlot.defaultScale == 2) - { - value = Math.sqrt(value); - } - else if (AProjectionLegoPlot.defaultScale == 1) - { - value = Math.log10(value) - AProjectionLegoPlot.minimumofLogScale; - } - return value; - } - - public static void drawHistograms(AWindow window, AGraphics ag, AEvent event, double[][][] lego, double maxEt, double met, double AODmaxEt) - { - // Draw the other stuff in the event: jets, missing Et, etc. - double _jetcircleradius = parameterStore.get("LegoPlot", "JetCircleRadius").getD(); - double _legocut = parameterStore.get("LegoPlot", "LegoCut").getD(); - _legocut=scaleValue(_legocut); - boolean doAOD = false; - if (AODmaxEt!=0) - doAOD = true; - - //for ordering of ROIs - Stack jetROI = new Stack(), emTauROI = new Stack(), muonROI = new Stack(); - - List hitsAndTracks = event.getHitsAndTracks(window.getProjection()); - for (int h = 0; h < hitsAndTracks.size(); h++) - { - AData datatype = ((AData) hitsAndTracks.get(h)); - if (datatype.getName().equals("Jet")) - { - AJetData jet = (AJetData) datatype; - jet.makeDrawList(); - byte[] colors = jet.getColor(); - for (int j = 0; j < jet.getNumDraw(); ++j) - { - int list = jet.getDrawIndex(j); - double et = jet.getET(list); - Color _colorJet = AProjectionLegoPlot.defaultColorMap[colors[list]]; - ALegoDraw.drawJet(et, jet.getEta(list), jet.getPhi(list), _colorJet, window, ag, _jetcircleradius); - } - } - else if (datatype.getName().equals("ETMis")) - { - AETMisData mis = (AETMisData) datatype; - mis.makeDrawList(); - if (mis.getNumDraw() > 0) - { - byte[] colors = mis.getColor(); - int phib = (int) ((mis.getPhi()) * AProjectionLegoPlot.nPhiCells / AMath.TWO_PI); - if (phib < 0) - phib += AProjectionLegoPlot.nPhiCells; - if (phib >= AProjectionLegoPlot.nPhiCells) - phib -= AProjectionLegoPlot.nPhiCells; - Color _colorMis = AProjectionLegoPlot.defaultColorMap[colors[0]]; - ALegoDraw.drawMissEt(window, ag, phib, mis.getET(), _colorMis, maxEt); - } - } - //save the ROIs so they can be drawn jet-em-muon - else if (datatype.getName().equals("JetROI")) - { - jetROI.push(h); - } - else if (datatype.getName().equals("EmTauROI")) - { - emTauROI.push(h); - } - else if (datatype.getName().equals("MuonROI")) - { - muonROI.push(h); - } - }//end of loop over hitsandtracks - - //now draw the ROIs in the correct order - drawROIs(jetROI, window, ag, event); - drawROIs(emTauROI, window, ag, event); - drawROIs(muonROI, window, ag, event); - - - //for towers find colors to loop over - int largestColourIndex=0; - int lowestColourIndex=AProjectionLegoPlot.nLayers; - Iterator colorIterator = AProjectionLegoPlot.colorset.iterator(); - while(colorIterator.hasNext()) - { - int currentColor = ((Integer) colorIterator.next()).intValue(); - if(currentColor>largestColourIndex) - largestColourIndex=currentColor; - if(currentColor<lowestColourIndex) - lowestColourIndex=currentColor; - } - // Draw the EM and HAD towers - for (int y = 0; y < AProjectionLegoPlot.nEtaCells; ++y) - { - for (int x = AProjectionLegoPlot.nPhiCells - 1; x >= 0; --x) - { - double binheight = 0; - if(AProjectionLegoPlot.getDrawEMHAD() && AProjectionLegoPlot.colorset.size()==2) - { - //for Em/had option should only have 2 colors - int z=AProjectionLegoPlot.colorEM; - binheight=lego[x][y][z]; - if (binheight > _legocut) - { - ALegoDraw.drawBox(window, ag, x, y, z, 0.0, binheight, maxEt, 0.5); - if(lego[x][y][AProjectionLegoPlot.colorHad]> _legocut) - { - z=AProjectionLegoPlot.colorHad; - ALegoDraw.drawBox(window, ag, x, y, z, binheight, lego[x][y][z], maxEt, 0.5); - } - } - else if(lego[x][y][AProjectionLegoPlot.colorHad]> _legocut) - { - z=AProjectionLegoPlot.colorHad; - ALegoDraw.drawBox(window, ag, x, y, z, 0.0, lego[x][y][z], maxEt, 0.5); - } - } - else - { - //if not Em/Had then loop over colors - for(int z=largestColourIndex; z>=lowestColourIndex; z--) - { - if (lego[x][y][z] > _legocut) - { - ALegoDraw.drawBox(window, ag, x, y, z, binheight, lego[x][y][z], maxEt, 0.5); - binheight += lego[x][y][z]; - } - } - } - } - } - - //loop again and draw things that need to be on top of histogram - for (int h = 0; h < hitsAndTracks.size(); h++) - { - AData datatype = ((AData) hitsAndTracks.get(h)); - if (datatype.getName().equals("Jet")) - { - AJetData jet = (AJetData) datatype; - jet.makeDrawList(); - byte[] colors = jet.getColor(); - for (int j = 0; j < jet.getNumDraw(); ++j) - { - int list = jet.getDrawIndex(j); - double et = jet.getET(list); - Color _colorJet = AProjectionLegoPlot.defaultColorMap[colors[list]]; - if (parameterStore.get("LegoPlot", "JetText").getStatus()) - ALegoDraw.drawJetText(et, jet.getEta(list), jet.getPhi(list), _colorJet, window, ag, _jetcircleradius); - } - } - } - - if (doAOD) - { - //Draw the new jet Towers - String[] colJet=event.getActiveCollectionNames("Jet"); - for(int i=0;i<colJet.length;i++) - { - AJetData jets = (AJetData) event.get(colJet[i]); - - if (!parameterStore.get("Data", "Jet").getStatus()) - jets = null; - if (jets != null) - { - jets.makeDrawList(); - byte[] colors = jets.getColor(); - for (int j = 0; j < jets.getNumDraw(); ++j) - { - int list = jets.getDrawIndex(j); - Color _colorJet = AProjectionLegoPlot.defaultColorMap[colors[list]]; - int etabin = (int) ((jets.getEta(list) + 5.0) * AProjectionLegoPlot.nEtaCells / 10.0); - if (AProjectionLegoPlot.reverse) - etabin = AProjectionLegoPlot.nEtaCells - etabin; - int phibin = (int) ((jets.getPhi(list)) * AProjectionLegoPlot.nPhiCells / AMath.TWO_PI); - double pt = Math.abs(jets.getPt()[list]); - pt=scaleValue(pt); - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_JET,_colorJet, 0, pt, maxEt, 2.0); - } - } - } - - // Draw the caloClusters - String[] colCluster=event.getActiveCollectionNames("Cluster"); - for(int i=0;i<colCluster.length;i++) - { - AClusterData cluster = (AClusterData) event.get(colCluster[i]); - if (!parameterStore.get("Data", "Cluster").getStatus()) - cluster = null; - if (cluster != null) - { - cluster.makeDrawList(); - for (int m = 0; m < cluster.getNumDraw(); ++m) - { - int list = cluster.getDrawIndex(m); - int etabin = (int) ((cluster.getEta(list) + 5.0) * AProjectionLegoPlot.nEtaCells / 10.0); - if (AProjectionLegoPlot.reverse) - etabin = AProjectionLegoPlot.nEtaCells - etabin; - int phibin = (int) ((cluster.getPhi(list)) * AProjectionLegoPlot.nPhiCells / AMath.TWO_PI); - double et = Math.abs(cluster.getET(list)); - et=scaleValue(et); - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_CLUSTER, 0, et, maxEt, .5); - } - } - } - - // Draw the bjets - String[] colBjets=event.getActiveCollectionNames("BJet"); - for(int i=0;i<colBjets.length;i++) - { - ABJetData bjets = (ABJetData) event.get(colBjets[i]); - if (!parameterStore.get("Data", "BJet").getStatus()) - bjets = null; - if (bjets != null) - { - bjets.makeDrawList(); - for (int bj = 0; bj < bjets.getNumDraw(); ++bj) - { - int list = bjets.getDrawIndex(bj); - double et = bjets.getPT(list); - ALegoDraw.drawJet(et, bjets.getEta(list), bjets.getPhi(list), AProjectionLegoPlot.defaultColorMap[parameterStore.get("BJet", "Constant").getI()], window, ag, _jetcircleradius + _jetcircleradius / 5.0); - } - } - } - - // Draw the taujets - String[] colTau=event.getActiveCollectionNames("TauJet"); - for(int i=0;i<colTau.length;i++) - { - ATauJetData tjets = (ATauJetData) event.get(colTau[i]); - if (!parameterStore.get("Data", "TauJet").getStatus()) - tjets = null; - if (tjets != null) - { - tjets.makeDrawList(); - for (int tj = 0; tj < tjets.getNumDraw(); ++tj) - { - int list = tjets.getDrawIndex(tj); - double et = tjets.getPT(list); - ALegoDraw.drawJet(et, tjets.getEta(list), tjets.getPhi(list), AProjectionLegoPlot.defaultColorMap[parameterStore.get("TauJet", "Constant").getI()], window, ag, _jetcircleradius / 2.0); - } - } - } - - //Draw the muons - String[] colMuon=event.getActiveCollectionNames("Muon"); - for(int i=0;i<colMuon.length;i++) - { - AMuonData muons = (AMuonData) event.get(colMuon[i]); - if (!parameterStore.get("Data", "Muon").getStatus()) - muons = null; - if (muons != null) - { - muons.makeDrawList(); - for (int m = 0; m < muons.getNumDraw(); ++m) - { - int list = muons.getDrawIndex(m); - int etabin = (int) ((muons.getEta(list) + 5.0) * AProjectionLegoPlot.nEtaCells / 10.0); - if (AProjectionLegoPlot.reverse) - etabin = AProjectionLegoPlot.nEtaCells - etabin; - int phibin = (int) ((muons.getPhi(list)) * AProjectionLegoPlot.nPhiCells / AMath.TWO_PI); - double pt = Math.abs(muons.getPT(list)); - pt=scaleValue(pt); - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_MUON, 0, pt, maxEt, 0.5); - } - } - } - - //Draw the electrons - String[] colElectron=event.getActiveCollectionNames("Electron"); - for(int i=0;i<colElectron.length;i++) - { - AElectronData electrons = (AElectronData) event.get(colElectron[i]); - - if (!parameterStore.get("Data", "Electron").getStatus()) - electrons = null; - if (electrons != null) - { - electrons.makeDrawList(); - for (int e = 0; e < electrons.getNumDraw(); ++e) - { - int list = electrons.getDrawIndex(e); - int etabin = (int) ((electrons.getEta(list) + 5.0) * AProjectionLegoPlot.nEtaCells / 10.0); - if (AProjectionLegoPlot.reverse) - etabin = AProjectionLegoPlot.nEtaCells - etabin; - int phibin = (int) ((electrons.getPhi(list)) * AProjectionLegoPlot.nPhiCells / AMath.TWO_PI); - double pt = Math.abs(electrons.getPT(list)); - pt=scaleValue(pt); - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_ELECTRON, 0, pt, maxEt, 0.5); - } - } - } - - //Draw the photons - String[] colPhoton=event.getActiveCollectionNames("Photon"); - for(int i=0;i<colPhoton.length;i++) - { - APhotonData photons = (APhotonData) event.get(colPhoton[i]); - if (!parameterStore.get("Data", "Photon").getStatus()) - photons = null; - if (photons != null) - { - photons.makeDrawList(); - for (int p = 0; p < photons.getNumDraw(); ++p) - { - int list = photons.getDrawIndex(p); - int etabin = (int) ((photons.getEta(list) + 5.0) * AProjectionLegoPlot.nEtaCells / 10.0); - if (AProjectionLegoPlot.reverse) - etabin = AProjectionLegoPlot.nEtaCells - etabin; - int phibin = (int) ((photons.getPhi(list)) * AProjectionLegoPlot.nPhiCells / AMath.TWO_PI); - double pt = Math.abs(photons.getPT(list)); - pt=scaleValue(pt); - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_PHOTON, 0, pt, maxEt, 0.5); - } - } - } - - //Draw the compositeParticles - String[] colCompPart=event.getActiveCollectionNames("CompositeParticle"); - for(int i=0;i<colCompPart.length;i++) - { - ACompositeParticleData compositeParticles = (ACompositeParticleData) event.get(colCompPart[i]); - if (!parameterStore.get("Data", "CompositeParticle").getStatus()) - compositeParticles = null; - if (compositeParticles != null) - { - compositeParticles.makeDrawList(); - for (int e = 0; e < compositeParticles.getNumDraw(); ++e) - { - int list = compositeParticles.getDrawIndex(e); - int etabin = (int) ((compositeParticles.getEta(list) + 5.0) * AProjectionLegoPlot.nEtaCells / 10.0); - if (AProjectionLegoPlot.reverse) - etabin = AProjectionLegoPlot.nEtaCells - etabin; - int phibin = (int) ((compositeParticles.getPhi(list)) * AProjectionLegoPlot.nPhiCells / AMath.TWO_PI); - double pt = Math.abs(compositeParticles.getPT(list)); - pt=scaleValue(pt); - //change how drawn depending on type - if(Math.abs(compositeParticles.getPdgId(list))==13) - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_MUON, 0, pt, maxEt, 0.5); - else if(Math.abs(compositeParticles.getPdgId(list))==11) - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_ELECTRON, 0, pt, maxEt, 0.5); - else if(Math.abs(compositeParticles.getPdgId(list))==22) - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_PHOTON, 0, pt, maxEt, 0.5); - else if(Math.abs(compositeParticles.getPdgId(list))==5) - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_BJET, 0, pt, maxEt, 0.5); - else if(Math.abs(compositeParticles.getPdgId(list))==15) - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_TAUJET, 0, pt, maxEt, 0.5); - else if(compositeParticles.getTypeEV(list).equals("EVParticleJet")) - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_JET, 0, pt, maxEt, 0.5); - else - ALegoDraw.drawBox(window, ag, phibin, etabin, AProjectionLegoPlot.DRAW_COMPOSITEPARTICLE, 0, pt, maxEt, 0.5); - } - } - } - }//if doAOD - }//drawHistograms - - public static void drawROIs(Stack ROIstack, AWindow window, AGraphics ag, AEvent event) - { - List hitsAndTracks = event.getHitsAndTracks(window.getProjection()); - //loop over ROIs - while(ROIstack.size()>0) - { - int h = (Integer) ROIstack.pop(); - AData datatype = ((AData) hitsAndTracks.get(h)); - - byte[] ROIColor; - double deltaPhi; - double deltaEta; - AROIData ROIData = (AROIData) datatype; - ROIData.makeDrawList(); - ROIColor = datatype.getColor(); - deltaEta = parameterStore.get(datatype.getName(), "deta").getD(); - deltaPhi = parameterStore.get(datatype.getName(), "dphi").getD(); - // deltaEta and deltaPhi should not be too large - for (int j = 0; j < ROIData.getNumDraw(); ++j) - { - int numPoints = 4; - int list = ROIData.getDrawIndex(j); - double ROIphi = ROIData.getPhi(list); - double ROIeta = ROIData.getEta(list); - if (AProjectionLegoPlot.reverse) - ROIeta = -ROIeta; - double leftPhi = ROIphi - deltaPhi; - double rightPhi = ROIphi + deltaPhi; - double topEta = ROIeta + deltaEta; - double bottomEta = ROIeta - deltaEta; - if ((ROIColor[list] < AProjectionLegoPlot.defaultColorMap.length) && (ROIColor[list] >= 0)) - ag.setColor(AProjectionLegoPlot.defaultColorMap[ROIColor[list]]); - ag.setLineWidth(3); - double ROIx = 0.0; - double ROIy = 0.0; - double[][] hv = new double[2][numPoints]; - if ((rightPhi <= AMath.TWO_PI) && (leftPhi >= 0.0)) - { - for (int p = 0; p < numPoints; p++) - { - switch (p) - { - case 0: - ROIx = rightPhi * 360.0 / AMath.TWO_PI; - ROIy = bottomEta; - break; - case 1: - ROIx = leftPhi * 360.0 / AMath.TWO_PI; - ROIy = bottomEta; - break; - case 2: - ROIx = leftPhi * 360.0 / AMath.TWO_PI; - ROIy = topEta; - break; - case 3: - ROIx = rightPhi * 360.0 / AMath.TWO_PI; - ROIy = topEta; - break; - } - if(ROIy <= -5.0) - ROIy = -5.0; - if(ROIy >= 5.0) - ROIy = 5.0; - //move phi value due to slant of eta axis - ROIx=AProjectionLegoPlot.adjustPhi(window,ROIx,ROIy); - hv[0][p] = ROIx; - hv[1][p] = ROIy; - } - } - else if ((rightPhi > AMath.TWO_PI) && (leftPhi < 0.0)) - { - for (int p = 0; p < numPoints; p++) - { - switch (p) - { - case 0: - ROIx = 360.0; - ROIy = bottomEta; - break; - case 1: - ROIx = 0.0; - ROIy = bottomEta; - break; - case 2: - ROIx = 0.0; - ROIy = topEta; - break; - case 3: - ROIx = 360.0; - ROIy = topEta; - break; - } - if(ROIy <= -5.0) - ROIy = -5.0; - if(ROIy >= 5.0) - ROIy = 5.0; - //move phi value due to slant of eta axis - ROIx=AProjectionLegoPlot.adjustPhi(window,ROIx,ROIy); - hv[0][p] = ROIx; - hv[1][p] = ROIy; - } - } - else if (rightPhi > AMath.TWO_PI) - { - double[][] hvWrap = new double[2][numPoints]; - double ROIxWrap = 0.0; - for (int p = 0; p < numPoints; p++) - { - switch (p) - { - case 0: - ROIx = 360.0; - ROIxWrap = (rightPhi - AMath.TWO_PI) * 360.0 / AMath.TWO_PI; - ROIy = bottomEta; - break; - case 1: - ROIx = leftPhi * 360.0 / AMath.TWO_PI; - ROIxWrap = 0.0; - ROIy = bottomEta; - break; - case 2: - ROIx = leftPhi * 360.0 / AMath.TWO_PI; - ROIxWrap = 0.0; - ROIy = topEta; - break; - case 3: - ROIx = 360.0; - ROIxWrap = (rightPhi - AMath.TWO_PI) * 360.0 / AMath.TWO_PI; - ROIy = topEta; - break; - } - if(ROIy <= -5.0) - ROIy = -5.0; - if(ROIy >= 5.0) - ROIy = 5.0; - //move phi value due to slant of eta axis - ROIx=AProjectionLegoPlot.adjustPhi(window,ROIx,ROIy); - hv[0][p] = ROIx; - hv[1][p] = ROIy; - //move phi value due to slant of eta axis - ROIxWrap=AProjectionLegoPlot.adjustPhi(window,ROIxWrap,ROIy); - hvWrap[0][p] = ROIxWrap; - hvWrap[1][p] = ROIy; - } - Point2D.Double p= new Point2D.Double(0,0); - for(int i=0; i<numPoints; i++) - { - p = window.calculateDisplay(hvWrap[0][i],hvWrap[1][i]); - hvWrap[0][i]=p.x; - hvWrap[1][i]=p.y; - } - ag.fillPolygon(hvWrap[0], hvWrap[1], numPoints); - } - else - { - double[][] hvWrap = new double[2][numPoints]; - double ROIxWrap = 0.0; - for (int p = 0; p < numPoints; p++) - { - switch (p) - { - case 0: - ROIx = rightPhi * 360.0 / AMath.TWO_PI; - ROIxWrap = 360.0; - ROIy = bottomEta; - break; - case 1: - ROIx = 0.0; - ROIxWrap = (leftPhi + AMath.TWO_PI) * 360.0 / AMath.TWO_PI; - ROIy = bottomEta; - break; - case 2: - ROIx = 0.0; - ROIxWrap = (leftPhi + AMath.TWO_PI) * 360.0 / AMath.TWO_PI; - ROIy = topEta; - break; - case 3: - ROIx = rightPhi * 360.0 / AMath.TWO_PI; - ROIxWrap = 360.0; - ROIy = topEta; - break; - } - if(ROIy <= -5.0) - ROIy = -5.0; - if(ROIy >= 5.0) - ROIy = 5.0; - //move phi value due to slant of eta axis - ROIx=AProjectionLegoPlot.adjustPhi(window,ROIx,ROIy); - hv[0][p] = ROIx; - hv[1][p] = ROIy; - //move phi value due to slant of eta axis - ROIxWrap=AProjectionLegoPlot.adjustPhi(window,ROIxWrap,ROIy); - hvWrap[0][p] = ROIxWrap; - hvWrap[1][p] = ROIy; - } - Point2D.Double p= new Point2D.Double(0,0); - for(int i=0; i<numPoints; i++) - { - p = window.calculateDisplay(hvWrap[0][i],hvWrap[1][i]); - hvWrap[0][i]=p.x; - hvWrap[1][i]=p.y; - } - ag.fillPolygon(hvWrap[0], hvWrap[1], numPoints); - } - Point2D.Double p= new Point2D.Double(0,0); - for(int i=0; i<numPoints; i++) - { - p = window.calculateDisplay(hv[0][i],hv[1][i]); - hv[0][i]=p.x; - hv[1][i]=p.y; - } - ag.fillPolygon(hv[0], hv[1], numPoints); - }//end of loop over ROI data - } - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AMBTSData.java b/graphics/AtlantisJava/src/atlantis/data/AMBTSData.java deleted file mode 100644 index 931b749640d510e8e0a940a3dfd83c73b5b3fa0f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AMBTSData.java +++ /dev/null @@ -1,595 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.ALogger; - - -/** - * The Minimum Bias Trigger Scintillator implementation. - * - * @author Mark Stockton - */ -public class AMBTSData extends ACalorimeterData -{ - private static ALogger logger = ALogger.getLogger(AMBTSData.class); - - - /* - * For Rz histograms may/will need: - * - * private int[][] cellTable; - * - * phiIndex[i] - * etaIndex[i] - * outerEta -> use -> detector.getEtaMax() - * outerR -> use -> detector.getRMax() - * outerZ -> use -> detector.getZMax() - * etaGranularity - */ - - protected float[] quality; - protected float[] time; - //label not needed at present as is just a string made - // from type, module and channel - //protected String[] label; - - // data for real pulse shapes plots - private int[][] adcCounts = null; - private float[] cellPedestal = null; - private float[] cellRawTime = null; - private float[] cellRawAmplitude = null; - private static boolean pulseShapesDataAvailable = false; - private static final String LOOKUP_TABLE_FILE = - AGlobals.instance().getHomeDirectory() + "configuration" + - System.getProperty("file.separator") + - "rpsplt_tile.csv"; - // number of lookup table values for real pulse shapes plots calculation - private static final short NUMBER_OF_LOOKUP_VALUES = 401; - - - - - protected ACalorimeterDetector[] MBTSlayers = new ACalorimeterDetector[2]; - - AMBTSData(AHashMap p, AEvent e) - { - super(p,e); - - channel = p.getIntArray("channel"); - /* - * this energy is in MeV not GeV - */ - et = p.getFloatArray("energy"); - etSum = p.getFloatArray("energy"); - //label = p.getStringArray("label"); - quality = p.getFloatArray("quality"); - sampling = p.getIntArray("sampling"); - time = p.getFloatArray("time"); - - /* - * The phi and eta coordinates used here are actually not phi and eta - * - * Instead: - phi refers to the module number 0-8 - * - eta refers to which side of the detector - * - * The actual phi and eta are then calculated from the geometry object - */ - int[] inteta; - int[] intphi; - if( p.containsKey("module")) - { - //phi new version - intphi = p.getIntArray("module"); - } - else - { - //phi first version - float[] tempphi = p.getFloatArray("phi"); - intphi = new int[numData]; - for(int i=0; i<numData; i++) - { - intphi[i]=(int) (( (8*tempphi[i])/(2*Math.PI))-(1/2)); - } - } - - if( p.containsKey("type")) - { - //eta new version - inteta = p.getIntArray("type"); - } - else - { - //eta first version - float[] tempeta = p.getFloatArray("eta"); - inteta = new int[numData]; - for(int i=0; i<numData; i++) - { - if(tempeta[i]<0) - { - inteta[i] = -1; - } - else - { - inteta[i] = 1; - } - } - } - eta = new float[numData]; - phi = new float[numData]; - for(int i=0; i<numData; i++) - { - eta[i]=inteta[i]; - phi[i]=intphi[i]; - } - - //now define sub and side depending on eta value - for(int i=0; i<numData; i++) - { - if(eta[i]<0) - { - sub[i] = 0; - side[i] = -1; - } - else - { - sub[i] = 1; - side[i] = 1; - } - } - - //store the two sampling of the MBTS geometry - for (int i=0; i<ACalorimeterDetector.count(); i++) - { - ACalorimeterDetector detector = ACalorimeterDetector.get(i); - if(detector.getName().equals("Minimum Bias Trigger Scintillators")) - { - MBTSlayers[detector.getSampling()] = detector; - } - } - - // read in MBTS data for real pulse shapes plots - readPulseShapePlotData(p); - - } - - - - private void readPulseShapePlotData(AHashMap p) - { - // read ADCCounts and cell data for real pulse shapes plots - adcCounts = super.getADCCountsData(p); - - // read other MBTS data for real pulse shapes plots - cellPedestal = (p.get("cellPedestal") != null) ? p.getFloatArray("cellPedestal") : null; - cellRawTime = (p.get("cellRawTime") != null) ? p.getFloatArray("cellRawTime") : null; - cellRawAmplitude = (p.get("cellRawAmplitude") != null) ? p.getFloatArray("cellRawAmplitude") : null; - - pulseShapesDataAvailable = false; - if(adcCounts != null && cellPedestal != null && cellRawTime != null && - cellRawAmplitude != null) - { - pulseShapesDataAvailable = true; - - logger.debug(CALORIMETER_NAME + - ": data for real pulse shape plots available"); - - if(ACalorimeterRPSPLT.areTileLookupTablesInitialized()) - { - logger.debug(CALORIMETER_NAME + - ": lookup tables have already been read in"); - } - else - { - logger.debug(CALORIMETER_NAME + - ": lookup table values have not been read in yet\n" + - " trying to read file: " + LOOKUP_TABLE_FILE); - - try - { - ATILEData.readLookupTableFile(); - logger.debug(CALORIMETER_NAME + - ": values from " + LOOKUP_TABLE_FILE + - " successfully read in"); - } - catch(AAtlantisException ex) - { - logger.debug(CALORIMETER_NAME + - ": reading " + LOOKUP_TABLE_FILE + - " failed, real pulse shapes plots will not " + - "be available, reason: " + ex.getMessage(), ex); - pulseShapesDataAvailable = false; - } - } - } - - } // readPulseShapePlotData() ------------------------------------------- - - - - /** - * Returns the name of the parameter group. - * - * @return String parameter group - */ - public String getParameterGroup() - { - return "TILE"; - } - - /** - * Returns the name of the datatype. - * - * @return String datatype - */ - public String getName() - { - return "MBTS"; - } - - /** - * Returns the name of the datatype. - * - * @return String datatype - */ - public String getNameScreenName() - { - return "MBTS"; - } - - /** - * Returns the type of calorimeter (ECAL/HCAL) for a hit. - * - * @param index int hit index - * @return String calorimeter type - */ - public String getCalorimeterType(int index) - { - return "HCAL"; - } - - /** - * Draws the MBTS data in the y-x projection. - * - * @return ACoord cell geometry polygons - */ - protected ACoord getYXUser() - { - makeDrawList(); - - int mode = parameterStore.get("YX", "Mode").getI(); - if (mode != AProjectionYX.MODE_MBTS) - { - return ACoord.NO_DATA; - } - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - double rMax = MBTSlayers[sampling[j]].getRMax(); - double rMin = MBTSlayers[sampling[j]].getRMin(); - int numPhi = MBTSlayers[sampling[j]].getNumPhi(); - double phiMin = Math.PI*2*phi[j]/numPhi; - double phiMax = Math.PI*2*(1+phi[j])/numPhi; - hv[0][i] = new double[] {rMax*Math.cos(phiMin), rMax*Math.cos(phiMax), - rMin*Math.cos(phiMax), rMin*Math.cos(phiMin)}; - hv[1][i] = new double[] {rMax*Math.sin(phiMin), rMax*Math.sin(phiMax), - rMin*Math.sin(phiMax), rMin*Math.sin(phiMin)}; - index[i] = j; - } - - return new ACoord(hv, index, this); - } - - /** - * Draws the MBTS data in the rho-z projection. See the description of - * filterDrawListRZ() for an explanation of the drawing method. - * - * @return ACoord cell geometry polygons - */ - protected ACoord getRZUser() - { - makeDrawList(); - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int j = listdl[i]; - int sign = MBTSlayers[sampling[j]].getRSign((int) phi[j]); - double zMax = MBTSlayers[sampling[j]].getZMax() * side[j]; - double zMin = MBTSlayers[sampling[j]].getZMin() * side[j]; - double rMax = MBTSlayers[sampling[j]].getRMax() * sign; - double rMin = MBTSlayers[sampling[j]].getRMin() * sign; - hv[0][i] = new double[] {zMax, zMin, zMin, zMax}; - hv[1][i] = new double[] {rMax, rMax, rMin, rMin}; - index[i] = j; - } - - return new ACoord(hv, index, this); - } - - /** - * Applies cuts to the data. - */ - protected void applyCuts() - { - super.applyCuts(); - - cut("CutsCalo", "MBTSEnergy", "MBTSEnergy", et); - int cutSub = parameterStore.get("CutsCalo", "MBTS").getI(); - if(cutSub != -1) - { - cutArray(sub, cutSub, "Endcap"); - } - } - - /** - * Returns the data in the phi-rho projection. - * - * @return ACoord polygons representing calorimeter cells - */ - public ACoord getFRUser() - { - return getYXUser().convertYXToFR().includePhiWrapAround("FR"); - } - - /** - * Returns info about a selected hit (for picking) - * - * @param index int hit index - * @return String info - */ - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+ - "\n Energy="+correctEnergy(energy[index])+" GeV\n "; - - //find the cell energy on the opposite MBTS layer - String cellminus, cellplus; - double tempEnergy=0.0; - for(int i=0; i<energy.length; i++) - { - if(eta[i]==(-1.0*eta[index]) && phi[i]==phi[index] && sampling[i]==sampling[index]) - { - tempEnergy=energy[i]; - } - } - - if(eta[index]<0) - { - cellminus = correctEnergy(energy[index]); - cellplus = correctEnergy(tempEnergy); - } - else - { - cellplus = correctEnergy(energy[index]); - cellminus = correctEnergy(tempEnergy); - } - StringBuffer msg = new StringBuffer(CALORIMETER_NAME + " cell "); - - // calling AIdHelper.getFullIdentifier(id[index])[0] - does not work, - // id array is not present in the event data. it is arbitrarily created - // in Atlantis, however, but contains only indices, thus currently - // (2008-11-25) index and id[index] are the same values - msg.append(" (id: " + id[index] + " index: " + index + ")"); - - msg.append("\n Energy = " + correctEnergy(energy[index])); - msg.append("\n (MBTS + = " + cellplus + " MBTS - = " + cellminus + ")"); - msg.append("\n time = " + time[index]); - msg.append("\n quality = " + quality[index]); - msg.append("\n type = " + String.format("%.4f",eta[index])); - msg.append("\n module = " + String.format("%.1f",phi[index])); - msg.append("\n sampling = " + sampling[index]); - msg.append("\n channel = " + channel[index]); - - // real pulse shapes plots - msg.append("\n cell pedestal = "); - String m = (cellPedestal != null) ? Float.toString(cellPedestal[index]) + - " ADC counts" : "n/a"; - msg.append(m); - - m = pulseShapesDataAvailable ? "" : "\n data for real pulse shapes plot n/a"; - msg.append(m); - - return msg.toString(); - - } // getHitInfo() ------------------------------------------------------- - - private String correctEnergy(double energy) - { - String energyOutput; - if(energy>1.) - { - energyOutput = String.format("%.2f",energy) + " MeV"; - } - else if(energy>0.001) - { - energy*=1000.; - energyOutput = String.format("%.2f",energy) + " KeV"; - } - else - { - energy*=1000.*1000.; - energyOutput = String.format("%.2f",energy) + " eV"; - } - return energyOutput; - } - - - /** - * Returns the histograms for this projection. - * - * @param projection AProjection2D current projection - * @return ACoord[] polygons representing histograms - */ - protected ACoord[] getUserHistograms(AProjection2D projection) - { - ACoord[] data = ACoord.NO_HISTOGRAMS; - //TODO add MBTS RZ Histograms option turned off in gui - //if (projection instanceof AProjectionRZ) - // data = getRZHistograms(); - return projection.nonLinearTransform(data); - } - - - - // calculate real pulse shapes values based on the values in the lookup tables - // taken from ATILEData. This function can't be shared from ACalorimeterData - // (shared by LAr, FCAL, HEC) since the calculation is different and can't - // call it directly from TILE since there are two channels. - // Should likely be refactored (so that method is somewhat shared) - after - // discussion with someone from TILE/MBTS/LAr ... - private double getPhysicsPulseShape(double xTime, double pmtTime, - double pmtPedestal, double pmtEnergy, - float[] amplitude, float[] time) - throws AAtlantisException - { - double tdiv = 0.0; - int lookup = 0; - double localTime = 0.0; - double xpulse = 0.0; - - // need to get "multiple" parameter ( = number of values in adcCounts - // for each cell - adcCounts.length), shall be the same for all the - // cells - taking the length of the first array (for the first cell) - // no NullPointer or ArrayIndexBound checks are necessary here as this - // method shall only be called when the relevant data is available - double centerOfSamples = (adcCounts[0].length + 1.0) / 2.0; - - tdiv = time[1] - time[0]; - localTime = (xTime - centerOfSamples) * 25.0 - pmtTime; - lookup = (int) ((localTime - time[0]) / tdiv); - - if(lookup < 0) - { - lookup = 0; - } - if(lookup >= NUMBER_OF_LOOKUP_VALUES - 1) - { - lookup = NUMBER_OF_LOOKUP_VALUES - 2; // -1 was off by 1 - } - - try - { - if(lookup == 0 || lookup == NUMBER_OF_LOOKUP_VALUES - 2) - { - xpulse = amplitude[lookup]; - } - else - { - xpulse = amplitude[lookup] + ((amplitude[lookup + 1] - - amplitude[lookup]) / tdiv) * (localTime - time[lookup]); - } - } - catch(ArrayIndexOutOfBoundsException ex) - { - String m = "AMBTSData.getPhysicsPulseShape():\n" + - " lookup index out of bound: lookup = " + lookup; - throw new AAtlantisException(m); - } - return (xpulse * pmtEnergy) + pmtPedestal; - - } // getPhysicsPulseShape() --------------------------------------------- - - - - /** - * Utility method APulseShapePlot.plotRealPulseShapes() is called from - * here. - * Physics pulse is calculated here: getPhysicsPulseShape(). - * This method is called from APickInteraction via ACalorimeterData - * which defines abstract plotPulseShapes(). - * Method more or less copied & pasted from ATILEData, but here is - * for just one channel. - * - * @param index int - */ - public void plotPulseShapes(int index) - { - if(pulseShapesDataAvailable) - { - String title = CALORIMETER_NAME + " cell index: " + index; - - // one channel for MBTS - int[][] adcCountsLocal = new int[][] { adcCounts[index] }; - - if(super.checkADCCountsAvailability(adcCountsLocal)) - { - // adc counts are available - logger.debug(CALORIMETER_NAME + " adc counts (digits) are " + - "available for pulse shapes plots for this cell."); - } - else - { - AOutput.append("\nADC counts are not available for this cell, " + - "can't plot pulse shapes.", ALogInterface.WARNING); - return; - } - - - // step - starting from 1, need to get step numbers within - // number of ADC samples (adcCounts[0].length) - double step = (adcCounts[0].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - double[][] realPulse = new double[1][NUMBER_OF_LOOKUP_VALUES]; // 1 channel - double d = 1.0; - - // by zdenek 2008-12-02 - // DPD (slimed version of ESD) sometimes don't have cellPedestal - // for a cell (the tag exists, values are there, but are 0). check - // if pedestal is 0 and if so, take as pedestal value the first - // adc count digit - float cellPedestalLocal = cellPedestal[index]; - if(cellPedestalLocal == 0.0f) - { - logger.debug("MBTS cellPedestal is not available (i.e. " + - "are 0.0f), using first adcCount digit as pedestal."); - cellPedestalLocal = adcCounts[index][0]; - } - - try - { - for(int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) - { - d += step; - realPulse[0][i] = - this.getPhysicsPulseShape(d, cellRawTime[index], - cellPedestalLocal, - cellRawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - } - } - catch(AAtlantisException aaex) - { - AOutput.append(aaex.getMessage(), ALogInterface.WARNING); - return; - } - - APulseShapePlot.plotRealPulseShapes(adcCountsLocal, realPulse, - step, null, title); - } - else - { - logger.warn(CALORIMETER_NAME + " plotPulseShapes() method called, " + - "but data is not available."); - return; - } - - } // plotPulseShapes() -------------------------------------------------- - - - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AMDTData.java b/graphics/AtlantisJava/src/atlantis/data/AMDTData.java deleted file mode 100755 index 0074b2c5a161fd28d5e9ba25a99a1c8405f4b319..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AMDTData.java +++ /dev/null @@ -1,338 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; - -public class AMDTData extends AMuonHitData -{ - protected float[] driftR; - protected float[] length; - private static final int BARREL = 1; - - private static ALogger logger = ALogger.getLogger(AMDTData.class); - - public String getParameterGroup() - { - return "MDT"; - } - - public String getName() - { - return "MDT"; - } - - public String getNameScreenName() - { - return "MDT"; - } - - AMDTData(AHashMap p, AEvent e) - { - super(p,e); - driftR = p.getFloatArray("driftR"); - length = p.getFloatArray("length"); - // removed the fudge (CT 27/7/2004), and replaced with another - // for(int i=0; i<numData; i++) - // driftR[i]*=500./700.; - for (int i = 0; i < numData; i++) - if (driftR[i] > 1.46) - driftR[i] = (float) 1.46; // don't go out of the drifttube ! - } - - protected int getStation(int index) - { - try { - String stationName = AIdHelper.stationName(id[index]); - - if (stationName.charAt(1) == 'I') { - return 0; - } else if (stationName.charAt(1) == 'E') { - return 1; - } else if (stationName.charAt(1) == 'M') { - return 2; - } else if (stationName.charAt(1) == 'O') { - return 3; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding MDT identifier", e); - } - - return 0; - } - - protected int getSub(int index) - { - try { - if (AIdHelper.stationName(id[index]).charAt(0) == 'B') { - return 1; - } else if (AIdHelper.stationEta(id[index]) < 0) { - return 0; - } else { - return 2; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding MDT identifier", e); - } - - return 1; - } - - public int getSector(int index) - { - try { - String stationName = AIdHelper.stationName(id[index]); - - if (stationName.charAt(2) == 'L') { - return 2 * (AIdHelper.stationPhi(id[index]) - 1); - } else { - return 2 * (AIdHelper.stationPhi(id[index]) - 1) + 1; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding MDT identifier", e); - } - - return 0; - } - - protected boolean getMeasuresPhi(int index) - { - return false; - } - - protected void applyCuts() - { - super.applyCuts(); - if (parameterStore.get("CutsATLAS", "CutPhi").getStatus()) - cutPhi(phi, getDPhi()); - cutEta(rho, z); - } - - // used to make phi cut - - private float[] getDPhi() - { - // only roughly correct for some special sectors - // must create all - float[] dphi = new float[numData]; - - // need only fill for those in draw list - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - dphi[list] = (float) Math.abs(Math.atan2(length[list] / 2., rho[list])); - } - return dphi; - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+"\n"+ - AMath.RHO+" = "+String.format("%.3f",rho[index])+"\n "+ - "z = " + String.format("%.3f",z[index]) + " cm\n"+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - String temp = getNameScreenName() + " (id: " + identifier[index] + - " index: " + index + ")\n " + - AMath.RHO + " = " + String.format("%.3f",rho[index]) + " cm" + "\n " + - AMath.PHI + " = " + String.format("%.3f",Math.toDegrees(phi[index])) + - AMath.DEGREES + " (" + String.format("%.3f",phi[index]) + " rad)\n " + - "z = " + String.format("%.3f",z[index]) + " cm\n " + - "driftR = " + String.format("%.3f",driftR[index]) + " cm"; - if (sector[index] != -1) - { - temp += "\n sector = " + sector[index]; - } - - return temp; - } - - private void makeDrawListYX() - { - int mode = parameterStore.get("YX", "Mode").getI(); - - if (mode > 0 && mode < 5) - { - numDraw = 0; - } - else - { - makeDrawList(); - if (mode == 0) - cut(" Barrel ", sub, "==", BARREL); - else - { - cut(" Endcaps", sub, "!=", BARREL); - cut(" Station", station, "==", mode - 5); - } - } - } - - private void makeDrawListFZ() - { - int mode = parameterStore.get("FZ", "Mode").getI(); - - if (mode > 0 && mode < 4) - { - numDraw = 0; - } - else - { - makeDrawList(); - if (mode == 0) - cut(" Endcaps", sub, "!=", BARREL); - else - { - cut(" Barrel ", sub, "==", BARREL); - if (mode == 4) - cut(" Station", station, "<=", mode - 3); - else - cut(" Station", station, "==", mode - 3); - } - } - } - - protected ACoord getYXUser() - { - return getYXUser(0); - } - - private ACoord getYXUser(int flag) - { - makeDrawListYX(); - int numPieces = 13; - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double r = rho[list]; - double cosPhi = Math.cos(phi[list]); - double sinPhi = Math.sin(phi[list]); - double phiM = Math.rint(phi[list] / AMath.PI_BY_8) * AMath.PI_BY_8; - double cosPhiM = Math.cos(phiM); - double sinPhiM = Math.sin(phiM); - double d = length[list] / 2.; - double x = r * cosPhi; - double y = r * sinPhi; - - hv[0][i] = AMath.splitLineIntoPieces(new double[] { x + d * sinPhiM, x - d * sinPhiM }, numPieces); - hv[1][i] = AMath.splitLineIntoPieces(new double[] { y - d * cosPhiM, y + d * cosPhiM }, numPieces); - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - } - - protected ACoord getFRUser() - { - return getYXUser(1).convertYXToFR().includePhiWrapAround("FR"); - } - - protected ACoord getRZUser() - { - makeDrawList(); - int[] sign = new int[numDraw]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - - for (int i = 0; i < numDraw; i++) - { - double phiDiff = Math.abs(phi[listdl[i]] - phiMid); - - sign[i] = -1; - if (phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - sign[i] = 1; - } - return getXZRZUser(sign); - } - - protected ACoord getXZUser() - { - makeDrawList(); - cutMuonSector(sector); - int[] sign = new int[numDraw]; - int sect=(int)Math.round(parameterStore.get("XZ", "Phi").getD() / 22.5); - - for (int i = 0; i < numDraw; i++) - { - sign[i] = 1; - if (sector[listdl[i]] != sect) - sign[i] = -1; - } - return getXZRZUser(sign); - } - - protected ACoord getXZRZUser(int[] sign) - { - // int muonMode=APar.get("Data.MDT").getI(); - int muonMode = parameterStore.get("MDT", "Mode").getI(); - int numPoints; - - if (muonMode == 0) // circles - numPoints = 48; - else - numPoints = 2; // lines - - double[][][] hv = new double[2][numDraw][numPoints]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double rC = sign[i] * getSectorRho(sector[list], rho[list], phi[list]); - double zC = z[list]; - double d = driftR[list]; - - if (muonMode == 0) - { // circles - for (int j = 0; j < numPoints; j++) - { - hv[0][i][j] = zC + d * Math.cos(Math.PI * 2 * j / (numPoints - 1)); - hv[1][i][j] = rC + d * Math.sin(Math.PI * 2 * j / (numPoints - 1)); - } - } - else - { // lines - double radius = Math.sqrt(rC * rC + zC * zC); - double sinTheta = rC / radius; - double cosTheta = zC / radius; - - hv[0][i][0] = zC + d * sinTheta; - hv[1][i][0] = rC - d * cosTheta; - hv[0][i][1] = zC - d * sinTheta; - hv[1][i][1] = rC + d * cosTheta; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - } - - protected ACoord getFZUser() - { - makeDrawListFZ(); - double[][][] hv = new double[2][numDraw][2]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - index[i] = list; - hv[0][i][0] = z[list]; - hv[0][i][1] = z[list]; - double deltaPhi = Math.atan2(length[list] / 2., rho[list]); - - hv[1][i][0] = Math.toDegrees(phi[list] - deltaPhi); - hv[1][i][1] = Math.toDegrees(phi[list] + deltaPhi); - } - return new ACoord(hv, index, this, ACoord.POLYLINES).includePhiWrapAround("FZ"); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AMuonData.java b/graphics/AtlantisJava/src/atlantis/data/AMuonData.java deleted file mode 100755 index 368a6a039886a4bb4a09bb6c4c1cd9e6a3f45b7b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AMuonData.java +++ /dev/null @@ -1,95 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; -import atlantis.utils.A4Vector; - -/** - * Reconstructed Muon - */ -public class AMuonData extends AHelixAODData -{ - private float[] chi2; - - AMuonData(AHashMap p, AEvent e) - { - super(p,e); - chi2=p.getFloatArray("chi2"); - } - - public String getParameterGroup() - { - return "Muon"; - } - - public float getchi2(int index) - { - return chi2[index]; - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A4Vector start = new A4Vector(); - start.setPtEtaPhiM(pT[k],eta[k],phi[k],0.1057); - sum.add(start); - } - - return sum; - } - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsObjects", "MuonPt", " |ET|", pT); - cut("CutsObjects", "Muonchi2", " |chi2|", chi2); - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n PT="+String.format("%.3f",pT[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Px="+String.format("%.3f",pT[index]*Math.cos(phi[index]))+" GeV "+ - "\n Py="+String.format("%.3f",pT[index]*Math.sin(phi[index]))+" GeV "+ - "\n Pz="+String.format("%.3f",pT[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n storegate key: "); - msg.append(sgKey); - msg.append("\n PT = "); - msg.append(String.format("%.3f",pT[index])); - msg.append(" GeV\n P = "); - msg.append(String.format("%.3f",Math.abs(pT[index]/Math.cos(AMath.lambda(eta[index]))))); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",Math.toDegrees(phi[index]))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - msg.append("\n chi2 = "); - msg.append(chi2[index]); - - return msg.toString(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AMuonHitData.java b/graphics/AtlantisJava/src/atlantis/data/AMuonHitData.java deleted file mode 100644 index 85717f5fa904875fbcd9923d451a9688dc4dd853..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AMuonHitData.java +++ /dev/null @@ -1,192 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.utils.*; -import atlantis.parameters.*; - -public abstract class AMuonHitData extends AHitData { - - protected float[] rho; - protected float[] phi; - protected float[] x; - protected float[] y; - protected float[] z; - protected int[] sector; - protected int[] station; - protected boolean[] measuresPhi; - - public static final int DOES_NOT_MEASURE_PHI=0; - public static final int MEASURES_PHI=1; - - // remove when go to compact id ( if compact id was in a sensible form) - String[] identifier; - - AMuonHitData(AHashMap p, AEvent e) { - super(p,e); - x=p.getFloatArray("x"); - y=p.getFloatArray("y"); - z=p.getFloatArray("z"); - rho=new float[numData]; - phi=new float[numData]; - for(int i=0; i<numData; ++i) { - rho[i]=(float)Math.sqrt(x[i]*x[i]+y[i]*y[i]); - phi[i]=(float)Math.atan2(y[i], x[i]); - if(phi[i]<0.) phi[i]+=AMath.TWO_PI; - } - identifier=p.getStringArray("identifier"); - station=new int[numData]; - sector=new int[numData]; - measuresPhi=new boolean[numData]; - for(int i=0; i<numData; ++i) { - // should be moved to AHitData - sub[i]=getSub(i); - sector[i]=getSector(i); - station[i]=getStation(i); - measuresPhi[i]=getMeasuresPhi(i); - } - } - - /** - * Get the name used for associating this datatype/collection. For the - * muon hits no storegate key is used. - * @return - */ - public String getFullName() { - return getName(); - } - - protected int internalColor() - { - int numColorTypes = super.internalColor(); - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if(colorFunction == numColorTypes + 1) // colour by Track Segment - { - colorBy(getSegments()); - } - return numColorTypes + 1; - - } // internalColor() ---------------------------------------------------- - - - abstract protected int getStation(int index); - - abstract public int getSector(int index); - - abstract protected int getSub(int index); - - abstract protected boolean getMeasuresPhi(int index); - - protected String getSegments() { - AEnumeratorParameter key = (AEnumeratorParameter) parameterStore.get("MuonSegment", "MuonSegmentCollections"); - - return "MuonSegment" + key.getCurrentText(); - } - - public int getRZSign(int index) { - double phiMid=Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff=Math.abs(phi[index]-phiMid); - - int sign=-1; - if(phiDiff<Math.PI/2.||phiDiff>3*Math.PI/2.) - sign=1; - return sign; - } - - protected String getReconstructedTracks() { - AData tracks = event.getTrackData("MuonTrack"); - if (tracks == null) { - return null; - } else { - return tracks.getName() + tracks.getStoreGateKey(); - } - } - - // get the distance of closest approach of the inifinite line representing the - // drift tube axis to Z axis - // Normal this is rho of the hit, but need not be for non standard modules - // (e.g. near feet) - static double getSectorRho(int sector, double rho, double phi) { - return rho*Math.abs(Math.cos(phi-sector*AMath.PI_BY_8)); - } - - protected void applyCuts() { - cutIndex(); - cutSimulatedTracks(); - cutReconstructedTracks(); - cutSegments(); - } - - // keep only muon hits in the input muon sectors - protected void cutMuonSector(int[] sector) { - AParameter p=parameterStore.get("XZ", "Phi"); - - // display muon data when phi is in the middle of a sector - if(p.getD() % 22.5 < 1e-2) { - int sect=(int)Math.round((p.getD() % 360.) / 22.5); - - int num=0; - - for(int i=0; i<numDraw; i++) { - int s=sector[listdl[i]]; - - if(s==sect||s==sect-8||s==sect+8) - listdl[num++]=listdl[i]; - } - numDraw=num; - } else { - numDraw=0; - } - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+"\n"+ - AMath.RHO+" = "+String.format("%.3f",rho[index])+"\n "+ - "z = " + String.format("%.3f",z[index]) + "cm\n"+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - String temp = getNameScreenName() + " (id: " + identifier[index] + " index: " + index + ")" + - "\n " + AMath.RHO + " = " + String.format("%.3f",rho[index]) + " cm" + - "\n " + AMath.PHI + " = " + String.format("%.3f",Math.toDegrees(phi[index])) + - AMath.DEGREES + " (" + String.format("%.3f",phi[index]) + " rad)" + - "\n z = " + String.format("%.3f",z[index]) + " cm"; - - if(sector[index]!=-1) - { - temp += "\n sector = " + sector[index]; - } - - return temp; - } - - protected void setType() { //What is this doing?? - int[][] recon=event.getAssociationManager().get(getName(),getReconstructedTracks()); - for(int i=0; i<numData; i++) { - if( (recon!=null&&recon[i]!=null)) - type[i]=1; - else - type[i]=0; - } - } - - /** - * cut hits if connected/unconnected to reconstructed tracks - */ - protected void cutReconstructedTracks() - { - int cutOption = parameterStore.get("CutsMuon", "HitsByRTr").getI(); - cutByAssociationTo(getReconstructedTracks(), getName(), cutOption); - } - - /** - * cut hits if connected/unconnected to reconstructed segments - */ - protected void cutSegments() - { - int cutOption = parameterStore.get("CutsMuon", "HitsBySegment").getI(); - cutByAssociationTo(getSegments(), getName(), cutOption); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AMuonROIData.java b/graphics/AtlantisJava/src/atlantis/data/AMuonROIData.java deleted file mode 100755 index 567f2f9cf5ab7e116a4d34c6adf708bf3cf97a23..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AMuonROIData.java +++ /dev/null @@ -1,34 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.utils.AHashMap; - -/** - * - * Muon Region Of Interest - * - * @author Zdenek Maxa, Qiang Lu, Juergen Thomas - */ -public class AMuonROIData extends AROIData -{ - AMuonROIData(AHashMap p, AEvent e) - { - super(p,e); - } // AMuonROIData() ------------------------------------------------------ - - public String getParameterGroup() - { - return "MuonROI"; - } // getParameterGroup() ------------------------------------------------ - - public String getName() - { - return "MuonROI"; - } // getName() ---------------------------------------------------------- - - public String getNameScreenName() - { - return "MuonROI"; - } // getNameScreenName() ------------------------------------------------ - -} // class AMuonROIData ====================================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/AMuonSegmentData.java b/graphics/AtlantisJava/src/atlantis/data/AMuonSegmentData.java deleted file mode 100755 index 96adc598bcf40afe35e5ef93f34f84ad63f244f3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AMuonSegmentData.java +++ /dev/null @@ -1,56 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AHashMap; - -/** - * - * @author Eric Jansen - */ -public class AMuonSegmentData extends ASegmentData { - - /** Creates a new instance of AMuonSegmentData */ - AMuonSegmentData(AHashMap p, AEvent e) { - super(p,e); - String assocKey = getName() + getStoreGateKey(); - event.getAssociationManager().add(new AAssociation(assocKey, "MDT", numHits, hits, event)); - event.getAssociationManager().add(new AAssociation(assocKey, "RPC", numHits, hits, event)); - event.getAssociationManager().add(new AAssociation(assocKey, "TGC", numHits, hits, event)); - event.getAssociationManager().add(new AAssociation(assocKey, "CSC", numHits, hits, event)); - } - - public void makeDrawList() { - super.makeDrawList(); - - if (currentProjection instanceof AProjectionYX) { - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_STANDARD) { - numDraw = 0; - } else { - int num = 0; - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - - // Anything beyond z=13m or below r=6.5m is endcap - if (Math.sqrt(x[j]*x[j] + y[j]*y[j]) > 650. - && Math.abs(z[j]) < 1300.) { - listdl[num++] = j; - } - } - numDraw = num; - } - } - } - - public String getParameterGroup() { - return "MuonSegment"; - } - - public String getName() { - return "MuonSegment"; - } - - public String getNameScreenName() { - return "MuonSegment"; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AMuonTrackData.java b/graphics/AtlantisJava/src/atlantis/data/AMuonTrackData.java deleted file mode 100644 index cd768ea2a38db3f71b06166f98315ff02c4657f4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AMuonTrackData.java +++ /dev/null @@ -1,200 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.canvas.AWindow; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionVP; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; - - -/** - * - * @author Eric Jansen - */ -public class AMuonTrackData extends ATrackData { - - private static ALogger logger = ALogger.getLogger(AMuonTrackData.class); - - protected float[] phi0; - protected float[] pT; - protected float[] cotTheta; - protected int[] author; - - /** Creates a new instance of AMuonTrackData */ - AMuonTrackData(AHashMap p, AEvent e) throws AAtlantisException { - super(p,e); - String assocKey = getName() + getStoreGateKey(); - if(p.get("numHits") != null) { - int[] numHits = p.getIntArray("numHits"); - int[] hits = p.getIntArray("hits"); - - event.getAssociationManager().add(new AAssociation(assocKey, "MDT", numHits, hits,event)); - event.getAssociationManager().add(new AAssociation(assocKey, "RPC", numHits, hits,event)); - event.getAssociationManager().add(new AAssociation(assocKey, "TGC", numHits, hits,event)); - event.getAssociationManager().add(new AAssociation(assocKey, "CSC", numHits, hits,event)); - } - - phi0 = p.getFloatArray("phi0"); - pT = p.getFloatArray("pt"); - cotTheta = p.getFloatArray("cotTheta"); - author = p.getUnsureIntArray("trackAuthor"); - } - - public String getParameterGroup() { - return "MuonTrack"; - } - - public String getName() { - return "MuonTrack"; - } - - public String getNameScreenName() { - return "MuonTrack"; - } - - protected void finalizeConstruction() { - super.finalizeConstruction(); -/* - // needs ZVTx - h = new AHelix[numData]; - for(int i = 0; i < numData; ++i) { - double p = AMath.getPFromPttL(pT[i], cotTheta[i]); - double xVtx = parameterStore.get("Event", "XVtx").getD(); - double yVtx = parameterStore.get("Event", "YVtx").getD(); - double phiVtx = Math.atan2(yVtx, xVtx); - double rho = Math.sqrt(xVtx * xVtx + yVtx * yVtx); - double d0 = -rho * Math.sin(phi0[i] - phiVtx); - // correct for average energy loss - double pTCorrected = pT[i] * (p + 3.7) / p; - - h[i] = new AHelix((float)d0, - (float)(parameterStore.get("Event", "ZVtx").getD()), - (float)Math.toDegrees(phi0[i]), cotTheta[i], (float)pTCorrected); - //calculatePhiCorrection(i); - } -*/ - } - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if(projection instanceof AProjectionVP - && parameterStore.get(PARAMETER_GROUP, "DrawnAs").getI() != DRAW_NEWHELIX) - { - ag.draw(window.calculateDisplay(getVPUser(window, projection))); - } - else - super.draw(window, ag, projection); - } - - protected ACoord getVPUser(AWindow window, AProjection projection) - { - makeDrawList(); - double[][][] hv = new double[2][2*numDraw][]; - int[] index = new int[2 * numDraw]; - int num = 0; - for (int j=0; j<numDraw; j++) { - int list = listdl[j]; - ADHelix dhelix = new ADHelix(h[list]); - double s1 = dhelix.getAStart(); - double s2 = 179.; - // hardwire projection.getMinRho() == 2. for now - s1 = dhelix.intersectWithRadialCylinder(((AProjection2D)projection).getMinRho(), s1, s2); - double sEnd = dhelix.intersectWithCylinder(true, AProjectionVP.getRhoVPlot(), - true, AProjectionVP.getZVPlot()); - s2 = Math.max(Math.min(s2, sEnd), s1); - // if the whole helix is to be drawn (which are unusual - // helices, shorten it a little to avoid wraparound problems - if (s1 == 0. && s2 == 180.) s2 = 179.; - - if (parameterStore.get("VP", "ShortV").getStatus() && !parameterStore.get("Data", "S3D").getStatus()) { - s1 = s2 - parameterStore.get("VP", "ShortV").getD() * (s2 - s1); - } - - // by Zdenek: - // if this condition is not entered, hv array containing coordinates - // remains empty and Atlantis will crash with NullPointerException - // in AWindow.calculateUser(ACoord user) - // magic constants here (e.g. s2) need to be understood and this - // method best reimplemented - for(int sign=-1; sign<=1; sign+=2) { - // ugly must change structure at some point - AProjectionVP.sign = sign; - ACoord pointsOnHelix; - if (s2 > s1) { - pointsOnHelix = dhelix.drawHelix(window, (AProjection2D) projection, s1, s2); - hv[0][num] = pointsOnHelix.hv[0][0]; - hv[1][num] = pointsOnHelix.hv[1][0]; - } else { - hv[0][num] = new double[0]; - hv[1][num] = new double[0]; - } - index[num] = list; - num++; - } - } - - // by Zdenek: - // condition to prevent NullPointerException in AWindow.calculateUser() - // see previous comment ... - // this condition should be removed completely 'bug in helix' - // problem is understood - ACoord coord = null; - if(hv[0].length > 0 && hv[0][0] == null) - { - logger.warn("AMuonTrackData.getVPUser(): \"" + this.getName() + - ":" + this.getStoreGateKey() + "\" can't be drawn in eta-phi"); - coord = ACoord.NO_DATA; - } - else - { - coord = new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES); - } - return window.calculateUser(coord).includePhiWrapAround(projection.getName()); - } - - - - private float[] getEta() - { - float[] eta = new float[numData]; - if(polylinedTrack) - { - for(int i = 0; i < numData; i++) - { - if(h!=null && h[i]!=null) eta[i] = (float) h[i].eta(); - else eta[i] = (float) AParameterUtilities.eta(z[i][0], rho[i][0]); - } - } - else - { - for(int i = 0; i < numData; i++) - { - eta[i] = (float) h[i].eta(); - } - - } - - return eta; - } - - - - protected void applyCuts() { - cutIndex(); - cut("CutsInDet", "Pt", " |Pt|", pT); - cut("CutsMuon", "Pt", " |Pt|", pT); - cut("CutsInDet", "trackAuthor", " Author", author); - cutPhi(phi0); - if(parameterStore.get("CutsATLAS", "CutEta").getStatus()) - { - cutEta(getEta()); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AOldHelix.java b/graphics/AtlantisJava/src/atlantis/data/AOldHelix.java deleted file mode 100755 index a3f490c571707dba7a2a690cdbf460e2f5972913..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AOldHelix.java +++ /dev/null @@ -1,338 +0,0 @@ -package atlantis.data; - -import atlantis.globals.AGlobals; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.utils.AMath; -import atlantis.utils.A3Vector; -import atlantis.utils.ALogger; - -import static java.lang.Math.PI; - -/** - * This is a convenience class to group together the six helix parameters. - */ -public class AOldHelix { - - private final static ALogger logger = ALogger.getLogger(AOldHelix.class); - - private static final int SIZE=5; - private static final boolean DEBUG = false; - private static final APar parameterStore = APar.instance(); - // C - constant depending on the magnetic field, constant proportional - // to curvature in the magnetic field - private static final double C; - static { - AParameter curvatureParameter = parameterStore.get("Event", "Curvature"); - if (curvatureParameter!=null) { - C = curvatureParameter.getD(); - } - else { - C = 100/0.6;; - logger.error("Curvature parameter not found, defaulting to "+C); - } - } - - // These fields are public but final so cannot be altered. - /** Distance between circle and (0,0) at point of closest approach (PCA). */ - public final double d0; - /** Z of circle at PCA. */ - public final double z0; - /** phi0 of track at PCA [degrees] */ - public final double phi0; - /** Dip of track = Pz/pTTrack =0.5 * ( E - 1/E ) : constant along the helix */ - public final double tL; - /** Transverse momentum * charge. */ - public final double pT; - /** ln( Pz/pTTrack + SQRT[(Pz/pTTrack)**2 +1 ] */ - public final double eta; - /** Angle between (0,0) and vertex as seen from the circle center [degrees]? - * For helices starting at PCA, startPhi=0. This is the case for reconstructed - * helices that are not yet associated to a secondary vertex or are - * drawn to PCA. - * Mutable because it is changed when tracks are used to fit a vertex. */ - double startPhi; - - // negative end vertex means none exits - double rhoVertex = 0.0; - private double rhoEndVertex = -1.0; - - private int numHits; - - double[][] cov=null; - - AOldHelix() { - this(0, 0, 0, 0, 0); - }; - - /** Standard Helix constructor without end vertex */ - AOldHelix(float rhoVertex, float phiVertex, float zVertex, - float pTTrack, float phiTrack, float etaTrack, int charge ) { - this(rhoVertex,phiVertex,zVertex,pTTrack,phiTrack,etaTrack,charge,-1); - } - - /** - * Standard Helix constructor with end vertex. - * - * Note: this method is not called when creating helix representation of - * reconstructed InDet tracks, but is called for simulated InDet tracks. - * - * @param rhoVertex rho of vertex from which track starts - * @param phiVertex phi of vertex from which track starts - * @param zVertex Z of vertex from which track starts - * @param pTTrack transverse track momentum > 0 - * @param phiTrack phi of track seen from vertex - * @param etaTrack eta = -ln(tg(theta/2)), theta = arctg(pTTrack/Pz) = 2*arctg( e**(-eta)) - * @param charge charge = +1 or -1 - * @param rhoEndVertex - */ - AOldHelix(float rhoVertex, float phiVertex, float zVertex, - float pTTrack, float phiTrack, float etaTrack, int charge, float rhoEndVertex ) { - /* - * Derived: - * rC = signed radius of circle (positive for positive particle, which - * loops in the clockwise direction in the standard xy projection, - * given that Bz is positive in the ATLAS solenoid) - * xC = x position of center of circle - * yC = y position of center of circle - * E = E**eta - * charge=1 if icode>=0 else charge=-1 - * - * Calculation: - * rC = C*pTTrack C = 100./0.6 - * xC = rhoVertex*cos(phiVertex) + rC*sin(phiTrack) - * yC = rhoVertex*sin(phiVertex) - rC*cos(phiTrack) - * tl = Pz/pTTrack = 0.5 * ( E - 1/E ) - * d0 = rC - sqrt(xC*xC + yC*yC) - * startPhi = pi/2 - phiTrack + atan2(yC,xC) modify startPhi to: -pi/2 < startPhi < pi/2 - * z0 = zVertex - rC*startPhi*tl - * phi0 = phiTrack + startPhi - * pCharge = charge*pTTrack - * Change startPhi and phi0 from radians to degrees. - * - */ - double rC=C*pTTrack*charge; - if (DEBUG) logger.debug("AOldHelix: charge, rC = "+charge+", "+rC); - double xC=rhoVertex*Math.cos(phiVertex)+rC*Math.sin(phiTrack); - double yC=rhoVertex*Math.sin(phiVertex)-rC*Math.cos(phiTrack); - if (DEBUG) logger.debug("AOldHelix: xCyC"+" "+xC+" "+yC); - double e=Math.exp(etaTrack); - tL=0.5*(e-1./e); - eta = etaTrack; - d0=rC-charge*Math.sqrt(xC*xC+yC*yC); - phiTrack = (float) AMath.nearestPhiRadians(phiTrack); - double temp=Math.atan2(yC, xC); - temp = AMath.nearestPhiRadians(temp); - double startPhiRad=charge*(PI/2)-phiTrack+temp; - startPhiRad = AMath.nearestPhiRadians(startPhiRad, 0); - z0=zVertex-rC*startPhiRad*tL; - phi0=Math.toDegrees(phiTrack+startPhiRad); - startPhi=charge*Math.toDegrees(startPhiRad); - pT=charge*pTTrack; - - // keep rhoEndVertex for simulated tracks with a daughter - this.rhoVertex=rhoVertex; - this.rhoEndVertex = rhoEndVertex; - } - - /** - * Construct AOldHelix object. - * @param d0 - * @param z0 - * @param phi0 [degrees] - * @param tL - * @param pT - */ - AOldHelix(float d0, float z0, float phi0, - float tL, float pT) { - this.d0=d0; - this.z0=z0; - this.phi0=AMath.nearestPhiDegrees(phi0); - this.tL=tL; - this.eta = calculateEta(this.tL); - this.pT=pT; - startPhi=0.; - } - - AOldHelix(float d0, float z0, float phi0, - float tL, float pT, int numHits) { - this(d0, z0, phi0, tL, pT); - this.numHits=numHits; - } - - AOldHelix(float d0, float z0, float phi0, - float tL, float pT, float[][] c) { - this.d0=d0; - this.z0=z0; - this.phi0=phi0; - this.tL=tL; - this.eta = calculateEta(this.tL); - this.pT=pT; - this.startPhi=0.; - - cov=new double[c.length][]; - if(c.length!=SIZE) - logger.error("Helix error "+c.length); - for(int i=0; i<c.length; ++i) { - if(c[i].length!=SIZE) - logger.error("Helix error "+c.length); - cov[i]=new double[c[i].length]; - } - for(int i=0; i<c.length; ++i) - for(int j=0; j<c[i].length; ++j) - cov[i][j]=c[i][j]; - } - - AOldHelix(float d0, float z0, float phi0, - float tL, float pT, int numHits, float[][] c) { - this(d0, z0, phi0, tL, pT, c); - this.numHits=numHits; - } - - public double[] getPar() { - return new double[] {d0, z0, Math.toRadians(phi0), tL, 1./pT}; - } - - public double[][] getCov() { - return cov; - } - - public double getRhoEndVertex(){ - return rhoEndVertex; - } - -/** - * Set Phi start so that the track will originate from the point on the - * reconstructed track in the YX plane which is closest to the point (Vx,Vy). - * Only used when drawing tracks originating from a reconstructed vertex. - */ - public void setPhiStartByXYPoint(double Vx, double Vy) { - //construct a local super object to get the xC and yC numbers - ADHelix Dh=new ADHelix(this); - // do the calculation to find the starting angle - double Xc=Dh.getxC(); - double Yc=Dh.getyC(); - - double a=-1.*(Vx-Xc); - double b=-1.*(Vy-Yc); - - double pTTrack=pT; - double phiTrack=Math.toRadians(phi0); - - double charge=1; - if(pTTrack<0.0) charge=-1.; - - double temp=Math.atan2(b, a); - temp = AMath.nearestPhiRadians(temp); - double sPhi=charge*(PI/2)-phiTrack+temp; - sPhi = AMath.nearestPhiRadians(sPhi, 0); - sPhi=charge*Math.toDegrees(sPhi); - startPhi=Math.abs(sPhi); - } - - public String toString() { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = ""; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n PT="+String.format("%.3f",Math.abs(pT))+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta)+"\n "+ - AMath.PHI+" = "+String.format("%.3f",phi0)+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Px="+String.format("%.3f",Math.abs(pT)*Math.cos(Math.toRadians(phi0)))+" GeV "+ - "\n Py="+String.format("%.3f",Math.abs(pT)*Math.sin(Math.toRadians(phi0)))+" GeV "+ - "\n Pz="+String.format("%.3f",Math.abs(pT)*Math.sinh(eta))+" GeV "+ - "\n Charge = " + (int)(pT/Math.abs(pT)); - return output; - } - - String s=""; - double f=1.; - - if(numHits>0) - s+="\n numHits = "+numHits; - // if(Math.abs(d0)<0.1) f=10000.; - s+="\n d0 = "+String.format("%.3f",f*d0); - if(cov!=null) s+=" "+AMath.PLUSMINUS+" "+String.format("%.3f",f*Math.sqrt(cov[0][0])); - if(f>100) - s+=" um"; - else - s+=" cm"; - f=1.; - // if(Math.abs(z0)<0.1) f=10000.; - s+="\n z0 = "+String.format("%.3f",f*z0); - if(cov!=null) s+=" "+AMath.PLUSMINUS+" "+String.format("%.3f",Math.sqrt(f*cov[1][1])); - if(f>100) - s+=" um"; - else - s+=" cm"; - - double zVtx = parameterStore.get("Event", "ZVtx").getD(); - //if(Math.abs(z0-zVtx) < 0.1) f=10000.; - s+="\n |z0-zVtx| = "+String.format("%.3f",f*Math.abs(z0-zVtx)); - if(f>100) - s+=" um"; - else - s+=" cm"; - - s+="\n phi0 = "+String.format("%.3f",phi0); - if(cov!=null) - { - s += " " + AMath.PLUSMINUS + " " + - String.format("%.3f",Math.toDegrees(Math.sqrt(cov[2][2]))) + - AMath.DEGREES; - } - else - { - s += AMath.DEGREES; - - } - s+= " (" + String.format("%.3f",Math.toRadians(phi0)); - if(cov != null) - { - s += " " + AMath.PLUSMINUS + " " + - String.format("%.3f",Math.toRadians(Math.sqrt(cov[2][2]))) + " rad)"; - } - else - { - s += " rad)"; - } - - s+="\n "+AMath.ETA+" = "+String.format("%.3f",eta); - if(cov!=null) { - // based on the relation between eta and ctgTheta - double etaError = Math.sqrt(cov[3][3] / (tL * tL + 1.0)); - s+=" "+AMath.PLUSMINUS+" "+String.format("%.3f",etaError); - } - s+="\n tL = "+String.format("%.3f",tL); - if(cov!=null) s+=" "+AMath.PLUSMINUS+" "+String.format("%.3f",Math.sqrt(cov[3][3])); - s+="\n pT = "+String.format("%.2f",pT) + " GeV"; - if(cov!=null) { - double sigmaPt=Math.abs(1./(Math.abs(1./pT)+Math.sqrt(cov[4][4]))-Math.abs(pT)); - - s+=" "+AMath.PLUSMINUS+" "+String.format("%.3f",sigmaPt)+" GeV"; - } - if(pT<0.) - s+="\n p = "+String.format("%.2f",-AMath.getPFromPttL(pT,tL)); - else - s+="\n p = "+String.format("%.2f",AMath.getPFromPttL(pT,tL)); - s+= " GeV"; - - return s; - } - - public A3Vector getP() { - double pTrans=Math.abs(pT); - double phi=Math.toRadians(phi0); - return new A3Vector(pTrans*Math.cos(phi), pTrans*Math.sin(phi), pTrans*tL); - } - - /** eta = -ln(tg theta/2), so eta = -ln(sqrt(ctgtheta*ctgtheta+1)-ctgtheta) */ - private static double calculateEta(double ctgTheta) { - double eta; - eta = -Math.log(Math.sqrt(ctgTheta * ctgTheta + 1.0) - ctgTheta); - return eta; - } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/data/APDGTable.java b/graphics/AtlantisJava/src/atlantis/data/APDGTable.java deleted file mode 100755 index 5fde73d3136128d50e24313b7a2b4be61ef7f152..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/APDGTable.java +++ /dev/null @@ -1,107 +0,0 @@ -package atlantis.data; - -import atlantis.globals.AGlobals; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; -import atlantis.utils.xml.*; -import java.util.*; -import java.io.File; -import java.io.InputStream; -import org.w3c.dom.*; -import javax.xml.parsers.*; - -/** - * Read a PDG table from the file pdg.xml and provide - * basic accessor functions to its particles - */ -public final class APDGTable { - - //The logger - private final static ALogger logger = ALogger.getLogger(APDGTable.class); - - //Wether to validate the XML document - private final static boolean VALIDATION=true; - - //The particle table linked by PDG code - private final static Map<Integer, AParticle> particles = new HashMap<Integer, AParticle>(100); - - //Always read in the Hashmap - static { - readPDG(APDGTable.getFileInCurrentUserThenAtlantisHome("configuration","pdg.xml")); - } - - //Read in the PDG table from a file - private static void readPDG(String fileName) { - try { - DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance(); - - factory.setValidating(VALIDATION); - DocumentBuilder parser=factory.newDocumentBuilder(); - - parser.setErrorHandler(new AXMLErrorHandler()); - InputStream is = AUtilities.getFileAsStream(fileName); - Node pdg=parser.parse(is).getDocumentElement(); - NodeList particlesList=pdg.getChildNodes(); - int particlesCount=particlesList.getLength(); - - for(int i=0; i<particlesCount; i++) { - Node particle=particlesList.item(i); - - if(particle.getNodeType()==Node.ELEMENT_NODE) { - AParticle p=new AParticle(particle); - - particles.put(new Integer(p.getCode()), p); - } - } - } catch(Exception e) { - logger.error("Failed reading PDG table", e); - } - } - - public static int getCharge(int code) { - int sign=code/Math.abs(code); - AParticle p=particles.get(new Integer(Math.abs(code))); - - if(p!=null) - return p.getCharge()*sign; - else throw new ParticleNotFoundError(code); - } - - public static String getName(int code) { - AParticle p=particles.get(new Integer(Math.abs(code))); - int sign=1; - - if(code<0) sign=-1; - if(p!=null) - return p.getName(sign); - else throw new ParticleNotFoundError(code); - } - - public static int getParticleType(int code) { - AParticle p=particles.get(new Integer(Math.abs(code))); - - if(p!=null) - return p.getType(); - else throw new ParticleNotFoundError(code); - } - - //Declare our own error type here - no special implementation - public static class ParticleNotFoundError extends Error { - - //Only implement Error constructor with particle code - ParticleNotFoundError(int code){ - super("Particle with code "+code+" not found in PDG table"); - } - } - -public static String getFileInCurrentUserThenAtlantisHome(String directory, String name) -{ - File user = new File(name); - if (!user.canRead()) - { - return AGlobals.instance().getHomeDirectory() + directory + - System.getProperty("file.separator") + name; - } - return name; -}; -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AParticle.java b/graphics/AtlantisJava/src/atlantis/data/AParticle.java deleted file mode 100755 index 8007ae2c46f0413ce84712d629335e5c5a42873d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AParticle.java +++ /dev/null @@ -1,57 +0,0 @@ -package atlantis.data; - - -import atlantis.output.AExceptionHandler; - -import org.w3c.dom.*; - - -/** - * This class is used to store the properties of a particle. Used by APDGTable. - */ -public class AParticle { - private String name; - private int charge; - private int type; - private int code; - - private String[] chargeRep=new String[] { "-", "0", "+"}; - - public AParticle(Node node) { - NamedNodeMap atts=node.getAttributes(); - - try { - charge=Integer.parseInt(atts.getNamedItem("charge").getNodeValue()); - type=Integer.parseInt(atts.getNamedItem("type").getNodeValue()); - code=Integer.parseInt(atts.getNamedItem("code").getNodeValue()); - name=atts.getNamedItem("name").getNodeValue(); - } catch(NumberFormatException e) { - AExceptionHandler.processException("PDG error in Particle Node: "+node, e); - } - } - - public int getCharge() { - return charge; - } - - public int getType() { - return type; - } - - public int getCode() { - return code; - } - - public String getName() { - return name; - } - - public String getName(int sign) { - if(charge!=0) { - if(name.equals("Proton")&&sign==1) return "Proton"; - if(name.equals("Proton")&&sign==-1) return "Antiproton"; - return name+chargeRep[charge*sign+1]; - } else - return name; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/APhotonData.java b/graphics/AtlantisJava/src/atlantis/data/APhotonData.java deleted file mode 100755 index 7f942031f0969beac7441c980b5573667a1f4db3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/APhotonData.java +++ /dev/null @@ -1,166 +0,0 @@ -package atlantis.data; - -import java.util.Vector; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; -import atlantis.utils.A4Vector; - -/** - * Reconstructed Photon - */ -public class APhotonData extends AAODData -{ - private enum isEMe { Tight, Loose, none } - - private int[] isEM; - - private Vector<Enum> isEMEnum = new Vector<Enum>(); - private String[] label; - - APhotonData(AHashMap p, AEvent e) - { - super(p,e); - String[] isEMString=p.getUnsureStringArray("isEMString"); - label=p.getUnsureStringArray("label"); - isEM=p.getUnsureIntArray("isEM"); - - if(isEMString!=null) - { - for(String s : isEMString) - { - try { - isEMEnum.add(isEMe.valueOf(s)); - } - catch(IllegalArgumentException q) { - isEMEnum.add(isEMe.none); - } - } - } - else - { - for(int i=0;i<numData;i++) - { - isEMEnum.add(isEMe.none); - } - } - } - - public String getParameterGroup() - { - return "Photon"; - } - - public String getName() - { - return "Photon"; - } - - public String getisEMEnum(int index) - { - return isEMEnum.get(index).toString(); - } - - public int getisEM(int index) - { - return isEM[index]; - } - - public String getlabel(int index) - { - return label[index]; - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A4Vector start = new A4Vector(); - start.setPtEtaPhiM(pT[k],eta[k],phi[k],0); - sum.add(start); - } - return sum; - } - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsObjects", "PhotonPt", " |ET|", pT); - - // because of the retriever bug, currently 2048 means 0 for isEM - // remove this for block when the bug is fixed - if(isEM != null) - { - for(int i=0; i<isEM.length; i++) - { - if(isEM[i]==2048) - isEM[i] = 0; - } - } - - cut("CutsObjects", "PhotonisEM", " isEM", isEM); - - if (parameterStore.get("CutsObjects", "PhotonisEMString").getStatus()) - { - int cutSub = parameterStore.get("CutsObjects", "PhotonisEMString").getI(); - cutArrayEnum(isEMEnum, cutSub, "Photon isEMString"); - } - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n PT="+String.format("%.3f",pT[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Px="+String.format("%.3f",pT[index]*Math.cos(phi[index]))+" GeV "+ - "\n Py="+String.format("%.3f",pT[index]*Math.sin(phi[index]))+" GeV "+ - "\n Pz="+String.format("%.3f",pT[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n storegate key: "); - msg.append(sgKey); - msg.append("\n PT = "); - msg.append(String.format("%.3f",pT[index])); - msg.append(" GeV\n P = "); - msg.append(String.format("%.3f",Math.abs(pT[index]/Math.cos(AMath.lambda(eta[index]))))); - msg.append(" GeV\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",Math.toDegrees(phi[index]))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - - if (isEM != null) - { - msg.append("\n isEM = "); - msg.append(isEM[index]); - } - if (label != null) - { - msg.append("\n label = "); - msg.append(label[index]); - } - - return msg.toString(); - } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/data/APixelClusterData.java b/graphics/AtlantisJava/src/atlantis/data/APixelClusterData.java deleted file mode 100644 index acbe38d5856d632137ceeb4f9ccd4891e4b0deb9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/APixelClusterData.java +++ /dev/null @@ -1,403 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjectionVP; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -/** - * PixelCluster - Pixel clusters, as SiCluster but for Pixels - * reads in PixelCluster datatype - */ -public class APixelClusterData extends AHitData -{ - // read in from event file - private float[] x; - private float[] y; - private float[] z; - private float[] widthx; - private float[] widthy; - private int[] etaModule; - private int[] phiModule; - private float[] eloss; - - // calculated - private float[][] rho; - private float[][] phi; - private int[] layer; - - public static final int U_CLUSTER = -1; - public static final int PHI_CLUSTER = 0; - public static final int V_CLUSTER = 1; - public static final int ENDCAP_MINUS = 0; - public static final int BARREL = 1; - public static final int ENDCAP_PLUS = 2; - - - public String getParameterGroup() - { - return "PixelCluster"; - } - - public String getName() - { - return "PixelCluster"; - } - - public String getNameScreenName() - { - return "PixelCluster"; - } - - public float[] getX() - { - return x; - } - - public float[] getY() - { - return y; - } - - public float[] getZ() - { - return z; - } - - APixelClusterData(AHashMap p, AEvent e) - { - super(p,e); - x = p.getFloatArray("x0"); - y = p.getFloatArray("y0"); - z = p.getFloatArray("z0"); - widthx = p.getFloatArray("widthx"); - widthy = p.getFloatArray("widthy"); - eloss = p.getFloatArray("eloss"); - - rho = new float[2][numData]; - phi = new float[2][numData]; - - layer = new int[numData]; - for (int i = 0; i < numData; ++i) - { - sub[i] = getSub(id[i]); - layer[i] = getLayer(id[i]); - } - - etaModule = (p.get("etaModule") != null) ? p.getIntArray("etaModule") : null; - phiModule = (p.get("phiModule") != null) ? p.getIntArray("phiModule") : null; - - } // APixelClusterData() --------------------------------------------------- - - - - protected void calculateRhoPhi() - { - calculateRhoPhi(x, y, rho[0], phi[0]); - // treat wraparound - for (int i = 0; i < numData; ++i) - { - if (Math.abs(0 - phi[0][i]) > Math.PI) - { - if (0 - phi[0][i] > 0) - { - phi[0][i] += AMath.TWO_PI; - } - } - } // for - } // calculateRhoPhi() -------------------------------------------------- - - private void cutSubdetector() - { - AParameter par = parameterStore.get("CutsInDet", "SCT"); - if (par.getI() != -1) - { - cutArray(sub, par.getI(), "Barrel/Endcap"); - } - } // cutSubdetector() --------------------------------------------------- - - - protected void applyCuts() - { - cutIndex(); - cutOrientation(); - cutSubdetector(); - cut("CutsInDet", "Layer", "Layer", layer); - cutSimulatedTracks(); - cutReconstructedTracks(); - cutPhi(phi[0]); - cutEta(); - } // applyCuts() -------------------------------------------------------- - - private void cutEta() - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - if (!par.getStatus()) - return; - double etaCut = par.getD(); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaLowerCut = etaMid - etaCut; - double etaUpperCut = etaMid + etaCut; - int num = 0; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double eta1 = AParameterUtilities.eta(z[list], rho[0][list]); - if (eta1 > etaLowerCut && eta1 < etaUpperCut) - listdl[num++] = list; - } - numDraw = num; - } // cutEta() ----------------------------------------------------------- - - public int getLayer(int id) - { - int layer = (id >> 27) & 0x3; - int sub = getSub(id); - if (sub != BARREL) - { - layer += 7; - } - return layer; - } // getLayer() --------------------------------------------------------- - - public int getSub(int id) - { - // bitwise operation to determine cluster position from id (1,0,2 -> endcap-,barrel,endcap+) - return(id >> 29) & 0x3; - } // getSub() ----------------------------------------------------------- - - public int getOrientation(int id) - { - int side = (id & 0x400) >> 10; - int sub = getSub(id); - if ((side == 1 && sub == BARREL) || (side == 0 && sub != BARREL)) - { - return PHI_CLUSTER; - } - - int layer = getLayer(id); - if (layer % 2 == 1) - { - return U_CLUSTER; - } - - return V_CLUSTER; - } // getOrientation() --------------------------------------------------- - - protected void cutOrientation() - { - int num = 0; - AParameter stereoAnglePar = parameterStore.get("PixelCluster", "Stereo"); - if (!stereoAnglePar.getStatus()) - { - return; - } - int orientation = stereoAnglePar.getI(); - for (int i = 0; i < numDraw; i++) - { - if (orientation == getOrientation(id[listdl[i]])) - { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } // cutOrientation() --------------------------------------------------- - - protected int internalColor() - { - int numColorTypes = super.internalColor(); - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - if (colorFunction == numColorTypes + 1) - { - colorBy(layer); - } - else if (colorFunction == numColorTypes + 2) - { - colorByOrientation(); - } - else if (colorFunction == numColorTypes + 3) - { - colorByEloss(); - } - - return numColorTypes + 2; - } // internalColor() ---------------------------------------------------- - - protected void colorByOrientation() - { - int numColors = parameterStore.get("HitColors", "Number").getI(); - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for (int i = 0; i < numData; i++) - { - color[i] = (byte) col[getOrientation(id[i]) + 1 % numColors]; - } - } // colorByOrientation() ----------------------------------------------- - - protected void colorByEloss() - { - // This method currently uses the uncorrected value for eloss as an approximation to dE/dx - // Need to either loop over one track collection for associated tracks in Atlantis, or do this in JiveXML.. - - int numColors = parameterStore.get("HitColors", "Number").getI(); - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for (int i = 0; i < numData; i++) - { - if(eloss[i] < 0.5) - { - color[i] = (byte) col[1 + 1 % numColors]; // blue - } - else if(eloss[i] >=0.5 && eloss[i] < 2) - { - color[i] = (byte) col[5 + 1 % numColors]; // yellow - } - else if(eloss[i] >=2) - { - color[i] = (byte) col[2 + 1 % numColors]; // red/orange - } - } - } // colorByEloss() ----------------------------------------------------- - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index; - - String temp = getNameScreenName() + " (id: " + id[index] + " index: " + index +")\n" + - " orientation = " + getOrientation(id[index]); - temp += "\n x = " + x[index]; - temp += "\n y = " + y[index]; - temp += "\n z = " + z[index]; - temp += "\n " + AMath.RHO + " = " + rho[0][index] + " " + rho[1][index]; - temp += "\n " + AMath.ETA + " module = "; - temp += (etaModule != null) ? Integer.toString(etaModule[index]) : "n/a"; - temp += "\n " + AMath.PHI + " module = "; - temp += (phiModule != null) ? Integer.toString(phiModule[index]) : "n/a"; - temp += "\n widthx = "; - temp += (widthx != null) ? Float.toString(widthx[index]) : "n/a"; - temp += "\n widthy = "; - temp += (widthy != null) ? Float.toString(widthx[index]) : "n/a"; - temp += "\n eloss = "; - temp += (eloss != null) ? Float.toString(eloss[index]) : "n/a"; - - temp += super.getHitInfo(index); // finds barcode information - - return temp; - } // getHitInfo() ------------------------------------------------------- - - protected ACoord getYXUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for (int j = 0; j < 1; j++) - { - hv[0][j][i] = x[list]; - hv[1][j][i] = y[list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.SYMBOLS); - } // getYXUser() -------------------------------------------------------- - - protected ACoord getRZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiDiff = Math.abs(phi[0][list] - phiMid); - double sign; - if (phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - { - sign = +1.; - } - else - { - sign = -1.; - } - - for (int j = 0; j < 1; j++) - { - hv[0][j][i] = z[list]; - hv[1][j][i] = sign * rho[j][list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.SYMBOLS); - } // getRZUser() -------------------------------------------------------- - - protected ACoord getFRUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for (int j = 0; j < 1; j++) - { - hv[0][j][i] = rho[j][list]; - hv[1][j][i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[j][list], phi[j][list], z[list])); - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.SYMBOLS).includePhiWrapAround("FR"); - } // getFRUser() -------------------------------------------------------- - - protected ACoord getFZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for (int j = 0; j < 1; j++) - { - hv[0][j][i] = z[list]; - hv[1][j][i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[j][list], phi[j][list], z[list])); - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.SYMBOLS).includePhiWrapAround("FZ"); - } // getFZUser() -------------------------------------------------------- - - protected ACoord getVPUser() - { - makeDrawList(); - int numTotal = 2 * numDraw; - double[][][] hv = new double[2][numTotal][2]; - int[] index = new int[numTotal]; - double[] sign = new double[] { -1., 1. }; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - double deltaEta = AProjectionVP.getDeltaEta(rho[0][list], z[list]); - double eta = AParameterUtilities.eta(z[list], rho[0][list]); - for (int j = 0; j < 2; j++) - { - // pixels displayed halfway in phi and eta, for some reason - // quick fix = multiply by 2 - hv[0][2 * i + j][0] = 2*(eta + sign[j] * deltaEta); - hv[1][2 * i + j][0] = 2*Math.toDegrees(phi[0][list]); - index[2 * i + j] = list; - } - - } - return new ACoord(hv, index, this, ACoord.POLYLINES).includePhiWrapAround("VP"); - } // getVPUser() -------------------------------------------------------- - -} // class APixelClusterData =================================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/APixelRDOData.java b/graphics/AtlantisJava/src/atlantis/data/APixelRDOData.java deleted file mode 100644 index f9c78bd7bf8e2e1a0778eb0b5482c8d8e15a4e6a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/APixelRDOData.java +++ /dev/null @@ -1,160 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - - -/* - * PixelRDO - Pixel Raw Data object (SpacePoint Raw Data Objects) - * The class is derived from AS3DData class (SpacePoint) - * Parameters expected in the event file for the PixelRDO datatype - * id x y z etaModule phiModule - */ -public class APixelRDOData extends AS3DData -{ - private int[] etaModule = null; - private int[] phiModule = null; - - - public String getParameterGroup() - { - return "PixelRDO"; - - } // getParameterGroup() ------------------------------------------------ - - - - public String getName() - { - return "PixelRDO"; - - } // getName() ---------------------------------------------------------- - - - - public String getNameScreenName() - { - return "PixelRDO"; - - } // getNameScreenName() ------------------------------------------------ - - - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+"\n"+ - AMath.RHO+" = "+String.format("%.3f",rho[index])+"\n "+ - "z = "+String.format("%.3f",z[index])+" cm\n"+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - String temp = getNameScreenName() + " (id: " + id[index] + " index: " + index + ")" + - "\n " + AMath.RHO + " = " + String.format("%.3f",rho[index]) + " cm" + - "\n " + AMath.PHI + " = " + - String.format("%.3f",Math.toDegrees(phi[index])) + - AMath.DEGREES + " (" + String.format("%.3f",phi[index]) + " rad)" + - "\n z = " + String.format("%.3f",z[index]) + " cm"; - - temp += "\n " + AMath.ETA + " module = "; - temp += (etaModule != null) ? Integer.toString(etaModule[index]) : "n/a"; - temp += "\n " + AMath.PHI + " module = "; - temp += (phiModule != null) ? Integer.toString(phiModule[index]) : "n/a"; - - return temp; - - } // getHitInfo() ------------------------------------------------------- - - - - APixelRDOData(AHashMap p, AEvent e) - { - super(p,e); - id = p.getIntArray("id"); - etaModule = (p.get("etaModule") != null) ? p.getIntArray("etaModule") : null; - phiModule = (p.get("phiModule") != null) ? p.getIntArray("phiModule") : null; - - } // APixelRDOData() ---------------------------------------------------- - - - - protected int internalColor() - { - int numColorTypes = super.internalColor(); - // int colorFunction=APar.get(PARAMETER_GROUP, "ColorFunction").getI(); - // color by error will go here - // if(colorFunction==numColorTypes+1) - // colorByError() - to implement - - return numColorTypes + 1; - - } // internalColor() ---------------------------------------------------- - - - - protected void applyCuts() - { - cutIndex(); - cutPhi(phi); - cutEta(rho, z); - if(etaModule != null) - { - cut("CutsInDet", "EtaModule", " EtaModule", etaModule); - } - if(phiModule != null) - { - cut("CutsInDet", "PhiModule", " PhiModule", phiModule); - } - - cutSubdetector(); - } // applyCuts() -------------------------------------------------------- - - private void cutSubdetector() - { - AParameter subPar = parameterStore.get("CutsInDet", "SCT"); - if(subPar.getI() != -1) - cutArray(sub, subPar.getI(), "Barrel/Endcap"); - } - - protected ACoord getFRUser() - { - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - h[i] = rho[list]; - v[i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[list], phi[list], z[list])); - index[i] = list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FR"); - - } // getFRUser() -------------------------------------------------------- - - - - protected ACoord getFZUser() - { - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - h[i] = z[list]; - v[i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[list], phi[list], z[list])); - index[i] = list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FZ"); - - } // getFZUser() -------------------------------------------------------- - -} // class APixelRDOData ==================================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/APulseShapePlot.java b/graphics/AtlantisJava/src/atlantis/data/APulseShapePlot.java deleted file mode 100644 index 8f1279d0fd0a36f53ed3e75952c2d0cc1ad9bc10..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/APulseShapePlot.java +++ /dev/null @@ -1,513 +0,0 @@ -package atlantis.data; - -import java.util.Vector; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.event.WindowEvent; -import java.awt.event.WindowAdapter; - -import javax.swing.JFrame; -import javax.swing.JPanel; - -// JAS libraries used by Plot class below -import hep.aida.IAnalysisFactory; -import hep.aida.ITree; -import hep.aida.IPlotter; -import hep.aida.IDataPoint; -import hep.aida.IDataPointSet; -import hep.aida.IDataPointSetFactory; -import hep.aida.IPlotterStyle; -import hep.aida.ref.plotter.PlotterUtilities; - -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; - - -/** - * Plotting pulse shapes and ADC counts for calorimeters - * - * @author Zdenek Maxa - - */ -public class APulseShapePlot -{ - protected static Component guiComponent = AGlobals.instance().getGuiFrame(); - private static Vector<JFrame> frameVector = new Vector<JFrame>(); - - private APulseShapePlot() {} - - - /** - * Plot real pulse shapes plots - ADC counts and calculated values of the - * real pulse shape plot over it. Works for multiple channels (TILE) as - * well as for a single channel e.g. LAr - * - * @param adcCounts int[][] - * @param realPulse double[][] - * @param step double - * @param subTitle String[] - * @param title String - */ - public static void plotRealPulseShapes(int[][] adcCounts, double[][] realPulse, - double step, String[] subTitle, String title) - { - JFrame frame = new JFrame(title); - frame.setTitle(title); - frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - AIcon.setIconImage(frame); - frame.setLocation(guiComponent.getLocation()); - Plot p = new Plot(); - frame.setContentPane(p); - p.plotRealPulseShapes(adcCounts, realPulse, step, subTitle); - frame.pack(); - int windowWidth = 330 + ((adcCounts.length - 1) * 110); - int windowHeight = 300; - frame.setSize(windowWidth, windowHeight); - frame.setVisible(true); - - frame.addWindowListener(new AllWindowsDisposer()); - frameVector.add(frame); - - } // plotRealPulseShapes() ---------------------------------------------- - - public static void plotRawCellPulseShapes(int[][] adcCounts, double[][] rawPulse, - double[][] cellPulse, double step, - String[] subTitle, String title) - { - JFrame frame = new JFrame(title); - frame.setTitle(title); - frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - AIcon.setIconImage(frame); - frame.setLocation(guiComponent.getLocation()); - Plot p = new Plot(); - frame.setContentPane(p); - p.plotRawCellPulseShapes(adcCounts, rawPulse, cellPulse, step, subTitle); - frame.pack(); - int windowWidth = 440 + ((adcCounts.length - 1) * 140); - int windowHeight = 400; - frame.setSize(windowWidth, windowHeight); - frame.setVisible(true); - - frame.addWindowListener(new AllWindowsDisposer()); - frameVector.add(frame); - - } // plotRealPulseShapes() ---------------------------------------------- - - /** - * Plots only ADC counts, used as follows: - * APulseShapePlot.plotADCCounts(adcCounts[index], title) - * still used for instance when real pulse shapes plot data is not - * available, e.g. LAr presampler (layer 0) - - * @param data int[][] - * @param title String title of window - * @param axis String[] title for the horizontal axis on each plot (if null uses "bunch crossing") - */ - public static void plotADCCounts(int[][] data, String title, String[] axis) - { - String[] labels = new String[data.length]; - String[] colors = new String[data.length]; - for(int i=0; i<data.length; i++) - { - labels[i]="ADC counts"; - colors[i]="blue"; - } - String[] newAxis; - if(axis!=null) - { - newAxis=axis; - } - else - { - newAxis= new String[data.length]; - for(int i=0; i<data.length; i++) - { - newAxis[i] = "bunch crossing"; - } - } - plotADCCounts(data, title, newAxis, labels, colors); - } - - - - /** - * Plots only ADC counts, used as follows: - * APulseShapePlot.plotADCCounts(adcCounts[index], title) - * still used for instance when real pulse shapes plot data is not - * available, e.g. LAr presampler (layer 0) - - * @param data int[][] - * @param title String title of window - * @param axis String[] titles for the horizontal axis on each plot - * @param labels String[] titles for each plot - * @param colors String[] color of datapoints for each plot - */ - public static void plotADCCounts(int[][] data, String title, String[] axis, String[] labels, String[] colors) - { - JFrame frame = new JFrame(title); - AIcon.setIconImage(frame); - frame.setLocation(guiComponent.getLocation()); - Plot p = new Plot(); - frame.setContentPane(p); - p.plotADCCounts(data, axis, labels, colors); - frame.pack(); - int windowWidth = 330+ ((data.length - 1) * 110); - int windowHeight = 300; - frame.setSize(windowWidth, windowHeight); - frame.setVisible(true); - - frame.addWindowListener(new AllWindowsDisposer()); - frameVector.add(frame); - - } // plotADCCounts() -------------------------------------------------- - - - - static class AllWindowsDisposer extends WindowAdapter - { - public void windowClosing(WindowEvent e) - { - for(int i = 0; i < frameVector.size(); i++) - { - JFrame cf = frameVector.get(i); - cf.dispose(); - } - frameVector.removeAllElements(); - } - - } // class AllWindowsDisposer =========================================== - - -} // class ACaloPulseShapePlot ============================================== - - - -/** - * - * <p>Title: Plot</p> - * - * <p>Description: Plotting class using JAS library </p> - * - */ -class Plot extends JPanel -{ - - public Plot() - { - super(new BorderLayout()); - - } // Plot() ------------------------------------------------------------- - - - - protected void plotRealPulseShapes(int[][] adcCounts, double[][] realPulse, - double step, String[] subTitle) - { - - IAnalysisFactory af = IAnalysisFactory.create(); - ITree tree = af.createTreeFactory().create(); - IDataPointSetFactory dpsf = af.createDataPointSetFactory(tree); - - // Create a two dimensional IDataPointSet - IDataPointSet[] dataPointSet = new IDataPointSet[adcCounts.length]; - for(int i = 0; i < adcCounts.length; i++) - { - String myTitle = (subTitle != null) ? subTitle[i] : "Real pulse shape"; - - double[] x = new double[adcCounts[i].length]; - double[] y = new double[adcCounts[i].length]; - double[] e = new double[adcCounts[i].length]; - - for(int ii = 0; ii < adcCounts[i].length; ii++) - { - x[ii] = ii + 1.0; // counting from 1 (to 9 for TILE) - y[ii] = (double) adcCounts[i][ii]; - e[ii] = 0.0; // arrays with errors - } - - // first parameter must be path - what for here? - dataPointSet[i] = dpsf.createXY(myTitle, x, y, e, e); - dataPointSet[i].setTitle(myTitle); - } // over number of channels - - // Create a two dimensional IDataPointSet - IDataPointSet[] dataPointSetReal = new IDataPointSet[realPulse.length]; - for(int i = 0; i < realPulse.length; i++) - { - String myTitle = (subTitle != null) ? subTitle[i] : "Real pulse shape"; - - double[] x = new double[realPulse[i].length]; - double[] y = new double[realPulse[i].length]; - double[] e = new double[realPulse[i].length]; - - double d = 1.0; - for(int ii = 0; ii < realPulse[i].length; ii++) - { - x[ii] = d; - y[ii] = realPulse[i][ii]; - e[ii] = 0.0; // arrays with errors - d += step; - } - - // first parameter must be path - what for here? - dataPointSetReal[i] = dpsf.createXY(myTitle, x, y, e, e); - dataPointSetReal[i].setTitle(myTitle); - - } // over number of channels - - - IPlotter plotter = af.createPlotterFactory().create(""); - - plotter.createRegions(adcCounts.length, 1); // regions 1x1, 1x2, ... - - // set common style parameters for both regions - IPlotterStyle style = af.createPlotterFactory().createPlotterStyle(); - style.xAxisStyle().setLabel("bunch crossing"); - style.yAxisStyle().setLabel("ADC counts"); - style.titleStyle().textStyle().setColor("black"); - style.titleStyle().textStyle().setBold(true); - style.xAxisStyle().labelStyle().setColor("black"); - style.yAxisStyle().labelStyle().setColor("black"); - - // set no legend at plots - style.statisticsBoxStyle().setVisible(false); // statistical legend - style.legendBoxStyle().setVisible(false); // legend for function fit - - for(int i = 0; i < adcCounts.length; i++) - { - // set style parameters different for regions - style.dataStyle().markerStyle().setParameter("size", "2"); - style.dataStyle().markerStyle().setShape("box"); // "square" - plotter.region(i).style().dataStyle().markerStyle().setColor("red"); - plotter.region(i).plot(dataPointSetReal[i], style); - - style.dataStyle().markerStyle().setParameter("size", "7"); - style.dataStyle().markerStyle().setShape("dot"); // "circle" - plotter.region(i).style().dataStyle().markerStyle().setColor("blue"); - plotter.region(i).plot(dataPointSet[i], style); - } - - // now embed the plotter - add(PlotterUtilities.componentForPlotter(plotter), BorderLayout.CENTER); - - } // plotRealPulseShapes() ---------------------------------------------- - - - - - /** - * Method creates multiple plots of ADC counts only. - * multiple channels, no fit, no pulse shapes. - * or plots of ADC Counts pulse shapes. - * - * @param data int[][] - * @param labels String[] titles for each plot - */ - public void plotADCCounts(int[][] data, String[] axis, String[] labels, String[] colors) - { - IAnalysisFactory af = IAnalysisFactory.create(); - ITree tree = af.createTreeFactory().create(); - IDataPointSetFactory dpsf = af.createDataPointSetFactory(tree); - - // Create a IDataPointSet (one dimension) - IDataPointSet[] dataPointSet = new IDataPointSet[data.length]; - for(int j = 0; j < data.length; j++) - { - - dataPointSet[j] = dpsf.create("plot", labels[j], 2); - - for(int i = 0; i < data[j].length; i++) - { - dataPointSet[j].addPoint(); - IDataPoint dp = dataPointSet[j].point(i); - - dp.coordinate(0).setValue(i); - dp.coordinate(1).setValue(data[j][i]); - } - } - - - IPlotter plotter = af.createPlotterFactory().create(""); - - plotter.createRegions(data.length, 1); // regions 1x1, 1x2, ... - - IPlotterStyle style = af.createPlotterFactory().createPlotterStyle(); - style.yAxisStyle().setLabel("ADC counts"); - style.dataStyle().markerStyle().setParameter("size", "7"); - style.dataStyle().markerStyle().setShape("dot"); - style.titleStyle().textStyle().setColor("black"); - style.titleStyle().textStyle().setBold(true); - style.xAxisStyle().labelStyle().setColor("black"); - style.yAxisStyle().labelStyle().setColor("black"); - - // set no legend at plots - style.statisticsBoxStyle().setVisible(false); // statistical legend - style.legendBoxStyle().setVisible(false); // legend for function fit - - for(int j = 0; j < data.length; j++) - { - plotter.region(j).style().xAxisStyle().setLabel(axis[j]); - plotter.region(j).style().dataStyle().markerStyle().setColor(colors[j]); - plotter.region(j).style().dataStyle().outlineStyle().setColor(colors[j]); - - // plot the data - points ('style' parameter is optional for plotter) - plotter.region(j).plot(dataPointSet[j], style); - } - // now embed the plotter - add(PlotterUtilities.componentForPlotter(plotter), BorderLayout.CENTER); - - } // plotADCCounts() ------------ --------------------------------------- - - - protected void plotRawCellPulseShapes(int[][] adcCounts, double[][] rawPulse, - double[][] cellPulse, - double step, String[] subTitle) - { - - IAnalysisFactory af = IAnalysisFactory.create(); - ITree tree = af.createTreeFactory().create(); - IDataPointSetFactory dpsf = af.createDataPointSetFactory(tree); - - // Create a two dimensional IDataPointSet - IDataPointSet[] dataPointSet = new IDataPointSet[adcCounts.length]; - for(int i = 0; i < adcCounts.length; i++) - { - String myTitle = "ADC counts"; - - double[] x = new double[adcCounts[i].length]; - double[] y = new double[adcCounts[i].length]; - double[] e = new double[adcCounts[i].length]; - - for(int ii = 0; ii < adcCounts[i].length; ii++) - { - x[ii] = ii + 1.0; // counting from 1 (to 9 for TILE) - y[ii] = (double) adcCounts[i][ii]; - e[ii] = 0.0; // arrays with errors - } - - // first parameter must be path - what for here? - dataPointSet[i] = dpsf.createXY(myTitle, x, y, e, e); - dataPointSet[i].setTitle(myTitle); - } // over number of channels - - // Create a two dimensional IDataPointSet - IDataPointSet[] dataPointSetCell = new IDataPointSet[cellPulse.length]; - for(int i = 0; i < cellPulse.length; i++) - { - String myTitle = "Cell time"; - - double[] x = new double[cellPulse[i].length]; - double[] y = new double[cellPulse[i].length]; - double[] e = new double[cellPulse[i].length]; - - double d = 1.0; - for(int ii = 0; ii < cellPulse[i].length; ii++) - { - x[ii] = d; - y[ii] = cellPulse[i][ii]; - e[ii] = 0.0; // arrays with errors - d += step; - } - - // first parameter must be path - what for here? - dataPointSetCell[i] = dpsf.createXY(myTitle, x, y, e, e); - dataPointSetCell[i].setTitle(myTitle); - - } // over number of channels - - - // Create a two dimensional IDataPointSet - IDataPointSet[] dataPointSetRaw = new IDataPointSet[rawPulse.length]; - for(int i = 0; i < rawPulse.length; i++) - { - String myTitle = "Raw time"; - - double[] x = new double[rawPulse[i].length]; - double[] y = new double[rawPulse[i].length]; - double[] e = new double[rawPulse[i].length]; - - double d = 1.0; - for(int ii = 0; ii < rawPulse[i].length; ii++) - { - x[ii] = d; - y[ii] = rawPulse[i][ii]; - e[ii] = 0.0; // arrays with errors - d += step; - } - - // first parameter must be path - what for here? - dataPointSetRaw[i] = dpsf.createXY(myTitle, x, y, e, e); - dataPointSetRaw[i].setTitle(myTitle); - - } // over number of channels - - - IPlotter plotter = af.createPlotterFactory().create(""); - - plotter.createRegions(adcCounts.length, 1); // regions 1x1, 1x2, ... - - // set common style parameters for both regions - IPlotterStyle style = af.createPlotterFactory().createPlotterStyle(); - style.xAxisStyle().setLabel("bunch crossing"); - style.yAxisStyle().setLabel("ADC counts"); - style.titleStyle().textStyle().setColor("black"); - style.titleStyle().textStyle().setBold(true); - style.xAxisStyle().labelStyle().setColor("black"); - style.yAxisStyle().labelStyle().setColor("black"); - - style.statisticsBoxStyle().setVisible(false); // statistical legend - style.legendBoxStyle().setVisible(true); // legend for function fit - - for(int i = 0; i < adcCounts.length; i++) - { - // set style parameters different for regions - style.dataStyle().markerStyle().setParameter("size", "4"); - style.dataStyle().markerStyle().setShape("box"); // "square" - style.dataStyle().showInLegendBox(true); - plotter.region(i).style().dataStyle().markerStyle().setColor("red"); - plotter.region(i).plot(dataPointSetRaw[i], style); - - style.dataStyle().markerStyle().setParameter("size", "2"); - style.dataStyle().markerStyle().setShape("box"); // "square" - style.dataStyle().showInLegendBox(true); - plotter.region(i).style().dataStyle().markerStyle().setColor("green"); - plotter.region(i).plot(dataPointSetCell[i], style); - - style.dataStyle().markerStyle().setParameter("size", "7"); - style.dataStyle().markerStyle().setShape("dot"); // "circle" - style.dataStyle().showInLegendBox(false); - plotter.region(i).style().dataStyle().markerStyle().setColor("blue"); - plotter.region(i).plot(dataPointSet[i], style); - - //plotter.region(i).style().legendBoxStyle().boxStyle().borderStyle().setVisible(false); - - plotter.region(i).setTitle((subTitle != null) ? subTitle[i] : "Real pulse shape"); - } - - // now embed the plotter - add(PlotterUtilities.componentForPlotter(plotter), BorderLayout.CENTER); - - } // plotRealPulseShapes() ---------------------------------------------- - - - -} // class Plot ============================================================= - - - -/* following lines for hints only (futher JAS plotting styles settings) - - IPlotterStyle style = plotterFactory.createPlotterStyle(); - style.xAxisStyle().tickLabelStyle().setFontSize(14); - style.xAxisStyle().tickLabelStyle().setBold(true); - style.xAxisStyle().tickLabelStyle().setColor("blue"); - style.xAxisStyle().labelStyle().setFontSize(24); - style.xAxisStyle().labelStyle().setItalic(true); - style.titleStyle().textStyle().setFontSize(30); - style.dataStyle().markerStyle().setParameter("size","12"); - style.dataStyle().markerStyle().setParameter("shape","3"); - style.dataStyle().markerStyle().setParameter("color","blue"); - plotter.region(0).plot(h1); - plotter.region(0).plot(h2, style); - plotter.show(); -*/ diff --git a/graphics/AtlantisJava/src/atlantis/data/AROIData.java b/graphics/AtlantisJava/src/atlantis/data/AROIData.java deleted file mode 100644 index 0b3a539e2505db1d8058c99251cd31d2399f3cda..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AROIData.java +++ /dev/null @@ -1,334 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -/** - * Base class for EmTauROI, JetROI and MuonROI - * - * @author Gary Taylor, Zdenek Maxa, Qiang Lu - */ - -abstract public class AROIData extends AData -{ - protected float[] eta; - protected float[] phi; - protected float[] energy; - // energy variables for EmTauROIs - protected float[] energyEM; - protected float[] energyTAU; - - private int drawOrFill = AGraphics.FILL; - - AROIData(AHashMap p, AEvent e) - { - super(p,e); - eta = p.getFloatArray("eta"); - phi = p.getFloatArray("phi"); - energy = p.getFloatArray("energy"); - if(this instanceof AEmTauROIData) - { - energyEM = p.getFloatArray("energyEM"); - energyTAU = p.getFloatArray("energyTAU"); - } - } - - public float getEnergy(int index) - { - return energy[index]; - } - public float getEnergyEM(int index) - { - return energyEM[index]; - } - public float getEnergyTAU(int index) - { - return energyTAU[index]; - } - - public float getEta(int index) - { - return eta[index]; - } - - public float getPhi(int index) - { - return phi[index]; - } - - public float[] getEnergy() - { - return energy; - } - - public float[] getEnergyEM() - { - return energyEM; - } - - public float[] getEnergyTAU() - { - return energyTAU; - } - - public float[] getEta() - { - return eta; - } - - public float[] getPhi() - { - return phi; - } - - protected int getDrawOrFill() - { - return drawOrFill; - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+ - "\n Energy="+String.format("%.3f",energy[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - double deta = parameterStore.get(PARAMETER_GROUP, "deta").getD(); - double dphi = parameterStore.get(PARAMETER_GROUP, "dphi").getD(); - - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n energy = "); - msg.append(String.format("%.3f",energy[index])); - msg.append(" GeV\n "); - if(this instanceof AEmTauROIData) - { - if(energyEM != null) - { - msg.append("energyEM = "); - msg.append(String.format("%.3f",energyEM[index])); - msg.append(" GeV\n "); - } - if(energyTAU != null) - { - msg.append("energyTAU = "); - msg.append(String.format("%.3f",energyTAU[index])); - msg.append(" GeV\n "); - } - } - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",Math.toDegrees(phi[index]))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - msg.append("\n deta = "); - msg.append(String.format("%.3f",deta)); - msg.append("\n dphi = "); - msg.append(String.format("%.3f",Math.toDegrees(dphi))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",dphi) + " rad)"); - - return msg.toString(); - } - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if (colorFunction == 0) - { - colorByConstant(); - } - else if (colorFunction == 1) - { - colorByIndex(); - } - - return 1; - } - - protected void applyCuts() - { - cutIndex(); - cutPhi(phi); - cutEta(eta); - } - - protected ACoord getVPUser() - { - drawOrFill = AGraphics.DRAW; - - double deta = parameterStore.get(PARAMETER_GROUP, "deta").getD() / 2; - double dphiDeg = Math.toDegrees(parameterStore.get(PARAMETER_GROUP, "dphi").getD()) / 2; - double phiDeg = 0; - - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - phiDeg = Math.toDegrees(phi[list]); - - // without the cross in the middle - // hv[0][i] = AMath.xBox(eta[list], deta); // x-dx,x-dx,x+dx,x+dx - // hv[1][i] = AMath.yBox(phiDeg, dphiDeg); // y-dy,y+dy,y+dy,y-dy - - hv[0][i] = new double[] { eta[list] - deta, eta[list] - deta, - eta[list] + deta, eta[list] - deta, eta[list] + deta, - eta[list] - deta, eta[list] + deta, eta[list] + deta }; - hv[1][i] = new double[] { phiDeg - dphiDeg, phiDeg + dphiDeg, - phiDeg - dphiDeg, phiDeg - dphiDeg, phiDeg + dphiDeg, - phiDeg + dphiDeg, phiDeg - dphiDeg, phiDeg + dphiDeg }; - index[i] = list; - } - - return new ACoord(hv, index, this).includePhiWrapAround("VP"); - } - - protected ACoord getYXUser() - { - drawOrFill = AGraphics.FILL; - double dphi = parameterStore.get(PARAMETER_GROUP, "dphi").getD() / 2; - - makeDrawList(); - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiPlus = phi[list] + dphi; - double phiMinus = phi[list] - dphi; - double cosPlus = Math.cos(phiPlus); - double sinPlus = Math.sin(phiPlus); - double cosMinus = Math.cos(phiMinus); - double sinMinus = Math.sin(phiMinus); - - double rhoPlus = 1150; - double rhoMinus = 1130; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = rhoMinus * cosPlus; - hv[1][i][0] = rhoMinus * sinPlus; - // x1, y1 - hv[0][i][1] = rhoPlus * cosPlus; - hv[1][i][1] = rhoPlus * sinPlus; - // x2, y2 - hv[0][i][2] = rhoPlus * cosMinus; - hv[1][i][2] = rhoPlus * sinMinus; - // x3, y3 - hv[0][i][3] = rhoMinus * cosMinus; - hv[1][i][3] = rhoMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - - protected ACoord getFRUser() - { - ACoord coordFR = getYXUser().convertYXToFR().includePhiWrapAround("FR"); - return coordFR; - } - - protected ACoord getRZUser() - { - drawOrFill = AGraphics.FILL; - double deta = parameterStore.get(PARAMETER_GROUP, "deta").getD() / 2; - - makeDrawList(); - double[][][] hv = new double[2][numDraw][4]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi[list] - phiMid); - double rSign; - if (phiDiff > Math.PI / 2. && phiDiff <= 3 * Math.PI / 2.) - rSign = -1; - else - rSign = 1; - - // calculate theta based on the eta value - double theta = Math.atan(Math.exp(-Math.abs(eta[list]))) * 2.0; - double thetaPlus = Math.atan(Math.exp(-(Math.abs(eta[list]) - deta))) * 2.0; - double thetaMinus = Math.atan(Math.exp(-(Math.abs(eta[list]) + deta))) * 2.0; - - if ((eta[list] > 0.) && (rSign == -1)) - { - theta = 2 * Math.PI - theta; - thetaPlus = 2 * Math.PI - thetaPlus; - thetaMinus = 2 * Math.PI - thetaMinus; - } - else if ((eta[list] < 0.) && (rSign == -1)) - { - theta += Math.PI; - thetaPlus += Math.PI; - thetaMinus += Math.PI; - } - else if ((eta[list] < 0.) && (rSign == 1)) - { - theta = Math.PI - theta; - thetaPlus = Math.PI - thetaPlus; - thetaMinus = Math.PI - thetaMinus; - } - - double cosPlus = Math.cos(thetaPlus); - double sinPlus = Math.sin(thetaPlus); - double cosMinus = Math.cos(thetaMinus); - double sinMinus = Math.sin(thetaMinus); - - // decide the region based on the theta value - final byte TOP_BOTTOM = 0; - final byte LEFT_RIGHT = 1; - byte region = TOP_BOTTOM; - // hard-coded value is based on the values in Geometry - if (Math.abs(Math.tan(theta)) < 0.8) - region = LEFT_RIGHT; - - double radiusMinus = 0.; - switch (region) - { - case TOP_BOTTOM: - radiusMinus = 1330 / Math.abs(Math.sin(theta)); - break; - case LEFT_RIGHT: - radiusMinus = 1630 / Math.abs(Math.cos(theta)); - break; - } - double radiusPlus = radiusMinus + 20; - - // 4 corners of the cell area - // x0, y0 - hv[0][i][0] = radiusMinus * cosPlus; - hv[1][i][0] = radiusMinus * sinPlus; - // x1, y1 - hv[0][i][1] = radiusPlus * cosPlus; - hv[1][i][1] = radiusPlus * sinPlus; - // x2, y2 - hv[0][i][2] = radiusPlus * cosMinus; - hv[1][i][2] = radiusPlus * sinMinus; - // x3, y3 - hv[0][i][3] = radiusMinus * cosMinus; - hv[1][i][3] = radiusMinus * sinMinus; - - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.POLYGONS); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ARPCData.java b/graphics/AtlantisJava/src/atlantis/data/ARPCData.java deleted file mode 100755 index de50662cfd6d5cb7e71a236f975bf912240d1afe..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ARPCData.java +++ /dev/null @@ -1,311 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.graphics.ACoord; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; - -/** - * for comments see AMDTData - */ - -public class ARPCData extends AMuonHitData -{ - protected float[] width; - protected float[] length; - protected int[] gasGap; - - private static ALogger logger = ALogger.getLogger(ARPCData.class); - - public String getParameterGroup() - { - return "RPC"; - } - - public String getName() - { - return "RPC"; - } - - public String getNameScreenName() - { - return "RPC"; - } - - ARPCData(AHashMap p, AEvent e) - { - super(p,e); - length = p.getFloatArray("length"); - width = p.getFloatArray("width"); - gasGap = new int[numData]; - for (int i = 0; i < numData; ++i) - gasGap[i] = getGasGap(i); - } - - protected int getStation(int index) - { - try { - String stationName = AIdHelper.stationName(id[index]); - - if (stationName.charAt(1) == 'M') { - return AIdHelper.rpcDoubletR(id[index]) - 1; - } else { - return AIdHelper.rpcDoubletR(id[index]) + 1; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding RPC identifier", e); - } - - return 0; - } - - protected int getSub(int index) - { - return 0; - } - - public int getSector(int index) - { - try { - String stationName = AIdHelper.stationName(id[index]); - - if (stationName.charAt(2) == 'L') { - return 2 * (AIdHelper.stationPhi(id[index]) - 1); - } else { - return 2 * (AIdHelper.stationPhi(id[index]) - 1) + 1; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding RPC identifier", e); - } - - return 0; - } - - protected int getGasGap(int index) - { - try { - return AIdHelper.rpcGasGap(id[index]); - } catch (AAtlantisException e) { - logger.error("Problem decoding RPC identifier", e); - } - - return 0; - } - - protected boolean getMeasuresPhi(int index) - { - try { - if (AIdHelper.rpcMeasuresPhi(id[index]) == 1) { - return true; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding RPC identifier", e); - } - - return false; - } - - protected void applyCuts() - { - super.applyCuts(); - if (parameterStore.get("CutsATLAS", "CutPhi").getStatus()) - cutPhi(phi, getDPhi()); - if (parameterStore.get("CutsATLAS", "CutEta").getStatus()) - cutEtaDZ(rho, z, getDZ()); - } - - private float[] getDPhi() - { - // only roughly correct - // must create all - float[] dphi = new float[numData]; - - // need only fill for those in draw list - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - if (measuresPhi[list]) - dphi[list] = (float) Math.abs(Math.atan2(width[list] / 2., rho[list])); - else - dphi[list] = (float) Math.abs(Math.atan2(length[list] / 2., rho[list])); - } - return dphi; - } - - private float[] getDZ() - { - // must create all - float[] dz = new float[numData]; - - // need only fill for those in draw list - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - if (measuresPhi[list]) - dz[list] = (float) (length[list] / 2.); - else - dz[list] = (float) (width[list] / 2.); - } - return dz; - } - - protected ACoord getYXUser() - { - makeDrawList(); - cutArray(measuresPhi, true, " Strip"); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double r = rho[list]; - double cosPhi = Math.cos(phi[list]); - double sinPhi = Math.sin(phi[list]); - double phiSector = sector[list] * AMath.PI_BY_8; - double cosPhiSector = Math.cos(phiSector); - double sinPhiSector = Math.sin(phiSector); - double d = width[list] / 2.; - if (!measuresPhi[list]) - d = length[list] / 2.; - double x = r * cosPhi; - double y = r * sinPhi; - double dx = d * sinPhiSector; - double dy = d * cosPhiSector; - - hv[0][0][i] = x + dx; - hv[1][0][i] = y - dy; - hv[0][1][i] = x - dx; - hv[1][1][i] = y + dy; - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - protected ACoord getRZUser() - { - makeDrawList(); - cutArray(measuresPhi, false, " Strip"); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiDiff = Math.abs(phi[list] - phiMid); - int sign = -1; - - if (phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - sign = 1; - double rC = sign * AMDTData.getSectorRho(sector[list], rho[list], phi[list]); - double zC = z[list]; - double w = width[list] / 2.; - - hv[0][0][i] = zC - w; - hv[1][0][i] = rC; - hv[0][1][i] = zC + w; - hv[1][1][i] = rC; - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - protected ACoord getXZUser() - { - makeDrawList(); - cutMuonSector(sector); - cutArray(measuresPhi, false, " Strip"); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - int sect=(int)Math.round(parameterStore.get("XZ", "Phi").getD() / 22.5); - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int sign = 1; - - if (sector[list] != sect) - sign = -1; - double rC = sign * AMDTData.getSectorRho(sector[list], rho[list], phi[list]); - double zC = z[list]; - double w = width[list] / 2.; - - hv[0][0][i] = zC - w; - hv[1][0][i] = rC; - hv[0][1][i] = zC + w; - hv[1][1][i] = rC; - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - protected ACoord getFRUser() - { - makeDrawList(); - cutArray(measuresPhi, true, " Strip"); - return getYXUser().convertYXToFR().includePhiWrapAround("FR"); - } - - private void makeDrawListFZ() - { - int mode = parameterStore.get("FZ", "Mode").getI(); - - if (mode == 0 || mode >= 4) - { - numDraw = 0; - } - else - { - makeDrawList(); - cut(" Station", station, "==", mode - 1); - } - cut("FZ", "RPCGasGap", " RPC Gas Gap", gasGap); - } - - protected ACoord getFZUser() - { - makeDrawListFZ(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - index[i] = list; - if (measuresPhi[list]) - { - hv[0][i] = AMath.xBox(z[list], length[list] / 2.); - hv[1][i] = AMath.yBox(Math.toDegrees(phi[list]), Math.toDegrees((width[list] / 2.) / rho[list])); - } - else - { - double zC = z[list]; - double r = rho[list]; - double cosPhi = Math.cos(phi[list]); - double sinPhi = Math.sin(phi[list]); - double phiSector = sector[list] * AMath.PI_BY_8; - double cosPhiSector = Math.cos(phiSector); - double sinPhiSector = Math.sin(phiSector); - double d = length[list] / 2.; - double w = width[list] / 2.; - double x = r * cosPhi; - double y = r * sinPhi; - double dx = d * sinPhiSector; - double dy = d * cosPhiSector; - double phi1 = Math.toDegrees(Math.atan2(y - dy, x + dx)); - double phi2 = Math.toDegrees(Math.atan2(y + dy, x - dx)); - hv[0][i] = AMath.xBox(zC, w); - hv[1][i] = AMath.yBox((phi1 + phi2) / 2., (phi1 - phi2) / 2.); - - } - } - return new ACoord(hv, index, this).includePhiWrapAround("FZ"); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ARVxData.java b/graphics/AtlantisJava/src/atlantis/data/ARVxData.java deleted file mode 100644 index 6d27099259a8cdc297fe0ba625d27834b159320f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ARVxData.java +++ /dev/null @@ -1,1043 +0,0 @@ -/* - * CAUTION: When working on this class, remember that the number of vertices - * is not a fixed number for an event. If the user fits additional - * vertices in Atlantis, they will be appended to the list. For this - * reason everything is using ArrayList and not simple arrays. - */ - -package atlantis.data; - -import java.awt.event.ActionEvent; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import java.util.Vector; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.tree.DefaultMutableTreeNode; - -import atlantis.canvas.ACanvas; -import atlantis.event.AEvent; -import atlantis.event.AData; -import atlantis.event.AAssociation; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.list.AList; -import atlantis.list.AListManager; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection3D; -import atlantis.projection.AProjectionVP; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.ALogger; - -import static atlantis.data.AVertex.Type.*; - -/** - * Stores Reconstructed vertices formed for fitting groups - * of tracks. There may not be any reconstructed vertices when a new event - * is read in. However, empty datatype ARVxData is always created within - * the AEvent instance. RVx instances may be added at run time by the user - * when the vertex fitter algorithm is run inside Atlantis. - * - * @author Gary Taylor - */ -public class ARVxData extends AData -{ - private static ALogger logger = ALogger.getLogger(ARVxData.class); - - // size of the arrays with coordinates of the RVx ellipse, - // size of martices - private static final int SIZE = 3; - - // vertices - saved reconstructed vertices, instances of AVertex - private ArrayList<AVertex> vertices = new ArrayList<AVertex>(); - // tracksIndex - indices of tracks (starting from 0) - private ArrayList<int[]> tracksIndex = new ArrayList<int[]>(); - // tracksId - IDs of tracks (as read from event file) - private ArrayList<int[]> tracksId = new ArrayList<int[]>(); - private ArrayList<String> tracksCollection = new ArrayList<String>(); - private ArrayList<Boolean> drawFlag = new ArrayList<Boolean>(); - // false - RVx calculated in Atlantis, true - RVx calculated in Athena - private ArrayList<Boolean> athenaOrigin = new ArrayList<Boolean>(); - - // array of flags 1 - is primary vertex candidate, this - // attribute should be accessed only during event finalise phase - private int[] primVxCand = null; - - /** Vertex type from Athena: for types see - * http://alxr.usatlas.bnl.gov/lxr/source/atlas/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/VertexType.h */ - private int[] vertexType = null; - - /** Array containing number of tracks associated with each vertex. */ - private int[] numTracks = null; - - /** Flag whether track numbers are consistent: see Trac bug #551 */ - private boolean hasConsistentTrackNumbers; - - // numData (as at all other datatypes) is used instead of numVertices - // numData variable is referenced from ADrawnGraphics2D (by .getNumData - // method) and since it wasn't set properly in case of RVx it was crashing - // in ADrawnGraphics2D.drawLine() [when rubberbanding over RVx object] - - public String getParameterGroup() - { - return "RVx"; - } - - @Override - public String getName() - { - return "RVx"; - } - - public String getNameScreenName() - { - return "RecVertex"; - } - - /** - * This constructor is called when RVx datatype is found in the event file. - * This RVx data was produced in Athena. - * @param p elements within RVx element in JiveXML input: map of names to values - * @param e parent event - * @throws AAtlantisException if failing to create data - */ - ARVxData(AHashMap p, AEvent e) throws AAtlantisException - { - super(p,e); - - int[] tracks = p.getIntArray("tracks"); - numTracks = p.getUnsureIntArray("numTracks"); - if (numTracks == null) numTracks = new int[numData]; - float[] z = p.getFloatArray("z"); - float[] y = p.getFloatArray("y"); - float[] x = p.getFloatArray("x"); - float[] covMatrix = p.getFloatArray("covMatrix"); - float[] chi2 = p.getFloatArray("chi2"); - String[] storegateKeys = null; - - // Check whether numbers of tracks agree. - hasConsistentTrackNumbers = false; - if (tracks!=null) { - int numTrackIds = tracks.length; - int numTracksFromVertices = 0; - for (int numTracksFromVertex : numTracks) { - numTracksFromVertices += numTracksFromVertex; - } - if (numTracksFromVertices == numTrackIds) { - hasConsistentTrackNumbers = true; - } - } - if (!hasConsistentTrackNumbers) { - logger.error("RVx: numbers of tracks are inconsistent."); - } - - if(p.getStringArray("sgkey") != null) - { - storegateKeys = p.getStringArray("sgkey"); - } - else - { - storegateKeys = new String[numData]; - for (int i = 0; i < numData; i++) - { - storegateKeys[i] = "n/a"; - } - } - - // Allowed to be null if element not in JiveXML. - vertexType = p.getUnsureIntArray("vertexType"); - - primVxCand = p.getUnsureIntArray("primVxCand"); - if (primVxCand == null) primVxCand = new int[numData]; - - if (hasConsistentTrackNumbers) createVertexTrackAssociations(tracks, storegateKeys); - - double[] pos = new double[SIZE]; - double[][] cov = new double[SIZE][SIZE]; - int[] tracksIdArray = null; - int[] tracksIndexArray = null; - - int n = 0; - int m = 0; - for (int i = 0; i < numData; i++) - { - // x, y, z coordinates of the RVx ellipse - pos[0] = x[i]; - pos[1] = y[i]; - pos[2] = z[i]; - - // covMatrix, resp. 3x3 cov array - // numbers are too small, so JiveXML multiplies by 10k, here inverse - // [the same happens with covMatrix for tracks - AHelixData class] - for (int j = 0; j < SIZE; j++) - { - for (int k = 0; k < j + 1; k++) - { - cov[j][k] = covMatrix[n] / 10000; - cov[k][j] = cov[j][k]; - n++; - } - } - - AVertex vertex = new AVertex(chi2[i], pos, cov); - vertices.add(vertex); // new vertex - - // Only save track details if data are consistent. - if (hasConsistentTrackNumbers) { - tracksIdArray = new int[numTracks[i]]; - tracksIndexArray = new int[numTracks[i]]; - for (int j = 0; j < numTracks[i]; j++) - { - tracksIdArray[j] = tracks[m]; - // should be removed - problem that IDs run from 1 and indices - // from 0 - will be fixed - tracksIndexArray[j] = tracks[m] - 1; - m++; - } - tracksIndex.add(tracksIndexArray.clone()); // save indices of tracks - tracksId.add(tracksIdArray.clone()); // save IDs of tracks - } - - // save storeGateKey of the Tracks which form this vertex - tracksCollection.add(storegateKeys[i]); - drawFlag.add(new Boolean(true)); - athenaOrigin.add(new Boolean(true)); - } // for(int i = 0; i < numData; i++) - } // ARVxData() --------------------------------------------------------- - - - /** - * Create vertex-track associations. and adds them to the event's association manager. - * @param tracks array of track ID numbers - * @param storegateKeys array of storegate keys, one per vertex - * Also uses numTracks: number of tracks associated with each vertex. - */ - private void createVertexTrackAssociations(int[] tracks, String[] storegateKeys) { - // Create a list of unique storegate keys. - Vector<String> uniqueStoregateKeys = new Vector<String>(); - if(!storegateKeys[0].equals("n/a")){ - uniqueStoregateKeys.add(storegateKeys[0]); - } - for(int i = 0; i < storegateKeys.length; i++){ - if(storegateKeys[i].equals("n/a")){ - continue; - } - // Check if track particle type already added to list of storegate keys - boolean inVector = false; - for (String sgKey : uniqueStoregateKeys) { - if (sgKey.equals(storegateKeys[i])) { - inVector = true; - break; - } - } - // If storegate key is not in the list, it is added. - if(!inVector){ - uniqueStoregateKeys.add(storegateKeys[i]); - } - } - // Create new association int array for each unique storegate key. - for(int i = 0; i < uniqueStoregateKeys.size(); i++){ - int trackCount = 0; - Vector<Integer> TrkNum = new Vector<Integer>(); - Vector<Integer> Track = new Vector<Integer>(); - // Creating vectors of the 'number of tracks associated to each list' and 'track Ids' - for(int j = 0; j < storegateKeys.length; j++){ - if(uniqueStoregateKeys.get(i).equals(storegateKeys[j])){ - TrkNum.add(numTracks[j]); - for(int k = trackCount; k < trackCount + numTracks[j]; k++){ - Track.add(tracks[k]); - } - } - trackCount += numTracks[j]; - } - //Converting vectors to int[] - int[] assocTracks = new int[Track.size()]; - for(int j = 0; j < Track.size(); j++){ - assocTracks[j] = Track.get(j); - } - int[] numTrks = new int[TrkNum.size()]; - for(int j = 0; j < TrkNum.size(); j++){ - numTrks[j] = TrkNum.get(j); - } - //Creating associations - AAssociation assoc = new AAssociation("RVx" + getStoreGateKey(), - "InDetTrack" + uniqueStoregateKeys.get(i), numTrks, - assocTracks, event); - event.getAssociationManager().add(assoc); - } - } - - /** - * Redefined inherited method AData.getIdFromIndex() - * the array int[] id is not used in this class (unlike other types) so - * AData.getIdFromIndex() was crashing at RVx since this array was empty - * listdl[] array (also inherited from AData) should be properly handled - * in this class (used to crash when rubberbanding over displayed RVx) - * @param index int - * @return int - */ - @Override - public int getIdFromIndex(int index) - { - return listdl[index]; - } // getIdFromIndex() ----------------------------------------------------- - - /** - * - * @param listOfTracksToVertex int[] - list of track indices (internal - * Atlantis indices starting from 0) - * @param key - Track collection storeGateKey - */ - private void createVertexFromTracks(int[] listOfTracksToVertex, String key) - { - - //Retrieving/checking for pre-existing assocation - int[][] assoc = event.getAssociationManager().get("RVx","InDetTrack" + key); - if(assoc == null){ - //Create new association for the between selected tracks and the new vertex - int[] numTracks2 = new int[1]; - numTracks2[0] = listOfTracksToVertex.length; - event.getAssociationManager().add(new AAssociation("RVx","InDetTrack" + key, numTracks2, listOfTracksToVertex, event)); - }else{//if assocation already exists add new one to it - //Remove old assocation - event.getAssociationManager().remove("InDetTrack" + key + "RVx"); - //Create new assocation by copying old one and adding extra line at the end. - int[][] newAssoc = new int[assoc.length + 1][]; - for(int i = 0; i < newAssoc.length; i++){ - if(i == assoc.length){ - newAssoc[i] = listOfTracksToVertex; - }else{ - newAssoc[i] = assoc[i]; - } - } - //recreating assocation - event.getAssociationManager().add(new AAssociation("RVx","InDetTrack" + key, newAssoc, event)); - } - - - - ATrackData aRTr = null; - aRTr = event.getTrackData("InDetTrack", key); - if (aRTr == null) - { - return; - } - // get helices of the appropriate tracks, helices are access by indices - // save the IDs of tracks into trackIdLocal which will be copied to tracksId - int[] trackIdLocal = new int[listOfTracksToVertex.length]; - AHelix[] thisHelGoToFitter = new AHelix[listOfTracksToVertex.length]; - for (int j = 0; j < listOfTracksToVertex.length; j++) - { - AHelix helix = aRTr.getModifiableHelix(listOfTracksToVertex[j]); - if (helix == null) { - AOutput.alwaysAppend("\nOne or more of the selected tracks do not have perigee parameters, " - + "the vertex cannot be created\n", ALogInterface.BAD_COMMAND); - return; - } - thisHelGoToFitter[j] = helix; - trackIdLocal[j] = aRTr.getIdFromIndex(listOfTracksToVertex[j]); - } - - - double xVtx = parameterStore.get("Event", "XVtx").getD(); - double yVtx = parameterStore.get("Event", "YVtx").getD(); - double zVtx = parameterStore.get("Event", "ZVtx").getD(); - AVertex startingPoint = new AVertex(new double[] { xVtx, yVtx, zVtx }); - try - { - // RuntimeException is thrown - no vertex found or goes on (new vertex) - AVertex vertex = AVertexFit.fitVertex(startingPoint, thisHelGoToFitter); - vertices.add(vertex); // new vertex - tracksIndex.add(listOfTracksToVertex.clone()); // save indices of tracks - tracksId.add(trackIdLocal.clone()); // save IDs of tracks - tracksCollection.add(key); - drawFlag.add(new Boolean(true)); - athenaOrigin.add(new Boolean(false)); - - int[] newNumTracks = new int[numData+1]; - int[] newPrimVxCand = new int[numData+1]; - for (int i=0; i<numData; i++) { - newNumTracks[i] = numTracks[i]; - newPrimVxCand[i] = primVxCand[i]; - } - numTracks = newNumTracks; - primVxCand = newPrimVxCand; - numTracks[numData] = listOfTracksToVertex.length; - primVxCand[numData] = 2; - - if (vertexType != null) { - int[] newVertexType = new int[numData+1]; - for (int i=0; i<numData; i++) { - newVertexType[i] = vertexType[i]; - } - vertexType = newVertexType; - vertexType[numData] = 2; - } - - double[] par = vertex.getPosition(); - double Vx = par[0]; - double Vy = par[1]; - // temp set axis and orientation of 3D rotation wrt last vertex - // adjust the starting point of the tracks according to the vertex - double Vz = par[2]; - for (int j = 0; j < thisHelGoToFitter.length; j++) - { - double a = Vx - xVtx; - double b = Vy - yVtx; - double c = Vz - zVtx; - double size = Math.sqrt(a * a + b * b + c * c); - parameterStore.get("3D", "xAxis").setD(a / size); - parameterStore.get("3D", "yAxis").setD(b / size); - parameterStore.get("3D", "zAxis").setD(c / size); - thisHelGoToFitter[j].setPhiStartByXYPoint(Vx, Vy); - } - AOutput.alwaysAppend("\n" + getHitInfo(numData) + "\n", ALogInterface.NORMAL); - numData++; - makeDrawList(); - } - catch (RuntimeException e) - { - StringBuilder temp = new StringBuilder("\nRVx: tracks ("); - for (int i = 0; i < listOfTracksToVertex.length; i++) - { - if (i > 0) - { - temp.append(", "); - } - // the tracks were accessed by indices but user wants to see - // IDs like pick prints (listOfTracksToVertex[] - indices) - temp.append(aRTr.getIdFromIndex(listOfTracksToVertex[i])); - } - AOutput.alwaysAppend(temp + ")\n not originating from a common vertex\n", ALogInterface.NORMAL); - throw e; - } - } // createVertexFromTracks() ------------------------------------------- - - /** - * 'Colour by vertex type' option, that allows to colour the vertices depending on whether they are primary, - * secondary or other vertices. - */ - protected void colorbyVertexType() { - - int pri = parameterStore.get("RVx", "PriVxColor").getI(); - int sec = parameterStore.get("RVx", "SecVxColor").getI(); - int res = parameterStore.get("RVx", "RestVxColor").getI(); - - if (vertexType!=null) { - for (int i=0; i<numData; ++i) { - int typeId = vertexType[i]; - AVertex.Type type = AVertex.Type.typeFromId(typeId); - switch (type) { - case PRIMARY: - case DUMMY: - color[i] = (byte) pri; - break; - case SECONDARY: - color[i] = (byte) sec; - break; - case TEMPV0LAMBDA: - color[i] = (byte) sec; - break; - case TEMPV0LAMBDABAR: - color[i] = (byte) sec; - break; - case TEMPKSHORT: - color[i] = (byte) sec; - break; - case PILEUP: - case CONVERSION: - case V0: - case KINK: - color[i] = (byte) res; - break; - default: - color[i] = (byte) res; - - } - } - } - else if (primVxCand!=null) { // use primary vertex candidate flag as fall-back if vertex type not available - for (int i=0; i<numData; ++i) { - if (primVxCand[i]==1) { - color[i] = (byte) pri; - } - else { - color[i] = (byte) res; - } - } - } - else { // if no vertex type information, use constant colour - colorByConstant(); - } - } - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - // The number of vertices can increase when the user fits a vertex in - // Atlantis, make sure the color array also increases in size then - if (numData > color.length) - color = new byte[numData]; - - if (colorFunction == 0) - { - colorByConstant(); - } - else if(colorFunction == 1) - { - colorByIndex(); - } - else if (colorFunction == 2) - { - colorbyVertexType(); - } - return 0; - } // internalColor() ---------------------------------------------------- - - @Override - public void makeDrawList() - { - numDraw = 0; - listdl = new int[numData]; - for (int i = 0; i < numData; i++) { - if (drawFlag.get(i).booleanValue()) { - listdl[numDraw] = i; - numDraw++; - } - } - this.cutTracksByVertexType(); - this.applyCuts(); - } - - private void cutTracksByVertexType() { - numDraw = 0; - listdl = new int[numData]; - for (int i = 0; i < numData; i++) { - if (drawFlag.get(i).booleanValue()) { - // All=0, Primary=1, Secondary=2, Rest=3 - int vertexTypeSelected = parameterStore.get("CutsObjects", "vertextype").getI(); - if (vertexTypeSelected==0) { - listdl[numDraw] = i; - numDraw++; - } - if (vertexTypeSelected==1) { // primary - if (vertexType!=null) { - int typeId = vertexType[i]; - AVertex.Type type = AVertex.Type.typeFromId(typeId); - if (type == PRIMARY || type == DUMMY){ - listdl[numDraw] = i; - numDraw++; - } - } - } - if (vertexTypeSelected==2){ - if (vertexType!=null) { - int typeId = vertexType[i]; - AVertex.Type type = AVertex.Type.typeFromId(typeId); - if (type == SECONDARY || type == TEMPV0LAMBDA || type == TEMPV0LAMBDABAR || type == TEMPKSHORT){ - listdl[numDraw] = i; - numDraw++; - } - } - } - if (vertexTypeSelected==3){ - if (vertexType!=null) { - int typeId = vertexType[i]; - AVertex.Type type = AVertex.Type.typeFromId(typeId); - if (type == PILEUP || type == CONVERSION || type == V0 || type == KINK){ - listdl[numDraw] = i; - numDraw++; - } - } - } - } - } - } - - public String getHitInfo(int index) - { - boolean athenaOriginBoolean = athenaOrigin.get(index).booleanValue(); - String origin = (athenaOriginBoolean == true) ? "Athena" : "Atlantis"; - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+ - "\n calculated in "+origin; - - StringBuilder temp = new StringBuilder(); - temp.append("\n" + getNameScreenName() + " (index: " + index + ") (calculated in " + origin + ")\n" + " type of Track: " + tracksCollection.get(index) + "\n"); - temp.append(" tracks IDs = "); - boolean tracksIDsKnown = false; - if (tracksId.size() > 0) { - int[] tracksIdInVertex = (tracksId.get(index)); - for (int i = 0; i < tracksIdInVertex.length; i++) - { - int id2 = tracksIdInVertex[i]; - // if the JiveXML knows that vertex creates X number of - // tracks but doesn't know the ID, -1 is put as tracks ID - // list of -1 doesn't need to be printed - if (id2 > -1) - { - tracksIDsKnown = true; - if (i > 0) - { - temp.append(","); - } - temp.append(tracksIdInVertex[i]); - } - } - } - if (!tracksIDsKnown) temp.append("n/a"); - //To display in the output screen the vertex type number and description when this is selected - if (vertexType!=null) { - int typeId = vertexType[index]; - AVertex.Type type = AVertex.Type.typeFromId(typeId); - String vertexInfo = String.format("%nVertex type = %d (%s)", typeId, type.description); - temp.append(vertexInfo); - } - temp.append("\nPrimary candidate status = " + primVxCand[index]); - temp.append("\nnumTracks = " + numTracks[index]); - temp.append("\n" + vertices.get(index)); - return temp.toString(); - } // getHitInfo() ------------------------------------------------------- - - @Override - public ACoord getYXUser() - { - makeDrawList(); - double hv[][][] = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - AVertex vertex = vertices.get(listdl[i]); - double[][] p = vertex.getYXEllipse(); - hv[0][i] = p[0]; - hv[1][i] = p[1]; - - index[i] = listdl[i]; - } - return new ACoord(hv, index, this); - } // getYXUser() -------------------------------------------------------- - - @Override - public ACoord getXZUser() - { - makeDrawList(); - double hv[][][] = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - AVertex vertex = vertices.get(listdl[i]); - double[][] p = vertex.getXZEllipse(); - hv[0][i] = p[0]; - hv[1][i] = p[1]; - index[i] = listdl[i]; - } - return new ACoord(hv, index, this); - } // getXZUser() -------------------------------------------------------- - - @Override - public ACoord getYZUser() - { - makeDrawList(); - double hv[][][] = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - AVertex vertex = vertices.get(listdl[i]); - double[][] p = vertex.getYZEllipse(); - hv[0][i] = p[0]; - hv[1][i] = p[1]; - index[i] = listdl[i]; - } - return new ACoord(hv, index, this); - } // getYZUser() -------------------------------------------------------- - - @Override - public ACoord getRZUser() - { - makeDrawList(); - double hv[][][] = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - AVertex vertex = vertices.get(listdl[i]); - //TODO: make "RZ ellipse" - double[][] p = vertex.getRZEllipse(); - hv[0][i] = p[0]; - hv[1][i] = p[1]; - index[i] = listdl[i]; - } - return new ACoord(hv, index, this); - } // getRZUser() -------------------------------------------------------- - - @Override - protected ACoord get3DUser() - { - makeDrawList(); - double h[] = new double[numDraw]; - double v[] = new double[numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - double[] hvo = AProjection3D.getRotated(vertices.get(listdl[i]).getPosition()); - h[i] = hvo[0]; - v[i] = hvo[1]; - index[i] = listdl[i]; - } - return new ACoord(h, v, index, this); - } // get3DUser() -------------------------------------------------------- - - @Override - public ACoord getFZUser() - { - makeDrawList(); - double h[] = new double[numDraw]; - double v[] = new double[numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - AVertex vertex = vertices.get(listdl[i]); - double[] xyz = vertex.getPosition(); - double phi = vertex.getPhi(); - double z = xyz[2]; - h[i] = z; - v[i] = Math.toDegrees(phi); - index[i] = listdl[i]; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FZ"); - } // getFZUser() -------------------------------------------------------- - - @Override - public ACoord getFRUser() - { - makeDrawList(); - double h[] = new double[numDraw]; - double v[] = new double[numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - AVertex vertex = vertices.get(listdl[i]); - double rho = vertex.getRho(); - double phi = vertex.getPhi(); - h[i] = rho; - v[i] = Math.toDegrees(phi); - index[i] = listdl[i]; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FR"); - } // getFRUser() -------------------------------------------------------- - - @Override - public ACoord getVPUser() - { - makeDrawList(); - double h[] = new double[numDraw * 2]; - double v[] = new double[numDraw * 2]; - int[] index = new int[numDraw * 2]; - double[] sign = new double[] { -1., 1. }; - int num = 0; - - for (int i = 0; i < numDraw; i++) - { - AVertex vertex = vertices.get(listdl[i]); - double[] xyz = vertex.getPosition(); - // if rho is 0, AMath.eta() divides by 0, since it's real type, - // Infinity is returned, program doesn't crash, vertex is not drawn - // proper would be to test all rho > 0.01cm values in advance - double rho = vertex.getRho(); - double phi = vertex.getPhi(); - double z = xyz[2]; - double eta = AParameterUtilities.eta(z, rho); - double delEta = AProjectionVP.getDeltaEta(rho, z); - for (int j = 0; j < 2; j++) - { - h[num] = eta + sign[j] * delEta; - v[num] = Math.toDegrees(phi); - index[num] = listdl[i]; - num++; - } - } - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - } // getVPUser() -------------------------------------------------------- - - protected void applyCuts() - { - cutIndex(); - - float[] phi = new float[numDraw]; - float[] eta = new float[numDraw]; - for(int i=0; i<numDraw; i++) - { - AVertex vertex = vertices.get(listdl[i]); - phi[i] = (float) vertex.getPhi(); - double z = vertex.getPosition()[2]; - eta[i] = (float) AParameterUtilities.eta(z, vertex.getRho()); - } - cutPhi(phi); - cutEta(eta); - - cut("CutsInDet", "NumRVxTracks", " Ntrack", numTracks); - cut("CutsInDet", "PrimaryRVx", " Primary", primVxCand); - - } // applyCuts() -------------------------------------------------------- - - /** - * @param nodes Collection - * @return Action[] - * Method returns either empty list of Actions or Vertex item after the - * right mouse click on the list (in the list dialog) - * Vertex only appear if there is one type of reconstructed tracks in the - * list and no other datatype - */ - @Override - public Action[] getActions(Collection nodes) - { - if (nodes.size() != 1) - { - return new Action[0]; - } - final DefaultMutableTreeNode node = (DefaultMutableTreeNode) (nodes.iterator().next()); - if (!node.getAllowsChildren()) - { - return new Action[0]; - } - AList[] list = AListManager.getInstance().getChildren(node); - if (list == null) - { - return new Action[0]; - } - Set<Integer> tracks = new HashSet<Integer>(); - Set<Integer> tracksID = new HashSet<Integer>(); - // iterate over the items in the list (set of whichever datatypes) - // condition in this loop assures that 'Vertex *' action appears only - // if there is/are set(s) of one type of reconstructed tracks and no - // other types. the condition used to be - // list[i].getSource() == ... .event.getRTrData() which was - // a method depending on the current selected Hits-to-RTr association - for (int i = 0; i < list.length; i++) - { - // tests that there is either type of reconstructed tracks in the list - if (list[i].getSource() instanceof ATrackData) - { - // test that there is just one type of reconstructed tracks if - // there are more than one item in list - if (i > 0) - { - String key1 = list[i - 1].getSource().getStoreGateKey(); - String key2 = list[i].getSource().getStoreGateKey(); - if (!(key1 == null && key2 == null) && !key1.equals(key2)) - { - String msg = "info: Vertexing is available if only one " + - "Track collection is chosen in the list. " + - " (select: InDet->Track->Track Collections)\n"; - AOutput.alwaysAppend(msg, ALogInterface.NORMAL); - return new Action[0]; - } - } - // tests passed - save indices of the tracks from the hashtable - for (int j = 0; j < list[i].getItems().length; j++) - { - int index = list[i].getItems()[j]; - int id2 = list[i].getSource().getIdFromIndex(index); - tracks.add(new Integer(index)); - tracksID.add(new Integer(id2)); - } - } - else - { - return new Action[0]; - } - } // for - int numTracks2 = tracks.size(); - if (numTracks2 < 2) - { - return new Action[0]; - } - final String trackName = list[0].getSource().getNameScreenName(); - final String trackStoreGateKey = list[0].getSource().getStoreGateKey(); - final int[] trackNumbers = new int[numTracks2]; // indices of tracks - final int[] trackIDs = new int[numTracks2]; // IDs of tracks - Iterator<Integer> i = tracks.iterator(); - int n = 0; - while (i.hasNext()) - { - trackNumbers[n++] = (i.next()).intValue(); - } - i = tracksID.iterator(); - n = 0; - while (i.hasNext()) - { - trackIDs[n++] = (i.next()).intValue(); - } - Action[] action = new Action[1]; // only one action will be displayed - // after removing interactive Athena - action[0] = new AbstractAction("Vertex " + trackName + " " + trackStoreGateKey + " in Atlantis") - { - public void actionPerformed(ActionEvent e) - { - try - { - createVertexFromTracks(trackNumbers, trackStoreGateKey); - // maybe should be all windows - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - node.setUserObject(new AList(ARVxData.this, numData - 1)); - } - catch (Exception ee) - { - // this exception was initially completely ignored (empty - // block) - can't actually see the reason why it is thrown - // at the end of createVertexFromTracks since it should be - // ignored. whether or not the exception occures tells - // whether the tracks are coming from the common vertex - - logger.debug("ARVxData.getActions() exception: " + ee.getMessage(), ee); - } - } - }; - - return action; - } // getActions() ------------------------------------------------------- - - - /** - * The method is called when Remove action is selected after right-click - * on the list item. There may be vertices coming from different types of - * tracks, trackType variable assures that the current reconstructed track - * instance is retrieved and the helix paremeters set on corrent tracks - * @param index int[] - */ - @Override - public void remove(int[] index) - { - String key = null; - ATrackData aRTr = null; - for (int i = 0; i < index.length; ++i) - { - drawFlag.set(index[i], new Boolean(false)); - key = tracksCollection.get(index[i]); - aRTr = event.getTrackData("InDetTrack", key); - if (aRTr != null) - { - int[] tracksInVertex = (tracksIndex.get(index[i])); - for (int j = 0; j < tracksInVertex.length; ++j) - { - aRTr.getModifiableHelix(tracksInVertex[j]).setPhiStartByXYPoint(0., 0.); - } - } // if - } // for - } // remove() ----------------------------------------------------------- - - /** - * if RVx (with numData > 0) is present in this event, cut Tracks - * forming vertices when tracks are drawn as polylines - */ - public void cutTracksToRVx(AEvent event) - { - if (!hasConsistentTrackNumbers) return; - for (int i = 0; i < numData; i++) - { - boolean origin = athenaOrigin.get(i).booleanValue(); - if (origin) - { - // true - RVx coming from Athena -> cut the track if its - // storeGateKey is known (was saved into tracksCollection) - String trackKey = tracksCollection.get(i); - ATrackData tracks = event.getTrackData("InDetTrack", trackKey); - if (tracks != null) - { - int[] tracksIdInVertex = (tracksId.get(i)); - if (tracksIdInVertex.length < 2) //ACH - put some more cuts on this? - continue; - AHelix[] thisHelGoToFitter = new AHelix[tracksIdInVertex.length]; - AVertex vertex = vertices.get(i); - double[] par = vertex.getPosition(); - double Vx = par[0]; - double Vy = par[1]; - for (int j = 0; j < tracksIdInVertex.length; j++) - { - int id2 = tracksIdInVertex[j]; - // if the JiveXML knows that vertex creates X number of - // tracks but doesn't know the ID, -1 is put as tracks ID - // skip cutting tracks - ID is actually unknown - if (id2 > -1) - { - thisHelGoToFitter[j] = tracks.getModifiableHelix(id2); - thisHelGoToFitter[j].setPhiStartByXYPoint(Vx, Vy); - } - } - } // if(tracks != null) - } - } - } // cutTracksToRVx() ---------------------------------------------------- - - - - /** - * Returns the values of primary vertex for the current event using the - * first vertex in this RVx data if it exists. - * @return double[3] or null - */ - public double[] getPrimaryVertex() - { - double[] vtx = null; // vertex position (x, y, z order) - - if (!(numData > 0)) - { - // Check this? If we have no vertices, want to get a primary vertex - // from somewhere else - return vtx; // null - } - - // if datatype contains primVxCand subtag, then take first item - // flagged 1 (primary vertex candidate) otherwise first item of - // the whole datatype - if(primVxCand != null) - { - for(int i = 0; i < numData; i++) - { - if(primVxCand[i] == 1) - { - vtx = vertices.get(i).getPosition(); - break; - } - } - if(vtx == null) - { - // none of the vetices had flag 1, take the first one anyway - vtx = vertices.get(0).getPosition(); - } - } - else - { - // primVxCand is not available, take the first item - vtx = vertices.get(0).getPosition(); - } - - return vtx; - - } // getPrimaryVertex() ------------------------------------------------- - - - - /** - * - * @param index int - * @return double[] - * Returns double array with x, y, z positions of the vertex - */ - public double[] getVertex(int index) - { - double[] vtx = null; - vtx = vertices.get(index).getPosition(); - return vtx; - - } // getVertex() -------------------------------------------------------- - - -} // class ARVxData ========================================================= diff --git a/graphics/AtlantisJava/src/atlantis/data/AS3DData.java b/graphics/AtlantisJava/src/atlantis/data/AS3DData.java deleted file mode 100644 index 62929b6f6b8a6be49713b401657a1e8d139475fc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AS3DData.java +++ /dev/null @@ -1,486 +0,0 @@ -package atlantis.data; - -import atlantis.event.AAssociation; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - - -/* - * The input array clusters is being used to contain two types of information - * for pixel clusters - * clusters[i][0] = identifier - * clusters[i][1] = -1 - * for space points from 2 strip clusters it contains the identifiers of the - * individual strips - * clusters[i][0] = identifier of first strip - * clusters[i][1] = identifier of second strip - */ -public class AS3DData extends A3DPointData -{ - private int[][] clusters = null; - // read from the event file - protected int[] layer = null; - private int[] etaModule = null; - private int[] phiModule = null; - - // for use by the filter loop, group[] is filled in by hit filter, other - // classes contain group functionality as well but currently (2006/08) - // hit filter takes into account only S3D (SiSpacePoint) data - protected int[] group = null; - private double[] eta = null; - - private boolean[] pixel = null; - public static final int PIXEL = -1; - public static final int CUT_INDET_SCT_ALL = -1; - public static final int CUT_INDET_SCT_EC_NEG = 0; - public static final int CUT_INDET_SCT_BARREL = 1; - public static final int CUT_INDET_SCT_EC_POS = 2; - - - - public String getParameterGroup() - { - return "S3D"; - } - - - public String getName() - { - return "S3D"; - } - - - public String getNameScreenName() - { - return "SpacePoint"; - } - - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+"\n"+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - String clId = clusters[index][0] + ", " + clusters[index][1]; - String type = pixel[index] ? " (Pixel hit)" : " (SCT hit)"; - - String temp = getNameScreenName() + " (id: " + id[index] + " index: " + index + ")" + - type + - "\n cluster identifiers: " + clId + - "\n x = " + String.format("%.3f",x[index]) + " cm" + - "\n y = " + String.format("%.3f",y[index]) + " cm" + - "\n z = " + String.format("%.3f",z[index]) + " cm" + - "\n " + AMath.RHO + " = " + String.format("%.3f",rho[index]) + - " cm" + - "\n " + AMath.PHI + " = " + - String.format("%.3f",Math.toDegrees(phi[index])) + - AMath.DEGREES + " (" + String.format("%.3f",phi[index]) + " rad)" + - "\n z = " + String.format("%.3f",z[index]) + " cm" + - "\n group = " + group[index]; - temp += "\n " + AMath.ETA + " module = "; - temp += (etaModule != null) ? Integer.toString(etaModule[index]) : "n/a"; - temp += "\n " + AMath.PHI + " module = "; - temp += (phiModule != null) ? Integer.toString(phiModule[index]) : "n/a"; - temp += super.getHitInfo(index); // finds barcode information - - return temp; - - } // getHitInfo() --------------------------------------------------------- - - - - AS3DData(AHashMap p, AEvent e) - { - super(p,e); - - etaModule = (p.get("etaModule") != null) ? p.getIntArray("etaModule") : null; - phiModule = (p.get("phiModule") != null) ? p.getIntArray("phiModule") : null; - - // use this for now as pixel id have bug i.e. sometimes > 0 - layer = p.getUnknownIntArray("layer"); - if(p.get("layer") == null || p.get("sub") == null) - { - calculateLayerSubdetector(); - } - group = new int[numData]; - eta = new double[numData]; - - if(p.get("clusters") != null) - { - // can only distinguish between SCT and Pixel hits if clusters - // subtag is available - pixel = new boolean[numData]; - // save IDs from event file to be available with pick info - clusters = new int[numData][]; - int[][] assocClusters = new int[numData][]; - int[] temp = p.getIntArray("clusters"); - for(int i = 0; i < numData; i++) - { - // save all clusters IDs - clusters[i] = new int[] { temp[2 * i], temp[2 * i + 1] }; - - // check if the second number, PIXEL (-1) designates pixel hit - if(temp[2 * i + 1] != PIXEL) - { - // this is SCT spacepoint - has got two clusters - assocClusters[i] = new int[] { temp[2 * i], temp[2 * i + 1] }; - } - else - { - // this is a pixel spacepoint (second cluster number is -1) - pixel[i] = true; - - // to ignore associtiation between pixel clusters and spacepoints: - // assocClusters[i] = null; - - // taking pixel cluster into account (pixel spacepoint has got - // only one cluster) (where as SCT spacepoint has got two clusters) - assocClusters[i] = new int[] { temp[2 * i] }; - } - } - event.getAssociationManager().add(new AAssociation(getFullName(), "SiCluster", assocClusters, event)); - event.getAssociationManager().add(new AAssociation(getFullName(), "PixelCluster", assocClusters, event)); - } - } - - - - protected void finalizeConstruction() - { - super.finalizeConstruction(); - super.calculateAssociationViaClusters(); - - } // finalizeConstruction() ---------------------------------------------- - - - - protected int internalColor() - { - int numColorTypes = super.internalColor(); - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - if(colorFunction == numColorTypes + 1) - { - colorByGroup(); - } - else if(colorFunction == numColorTypes + 2) - { - colorBy(layer); - } - return numColorTypes + 2; - - } // internalColor() ---------------------------------------------------- - - - protected void colorByGroup() - { - byte ungroupedColor; - if(parameterStore.get(PARAMETER_GROUP, "Ungrouped").getStatus()) - ungroupedColor = (byte) parameterStore.get(PARAMETER_GROUP, "Ungrouped").getI(); - else - ungroupedColor = (byte) parameterStore.get(PARAMETER_GROUP, "Unconnected"). - getI(); - int numColors = (byte) parameterStore.get("HitColors", "Number").getI(); - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for(int i = 0; i < numData; i++) - { - if(group[i] == 0) - color[i] = ungroupedColor; - else - color[i] = (byte) col[(group[i] - 1) % numColors]; - } - } - - - - /** - * define noise and good hits type = 0 means noise - * noise hits - hits associated neither with Track not STr - * good hits - hits associated either with Track or with STr plus - * group information - set by the AFilter (hit filter) - */ - protected void setType() - { - int[][] assocSTr = event.getAssociationManager().get(getFullName(), "STr"); - int[][] assocRTr = event.getAssociationManager().get(getFullName(), getReconstructedTracks()); - for(int i = 0; i < numData; i++) - { - if((assocSTr != null && assocSTr[i] != null) || - (assocRTr != null && assocRTr[i] != null) || group[i] > 0) - { - type[i] = 1; - } - else - { - type[i] = 0; - } - } - - } // setType() ---------------------------------------------------------- - - - - protected void applyCuts() - { - cutIndex(); - cutSubdetector(); - cut("CutsInDet", "Layer", " Layer", layer); - cutPhi(phi); - cutEta(rho, z); - cutSimulatedTracks(); - cutReconstructedTracks(); - cut("CutsInDet", "Group", " Group", group); - if(etaModule != null) - { - cut("CutsInDet", "EtaModule", " EtaModule", etaModule); - } - if(phiModule != null) - { - cut("CutsInDet", "PhiModule", " PhiModule", phiModule); - } - } - - private void cutSubdetector() - { - AParameter subPar = parameterStore.get("CutsInDet", "SCT"); - if(subPar.getI() != -1) - cutArray(sub, subPar.getI(), "Barrel/Endcap"); - } - - - public int getLayer(int id) - { - int layer; - if(id > -1) - layer = (id >> 21) & 0xF; - else - layer = (id >> 27) & 0x3; - int sub = getSub(id); - if(id > -1) - { - // strips - if(sub == ASiClusterData.BARREL) - layer += 3; - else - layer += 11; - } - else - { - // pixels - if(sub != ASiClusterData.BARREL) - layer += 7; - } - return layer; - } - - - public int getSub(int id) - { - if(id > -1) - return(id >> 25) & 0x3; - else - return(id >> 29) & 0x3; - } - - - private void calculateLayerSubdetector() - { - final double rhoPixelMax = 24.; - final double zBarrelPixelMax = 41.; - final double zBarrelStripsMax = 78.; - final double[] zEndcapPixel = - {51., 64., 90.}; - final double[] zEndcapStrips = - {88., 98., 116., 134., 156., 190., 233., - 263.}; - final double[] rhoBarrel = - {6.74, 11.5, 23., 34., 40., 48.}; - for(int i = 0; i < numData; i++) - { - double z = Math.abs(this.z[i]); - double r = rho[i]; - if(r < rhoPixelMax) - { - // .............................................. pixels - if(z < zBarrelPixelMax) - { - // ............................................ barrel - sub[i] = 1; - for(int l = 0; l < rhoBarrel.length; l++) - if(r < rhoBarrel[l]) - { - layer[i] = l; - break; - } - } - else - { - // ............................................ end cap - layer[i] = 10; - for(int l = 0; l < zEndcapPixel.length; l++) - { - if(z < zEndcapPixel[l]) - { - layer[i] = 7 + l; - break; - } - } - if(this.z[i] < 0) - sub[i] = 0; - else - sub[i] = 2; - } - } - else - { - // .............................................. strips - - if(z < zBarrelStripsMax) - { - // ............................................ BARREL - sub[i] = 1; - layer[i] = 6; - for(int l = 0; l < rhoBarrel.length; l++) - if(r < rhoBarrel[l]) - { - layer[i] = l; - break; - } - } - else - { - // ............................................ end cap - layer[i] = 19; - for(int l = 0; l < zEndcapStrips.length; l++) - { - if(z < zEndcapStrips[l]) - { - layer[i] = 11 + l; - break; - } - } - if(this.z[i] < 0) - sub[i] = 0; - else - sub[i] = 2; - } - } - } - } - - - // drawlist to be used as input to the filter - public int makeFilterDrawList(double etaRange) - { - calculateRhoPhi(); - - // overwrite the input array to improve speed - numDraw = 0; - for(int i = 0; i < numData; i++) - { - double eta = AParameterUtilities.eta(z[i], rho[i]); - this.eta[i] = eta; - if(eta > -etaRange && eta < etaRange) - { - listdl[numDraw++] = i; - } - } - - return numDraw; - } - - - public int[] getIntegerEta(int numBins, double etaRange, int[] integerEta) - { - // overwrite the input array to improve speed - double binWidth = 2 * etaRange / numBins; - double etaRangeOptimised = etaRange + binWidth; - for(int i = 0; i < numDraw; i++) - // implicit (int) conversion only does correct thing if positive - integerEta[i] = (int) ((eta[listdl[i]] + etaRangeOptimised) / - binWidth); - return integerEta; - } - - - public int[] getIntegerPhi(int numBins, double skew, int[] integerPhi) - { - calculateRhoPhi(); - // overwrite the input array to improve speed - double binWidth = 2 * Math.PI / numBins; - for(int i = 0; i < numDraw; i++) - { - // can only be positive - // add one to treat wraparound efficiently - double p = phi[listdl[i]] - skew * rho[listdl[i]]; - if(p < 0.) - p += 2 * Math.PI; - else if(p > 2 * Math.PI) - p -= 2 * Math.PI; - integerPhi[i] = (int) (p / binWidth) + 1; - } - return integerPhi; - } - - - public int[] getLayer(int[] layer) - { - for(int i = 0; i < numDraw; i++) - layer[i] = this.layer[listdl[i]]; - return layer; - } - - - public void setGroup(int[] group) - { - for(int i = 0; i < numData; i++) - this.group[i] = 0; - for(int i = 0; i < numDraw; i++) - this.group[listdl[i]] = group[i]; - } - - - protected ACoord getFRUser() - { - if(!parameterStore.get("SiCluster", "Stereo").getStatus())return super.getFRUser(); - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - h[i] = rho[list]; - v[i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[list], phi[list], z[list])); - index[i] = list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FR"); - } - - - protected ACoord getFZUser() - { - if(!parameterStore.get("SiCluster", "Stereo").getStatus())return super.getFZUser(); - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - h[i] = z[list]; - v[i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[list], phi[list], z[list])); - index[i] = list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FZ"); - } - -} // class AS3DData ========================================================= diff --git a/graphics/AtlantisJava/src/atlantis/data/ASMTrData.java b/graphics/AtlantisJava/src/atlantis/data/ASMTrData.java deleted file mode 100644 index dfd4eb8c63d4214452baee66bd8eb6201c66bd39..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ASMTrData.java +++ /dev/null @@ -1,626 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.canvas.AWindow; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionXZ; -import atlantis.utils.A3Vector; -import atlantis.utils.A4Vector; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -/** - * Simulated particle in the muon system - */ - -public class ASMTrData extends AData -{ - private static final double START_RADIUS = 2.; - protected int[] code; - protected int[] particleType; - protected int[] originVertex; - protected float[] pT; - protected float[][] rho; - protected float[][] phi; - protected float[][] z; - protected float[][] x; - protected float[][] y; - AHelix[] innerTrack; - protected int[] type; - private int[] index; - - - public String getParameterGroup() - { - return "SMTr"; - } - - - public String getName() - { - return "SMTr"; - } - - - public String getNameScreenName() - { - return "SimMuonTrack"; - } - - - ASMTrData(AHashMap p, AEvent e) - { - super(p,e); - rho = new float[2][]; - phi = new float[2][]; - z = new float[2][]; - x = new float[2][]; - y = new float[2][]; - x[0] = new float[numData]; - y[0] = new float[numData]; - rho[0] = p.getFloatArray("rhoVertex"); - phi[0] = p.getFloatArray("phiVertex"); - z[0] = p.getFloatArray("zVertex"); - for(int i = 0; i < numData; ++i) - { - x[0][i] = (float) (rho[0][i] * Math.cos(phi[0][i])); - y[0][i] = (float) (rho[0][i] * Math.sin(phi[0][i])); - } - x[1] = (float[]) x[0].clone(); - y[1] = (float[]) y[0].clone(); - z[1] = (float[]) z[0].clone(); - phi[1] = (float[]) phi[0].clone(); - rho[1] = (float[]) rho[0].clone(); - pT = p.getFloatArray("pt"); - code = p.getIntArray("code"); - type = new int[numData]; - particleType = new int[numData]; - originVertex = p.getIntArray("simulatedVertex"); - for(int i = 0; i < numData; i++) - { - if(Math.abs(code[i]) > 10) - // code is being used to store particle code - particleType[i] = APDGTable.getParticleType(code[i]); - } - calculateReasonableEndpoints(p.getFloatArray("phi"), - p.getFloatArray("eta")); - double[] phiD = new double[numData]; - float[] phiF = p.getFloatArray("phi"); - for(int i = 0; i < numData; i++) - phiD[i] = phiF[i]; - index = indexBy(phiD); - } - - - protected void calculateRhoPhi() - { - calculateRhoPhi(x[0], y[0], rho[0], phi[0]); - calculateRhoPhi(x[1], y[1], rho[1], phi[1]); - } - - private void calculateReasonableEndpoints(float[] phiDir, float[] eta) - { - double rhoTo = 1500.; - double zTo = 2500.; - int maxPoints = 5; - double[] d = new double[maxPoints]; - for(int i = 0; i < numData; i++) - { - int numPoints = 0; - //initial point inside volume - if(rho[0][i] < rhoTo && Math.abs(z[0][i]) < zTo) - { - d[numPoints++] = 0.; - } - double lambda = AMath.lambda(eta[i]); - double x0 = x[0][i]; - double y0 = y[0][i]; - double z0 = z[0][i]; - x[1][i] = (float) x0; - y[1][i] = (float) y0; - z[1][i] = (float) z0; - double u = Math.cos(lambda) * Math.cos(phiDir[i]); - double v = Math.cos(lambda) * Math.sin(phiDir[i]); - double w = Math.sin(lambda); - //intersections with cylinder walls - if(w != 0.) - { - d[numPoints++] = (zTo - z0) / w; - d[numPoints++] = ( -zTo - z0) / w; - } - double a = u * u + v * v; - double c = x0 * x0 + y0 * y0 - rhoTo * rhoTo; - double b = 2 * (u * x0 + v * y0); - double squared = b * b - 4 * a * c; - if(squared >= 0.) - { - d[numPoints++] = ( -b + Math.sqrt(squared)) / (2 * a); - d[numPoints++] = ( -b - Math.sqrt(squared)) / (2 * a); - } - //bubble sort points by increasing path length - for(int j = 0; j < numPoints - 1; ++j) - for(int k = j + 1; k < numPoints; ++k) - if(d[k] < d[j]) - { - double temp = d[k]; - d[k] = d[j]; - d[j] = temp; - } - for(int j = 0; j < numPoints; ++j) - if(d[j] >= 0. && j < numPoints - 1) - { - x[0][i] = (float) (x0 + d[j] * u); - y[0][i] = (float) (y0 + d[j] * v); - z[0][i] = (float) (z0 + d[j] * w); - x[1][i] = (float) (x0 + d[j + 1] * u); - y[1][i] = (float) (y0 + d[j + 1] * v); - z[1][i] = (float) (z0 + d[j + 1] * w); - break; - } - } - } - - - protected void finalizeConstruction() - { - super.finalizeConstruction(); - // needs ZVTx - innerTrack = new AHelix[numData]; - for(int i = 0; i < numData; ++i) - { - double p = AMath.getPFromPttL(pT[i], - AMath.tanLambda(AParameterUtilities.eta(z[0][i], - rho[0][i]))); - // correct for average energy loss - double pTCorrected = pT[i] * (p + 3.7) / p; - innerTrack[i] = new AHelix((float) 0., - (float) (parameterStore.get("Event", "ZVtx").getD()), ( - float) (Math.toDegrees(phi[0][i])), - (float) AMath.tanLambda(AParameterUtilities.eta(z[0][i], - rho[0][i])), (float) pTCorrected); - // calculatePhiCorrection(i); - } - } - - - protected void applyCuts() - { - cutIndex(); - cut("CutsInDet", "STrType", " STr Type", particleType); - cut("CutsInDet", "STr", " STr id", id); - cut("CutsInDet", "Pt", " |Pt|", pT); - cut("CutsInDet", "SVx", " Vertex", originVertex); - cutPhi(phi[1]); - float[] phiStart = new float[numData]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int iMax = 0; - if(rho[1][list] > rho[0][list]) - iMax = 1; - int iMin = 1 - iMax; - phiStart[list] = (float) phi[iMin][list]; - } - cutPhi(phiStart); - cutEta(rho[1], z[1]); - } - - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - if(colorFunction == 0) - colorByConstant(); - else if(colorFunction == 1) - colorByIndex(index); - else if(colorFunction == 2) - colorBy("ParticleColors", particleType); - return 2; - } - - - public String getHitInfo(int index) - { - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n Type = "); - msg.append(APDGTable.getName(code[index])); - if (innerTrack != null) - msg.append(innerTrack[index].toString()); - msg.append("\n pT (muon spectrometer) = "); - msg.append(String.format("%.3f",pT[index])); - msg.append(" GeV"); - - return msg.toString(); - } - - - protected void cutStartRadius() - { - int num = 0; - for(int i = 0; i < numDraw; i++) - if(Math.min(Math.abs(z[0][listdl[i]] / rho[0][listdl[i]]), - Math.abs(z[1][listdl[i]] / rho[1][listdl[i]])) - < 12.3 / 9.2) - listdl[num++] = listdl[i]; - numDraw = num; - } - - - protected void cutStartRadius2() - { - int num = 0; - for(int i = 0; i < numDraw; i++) - if(Math.max(Math.abs(z[0][listdl[i]] / rho[0][listdl[i]]), - Math.abs(z[1][listdl[i]] / rho[1][listdl[i]])) - > 12.3 / 9.2) - listdl[num++] = listdl[i]; - numDraw = num; - } - - - protected ACoord getYXUser() - { - makeDrawList(); - cutStartRadius(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for(int j = 0; j < 2; j++) - { - hv[0][j][i] = x[j][list]; - hv[1][j][i] = y[j][list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - - protected ACoord getRZUser() - { - makeDrawList(); - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - int numSplit = 0; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiDiff = Math.abs(phi[0][list] - phiMid); - double sign0 = -1.; - if(phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - sign0 = +1.; - phiDiff = Math.abs(phi[1][list] - phiMid); - double sign1 = -1.; - if(phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - sign1 = +1.; - if(sign0 != sign1) numSplit++; - } - int numPoints = 100; - double[][][] hv = new double[2][numDraw + numSplit][]; - int[] index = new int[numDraw + numSplit]; - int num = 0; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiDiff = Math.abs(phi[0][list] - phiMid); - double sign0 = -1.; - if(phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - sign0 = +1.; - phiDiff = Math.abs(phi[1][list] - phiMid); - double sign1 = -1.; - if(phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - sign1 = +1.; - if(sign0 == sign1) - { - hv[0][num] = AMath.splitLineIntoPieces(new double[] - {z[1][list], z[0][list]}, numPoints); - double[] xx = AMath.splitLineIntoPieces(new double[] - {x[1][list], x[0][list]}, numPoints); - double[] yy = AMath.splitLineIntoPieces(new double[] - {y[1][list], y[0][list]}, numPoints); - hv[1][num] = new double[xx.length]; - for(int j = 0; j < xx.length; ++j) - hv[1][num][j] = sign0 * - Math.sqrt(xx[j] * xx[j] + yy[j] * yy[j]); - index[num++] = list; - } - else - { - //just for now.... - double a = Math.cos(phiMid); - double b = Math.sin(phiMid); - double x0 = x[0][list]; - double y0 = y[0][list]; - double z0 = z[0][list]; - double dx = x[1][list] - x0; - double dy = y[1][list] - y0; - double dz = z[1][list] - z0; - double mag = Math.sqrt(dx * dx + dy * dy + dz * dz); - dx /= mag; - dy /= mag; - dz /= mag; - double d = -(a * x0 + b * y0) / (a * dx + b * dy); - double xMid = x0 + d * dx; - double yMid = y0 + d * dy; - double zMid = z0 + d * dz; - hv[0][num] = AMath.splitLineIntoPieces(new double[] - {zMid, z[0][list]}, numPoints); - double[] xx = AMath.splitLineIntoPieces(new double[] - {xMid, x[0][list]}, numPoints); - double[] yy = AMath.splitLineIntoPieces(new double[] - {yMid, y[0][list]}, numPoints); - hv[1][num] = new double[xx.length]; - for(int j = 0; j < xx.length; ++j) - hv[1][num][j] = sign0 * - Math.sqrt(xx[j] * xx[j] + yy[j] * yy[j]); - index[num++] = list; - hv[0][num] = AMath.splitLineIntoPieces(new double[] - {z[1][list], zMid}, numPoints); - xx = AMath.splitLineIntoPieces(new double[] - {x[1][list], xMid}, numPoints); - yy = AMath.splitLineIntoPieces(new double[] - {y[1][list], yMid}, numPoints); - hv[1][num] = new double[xx.length]; - for(int j = 0; j < xx.length; ++j) - hv[1][num][j] = sign1 * - Math.sqrt(xx[j] * xx[j] + yy[j] * yy[j]); - index[num++] = list; - } - } - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES); - } - - - protected ACoord getFRUser() - { - makeDrawList(); - cutStartRadius(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int iMax = 0; - if(rho[1][list] > rho[0][list]) - iMax = 1; - int iMin = 1 - iMax; - double rho1 = rho[iMin][list]; - double rho2 = rho[iMax][list]; - if(rho1 > START_RADIUS) - { - hv[0][0][i] = rho1; - hv[1][0][i] = Math.toDegrees(phi[iMin][list]); - } - else - { - double[] rpz = calculateRhoPhiZAtStart(list); - hv[0][0][i] = rpz[0]; - hv[1][0][i] = Math.toDegrees(rpz[1]); - } - hv[0][1][i] = rho2; - hv[1][1][i] = Math.toDegrees(phi[iMax][list]); - index[i] = list; - } - return new ACoord(hv, index, this, - ACoord.LINES).includePhiWrapAround("FR"); - } - - - protected ACoord getXZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phi0 = Math.toRadians(AProjectionXZ.getPhi()); - double cosPhi0 = Math.cos(phi0); - double sinPhi0 = Math.sin(phi0); - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for(int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = x[j][list] * cosPhi0 + y[j][list] * sinPhi0; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - - protected ACoord getYZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phi0 = Math.toRadians(AProjectionXZ.getPhi()); - double cosPhi0 = Math.cos(phi0); - double sinPhi0 = Math.sin(phi0); - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for(int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = y[j][list] * cosPhi0 - x[j][list] * sinPhi0; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - - protected ACoord getFZUser() - { - makeDrawList(); - cutStartRadius2(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int iMax = 0; - if(rho[1][list] > rho[0][list]) - iMax = 1; - int iMin = 1 - iMax; - double rho1 = rho[iMin][list]; - if(rho1 > START_RADIUS) - { - hv[0][0][i] = z[iMin][list]; - hv[1][0][i] = Math.toDegrees(phi[iMin][list]); - } - else - { - double[] rpz = calculateRhoPhiZAtStart(list); - hv[0][0][i] = rpz[2]; - hv[1][0][i] = Math.toDegrees(rpz[1]); - } - hv[0][1][i] = z[iMax][list]; - hv[1][1][i] = Math.toDegrees(phi[iMax][list]); - index[i] = list; - } - return new ACoord(hv, index, this, - ACoord.LINES).includePhiWrapAround("FZ"); - } - - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if(projection instanceof AProjectionVP) - { - ag.draw(window.calculateDisplay(getVPUser(window, projection))); - } - else - super.draw(window, ag, projection); - } - - - // a track has two arms in the VPlot - - protected ACoord getVPUser(AWindow window, AProjection projection) - { - makeDrawList(); - - // make a copy of the points to draw: both arms * ??? - double[][][] hv = new double[2][2 * numDraw][]; - int[] index = new int[2 * numDraw]; - int num = 0; - - //loop over drawn objects? - for(int j = 0; j < numDraw; ++j) - { - // get list item from draw index list? - int list = listdl[j]; - // get the helix that should be drawn - ADHelix dhelix = new ADHelix(innerTrack[list]); - // get the helix start and end - double s1 = dhelix.getAStart(); - double s2 = 179.; - // hardwire projection.getMinRho() == 2. for now - s1 = dhelix.intersectWithRadialCylinder(((AProjection2D) projection). - getMinRho(), s1, s2); - double sEnd = dhelix.intersectWithCylinder(true, - AProjectionVP.getRhoVPlot(), true, - AProjectionVP.getZVPlot()); - s2 = Math.max(Math.min(s2, sEnd), s1); - // if the whole helix is to be drawn (which are unusual - // helices, shorten it a little to avoid wraparound problems - if(s1 == 0. && s2 == 180.) s2 = 179.; - if(parameterStore.get("VP", "ShortV").getStatus() && - !parameterStore.get("Data", "S3D").getStatus()) - s1 = s2 - parameterStore.get("VP", "ShortV").getD() * (s2 - s1); - if(s2 > s1) - { - int signMin = -1; - int signMax = 1; - for(int sign = signMin; sign <= signMax; sign += 2) - { - // ugly must change structure at some point - AProjectionVP.sign = sign; - ACoord pointsOnHelix = dhelix.drawHelix(window, - (AProjection2D) projection, s1, s2); - hv[0][num] = pointsOnHelix.hv[0][0]; - hv[1][num] = pointsOnHelix.hv[1][0]; - index[num] = list; - num++; - } - } - } - return window.calculateUser(new ACoord(hv, index, this, - ACoord.SMOOTH_POLYLINES)). - includePhiWrapAround(projection.getName()); - } - - - private double[] calculateRhoPhiZAtStart(int index) - { - double[] rpz = new double[3]; - double rho1 = rho[0][index]; - double phi1 = phi[0][index]; - double z1 = z[0][index]; - double rho2 = rho[1][index]; - double phi2 = phi[1][index]; - double z2 = z[1][index]; - double x1 = rho1 * Math.cos(phi1); - double y1 = rho1 * Math.sin(phi1); - double x2 = rho2 * Math.cos(phi2); - double y2 = rho2 * Math.sin(phi2); - double fract = (START_RADIUS - rho1) / (rho2 - rho1); - double x = x1 + fract * (x2 - x1); - double y = y1 + fract * (y2 - y1); - double z = z1 + fract * (z2 - z1); - double phi = Math.atan2(y, x); - if(phi < 0.) phi += 2 * Math.PI; - rpz[0] = START_RADIUS; - rpz[1] = phi; - rpz[2] = z; - return rpz; - } - - - public String getVPHitInfo() - { - makeDrawList(); - if (numDraw == 0) - return ""; - double sumP = 0.; - double sumPt = 0.; - for(int i = 0; i < numDraw; ++i) - { - sumPt += Math.abs(pT[listdl[i]]); - double invLambda = (rho[1][listdl[i]] - rho[0][listdl[i]]) / - (z[1][listdl[i]] - z[0][listdl[i]]); - sumP += Math.abs(pT[listdl[i]] / Math.cos(Math.atan(1. / invLambda))); - } - - String msg = numDraw + " " + getNameScreenName(); - msg += " sum(PT) = " + String.format("%.1f",sumPt) + " sum(P) = " + String.format("%.1f",sumP); - - return msg; - } - - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - for(int i = 0; i < num; ++i) - { - int k = list[i]; - A3Vector start = A3Vector.fromRhoPhiZ(rho[0][k], phi[0][k], - z[0][k]); - A3Vector stop = A3Vector.fromRhoPhiZ(rho[1][k], phi[1][k], - z[1][k]); - A3Vector v = (stop.subtract(start)).normalize(); - double p = pT[k] / Math.sqrt(1. - v.z * v.z); - sum.add(new A4Vector(v.scale(p), 0.)); - } - return sum; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ASNPData.java b/graphics/AtlantisJava/src/atlantis/data/ASNPData.java deleted file mode 100644 index 4c6602479950fc2da6ebc1769c5661b812137557..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ASNPData.java +++ /dev/null @@ -1,659 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjectionXZ; -import atlantis.utils.A3Vector; -import atlantis.utils.A4Vector; -import atlantis.utils.AHashMap; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; - -/** - * Simulated Neutral Particle - */ - -public class ASNPData extends AData -{ - private static ALogger logger = ALogger.getLogger(ASNPData.class); - - private static final double START_RADIUS = 2.; - - protected int[] code; - protected int[] particleType; - protected int[] originVertex; - protected float[] pT; - protected float[][] rho; - protected float[][] phi; - protected float[][] z; - protected float[][] x; - protected float[][] y; - protected int[] type; - private float[] temp; - private int[] index; - - public float[] getPt() - { - return pT; - } - - public String getParameterGroup() - { - return "SNP"; - } - - public String getName() - { - return "SNP"; - } - - public String getNameScreenName() - { - return "SimNeutralTrack"; - } - - ASNPData(AHashMap p, AEvent e) - { - super(p,e); - rho = new float[2][]; - phi = new float[2][]; - z = new float[2][]; - x = new float[2][numData]; - y = new float[2][numData]; - rho[0] = p.getFloatArray("rhoVertex"); - phi[0] = p.getFloatArray("phiVertex"); - z[0] = p.getFloatArray("zVertex"); - - pT = p.getFloatArray("pt"); - code = p.getIntArray("code"); - type = new int[numData]; - particleType = new int[numData]; - originVertex = p.getIntArray("simulatedVertex"); - temp = new float[numData]; - for (int i = 0; i < numData; i++) - { - if (Math.abs(code[i]) > 10) - { - // code is being used to store particle code - particleType[i] = APDGTable.getParticleType(code[i]); - } - } - calculateReasonableEndpoints(p.getFloatArray("phi"), p.getFloatArray("eta")); - - double[] phiD = new double[numData]; - float[] phiF = p.getFloatArray("phi"); - - for (int i = 0; i < numData; i++) - phiD[i] = phiF[i]; - index = indexBy(phiD); - calculateXY(rho[0], phi[0], x[0], y[0]); - calculateXY(rho[1], phi[1], x[1], y[1]); - } - - protected void calculateRhoPhi() - { - calculateRhoPhi(x[0], y[0], rho[0], phi[0]); - calculateRhoPhi(x[1], y[1], rho[1], phi[1]); - } - - public static AHashMap createSNP(AHashMap p) - { - float[] pt = p.getFloatArray("pt"); - float[] phi = p.getFloatArray("phi"); - float[] eta = p.getFloatArray("eta"); - float[] rhoVertex = p.getFloatArray("rhoVertex"); - float[] phiVertex = p.getFloatArray("phiVertex"); - float[] zVertex = p.getFloatArray("zVertex"); - int[] id = p.getIntArray("id"); - - int[] code = p.getIntArray("code"); - - int numNeutral = 0; - - for (int i = 0; i < code.length; ++i) - { - int charge = code[i]; - - try - { - if (Math.abs(code[i]) >= 10) - - // code is being used to store particle code - charge = APDGTable.getCharge(code[i]); - if (charge == 0) - numNeutral++; - } - catch (APDGTable.ParticleNotFoundError pnf){ - logger.debug(pnf.getMessage()); - } - } - - int[] simulatedVertex = ASVxData.assignVertexNumbers(phiVertex, rhoVertex, zVertex); - - int[] idN = new int[numNeutral]; - float[] rhoVertexN = new float[numNeutral]; - float[] phiVertexN = new float[numNeutral]; - float[] zVertexN = new float[numNeutral]; - float[] ptN = new float[numNeutral]; - float[] phiN = new float[numNeutral]; - float[] etaN = new float[numNeutral]; - int[] codeN = new int[numNeutral]; - int[] simulatedVertexN = new int[numNeutral]; - - numNeutral = 0; - for (int i = 0; i < code.length; ++i) - { - double charge = code[i]; - - try - { - if (Math.abs(code[i]) >= 10) - { - // code is being used to store particle code - charge = APDGTable.getCharge(code[i]); - } - if (charge == 0) - { - idN[numNeutral] = id[i]; - rhoVertexN[numNeutral] = (float) Math.sqrt(rhoVertex[i]*rhoVertex[i]-zVertex[i]*zVertex[i]); - phiVertexN[numNeutral] = phiVertex[i]; - zVertexN[numNeutral] = zVertex[i]; - ptN[numNeutral] = pt[i]; - phiN[numNeutral] = phi[i]; - etaN[numNeutral] = eta[i]; - codeN[numNeutral] = code[i]; - simulatedVertexN[numNeutral] = simulatedVertex[i]; - numNeutral++; - } - } - catch (APDGTable.ParticleNotFoundError pnf){ - logger.debug(pnf.getMessage()); - } - } - - AHashMap newP = new AHashMap(10); - - newP.put("numData", new Integer(numNeutral)); - newP.put("id", idN); - newP.put("rhoVertex", rhoVertexN); - newP.put("phiVertex", phiVertexN); - newP.put("zVertex", zVertexN); - newP.put("pt", ptN); - newP.put("phi", phiN); - newP.put("eta", etaN); - newP.put("code", codeN); - newP.put("simulatedVertex", simulatedVertexN); - return newP; - } - - private void calculateReasonableEndpoints(float[] dirPhi, float[] dirEta) - { - double rhoTo = parameterStore.get("RTr", "RadiusTr").getD(); - double zTo = parameterStore.get("RTr", "ZTr").getD(); - - rho[1] = (float[]) rho[0].clone(); - phi[1] = (float[]) phi[0].clone(); - z[1] = (float[]) z[0].clone(); - for (int i = 0; i < numData; i++) - { - if (particleType[i] == 5) - { - // photon -> ecal entrance - rhoTo = 150.; - zTo = 370.; - } - else - { - // neutral hadron -> hcal entrance - rhoTo = 228.; - zTo = 426.2; - } - if (rho[0][i] > rhoTo || Math.abs(z[0][i]) > zTo) - continue; - double rho2 = rhoTo; - double tanLambda = AMath.tanLambda(dirEta[i]); - double zz = z[0][i] + (rho2 - rho[0][i]) * tanLambda; - - if (zz > zTo) - rho2 = (zTo - z[0][i]) / tanLambda + rho[0][i]; - if (zz < -zTo) - rho2 = (-zTo - z[0][i]) / tanLambda + rho[0][i]; - double x = rho[0][i] * Math.cos(phi[0][i]); - double y = rho[0][i] * Math.sin(phi[0][i]); - // y=mx+c, x*x+y*y=rho2*rho2 - double m = Math.tan(dirPhi[i]); - double c = y - m * x; - // ax^2+bx+cc=0 - double a = m * m + 1.; - double b = 2. * m * c; - double cc = c * c - rho2 * rho2; - double d = Math.sqrt(b * b - 4 * a * cc); - double x1 = (-b + d) / (a * 2); - double x2 = (-b - d) / (a * 2); - double y1 = m * x1 + c; - double y2 = m * x2 + c; - double xx = x1; - double yy = y1; - - if ((x2 - x) * Math.cos(dirPhi[i]) + (y2 - y) * Math.sin(dirPhi[i]) > 0.) - { - xx = x2; - yy = y2; - } - zz = z[0][i] + (rho2 - rho[0][i]) * tanLambda; - rho[1][i] = (float) Math.sqrt(xx * xx + yy * yy); - phi[1][i] = (float) Math.atan2(yy, xx); - if (phi[1][i] < 0.) - phi[1][i] += 2 * Math.PI; - z[1][i] = (float) zz; - } - } - - protected void applyCuts() - { - cutIndex(); - cut("CutsInDet", "STrType", " STr Type", particleType); - cut("CutsInDet", "STr", " STr id", id); - cut("CutsInDet", "Pt", " |Pt|", pT); - cut("CutsInDet", "SVx", " Vertex", originVertex); - cut("CutsInDet", "d0", " |d0|", getD0()); - cut("CutsInDet", "d0Loose", " |d0Loose|", getD0()); - cut("CutsInDet", "z0-zVtx", " |z0-zVtx|", getZ0Primary()); - cut("CutsInDet", "z0", " |z0|", getZ0()); - cutPhi(phi[1]); - float[] phiStart = new float[numData]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int iMax = 0; - - if (rho[1][list] > rho[0][list]) - iMax = 1; - int iMin = 1 - iMax; - - if (rho[iMin][list] > START_RADIUS) - phiStart[list] = phi[iMin][list]; - else - { - double[] rpz = calculateRhoPhiZAtStart(list); - - phiStart[list] = (float) rpz[1]; - } - } - cutPhi(phiStart); - cutEta(rho[1], z[1]); - } - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if (colorFunction == 0) - colorByConstant(); - else if (colorFunction == 1) - colorByIndex(index); - else if (colorFunction == 2) - colorBy(getPt()); - else if (colorFunction == 3) - colorBy("ParticleColors", particleType); - else if (colorFunction == 4) - colorBy(originVertex); - return 3; - } - - public String getHitInfo(int index) - { - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n Type = "); - msg.append(APDGTable.getName(code[index])); - msg.append("\n PT = "); - msg.append(String.format("%.3f",pT[index])); - msg.append(" GeV"); - - return msg.toString(); - } - - protected void cutStartRadius() - { - int num = 0; - - for (int i = 0; i < numDraw; i++) - if (Math.max(rho[0][listdl[i]], rho[1][listdl[i]]) > START_RADIUS) - listdl[num++] = listdl[i]; - numDraw = num; - } - - protected ACoord getYXUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - for (int j = 0; j < 2; j++) - { - hv[0][j][i] = x[j][list]; - hv[1][j][i] = y[j][list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - protected ACoord getRZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiDiff = Math.abs(phi[1][list] - phiMid); - double sign; - - // this is not quite correct need to split some tracks - if (phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - sign = +1.; - else - sign = -1.; - for (int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = sign * rho[j][list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - protected ACoord getFRUser() - { - makeDrawList(); - cutStartRadius(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int iMax = 0; - - if (rho[1][list] > rho[0][list]) - iMax = 1; - int iMin = 1 - iMax; - double rho1 = rho[iMin][list]; - double rho2 = rho[iMax][list]; - - if (rho1 > START_RADIUS) - { - hv[0][0][i] = rho1; - hv[1][0][i] = Math.toDegrees(phi[iMin][list]); - } - else - { - double[] rpz = calculateRhoPhiZAtStart(list); - - hv[0][0][i] = rpz[0]; - hv[1][0][i] = Math.toDegrees(rpz[1]); - } - hv[0][1][i] = rho2; - hv[1][1][i] = Math.toDegrees(phi[iMax][list]); - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES).includePhiWrapAround("FR"); - } - - protected ACoord getXZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phi0 = Math.toRadians(AProjectionXZ.getPhi()); - double cosPhi0 = Math.cos(phi0); - double sinPhi0 = Math.sin(phi0); - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - for (int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = x[j][list] * cosPhi0 + y[j][list] * sinPhi0; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - protected ACoord getYZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phi0 = Math.toRadians(AProjectionXZ.getPhi()); - double cosPhi0 = Math.cos(phi0); - double sinPhi0 = Math.sin(phi0); - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - for (int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = y[j][list] * cosPhi0 - x[j][list] * sinPhi0; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - protected ACoord getFZUser() - { - makeDrawList(); - cutStartRadius(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int iMax = 0; - - if (rho[1][list] > rho[0][list]) - iMax = 1; - int iMin = 1 - iMax; - double rho1 = rho[iMin][list]; - - if (rho1 > START_RADIUS) - { - hv[0][0][i] = z[iMin][list]; - hv[1][0][i] = Math.toDegrees(phi[iMin][list]); - } - else - { - double[] rpz = calculateRhoPhiZAtStart(list); - - hv[0][0][i] = rpz[2]; - hv[1][0][i] = Math.toDegrees(rpz[1]); - } - hv[0][1][i] = z[iMax][list]; - hv[1][1][i] = Math.toDegrees(phi[iMax][list]); - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES).includePhiWrapAround("FZ"); - } - - protected ACoord getVPUser() - { - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - h[i] = AParameterUtilities.eta(z[1][list], rho[1][list]); - v[i] = Math.toDegrees(phi[1][list]); - index[i] = list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("VP"); - } - - private double[] calculateRhoPhiZAtStart(int index) - { - double[] rpz = new double[3]; - double rho1 = rho[0][index]; - double phi1 = phi[0][index]; - double z1 = z[0][index]; - double rho2 = rho[1][index]; - double phi2 = phi[1][index]; - double z2 = z[1][index]; - double x1 = rho1 * Math.cos(phi1); - double y1 = rho1 * Math.sin(phi1); - double x2 = rho2 * Math.cos(phi2); - double y2 = rho2 * Math.sin(phi2); - double fract = (START_RADIUS - rho1) / (rho2 - rho1); - double x = x1 + fract * (x2 - x1); - double y = y1 + fract * (y2 - y1); - double z = z1 + fract * (z2 - z1); - double phi = Math.atan2(y, x); - - if (phi < 0.) - phi += 2 * Math.PI; - rpz[0] = START_RADIUS; - rpz[1] = phi; - rpz[2] = z; - return rpz; - } - - public String getVPHitInfo() - { - makeDrawList(); - if (numDraw == 0) - return ""; - double sumP = 0.; - double sumPt = 0.; - - for (int i = 0; i < numDraw; ++i) - { - sumPt += Math.abs(pT[listdl[i]]); - double invLambda = (rho[1][listdl[i]] - rho[0][listdl[i]]) / (z[1][listdl[i]] - z[0][listdl[i]]); - sumP += Math.abs(pT[listdl[i]] / Math.cos(Math.atan(1. / invLambda))); - } - - String msg = numDraw + " " + getNameScreenName(); - msg += " sum(PT) = " + String.format("%.1f",sumPt) + " sum(P) = " + String.format("%.1f",sumP); - - return msg; - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A3Vector start = A3Vector.fromRhoPhiZ(rho[0][k], phi[0][k], z[0][k]); - A3Vector stop = A3Vector.fromRhoPhiZ(rho[1][k], phi[1][k], z[1][k]); - A3Vector v = (stop.subtract(start)).normalize(); - double p = pT[k] / Math.sqrt(1. - v.z * v.z); - sum.add(new A4Vector(v.scale(p), 0.)); - } - - return sum; - } - - private float[] getZ0() - { - for (int i = 0; i < numDraw; ++i) - { - int list = listdl[i]; - double[] poca = getPoca(list); - temp[list] = (float) poca[2]; - } - return temp; - } - - private float[] getZ0Primary() - { - double[] primary = event.getPrimaryVertex(); - double c = primary[2]; - for (int i = 0; i < numDraw; ++i) - { - int list = listdl[i]; - double[] poca = getPoca(list); - temp[list] = (float) (poca[2] - c); - } - return temp; - } - - private float[] getD0() - { - double[] primary = event.getPrimaryVertex(); - double a = primary[0]; - double b = primary[1]; - for (int i = 0; i < numDraw; ++i) - { - int list = listdl[i]; - double[] poca = getPoca(list); - temp[list] = (float) Math.hypot(a-poca[0], b-poca[1]); - } - return temp; - } - - private double[] getPoca(int i) - { - double[] primary = event.getPrimaryVertex(); - double a = primary[0]; - double b = primary[1]; - double xMin; - double yMin; - double zMin; - double dx = x[1][i] - x[0][i]; - if (dx == 0.) - { - xMin = x[0][i]; - yMin = b; - } - else - { - double m = (y[1][i] - y[0][i]) / dx; - double c = y[0][i] - m * x[0][i]; - xMin = (a + (b - c) * m) / (m * m + 1); - yMin = m * xMin + c; - } - double dz = z[1][i] - z[0][i]; - if (dz == 0.) - { - zMin = z[0][i]; - } - else - { - double mx = (x[1][i] - x[0][i]) / dz; - if (mx != 0.) - zMin = z[0][i] + (xMin - x[0][i]) / mx; - else - { - double my = (y[1][i] - y[0][i]) / dz; - if (my != 0.) - zMin = z[0][i] + (yMin - y[0][i]) / my; - else - zMin = z[0][i]; - } - } - return new double[] { xMin, yMin, zMin }; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ASTrData.java b/graphics/AtlantisJava/src/atlantis/data/ASTrData.java deleted file mode 100644 index aa8f6caa5d799ad6afbf18fd94eef53fb58441d2..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ASTrData.java +++ /dev/null @@ -1,254 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.utils.AHashMap; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; - -public class ASTrData extends ATrackData -{ - private static ALogger logger = ALogger.getLogger(ASTrData.class); - - public static final int UNDERLYING_EVENT = 0; - public static final int NORMAL = 1; - - protected int[] code; - protected int[] type; - protected int[] particleType; - protected int[] originVertex; - - public String getParameterGroup() - { - return "STr"; - } - - public String getName() - { - return "STr"; - } - - public String getNameScreenName() - { - return "SimChargedTrack"; - } - - ASTrData(AHashMap p, AEvent e) throws AAtlantisException - { - super(p,e); - code = p.getIntArray("code"); - originVertex = p.getIntArray("originVertex"); - type = p.getIntArray("type"); - particleType = new int[numData]; - for(int i = 0; i < numData; i++) - particleType[i] = APDGTable.getParticleType(code[i]); - } - - - public static AHashMap createSTr(AHashMap p) - { - float[] pt = p.getFloatArray("pt"); - float[] phi = p.getFloatArray("phi"); - float[] eta = p.getFloatArray("eta"); - float[] rhoVertex = p.getFloatArray("rhoVertex"); - float[] phiVertex = p.getFloatArray("phiVertex"); - float[] zVertex = p.getFloatArray("zVertex"); - int[] id = p.getIntArray("id"); - int[] code = p.getIntArray("code"); - //rhoEndVertex not available in older xml files - check that it exists first. - float[] rhoEndVertex = (p.get("rhoEndVertex") != null) ? p.getFloatArray("rhoEndVertex") : null; - //float[] phiEndVertex = (p.get("phiEndVertex") != null) ? p.getFloatArray("phiEndVertex") : null; - float[] zEndVertex = (p.get("zEndVertex") != null) ? p.getFloatArray("zEndVertex") : null; - - int numCharged = 0; - for(int i = 0; i < code.length; ++i) - { - int charge = code[i]; - - try - { - if(Math.abs(code[i]) >= 10 || Math.abs(code[i]) == 1) - // code is being used to store particle code - charge = APDGTable.getCharge(code[i]); - if(charge == 1 || charge == -1) - numCharged++; - } - catch(APDGTable.ParticleNotFoundError pnf){ - logger.debug(pnf.getMessage()); - } - } - - //Assign the vertices to the particle tracks - int[] simulatedVertex = ASVxData.assignVertexNumbers(phiVertex, rhoVertex, zVertex); - - //Now build subsets of the charged tracks only - int[] idC = new int[numCharged]; - int[] typeC = new int[numCharged]; - float[] rhoVertexC = new float[numCharged]; - float[] rhoEndVertexC = new float[numCharged]; - float[] phiVertexC = new float[numCharged]; - float[] zVertexC = new float[numCharged]; - float[] ptC = new float[numCharged]; - float[] phiC = new float[numCharged]; - float[] etaC = new float[numCharged]; - int[] chargeC = new int[numCharged]; - int[] codeC = new int[numCharged]; - int[] simulatedVertexC = new int[numCharged]; - - numCharged = 0; - for(int i = 0; i < code.length; ++i) - { - int charge = code[i]; - try - { - if(Math.abs(code[i]) >= 10 || Math.abs(code[i]) == 1) - // code is being used to store particle code - charge = APDGTable.getCharge(code[i]); - if(charge == 1 || charge == -1) - { - if(id[i] > 0) - { - idC[numCharged] = id[i]; - typeC[numCharged] = NORMAL; - } - else - { - // negative id is used to flag tracks belong to a second - // track bank which correspond to the underlyingEvent - // set id to zero as it is not a kine number - idC[numCharged] = 0; - typeC[numCharged] = UNDERLYING_EVENT; - } - //copy all the information - rhoVertexC[numCharged] = (float)(Math.sqrt(rhoVertex[i]*rhoVertex[i]-zVertex[i]*zVertex[i])); - //if there is no end vertex, fill with 0.0 as in XML file - rhoEndVertexC[numCharged] = (rhoEndVertex != null) ? (float)(Math.sqrt(rhoEndVertex[i]*rhoEndVertex[i]-zEndVertex[i]*zEndVertex[i])) : 0 ; - phiVertexC[numCharged] = phiVertex[i]; - zVertexC[numCharged] = zVertex[i]; - ptC[numCharged] = pt[i]; - //if (pt[i]>5) System.out.println(zVertex[i]); - phiC[numCharged] = phi[i]; - etaC[numCharged] = eta[i]; - codeC[numCharged] = code[i]; - chargeC[numCharged] = charge; - simulatedVertexC[numCharged] = simulatedVertex[i]; - numCharged++; - } - } - catch(APDGTable.ParticleNotFoundError pnf) - { - logger.debug(pnf.getMessage()); - } - } - - //Build a new hash map with the information for the - //charged tracks only - AHashMap newP = new AHashMap(12); - newP.put("numData", new Integer(numCharged)); - newP.put("id", idC); - newP.put("type", typeC); - newP.put("rhoVertex", rhoVertexC); - newP.put("rhoEndVertex", rhoEndVertexC); - newP.put("phiVertex", phiVertexC); - newP.put("zVertex", zVertexC); - newP.put("pt", ptC); - newP.put("phi", phiC); - newP.put("eta", etaC); - newP.put("code", codeC); - newP.put("charge", chargeC); - newP.put("originVertex", simulatedVertexC); - //return the new hasp map - return newP; - } - - - /** - * Get the vertex for which sum|Pt| is maximum - * @return the index of that vertex - */ - public int getMaxSumPtVertex() - { - /*** - * Triple loop can be avoided, e.g using hashmap, - * to tired to fix all this - S.B. - */ - - //get the highest vertex number - int maxVertex = 0; - - //by looping over all tracks and looking at the vertex number - for(int i = 0; i < numData; i++) - if(type[i] == NORMAL) - if(originVertex[i] > maxVertex) - maxVertex = originVertex[i]; - - //Now make an array to hold the sumPT for all vertices - double[] sumPt = new double[maxVertex + 1]; - - //Now loop again to add up all the pT - for(int i = 0; i < numData; i++) - if(type[i] == NORMAL && Math.abs(h[i].d0()) < 2.0) - sumPt[originVertex[i]] += Math.abs(h[i].pT()); - - //Yippee - lets loop once more to find the highest pT one - int VtxIndex = 0; - for(int i = 0; i < sumPt.length; i++) - if(sumPt[i] > sumPt[VtxIndex]) - VtxIndex = i; - - return VtxIndex; - } - - - - protected void applyCuts() - { - super.applyCuts(); - - // STr are always drawn as helices, check for tracks with rhoVertex - // beyond the diameter of InDet and don't draw those - super.cutRhoVertexAfterInDetRadius(); - - cut("CutsInDet", "STr", " STr id", id); - cut("CutsInDet", "STrCode", " STr code", code); - cut("CutsInDet", "STrType", " STr Type", particleType); - cut("CutsInDet", "SVx", " Vertex", originVertex); - } - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - switch (colorFunction) - { - case 0: - colorByConstant(); - break; - case 1: - colorByIndex(index); - break; - case 2: - colorBy(getPt()); - break; - case 3: - colorBy("ParticleColors", particleType); - break; - case 4: - colorBy(originVertex); - break; - } - - return 4; - } - - public String getHitInfo(int index) - { - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (barcode/id: " + id[index] + " index: " + index + ")"); - msg.append("\n Type = "+APDGTable.getName(code[index])); - msg.append(" (type code "); msg.append(code[index]); - msg.append(")"); msg.append(h[index].toString()); - - return msg.toString(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ASVxData.java b/graphics/AtlantisJava/src/atlantis/data/ASVxData.java deleted file mode 100644 index 87481919d2ad5c98d3f012fc36fd8667061ad691..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ASVxData.java +++ /dev/null @@ -1,167 +0,0 @@ -package atlantis.data; - - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.utils.*; -import java.util.*; - - -/** - * Simulated vertices - */ -public class ASVxData extends A3DPointData { - - // protected final String PARAMETER_GROUP = getParameterGroup(); - - - public String getParameterGroup() - { - return "SVx"; - } - - - public String getName() - { - return "SVx"; - } - - - public String getNameScreenName() - { - return "SimVertex"; - - } - - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+"\n"+ - AMath.RHO+" = "+String.format("%.3f",rho[index])+"\n "+ - "z = "+String.format("%.3f",z[index])+" cm\n"+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - return getNameScreenName() + " (id: " + id[index] + " index: " + index + ")" + - "\n x = " + String.format("%.5f",x[index]) + " cm" + - "\n y = " + String.format("%.5f",y[index]) + " cm" + - "\n z = " + String.format("%.5f",z[index]) + " cm" + - "\n " + AMath.RHO + " = " + String.format("%.5f",rho[index]) + " cm" + - "\n " + AMath.PHI + " = " + - String.format("%.5f",Math.toDegrees(phi[index])) + AMath.DEGREES + - " (" + String.format("%.5f",phi[index]) + " rad)"; - - } // getHitInfo() -------------------------------------------------------- - - - - ASVxData(AHashMap p, AEvent e) { - super(p,e); - } - - // SVx do not come correctly in input xml file - // must create them from STr data in xml file - public static AHashMap createSVx(AHashMap p) { - float[] rhoVertex=p.getFloatArray("rhoVertex"); - float[] phiVertex=p.getFloatArray("phiVertex"); - float[] zVertex=p.getFloatArray("zVertex"); - int[] sv=ASVxData.assignVertexNumbers(phiVertex, rhoVertex, zVertex); - int numVertex=0; - - for(int i=0; i<sv.length; i++) - if(sv[i]>=numVertex) numVertex=sv[i]+1; - - float[] rho=new float[numVertex]; - float[] phi=new float[numVertex]; - float[] z=new float[numVertex]; - - for(int i=0; i<sv.length; i++) { - rho[sv[i]]=(float)(Math.sqrt(rhoVertex[i]*rhoVertex[i]-zVertex[i]*zVertex[i])); - phi[sv[i]]=phiVertex[i]; - z[sv[i]]=zVertex[i]; - } - - AHashMap newP=new AHashMap(4); - - newP.put("numData", new Integer(numVertex)); - newP.put("rho", rho); - newP.put("phi", phi); - newP.put("z", z); - return newP; - } - - public static int[] assignVertexNumbers(float[] phi, float[] rho, float[] z) { - int[] sv=new int[phi.length]; - Vertex[] key=new Vertex[phi.length]; - - HashMap vertices=new HashMap(); - -// this is ugly, related to the fact that id[i]=i+1 by default; - int num=1; - for(int i=0; i<sv.length; i++) { - key[i]=new Vertex(rho[i], phi[i], z[i]); - Object value=vertices.get(key[i]); - if(value==null) { - sv[i]=num; - vertices.put(key[i], new Integer(num++)); - } else { - sv[i]=((Integer)value).intValue(); - } - } - return sv; - } - - protected int internalColor() { - colorByConstant(); - return 1; - } - - protected void applyCuts() { - cutIndex(); - cutPhi(phi); - cutEta(rho, z); - cut("CutsInDet", "SVx", " Vertex", id); - } - - - public double[] getVertex(int index) { - - double[] vertex=new double[3]; - - if(index>-1&&index<numData) { - vertex[0]=x[index]; - vertex[1]=y[index]; - vertex[2]=z[index]; - } - return vertex; - } - -} - - -class Vertex { - float x; - float y; - float z; - int hashcode; - - Vertex(float x, float y, float z) { - this.x=x; - this.y=y; - this.z=z; - hashcode=Float.floatToIntBits(z); - } - - @Override - public int hashCode() { - return hashcode; - } - - @Override - public boolean equals(Object a) { - if(!(a instanceof Vertex)) return false; - Vertex b=(Vertex)a; - return x==b.x&&y==b.y&&z==b.z; - } -} - diff --git a/graphics/AtlantisJava/src/atlantis/data/ASegmentData.java b/graphics/AtlantisJava/src/atlantis/data/ASegmentData.java deleted file mode 100755 index d999effdb0b26e65b6743d6086a05ec077f14d16..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ASegmentData.java +++ /dev/null @@ -1,164 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjectionXZ; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -/** - * Generic track segment class. - * - * @author Eric Jansen - */ -public abstract class ASegmentData extends AData { - - protected float[] x; - protected float[] y; - protected float[] z; - protected float[] theta; - protected float[] phi; - protected int[] hits; - protected int[] numHits; - - ASegmentData(AHashMap p, AEvent e) { - super(p,e); - - x = p.getFloatArray("x"); - y = p.getFloatArray("y"); - z = p.getFloatArray("z"); - phi = p.getFloatArray("phi"); - theta = p.getFloatArray("theta"); - numHits = p.getIntArray("numHits"); - - hits = p.getIntArray("hits"); - } - - protected int internalColor() { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - switch(colorFunction) { - case 0: - colorByConstant(); - break; - case 1: - colorByIndex(); - break; - } - - return 1; - } - - - protected void applyCuts() - { - cutIndex(); - - } - - - public String getHitInfo(int index) { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+"\n"+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - - return getName() + " (index: " + index + ")\n" - + " storegate key = " + storeGateKey + "\n" - + " " + AMath.PHI + " = " + String.format("%.3f",Math.toDegrees(phi[index])) - + " (" + String.format("%.3f",phi[index]) + " rad)" + "\n" - + " tL = " + String.format("%.3f",Math.toDegrees(1./Math.tan(theta[index]))) + "\n" - + " x = " + String.format("%.3f",x[index]) + " cm\n" - + " y = " + String.format("%.3f",y[index]) + " cm\n" - + " z = " + String.format("%.3f",z[index]) + " cm\n" - + " hits = " + numHits[index] + "\n"; - } - - protected ACoord getYXUser() { - makeDrawList(); - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - double length = parameterStore.get(PARAMETER_GROUP, "SegmentLength").getD(); - - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - - double dx = length * Math.sin(theta[j]) * Math.cos(phi[j]); - double dy = length * Math.sin(theta[j]) * Math.sin(phi[j]); - - hv[0][i] = new double [] {x[j]-dx, x[j]-dx/2., x[j], x[j]+dx/2., x[j]+dx}; - hv[1][i] = new double [] {y[j]-dy, y[j]-dy/2., y[j], y[j]+dy/2., y[j]+dy}; - - index[i] = j; - } - - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES); - } - - protected ACoord getFRUser() { - return getYXUser().convertYXToFR().includePhiWrapAround("FR"); - } - - protected ACoord getRZUser() { - makeDrawList(); - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - double length = parameterStore.get(PARAMETER_GROUP, "SegmentLength").getD(); - - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - - double dx = length * Math.sin(theta[j]) * Math.cos(phi[j]); - double dy = length * Math.sin(theta[j]) * Math.sin(phi[j]); - double dz = length * Math.cos(theta[j]); - - int sign = AParameterUtilities.getRhoSign(x[j], y[j]); - - hv[0][i] = new double [] {z[j]-dz, z[j]+dz}; - hv[1][i] = new double [] { - sign * Math.hypot(x[i]-dx, y[i]-dy), - sign * Math.hypot(x[i]+dx, y[i]+dy) - }; - - index[i] = j; - } - - return new ACoord(hv, index, this, ACoord.POLYLINES); - } - - protected ACoord getXZUser() { - makeDrawList(); - - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - double length = parameterStore.get(PARAMETER_GROUP, "SegmentLength").getD(); - double phi0 = Math.toRadians(AProjectionXZ.getPhi()); - - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - - double dx = length * Math.sin(theta[j]) * Math.cos(phi[j]); - double dy = length * Math.sin(theta[j]) * Math.sin(phi[j]); - double dz = length * Math.cos(theta[j]); - - double s = x[j] * Math.cos(phi0) + y[j] * Math.sin(phi0); - double ds = dx * Math.cos(phi0) + dy * Math.sin(phi0); - - if (z[j] < 0) { - hv[0][i] = new double [] {z[j]+dz, z[j]-dz}; - hv[1][i] = new double [] {s-ds, s+ds}; - } else { - hv[0][i] = new double [] {z[j]-dz, z[j]+dz}; - hv[1][i] = new double [] {s-ds, s+ds}; - } - - index[i] = j; - } - - return new ACoord(hv, index, this, ACoord.POLYLINES); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ASiClusterData.java b/graphics/AtlantisJava/src/atlantis/data/ASiClusterData.java deleted file mode 100644 index 83cc0f98026120928d389a12a654025319c5ee52..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ASiClusterData.java +++ /dev/null @@ -1,385 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjectionVP; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - -/** - * SiCluster - Silicon clusters, reads in STC datatype from event file - */ -public class ASiClusterData extends AHitData -{ - // read in from event file - private float[][] x; - private float[][] y; - private float[][] z; - private float[] width; - private int[] etaModule; - private int[] phiModule; - private int[] side; - - // calculated - private float[][] rho; - private float[][] phi; - private int[] layer; - - public static final int U_CLUSTER = -1; - public static final int PHI_CLUSTER = 0; - public static final int V_CLUSTER = 1; - public static final int ENDCAP_MINUS = 0; - public static final int BARREL = 1; - public static final int ENDCAP_PLUS = 2; - - - public String getParameterGroup() - { - return "SiCluster"; - } - - public String getName() - { - return "SiCluster"; - } - - public String getNameScreenName() - { - return "SCT_Cluster"; - } - - public float[][] getX() - { - return x; - } - - public float[][] getY() - { - return y; - } - - public float[][] getZ() - { - return z; - } - - - - ASiClusterData(AHashMap p, AEvent e) - { - super(p,e); - x = new float[][] { p.getFloatArray("x0"), p.getFloatArray("x1") }; - y = new float[][] { p.getFloatArray("y0"), p.getFloatArray("y1") }; - z = new float[][] { p.getFloatArray("z0"), p.getFloatArray("z1") }; - width = p.getFloatArray("width"); - - rho = new float[2][numData]; - phi = new float[2][numData]; - - layer = new int[numData]; - for (int i = 0; i < numData; ++i) - { - sub[i] = getSub(id[i]); - layer[i] = getLayer(id[i]); - } - - etaModule = (p.get("etaModule") != null) ? p.getIntArray("etaModule") : null; - phiModule = (p.get("phiModule") != null) ? p.getIntArray("phiModule") : null; - side = (p.get("side") != null) ? p.getIntArray("side") : null; - - } // ASiClusterData() --------------------------------------------------- - - - - protected void calculateRhoPhi() - { - - calculateRhoPhi(x[0], y[0], rho[0], phi[0]); - calculateRhoPhi(x[1], y[1], rho[1], phi[1]); - // treat wraparound - for (int i = 0; i < numData; ++i) - { - if (Math.abs(phi[1][i] - phi[0][i]) > Math.PI) - { - if (phi[1][i] - phi[0][i] > 0) - { - phi[0][i] += AMath.TWO_PI; - } - else - { - phi[1][i] += AMath.TWO_PI; - } - } - } // for - } // calculateRhoPhi() -------------------------------------------------- - - private void cutSubdetector() - { - AParameter par = parameterStore.get("CutsInDet", "SCT"); - if (par.getI() != -1) - { - cutArray(sub, par.getI(), "Barrel/Endcap"); - } - } // cutSubdetector() --------------------------------------------------- - - - protected void applyCuts() - { - cutIndex(); - cutOrientation(); - cutSubdetector(); - cut("CutsInDet", "Layer", "Layer", layer); - cutSimulatedTracks(); - cutReconstructedTracks(); - cutPhi(phi[0]); - cutEta(); - } // applyCuts() -------------------------------------------------------- - - private void cutEta() - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - if (!par.getStatus()) - return; - double etaCut = par.getD(); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaLowerCut = etaMid - etaCut; - double etaUpperCut = etaMid + etaCut; - int num = 0; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double eta1 = AParameterUtilities.eta(z[0][list], rho[0][list]); - double eta2 = AParameterUtilities.eta(z[1][list], rho[1][list]); - double etaLower = Math.min(eta1, eta2); - double etaUpper = Math.max(eta1, eta2); - if (etaUpper > etaLowerCut && etaLower < etaUpperCut) - listdl[num++] = list; - } - numDraw = num; - } // cutEta() ----------------------------------------------------------- - - public int getLayer(int id) - { - int layer = (id & 0x01e00000) >> 21; - int sub = getSub(id); - if (sub == BARREL) - { - layer += 3; - } - else - { - layer += 11; - } - return layer; - } // getLayer() --------------------------------------------------------- - - public int getSub(int id) - { - return (id & 0x06000000) >> 25; - } // getSub() ----------------------------------------------------------- - - public int getOrientation(int id) - { - int side = (id & 0x400) >> 10; - int sub = getSub(id); - if ((side == 1 && sub == BARREL) || (side == 0 && sub != BARREL)) - { - return PHI_CLUSTER; - } - - int layer = getLayer(id); - if (layer % 2 == 1) - { - return U_CLUSTER; - } - - return V_CLUSTER; - } // getOrientation() --------------------------------------------------- - - protected void cutOrientation() - { - int num = 0; - AParameter stereoAnglePar = parameterStore.get("SiCluster", "Stereo"); - if (!stereoAnglePar.getStatus()) - { - return; - } - int orientation = stereoAnglePar.getI(); - for (int i = 0; i < numDraw; i++) - { - // only works for barrel for now !!!! - // if( getSub(id[listdl[i]])==BARREL && - // orientation==getOrientation(id[listdl[i]])) - if (orientation == getOrientation(id[listdl[i]])) - { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } // cutOrientation() --------------------------------------------------- - - protected int internalColor() - { - int numColorTypes = super.internalColor(); - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - if (colorFunction == numColorTypes + 1) - { - colorBy(layer); - } - else if (colorFunction == numColorTypes + 2) - { - colorByOrientation(); - } - - return numColorTypes + 2; - } // internalColor() ---------------------------------------------------- - - protected void colorByOrientation() - { - int numColors = parameterStore.get("HitColors", "Number").getI(); - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for (int i = 0; i < numData; i++) - { - color[i] = (byte) col[getOrientation(id[i]) + 1 % numColors]; - } - } // colorByOrientation() ----------------------------------------------- - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index; - - String temp = getNameScreenName() + " (id: " + id[index] + " index: " + index +")\n" + - " orientation = " + getOrientation(id[index]); - temp += "\n x = " + x[0][index] + " " + x[1][index]; - temp += "\n y = " + y[0][index] + " " + y[1][index]; - temp += "\n z = " + z[0][index] + " " + z[1][index]; - temp += "\n " + AMath.RHO + " = " + rho[0][index] + " " + rho[1][index]; - temp += "\n " + AMath.ETA + " module = "; - temp += (etaModule != null) ? Integer.toString(etaModule[index]) : "n/a"; - temp += "\n " + AMath.PHI + " module = "; - temp += (phiModule != null) ? Integer.toString(phiModule[index]) : "n/a"; - temp += "\n side = "; - temp += (side != null) ? Integer.toString(side[index]) : "n/a"; - temp += "\n width = "; - temp += (width != null) ? Float.toString(width[index]) : "n/a"; - - temp += super.getHitInfo(index); // finds barcode information - - return temp; - } // getHitInfo() ------------------------------------------------------- - - protected ACoord getYXUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for (int j = 0; j < 2; j++) - { - hv[0][j][i] = x[j][list]; - hv[1][j][i] = y[j][list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } // getYXUser() -------------------------------------------------------- - - protected ACoord getRZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiDiff = Math.abs(phi[1][list] - phiMid); - double sign; - if (phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - { - sign = +1.; - } - else - { - sign = -1.; - } - - for (int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = sign * rho[j][list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } // getRZUser() -------------------------------------------------------- - - protected ACoord getFRUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for (int j = 0; j < 2; j++) - { - hv[0][j][i] = rho[j][list]; - hv[1][j][i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[j][list], phi[j][list], z[j][list])); - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES).includePhiWrapAround("FR"); - } // getFRUser() -------------------------------------------------------- - - protected ACoord getFZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for (int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[j][list], phi[j][list], z[j][list])); - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES).includePhiWrapAround("FZ"); - } // getFZUser() -------------------------------------------------------- - - protected ACoord getVPUser() - { - makeDrawList(); - int numTotal = 2 * numDraw; - double[][][] hv = new double[2][numTotal][2]; - int[] index = new int[numTotal]; - double[] sign = new double[] { -1., 1. }; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for (int k = 0; k < 2; k++) - { - double deltaEta = AProjectionVP.getDeltaEta(rho[k][list], z[k][list]); - double eta = AParameterUtilities.eta(z[k][list], rho[k][list]); - for (int j = 0; j < 2; j++) - { - hv[0][2 * i + j][k] = eta + sign[j] * deltaEta; - hv[1][2 * i + j][k] = Math.toDegrees(phi[k][list]); - index[2 * i + j] = list; - } - } - } - return new ACoord(hv, index, this, ACoord.POLYLINES).includePhiWrapAround("VP"); - } // getVPUser() -------------------------------------------------------- - -} // class ASiClusterData =================================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/ASiClusterRDOData.java b/graphics/AtlantisJava/src/atlantis/data/ASiClusterRDOData.java deleted file mode 100644 index ac1806b4cb14bb43cd6cebbaef579ffe3bf2ce7f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ASiClusterRDOData.java +++ /dev/null @@ -1,481 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjectionVP; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - - -/** - * Silicon clusters RDO Raw Data Objects (class derived from ASiClusterData) - * Parameters expected in the event file for SCTRDO datatype: - * x0|x1|y0|y1|z0|z1|phiModule|etaModule|id|BCIDError|firstHitError| - * formatterError|lvl1Error|preambleError|secondHitError|syncError|timeBin - * - */ -public class ASiClusterRDOData extends AHitData -{ - private float[][] x = null; - private float[][] y = null; - private float[][] z = null; - private int[] etaModule = null; - private int[] phiModule = null; - private int[] BCIDError = null; - private int[] firstHitError = null; - private int[] formatterError = null; - private int[] lvl1Error = null; - private int[] preambleError = null; - private int[] secondHitError = null; - private int[] syncError = null; - private int[] timeBin = null; - // calculated here - private int[] layer; - private float[][] rho; - private float[][] phi; - - public static final int U_CLUSTER = -1; - public static final int PHI_CLUSTER = 0; - public static final int V_CLUSTER = 1; - public static final int ENDCAP_MINUS = 0; - public static final int BARREL = 1; - public static final int ENDCAP_PLUS = 2; - - - - public String getParameterGroup() - { - return "SiClusterRDO"; - - } // getParameterGroup() ------------------------------------------------ - - - - public String getName() - { - return "SiClusterRDO"; - - } // getName() ---------------------------------------------------------- - - - - public String getNameScreenName() - { - return "SiClusterRDO"; - - } // getNameScreenName() ------------------------------------------------ - - - - ASiClusterRDOData(AHashMap p, AEvent e) - { - super(p,e); - x = new float[][] - { p.getFloatArray("x0"), p.getFloatArray("x1") }; - y = new float[][] - { p.getFloatArray("y0"), p.getFloatArray("y1") }; - z = new float[][] - { p.getFloatArray("z0"), p.getFloatArray("z1") }; - etaModule = p.getIntArray("etaModule"); - phiModule = p.getIntArray("phiModule"); - BCIDError = p.getIntArray("BCIDError"); - firstHitError = p.getIntArray("firstHitError"); - formatterError = p.getIntArray("formatterError"); - lvl1Error = p.getIntArray("lvl1Error"); - preambleError = p.getIntArray("preambleError"); - secondHitError = p.getIntArray("secondHitError"); - syncError = p.getIntArray("syncError"); - timeBin = p.getIntArray("timeBin"); - rho = new float[2][numData]; - phi = new float[2][numData]; - layer = new int[numData]; - - for(int i = 0; i < numData; ++i) - { - sub[i] = getSub(id[i]); - layer[i] = getLayer(id[i]); - } - - } // ASiClusterRDOData() ------------------------------------------------ - - - protected void calculateRhoPhi() - { - calculateRhoPhi(x[0], y[0], rho[0], phi[0]); - calculateRhoPhi(x[1], y[1], rho[1], phi[1]); - // treat wraparound - for(int i = 0; i < numData; ++i) - { - if(Math.abs(phi[1][i] - phi[0][i]) > Math.PI) - { - if(phi[1][i] - phi[0][i] > 0) - { - phi[0][i] += AMath.TWO_PI; - } - else - { - phi[1][i] += AMath.TWO_PI; - } - } - } - - } // calculateRhoPhi() -------------------------------------------------- - - - - private void cutSubdetector() - { - AParameter par = parameterStore.get("CutsInDet", "SCT"); - if(par.getI() != -1) - { - cutArray(sub, par.getI(), "Barrel/Endcap"); - } - - } // cutSubdetector() --------------------------------------------------- - - - protected void applyCuts() - { - cutIndex(); - cutOrientation(); - cutSubdetector(); - cut("CutsInDet", "Layer", "Layer", layer); - cutPhi(phi[0]); - cutEta(); - - } // applyCuts() -------------------------------------------------------- - - - - private void cutEta() - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - if(!par.getStatus())return; - double etaCut = par.getD(); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaLowerCut = etaMid - etaCut; - double etaUpperCut = etaMid + etaCut; - int num = 0; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double eta1 = AParameterUtilities.eta(z[0][list], rho[0][list]); - double eta2 = AParameterUtilities.eta(z[1][list], rho[1][list]); - double etaLower = Math.min(eta1, eta2); - double etaUpper = Math.max(eta1, eta2); - if(etaUpper > etaLowerCut && etaLower < etaUpperCut) - listdl[num++] = list; - } - numDraw = num; - - } // cutEta() ----------------------------------------------------------- - - - - public int getLayer(int id) - { - int layer = (id & 0x01e00000) >> 21; - int sub = getSub(id); - if(sub == BARREL) - layer += 3; - else - layer += 11; - return layer; - - } // getLayer() --------------------------------------------------------- - - - - public int getSub(int id) - { - return(id & 0x06000000) >> 25; - - } // getSub() ----------------------------------------------------------- - - - - public int getOrientation(int id) - { - int side = (id & 0x400) >> 10; - int sub = getSub(id); - if((side == 1 && sub == BARREL) || (side == 0 && sub != BARREL)) - { - return PHI_CLUSTER; - } - int layer = getLayer(id); - if(layer % 2 == 1)return U_CLUSTER; - return V_CLUSTER; - - } // getOrientation() --------------------------------------------------- - - - - protected void cutOrientation() - { - int num = 0; - AParameter stereoAnglePar = parameterStore.get("SiCluster", "Stereo"); - if(!stereoAnglePar.getStatus()) - { - return; - } - int orientation = stereoAnglePar.getI(); - for(int i = 0; i < numDraw; i++) - // only works for barrel for now !!!! - // if( getSub(id[listdl[i]])==BARREL && orientation==getOrientation(id[listdl[i]])) - if(orientation == getOrientation(id[listdl[i]])) - { - listdl[num++] = listdl[i]; - } - numDraw = num; - - } // cutOrientation() --------------------------------------------------- - - - - /** - * parameter InDet -> SiClusterRDO -> Color Function: - * pv="Constant = 0, Error = 1, Orientation = 2" - */ - protected int internalColor() - { - // it's usual to call this method from mother class, but in this case - // it uses it's own colour types co we don't care about AHitData - // int numColorTypes = super.internalColor(); - - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if(colorFunction == 0) - { - colorByConstant(); - } - else if(colorFunction == 1) - { - colorByError(); - } - else if(colorFunction == 2) - { - colorByOrientation(); - } - - // 3 colour schemes exist here - return 3; - - } // internalColor() ---------------------------------------------------- - - - - /** - * colour elements by error (error subtags from the event file): - * BCIDError, firstHitError, formatterError, lvl1Error, preambleError, - * secondHitError, syncError ] - * if any of these flags is set to true, the element is considered erroneous - * (next iteration may be to colour by error type, if they want it ...) - */ - protected void colorByError() - { - int constantColor = parameterStore.get(PARAMETER_GROUP, "Constant").getI(); - int errorColor = parameterStore.get(PARAMETER_GROUP, "Error").getI(); - - for(int i = 0; i < numData; i++) - { - if(BCIDError[i] != 0 || firstHitError[i] != 0 || - formatterError[i] != 0 || lvl1Error[i] != 0 || - preambleError[i] != 0 || secondHitError[i] != 0 || - syncError[i] != 0) - { - // element is erroneous - color[i] = (byte) errorColor; - } - else - { - color[i] = (byte) constantColor; - } - } - - } // colorByError() ----------------------------------------------------- - - - - protected void colorByOrientation() - { - int numColors = parameterStore.get("HitColors", "Number").getI(); - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for(int i = 0; i < numData; i++) - { - color[i] = (byte) col[getOrientation(id[i]) + 1 % numColors]; - } - - } // colorByOrientation() ----------------------------------------------- - - - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index; - - String temp = getNameScreenName() + " (id: " + id[index] + " index: " + index + ")\n" + - " orientation = " + getOrientation(id[index]) + "\n" + - " x = " + x[0][index] + " " + x[1][index] + "\n" + - " y = " + y[0][index] + " " + y[1][index] + "\n" + - " z = " + z[0][index] + " " + z[1][index] + "\n" + - " " + AMath.RHO + " = " + rho[0][index] + " " + - rho[1][index] + "\n" + - " " + AMath.ETA + " module = " + etaModule[index] + "\n" + - " " + AMath.PHI + " module = " + phiModule[index] + "\n" + - " BCID error = " + BCIDError[index] + "\n" + - " first hit error = " + firstHitError[index] + "\n" + - " formatter error = " + formatterError[index] + "\n" + - " lvl1 error = " + lvl1Error[index] + "\n" + - " preamble error = " + preambleError[index] + "\n" + - " second hit error = " + secondHitError[index] + "\n" + - " sync error = " + syncError[index] + "\n" + - " time bin = " + timeBin[index]; - return temp; - - } // getHitInfo() ------------------------------------------------------- - - - - protected ACoord getYXUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for(int j = 0; j < 2; j++) - { - hv[0][j][i] = x[j][list]; - hv[1][j][i] = y[j][list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - - } // getYXUser() -------------------------------------------------------- - - - - protected ACoord getRZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double phiDiff = Math.abs(phi[1][list] - phiMid); - double sign; - if(phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - { - sign = +1.; - } - else - { - sign = -1.; - } - for(int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = sign * rho[j][list]; - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - - } // getRZUser() -------------------------------------------------------- - - - - protected ACoord getFRUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for(int j = 0; j < 2; j++) - { - hv[0][j][i] = rho[j][list]; - hv[1][j][i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[j][list], phi[j][list], - z[j][list])); - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES).includePhiWrapAround("FR"); - - } // getFRUser() -------------------------------------------------------- - - - - protected ACoord getFZUser() - { - makeDrawList(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - for(int j = 0; j < 2; j++) - { - hv[0][j][i] = z[j][list]; - hv[1][j][i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[j][list], phi[j][list], - z[j][list])); - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES).includePhiWrapAround("FZ"); - - } // getFZUser() -------------------------------------------------------- - - - - protected ACoord getVPUser() - { - makeDrawList(); - int numTotal = 2 * numDraw; - int numPoints = 10; - double[][][] hv = new double[2][numTotal][numPoints]; - int[] index = new int[numTotal]; - double[] sign = new double[] - { -1., 1.}; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double xx = x[0][list]; - double delx = (x[1][list] - x[0][list]) / (numPoints - 1); - double yy = y[0][list]; - double dely = (y[1][list] - y[0][list]) / (numPoints - 1); - double zz = z[0][list]; - double delz = (z[1][list] - z[0][list]) / (numPoints - 1); - for(int k = 0; k < numPoints; k++) - { - double xxx = xx + k * delx; - double yyy = yy + k * dely; - double zzz = zz + k * delz; - double rrr = Math.sqrt(xxx * xxx + yyy * yyy); - double ppp = Math.atan2(yyy, xxx); - double deltaEta = AProjectionVP.getDeltaEta(rrr, zzz); - double eta = AParameterUtilities.eta(zzz, rrr); - for(int j = 0; j < 2; j++) - { - hv[0][2 * i + j][k] = eta + sign[j] * deltaEta; - hv[1][2 * i + j][k] = Math.toDegrees(ppp); - index[2 * i + j] = list; - } - } - } - return new ACoord(hv, index, this, ACoord.POLYLINES). includePhiWrapAround("VP"); - - } // getVPUser() -------------------------------------------------------- - - -} // class ASiClusterRDOData ================================================ diff --git a/graphics/AtlantisJava/src/atlantis/data/ATGCData.java b/graphics/AtlantisJava/src/atlantis/data/ATGCData.java deleted file mode 100755 index e0005dce948e227e049bb0d254a529a05e5c7a8e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ATGCData.java +++ /dev/null @@ -1,340 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.graphics.ACoord; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AParameterUtilities; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; - -public class ATGCData extends AMuonHitData -{ - float[] swidth; - float[] lwidth; - float[] length; - int[] gasGap; - - private static ALogger logger = ALogger.getLogger(ATGCData.class); - - public String getParameterGroup() - { - return "TGC"; - } - - public String getName() - { - return "TGC"; - } - - public String getNameScreenName() - { - return "TGC"; - } - - ATGCData(AHashMap p, AEvent e) - { - super(p,e); - swidth = p.getFloatArray("swidth"); - length = p.getFloatArray("length"); - lwidth = p.getFloatArray("lwidth"); - gasGap = new int[numData]; - for (int i = 0; i < numData; i++) - gasGap[i] = getGasGap(i); - } - - protected int getStation(int index) - { - try { - String stationName = AIdHelper.stationName(id[index]); - return (stationName.charAt(1) - '0') % 4; - } catch (AAtlantisException e) { - logger.error("Problem decoding TGC identifier", e); - } - - return 0; - } - - protected int getSub(int index) - { - try { - if (AIdHelper.stationEta(id[index]) < 0) { - return 0; - } else { - return 1; - } - - } catch (AAtlantisException e) { - logger.error("Problem decoding TGC identifier", e); - } - - return 0; - } - - public int getSector(int index) - { - try { - String stationName = AIdHelper.stationName(id[index]); - int stationPhi = AIdHelper.stationPhi(id[index]); - - int retval; - if (stationName.equals("T4E")) { - int temp = stationPhi % 24; - retval = 2 * (temp / 3); - } else if (stationName.charAt(2) == 'F') { - int temp = stationPhi % 24; - retval = 2 * (temp / 3); - if (temp % 3 > 1) retval += 1; - } else { - int temp = (stationPhi + 1) % 48; - retval = 2 * (temp / 6); - if (temp % 6 > 3) retval += 1; - } - return retval; - - } catch (AAtlantisException e) { - logger.error("Problem decoding TGC identifier", e); - } - - return 0; - - } - - protected int getGasGap(int index) - { - try { - return AIdHelper.tgcGasGap(id[index]); - } catch (AAtlantisException e) { - logger.error("Problem decoding TGC identifier", e); - } - - return 0; - } - - protected boolean getMeasuresPhi(int index) - { - try { - if (AIdHelper.tgcIsStrip(id[index]) == 1) { - return true; - } - } catch (AAtlantisException e) { - logger.error("Problem decoding TGC identifier", e); - } - - return false; - } - - public void applyCuts() - { - super.applyCuts(); - if (parameterStore.get("CutsATLAS", "CutPhi").getStatus()) - cutPhi(phi, getDPhi()); - if (parameterStore.get("CutsATLAS", "CutEta").getStatus()) - cutEtaDRho(rho, z, getDRho()); - } - - // used for cuts - - private float[] getDPhi() - { - // only roughly correct - // must create all - float[] dphi = new float[numData]; - - // need only fill for those in draw list - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - dphi[list] = (float) Math.abs(Math.atan2((swidth[list] + lwidth[list]) / 4., rho[list])); - } - return dphi; - } - - // used for cuts - - private float[] getDRho() - { - // only roughly correct - // must create all - float[] drho = new float[numData]; - - // need only fill for those in draw list - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - drho[list] = (float) (length[list] / 2.); - } - return drho; - } - - protected ACoord getFZUser() - { - makeDrawList(); - cutArray(measuresPhi, true, " Strip"); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - index[i] = list; - double deltaPhi = ((swidth[list] + lwidth[list]) / 4.) / rho[list]; - - hv[0][0][i] = z[list]; - hv[1][0][i] = Math.toDegrees(phi[list] - deltaPhi); - hv[0][1][i] = z[list]; - hv[1][1][i] = Math.toDegrees(phi[list] + deltaPhi); - } - return new ACoord(hv, index, this, ACoord.LINES).includePhiWrapAround("FZ"); - } - - private void makeDrawListYX() - { - int mode = parameterStore.get("YX", "Mode").getI(); - - if (mode == 0 || mode >= 5) - { - numDraw = 0; - } - else - { - makeDrawList(); - int num = 0; - - for (int i = 0; i < numDraw; ++i) - if (mode == station[listdl[i]] + 1) - listdl[num++] = listdl[i]; - numDraw = num; - } - cut("YX", "TGCGasGap", " TGC Gas Gap", gasGap); - } - - protected ACoord getYXUser() - { - return getYXUser(0); - } - - protected ACoord getYXUser(int flag) - { - makeDrawListYX(); - int[] split = { 6, 1, 6, 1 }; - int numPoints = 4; - boolean splitIt = parameterStore.get("YX", "FishEye").getStatus() || flag == 1; - - if (splitIt) - numPoints = 14; - double[] temp = new double[4]; - double[][][] hv = new double[2][numDraw][numPoints]; - int[] index = new int[numDraw]; - - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - - index[i] = list; - double cosPhi = Math.cos(phi[list]); - double sinPhi = Math.sin(phi[list]); - double rMid = rho[list]; - double dR = length[list] / 2.; - double r = rMid - dR; - double d = swidth[list] / 2.; - double x = r * cosPhi; - double y = r * sinPhi; - double dx = d * sinPhi; - double dy = d * cosPhi; - - hv[0][i][0] = x + dx; - hv[1][i][0] = y - dy; - hv[0][i][1] = x - dx; - hv[1][i][1] = y + dy; - r = rMid + dR; - x = r * cosPhi; - y = r * sinPhi; - d = lwidth[list] / 2.; - dx = d * sinPhi; - dy = d * cosPhi; - hv[0][i][2] = x - dx; - hv[1][i][2] = y + dy; - hv[0][i][3] = x + dx; - hv[1][i][3] = y - dy; - if (splitIt) - for (int j = 0; j < 2; ++j) - { - for (int k = 0; k < 4; ++k) - temp[k] = hv[j][i][k]; - AMath.splitArrayIntoPieces(temp, hv[j][i], split); - } - } - return new ACoord(hv, index, this); - } - - protected ACoord getFRUser() - { - return getYXUser(1).convertYXToFR().includePhiWrapAround("FR"); - } - - protected ACoord getXZRZUser(int sign[]) - { - double[][][] hv = new double[2][numDraw][]; - int index[] = new int[numDraw]; - - try { - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - index[i] = j; - - double rho = Math.sqrt(x[j]*x[j] + y[j]*y[j]); - - if (AIdHelper.tgcIsStrip(id[j]) == 1) { - double drho = length[j]/2.; - hv[0][i] = new double[] { z[j], z[j] }; - hv[1][i] = new double[] { sign[i] * (rho - drho), - sign[i] * (rho + drho) }; - } else { - hv[0][i] = new double[] { z[j] }; - hv[1][i] = new double[] { sign[i] * rho }; - } - } - - return new ACoord(hv, index, this); - } catch (AAtlantisException e) { - AOutput.append("Error decoding TGC identifier: " + e.getMessage(), ALogInterface.BAD_COMMAND); - return ACoord.NO_DATA; - } - } - - protected ACoord getXZUser() { - makeDrawList(); - cutMuonSector(sector); - - int[] sign = new int[numDraw]; - int sect = (int) Math.round(parameterStore.get("XZ", "Phi").getD() / 22.5); - - for(int i=0; i<numDraw; i++) { - if (sector[listdl[i]] == sect) - sign[i] = 1; - else - sign[i] = -1; - } - - return getXZRZUser(sign); - } - - protected ACoord getRZUser() { - makeDrawList(); - - int[] sign = new int[numDraw]; - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - sign[i] = AParameterUtilities.getRhoSign(x[j], y[j]); - } - - return getXZRZUser(sign); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ATILEData.java b/graphics/AtlantisJava/src/atlantis/data/ATILEData.java deleted file mode 100755 index 99bc22c7daacb2b21f8d7f53dfaf8cbddb9ce6c6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ATILEData.java +++ /dev/null @@ -1,843 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; -import java.io.FileNotFoundException; - -import com.Ostermiller.util.CSVParser; - -import atlantis.geometry.ACalorimeterDetector; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.AMath; -import atlantis.utils.AUtilities; -import atlantis.utils.ALogger; - - -/** - * The TILE hadronic calorimeter. - * - * @author Eric Jansen - */ -public class ATILEData extends ACalorimeterData -{ - private static ALogger logger = ALogger.getLogger(ATILEData.class); - - // data for real pulse shapes plots - private float[] pmt1Energy = null; - private float[] pmt2Energy = null; - private float[] pmt1Chi2 = null; - private float[] pmt2Chi2 = null; - private float[] pmt1Time = null; - private float[] pmt2Time = null; - private float[] pmt1RawTime = null; - private float[] pmt2RawTime = null; - private float[] pmt1RawAmplitude = null; - private float[] pmt2RawAmplitude = null; - private int[][] adcCounts1 = null; - private int[][] adcCounts2 = null; - private int[] pmt1Gain = null; - private int[] pmt2Gain = null; - private float[] pmt1Pedestal = null; - private float[] pmt2Pedestal = null; - private int[] pmt1Number = null; - private int[] pmt2Number = null; - private int[] pmt1ADCStatus = null; - private int[] pmt2ADCStatus = null; - private static boolean pulseShapesDataAvailable = false; - private static final String LOOKUP_TABLE_FILE = - AGlobals.instance().getHomeDirectory() + "configuration" + - System.getProperty("file.separator") + - "rpsplt_tile.csv"; - // number of lookup table values for real pulse shapes plots calculation - private static final short NUMBER_OF_LOOKUP_VALUES = 401; - - - ATILEData(AHashMap p, AEvent e) - { - super(p,e); - - - for (int i = 0; i < numData; i++) - { - try - { - side[i] = (byte) AIdHelper.tileSide(id[i]); - etaIndex[i] = (short) AIdHelper.tileTower(id[i]); - phiIndex[i] = (short) AIdHelper.tileModule(id[i]); - sampling[i] = AIdHelper.tileSampling(id[i]); - } - catch (AAtlantisException ex) - { - System.out.println("Problem decoding ID " + id[i] + " in " + - CALORIMETER_NAME + ": " + ex.getMessage()); - side[i] = 0; - etaIndex[i] = -1; - phiIndex[i] = -1; - sampling[i] = -1; - } - } - - makeHitToGeometryMapping(); - for (int i = 0; i < et.length; ++i) - { - et[i] = Math.abs(energy[i] / (float) Math.cosh(eta[i])); - } - - // Collect some constants needed for the histograms. - for (int i = 0; i < ACalorimeterDetector.count(); i++) - { - if (ACalorimeterDetector.get(i).getName().indexOf(CALORIMETER_NAME) >= 0) - { - if (innerR == 0.0 || ACalorimeterDetector.get(i).getRMin() < innerR) - { - innerR = ACalorimeterDetector.get(i).getRMin(); - } - if (phiGranularity == 0.0 || ACalorimeterDetector.get(i).getDeltaPhi() < phiGranularity) - { - phiGranularity = ACalorimeterDetector.get(i).getDeltaPhi(); - } - if (etaGranularity == 0.0 || ACalorimeterDetector.get(i).getDeltaEta() < etaGranularity) - { - etaGranularity = ACalorimeterDetector.get(i).getDeltaEta(); - } - if (outerEta == 0.0 || ACalorimeterDetector.get(i).getEtaMax() > outerEta) - { - outerEta = ACalorimeterDetector.get(i).getEtaMax(); - } - } - - if (outerR == 0.0 || ACalorimeterDetector.get(i).getRMax() > outerR) - { - outerR = ACalorimeterDetector.get(i).getRMax(); - } - if (outerZ == 0.0 || ACalorimeterDetector.get(i).getZMax() > outerZ) - { - outerZ = ACalorimeterDetector.get(i).getZMax(); - } - } - - // Add a little bit of extra margin to prevent binning errors due to - // rounding of numbers. - outerEta += etaGranularity; - - readPulseShapePlotData(p); - - pmt1ADCStatus = (p.get("pmt1ADCStatus") != null) ? p.getIntArray("pmt1ADCStatus") : null; - pmt2ADCStatus = (p.get("pmt2ADCStatus") != null) ? p.getIntArray("pmt2ADCStatus") : null; - - - } // ATILEData() -------------------------------------------------------- - - - - /** - * readLookupTableFile() reads in comma separated values (CSV) file - * with TILE real pulse shapes plots time and amplitude lookup values - * @throws AAtlantisException - */ - protected static void readLookupTableFile() throws AAtlantisException - { - try - { - InputStream is = AUtilities.getFileAsStream(LOOKUP_TABLE_FILE); - CSVParser parser = new CSVParser(is); - parser.setCommentStart("#"); - String arrayName = null; - - while((arrayName = parser.nextValue()) != null) - { - String valueArray = parser.nextValue(); // shall now contain all values - CSVParser parserArray = new CSVParser(new StringReader(valueArray)); - String[][] s = parserArray.getAllValues(); - if("TILE_AMPLITUDE".equals(arrayName)) - { - ACalorimeterRPSPLT.TILE_AMPLITUDE = - getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - } - else if("TILE_TIME".equals(arrayName)) - { - ACalorimeterRPSPLT.TILE_TIME = - getLookupTableArray(s, NUMBER_OF_LOOKUP_VALUES); - } - } - } - catch(FileNotFoundException e) - { - throw new AAtlantisException("could not find file: " + - LOOKUP_TABLE_FILE); - } - catch(IOException e) - { - throw new AAtlantisException("exception while reading file: " + - LOOKUP_TABLE_FILE); - } - catch(AAtlantisException e) - { - throw e; - } - - } // readLookupTableFile() ---------------------------------------------- - - - - private void readPulseShapePlotData(AHashMap p) - { - pmt1Energy = (p.get("pmt1Energy") != null) ? p.getFloatArray("pmt1Energy") : null; - pmt2Energy = (p.get("pmt2Energy") != null) ? p.getFloatArray("pmt2Energy") : null; - pmt1Chi2 = (p.get("pmt1Chi2") != null) ? p.getFloatArray("pmt1Chi2") : null; - pmt2Chi2 = (p.get("pmt2Chi2") != null) ? p.getFloatArray("pmt2Chi2") : null; - pmt1Time = (p.get("pmt1Time") != null) ? p.getFloatArray("pmt1Time") : null; - pmt2Time = (p.get("pmt2Time") != null) ? p.getFloatArray("pmt2Time") : null; - - pmt1Gain = (p.get("pmt1Gain") != null) ? p.getIntArray("pmt1Gain") : null; - pmt2Gain = (p.get("pmt2Gain") != null) ? p.getIntArray("pmt2Gain") : null; - - pmt1Pedestal = (p.get("pmt1Pedestal") != null) ? p.getFloatArray("pmt1Pedestal") : null; - pmt2Pedestal = (p.get("pmt2Pedestal") != null) ? p.getFloatArray("pmt2Pedestal") : null; - - pmt1Number = (p.get("pmt1Number") != null) ? p.getIntArray("pmt1Number") : null; - pmt2Number = (p.get("pmt2Number") != null) ? p.getIntArray("pmt2Number") : null; - - int[] adc1 = (p.get("adcCounts1") != null) ? p.getIntArray("adcCounts1") : null; - int[] adc2 = (p.get("adcCounts2") != null) ? p.getIntArray("adcCounts2") : null; - - // by zdenek (2008-09-15): - // raw time: later additions to tilecal pulse shapes, doens't necessarily - // have to be in the event files, will not be in the old ones - pmt1RawTime = (p.get("pmt1RawTime") != null) ? p.getFloatArray("pmt1RawTime") : null; - pmt2RawTime = (p.get("pmt2RawTime") != null) ? p.getFloatArray("pmt2RawTime") : null; - - // by zdenek (2008-11-24): - // pmt1RawAmplitude, pmt2RawAmplitude now used to calculate pulse shape - // this is made now obligatory, without this data, the pulse shapes will - // not be available - pmt1RawAmplitude = (p.get("pmt1RawAmplitude") != null) ? p.getFloatArray("pmt1RawAmplitude") : null; - pmt2RawAmplitude = (p.get("pmt2RawAmplitude") != null) ? p.getFloatArray("pmt2RawAmplitude") : null; - - // read in ADCCounts - if(adc1 != null && adc2 != null) - { - adcCounts1 = new int[numData][0]; - adcCounts2 = new int[numData][0]; - // amount of numbers associated with each cells (i.e. with each data item) - int multiple = adc1.length / numData; - int num = 0; - for (int i = 0; i < numData; i++) - { - adcCounts1[i] = new int[multiple]; - adcCounts2[i] = new int[multiple]; - for (int j = 0; j < multiple; j++) - { - adcCounts1[i][j] = adc1[num]; // fill in array for each cell - adcCounts2[i][j] = adc2[num]; // fill in array for each cell - num++; - } - } - } - - pulseShapesDataAvailable = false; - if(adcCounts1 != null && adcCounts2 != null && adcCounts1.length != 0 && - adcCounts2.length != 0 && adcCounts1[0].length != 0 && - adcCounts2[0].length != 0 && pmt1Number != null && - pmt2Number != null && pmt1Energy != null && pmt2Energy != null && - pmt1Time != null && pmt2Time != null && pmt1Pedestal != null && - pmt2Pedestal != null && pmt1Gain != null && pmt2Gain != null && - pmt1RawAmplitude != null && pmt2RawAmplitude != null) - { - pulseShapesDataAvailable = true; - - logger.debug(CALORIMETER_NAME + - ": data for real pulse shape plots available"); - - if(ACalorimeterRPSPLT.areTileLookupTablesInitialized()) - { - logger.debug(CALORIMETER_NAME + - ": lookup tables have already been read in"); - } - else - { - - logger.debug(CALORIMETER_NAME + - ": lookup table values have not been read in yet\n" + - " trying to read file: " + LOOKUP_TABLE_FILE); - - try - { - readLookupTableFile(); - logger.debug(CALORIMETER_NAME + - ": values from " + LOOKUP_TABLE_FILE + - " successfully read in"); - } - catch(AAtlantisException ex) - { - logger.error(CALORIMETER_NAME + - ": reading " + LOOKUP_TABLE_FILE + - " failed, real pulse shapes plots will not " + - "be available, reason: " + ex.getMessage(), ex); - pulseShapesDataAvailable = false; - } - } - } - - } // readPulseShapePlotData() ------------------------------------------- - - - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsCalo", "TileET", "TileET", et); - cut("CutsCalo", "TileEnergyBottom", "TileEnergyBottom", energy); - cut("CutsCalo", "TileEnergyUp", "TileEnergyUp", energy); - - // following cut is based on pmt1ADCStatus, resp. pmt2ADCStatus - if(pmt1ADCStatus != null && pmt2ADCStatus != null) - { - cut("CutsCalo", "TilePMTADC", "TilePMTADC", pmt1ADCStatus); - cut("CutsCalo", "TilePMTADC", "TilePMTADC", pmt2ADCStatus); - } - } - - - - /** - * Returns the name of the parameter group. - * @return String parameter group - */ - public String getParameterGroup() - { - return "TILE"; - } - - /** - * Returns the name of the datatype. - * @return String datatype - */ - public String getName() - { - return "TILE"; - } - - /** - * Returns the displayed name of datatype - * @return String screen name - */ - public String getNameScreenName() - { - return "TILE"; - } - - /** - * Returns the type of calorimeter (ECAL/HCAL) for a hit. - * @param index int hit index - * @return String calorimeter type - */ - public String getCalorimeterType(int index) - { - return "HCAL"; - } - - @Override //ACalorimeterData - //Gives the hit time for this Tile cell based on the PMT times - protected double getTime(int hit) - { - if (pmt1Time == null) return 0.0; - else if (pmt2Time == null) return 0.0; - else { - if (pmt1Time[hit]!=0.0 && pmt2Time[hit]!=0.0){ - return (pmt1Time[hit]+pmt2Time[hit])/2.; - } - if (pmt1Time[hit]==0.0 && pmt2Time[hit]!=0.0){ - return pmt2Time[hit]; - } - if (pmt1Time[hit]!=0.0 && pmt2Time[hit]==0.0){ - return pmt1Time[hit]; - } - } - return 0.0; - } - - /** - * Returns calo hit info, most of the parameters are taken from from - * (mother) ACalorimeterData class. - * @param index int - * @return String - */ - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n ET="+String.format("%.3f",et[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Ex="+String.format("%.3f",et[index]*Math.cos(phi[index]))+" GeV "+ - "\n Ey="+String.format("%.3f",et[index]*Math.sin(phi[index]))+" GeV "+ - "\n Ez="+String.format("%.3f",et[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String t = ""; - String pmt1Info = ""; - String pmt2Info = ""; - - String decodedId = AIdHelper.getDecodedTileIndentifier(id[index]); - t = decodedId + " " + super.getHitInfoNoDecode(index); - - - pmt1Info += "\n PMT1 ADC status = "; - pmt1Info += (pmt1ADCStatus != null) ? Integer.toString(pmt1ADCStatus[index]) : "n/a"; - - pmt1Info += "\n PMT1 energy = "; - pmt1Info += (pmt1Energy != null) ? Float.toString(pmt1Energy[index]) + - " GeV" : "n/a"; - pmt1Info += "\n PMT1 chi2 = "; - pmt1Info += (pmt1Chi2 != null) ? Float.toString(pmt1Chi2[index]) : "n/a"; - pmt1Info += "\n PMT1 time = "; - pmt1Info += (pmt1Time != null) ? Float.toString(pmt1Time[index]) + - " ns" : "n/a"; - pmt1Info += "\n PMT1 gain = "; - pmt1Info += (pmt1Gain != null) ? Integer.toString(pmt1Gain[index]) : "n/a"; - pmt1Info += "\n PMT1 pedestal = "; - pmt1Info += (pmt1Pedestal != null) ? Float.toString(pmt1Pedestal[index]) + - " ADC counts" : "n/a"; - - - pmt2Info += "\n PMT2 ADC status = "; - pmt2Info += (pmt2ADCStatus != null) ? Integer.toString(pmt2ADCStatus[index]) : "n/a"; - - pmt2Info += "\n PMT2 energy = "; - pmt2Info += (pmt2Energy != null) ? Float.toString(pmt2Energy[index]) + - " GeV" : "n/a"; - pmt2Info += "\n PMT2 chi2 = "; - pmt2Info += (pmt2Chi2 != null) ? Float.toString(pmt2Chi2[index]) : "n/a"; - pmt2Info += "\n PMT2 time = "; - pmt2Info += (pmt2Time != null) ? Float.toString(pmt2Time[index]) + - " ns" : "n/a"; - pmt2Info += "\n PMT2 gain = "; - pmt2Info += (pmt2Gain != null) ? Integer.toString(pmt2Gain[index]) : "n/a"; - pmt2Info += "\n PMT2 pedestal = "; - pmt2Info += (pmt2Pedestal != null) ? Float.toString(pmt2Pedestal[index]) + - " ADC counts" : "n/a"; - - pmt2Info += pulseShapesDataAvailable ? "" : - "\n data for real pulse shapes plot n/a"; - - pmt2Info += "\n calc time = "+getTime(index); - - return t + pmt1Info + pmt2Info; - - } // getHitInfo() ------------------------------------------------------- - - - - // calculate real pulse shapes values based on the values in the lookup tables - private double getPhysicsPulseShape(double xTime, double pmtTime, - double pmtPedestal, double pmtEnergy, - float[] amplitude, float[] time) - throws AAtlantisException - { - double tdiv = 0.0; - int lookup = 0; - double localTime = 0.0; - double xpulse = 0.0; - - // need to get "multiple" parameter ( = number of values in adcCounts - // for each cell - adcCounts1[0].length), shall be the same for all the - // cells - taking the length of the first array (for the first cell) - // [currently (2007-05-23) is this multiple 9 but to change in real data] - // no NullPointer or ArrayIndexBound checks are necessary here as this - // method shall only be called when the relevant data is available - double centerOfSamples = (adcCounts1[0].length + 1.0) / 2.0; - - tdiv = time[1] - time[0]; - localTime = (xTime - centerOfSamples) * 25.0 - pmtTime; - lookup = (int) ((localTime - time[0]) / tdiv); - - if(lookup < 0) - { - lookup = 0; - } - if(lookup >= NUMBER_OF_LOOKUP_VALUES - 1) - { - lookup = NUMBER_OF_LOOKUP_VALUES - 2; // -1 was off by 1 - } - - try - { - if(lookup == 0 || lookup == NUMBER_OF_LOOKUP_VALUES - 2) - { - xpulse = amplitude[lookup]; - } - else - { - xpulse = amplitude[lookup] + ((amplitude[lookup + 1] - - amplitude[lookup]) / tdiv) * (localTime - time[lookup]); - } - } - catch(ArrayIndexOutOfBoundsException ex) - { - String m = "ATILEData.getPhysicsPulseShape():\n" + - " lookup index out of bound: lookup = " + lookup; - throw new AAtlantisException(m); - } - return (xpulse * pmtEnergy) + pmtPedestal; - - } // getPhysicsPulseShape() --------------------------------------------- - - - -// /** -// * Call util class which plots cell pulse shapes provided that -// * all real pulse shapes data is available -// * Functions calculates values of real pulse shape calculated in the method -// * getPhysicsPulseShape(). -// * This method is called from pick interaction. -// * -// * @param index int -// */ - /*public void plotPulseShapes(int index) - { - - if(pulseShapesDataAvailable) - { - String title = getPulseTitleString(index); - - // two channels for a TILE cell (two arrays of ADC counts) - int[][] adcCounts = new int[][] { adcCounts1[index], adcCounts2[index] }; - - if(super.checkADCCountsAvailability(adcCounts)) - { - // adc counts are available - logger.debug(CALORIMETER_NAME + " adc counts (digits) are " + - "available for pulse shapes plots for this cell."); - } - else - { - AOutput.append("\nADC counts are not available for this cell, " + - "can't plot pulse shapes.", ALogPane.WARNING); - return; - } - - - String cap1 = "Real pulse shape " + "PMT " + pmt1Number[index] + - " gain " + pmt1Gain[index]; - String cap2 = "Real pulse shape " + "PMT " + pmt2Number[index] + - " gain " + pmt2Gain[index]; - String[] subTitle = new String[] { cap1, cap2 }; - - // by zdenek (2008-11-24): - // energy calculations (lowGainFactor, highGainFactor) and related - // magic constants removed - now using pmt1RawAmplitude, pmt2RawAmplitude - // instead of pmt[1,2]Energy, resp. former local variables - // energy1, energy2 when calling getPhysicsPulseShape() further down - - // 1 .. 9 range (9 values of ADC counts, 9 samples (starts from 1!)), - // need to get 401 values within this range. number of samples will - // likely decrease in real data from 9 to 7 - double step = (adcCounts1[index].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - double[][] realPulse = new double[2][NUMBER_OF_LOOKUP_VALUES]; // 2 channels - double[][] realPulseForRawTime = null; - double d = 1.0; - - // if pmt1RawTime and pmt2RawTime are present, use those for - // calculating data for real pulse shape plot based on these time values - boolean showPlotForRawTime = false; - if(pmt1RawTime != null && pmt2RawTime != null) - { - logger.debug("TILE pmt[1,2]RawTime are present, showing another plot."); - showPlotForRawTime = true; - realPulseForRawTime = new double[2][NUMBER_OF_LOOKUP_VALUES]; // 2 channels - } - - - // by zdenek 2008-11-25 - // DPD (slimed version of ESD) sometimes don't have pmt[1,2]Pedestal - // for a cell (the tag exists, values are there, but are 0). check - // if pedestal is 0 and if so, take as pedestal value the first - // adc count digit - float pmt1PedestalLocal = pmt1Pedestal[index]; - float pmt2PedestalLocal = pmt2Pedestal[index]; - if(pmt1PedestalLocal == 0.0f && pmt2PedestalLocal == 0.0f) - { - logger.debug("TILE pmt[1,2]Pedestal are not available (i.e. " + - "are 0.0f), using minimum of first and last " + - "adcCount digit as pedestal."); - float last1 = adcCounts1[index][adcCounts1[index].length - 1]; - float last2 = adcCounts2[index][adcCounts2[index].length - 1]; - pmt1PedestalLocal = Math.min(adcCounts1[index][0], last1); - pmt2PedestalLocal = Math.min(adcCounts2[index][0], last2); - } - - - try - { - for(int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) - { - d += step; - realPulse[0][i] = - getPhysicsPulseShape(d, pmt1Time[index], pmt1PedestalLocal, - pmt1RawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - realPulse[1][i] = - getPhysicsPulseShape(d, pmt2Time[index], pmt2PedestalLocal, - pmt2RawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - if(showPlotForRawTime) - { - realPulseForRawTime[0][i] = - getPhysicsPulseShape(d, pmt1RawTime[index], pmt1PedestalLocal, - pmt1RawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - realPulseForRawTime[1][i] = - getPhysicsPulseShape(d, pmt2RawTime[index], pmt2PedestalLocal, - pmt2RawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - } - } - } - catch(AAtlantisException aaex) - { - AOutput.append(aaex.getMessage(), ALogPane.WARNING); - return; - } - - if(realPulseForRawTime != null) - { - APulseShapePlot.plotRealPulseShapes(adcCounts, realPulse, - step, subTitle, title + " (cell time)"); - APulseShapePlot.plotRealPulseShapes(adcCounts, realPulseForRawTime, - step, subTitle, title + " (raw time)"); - } - else - { - // if RawTime stuff is to be removed, there will remain only - // one such call to plot real pulse shapes - this one - APulseShapePlot.plotRealPulseShapes(adcCounts, realPulse, - step, subTitle, title); - } - } - else - { - logger.warn(CALORIMETER_NAME + " plotPulseShapes() method called, " + - "but data is not available."); - return; - } - - } */// plotPulseShapes() -------------------------------------------------- - - - - /** - * Returns the histograms for this projection. - * - * @param projection AProjection2D current projection - * @return ACoord[] polygons representing histograms - */ - protected ACoord[] getUserHistograms(AProjection2D projection) - { - ACoord[] data = ACoord.NO_HISTOGRAMS; - if (projection instanceof AProjectionYX && parameterStore.get("YX", "Mode").getI() == AProjectionYX.MODE_STANDARD) - data = getYXHistograms(); - else if (projection instanceof AProjectionFR) - data = getFRHistograms(); - else if (projection instanceof AProjectionRZ) - data = getRZHistograms(); - return projection.nonLinearTransform(data); - } - - @Override - protected String getPulseTitleString(int index) { - String[] decodedId = AIdHelper.getFullIdentifier(id[index]); - - String title = CALORIMETER_NAME + " cell: " + decodedId[0]; - - return title; - } - - @Override - protected int[][] getADCCounts(int index) { - - if (pulseShapesDataAvailable) { - // two channels for a TILE cell (two arrays of ADC counts) - return new int[][]{adcCounts1[index], adcCounts2[index]}; - } else { - return null; - } - } - - @Override - protected double[][] getPulseShape(int index) { - - if (!pulseShapesDataAvailable) return null; - - // by zdenek (2008-11-24): - // energy calculations (lowGainFactor, highGainFactor) and related - // magic constants removed - now using pmt1RawAmplitude, pmt2RawAmplitude - // instead of pmt[1,2]Energy, resp. former local variables - // energy1, energy2 when calling getPhysicsPulseShape() further down - - // 1 .. 9 range (9 values of ADC counts, 9 samples (starts from 1!)), - // need to get 401 values within this range. number of samples will - // likely decrease in real data from 9 to 7 - double step = getPulseStep(index); - double[][] realPulseRaw = new double[2][NUMBER_OF_LOOKUP_VALUES]; // 2 channels - double d = 1.0; - - // if pmt1RawTime and pmt2RawTime are present, use those for - // calculating data for real pulse shape plot based on these time values - if (pmt1RawTime == null || pmt2RawTime == null) { - logger.warn("No raw time values available"); - return null; - } - - - // by zdenek 2008-11-25 - // DPD (slimed version of ESD) sometimes don't have pmt[1,2]Pedestal - // for a cell (the tag exists, values are there, but are 0). check - // if pedestal is 0 and if so, take as pedestal value the first - // adc count digit - float pmt1PedestalLocal = pmt1Pedestal[index]; - float pmt2PedestalLocal = pmt2Pedestal[index]; - if (pmt1PedestalLocal == 0.0f && pmt2PedestalLocal == 0.0f) { - logger.debug("TILE pmt[1,2]Pedestal are not available (i.e. " + - "are 0.0f), using minimum of first and last " + - "adcCount digit as pedestal."); - float last1 = adcCounts1[index][adcCounts1[index].length - 1]; - float last2 = adcCounts2[index][adcCounts2[index].length - 1]; - pmt1PedestalLocal = Math.min(adcCounts1[index][0], last1); - pmt2PedestalLocal = Math.min(adcCounts2[index][0], last2); - } - - try { - for (int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) { - d += step; - realPulseRaw[0][i] = - getPhysicsPulseShape(d, pmt1RawTime[index], pmt1PedestalLocal, - pmt1RawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - realPulseRaw[1][i] = - getPhysicsPulseShape(d, pmt2RawTime[index], pmt2PedestalLocal, - pmt2RawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - } - } catch (AAtlantisException aaex) { - AOutput.append(aaex.getMessage(), ALogInterface.WARNING); - return null; - } - - return realPulseRaw; - } - - protected double[][] getPulseShapeCellTime(int index) { - - if (!pulseShapesDataAvailable) return null; - - double step = getPulseStep(index); - double[][] realPulse = new double[2][NUMBER_OF_LOOKUP_VALUES]; // 2 channels - double d = 1.0; - - // by zdenek 2008-11-25 - // DPD (slimed version of ESD) sometimes don't have pmt[1,2]Pedestal - // for a cell (the tag exists, values are there, but are 0). check - // if pedestal is 0 and if so, take as pedestal value the first - // adc count digit - float pmt1PedestalLocal = pmt1Pedestal[index]; - float pmt2PedestalLocal = pmt2Pedestal[index]; - if (pmt1PedestalLocal == 0.0f && pmt2PedestalLocal == 0.0f) { - logger.debug("TILE pmt[1,2]Pedestal are not available (i.e. " + - "are 0.0f), using minimum of first and last " + - "adcCount digit as pedestal."); - float last1 = adcCounts1[index][adcCounts1[index].length - 1]; - float last2 = adcCounts2[index][adcCounts2[index].length - 1]; - pmt1PedestalLocal = Math.min(adcCounts1[index][0], last1); - pmt2PedestalLocal = Math.min(adcCounts2[index][0], last2); - } - - try { - for (int i = 0; i < NUMBER_OF_LOOKUP_VALUES; i++) { - d += step; - realPulse[0][i] = - getPhysicsPulseShape(d, pmt1Time[index], pmt1PedestalLocal, - pmt1RawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - realPulse[1][i] = - getPhysicsPulseShape(d, pmt2Time[index], pmt2PedestalLocal, - pmt2RawAmplitude[index], - ACalorimeterRPSPLT.TILE_AMPLITUDE, - ACalorimeterRPSPLT.TILE_TIME); - } - } catch (AAtlantisException aaex) { - AOutput.append(aaex.getMessage(), ALogInterface.WARNING); - return null; - } - - return realPulse; - } - - - @Override - protected double getPulseStep(int index) { - return (adcCounts1[index].length - 1) / (float) NUMBER_OF_LOOKUP_VALUES; - } - - @Override - protected String[] getPulseSubtitle(int index) { - String cap1 = "Real pulse shape " + "PMT " + pmt1Number[index] + - " gain " + pmt1Gain[index]; - String cap2 = "Real pulse shape " + "PMT " + pmt2Number[index] + - " gain " + pmt2Gain[index]; - return new String[]{cap1, cap2}; - } - - public void plotPulseShapesWithTiming(int index) { - - int[][] adc = getADCCounts(index); - double[][] raw = getPulseShape(index); - double[][] cell = getPulseShapeCellTime(index); - - if (adc == null || raw == null || cell == null) { - logger.warn("Pulse shapes with raw/cell times requested but no " + - "data available, falling back to regular pulse shapes"); - plotPulseShapes(index, true); - } else { - APulseShapePlot.plotRawCellPulseShapes(adc, raw, cell, - getPulseStep(index), getPulseSubtitle(index), - getPulseTitleString(index)); - } - - /*if (!withcurve) { - APulseShapePlot.plotADCCounts(adc, getPulseTitleString(index), null); - } else { - double[][] ps = getPulseShape(index); - if (ps == null) { - logger.warn("No pulse shape information available, just plotting adc instead"); - APulseShapePlot.plotADCCounts(adc, getPulseTitleString(index), null); - } else { - APulseShapePlot.plotRealPulseShapes(adc, ps, - getPulseStep(index), getPulseSubtitle(index), getPulseTitleString(index)); - } - }*/ - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ATRTData.java b/graphics/AtlantisJava/src/atlantis/data/ATRTData.java deleted file mode 100644 index c77849df8a980a43d9566c0a08154891e52ab5fb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ATRTData.java +++ /dev/null @@ -1,752 +0,0 @@ -package atlantis.data; - -import java.awt.event.ActionEvent; -import java.awt.geom.Point2D; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import java.util.Vector; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.tree.DefaultMutableTreeNode; - -import atlantis.canvas.ACanvas; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.colormap.AColorMap; -import atlantis.list.AList; -import atlantis.list.AListManager; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AEnumeratorParameter; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AHashMap; -import atlantis.utils.AIdHelper; -import atlantis.utils.AMath; - - -/** - * - * Transition Radiation Tracker data - * - * data from the event file - * id - processed by AData - * barcode (old) / barcodes and numBarcodes (new) - processed by AHitData - * phi - * rhoz - rho (for barrel) or z (for endcap) - * driftR - drift radius - * threshold - * sub - subdetector - * - * still need to have correct phi calculated from pVtx for cuts - * still need to have correct rho calculated from pVtx for cuts - * - */ -public class ATRTData extends AHitData -{ - protected float[] phi = null; - protected float[] rhoz = null; - protected float[] driftR = null; - protected int[] threshold = null; - protected int[] noise = null; - // bitPattern subtag information implemented in the retriever but - // currently (2009-01-21) not used or necessary but - // said to may become useful later - protected int[] bitPattern = null; - protected float[] timeOverThreshold = null; - protected HashMap<String, int[]> driftSign = new HashMap<String, int[]>(); - protected HashMap<String, int[]> isOutlier = new HashMap<String, int[]>(); - //error code for when driftSign/isOutlier is not present - private static final int NO_DATA =-99; - - - - public String getParameterGroup() - { - return "TRT"; - } - - - public String getName() - { - return "TRT"; - } - - - public String getNameScreenName() - { - return "TRT_DriftCircle"; - } - - - public int getDriftSign(int index) - { - //find current selection of track - AEnumeratorParameter listBox = (AEnumeratorParameter) parameterStore.get("InDetTrack", "InDetTrackCollections"); - String currentSelection = listBox.getCurrentText(); - if(driftSign!=null && !currentSelection.equals("All")) - { - //find data from current track - int[] data = (int[]) driftSign.get(currentSelection); - if(data!=null) - return data[index]; - } - //no present so return error code - return NO_DATA; - } - - - public int getIsOutlier(int index) - { - //find current selection of track - AEnumeratorParameter listBox = (AEnumeratorParameter) parameterStore.get("InDetTrack", "InDetTrackCollections"); - String currentSelection = listBox.getCurrentText(); - if(isOutlier!=null && !currentSelection.equals("All")) - { - //find data from current track - int[] data = (int[]) isOutlier.get(currentSelection); - if(data!=null) - return data[index]; - } - //no present so return error code - return NO_DATA; - } - - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+"\n"+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - StringBuilder s = new StringBuilder(); - String[] decodedId = AIdHelper.getFullIdentifier(id[index]); - s.append(getNameScreenName() + " (id: " + decodedId[0] + - " index: " + index + ")"); - // iterate over decodedId to get further details (if available), - // first item [0] was already printed out above - for(int i = 1; i < decodedId.length; i++) - { - s.append("\n " + decodedId[i]); - } - if(sub[index] == 1 || sub[index] == 2) - { - s.append("\n " + AMath.RHO + " = " + String.format("%.1f",rhoz[index]) + " cm"); - } - else - { - s.append("\n z = " + String.format("%.1f",rhoz[index]) + " cm"); - } - s.append("\n " + AMath.PHI + " = " + - String.format("%.1f",Math.toDegrees(phi[index])) + AMath.DEGREES + - " (" + String.format("%.3f",phi[index]) + " rad)" + - "\n drift radius = " + String.format("%.3f",driftR[index]) + " cm" + - "\n threshold = " + threshold[index] + - "\n sub = " + sub[index]); - - s.append(super.getHitInfo(index)); // finds barcode information - - int d = getDriftSign(index); - s.append((d!=NO_DATA) ? ("\n driftSign = " + d) : "\n driftSign = n/a"); - int o = getIsOutlier(index); - s.append((o!=NO_DATA) ? ("\n isOutlier = " + o) : "\n isOutlier = n/a"); - s.append("\n noise = " + (noise != null ? noise[index] : "n/a")); - s.append("\n time over threshold = " + - (timeOverThreshold != null ? timeOverThreshold[index] : "n/a")); - - return s.toString(); - - } // getHitInfo() ------------------------------------------------------- - - - public ATRTData(AHashMap p, AEvent e) - { - super(p,e); - phi = p.getFloatArray("phi"); - rhoz = p.getFloatArray("rhoz"); - driftR = p.getFloatArray("driftR"); - threshold = p.getUnknownIntArray("threshold"); - noise = p.getUnsureIntArray("noise"); - if(p.getIntArray("sub") == null) - { - for(int i=0; i<numData; i++) - { - sub[i] = getSub(id[i]); - } - } - // the way to retrieve bitPattern subtag information - // currently (2009-01-21) not used or necessary but - // said to may become useful later - // bitPattern = p.getIntArray("bitPattern"); - timeOverThreshold = p.getFloatArray("timeOverThreshold"); - - } // ATRTData() --------------------------------------------------------- - - - protected int internalColor() - { - int numColorTypes = super.internalColor(); - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if(colorFunction == numColorTypes + 1) // colour by Track Segment - { - colorBy(getSegments()); - } - else if(colorFunction == numColorTypes + 2) // colour by isOutlier - { - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - int iO = getIsOutlier(list); - if(iO==0) - color[list]= AColorMap.GN;//green - else if(iO==1) - color[list]= AColorMap.RD;//red - else - color[list]= (byte) parameterStore.get(PARAMETER_GROUP, "Constant").getI(); - } - } - else if(colorFunction == numColorTypes + 3) // colour by driftSign - { - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - int ds = getDriftSign(list); - if(ds==-1) - color[list]= AColorMap.GN;//green - else if(ds==1) - color[list]= AColorMap.RD;//red - else - color[list]= (byte) parameterStore.get(PARAMETER_GROUP, "Constant").getI(); - } - } - else if(colorFunction == numColorTypes + 4) // colour by threshold - { - for(int i=0; i<numDraw; i++) - { - int list = listdl[i]; - if(threshold[list]==1) - color[list]= AColorMap.RD; // red is preferable then previous green - else - color[list]= (byte) parameterStore.get(PARAMETER_GROUP, "Constant").getI(); - } - } - return numColorTypes + 1; - - } // internalColor() ---------------------------------------------------- - - - - public int getLayer(int id) - { - try { - return AIdHelper.trtLayerWheel(id); - } catch (AAtlantisException e) { - return 0; - } - //return(id & 0x01F00000) >> 20; before using IDHelper - } - - - - public int getSub(int id) - { - try { - return AIdHelper.trtBarrelEndcap(id); - } catch (AAtlantisException e) { - return 0; - } - //return(id & 0x06000000) >> 25; before using IDHelper - } - - - - protected void applyCuts() - { - cutIndex(); - cut("CutsInDet", "Threshold", " Threshold", threshold); - cutSimulatedTracks(); - cutReconstructedTracks(); - cutSegments(); - cutPhi(phi); - cutEta(); - - // cut noise - if(noise != null && parameterStore.get("CutsInDet", "Noise").getStatus()) - { - cutArray(noise, 0, "TRT Noise Cut"); - } - - // cut TimeOverThreshold - // method takes care that the cut is actually turned on - // or if the timeOverThreshold array is null (n/a in the event file) - cut("CutsInDet", "TRTTimeOverThreshold", - "TRTTimeOverThreshold", timeOverThreshold); - } - - - - private void keepBarrel() - { - int num = 0; - int cutSub = parameterStore.get("CutsInDet", "TRT").getI(); - for(int i = 0; i < numDraw; i++) - { - // sub values 1 and 2 - barrel - if(sub[listdl[i]] == 1 || sub[listdl[i]] == 2) - { - if(cutSub == -1 || sub[listdl[i]] == cutSub) - { - listdl[num++] = listdl[i]; - } - } - } - numDraw = num; - } - - - - private void keepEndcap() - { - int num = 0; - for(int i = 0; i < numDraw; i++) - { - // sub values 0 and 3 - endcaps - if(sub[listdl[i]] == 0 || sub[listdl[i]] == 3) - { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - - - - private void cutEta() - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - if(!par.getStatus())return; - double etaCut = par.getD(); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaLowerCut = etaMid - etaCut; - double etaUpperCut = etaMid + etaCut; - int num = 0; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double z1, z2, r1, r2; - if(sub[list] == 0 || sub[list] == 3) - { - // endcap - z1 = rhoz[list]; - z2 = rhoz[list]; - r1 = 64.; - if(Math.abs(rhoz[list]) > 280.) r1 = 48.; - r2 = 103.; - } - else - { - // barrel - z1 = 0.35; - if(rhoz[list] < 62) z1 = 40.; - z2 = 74.2; - if(sub[list] == 1) - { - z1 *= -1.; - z2 *= -1.; - } - r1 = rhoz[list]; - r2 = rhoz[list]; - } - double eta1 = AParameterUtilities.eta(z1, r1); - double eta2 = AParameterUtilities.eta(z2, r2); - double etaLower = Math.min(eta1, eta2); - double etaUpper = Math.max(eta1, eta2); - if(etaUpper > etaLowerCut && etaLower < etaUpperCut) - listdl[num++] = list; - } - numDraw = num; - } - - - // in XY only TRT barrel data are displayed - protected ACoord getYXUser() - { - makeDrawList(); - keepBarrel(); - double zoomScaling=0; - //check if zoomed in enough to display circles/drift sign arrows - Point2D.Double[] corners = ACanvas.getCanvas().getPaintingWindow().getUserCorners(); - double widthx=corners[1].x-corners[0].x; - double widthy=corners[0].y-corners[2].y; - //average width of window - double width=Math.sqrt(widthx*widthx+widthy*widthy); - //calculate scaling (100 is arbitrary constant) - zoomScaling=100/width; - //now return relevant user coords depending on the zoom - //(0.25 is arbitrary constant increase to turn on drawing - // circles and arrows at a more zoomed in state) - if(zoomScaling>0.25) - return getYXUserCircle(); - else - return getYXUserNormal(); - } - - - /** - * Will give coords for a line along the TRT drift - */ - private ACoord getYXUserNormal() - { - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double r = rhoz[list]; - double cosPhi = Math.cos(phi[list]); - double sinPhi = Math.sin(phi[list]); - double d = driftR[list]; - double x = r * cosPhi; - double y = r * sinPhi; - hv[0][0][i] = x + d * sinPhi; - hv[1][0][i] = y - d * cosPhi; - hv[0][1][i] = x - d * sinPhi; - hv[1][1][i] = y + d * cosPhi; - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - - /** - * Will give coords for the drift circle and arrow showing the drift - */ - private ACoord getYXUserCircle() - { - int numPoints = 48; - int[] index = new int[numDraw]; - double[][][] hv = new double[2][numDraw][]; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int ds = getDriftSign(list); - //adjust ds if z<0 - if(sub[list] == 1) - { - ds *= -1; - } - if(ds==1 || ds==-1) - { - //has drift sign so has extra points for arrow - hv[0][i] = new double[numPoints+3]; - hv[1][i] = new double[numPoints+3]; - } - else - { - hv[0][i] = new double[numPoints]; - hv[1][i] = new double[numPoints]; - ds=0; - } - double r = rhoz[list]; - double cosPhi = Math.cos(phi[list]); - double sinPhi = Math.sin(phi[list]); - double d = driftR[list]; - double x = r * cosPhi; - double y = r * sinPhi; - int jstart=0; - //calculate starting point of circle - if(ds==1 || ds ==-1) - { - jstart = (int) (phi[list]/(Math.PI * 2 / (numPoints - 1))); - d*=ds; - } - //store points of circle - int count=0; - for (int j = jstart; j < numPoints; j++) - { - hv[0][i][count] = x + d * Math.sin(Math.PI * 2 * j / (numPoints - 1)); - hv[1][i][count] = y - d * Math.cos(Math.PI * 2 * j / (numPoints - 1)); - count++; - } - for (int j = 0; j < jstart; j++) - { - hv[0][i][count] = x + d * Math.sin(Math.PI * 2 * (j+1) / (numPoints - 1)); - hv[1][i][count] = y - d * Math.cos(Math.PI * 2 * (j+1) / (numPoints - 1)); - count++; - } - index[i] = list; - //if has drift show arrow - if(ds==1 || ds==-1) - { - //first line - hv[0][i][numPoints] = hv[0][i][2*(numPoints-1)/5]; - hv[1][i][numPoints] = hv[1][i][2*(numPoints-1)/5]; - //back to end point of circle - hv[0][i][numPoints+1] = hv[0][i][numPoints-1]; - hv[1][i][numPoints+1] = hv[1][i][numPoints-1]; - //second line - hv[0][i][numPoints+2] = hv[0][i][3*(numPoints-1)/5]; - hv[1][i][numPoints+2] = hv[1][i][3*(numPoints-1)/5]; - } - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - } - - - protected ACoord getRZUser() - { - // correction for primary vertex - if(!parameterStore.get("RZ", "TRT").getStatus())return ACoord.NO_DATA; - makeDrawList(); - // line size was found using findRZActiveArea(){ - // may need to be found again if geometry changes... - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - if(sub[list] == 0 || sub[list] == 3) - { - // endcap - hv[0][0][i] = rhoz[list]; - hv[0][1][i] = rhoz[list]; - double phiDiff = Math.abs(phi[list] - phiMid); - double r1 = 64.; - if(Math.abs(rhoz[list]) > 280.) r1 = 48.; - double r2 = 103.; - if(phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - { - hv[1][0][i] = r1; - hv[1][1][i] = r2; - } - else - { - hv[1][0][i] = -r1; - hv[1][1][i] = -r2; - } - } - else - { - // barrel - double z1 = 0.35; - if(rhoz[list] < 62) z1 = 40.; - double z2 = 74.2; - if(sub[list] == 1) - { - z1 *= -1.; - z2 *= -1.; - } - hv[0][0][i] = z1; - hv[0][1][i] = z2; - double phiDiff = Math.abs(phi[list] - phiMid); - if(phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - { - hv[1][0][i] = rhoz[list]; - hv[1][1][i] = rhoz[list]; - } - else - { - hv[1][0][i] = -rhoz[list]; - hv[1][1][i] = -rhoz[list]; - } - } - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES); - } - - - protected ACoord getFRUser() - { - makeDrawList(); - keepBarrel(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - double[] pVtx = event.getPrimaryVertex(); - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double r = rhoz[list]; - double p = phi[list]; - double x = r * Math.cos(p); - double y = r * Math.sin(p); - double dx = x - pVtx[0]; - double dy = y - pVtx[1]; - r = Math.sqrt(dx * dx + dy * dy); - p = Math.atan2(dy, dx); - if(p < 0.) p += AMath.TWO_PI; - double delPhi = driftR[list] / r; - hv[0][0][i] = r; - hv[1][0][i] = Math.toDegrees(p - delPhi); - hv[0][1][i] = r; - hv[1][1][i] = Math.toDegrees(p + delPhi); - index[i] = list; - } - return new ACoord(hv, index, this, ACoord.LINES).includePhiWrapAround("FR"); - } - - - - protected ACoord getFZUser() - { - makeDrawList(); - keepEndcap(); - double[][][] hv = new double[2][2][numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double z = rhoz[list]; - // average rho from findRZActiveArea() - double averageRho = 81.; - if(Math.abs(z) > 280.) - averageRho = 70.; - double p = phi[list]; - double delPhi = driftR[list] / averageRho; - hv[0][0][i] = z; - hv[1][0][i] = Math.toDegrees(p - delPhi); - hv[0][1][i] = z; - hv[1][1][i] = Math.toDegrees(p + delPhi); - index[i] = list; - } - return new ACoord(hv, index, this, - ACoord.LINES).includePhiWrapAround("FZ"); - } - - - public Action[] getActions(Collection nodes) - { - if(nodes.size() != 1) - return new Action[0]; - final DefaultMutableTreeNode node = (DefaultMutableTreeNode) (nodes. - iterator().next()); - AList[] list = AListManager.getInstance().getChildren(node); - if(list == null)return new Action[0]; - Set hits = new HashSet(); - for(int i = 0; i < list.length; ++i) - { - if(list[i].getSource() == this) - { - for(int j = 0; j < list[i].getItems().length; j++) - { - hits.add(new Integer(list[i].getItems()[j])); - } - } - else - { - return new Action[0]; - } - } - int numHits = hits.size(); - if(numHits < 2) - return new Action[0]; - final int[] h = new int[numHits]; - Iterator i = hits.iterator(); - int n = 0; - while(i.hasNext()) - { - h[n++] = ((Integer) (i.next())).intValue(); - } - Action[] action = new Action[1]; - action[0] = new AbstractAction("Find Eta") - { - public void actionPerformed(ActionEvent e) - { - final double MIN = 9999.; - final double MAX = -9999.; - double minRho = MIN; - double maxRho = MAX; - double minZ = MIN; - double maxZ = MAX; - for(int i = 0; i < h.length; ++i) - { - if(sub[h[i]] == 1 || sub[h[i]] == 2) - { - minRho = Math.min(minRho, rhoz[h[i]]); - maxRho = Math.max(maxRho, rhoz[h[i]]); - } - else - { - minZ = Math.min(minZ, rhoz[h[i]]); - maxZ = Math.max(maxZ, rhoz[h[i]]); - } - } - AOutput.append("Eta results:\n minRho = " + - String.format("%.3f",minRho) + - " maxRho = " + String.format("%.3f",maxRho) + "\n" + - " minZ = " + String.format("%.3f",minZ) + - " maxZ = " + String.format("%.3f",maxZ) + "\n", - ALogInterface.NORMAL); - } - }; - return action; - } - - - @Override - protected void finalizeConstruction() { - super.finalizeConstruction(); - Vector keys = (Vector) event.getCollections().get("InDetTrack"); - if(keys != null) - { - Iterator keysIterator = keys.iterator(); - //loop over collections - while(keysIterator.hasNext()) - { - String trackCollec = (String) keysIterator.next(); - AInDetTrackData data = (AInDetTrackData) (event.get("InDetTrack" + trackCollec)); - int[][] hits = event.getAssociationManager().get("InDetTrack" + trackCollec, getName()); - int[][] drifts = event.getAssociationManager().get("InDetTrack" + trackCollec + "Drift", getName()); - int[][] outliers = event.getAssociationManager().get("InDetTrack" + trackCollec + "Outlier", getName()); - - if(drifts!=null || outliers!=null) - { - int[] driftSignData = new int[numData]; - int[] isOutlierData = new int[numData]; - //set to noData to distinguish from a 0 returned if the data is present - for(int i=0; i<this.numData; i++) - { - driftSignData[i]=NO_DATA; - isOutlierData[i]=NO_DATA; - } - //loop over alll hits in track collection - for(int i=0; i<data.getNumData(); i++) - { - for(int j=0; j<hits[i].length; j++) - { - //check if current hit matches a TRT index - int list=getIndexFromId(hits[i][j]); - if(list!=-1) - { - //found match so save value if not null - if(drifts!=null) - driftSignData[list] = drifts[i][j]; - if(outliers!=null) - isOutlierData[list] = outliers[i][j]; - } - } - } - //if has data in file then save array of values - if(drifts!=null) - driftSign.put(trackCollec, driftSignData); - if(outliers!=null) - isOutlier.put(trackCollec, isOutlierData); - } - //no data for this collection in file so save null to vector - if(drifts==null) - driftSign.put(trackCollec, null); - if(outliers==null) - isOutlier.put(trackCollec, null); - } - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ATauJetData.java b/graphics/AtlantisJava/src/atlantis/data/ATauJetData.java deleted file mode 100755 index 91ebb9af7757f2edcc796ee86e483f739d0062bf..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ATauJetData.java +++ /dev/null @@ -1,198 +0,0 @@ -package atlantis.data; - -import java.util.Vector; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; -import atlantis.utils.A4Vector; - -/** - * Reconstructed Tau Jet - */ -public class ATauJetData extends AAODData -{ - // Note: This is a hierarchy list ! I.e. TauCutTight is assumed to have passed - // all other criteria as well. This is strictly not completely correct but - // good enough for Atlantis purposes. - private enum isTau { TauCutTight, TauCutMedium, TauCutLoose, TauLlhTight, TauLlhMedium, TauLlhLoose, none } - - private float[] charge; - private int[] integerCharge; - private int[] numTracks; - private float[] isolFrac; - private float[] logLhRatio; - private String[] label; - private Vector<Enum> isTauEnum = new Vector<Enum>(); - - ATauJetData(AHashMap p, AEvent e) - { - super(p,e); - charge=p.getFloatArray("charge"); - integerCharge = new int[charge.length]; - - // The recommended default cut for Tau charge is to equal to 1/-1, - // but the cut for float value has no "=" operator in the - // implementation, so change float[] to int[] to make it possible - // to use "=". - for(int i=0; i<charge.length; ++i) - { - integerCharge[i] = (int) charge[i]; - } - numTracks=p.getUnknownIntArray("numTracks"); - isolFrac=p.getUnsureFloatArray("isolFrac"); - logLhRatio=p.getUnsureFloatArray("logLhRatio"); - label=p.getUnsureStringArray("label"); - String[] isTauString=p.getUnsureStringArray("isTauString"); - - if(isTauString!=null){ - for(String s : isTauString) - { - try { - isTauEnum.add(isTau.valueOf(s)); - } - catch(IllegalArgumentException q) { - isTauEnum.add(isTau.none); - } - } - } - else - { - for(int i=0;i<numData;i++) - { - isTauEnum.add(isTau.none); - } - } - } - - public String getParameterGroup() - { - return "TauJet"; - } - - public String getName() - { - return "TauJet"; - } - - public float getCharge(int index) - { - return charge[index]; - } - - public int getNumTracks(int index) - { - return numTracks[index]; - } - - public float getIsolFrac(int index) - { - if(isolFrac != null) return isolFrac[index]; - else return -100; - } - - public float getLogLhRatio(int index) - { - if(logLhRatio != null) return logLhRatio[index]; - else return -100; - } - - public String getisTau(int index) - { - return isTauEnum.get(index).toString(); - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - for (int i = 0; i < num; ++i) - { - int k = list[i]; - A4Vector start = new A4Vector(); - start.setPtEtaPhiM(pT[k],eta[k],phi[k],1.77682); - sum.add(start); - } - - return sum; - } - - protected void applyCuts() - { - super.applyCuts(); - cut("CutsObjects", "TauJetPt", " |ET|", pT); - cut("CutsObjects", "TauJetCharge", " |Charge|", integerCharge); - cut("CutsObjects", "TauJetNumTracks", " |NumTracks|", numTracks); - if(isolFrac != null) - cut("CutsObjects", "TauJetisolFrac", " isolFrac", isolFrac); - if(logLhRatio != null) - cut("CutsObjects", "TauJetlogLhRatio", " logLhRatio", logLhRatio); - - if (parameterStore.get("CutsObjects", "TauJetisTauString").getStatus()) - { - int cutSub = parameterStore.get("CutsObjects", "TauJetisTauString").getI(); - cutArrayEnum(isTauEnum, cutSub, "TauJet isTauString"); - } - } - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0){ - String output = getNameScreenName()+" index: " + index; - if(simpleOutput==1 || simpleOutput==3) - output+= "\n PT="+String.format("%.3f",pT[index])+" GeV\n "+ - AMath.ETA+" = "+String.format("%.3f",eta[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - if(simpleOutput==2 || simpleOutput==3) - output+= "\n Px="+String.format("%.3f",pT[index]*Math.cos(phi[index]))+" GeV "+ - "\n Py="+String.format("%.3f",pT[index]*Math.sin(phi[index]))+" GeV "+ - "\n Pz="+String.format("%.3f",pT[index]*Math.sinh(eta[index]))+" GeV "; - return output; - } - - String k = this.getStoreGateKey(); - String sgKey = k != null ? k : "n/a"; - StringBuffer msg = new StringBuffer(getNameScreenName()); - msg.append(" (id: " + id[index] + " index: " + index + ")"); - msg.append("\n storegate key: "); - msg.append(sgKey); - msg.append("\n PT = "); - msg.append(String.format("%.3f",pT[index])); - msg.append(" GeV\n P = "); - msg.append(String.format("%.3f",Math.abs(pT[index]/Math.cos(AMath.lambda(eta[index]))))); - msg.append(" GeV\n Charge = "); - msg.append(integerCharge[index]); - msg.append("\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.3f",eta[index])); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.3f",Math.toDegrees(phi[index]))); - msg.append(AMath.DEGREES); - msg.append(" (" + String.format("%.3f",phi[index]) + " rad)"); - msg.append("\n numTracks = "); - msg.append(numTracks[index]); - - if (label != null) - { - msg.append("\n label = "); - msg.append(label[index]); - } - if (isolFrac != null) - { - msg.append("\n isolFrac = "); - msg.append(isolFrac[index]); - } - if (logLhRatio != null) - { - msg.append("\n logLhRatio = "); - msg.append(logLhRatio[index]); - } - - return msg.toString(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ATrackData.java b/graphics/AtlantisJava/src/atlantis/data/ATrackData.java deleted file mode 100644 index bc680fdd7b15fe415c6b2ec54a2681b1529748d4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ATrackData.java +++ /dev/null @@ -1,1389 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.canvas.ACanvas; -import atlantis.utils.AMath; -import atlantis.utils.AHashMap; -import atlantis.utils.AAtlantisException; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AParameterUtilities; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.projection.AProjectionXZ; -import atlantis.graphics.AGraphics; -import atlantis.canvas.AWindow; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjection3D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.projection.AProjectionPhi; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionYX; -import atlantis.projection.AProjectionYZ; -import atlantis.projection.AProjectionsManager; -import atlantis.utils.A4Vector; -import atlantis.utils.ALogger; - -/** - * - * base class for ASTrData - Simulated Track - * AInDetTrackData - Reconstructed Inner Detector Track - * AMuonTrackData - Reconstructed Muon Detector Track - * - */ -public abstract class ATrackData extends AData -{ - private static final ALogger logger = ALogger.getLogger(ATrackData.class); - - public static final int DRAW_HELIX = 0; - public static final int DRAW_POLYLINE = 1; - public static final int DRAW_SMOOTH = 2; - public static final int DRAW_NEWHELIX = 3; - public static final int ADD_HELIX_POINTS = 0; - - /** True if track residual is available */ - private boolean hasResidual = false; - - protected ATrackResidualData[] residuals = null; - - /** True if reconstructed track event data contains polyline information */ - protected boolean polylinedTrack = false; - - // these attributes are used to store polyline coordinates of tracks - protected float x[][] = null; - protected float y[][] = null; - protected float z[][] = null; - protected float rho[][] = null; - protected float phi[][] = null; - - protected int numHelix[] = null; - protected boolean cosmic[] = null; - - protected AHelix[] h = null; - - /** - * rhoVertex value - for STr provided in the event file, for reconstructed - * track (Track) it is calculated from first polyline coordinates. - * This value is tested in cutRhoVertexAfterInDetRadius() method. - */ - protected float[] rhoVertex = null; - - protected int[] index = null; - - protected float chi2[] = null; - protected int numDoF[] = null; - private int[] vertexType = null; - - // methods -------------------------------------------------------------- - - ATrackData(AHashMap p, AEvent e) throws AAtlantisException - { - super(p,e); - - String assocKey = getName() + getStoreGateKey(); - if (p.get("barcode") != null) - { - int[] barcode = p.getUnknownIntArray("barcode"); - AAssociation assoc = new AAssociation(assocKey, "STr", null, barcode, event); - event.getAssociationManager().add(assoc); - } - //Get vertex type numbers - vertexType = p.getUnsureIntArray("vertexType"); - // if residual information is provided, second check is a workaround for a JiveXML bug -- EJ - if(p.get("numTsos")!=null && p.get("tsosPullLoc1")!=null) - { - hasResidual = true; - residuals = new ATrackResidualData[numData]; - int[] numTsos = p.getIntArray("numTsos"); - float[] tsosPullLoc1 = p.getFloatArray("tsosPullLoc1"); - float[] tsosResLoc1 = p.getFloatArray("tsosResLoc1"); - float[] tsosPullLoc2 = p.getFloatArray("tsosPullLoc2"); - float[] tsosResLoc2 = p.getFloatArray("tsosResLoc2"); - String[] tsosDetType = p.getUnsureStringArray("tsosDetType"); - - int num = 0; - for(int i=0; i<numData; i++) - { - int numPoints = numTsos[i]; - float[] pullLoc1 = new float[numPoints]; - float[] resLoc1 = new float[numPoints]; - float[] pullLoc2 = new float[numPoints]; - float[] resLoc2 = new float[numPoints]; - String[] detType = null; - if(tsosDetType != null) - detType = new String[numPoints]; - - for(int j=0; j<numPoints; j++) - { - pullLoc1[j] = tsosPullLoc1[num]; - resLoc1[j] = tsosResLoc1[num]; - pullLoc2[j] = tsosPullLoc2[num]; - resLoc2[j] = tsosResLoc2[num]; - if(tsosDetType != null) - detType[j] = tsosDetType[num]; - num++; - } - residuals[i] = new ATrackResidualData(this, i, numPoints, pullLoc1, - resLoc1, pullLoc2, resLoc2, detType); - } - } - - // helix may come in different formats: - // * helix track from reconstructed track ? - if (p.get("d0") != null) - { - h = new AHelix[numData]; - - float[] d0 = p.getFloatArray("d0"); - float[] phi0 = p.getFloatArray("phi0"); - float[] tl = p.getFloatArray("cotTheta"); - float[] pt = p.getFloatArray("pt"); - float[] z0 = p.getFloatArray("z0"); - - // this patch is useful when reading old event files generated by - // some older version of JiveXML, in which cotTheta is set to inf by - // error when eta equals to 0 for IDScan Tracks - if ("TrigInDetTrack".equals((String) p.get("storeGateKey"))) - { - for(int i = 0; i < tl.length; i++) - { - if(Float.isInfinite(tl[i])) - tl[i] = 0.0f; - } - } // end of the patch - - // 2005-11-16 - numbers in event file in covMatrix too small, a lot - // of them were 0.00000 hence multiplied by 10000 in JiveXML and - // divided here by 10000. only Vertex fitter affected, didn't work - // before anyway, so numbers are divided for all events - if (p.get("covMatrix") != null) - { - float[][][] cov = new float[numData][5][5]; - float[] covMatrix = p.getFloatArray("covMatrix"); - // dividing numbers - for (int i = 0; i < covMatrix.length; i++) - { - covMatrix[i] = covMatrix[i] / 10000; - } - - int n = 0; - for (int i = 0; i < numData; i++) - { - for (int j = 0; j < 5; j++) - { - for (int k = 0; k < j + 1; k++) - { - cov[i][j][k] = covMatrix[n++]; - cov[i][k][j] = cov[i][j][k]; - } - } - - h[i] = new AHelix(d0[i], z0[i], (float) Math.toDegrees(phi0[i]), tl[i], pt[i], cov[i]); - } - } - else - { - for (int i = 0; i < numData; i++) { - h[i] = new AHelix(d0[i], z0[i], (float) Math.toDegrees(phi0[i]), tl[i], pt[i]); - } - } - } - // * helix track from simulated charged tracks ? - else if (p.get("rhoVertex") != null) - { - h = new AHelix[numData]; - - // STr - save rhoVertex value for tests - rhoVertex = p.getFloatArray("rhoVertex"); - float[] rhoEndVertex = p.getFloatArray("rhoEndVertex"); - float[] pt = p.getFloatArray("pt"); - float[] phi = p.getFloatArray("phi"); - float[] eta = p.getFloatArray("eta"); - float[] phiVertex = p.getFloatArray("phiVertex"); - float[] zVertex = p.getFloatArray("zVertex"); - // charge is calculated in ASTrData, based on code subtag - // information and pdg.xml data - int[] charge = p.getIntArray("charge"); - for (int i = 0; i < numData; i++) - { - //Create helix w/ end vertex information if rhoEndVertex is set - if ( rhoEndVertex[i] != 0.0 ) - h[i] = new AHelix(rhoVertex[i], phiVertex[i], zVertex[i], pt[i], - (float)Math.toDegrees(phi[i]), eta[i], charge[i], rhoEndVertex[i]); - //Otherwise create helix w/o end vertex information - else - h[i] = new AHelix(rhoVertex[i], phiVertex[i], zVertex[i], pt[i], - (float)Math.toDegrees(phi[i]), eta[i], charge[i] ); - } - } - - // if polyline information is provided for tracks - if(p.get("numPolyline") != null) - { - int[] numPolyline = p.getIntArray("numPolyline"); - - boolean hasPolyline = false; - for (int i=0; i<numData; i++) { - if (numPolyline[i] > 0) { - hasPolyline = true; - break; - } - } - - if (hasPolyline) { - polylinedTrack = true; - x = new float[numData][]; - y = new float[numData][]; - z = new float[numData][]; - rho = new float[numData][]; - phi = new float[numData][]; - rhoVertex = new float[numData]; - numHelix = new int[numData]; - cosmic = new boolean[numData]; - - float[] polyX = p.getFloatArray("polylineX"); - float[] polyY = p.getFloatArray("polylineY"); - float[] polyZ = p.getFloatArray("polylineZ"); - int num = 0; - - for(int i = 0; i < numData; ++i) - { - numHelix[i] = 0; - cosmic[i] = false; - - // Do some checks on the track, decide what drawing we enable/disable for it. - if (numPolyline[i] >= 2) { - int first = num; - int next = num+1; - - // Find the next different point on the track. - while (next < numPolyline[i]-1 && polyX[next]==polyX[first] && polyY[next]==polyY[first]) next++; - - // Determine what direction the track has in rho and z. - float rStart = (float)Math.sqrt(polyX[first]*polyX[first] + polyY[first]*polyY[first]); - float rDir = (float)Math.sqrt(polyX[next]*polyX[next] + polyY[next]*polyY[next]) - rStart; - float zDir = Math.abs(polyZ[next]) - Math.abs(polyZ[first]); - - // Now in order to extrapolate to the IP we the track to: - // - go radially outwards - // - go away from the IP in z - // - have perigee parameters - // - have its first polyline point some distance from the perigee - // - be an InDetTrack - if (rDir > 0 && zDir > 0 && h != null && h[i] != null && rStart-Math.abs(h[i].d0()) > 1 - && this instanceof AInDetTrackData) { - numHelix[i] = ADD_HELIX_POINTS; - } - - // Check if this is perhaps a cosmic. Cosmics are allowed - // to be drawn on both sides in the rho-z projection - if (rDir < 0) { - cosmic[i] = true; - } - } else if (h != null && h[i] != null && this instanceof AInDetTrackData) { - - // In case of a track with only perigee parameters, draw it also as a helix. - numHelix[i] = ADD_HELIX_POINTS; - } - - x[i] = new float[numPolyline[i]+numHelix[i]]; - y[i] = new float[numPolyline[i]+numHelix[i]]; - z[i] = new float[numPolyline[i]+numHelix[i]]; - rho[i] = new float[numPolyline[i]+numHelix[i]]; - phi[i] = new float[numPolyline[i]+numHelix[i]]; - - for(int j = 0; j < numPolyline[i]; ++j) - { - x[i][j+numHelix[i]] = polyX[num]; - y[i][j+numHelix[i]] = polyY[num]; - z[i][j+numHelix[i]] = polyZ[num]; - rho[i][j+numHelix[i]] = (float)Math.sqrt(polyX[num]*polyX[num]+polyY[num]*polyY[num]); - num++; - - if(j == 0) - { - // first coordinate of a track - calculate rhoVertex - rhoVertex[i] = (float) Math.sqrt( x[i][numHelix[i]] * x[i][numHelix[i]] + - y[i][numHelix[i]] * y[i][numHelix[i]] ); - } - } - - if (h != null && h[i] != null) { - h[i].setPoints(x[i], y[i], z[i], numPolyline[i]); - } - - // When perigee parameters are available we extend the track all the way down to the IP - if (numHelix[i] > 0) { - // Radius of curvature of this track in the magnetic field - double R = parameterStore.get("Event", "Curvature").getD() * Math.abs(h[i].pT()); - - // +1/-1 for a clockwise/anti-clockwise helix - double S = AMath.getSign(h[i].pT()); - - // Coordinates of the center point for the helix - double xC = (S * h[i].d0() - R) * Math.cos(Math.toRadians(h[i].phi0()) + S * Math.PI / 2.); - double yC = (S * h[i].d0() - R) * Math.sin(Math.toRadians(h[i].phi0()) + S * Math.PI / 2.); - - // Determine to what radius we have to draw this track based on its - // perigee parameters. When space points are available for the track - // we stop before the first space point and make a smooth connection. - // If no space points are available we draw all the way through the - // inner detector. Not any further though, because the track will stop - // curving when it leaves the magnetic field. - double Rmax; - if (numPolyline[i] > 0) { - Rmax = Math.min(parameterStore.get("RTr", "RadiusTr").getD(), - Math.abs(Math.sqrt(x[i][numHelix[i]]*x[i][numHelix[i]] - + y[i][numHelix[i]]*y[i][numHelix[i]]) - 1)); - } else { - Rmax = parameterStore.get("RTr", "RadiusTr").getD(); - } - - // Calculate the phi value at which our helix intersects the maximum - // radius determined above. We have one circle (detector) centered at - // the origin with radius Rmax. The other circle (helix) we imagine to - // be at x=d with a radius R. Now we can easily calculate the coordinates - // (xI,+/-yI) of the intersection points. The curving direction of the - // helix determines which value of yI we have to use. Finally, the phiMax - // we're interested in is the polar angle with respect to the center of the - // helix at x=d. Calculation is straightforward. By adding phi0+S*PI/2 - // (as we do below) this solution is also valid for helices centered - // around y!=0. - double d = Math.sqrt(xC * xC + yC * yC); - double xI = (Rmax * Rmax - R * R + d * d) / (2 * d); - double yI = Math.sqrt(Rmax * Rmax - xI * xI); - double phiMax = Math.atan2(S * yI, d - xI); - - // This spreads the number of helix points evenly across the part of the - // helix we're going to draw - double dphi = phiMax / numHelix[i]; - - for (int j=0; j<numHelix[i]; j++) { - // Points on the helix in user coordinates - x[i][j] = (float) (xC + R * Math.cos(Math.toRadians(h[i].phi0()) + S * Math.PI/2. - j * dphi)); - y[i][j] = (float) (yC + R * Math.sin(Math.toRadians(h[i].phi0()) + S * Math.PI/2. - j * dphi)); - - // In R-Z the track is just a straight line - rho[i][j] = (float) Math.sqrt(x[i][j]*x[i][j] + y[i][j]*y[i][j]); - z[i][j] = (float) (h[i].z0() + h[i].cotanTheta() * (rho[i][j] - h[i].d0())); - } - } - - for (int j=0; j<numPolyline[i]+numHelix[i]; j++) { - phi[i][j] = (float)Math.atan2(y[i][j], x[i][j]); - - if (j>0 && Math.abs(phi[i][j-1]-phi[i][j]) > Math.PI) { - - // Don't let phi wrap around - if (phi[i][j] > phi[i][j-1]) { - phi[i][j] -= 2*Math.PI; - } else { - phi[i][j] += 2*Math.PI; - } - } - } - } - } - } // if(p.get("numPolyline") - - if (h != null) - { - double[] phi = new double[numData]; - for (int i = 0; i < numData; i++) - phi[i] = h[i].phi0(); - index = indexBy(phi); - } - else if(x != null && y != null) - { - double[] phi = new double[numData]; - for(int i = 0; i < numData; i++) - { - // if number of polylines for a track is 0 - Atlantis used - // to crash here with IndexOutOfBoundException - // check to avoid crashes with old events, from some point - // JiveXML doesn't output tracks with number of polylines - // coordinates less then 2 - if(x[i].length > 0 && y[i].length > 0) - { - phi[i] = Math.toDegrees(Math.atan2(y[i][0], x[i][0])); - } - else - { - String m = getName() + ":" + getStoreGateKey() + - " datatype rejected\n" + - "(no polyline coordinates)."; - throw new AAtlantisException(m, false); // non fatal - } - } - index = indexBy(phi); - } - - if (p.get("chi2") != null) chi2 = p.getFloatArray("chi2"); - if (p.get("numDoF") != null) numDoF = p.getIntArray("numDoF"); - } // ATrackData() ------------------------------------------------------- - - - public float[][] getX() - { - return x; - } - - public float[][] getY() - { - return y; - } - - public float[][] getZ() - { - return z; - } - - public float[][] getRho() - { - return rho; - } - - public float[][] getPhi() - { - return phi; - } - - public boolean getResidualStatus() - { - return hasResidual; - } - - public ATrackResidualData getTrackResidual(int index) - { - return residuals[index]; - } - - // moved from the former iPatData class where it was without the condition - protected void calculateRhoPhi() - { - if(!polylinedTrack) { - super.calculateRhoPhi(); - } - } // calculateRhoPhi() -------------------------------------------------- - - - - protected void applyCuts() - { - cutIndex(); - if (h != null) - { - cut("CutsInDet", "z0-zVtx", " |z0-zVtx|", getZ0Primary()); - cut("CutsInDet", "z0", " |z0|", getZ0()); - cut("CutsInDet", "Pt", " |Pt|", getPt()); - cut("CutsInDet", "d0", " |d0|", getD0()); - cut("CutsInDet", "d0Loose", " |d0Loose|", getD0()); - } - cutPhi(); - cutEta(); - cutNextInDrawList(); - cutReconstructedVertex(); - } // applyCuts() -------------------------------------------------------- - - - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+ - ((h!=null)?h[index].toString():""); - - - String msg = getNameScreenName() + " (id: " + id[index] + " index: " + index + ")"; - msg += "\n storegate key: "; - msg += (storeGateKey == null ? "n/a" : storeGateKey); - if (h != null) - msg += h[index].toString(); - if (chi2 != null && numDoF != null) - msg += "\n chi2/numDoF = " + chi2[index]/numDoF[index]; - return msg; - - } // getHitInfo() ------------------------------------------------------- - - - // all get**User() methods which are only called when tracks are drawn - // as polylines - protected ACoord getYXUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int numPoints = x[list].length; - hv[0][i] = new double[numPoints]; - hv[1][i] = new double[numPoints]; - for(int j = 0; j < numPoints; j++) - { - hv[0][i][j] = x[list][j]; - hv[1][i][j] = y[list][j]; - } - index[i] = list; - } - - if (parameterStore.get(PARAMETER_GROUP, "DrawnAs").getI() == DRAW_SMOOTH) - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES); - else - return new ACoord(hv, index, this, ACoord.POLYLINES); - - } // getYXUser() -------------------------------------------------------- - - - - protected ACoord getFRUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int numPoints = x[list].length; - int skip = 0; - - // Skip points with very small R, phi changes rapidly here - for (skip=0; skip<numPoints; skip++) - if (rho[list][skip] > 2.) break; - - hv[0][i] = new double[numPoints-skip]; - hv[1][i] = new double[numPoints-skip]; - - double phiStart = 0.; - if(numPoints > 0) phiStart = phi[list][0]; - for(int j = skip; j < numPoints; j++) - { - double phiTemp = phi[list][j]; - if(phiTemp - phiStart > Math.PI) phiTemp -= AMath.TWO_PI; - if(phiTemp - phiStart < -Math.PI) phiTemp += AMath.TWO_PI; - - hv[0][i][j-skip] = rho[list][j]; - hv[1][i][j-skip] = Math.toDegrees(phiTemp); - } - index[i] = list; - } - - if (parameterStore.get(PARAMETER_GROUP, "DrawnAs").getI() == DRAW_SMOOTH) - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES).includePhiWrapAround("FR"); - else - return new ACoord(hv, index, this, ACoord.POLYLINES).includePhiWrapAround("FR"); - - } // getFRUser() -------------------------------------------------------- - - - - protected ACoord getFZUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int numPoints = x[list].length; - int skip = 0; - - // Skip points with very small R, phi changes rapidly here - for (skip=0; skip<numPoints; skip++) - if (rho[list][skip] > 2.) break; - - hv[0][i] = new double[numPoints-skip]; - hv[1][i] = new double[numPoints-skip]; - // treat phi wraparound - double phiStart = 0.; - if(numPoints > 0) phiStart = phi[list][0]; - for(int j = skip; j < numPoints; j++) - { - hv[0][i][j-skip] = z[list][j]; - double phiTemp = phi[list][j]; - if(phiTemp - phiStart > Math.PI) phiTemp -= AMath.TWO_PI; - if(phiTemp - phiStart < -Math.PI) phiTemp += AMath.TWO_PI; - hv[1][i][j-skip] = Math.toDegrees(phiTemp); - } - index[i] = list; - } - - if (parameterStore.get(PARAMETER_GROUP, "DrawnAs").getI() == DRAW_SMOOTH) - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES).includePhiWrapAround("FZ"); - else - return new ACoord(hv, index, this, ACoord.POLYLINES).includePhiWrapAround("FZ"); - - } // getFZUser() -------------------------------------------------------- - - - - protected ACoord getRZUser() - { - // not quite correct need to split tracks crossing phi boundary - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int numPoints = rho[list].length; - hv[0][i] = new double[numPoints]; - hv[1][i] = new double[numPoints]; - - if (numPoints > 0) { - int sign = AParameterUtilities.getRhoSign(x[list][numPoints-1], y[list][numPoints-1]); - for(int j = 0; j < numPoints; j++) - { - if (cosmic != null && cosmic[i]) { - sign = AParameterUtilities.getRhoSign(x[list][j], y[list][j]); - } - hv[0][i][j] = z[list][j]; - hv[1][i][j] = rho[list][j] * sign; - } - } - index[i] = list; - } - - if (parameterStore.get(PARAMETER_GROUP, "DrawnAs").getI() == DRAW_SMOOTH) - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES); - else - return new ACoord(hv, index, this, ACoord.POLYLINES); - - } // getRZUser() -------------------------------------------------------- - - - - protected ACoord getXZUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - double phi0 = Math.toRadians(AProjectionXZ.getPhi()); - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int numPoints = rho[list].length; - hv[0][i] = new double[numPoints]; - hv[1][i] = new double[numPoints]; - for(int j = 0; j < numPoints; j++) - { - hv[0][i][j] = z[list][j]; - hv[1][i][j] = rho[list][j] * Math.cos(phi[list][j] - phi0); - } - index[i] = list; - } - - if (parameterStore.get(PARAMETER_GROUP, "DrawnAs").getI() == DRAW_SMOOTH) - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES); - else - return new ACoord(hv, index, this, ACoord.POLYLINES); - - } // getXZUser() -------------------------------------------------------- - - protected ACoord getYZUser() - { - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - double phi0 = Math.toRadians(AProjectionXZ.getPhi()); - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - int numPoints = rho[list].length; - hv[0][i] = new double[numPoints]; - hv[1][i] = new double[numPoints]; - for(int j = 0; j < numPoints; j++) - { - hv[0][i][j] = z[list][j]; - hv[1][i][j] = rho[list][j] * Math.sin(phi[list][j] - phi0); - } - index[i] = list; - } - - if (parameterStore.get(PARAMETER_GROUP, "DrawnAs").getI() == DRAW_SMOOTH) - return new ACoord(hv, index, this, ACoord.SMOOTH_POLYLINES); - else - return new ACoord(hv, index, this, ACoord.POLYLINES); - - } // getYZUser() -------------------------------------------------------- - - - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if(h != null && (projection instanceof AProjectionVP || projection instanceof AProjection3D)) - { - // in VPlot only helices are drawn, so try to draw tracks as helices - // in VPlot by default ignoring Track->DrawAs option for VPlot - drawHelix(window, ag, projection); - } - else - { - AParameter drawPar = parameterStore.get(PARAMETER_GROUP, "DrawnAs"); - int drawnAs = drawPar != null ? drawPar.getI() : DRAW_HELIX; - if (polylinedTrack && (h == null || drawnAs == DRAW_POLYLINE || drawnAs == DRAW_SMOOTH)) - { - // draw as polyline - ag.draw(window.calculateDisplay(getUser(projection))); - } - else if (h != null) - { - // draw as helix - drawHelix(window, ag, projection); - } - } - - } // draw() ------------------------------------------------------------- - - protected void cutRhoVertexAfterInDetRadius() - { - int num = 0; - int wrong = 0; - int list = 0; - double rho = 108; // 1.08m - double parRhoTr = parameterStore.get("RTr", "RadiusTr").getD(); - for(int i = 0; i < numDraw; i++) - { - list = listdl[i]; - if(this.rhoVertex[list] > Math.min(rho, parRhoTr)) - { - wrong++; - } - else - { - // include into drawlist - listdl[num++] = list; - } - } - - if(wrong > 0) - { - logger.debug("AHelix.cutRhoVertexAfterInDetRadius()"); - String key = this.getStoreGateKey(); - key = key != null ? ":" + key : ""; - logger.debug(" " + numDraw + " " + this.getName() + key + - " before test, " + wrong + " removed\n"); - } - numDraw = num; - } // cutRhoVertexAfterInDetRadius() ------------------------------------- - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - switch (colorFunction) - { - case 0: - colorByConstant(); - break; - case 1: - colorByIndex(index); - break; - case 2: - colorBy(getPt()); - break; - case 3: - colorByCollection(); - break; - case 4: - colorBy("STr"); - break; - case 5: - colorBy(getRVx()); - break; - case 6: - colorBy(getJets()); - break; - case 7: // by objects - colorByObjects(); - break; - } - - return 7; - } - - public int[] getDrawList() - { - int[] temp = new int[numDraw]; - System.arraycopy(listdl, 0, temp, 0, numDraw); - return temp; - } - - protected void cutNextInDrawList() - { - AParameter nextTrkPar = parameterStore.get(PARAMETER_GROUP, "NextTrack"); - if(!nextTrkPar.getStatus()) - { - return; - } - if(numDraw == 0) - { - return; - } - - int nextTrk = nextTrkPar.getI() % numData; - int nextTrkIndex = nextTrk; - boolean hasFound = false; - while (!hasFound) - { - for (int i=0; i<numDraw; ++i) - { - if(listdl[i] == nextTrk) - { - nextTrkIndex = nextTrk; - hasFound = true; - } - } - if(!hasFound) - nextTrk = (nextTrk + 1) % numData; - } - nextTrkPar.setI(nextTrkIndex); - numDraw = 1; - listdl[0] = nextTrkIndex; - } - - protected void cutPhi() - { - AParameter par = parameterStore.get("CutsATLAS", "CutPhi"); - boolean usePhiCut = par.getStatus(); - - if (usePhiCut) - { - // use degrees for tracks - double phiCut = par.getD(); - double phiMid = AMath.nearestPhiDegrees(parameterStore.get("CutsATLAS", "PhiMiddle").getD()); - // use vplot as projection - AProjection2D projection = (AProjection2D) AProjectionsManager.getProjection("VP"); - - int num = 0; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - ADHelix dH = new ADHelix(h[list]); - double s1 = dH.getAStart(); - double s2 = dH.getAEnd(); - s1 = dH.intersectWithRadialCylinder(projection.getMinRho(), s1, s2); - double sEnd = dH.intersectWithCylinder(true, AProjectionVP.getRhoVPlot(), true, AProjectionVP.getZVPlot()); - s2 = Math.max(Math.min(s2, sEnd), s1); - - double phiDiffStart = Math.abs(AMath.nearestPhiDegrees(dH.getPhi(s1), phiMid) - phiMid); - double phiDiffEnd = Math.abs(AMath.nearestPhiDegrees(dH.getPhi(s2), phiMid) - phiMid); - double phiDiffMiddle = Math.abs(AMath.nearestPhiDegrees(dH.getPhi((s1 + s2) / 2), phiMid) - phiMid); - // treats wrap around - int numPointsInside = 0; - - if (phiDiffStart < phiCut) - numPointsInside++; - if (phiDiffMiddle < phiCut) - numPointsInside++; - if (phiDiffEnd < phiCut) - numPointsInside++; - if (numPointsInside > 1) - listdl[num++] = list; - } - numDraw = num; - } - } - - /** - * Cut tracks if connected/unconnected to reconstructed vertices. - */ - protected void cutReconstructedVertex() - { - int cutOption = parameterStore.get("CutsObjects", "RTrsByRVtx").getI(); - cutByAssociationTo( "RVx", getReconstructedTracks(), cutOption); - } - - - protected void cutEta() - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - - if (par.getStatus()) - { - // use vplot as projection - AProjection2D projection = (AProjection2D) AProjectionsManager.getProjection("VP"); - - double etaCut = par.getD(); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaC1 = etaMid - etaCut; - double etaC2 = etaMid + etaCut; - int num = 0; - for (int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - ADHelix dH = new ADHelix(h[list]); - double s1 = dH.getAStart(); - double s2 = dH.getAEnd(); - s1 = dH.intersectWithRadialCylinder(projection.getMinRho(), s1, s2); - double sEnd = dH.intersectWithCylinder(true, AProjectionVP.getRhoVPlot(), true, AProjectionVP.getZVPlot()); - s2 = Math.max(Math.min(s2, sEnd), s1); - double[] etaPoints = new double[] { dH.getEta(s1), dH.getEta((s1 + s2) / 2), dH.getEta(s2) }; - - int numPointsInside = 0; - for (int j = 0; j < etaPoints.length; ++j) - if (etaC1 < etaPoints[j] && etaPoints[j] < etaC2) - numPointsInside++; - if (numPointsInside > 1) - listdl[num++] = list; - } - numDraw = num; - } - } - - // does not work correctly if primary vertex is displaced in YX plane - private float[] getZ0Primary() - { - double[] pVtx = event.getPrimaryVertex(); - float[] temp = new float[numData]; - double zVertex = pVtx[2]; - for (int i = 0; i < numDraw; i++) - temp[listdl[i]] = (float) (h[listdl[i]].z0() - zVertex); - return temp; - } - - private float[] getZ0() - { - float[] temp = new float[numData]; - for (int i = 0; i < numDraw; i++) - temp[listdl[i]] = (float) h[listdl[i]].z0(); - return temp; - } - - protected float[] getPt() - { - float[] temp = new float[numData]; - for (int i = 0; i < numDraw; i++) - temp[listdl[i]] = (float) h[listdl[i]].pT(); - return temp; - } - - - // d0 is calculated w.r.t. to XY position of the primary vertex - private float[] getD0() - { - double[] pVtx = event.getPrimaryVertex(); - float[] temp = new float[numData]; - for (int i = 0; i < numDraw; i++) - { - double phi0 = Math.toRadians(h[listdl[i]].phi0()); - - temp[listdl[i]] = (float) (-h[listdl[i]].d0() + pVtx[1] * Math.cos(phi0) - pVtx[0] * Math.sin(phi0)); - - } - return temp; - } - - - // give back Drawable helices - public ADHelix[] getHelices() - { - makeDrawList(); - ADHelix[] tempList = new ADHelix[numDraw]; - - for (int i = 0; i < numDraw; i++) - if (h != null && h[listdl[i]] != null) - { - tempList[i] = new ADHelix(h[listdl[i]]); - if (tempList[i].getAStart() == tempList[i].getAEnd()) - { - tempList[i] = null; - } - } - else - tempList[i] = null; - return tempList; - } - - // used by vertex package when changing the position on the helix from which - // to start drawing - public AHelix getModifiableHelix(int i) - { - if (h != null) - return h[i]; - else - return null; - } - - // info on tracks contained in vplot rubberband - public String getVPHitInfo() - { - makeDrawList(); - if (numDraw == 0) - return ""; - double sumP = 0.; - double sumPt = 0.; - - for (int i = 0; i < numDraw; ++i) - { - sumPt += Math.abs(h[listdl[i]].pT()); - sumP += AMath.getPFromPttL(h[listdl[i]].pT(), h[listdl[i]].cotanTheta()); - } - - String msg = numDraw + " " + getFullName(); - msg += " sum(PT) = " + String.format("%.1f",sumPt) + " sum(P) = " + String.format("%.1f",sumP); - return msg; - } - - public A4Vector get4Vector(int num, int[] list) - { - A4Vector sum = new A4Vector(); - for (int i = 0; i < num; ++i) { - if (h == null || h[list[i]] == null) continue; - // Use the pion mass (~140 MeV) here - sum.add(new A4Vector(h[list[i]].p(), 0.14)); - } - return sum; - } - - public A4Vector get4Vector(int num, int[] list, double mass) - { - A4Vector sum = new A4Vector(); - for (int i = 0; i < num; ++i) { - if (h == null || h[list[i]] == null) continue; - sum.add(new A4Vector(h[list[i]].p(), mass)); - - - } - return sum; - } - - public void zoomAroundTracks() - { - AWindow window = ACanvas.getCanvas().getCurrentWindow(); - AProjection projection = window.getProjection(); - if (projection instanceof AProjectionLegoPlot) - { - AOutput.append("Zoom Next Track unavailable for LegoPlot\n", ALogInterface.NORMAL); - } - else if (projection instanceof AProjection2D) - { - ACoord user; - if (projection instanceof AProjectionVP) - user = window.calculateUser(getVPDisplayHelices(window, (AProjection2D) projection)); - else if (polylinedTrack) - user = getUser((AProjection2D) projection); - else - user = window.calculateUser(getDisplayHelices(window, (AProjection2D) projection)); - double[] min = new double[2]; - double[] max = new double[2]; - min[0] = min[1] = 100000.; - max[0] = max[1] = -100000.; - for (int i = 0; i < 2; ++i) - for (int j = 0; j < user.hv[i].length; ++j) - for (int k = 0; k < user.hv[i][j].length; ++k) - { - if (user.hv[i][j][k] < min[i]) - min[i] = user.hv[i][j][k]; - if (user.hv[i][j][k] > max[i]) - max[i] = user.hv[i][j][k]; - } - // increase by 10% to improve appearence - for (int i = 0; i < 2; ++i) - { - double diff = (max[i] - min[i]) / 2.; - double middle = (max[i] + min[i]) / 2.; - if (diff > 0.) - { - max[i] = middle + 1.1 * diff; - min[i] = middle - 1.1 * diff; - } - } - // ensure entire trt hits included - if (projection instanceof AProjectionPhi) - { - min[1] -= 0.5; - max[1] += 0.5; - } - - if (max[0] - min[0] > 0 && max[1] - min[1] > 0) - { - window.setUserCorners(min[0], max[0], min[1], max[1]); - } - } - } - - public void drawHelix(AWindow window, AGraphics ag, AProjection2D projection) - { - if (projection instanceof AProjectionVP) - { - // phi wrap around is done in user coordinates, so we convert to user coordinates, - // do the phi wrap around and convert back to display coordinates - ag.draw(window.calculateDisplay(window.calculateUser( - getVPDisplayHelices(window, projection)).includePhiWrapAround(projection.getName()) - )); - } - else if (projection instanceof AProjectionRZ) - { - ag.draw(getRZDisplayHelices(window, projection)); - } - else if (projection instanceof AProjectionPhi) - { - // phi wrap around in user coordinates, see above - ag.draw(window.calculateDisplay(window.calculateUser( - getDisplayHelices(window, projection)).includePhiWrapAround(projection.getName()) - )); - - } - else - { - ag.draw(getDisplayHelices(window, projection)); - } - } - - // treat discontinuity when RZ sign changes crossing the phi boundary - private ACoord getRZDisplayHelices(AWindow window, AProjection2D projection) - { - ACoord display = getDisplayHelices(window, projection); - ACoord user = projection.inverseNonLinearTransform(window.calculateUser(display)); - - double[][] rho = user.hv[1]; - - int extraTrackSegments = 0; - - for (int i = 0; i < rho.length; i++) - for (int j = 1; j < rho[i].length - 2; j++) - if (rho[i][j] * rho[i][j + 1] < 0. && Math.abs(rho[i][j]) > 2.) - extraTrackSegments++; - - double hv[][][] = new double[2][rho.length + extraTrackSegments][]; - int index[] = new int[rho.length + extraTrackSegments]; - - extraTrackSegments = 0; - for (int i = 0; i < rho.length; i++) - { - int startOfSegment = 0; - int endOfLastSegment = rho[i].length - 1; - - for (int j = 0; j < rho[i].length - 1; j++) - if (rho[i][j] * rho[i][j + 1] < 0. && Math.abs(rho[i][j]) > 2.) - { - if (j == 0) - { - if (Math.abs(rho[i][0]) > 1.) - startOfSegment = 1; - } - else if (j == rho[i].length - 2) - endOfLastSegment = rho[i].length - 2; - else - { - for (int k = 0; k < hv.length; ++k) - { - hv[k][i + extraTrackSegments] = new double[j + 1 - startOfSegment]; - System.arraycopy(user.hv[k][i], startOfSegment, hv[k][i + extraTrackSegments], 0, j + 1 - startOfSegment); - } - index[i + extraTrackSegments] = user.index[i]; - startOfSegment = j + 1; - extraTrackSegments++; - } - } - if (startOfSegment == 0 && endOfLastSegment == rho[i].length - 1) - { - for (int k = 0; k < hv.length; ++k) - hv[k][i + extraTrackSegments] = user.hv[k][i]; - index[i + extraTrackSegments] = user.index[i]; - } - else - { - for (int k = 0; k < hv.length; ++k) - { - hv[k][i + extraTrackSegments] = new double[endOfLastSegment - startOfSegment + 1]; - System.arraycopy(user.hv[k][i], startOfSegment, hv[k][i + extraTrackSegments], 0, endOfLastSegment - startOfSegment + 1); - } - index[i + extraTrackSegments] = user.index[i]; - } - } - - rho = hv[1]; - for (int i = 0; i < rho.length; i++) - { - int j = 0; - - while (j < rho[i].length && Math.abs(rho[i][j]) < 2.) - j++; - if (j < rho[i].length) - if (rho[i][j] > 0.) - for (int k = 0; k < j; k++) - rho[i][k] = Math.abs(rho[i][k]); - else - for (int k = 0; k < j; k++) - rho[i][k] = -Math.abs(rho[i][k]); - } - - return window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv, index, this, ACoord.POLYLINES))); - } - - protected ACoord getDisplayHelices(AWindow window, AProjection2D projection) - { - AParameter drawPar = parameterStore.get(PARAMETER_GROUP, "DrawnAs"); - int drawnAs = drawPar != null ? drawPar.getI() : DRAW_HELIX; - - if (drawnAs == DRAW_HELIX) { - ADHelix[] dhelix = getHelices(); - double[][][] hv = new double[2][dhelix.length][0]; - int[] index = getDrawList(); - - for (int j = 0; j < dhelix.length; ++j) { - if (dhelix[j] != null) { - double s1 = dhelix[j].getAStart(); // Get start phi-angle - double s2 = dhelix[j].getAEnd(); // Get end phi-angle - - // s1 becomes phi at the intersection of the minimal radius - s1 = dhelix[j].intersectWithRadialCylinder(projection.getMinRho(), s1, s2); // minrho = 0 - // avoid drawing discontinuous in phi - dhelix[j].setPhiStart(s1, s2); - // returning a set of points to be drawn for this helix - ACoord pointsOnHelix = dhelix[j].drawHelix(window, projection, s1, s2); - - hv[0][j] = pointsOnHelix.hv[0][0]; - hv[1][j] = pointsOnHelix.hv[1][0]; - } - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - } else { // DRAW_NEW_HELIX - - // V-plot needs some additional settings - boolean showS3D = parameterStore.get("Data", "S3D").getStatus(); - AParameter shortV = parameterStore.get("VP", "ShortV"); - - makeDrawList(); - double[][][] hv = new double[2][numDraw][]; - int[] index = new int[numDraw]; - - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - index[i] = j; - - if (projection instanceof AProjectionYX) { - - hv[0][i] = h[j].getX(h[j].getAlphaMin(), h[j].getAlphaMax()); - hv[1][i] = h[j].getY(h[j].getAlphaMin(), h[j].getAlphaMax()); - - } else if (projection instanceof AProjectionRZ - || projection instanceof AProjectionXZ - || projection instanceof AProjectionYZ) { - - double alphaMin = h[j].getAlphaCylinder(projection.getMinRho(), AHelix.TRACKER_LENGTH); - hv[0][i] = h[j].getZ(alphaMin, h[j].getAlphaMax()); - hv[1][i] = h[j].getRho(alphaMin, h[j].getAlphaMax(), true); - - if (projection instanceof AProjectionXZ || projection instanceof AProjectionYZ) { - double phiC = AProjectionXZ.getPhi(); - if (projection instanceof AProjectionYZ) phiC += 90; - - double phi[] = h[j].getPhi(alphaMin, h[j].getAlphaMax(), false); - for (int k=0; k<hv[1][i].length; k++) { - hv[1][i][k] = Math.abs(hv[1][i][k]) * Math.cos(Math.toRadians(phi[k] - phiC)); - } - } - } else if (projection instanceof AProjectionFR) { - - double alphaMin = h[j].getAlphaCylinder(projection.getMinRho(), AHelix.TRACKER_LENGTH); - hv[0][i] = h[j].getRho(alphaMin, h[j].getAlphaMax(), false); - hv[1][i] = h[j].getPhi(alphaMin, h[j].getAlphaMax(), false); - - } else if (projection instanceof AProjectionFZ) { - - double alphaMin = h[j].getAlphaCylinder(projection.getMinRho(), AHelix.TRACKER_LENGTH); - hv[0][i] = h[j].getZ(alphaMin, h[j].getAlphaMax()); - hv[1][i] = h[j].getPhi(alphaMin, h[j].getAlphaMax(), false); - - } else if (projection instanceof AProjectionVP) { - - double alphaMin = h[j].getAlphaCylinder(projection.getMinRho(), AHelix.TRACKER_LENGTH); - double alphaMax = h[j].getAlphaExtrapolated(AProjectionVP.getRhoVPlot(), AHelix.TRACKER_LENGTH); - if (shortV.getStatus() && !showS3D) { - alphaMin = alphaMax - shortV.getD() * (alphaMax - alphaMin); - } - - hv[0][i] = h[j].getEta(alphaMin, alphaMax); - hv[1][i] = h[j].getPhi(alphaMin, alphaMax, true); - - } - } - - return window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv, index, this, ACoord.POLYLINES))); - } - } - - // a track has two arms in the VPlot - protected ACoord getVPDisplayHelices(AWindow window, AProjection2D projection) - { - boolean drawApex = parameterStore.get("VP", "DrawApex").getStatus(); - AParameter drawPar = parameterStore.get(PARAMETER_GROUP, "DrawnAs"); - int drawnAs = drawPar != null ? drawPar.getI() : DRAW_HELIX; - - if (drawnAs == DRAW_HELIX) { - ADHelix[] dhelix = getHelices(); - int size = 2 * dhelix.length; - if (drawApex) - size = 3 * dhelix.length; - double[][][] hv = new double[2][size][0]; - int[] index = new int[size]; - int[] indexIn = getDrawList(); - int num = 0; - - for (int j = 0; j < dhelix.length; ++j) - if (dhelix[j] != null) - { - double s1 = dhelix[j].getAStart(); - double s2 = dhelix[j].getAEnd(); - - int mode = parameterStore.get("VP", "Mode").getI(); - if(mode <= AProjectionVP.MODE_HCAL_LAYER_3 - && mode >= AProjectionVP.MODE_ECAL_LAYER_0) { - s2 = 179; - } - - s1 = dhelix[j].intersectWithRadialCylinder(projection.getMinRho(), s1, s2); - double sEnd = dhelix[j].intersectWithCylinder(true, AProjectionVP.getRhoVPlot(), true, AProjectionVP.getZVPlot()); - - s2 = Math.max(Math.min(s2, sEnd), s1); - // if the whole helix is to be drawn (which are unusual - // helices, shorten it a little to avoid wraparound problems - if (s1 == 0. && s2 == 180.) - s2 = 179.; - if (parameterStore.get("VP", "ShortV").getStatus() && !parameterStore.get("Data", "S3D").getStatus()) - s1 = s2 - parameterStore.get("VP", "ShortV").getD() * (s2 - s1); - if (s2 > s1) - { - int signMin = -1; - int signMax = 1; - double h = 0; - double v = 0; - for (int sign = signMin; sign <= signMax; sign += 2) - { - // ugly must change structure at some point - AProjectionVP.sign = sign; - ACoord pointsOnHelix = dhelix[j].drawHelix(window, projection, s1, s2); - hv[0][num] = pointsOnHelix.hv[0][0]; - hv[1][num] = pointsOnHelix.hv[1][0]; - index[num] = indexIn[j]; - h = hv[0][num][hv[0][num].length - 1]; - v = hv[1][num][hv[0][num].length - 1]; - num++; - } - if (drawApex) - { - int a = 3; - int b = 7; - hv[0][num] = new double[] { h - a, h + a, h, h, h - a, h + a }; - hv[1][num] = new double[] { v - b, v - b, v - b, v + b, v + b, v + b }; - index[num] = indexIn[j]; - num++; - } - } - } - return new ACoord(hv, index, this, ACoord.POLYLINES); - } else { // DRAW_NEW_HELIX is handled by the normal method - return getDisplayHelices(window, projection); - } - } -} - diff --git a/graphics/AtlantisJava/src/atlantis/data/ATrackResidualData.java b/graphics/AtlantisJava/src/atlantis/data/ATrackResidualData.java deleted file mode 100644 index 6f630c066367a7370eac720adc3b64dff3a5b372..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ATrackResidualData.java +++ /dev/null @@ -1,323 +0,0 @@ -package atlantis.data; - -import java.awt.Color; -import java.awt.Point; -import java.awt.geom.Point2D; - -import atlantis.canvas.AWindow; -import atlantis.globals.AGlobals; -import atlantis.graphics.AGraphics; -import atlantis.graphics.APickingGraphics2D; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjectionTrackResidual; - -/** - * Contains residual data for a single track - * - * @author Qiang Lu - */ -public class ATrackResidualData -{ - public static String PULL_X = "P_X"; - public static String RESIDUAL_X = "R_X"; - - private ATrackData track; - private int trackIndex; - private String showType = RESIDUAL_X; - private int numPoints; - private float[] pullLoc1; - private float[] resLoc1; - private float[] pullLoc2; - private float[] resLoc2; - private String[] detType; - - private double logMagnitudeMin; - private int pickedIndex; - private byte pickedGroup; // 1 for loc1/pull1, 2 for loc2/pull2 - private double minDiff; - - private static APar parameterStore = APar.instance(); - - /** - * @param theTrack track collection to which this residual belongs to - * @param trackIndex index of the associated track - * @param points number of residuals points - * @param pullLoc1 residuals pull data 1 - * @param resLoc1 residuals data 1 - * @param pullLoc2 residuals pull data 2 (only for Pixel) - * @param resLoc2 residuals data 2 (only for Pixel) - * @param detType detector type of each residual - */ - ATrackResidualData(ATrackData track, int trackIndex, int points, - float[] pullLoc1, float[] resLoc1, float[] pullLoc2, float[] resLoc2, - String[] detType) - { - this.track = track; - this.trackIndex = trackIndex; - numPoints = points; - this.pullLoc1 = pullLoc1; - this.resLoc1 = resLoc1; - this.pullLoc2 = pullLoc2; - this.resLoc2 = resLoc2; - this.detType = detType; - } - - /** - * @return Returns the number of residual points. - */ - public int getNumPoints() - { - return numPoints; - } - - public float[] getPullLoc1() - { - return pullLoc1; - } - - public float[] getResLoc1() - { - return resLoc1; - } - - public float[] getPullLoc2() - { - return pullLoc2; - } - - public float[] getResLoc2() - { - return resLoc2; - } - - public void setLogMagnitudeMin(double logMagnitudeMin) - { - this.logMagnitudeMin = logMagnitudeMin; - } - - public double getLogMagnitudeMin() - { - return logMagnitudeMin; - } - - public void draw(AWindow window, AGraphics ag, AProjectionTrackResidual projection) - { - Color[] colorMap=AColorMap.getColors(); - - // draw horizontal axis through 0 - double x1 = 0., y1 = 0., x2 = projection.getXLength(), y2 = 0.0; - Point2D.Double from = window.calculateDisplay(x1, y1); - Point2D.Double to = window.calculateDisplay(x2, y2); - ag.setColor(colorMap[AColorMap.BL]); - ag.drawLine(from.x, from.y, to.x, to.y); - - float[] temp1; - AParameter showExtraPar = parameterStore.get("TrackResidual", "ShowExtra"); - if(projection.getResidualType().equals(RESIDUAL_X)) - { - showType = RESIDUAL_X; - temp1 = this.resLoc1; - float[] temp2 = this.pullLoc1; // needed when drawing error bar - drawResidual(window, ag, temp1, temp2, colorMap, false); - if(showExtraPar.getStatus()) - { - temp1 = this.resLoc2; - temp2 = this.pullLoc2; - drawResidual(window, ag, temp1, temp2, colorMap, true); - } - } - else - { - showType = PULL_X; - temp1 = this.pullLoc1; - drawResidual(window, ag, temp1, null, colorMap, false); - if(showExtraPar.getStatus()) - { - temp1 = this.pullLoc2; - drawResidual(window, ag, temp1, null, colorMap, true); - } - } - - if(ag.getGraphics2D() instanceof APickingGraphics2D - && parameterStore.get("Event", "PickingMode").getI() == APickingGraphics2D.PICK_HITS_AND_TRACKS) // pick residula - { - APickingGraphics2D.mode = APickingGraphics2D.PICK_RESIDUAL; - APickingGraphics2D.setPicked(this); - } - } - - public void drawResidual(AWindow window, AGraphics ag, float[] res, - float[] pull, Color[] colorMap, boolean drawExtra) - { - // every residual is drawn as a small square with 2 pixels * 2 pixels - // N.B. when showType=PULL_X, res actually represents pull, and pull=null - double[] h = new double[4]; - double[] v = new double[4]; - int pixelOffset = 1; - - Point clickedPoint = null; - if(ag.getGraphics2D() instanceof APickingGraphics2D - && parameterStore.get("Event", "PickingMode").getI() == APickingGraphics2D.PICK_HITS_AND_TRACKS) // pick residual - { - clickedPoint = ((APickingGraphics2D)ag.getGraphics2D()).pickedPoint; - } - - Color colValid = colorMap[AColorMap.RD]; //for backward compatibility - Color colInvalid = colorMap[AColorMap.BK]; - for(int i=0; i<numPoints; i++) - { - double y; - if(res[i] == -99.0f) // unavailable - { - ag.setColor(colInvalid); - y = 0.0; - } - else - { - if(detType != null) - { - String det = detType[i]; - if("unident".equals(det)) - ag.setColor(colorMap[AColorMap.GY]); - else - { - AParameter detColor = parameterStore.get("Det", det+"Fill"); - if(detColor != null) - ag.setColor(colorMap[detColor.getI()]); - else - ag.setColor(colValid); - } - } - else // for old files that don't have <tsosDetType> - ag.setColor(colValid); - - if(parameterStore.get("TrackResidual", "Scale").getI() == 0) // linear - y = res[i]; - else // logarithmic scale - { - if(res[i] != 0.0f) - y = Math.log10(Math.abs(res[i])) - logMagnitudeMin; - else - y = res[i]; - if(res[i] < 0.0f) - y = -y; - } - } - - double tempX, tempY; - if(!drawExtra) - tempX = window.calculateDisplay(i, y).x; - else - tempX = window.calculateDisplay(i+0.25, y).x; - tempY = window.calculateDisplay(i, y).y; - - // when shape is a square, calculate the corners - // x0, y0 - h[0] = tempX - pixelOffset; - v[0] = tempY + pixelOffset; - // x1, y1 - h[1] = tempX - pixelOffset; - v[1] = tempY - pixelOffset; - // x2, y2 - h[2] = tempX + pixelOffset; - v[2] = tempY - pixelOffset; - // x3, y3 - h[3] = tempX + pixelOffset; - v[3] = tempY + pixelOffset; - - ag.fillPolygon(h, v, h.length); - - // draw error bar only for residual - AParameter showErrorBarPar = parameterStore.get("TrackResidual", "ErrorBar"); - if(showType.equals(RESIDUAL_X) && showErrorBarPar.getStatus() && - pull != null) - { - double error = 0.0; - if(pull[i] != 0.0f && pull[i] != -99.0f && y != 0.0) - error = res[i] / pull[i]; - - if(error != 0.0) // draw the error bar by linear scale always - { - double[][] vLine = new double[2][2]; - vLine[0][0] = tempX; - vLine[0][1] = tempX; - vLine[1][0] = window.calculateDisplay(i, y+error).y; - vLine[1][1] = window.calculateDisplay(i, y-error).y; - ag.drawPolyline(vLine[0], vLine[1], vLine[0].length); // verticle line - - double xMinus = tempX - 2 * pixelOffset; - double xPlus = tempX + 2 * pixelOffset; - double yTop = vLine[1][0]; - double yBottom = vLine[1][1]; - ag.drawLine(xMinus, yTop, xPlus, yTop); - ag.drawLine(xMinus, yBottom, xPlus, yBottom); - } - } - - // find the picked residual - if(ag.getGraphics2D() instanceof APickingGraphics2D - && parameterStore.get("Event", "PickingMode").getI() == APickingGraphics2D.PICK_HITS_AND_TRACKS) // pick residula - { - if(i==0 && !drawExtra) - { - pickedIndex = i; - pickedGroup = 1; - minDiff = Math.abs(clickedPoint.x - tempX); - APickingGraphics2D.pickedH = tempX; - APickingGraphics2D.pickedV = tempY; - } - else - { - double diff = Math.abs(clickedPoint.x - tempX); - if(minDiff > diff) - { - pickedIndex = i; - if(drawExtra) - pickedGroup = 2; - else - pickedGroup = 1; - minDiff = diff; - APickingGraphics2D.pickedH = tempX; - APickingGraphics2D.pickedV = tempY; - } - } - } - } - } - - public String getHitInfo() - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return track.getNameScreenName()+ - " index: "+trackIndex+"\n storegate key: "+ - (track.getStoreGateKey() == null ? "n/a" : track.getStoreGateKey()); - - StringBuffer msg = new StringBuffer(track.getNameScreenName() + " (index: "); - msg.append(trackIndex); - msg.append(")"); - msg.append("\n storegate key: "); - msg.append(track.getStoreGateKey() == null ? "n/a" : track.getStoreGateKey()); - if(showType.equals(RESIDUAL_X)) - { - msg.append("\n Residual" + pickedGroup + "(" + "index: " + pickedIndex + ") = "); - if (pickedGroup == 1) - msg.append((this.resLoc1[pickedIndex]==-99.0f)?"unavailable":this.resLoc1[pickedIndex] + "(mm)"); - else - msg.append((this.resLoc2[pickedIndex]==-99.0f)?"unavailable":this.resLoc2[pickedIndex] + "(mm)"); - } - else - { - msg.append("\n Pull" + pickedGroup + "(" + "index: " + pickedIndex + ") = "); - if (pickedGroup == 1) - msg.append((this.pullLoc1[pickedIndex]==-99.0f)?"unavailable":this.pullLoc1[pickedIndex] + "(mm)"); - else - msg.append((this.pullLoc2[pickedIndex]==-99.0f)?"unavailable":this.pullLoc2[pickedIndex] + "(mm)"); - } - - return msg.toString(); - - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/data/ATrigS3DData.java b/graphics/AtlantisJava/src/atlantis/data/ATrigS3DData.java deleted file mode 100644 index 2a20340f4ea354910d96c40769b2a624c07e6b79..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ATrigS3DData.java +++ /dev/null @@ -1,252 +0,0 @@ -package atlantis.data; - -import atlantis.event.*; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.utils.AHashMap; -import atlantis.utils.AMath; - - -/** - * - * Trigger SpacePoints - * - * barcodes + numBarcodes - associations with Truth (STr) - * clusters - associations with SiClusters and over it with reconstructed - * tracks (Track) - * - * cleanup notes: - * methods makeFilterDrawList(), getIntegerEta(), getIntegerPhi() were removed - * as these were only used by AFilter in S3D (this class was obviously the - * origin for the others) but AFilter doesn't work with TrigS3D - * other also unused methods are getLayer() and getSub() - what are these - * used for? - * - */ -public class ATrigS3DData extends A3DPointData -{ - private int[][] clusters = null; - - // data from the event file - protected int[] layer = null; - - private boolean[] pixel = null; - public static final int PIXEL = -1; - - - - public String getParameterGroup() - { - return "TrigS3D"; - } - - - - public String getName() - { - return "TrigS3D"; - } - - - - public String getNameScreenName() - { - return "TrigSiSpacePoint"; - } - - - - public String getHitInfo(int index) - { - int simpleOutput = AGlobals.instance().getSimpleOutput(); - if(simpleOutput>0) return getNameScreenName()+" index: " + index+"\n"+ - AMath.RHO+" = "+String.format("%.3f",rho[index])+"\n "+ - AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phi[index]))+AMath.DEGREES; - - String clId = " (" + clusters[index][0] + ", " + - clusters[index][1] + ")"; - String type = pixel[index] ? " (Pixel)" : " (SCT)"; - - String r = ""; - r += getNameScreenName() + " (id: " + id[index] + " index: " + index + ")" + - clId + type + "\n " + - "x = " + String.format("%.3f",x[index]) + " cm\n " + - "y = " + String.format("%.3f",y[index]) + " cm\n " + - "z = " + String.format("%.3f",z[index]) + " cm\n " + - AMath.RHO + " = " + String.format("%.3f",rho[index]) + " cm\n " + - AMath.PHI + " = " + - String.format("%.3f",Math.toDegrees(phi[index])) + - AMath.DEGREES + " (" + String.format("%.3f",phi[index]) + " rad)\n " + - " layer = " + layer[index]; - r += super.getHitInfo(index); // finds barcode information - - return r; - - } // getHitInfo() ------------------------------------------------------- - - - - ATrigS3DData(AHashMap p, AEvent e) - { - super(p,e); - layer = p.getUnknownIntArray("layer"); - - if(p.get("clusters") != null) - { - // can only distinguish between SCT and Pixel hits if clusters - // subtag is available - pixel = new boolean[numData]; - // save IDs from event file to be availeble with pick info - clusters = new int[numData][]; - - int[][] assocClusters = new int[numData][]; - int[] temp = p.getIntArray("clusters"); - for(int i = 0; i < numData; ++i) - { - // save all clusters IDs - clusters[i] = new int[] { temp[2 * i], temp[2 * i + 1] }; - - // check if the second number, PIXEL (-1) designates pixel hit - if(temp[2 * i + 1] != PIXEL) - { - // this is SCT spacepoint - has got two clusters - assocClusters[i] = new int[] { temp[2 * i], temp[2 * i + 1] }; - } - else - { - // this is a pixel spacepoint (second cluster number is -1) - pixel[i] = true; - - // to ignore associtiation between pixel clusters and spacepoints: - // assocClusters[i] = null; - - // taking pixel cluster into account (pixel spacepoint has got - // only one cluster) (where as SCT spacepoint has got two clusters) - assocClusters[i] = new int[] { temp[2 * i] }; - } - } - AAssociation assoc = new AAssociation(getName(), "SiCluster", - assocClusters,event); - event.getAssociationManager().add(assoc); - } - - } // ATrigS3DData() ----------------------------------------------------- - - - - protected void finalizeConstruction() - { - super.finalizeConstruction(); - super.calculateAssociationViaClusters(); - - } // finalizeConstruction() --------------------------------------------- - - - - protected int internalColor() - { - int numColorTypes = super.internalColor(); - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - if(colorFunction == numColorTypes + 1) - { - colorBy(layer); - } - - return numColorTypes + 1; - - } // internalColor() ---------------------------------------------------- - - - protected void applyCuts() - { - cutIndex(); - cutSubdetector(); - cut("CutsInDet", "Layer", "Layer", layer); - cutPhi(phi); - cutEta(rho, z); - cutSimulatedTracks(); - cutReconstructedTracks(); - - } // applyCuts() -------------------------------------------------------- - - - private void cutSubdetector() - { - AParameter subPar = parameterStore.get("CutsInDet", "SCT"); - if(subPar.getI() != -1) - { - cutArray(sub, subPar.getI(), "Barrel/Endcap"); - } - - } // cutSubdetector() --------------------------------------------------- - - - - public int[] getLayer(int[] layer) - { - for(int i = 0; i < numDraw; i++) - { - layer[i] = this.layer[listdl[i]]; - } - return layer; - - } // getLayer() --------------------------------------------------------- - - - - public int getSub(int id) - { - if(id > -1) - { - return(id >> 25) & 0x3; - } - else - { - return(id >> 29) & 0x3; - } - - } // getSub() ----------------------------------------------------------- - - - - protected ACoord getFRUser() - { - if(!parameterStore.get("SiCluster", "Stereo").getStatus())return super.getFRUser(); - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - h[i] = rho[list]; - v[i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[list], phi[list], z[list])); - index[i] = list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FR"); - - } // getFRUser() -------------------------------------------------------- - - - - protected ACoord getFZUser() - { - if(!parameterStore.get("SiCluster", "Stereo").getStatus())return super.getFZUser(); - makeDrawList(); - double[] h = new double[numDraw]; - double[] v = new double[numDraw]; - int[] index = new int[numDraw]; - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - h[i] = z[list]; - v[i] = Math.toDegrees(AParameterUtilities.getPhiStereo(rho[list], phi[list], z[list])); - index[i] = list; - } - return new ACoord(h, v, index, this).includePhiWrapAround("FZ"); - - } // getFZUser() -------------------------------------------------------- - -} // class ATrigS3DData ===================================================== diff --git a/graphics/AtlantisJava/src/atlantis/data/ATriggerInfoData.java b/graphics/AtlantisJava/src/atlantis/data/ATriggerInfoData.java deleted file mode 100644 index 4e9b000c650c3481ff8d4bc1b8365899d721eac8..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/ATriggerInfoData.java +++ /dev/null @@ -1,213 +0,0 @@ -package atlantis.data; - -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.utils.AHashMap; - -public class ATriggerInfoData extends AData -{ - private float[] energyEtMiss; - //private float[] energyEx; - //private float[] energyEy; - private float[] energySumEt; - private String[] trigInfoEF; - private String[] trigInfoExtL1ID; - private String[] trigInfoL1; - private String[] trigInfoL2; - private String[] trigInfoLvl1Type; - private String[] trigInfoStatus; - private String[] trigInfoStreamTag; - - ATriggerInfoData(AHashMap p, AEvent e) - { - super(p,e); - energyEtMiss = p.getUnknownFloatArray("energyEtMiss"); - //energyEx = p.getUnknownFloatArray("energyEx"); - //energyEy = p.getUnknownFloatArray("energyEy"); - energySumEt = p.getUnknownFloatArray("energySumEt"); - trigInfoEF = p.getStringArray("trigInfoEF"); - trigInfoExtL1ID = p.getStringArray("trigInfoExtL1ID"); - trigInfoL1 = p.getStringArray("trigInfoL1"); - trigInfoL2 = p.getStringArray("trigInfoL2"); - trigInfoLvl1Type = p.getStringArray("trigInfoLvl1Type"); - trigInfoStatus = p.getStringArray("trigInfoStatus"); - trigInfoStreamTag = p.getStringArray("trigInfoStreamTag"); - } - - protected void applyCuts() - {} - - public String getHitInfo(int index) - { - return "TriggerInfo"; - } - - protected int internalColor() - { - int colorFunction = parameterStore.get(PARAMETER_GROUP, "ColorFunction").getI(); - - if(colorFunction == 0) - colorByConstant(); - - return 3; - } - - public String getParameterGroup() - { - return "TriggerInfo"; - } - - public String getNameScreenName() - { - return "TriggerInfo"; - } - - /** - * For backward compatibility if this is null or -1 - * also check the value returned from ALVL1ResultData - */ - public float getEnergyEtMiss(int index) - { - return energyEtMiss[index]; - } - - /*public float getEnergyEx(int index) - { - return energyEx[index]; - } - public float getEnergyEy(int index) - { - return energyEy[index]; - }*/ - - /** - * For backward compatibility if this is null or -1 - * also check the value returned from ALVL1ResultData - */ - public float getEnergySumEt(int index) - { - return energySumEt[index]; - } - - public String getTrigInfoEF(int index) - { - return trigInfoEF[index]; - } - - /** - * Returns the individual parts of the list seperated by - - */ - public String[] getTrigInfoEFSplit(int index) - { - if(trigInfoEF!=null) - return splitItems(trigInfoEF[index]); - else - return null; - } - - /** - * Returns the hex values of the - * individual parts of the list seperated by - - */ - public String[] getTrigInfoEFSplitHex(int index) - { - return hexValues(splitItems(trigInfoEF[index])); - } - - public String getTrigInfoExtL1ID(int index) - { - return trigInfoExtL1ID[index]; - } - - public String getTrigInfoL1(int index) - { - return trigInfoL1[index]; - } - - /** - * Returns the individual parts of the list seperated by - - */ - public String[] getTrigInfoL1Split(int index) - { - if(trigInfoL1!=null) - return splitItems(trigInfoL1[index]); - else - return null; - } - - /** - * Returns the hex values of the - * individual parts of the list seperated by - - */ - public String[] getTrigInfoL1SplitHex(int index) - { - return hexValues(splitItems(trigInfoL1[index])); - } - - public String getTrigInfoL2(int index) - { - return trigInfoL2[index]; - } - - /** - * Returns the individual parts of the list seperated by - - */ - public String[] getTrigInfoL2Split(int index) - { - if(trigInfoL2!=null) - return splitItems(trigInfoL2[index]); - else - return null; - } - - /** - * Returns the hex values of the - * individual parts of the list seperated by - - */ - public String[] getTrigInfoL2SplitHex(int index) - { - return hexValues(splitItems(trigInfoL2[index])); - } - - public String getTrigInfoLvl1Type(int index) - { - return trigInfoLvl1Type[index]; - } - - public String getTrigInfoStatus(int index) - { - return trigInfoStatus[index]; - } - - - public String getTrigInfoStreamTag(int index) - { - return trigInfoStreamTag[index]; - } - - /** - * Returns the individual parts of the list seperated by - - */ - public String[] getTrigInfoStreamTagSplit(int index) - { - if(trigInfoStreamTag!=null) - return splitItems(trigInfoStreamTag[index]); - else - return null; - } - - - /** - * Returns the hex values of each element in the string - * string[] items represents a long[] - */ - private String[] hexValues(String[] items) - { - for(int i=0; i<items.length; i++) - { - long longvalue= Long.valueOf(items[i]).longValue(); - items[i] = "0x"+Long.toString(longvalue, 16).toUpperCase(); - } - return items; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/data/AVertex.java b/graphics/AtlantisJava/src/atlantis/data/AVertex.java deleted file mode 100755 index ed4ea9643d782384c3d03051a3282b32e41c4221..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AVertex.java +++ /dev/null @@ -1,328 +0,0 @@ -package atlantis.data; - -import Jama.Matrix; - -import java.util.HashMap; -import java.util.Map; -import atlantis.parameters.APar; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjectionXZ; -import atlantis.projection.AProjectionYX; -import atlantis.projection.AProjectionYZ; -import atlantis.utils.AMath; -import atlantis.utils.AAtlantisException; - -/** - * - * Reconstructed vertex instance. Either calculated in - * Atlantis (atlantis.utils.AVertexFit class) or read in from the event data as - * RVx datatype. RVx class keeps track of all the reconstructed vertices - * and contains instances of this class Avertex. - * (2005-08-08 refactoring and clean-ups) - * (2006-01-10 covMatrix, errMatrix variables were messed up (covMatrix - * numbers were huge - was actually the inverse - the weight matrix. AVertexFit - * code didn't give any ideas, very unclear code - covFittedMatrix there - * was used to initialize errMatrix here ...)) - * - * - * variables names renaming: - * covMatrix -> weightMatrix - * errMatrix -> covErrorMatrix - * - * @author Gary Taylor - */ -public class AVertex -{ - // size of the arrays with coordinates of the RVx ellipse and matrices - private static final int SIZE = 3; - - // basic RVx data - private double[] position = null; // x, y, z centre of the ellipse - private double chi2 = 1.e+10; - private Matrix covErrMatrix = null; // covariance error matrix - private Matrix weightMatrix = null; // inverse matrix of covErrMatrix - private double phi; // phi of the ellipse - private double rho; // rho of the ellipse - - private static APar parameterStore = APar.instance(); - - public AVertex(double[] p) - { - position = new double[SIZE]; - - if (p.length != SIZE) - { - throw new IllegalArgumentException("p.length=" + p.length); - } - for (int i = 0; i < SIZE; ++i) - { - position[i] = p[i]; - } - } // AVertex() ---------------------------------------------------------- - - /** - * @param p double[] - x, y, z positions of the centre of the ellipse - * @param c double[][] - input for covErrMatrix - * @param chiSquared double - */ - public AVertex(double[] p, double[][] c, double chiSquared) - { - testInputArrays(p, c); - - position = new double[SIZE]; - double[][] covErr = new double[SIZE][SIZE]; - - for (int i = 0; i < SIZE; ++i) - { - position[i] = p[i]; - } - phi = Math.atan2(p[1], p[0]); - if (phi < 0.) - phi += AMath.TWO_PI; - rho = Math.sqrt(p[0] * p[0] + p[1] * p[1]); - for (int i = 0; i < SIZE; ++i) - { - for (int j = 0; j < SIZE; ++j) - { - covErr[i][j] = c[i][j]; - } - } - - covErrMatrix = new Matrix(covErr); - weightMatrix = covErrMatrix.inverse(); - this.chi2 = chiSquared; - } // AVertex() ---------------------------------------------------------- - - /** - * - * @param chiSquared double - * @param p double[] - x, y, z positions of the centre of the ellipse - * @param c double[][] - input for covErrMatrix - */ - public AVertex(double chiSquared, double[] p, double[][] c) throws AAtlantisException - { - testInputArrays(p, c); - - chi2 = chiSquared; - - position = new double[SIZE]; - - for (int i = 0; i < SIZE; ++i) - { - position[i] = p[i]; - } - - phi = Math.atan2(p[1], p[0]); - if (phi < 0.) - phi += AMath.TWO_PI; - rho = Math.sqrt(p[0] * p[0] + p[1] * p[1]); - - double[][] covErr = new double[SIZE][SIZE]; - for (int x = 0; x < SIZE; x++) - { - covErr[x] = (double[]) c[x].clone(); - } - - try - { - covErrMatrix = new Matrix(covErr); - weightMatrix = covErrMatrix.inverse(); - } - catch (Exception ex) - { - String msg = "Error when creating covariance and/or weight\n" + "matrix in AVertex class.\nReason: " + ex.getMessage(); - throw new AAtlantisException(msg); - } - } // AVertex() ---------------------------------------------------------- - - private void testInputArrays(double[] p, double[][] c) throws IllegalArgumentException - { - if (p.length != SIZE) - { - throw new IllegalArgumentException("p.length = " + p.length); - } - - if (c.length != SIZE) - { - throw new IllegalArgumentException("c.length = " + c.length); - } - - for (int i = 0; i < SIZE; ++i) - { - if (c[i].length != SIZE) - { - throw new IllegalArgumentException("c[" + i + "].length = " + c[i].length); - } - } - } // testInputArrays() -------------------------------------------------- - - public double[] getPosition() - { - return (double[]) position.clone(); - } // getPosition() ------------------------------------------------------ - - public Matrix getCovErrMatrix() - { - return covErrMatrix; - } // getCovErrMatrix() -------------------------------------------------- - - public double getRho() - { - return rho; - } - - public double getPhi() - { - return phi; - } - - public String toString() - { - StringBuffer msg = new StringBuffer(" x = "); - msg.append(String.format("%.5f",position[0])); - msg.append(" "); - msg.append(AMath.PLUSMINUS); - msg.append(" "); - msg.append(String.format("%.3f",Math.sqrt(covErrMatrix.get(0, 0)))); - msg.append(" cm\n y = "); - msg.append(String.format("%.5f",position[1])); - msg.append(" "); - msg.append(AMath.PLUSMINUS); - msg.append(" "); - msg.append(String.format("%.3f",Math.sqrt(covErrMatrix.get(1, 1)))); - msg.append(" cm\n z = "); - msg.append(String.format("%.5f",position[2])); - msg.append(" "); - msg.append(AMath.PLUSMINUS); - msg.append(" "); - msg.append(String.format("%.3f",Math.sqrt(covErrMatrix.get(2, 2)))); - msg.append(" cm\n "); - msg.append(AMath.ETA); - msg.append(" = "); - msg.append(String.format("%.4f",AParameterUtilities.eta(position[2], rho))); - msg.append("\n "); - msg.append(AMath.PHI); - msg.append(" = "); - msg.append(String.format("%.1f",Math.toDegrees(phi))); - msg.append(AMath.DEGREES); - msg.append("\n chi2 = "); - msg.append(String.format("%.1f",chi2)); - - return msg.toString(); - } // toString() --------------------------------------------------------- - - // Ask Alan Litke to explain this calculation - private double[][] getEllipse(Matrix rM, int[] axisMapping) - { - Matrix parPrime = rM.times(new Matrix(position, position.length)); - - double a1 = weightMatrix.get(axisMapping[0], axisMapping[0]); - double a2 = weightMatrix.get(axisMapping[1], axisMapping[1]); - double a3 = weightMatrix.get(axisMapping[2], axisMapping[2]); - double a4 = 2. * weightMatrix.get(axisMapping[0], axisMapping[1]); - double a5 = 2. * weightMatrix.get(axisMapping[0], axisMapping[2]); - double a6 = 2. * weightMatrix.get(axisMapping[1], axisMapping[2]); - double b1 = a1 - a5 * a5 / (4. * a3); - double b2 = a2 - a6 * a6 / (4. * a3); - double b3 = a4 - 2 * a5 * a6 / (4. * a3); - double[][] hv = new double[2][360]; - double sigma = parameterStore.get("RVx", "NumSigma").getD(); - for (int i = 0; i < 360; ++i) - { - double thetat = Math.toRadians(i); - double tt = Math.tan(thetat); - double x = Math.sqrt(sigma * sigma / (b1 + b2 * tt * tt + b3 * tt)); - if (i > 90 && i <= 270) - x *= -1.; - hv[0][i] = x + parPrime.get(axisMapping[0], 0); - hv[1][i] = x * tt + parPrime.get(axisMapping[1], 0); - } - return hv; - } // getEllipse() ------------------------------------------------------- - - public double[][] getYXEllipse() - { - Matrix rM = new Matrix(AProjectionYX.getRotationMatrix()); - int[] axisMapping = AProjectionYX.getAxisMapping(); - - return getEllipse(rM, axisMapping); - } // getYXEllipse() ----------------------------------------------------- - - public double[][] getYZEllipse() - { - Matrix rM = new Matrix(AProjectionYZ.getRotationMatrix()); - int[] axisMapping = AProjectionYZ.getAxisMapping(); - - return getEllipse(rM, axisMapping); - } // getYZEllipse() ----------------------------------------------------- - - public double[][] getXZEllipse() - { - Matrix rM = new Matrix(AProjectionXZ.getRotationMatrix()); - int[] axisMapping = AProjectionXZ.getAxisMapping(); - - return getEllipse(rM, axisMapping); - } // getXZEllipse() ----------------------------------------------------- - - public double[][] getRZEllipse() - { - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi-phiMid); - int rSign; if (phiDiff > Math.PI/2. && phiDiff <= 3*Math.PI/2.) rSign = -1; else rSign = 1; - - double[][] hv = new double[2][360]; - double sigma = parameterStore.get("RVx", "NumSigma").getD(); - for (int i = 0; i < 360; ++i) - { - double thetat = Math.toRadians(i); - double ey = Math.sqrt(Math.sqrt(covErrMatrix.get(0,0)*covErrMatrix.get(0,0)+covErrMatrix.get(1,1)*covErrMatrix.get(1,1))); - double ex = Math.sqrt(covErrMatrix.get(2,2)); - hv[1][i] = rSign * Math.sqrt(position[0]*position[0]+position[1]*position[1]) + sigma*ey*Math.sin(thetat); - hv[0][i] = position[2] + sigma*ex*Math.cos(thetat); - //System.out.println(i+" "+thetat+" "+hv[0][i]+" "+hv[1][i]); - } - return hv; - } // getXZEllipse() ----------------------------------------------------- - - // Vertex type - enum same as in Athena - - enum Type { - DUMMY (0, "Dummy. Track particle was not used in vertex fit."), - PRIMARY (1, "Primary"), - SECONDARY (2, "Secondary"), - PILEUP (3, "Pile-up"), - CONVERSION (4, "Conversion"), - V0 (5, "V0 decay"), - KINK (6, "Kink"), - TEMPV0LAMBDA (7, "Temporary Addition for V0 Lambda"), - TEMPV0LAMBDABAR (8, "Temporary Addition for V0 LambdaBar"), - TEMPKSHORT (9, "Temporary Addition for KShort"), - DEFAULT (99, "Not specified"); - - public final int id; - public final String description; - - private static Map<Integer,Type> typeMap = new HashMap<Integer,Type>(); - static { - for (Type type : Type.values()) { - typeMap.put(type.id, type); - } - } - - /** - * Get vertex type corresponding to given integer type identifier. - * @param id type identifier - * @return vertex type - */ - public static Type typeFromId(int id) { - return typeMap.get(id); - } - - private Type (int id, String description) { - this.id = id; - this.description = description; - } - } - -} - \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/data/AVertexFit.java b/graphics/AtlantisJava/src/atlantis/data/AVertexFit.java deleted file mode 100755 index 09fba478e39342e1128813250c93b2bc54fc847f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/AVertexFit.java +++ /dev/null @@ -1,289 +0,0 @@ -package atlantis.data; - -import atlantis.parameters.APar; -import atlantis.utils.ALogger; - -import Jama.*; - - -/** - * This class provide a java implementation of the ALEPH vertex fitting - * routine YTOPOL. At the moment the only functionality is the fitting - * of ATLAS helices to a common vertex. A reasonable starting vertex for the - * fit must be given. For B decays the primary vertex should be good enough. - * Future improvements in functionality could include estimation of a - * starting vertex and including in the fitting also already calculated - * vertices and charged and neutral particles - */ - -public class AVertexFit { - private static ALogger logger = ALogger.getLogger(AVertexFit.class); - private static APar parameterStore = APar.instance(); - - private static final int MXITR=8; - private static final double CHISC=1.E-2; - private static final double CHISR=0.01; - private static final double PARCR=0.01; - private static final boolean DEBUG=false; - - private AVertexFit() {} - - public static AVertex fitVertex(AVertex estimatedVertex, AHelix[] helix) { - Matrix[] measuredHelix=new Matrix[helix.length]; - Matrix[] covHelix=new Matrix[helix.length]; - Matrix[] errHelix=new Matrix[helix.length]; - - for(int k=0; k<helix.length; ++k) { - double[] par=helix[k].getPar(); - double[][] cov=helix[k].getCovariance(); - double signD0=-1.; - double signPt=1.; - - par[0]*=signD0; - par[4]*=signPt; - - for(int i=0; i<5; ++i) { - cov[0][i]*=signD0; - cov[i][0]*=signD0; - cov[4][i]*=signPt; - cov[i][4]*=signPt; - } - - measuredHelix[k]=new Matrix(par, par.length); - covHelix[k]=new Matrix(cov); - errHelix[k]=covHelix[k].inverse(); - - // AOutput.logln( "measuredHelix "+k+" "+measuredHelix[k]); - // AOutput.logln( measuredHelix[k].toString()); - // AOutput.logln( covHelix[k].toString()); - - } - - int numFreeParam=3+3*helix.length; - Matrix fitted=new Matrix(numFreeParam, 1); - double[] estVertex=estimatedVertex.getPosition(); - int ipar; - - for(ipar=0; ipar<3; ++ipar) - fitted.set(ipar, 0, estVertex[ipar]); - ipar=3; - for(int k=0; k<helix.length; ++k) { - fitted.set(ipar++, 0, parameterStore.get("Event", "Curvature").getD()/measuredHelix[k].get(4, 0)-measuredHelix[k].get(0, 0)); - - fitted.set(ipar++, 0, measuredHelix[k].get(3, 0)); - fitted.set(ipar++, 0, measuredHelix[k].get(2, 0)); - } - - logger.debug("fittedHelix "+0+" "+new Transformation(fitted, 0).helixFromFitted()); - logger.debug("fittedHelix "+1+" "+new Transformation(fitted, 1).helixFromFitted()); - - // AOutput.logln( fitted.toString()); - - Matrix g=new Matrix(numFreeParam, 1); - Matrix gg=new Matrix(numFreeParam, numFreeParam); - int iteration=0; - double chiso=0.; - double chisq=0.; - boolean converged; - - FITTINGLOOP: - do { - g.timesEquals(0.); - gg.timesEquals(0.); - for(int k=0; k<helix.length; ++k) { - Transformation t=new Transformation(fitted, k); - - Matrix fittedHelix=t.helixFromFitted(); - - logger.debug("fittedHelix "+k+" "+fittedHelix); - Matrix dMdF=t.getHelixdMdF(); - Matrix delFM=fittedHelix.minus(measuredHelix[k]); - // helices are independent of each other so can - // use temporary matrices to avoid large matrix multiplications - Matrix gtemp=(errHelix[k].times(dMdF)).transpose().times(delFM); - Matrix ggtemp=dMdF.transpose().times(errHelix[k].times(dMdF)); - - // now put these into the large matrices - for(int i=0; i<3; ++i) { - int ix=3+3*k; - - g.set(i, 0, g.get(i, 0)+gtemp.get(i, 0)); - g.set(ix+i, 0, g.get(ix+i, 0)+gtemp.get(3+i, 0)); - for(int j=0; j<3; ++j) { - gg.set(i, j, gg.get(i, j)+ggtemp.get(i, j)); - gg.set(ix+i, j, gg.get(ix+i, j)+ggtemp.get(3+i, j)); - gg.set(i, ix+j, gg.get(i, ix+j)+ggtemp.get(i, 3+j)); - gg.set(ix+i, ix+j, gg.get(ix+i, ix+j)+ggtemp.get(3+i, 3+j)); - } - } - if(iteration==0) { - double chih=delFM.transpose().times(errHelix[k].times(delFM)).get(0, 0); - - chiso+=Math.min(chih, 1.0e+10); - // AOutput.logln( "initial chi2"+chih); - } - } - - // AOutput.logln( gg.toString()); - - gg=gg.inverse(); - Matrix delFitted=gg.times(g); - - logger.debug("DELFITTED "+iteration+" "+delFitted.toString()); - - fitted.minusEquals(delFitted); - - int jter=0; - int kter=0; - - while(true) { - if(kter>10) break FITTINGLOOP; - if(jter>100) break FITTINGLOOP; - - double chish=0.; - - chisq=0.; - for(int k=0; k<helix.length; ++k) { - Transformation t=new Transformation(fitted, k); - Matrix fittedHelix=t.helixFromFitted(); - Matrix delFM=fittedHelix.minus(measuredHelix[k]); - double chih=delFM.transpose().times(errHelix[k].times(delFM)).get(0, 0); - - chish+=Math.min(chih, 1.0e+10); - } - chisq+=chish; - - double chis1=0.; - - if((chisq>chiso+0.0001&&jter==0)||chisq>1.1*chiso) { - delFitted.timesEquals(0.5); - fitted.plusEquals(delFitted); - jter++; - chis1=chisq; - continue; - } else { - if(jter>0) { - // estimate best parameters - double chtrm=chis1+chiso-2.*chisq; - double fx; - - if(chtrm>0.) { - // concave chisq dependance - fx=(chis1-chiso)/(2.*(chis1+chiso-2.*chisq)); - fx=Math.max(fx, -2.); - fx=Math.min(fx, 2.); - } else { - // convex chisq dependance - fx=-2.; - } - delFitted.timesEquals(fx); - - jter=0; - kter++; - continue; - } - } - break; - } - - double dchi2=chiso-chisq; - - chiso=chisq; - converged=true; - // check for change in chisq - if(dchi2>CHISC&&dchi2>CHISR*chisq) converged=false; - // check for change in parameters - for(int i=0; i<numFreeParam; i++) - if(delFitted.get(i, 0)*delFitted.get(i, 0)>PARCR*gg.get(i, i)) - converged=false; - } while((!converged)&&iteration++<MXITR); - - double[] fittedVertex=new double[3]; - double[][] fittedVertexCov=new double[3][]; - - for(int i=0; i<3; i++) { - fittedVertex[i]=fitted.get(i, 0); - fittedVertexCov[i]=new double[3]; - for(int j=0; j<3; j++) - fittedVertexCov[i][j]=gg.get(i, j); - } - - return new AVertex(fittedVertex, fittedVertexCov, chisq); - } - - private static class Transformation { - double rho, tau, phi0, d0, z0, sinPhi, cosPhi, sinDPhi, cosDPhi, eta, s, r, dPhi; - - Transformation(Matrix fitted, int iHelix) { - int index=3+3*iHelix; - - eta=fitted.get(index++, 0); - tau=fitted.get(index++, 0); - phi0=fitted.get(index++, 0); - double sinPhi0=Math.sin(phi0); - double cosPhi0=Math.cos(phi0); - double xC=-eta*sinPhi0; - double yC=eta*cosPhi0; - - // if(DEBUG) AOutput.logln(" Afit xCyC"+iHelix+" "+xC+" "+yC+" "+eta); - - double xVxC=fitted.get(0, 0)-xC; - double yVyC=fitted.get(1, 0)-yC; - - r=0.; - if(eta>0.) - r=Math.sqrt(xVxC*xVxC+yVyC*yVyC); - else - r=-Math.sqrt(xVxC*xVxC+yVyC*yVyC); - - d0=r-eta; - sinPhi=xVxC/r; - cosPhi=-yVyC/r; - double phi=Math.atan2(sinPhi, cosPhi); - - if(phi-phi0<-Math.PI) phi+=2.*Math.PI; - dPhi=phi-phi0; - s=dPhi*r; - z0=fitted.get(2, 0)-s*tau; - sinDPhi=Math.sin(dPhi); - cosDPhi=Math.cos(dPhi); - rho=1./r; - } - - Matrix getHelixdMdF() { - Matrix dMdF=new Matrix(5, 6); - - double curvature = parameterStore.get("Event", "Curvature").getD(); - dMdF.set(4, 0, -curvature*rho*rho*sinPhi); - dMdF.set(4, 1, curvature*rho*rho*cosPhi); - dMdF.set(4, 3, -curvature*rho*rho*cosDPhi); - dMdF.set(4, 5, -curvature*rho*rho*eta*sinDPhi); - dMdF.set(3, 4, 1.); - dMdF.set(2, 5, 1.); - dMdF.set(0, 0, sinPhi); - dMdF.set(0, 1, -cosPhi); - dMdF.set(0, 3, cosDPhi-1.); - dMdF.set(0, 5, eta*sinDPhi); - dMdF.set(1, 0, -tau*(sinPhi*dPhi+cosPhi)); - dMdF.set(1, 1, tau*(cosPhi*dPhi-sinPhi)); - dMdF.set(1, 2, 1.); - dMdF.set(1, 3, -tau*(dPhi*cosDPhi-sinDPhi)); - dMdF.set(1, 4, -s); - dMdF.set(1, 5, -tau*(eta*(dPhi*sinDPhi+cosDPhi)-r)); - return dMdF; - } - - Matrix helixFromFitted() { - Matrix helix=new Matrix(5, 1); - - helix.set(4, 0, rho*parameterStore.get("Event", "Curvature").getD()); - helix.set(3, 0, tau); - helix.set(2, 0, phi0); - helix.set(0, 0, d0); - helix.set(1, 0, z0); - return helix; - } - - } -} - diff --git a/graphics/AtlantisJava/src/atlantis/data/package.html b/graphics/AtlantisJava/src/atlantis/data/package.html deleted file mode 100644 index 15056059d098ac41aee4c8219ef71d6b9a98fb44..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/data/package.html +++ /dev/null @@ -1,8 +0,0 @@ -<html> -<head></head> -<body> -<p>All classes handling particular datatypes are part of this package. -They all implement AData from the atlantis.event package.</p> -</body> -</html> - diff --git a/graphics/AtlantisJava/src/atlantis/event/AAssociation.java b/graphics/AtlantisJava/src/atlantis/event/AAssociation.java deleted file mode 100755 index b2338def707a30c8dc8525182ea06481e47b7ddc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AAssociation.java +++ /dev/null @@ -1,298 +0,0 @@ -package atlantis.event; - -import atlantis.utils.ALogger; - -/** - * Representation of the association between two data types. The association is - * stored using the string name+storeGateKey for both data types. - * - * The actual association is a an array of arrays of integers. The first index - * of this array is the index of an element in the first datatype. The array - * then contains the Athena IDs of the element in the second datatype that are - * associated to it. This is necessary because the second datatype might not - * have been read from the XML file yet, so the indices are unknown. - * - * @todo Modify this class to perform a translation of Athena ID to Atlantis ID - * for the identifiers of "b". This can be done together with purgeIDNotInData() - * and avoids the need for continuously looking up Athena IDs when drawing. - */ -public class AAssociation { - - /** Logger */ - private static final ALogger logger = ALogger.getLogger(AAssociation.class); - - /** Event this association belongs to */ - private final AEvent event; - - /** Identifying the datatype this association if from */ - private final String a; - - /** Identifying the datatype this association is to */ - private final String b; - - /** - * Association, the first index is the index of an element of "a", the - * second index then loops over the Athena IDs in "b" to which the element - * of "a" is associated. - */ - private final int[][] assoc; - - /** - * Constructor, taking as input a flat array (btoa) and an array that - * specifies how many entries correspond to each object in "a". - * - * For example: - * - * from = "Jet"; - * to = "Track"; - * numbtoa = {2, 0, 3}; - * btoa = {1, 5, 3, 4, 6}; - * - * This means that the first jet in the event (index=0) is associated - * to 2 tracks, namely index 1 and 5. The second jet has no associated - * tracks and the third jet (index=2) is associated to 3 tracks, indices - * 3, 4 and 6. - * - * Alternatively, numbtoa can be null. In that case the length of btoa has - * to be equal to the number of entries in "a". Every object in "a" will be - * associated to exactly one object in "b". - * - * @param from name+key this association is from, "a" - * @param to name+key this association is to, "b" - * @param numbtoa number of elements in "b" that each element in "a" is associated to - * @param btoa contents of the association in flat array - * @param e event object this association belongs to - */ - public AAssociation(String from, String to, int[] numbtoa, int[] btoa, AEvent e) { - - // Association to STr is done using barcodes, this is the only exception - // here: for barcodes ID=0 means no association. So we skip those entries. - boolean skipZero = to.startsWith("STr") && numbtoa == null; - - event = e; - a = from; - b = to; - - if (btoa == null) { - - assoc = null; - - } else { - - if (numbtoa != null) { - - // Multiple "b" entries associated to an "a" entry - assoc = new int[numbtoa.length][]; - - int num = 0; - for (int i = 0; i < numbtoa.length; ++i) { - if (numbtoa[i] <= 0) { - assoc[i] = new int[0]; - } else { - assoc[i] = new int[numbtoa[i]]; - } - - for (int j=0; j<numbtoa[i]; ++j) { - assoc[i][j] = btoa[num++]; - } - } - - } else { - - // Simple 1-on-1 association - assoc = new int[btoa.length][]; - - for (int i=0; i<btoa.length; i++) { - if (skipZero && btoa[i] <= 0) { - assoc[i] = new int[0]; - } else { - assoc[i] = new int[] { btoa[i] }; - } - } - } - - } - } - - /** - * Copy constructor - * - * @param from source datatype - * @param to target datatype - * @param associations association index arrays - * @param e event the association belongs to - */ - public AAssociation(String from, String to, int[][] associations, AEvent e) { - event = e; - a = from; - b = to; - assoc = associations; - } - - /** - * Get the name of association - * @return association name, concatenation of the two data types it associates - */ - public String getName() { - return a + b; - } - - /** - * Get source data type of association - * @return name of source data type - */ - public String getFrom() { - return a; - } - - /** - * Get target data type of association - * @return name of target data type - */ - public String getTo() { - return b; - } - - /** - * Get association array - * @return association array - */ - public int[][] getData() { - return assoc; - } - - /** - * Method that constructs the association b->a when only an association a->b - * currently exists. The complication here is due to the fact that "a" uses - * Atlantis indices (0, 1, ...), while "b" uses Athena IDs (1611690048, - * 1635282976, etc.). - * - * @return inverted association - */ - public AAssociation invert() { - - AData aData = event.get(a); - AData bData = event.get(b); - - if (aData == null || bData == null) { - logger.debug(getClass().getName() - + ": No association found between " + a + " and " + b); - return null; - - } else { - - try { - // New assoc will have the same number of entries as "b" - int[][] inv = new int[bData.getNumData()][]; - - // Athena IDs of object "a" - int[] ida = aData.getID(); - - // Loop over all entries in "a", the current association array - for (int i=0; i<assoc.length; ++i) { - if (assoc[i] != null) { - for (int j=0; j<assoc[i].length; ++j) { - - // For each associated entry in "b", we need to find - // the index from the Athena ID - int index = bData.getIndexFromId(assoc[i][j]); - - if (index != AData.NO_INVERSE) { - - if (inv[index] == null) { - - // The object in "a" is the first object that - // this object in "b" is associated to. Create - // a new array and add this entry. - inv[index] = new int[] { ida[i] }; - - } else { - - // The object in "b" is already associated to - // other objects in "a". Retrieve the other - // objects, increment the size and add the - // current object in "a". - int[] temp = new int[inv[index].length + 1]; - for (int k=0; k<inv[index].length; ++k) { - temp[k] = inv[index][k]; - } - temp[inv[index].length] = ida[i]; - inv[index] = temp; - } - } - } - } - } - return new AAssociation(b, a, inv, event); - - } catch (Exception e) { - logger.error("Unable to invert association.", e); - return null; - } - } - } // invert() --------------------------------------------------------------- - - /** - * Remove associations between items that are not present in the event data - */ - void purgeIDNotInData() { - // remove inconsistencies - // TRT hits from RTr<->SiCluster - // Association to an STr which does not exist in STr - - AData source = event.get(b); - if (assoc == null || source == null) { - return; - } - int INVALID_ID = -1; // (i hope!) - for (int i = 0; i < assoc.length; i++) { - if (assoc[i] != null) { - int num = 0; - for (int j = 0; j < assoc[i].length; j++) { - if (source.getIndexFromId(assoc[i][j]) == AData.NO_INVERSE) { - assoc[i][j] = INVALID_ID; - num++; - } - } - if (num > 0) { - if (num == assoc[i].length) { - assoc[i] = null; - } else { - int[] temp = new int[assoc[i].length - num]; - num = 0; - for (int j = 0; j < assoc[i].length; j++) { - if (assoc[i][j] != INVALID_ID) { - temp[num++] = assoc[i][j]; - } - } - assoc[i] = temp; - } - } - } - } - } - - /** - * Convert association into an informational message for the user - */ - @Override - public String toString() { - StringBuilder s = new StringBuilder(); - s.append(a).append(" to ").append(this.b); - if (assoc == null) { - s.append(" is empty\n"); - return s.toString(); - } else { - s.append("\n"); - for (int i = 0; i < assoc.length; i++) { - if (assoc[i] != null) { - for (int j = 0; j < assoc[i].length; j++) { - s.append(assoc[i][j]).append(" "); - } - s.append("\n"); - } - } - } - return s.toString(); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AAssociationManager.java b/graphics/AtlantisJava/src/atlantis/event/AAssociationManager.java deleted file mode 100755 index cc1cbedaf47ba988e74f623ea4708d5000a382c3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AAssociationManager.java +++ /dev/null @@ -1,118 +0,0 @@ -package atlantis.event; - - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import atlantis.utils.ALogger; - -public class AAssociationManager -{ - private static ALogger logger = ALogger.getLogger(AAssociationManager.class); - - private Map<String, AAssociation> associations = new HashMap<String, AAssociation>(); - - public AAssociationManager() {} - - public void clear() - { - associations = new HashMap<String, AAssociation>(); - } - - public void add(AAssociation a) - { - associations.put(a.getName(), a); - } - - public void remove(String key) - { - associations.remove(key); - } - - public int[][] get(String a, String b) - { - Object o = associations.get(a + b); - if(o != null) - { - return((AAssociation) o).getData(); - } - else - { - o = associations.get(b + a); - if(o != null) - { - //AOutput.logln("AAssociationManager.get()\n" + - // "querying non-existing association from-" + a + "-to-" + b + - // "\ncalculating inverse association ...") ; - AAssociation ass = ((AAssociation) o).invert(); - // following test prevents Atlantis from crashing if there - // is something wrong with the association between clusters - // and cells - if(ass != null) - { - add(ass); - return ass.getData(); - } - else - { - String name = "AAssociationManager.get(): "; - logger.debug(name + "No association " + - "found between " + a + " and " + b); - return null; - } - } - } - return null; - } // get() -------------------------------------------------------------- - - - public AAssociation getAssociation(String a, String b) - { - return (AAssociation) associations.get(a + b); - } - - public void correct() - { - Collection<AAssociation> c = associations.values(); - for (AAssociation a : c) { - a.purgeIDNotInData(); - } - } - - - public String[] getKnownAssociations(String a) - { - Collection<AAssociation> c = associations.values(); - Set<String> list = new TreeSet<String>(); - for (AAssociation ass : c) { - if(ass.getFrom().equals(a)) - { - list.add(ass.getTo()); - } - else if(ass.getTo().equals(a)) - { - list.add(ass.getFrom()); - } - } - return (String[]) list.toArray(new String[list.size()]); - } - - - public String getAllKnownAssociations() - { - Collection<AAssociation> col = associations.values(); - StringBuilder r = new StringBuilder(); - int c = 0; - - for (AAssociation ass : col) { - c++; - r.append(c + " association from " + ass.getFrom() + " to " + - ass.getTo() + " (name: " + ass.getName() + ")\n"); - } - - return r.toString(); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/ABufferedEventSource.java b/graphics/AtlantisJava/src/atlantis/event/ABufferedEventSource.java deleted file mode 100644 index 7d089cf7ce8d8661d3f4b5c5f690bd559cb4a79a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/ABufferedEventSource.java +++ /dev/null @@ -1,263 +0,0 @@ -package atlantis.event; - -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.utils.ALogger; -import java.util.Vector; - -/** - * Extension class to AEventSource providing buffering for a fixed number of events. - * @author sboeser - */ -public abstract class ABufferedEventSource implements AEventSource { - - //Logging interface - private final static ALogger logger = ALogger.getLogger(ABufferedEventSource.class); - - //The index of the currently selected event in the list - private static int currentEvent = -1; - //The maximum number of events to save - public static int maxNumberOfEvents = 1; - //A vector of available events - private static Vector<AEvent> eventContainer = new Vector<AEvent>(); - // the current event navigation mode - private NavigationMode eventNavigationMode = NavigationMode.SEQUENTIAL; - - /** - * Abstract read next event method to be implemented by all subclasses - * @return the next event - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - protected abstract AEvent readNext(AEventInfo currentEvent) throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException; - /** - * Abstract read previous event method to be implemented by all subclasses - * @return the previous event - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - protected abstract AEvent readPrevious(AEventInfo currentEvent) throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException; - - /** - * Get the next event, either from the buildin buffer or by reading it in - * @return the next event - * @throws atlantis.event.AEventSource.NoMoreEventsException - * @throws atlantis.event.AEventSource.InvalidEventSourceException - * @throws atlantis.event.AEventSource.ReadEventException - */ - public AEvent nextEvent() throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException - { - //Check if we are already at the last event - if (currentEvent == eventContainer.size()-1){ - - //if so, try to get another event - AEvent event = null; - try{ - event = readNext(getCurrentEventInfo()); - } catch ( OutOfMemoryError oom ) { - - //throw an error message - logger.error("Ran out of memory while reading event data"); - - //See if we can clear memory by removing events - if ( getNumberOfEvents() > 0) { - //be verbose - logger.info("Clearing event cache and retry..."); - //remove events - clearEventContainer(); - //Call garbage collector to free resources - System.gc(); - //Now retry (no current event) - event = readNext(null); - } - } - - //Add it to the eventContainer as last one - addEvent(event,false); - - } else { - // simply increase event counter - setCurrentEvent(currentEvent+1); - } - - //Now return the new current event - return eventContainer.get(currentEvent); - } - - public AEvent previousEvent() throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException { - - //Check if we are already at the first event - if (currentEvent <= 0 ){ - - //if so, try to get another event - AEvent event = null; - try{ - event = readPrevious(getCurrentEventInfo()); - } catch ( OutOfMemoryError oom ) { - - //throw an error message - logger.error("Ran out of memory while reading event data"); - - //See if we can clear memory by removing events - if ( getNumberOfEvents() > 0) { - //be verbose - logger.info("Clearing event cache and retry..."); - //remove events - clearEventContainer(); - //Call garbage collector to free resources - System.gc(); - //Now retry (no current event) - event = readPrevious(null); - } - } - - //Add it to the eventContainer as first one - addEvent(event,true); - - } else { - // simply decrease event counter - setCurrentEvent(currentEvent-1); - } - - //Now return the new current event - return eventContainer.get(currentEvent); - - } - - /** - * Get the event navigation mode for the current source. - * @return current event navigation mode - */ - public NavigationMode getNavigationMode() { - return eventNavigationMode; - } - - /** - * Set the event navigation mode for the current source, - * clears the buffer and reads the first event. - * Throws InvalidEventSourceException if the current - * source does not support the requested mode - * @param mode requested event navigation mode - */ - public void setNavigationMode(NavigationMode mode) throws InvalidEventSourceException - { - if(supportsNavigationMode(mode)) { - NavigationMode oldMode = getNavigationMode(); - eventNavigationMode = mode; - - // empty the buffer - clearEventContainer(); - } else - throw new InvalidEventSourceException("Mode '"+mode.name()+"' not supported by current source"); - } - - /** - * Checks whether the current event source supports - * a particular display mode. - * @return true if the mode is supported - * @param mode requested event navigation mode - */ - public abstract boolean supportsNavigationMode(NavigationMode mode); - - /** - * Returns number of events saved in the eventContainer - * @return int - */ - public int getNumberOfEvents() - { - return eventContainer != null ? eventContainer.size() : 0; - - } - - /** - * Add the given even to the event container. By default, events are added - * to the end of the container. If skipping backward, it may be necessary to - * add to the beginning of the container, as indicated by the asFirst flag - * The new event will also be set as default event - * - * @param event the event to add - * @param asFirst whether to add the event at the beginning (default is end) - */ - private synchronized void addEvent(AEvent event, boolean asFirst) - { - //create event container if it does not exist - if(eventContainer == null) eventContainer = new Vector<AEvent>(); - - //Make sure container does not get too large - while (eventContainer.size() >= maxNumberOfEvents){ - // remove at the side at which we are not adding event - if (asFirst) eventContainer.remove(eventContainer.lastElement()); - else eventContainer.remove(0); - } - - //At the end or at the beginning - int index = (asFirst) ? 0 : eventContainer.size(); - - //add the event - eventContainer.add(index,event); - - //be verbose - logger.debug(eventContainer.size() + " event(s) in memory"); - - //set as current event - setCurrentEvent(index); - } - - - /** - * Clear the event container, reset the current event - */ - protected synchronized void clearEventContainer() - { - //Make sure the event container exits before clearing it - if(eventContainer != null){ - // let the user know - String msg = "Clearing event container with "+getNumberOfEvents()+" events."; - logger.warn(msg); - AOutput.append(msg, ALogInterface.WARNING); - - //Clear the container - eventContainer.clear(); - } - - //Alse reset current event - currentEvent = -1; - - //Run the garbage collector to free space immediately - System.gc(); - - } - - private void setCurrentEvent(int index) { - //Check for out-of-bounds - if ((index < 0) || ( index >= eventContainer.size())) - throw new ArrayIndexOutOfBoundsException("Cannot set index "+index+" in event container of size "+eventContainer.size()); - currentEvent = index; - } - - /** - * @return the curent event or null if there is none - */ - private AEventInfo getCurrentEventInfo(){ - - //Check if the current event is there - try { - //get the current events name - return eventContainer.get(currentEvent); - } catch (ArrayIndexOutOfBoundsException ex){ - //return an empty string if there is no current event - return null; - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AData.java b/graphics/AtlantisJava/src/atlantis/event/AData.java deleted file mode 100644 index 6bf4541ac22d44d3c6423be44e28e0498615b0c7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AData.java +++ /dev/null @@ -1,1661 +0,0 @@ -package atlantis.event; - -import java.awt.Component; -import java.util.Vector; -import java.util.Collection; -import javax.swing.Action; - -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import atlantis.canvas.AWindow; -import atlantis.data.ACompositeParticleData; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.ADrawParameters; -import atlantis.graphics.ADrawable; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.list.AListManager; -import atlantis.output.AExceptionHandler; -import atlantis.parameters.AEnumeratorParameter; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjection3D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionXZ; -import atlantis.projection.AProjectionYX; -import atlantis.projection.AProjectionYZ; -import atlantis.utils.A4Vector; -import atlantis.utils.AHashMap; -import atlantis.utils.AIntHashtable; -import atlantis.utils.AMath; -import atlantis.list.AListProcessor; -import atlantis.utils.ALogger; - -/** - * Base class which holds the data from a subdetector (e.g. TRT) This - * representation is appropriate for data with a static number of entries but - * not for example for reconstructed vertices the number of which may be changed - * interactively by the user. AData should perhaps become an interface. - */ -abstract public class AData implements ADrawable, AListProcessor { - private static final ALogger logger = ALogger.getLogger(AData.class); //the event that this data belongs to - protected static AEventManager eventManager = AEventManager.instance(); - protected static APar parameterStore = APar.instance(); - protected static Component guiComponent = AGlobals.instance().getGuiFrame(); - protected final AEvent event; - protected static final int NO_INVERSE = -1; - protected int numData; - protected int numDraw; - protected int[] listdl; - protected byte[] color; - protected int[] id; - protected AIntHashtable indexFromId; - protected String storeGateKey = null; - protected final String PARAMETER_GROUP = getParameterGroup(); - - abstract protected int internalColor(); - - abstract protected void applyCuts(); - - abstract public String getNameScreenName(); - - abstract public String getHitInfo(int index); // pick info - - abstract public String getParameterGroup(); - // Holds the projection object that we are currently drawing on. This is *NOT* the same - // as ACanvas.getCanvas().getCurrentWindow().getProjection(), since this function gives - // the projection in the active window. Particularly at startup windows will be redrawn - // without being the active window. Hence this variable. - // - // By the way: this is also inherently bad design. Why does the data need - // to know about the projection? The main flaw is that the data draws itself, - // rather then the graphics context drawing the data - S.B. - protected AProjection2D currentProjection; - - // dummy version, only applies to dynamic data sources (e.g. RecVertex (RVx)) - public void remove(int[] index) {} - - // used to finalize the state of this object - // after all other AData objects are essentially built - // e.g. calculate the number of S3D hits on a track after both are read - protected void finalizeConstruction() {} - - // x y and z are now stored - // rho and phi arrays are only correct after a call to this function - protected void calculateRhoPhi() {} - - // used by rubberband in V-Plot - public String getVPHitInfo() { - return ""; - } - - public AData(AHashMap p, AEvent e) { - //save reference to the event this data belongs to - event = e; - - numData = p.getInt("numData"); - numDraw = numData; - listdl = new int[numData]; - color = new byte[numData]; - - storeGateKey = (String) p.get("storeGateKey"); - if ("".equals(storeGateKey) || storeGateKey == null) { - storeGateKey = null; - } - - if (p.get("id") != null) { - id = p.getIntArray("id"); - } else { - id = new int[numData]; - for (int i = 0; i < numData; i++) { - // start IDs calculated in Atlantis from 0, should be the same - // as in JiveXML - id[i] = i; - } - } - - indexFromId = new AIntHashtable(id); - } // AData() - - AData(Node node, AEvent e) { - //save reference to the event this data belongs to - event = e; - numData = 0; - NodeList children = node.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - if (children.item(i).getNodeType() == Node.ELEMENT_NODE) { - numData++; - } - } - numDraw = numData; - listdl = new int[numData]; - color = new byte[numData]; - id = new int[numData]; - for (int i = 0; i < numData; i++) { - id[i] = i; - } - indexFromId = new AIntHashtable(id); - } - - public AEvent getEvent(){ - return event; - } - - public int getIndexFromId(int id) { - return indexFromId.get(id); - } - - public final A4Vector get4Vector() { - makeDrawList(); - return get4Vector(numDraw, listdl); - } - - // only applies to data which can provide 4 vectors - public A4Vector get4Vector(int num, int[] list) { - return null; - } - - // only applies to data which can provide 4 vectors - public A4Vector get4Vector(int num, int[] list, double mass) { - return null; - } - - public int getNumData() { - return numData; - } - - public int getNumDraw() { - return numDraw; - } - - public int getDrawIndex(int index) { - return this.listdl[index]; - } - - public int[] getID() { - return id; - } - - protected int getNum(String name, int index) { - int[][] ass = event.getAssociationManager().get(getFullName(), name); - if (ass != null && ass[index] != null) { - return ass[index].length; - } else { - return 0; - } - } - - protected int[] getNum(String name) { - int[][] ass = event.getAssociationManager().get(getFullName(), name); - int[] num = new int[numData]; - if (ass != null) { - for (int i = 0; i < ass.length; ++i) { - if (ass[i] != null) { - num[i] = ass[i].length; - } - } - } - return num; - } - - public byte[] getColor() { - color(); - byte[] temp = new byte[id.length]; - - for (int i = 0; i < temp.length; i++) { - temp[i] = color[getIndexFromId(id[i])]; - } - return temp; - } - - public int[] getColor(int[] dl) { - color(); - int[] temp = new int[dl.length]; - - for (int i = 0; i < temp.length; i++) { - temp[i] = color[dl[i]]; - } - return temp; - } - - public int getColor(int index){ - return color[index]; - } - - public void makeDrawList() { - calculateRhoPhi(); - constructDefaultDrawlist(); - applyCuts(); - } - - public void constructDefaultDrawlist() { - if (!parameterStore.get("CutsATLAS", "ByList").getStatus()) { - // if some hits are on a list they must be drawn last - int[][] temp = AListManager.getInstance().getColorMapping(this); - int[] index = temp[0]; - int[] ctemp = temp[1]; - if (index.length > 0) { - // AOutput.logln("AData.constructDefaultDrawlist() numData = " + - // numData); - int[] c = new int[numData]; - final int NONE = -999; - for (int i = 0; i < numData; ++i) { - c[i] = NONE; - } - for (int i = 0; i < index.length; ++i) { - c[index[i]] = ctemp[i]; - } - numDraw = 0; - for (int i = 0; i < numData; ++i) { - if (c[i] == NONE) { - listdl[numDraw++] = i; - } - } - for (int i = 0; i < numData; ++i) { - if (c[i] != NONE && c[i] != AColorMap.INVISIBLE) { - listdl[numDraw++] = i; - // nb invisible are not in the drawlist - } - } - } else { - // this is the standard case - numDraw = numData; - for (int i = 0; i < numDraw; ++i) { - listdl[i] = i; - } - } - } else { - // drawlist set by cuts..... - boolean[] selected = AListManager.getInstance().getSelection(this); - numDraw = 0; - for (int i = 0; i < selected.length; ++i) { - if (selected[i]) { - listdl[numDraw++] = i; - } - } - } - } - - // provides the draw list as a boolean array parallel to the data array - protected boolean[] isDrawn() { - boolean[] drawn = new boolean[numData]; - - for (int i = 0; i < numDraw; i++) { - drawn[listdl[i]] = true; - } - return drawn; - } - - public void cut(String groupName, String parameterName, String text, float[] array) { - AParameter par = parameterStore.get(groupName, parameterName); - - if (par != null && par.getStatus() && array != null) { - double value = par.getD(); - String operator = par.getOperator(); - int num = 0; - - if (par.isModulus()) { - if (operator.equals("<")) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(array[listdl[i]]) < value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals(">")) { - // '>' really means '>=' for reals since they are real in - // from ascii file and don't have full precison - for (int i = 0; i < numDraw; i++) { - if (Math.abs(array[listdl[i]]) >= value) { - listdl[num++] = listdl[i]; - } - } - } else { - throw new Error(operator + " operator not sensible for floats"); - } - } else { - if (operator.equals("<")) { - for (int i = 0; i < numDraw; i++) { - if (array[listdl[i]] < value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals(">")) { - // '>' really means '>=' for reals since they are real in - // from ascii file - // and don't have full precison - for (int i = 0; i < numDraw; i++) { - if (array[listdl[i]] >= value) { - listdl[num++] = listdl[i]; - } - } - } else { - throw new Error(operator + " operator not sensible for floats"); - } - } - numDraw = num; - } - } - - protected void cut(String groupName, String parameterName, String text, int[] array) { - AParameter par = parameterStore.get(groupName, parameterName); - - if (par != null && par.getStatus() && array != null) { - int value = par.getI(); - - // consider two special cases: Electron/isEM and Photon/isEM - if (parameterName.endsWith("isEM")) { - if (!isEMValidate(value)) { - return; - } - String binaryString = Integer.toBinaryString(value); - Vector<String> possibleValues = getPossibleValues(binaryString); - cutIsEM(text, array, possibleValues); - } else { - String operator = par.getOperator(); - boolean modulus = par.isModulus(); - - cut(text, modulus, array, operator, value); - } - } - } - - protected void cut(String text, int[] array, String operator, int value) { - cut(text, false, array, operator, value); - } - - protected void cut(String text, boolean modulus, int[] array, String operator, int value) { - int num = 0; - - if (modulus) { - if (operator.equals("<")) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(array[listdl[i]]) < value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals(">")) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(array[listdl[i]]) > value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("=") || operator.equals("==")) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(array[listdl[i]]) == value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("!=") || operator.equals(AMath.NOTEQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(array[listdl[i]]) != value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("<=") || operator.equals(AMath.LESSEQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(array[listdl[i]]) <= value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals(">=") || operator.equals(AMath.GREATEREQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (Math.abs(array[listdl[i]]) >= value) { - listdl[num++] = listdl[i]; - } - } - } else { - throw new Error(operator + " operator not sensible for integers"); - } - } else { - if (operator.equals("<")) { - for (int i = 0; i < numDraw; i++) { - if (array[listdl[i]] < value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals(">")) { - for (int i = 0; i < numDraw; i++) { - if (array[listdl[i]] > value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("=") || operator.equals("==")) { - for (int i = 0; i < numDraw; i++) { - if (array[listdl[i]] == value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("!=") || operator.equals(AMath.NOTEQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (array[listdl[i]] != value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("<=") || operator.equals(AMath.LESSEQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (array[listdl[i]] <= value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals(">=") || operator.equals(AMath.GREATEREQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (array[listdl[i]] >= value) { - listdl[num++] = listdl[i]; - } - } - } else { - throw new Error(operator + " operator not sensible for integers"); - } - } - numDraw = num; - } - - // cut based on the i'th item in the data array - public void cutIndex() { - AParameter par = parameterStore.get("CutsATLAS", "Index"); - - if (par.getStatus()) { - int value = par.getI(); - String operator = par.getOperator(); - int num = 0; - - if (operator.equals("<")) { - for (int i = 0; i < numDraw; i++) { - if (listdl[i] < value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals(">")) { - for (int i = 0; i < numDraw; i++) { - if (listdl[i] > value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("=") || operator.equals("==")) { - for (int i = 0; i < numDraw; i++) { - if (listdl[i] == value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("!=") || operator.equals(AMath.NOTEQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (listdl[i] != value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals("<=") || operator.equals(AMath.LESSEQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (listdl[i] <= value) { - listdl[num++] = listdl[i]; - } - } - } else if (operator.equals(">=") || operator.equals(AMath.GREATEREQUAL)) { - for (int i = 0; i < numDraw; i++) { - if (listdl[i] >= value) { - listdl[num++] = listdl[i]; - } - } - } else { - throw new Error(operator + " operator not sensible for integers"); - } - numDraw = num; - } - } - - protected void cutArray(int[] value, int cutValue, String description) { - int num = 0; - - for (int i = 0; i < numDraw; i++) { - - if (value[listdl[i]] == cutValue) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - - protected void cutArray(byte[] value, int cutValue, String description) { - int num = 0; - - for (int i = 0; i < numDraw; i++) { - - if (value[listdl[i]] == cutValue) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - - //isEMString cut declaration - // - // Clone of above cut, but to allow values less than or equal to the cut value - // At the moment, Specific to isEMString for Electrons and Photons, and isTauString. - // - protected void cutArrayEnum(Vector<Enum> value, int cutValue, String description) { - int num = 0; - - for (int i = 0; i < numDraw; i++) { - if ((value.get(listdl[i]).ordinal()) <= cutValue) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - // End isEMString cut declaration - - protected void cutArray(boolean[] value, boolean cutValue, String description) { - int num = 0; - - for (int i = 0; i < numDraw; i++) { - if (value[listdl[i]] == cutValue) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - - protected void cutArrayOR(int[] value, int cutValue1, int cutValue2, - String description) { - int num = 0; - - for (int i = 0; i < numDraw; i++) { - if (value[listdl[i]] == cutValue1 || value[listdl[i]] == cutValue2) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - - // apply phi+-deltaphi cut to lines (e.g. TRT) - protected void cutPhi(float[] phi, float[] dphi) { - AParameter par = parameterStore.get("CutsATLAS", "CutPhi"); - - if (!par.getStatus()) { - return; - } - double phiCut = Math.toRadians(par.getD()); - double phiMid = Math.toRadians(AMath.nearestPhiDegrees(parameterStore.get("CutsATLAS", "PhiMiddle").getD())); - double phiLowerCut = phiMid - phiCut; - double phiUpperCut = phiMid + phiCut; - int num = 0; - - for (int i = 0; i < numDraw; i++) { - int list = listdl[i]; - double phiHit = AMath.nearestPhiRadians(phi[list], phiMid); - double phiLower = phiHit - dphi[list]; - double phiUpper = phiHit + dphi[list]; - - if (phiUpper - phiLowerCut > 1.0e-6 && phiUpperCut - phiLower > 1.0e-6) { - listdl[num++] = list; - } - } - numDraw = num; - } - - /** Apply phi+-deltaphi cut to points (e.g. S3D) */ - public void cutPhi(float[] phi) { - AParameter par = parameterStore.get("CutsATLAS", "CutPhi"); - boolean usePhiCut = par.getStatus(); - - if (usePhiCut) { - double phiCut = Math.toRadians(Math.abs(par.getD())); - double phiMid = Math.toRadians(AMath.nearestPhiDegrees(parameterStore.get("CutsATLAS", "PhiMiddle").getD())); - int num = 0; - - for (int i = 0; i < numDraw; i++) { - double phiDiff = Math.abs(AMath.nearestPhiRadians(phi[listdl[i]], phiMid) - phiMid); - - if (phiCut - phiDiff > 1.0e-6) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - - } - - /** apply eta+-deltaeta cut to points (e.g. S3D) */ - public void cutEta(float[] eta) { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - boolean useEtaCut = par.getStatus(); - - if (useEtaCut) { - double etaCut = Math.abs(par.getD()); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - int num = 0; - - for (int i = 0; i < numDraw; i++) { - double etaDiff = Math.abs(eta[listdl[i]] - etaMid); - - if (etaCut - etaDiff > 1.0e-6) { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - } - - protected void colorByConstant() { - if (!PARAMETER_GROUP.equals("CompositeParticle")) { - int constantColor = parameterStore.get(PARAMETER_GROUP, "Constant").getI(); - - for (int i = 0; i < numData; i++) { - color[i] = (byte) constantColor; - } - } else { - ACompositeParticleData compositeParticles = (ACompositeParticleData) this; - compositeParticles.makeDrawList(); - for (int e = 0; e < compositeParticles.getNumDraw(); ++e) { - int list = compositeParticles.getDrawIndex(e); - switch (Math.abs(compositeParticles.getPdgId(list))) { - case 13: - color[list] = (byte) parameterStore.get("Muon", "Constant").getI(); - break; - case 11: - color[list] = (byte) parameterStore.get("Electron", "Constant").getI(); - break; - case 22: - color[list] = (byte) parameterStore.get("Photon", "Constant").getI(); - break; - case 5: - color[list] = (byte) parameterStore.get("BJet", "Constant").getI(); - break; - case 15: - color[list] = (byte) parameterStore.get("TauJet", "Constant").getI(); - break; - case 24: - color[list] = (byte) parameterStore.get("CompositeParticle", "ConstantW").getI(); - break; - case 6: - color[list] = (byte) parameterStore.get("CompositeParticle", "ConstantTop").getI(); - break; - case 25: - color[list] = (byte) parameterStore.get("CompositeParticle", "ConstantH").getI(); - break; - - default: - if (compositeParticles.getTypeEV(list).equals("EVParticleJet")) { - color[list] = (byte) parameterStore.get("Jet", "Constant").getI(); - } else { - color[list] = (byte) parameterStore.get("CompositeParticle", "Constant").getI(); - } - } - } - } - } - - - /** Colour by index. - * e.g. colorByIndex(indexBy(phi)); - * will allow nearby phi tracks to be coloured differently. - * @param index - */ - protected void colorByIndex(int[] index) { - int numColors = parameterStore.get("HitColors", "Number").getI(); - - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for (int i = 0; i < numData; i++) { - color[index[i]] = (byte) col[i % numColors]; - } - } - - protected void colorByIndex() { - int numColors = parameterStore.get("HitColors", "Number").getI(); - - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for (int i = 0; i < numData; i++) { - color[i] = (byte) col[i % numColors]; - } - } - - protected void colorByCollection() { - int constantColor = parameterStore.get(PARAMETER_GROUP, "Constant").getI(); - int numColors = parameterStore.get("HitColors", "Number").getI(); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - AEvent ev = eventManager.getCurrentEvent(); - // vector with store gate keys for a particular datatype name: this.getName() - Vector<String> v = ev.getCollections().get(this.getName()); - int keyIndex = 0; - if (v != null && (keyIndex = v.indexOf(this.getStoreGateKey())) != -1) { - // v is null - requested datatype name doesn't exists in the current - // event - - // if keyIndex is -1 it means the current - // store gate key doesn't exists in the current event (for a datatype - // which exists in the current event) - // previous event(s) are being drawn and this colouring function - // won't work for them but only for the current event - - // constant colour index is used purely as modifier so as all datatypes - // coloured by colletictions don't start at the same colour ... - keyIndex += constantColor; - for (int i = 0; i < numData; i++) { - color[i] = (byte) col[keyIndex % numColors]; - } - } else { - logger.debug("colorByCollection(): can't colour by collection"); - } - - } // colorByCollection() ------------------------------------------------ - - /** - * Colour another class by association. This class is providing the colour, - * we assign colours from the local class to the target using col[] and id[][]. - * - * @param col target class colour array - * @param id association array from this class to the target class - * @param unconnectedColor colour for unconnected hits - * @param sharedColor colour for shared hits - */ - protected void colorByAssociation(AData target, int[][] id, - byte unconnectedColor, byte sharedColor) { - - // All hits are unconnected by default - for (int i=0; i<target.color.length; i++) { - target.color[i] = unconnectedColor; - } - - if (id == null) return; - - // Loop over drawn objects in this class, then colour the other elements - // that are associated. i iterates over the drawn items, j is the true - // index and k refers to an associated item in the target class, with true - // index l. - for (int i=0; i<numDraw; i++) { - int j = listdl[i]; - - if (id[j] != null) { - for (int k = 0; k < id[j].length; k++) { - int l = target.getIndexFromId(id[j][k]); - - if (l < 0) continue; - - if (target.color[l] != unconnectedColor) { - // If item l was already connected, that means it is shared - target.color[l] = sharedColor; - } else { - // Assign associated item l the colour of item j in the local class - target.color[l] = this.color[j]; - } - } - } - } - } // colorByAssociation() ----------------------------------------------- - - protected void setColor(int index, byte color) { - if (index >= 0 && index < this.color.length) { - this.color[index] = color; - } else { - logger.debug(getClass().getName() + ": Set color for data with index = " + index); - } - } - - protected void setColor(byte color) { - for (int i = 0; i < this.color.length; i++) { - this.color[i] = color; - } - } - - protected void colorBy(int[] coloringVariable) { - int numColors = parameterStore.get("HitColors", "Number").getI(); - - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - - for (int i = 0; i < numData; i++) { - color[i] = (byte) col[coloringVariable[i] % numColors]; - } - } - - protected void colorBy(String colorGroup, int[] coloringVariable) { - int numColors = parameterStore.get(colorGroup, "Number").getI(); - - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray(colorGroup, "C1", numColors); - - for (int i = 0; i < numData; i++) { - color[i] = (byte) col[coloringVariable[i] % numColors]; - } - } - - protected void colorBy(float[] Pt) { - int numColors = parameterStore.get("HitColors", "Number").getI(); - - numColors = Math.min(7, numColors); - int[] col = parameterStore.getArray("HitColors", "C1", numColors); - for (int i = 0; i < numData; i++) { - int icol = 0; - if (Math.abs(Pt[i]) < 2) { - icol = 4; //lichtblauw - } else if (Math.abs(Pt[i]) < 4) { - icol = 2; //blauw - } else if (Math.abs(Pt[i]) < 10) { - icol = 5; //paars - } else if (Math.abs(Pt[i]) < 40) { - icol = 3; //oranje - } else { - icol = 0; //rood - } - color[i] = (byte) col[icol]; - } - } - - public String getName() { - return getParameterGroup(); - } - - public String getStoreGateKey() { - return storeGateKey; - } - - // x y from rho phi - protected void calculateXY(float[] rho, float[] phi, float[] x, float[] y) { - for (int i = 0; i < x.length; ++i) { - x[i] = (float) (rho[i] * Math.cos(phi[i])); - y[i] = (float) (rho[i] * Math.sin(phi[i])); - } - } - - /** Calculate rho phi from x y */ - protected void calculateRhoPhi(float[] x, float[] y, float[] rho, float[] phi) { - // [2007-07-20] method is again always called from AData.makeDrawList() - // but reference to primary vertex is removed, it's not taken into account now - // double[] pVtx = Atlantis.getEventManager().getCurrentEvent().getPrimaryVertex(); - // double dx = x[i] - pVtx[0]; - // double dy = y[i] - pVtx[1]; - - for (int i = 0; i < rho.length; i++) { - double dx = x[i]; - double dy = y[i]; - - rho[i] = (float) (Math.sqrt(dx * dx + dy * dy)); - phi[i] = (float) (Math.atan2(dy, dx)); - if (phi[i] < 0.) { - phi[i] += AMath.TWO_PI; - } - } - } - - /** Draw the data form this detector on this window and projection */ - public void draw(AWindow window, AGraphics ag, AProjection2D projection) { - ag.draw(window.calculateDisplay(getUser(projection))); - } - - /** Get the data from a projection without non linear transform applied. - * @param projection - * @return - */ - protected ACoord getUserNoTransform(AProjection projection) { - ACoord data = ACoord.NO_DATA; - // don't use reflection as debugging is then harder - if (projection instanceof AProjectionYX) { - data = getYXUser(); - } else if (projection instanceof AProjectionFR) { - data = getFRUser(); - } else if (projection instanceof AProjectionRZ) { - data = getRZUser(); - } else if (projection instanceof AProjectionXZ) { - data = getXZUser(); - } else if (projection instanceof AProjectionYZ) { - data = getYZUser(); - } else if (projection instanceof AProjectionFZ) { - data = getFZUser(); - } else if (projection instanceof AProjectionVP) { - data = getVPUser(); - } else if (projection instanceof AProjection3D) { - data = get3DUser(); - } - - return data; - } - - /** Get the data form a projection with non linear transform applied. */ - protected ACoord getUser(AProjection2D projection) { - currentProjection = projection; - return projection.nonLinearTransform(getUserNoTransform(projection)); - } - - /** Should the polygon from this detector be drawn or filled? */ - protected int getDrawOrFill() { - return AGraphics.DRAW; - } - - /** - * Prints info about association in which AData:index participates - * (pick + n (navigate) - * @param index int - * @return String - */ - public String navigate(int index) { - StringBuilder temp = new StringBuilder(); - String assocKey = getFullName(); - String[] knownAssoc = event.getAssociationManager().getKnownAssociations(assocKey); - temp.append(" associated to:\n"); - for (int i = 0; i < knownAssoc.length; i++) { - AData source = eventManager.getCurrentEvent().get(knownAssoc[i]); - if (source == null) continue; - int[][] ass = event.getAssociationManager().get(assocKey, knownAssoc[i]); - if (ass != null && ass[index] != null) { - for (int x = 0; x < ass[index].length; x++) { - temp.append(" " + knownAssoc[i] + " id: " + ass[index][x] + - " index: " + source.getIndexFromId(ass[index][x]) + "\n"); - } - } - } - return temp.toString(); - - } // navigate() --------------------------------------------------------- - - private boolean isEMValidate(int inputValue) { - if (inputValue > 65535) { - String displayMessage = "isEM is a 16-bit binary data, maximum is 65535"; - AExceptionHandler.processException("warning", displayMessage.toString()); - return false; - } - return true; - } - - // "1" means a wildcard, can be "0" or "1" - private Vector<String> getPossibleValues(String bStr) { - Vector<String> possibleValues = new Vector<String>(); - if (bStr.length() == 1) { - possibleValues.add("0"); - if (bStr.charAt(0) == '1') { - possibleValues.add("1"); - } - } else { - Vector<String> possibleValuesWithoutFirstChar = getPossibleValues(bStr.substring(1)); - for (int i = 0; i < possibleValuesWithoutFirstChar.size(); i++) { - String str = possibleValuesWithoutFirstChar.get(i); - possibleValues.add("0" + str); - if (bStr.charAt(0) == '1') { - possibleValues.add("1" + str); - } - } - - } - return possibleValues; - } - - private void cutIsEM(String text, int[] array, Vector<String> possibleValues) { - int num = 0; - - for (int i = 0; i < numDraw; i++) { - for (int j = 0; j < possibleValues.size(); j++) { - String str = possibleValues.get(j); - int value = Integer.parseInt(str, 2); - if (array[listdl[i]] == value) { - listdl[num++] = listdl[i]; - break; - } - } - } - - numDraw = num; - } - - /** - * Track name + Track storeGateKey is returned according to selected - * Track collection in InDet -> Track -> TrackCollection listbox - * @return String - */ - protected String getReconstructedTracks() { - AData tracks = eventManager.getCurrentEvent().getTrackData("InDetTrack"); - String r = null; - if (tracks != null) { - r = tracks.getName() + tracks.getStoreGateKey(); - } - - return r; - - } // getReconstructedTracks() --------------------------------------------- - - /** - * Jet + Jet storeGateKey is returned according to selected - * Jet collection in ATLAS -> Jet -> JetCollection listbox - * @return String - */ - protected String getJets() { - AData jets = eventManager.getCurrentEvent().getJetData(); - String r = null; - if (jets != null) { - r = jets.getName() + jets.getStoreGateKey(); - } - - return r; - - } // getJets() ---------------------------------------------------------- - - /** - * RVx + RVx storeGateKey is returned according to selected - * vertex collection in InDet -> RecVertex -> VerteCollection listbox - * @return String - */ - protected String getRVx() { - AData rvx = eventManager.getCurrentEvent().getRVxData(); - String r = null; - if (rvx != null) { - r = rvx.getName() + rvx.getStoreGateKey(); - } - - return r; - - } // getRVx() ---------------------------------------------------------- - - protected AData getObjectCollection(String type) { - return eventManager.getCurrentEvent().getData(type); - } - - /** - * Cluster + Cluster storeGateKey is returned according to selected - * Cluster collection in Calo -> Cluster -> Cluster listbox - * @return String - */ - protected String getClusters() { - AData clusters = eventManager.getCurrentEvent().getClusterData(); - String r = null; - if (clusters != null) { - r = clusters.getName() + clusters.getStoreGateKey(); - } - - return r; - - } // getClusters() ------------------------------------------------------ - - public int[] getDrawList() { - return listdl; - - } // getDrawList() ------------------------------------------------------ - - /** Apply eta+-deltaEta cut to points (e.g. S3D) */ - protected void cutEta(float[] rho, float[] z) - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - boolean useEtaCut = par.getStatus(); - - if(useEtaCut) - { - double etaCut = Math.abs(par.getD()); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaLower = etaMid - etaCut; - double etaUpper = etaMid + etaCut; - int num = 0; - - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double eta = AParameterUtilities.eta(z[list], rho[list]); - - if(eta - etaLower > 1.0e-6 && etaUpper - eta > 1.0e-6) - listdl[num++] = list; - } - numDraw = num; - } - } - - - /** Apply eta+-deltaEta cut to lines perpendicular to beam axis */ - protected void cutEtaDRho(float[] rho, float[] z, float[] drho) - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - boolean useEtaCut = par.getStatus(); - - if(useEtaCut) - { - double etaCut = Math.abs(par.getD()); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaLowerCut = etaMid - etaCut; - double etaUpperCut = etaMid + etaCut; - int num = 0; - - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double eta1 = AParameterUtilities.eta(z[list], rho[list] + drho[list]); - double eta2 = AParameterUtilities.eta(z[list], rho[list] - drho[list]); - double etaLower = Math.min(eta1, eta2); - double etaUpper = Math.max(eta1, eta2); - - if(etaUpper - etaLowerCut > 1.0e-6 - && etaUpperCut - etaLower > 1.0e-6) - listdl[num++] = list; - } - numDraw = num; - } - } - - /** Apply eta+- deltaEta cut to lines parallel to beam axis */ - protected void cutEtaDZ(float[] rho, float[] z, float[] dz) - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - boolean useEtaCut = par.getStatus(); - - if(useEtaCut) - { - double etaCut = Math.abs(par.getD()); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaLowerCut = etaMid - etaCut; - double etaUpperCut = etaMid + etaCut; - int num = 0; - - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double etaLower = AParameterUtilities.eta(z[list] - dz[list], rho[list]); - double etaUpper = AParameterUtilities.eta(z[list] + dz[list], rho[list]); - - if(etaUpper - etaLowerCut > 1.0e-6 - && etaUpperCut - etaLower > 1.0e-6) - listdl[num++] = list; - } - numDraw = num; - } - } - - /** apply eta+-deltaeta cut to lines (e.g. TRT) */ - protected void cutEtaDEta(float[] eta, float[] deta) - { - AParameter par = parameterStore.get("CutsATLAS", "CutEta"); - - if(!par.getStatus()) - return; - double etaCut = Math.abs(par.getD()); - double etaMid = parameterStore.get("CutsATLAS", "EtaMiddle").getD(); - double etaLowerCut = etaMid - etaCut; - double etaUpperCut = etaMid + etaCut; - int num = 0; - - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - double etaLower = eta[list] - deta[list]; - double etaUpper = eta[list] + deta[list]; - - if(etaUpper - etaLowerCut > 1.0e-6 - && etaUpperCut - etaLower > 1.0e-6) - listdl[num++] = list; - } - numDraw = num; - - } - - - - /** - * - * @param sourceDatatype name of the datatype according to - * which the cut is being done - * @param beingCutDatatype name of the datatype which is - * being cut - * @param cutOption integer value of the cut option in GUI - */ - protected void cutByAssociationTo(String sourceDatatype, - String beingCutDatatype, int cutOption) - { - if(cutOption == 0) - { - // SA select all - // do nothing, draw everything - return; - } - - AEvent ev = eventManager.getCurrentEvent(); - AData source = ev.get(sourceDatatype); - int[][] assoc = event.getAssociationManager().get(beingCutDatatype, sourceDatatype); - if (assoc == null || source == null) { - AData being = ev.get(beingCutDatatype); - String screenName; - if(being!=null)screenName= being.getNameScreenName(); - else screenName="null"; - logger.warn(screenName + " - null (" + beingCutDatatype + " - " - + sourceDatatype +") association, nothing to draw"); - // if 'connected' or 'unconnected' is selected and association - // or datatype to associate with doesn't exist, draw nothing - // (numDraw = 0) - numDraw = 0; - return; - } - - if(cutOption == 1) - { - // SC select connected - int num = 0; - // first remove those not connected to anything - for(int i = 0; i < numDraw; i++) - { - if(assoc[listdl[i]] != null) - { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - // if tracks exist apply cuts to them - numDraw = source.cutByAssociation(numDraw, listdl, assoc); - } - else if(cutOption == 2) - { - // SU select unconnected - int num = 0; - for(int i = 0; i < numDraw; i++) - { - if(assoc[listdl[i]] == null) - { - listdl[num++] = listdl[i]; - } - } - numDraw = num; - } - - } // cutByAssociationTo() ----------------------------------------------- - - - - private int cutByAssociation(int numDraw, int[] listdl, int[][] id) - { - // aaargh danger modifies input listdl - makeDrawList(); - boolean[] drawn = isDrawn(); - int num = 0; - - for(int i = 0; i < numDraw; i++) - { - int list = listdl[i]; - if(id[list] != null) - { - for(int j = 0; j < id[list].length; ++j) - { - int inverse = indexFromId.get(id[list][j]); - if(inverse != NO_INVERSE && drawn[inverse]) - listdl[num++] = list; - break; - } - } - } - numDraw = num; - return numDraw; - } - - /** - * return graphics attributes corresponding to layer =0 frame layer =1 hits - * or tracks type=0 noise type=1 non-noise - */ - public ADrawParameters getDrawParameters(int layer, int type) - { - boolean draw = true; - int singleColor = -1; - int size = 10; - int lineWidth = 1; - int symbol = 0; - int frameWidth = 0; - boolean forceSymbols = false; - int minSize = 0; - - AParameter forceSymbolsPar = parameterStore.getUnknown(PARAMETER_GROUP, "ForceSymbols"); - AParameter symbolSize = parameterStore.getUnknown(PARAMETER_GROUP, "SymbolSize"); - AParameter symbolType = parameterStore.getUnknown(PARAMETER_GROUP, "Symbol"); - AParameter lineWidthPar = parameterStore.getUnknown(PARAMETER_GROUP, "LineWidth"); - - if(forceSymbolsPar != null) - { - forceSymbols = forceSymbolsPar.getStatus(); - if(forceSymbols && symbolSize != null) - minSize = Math.max(symbolSize.getI(), 1); - } - - if(symbolSize != null) - size = symbolSize.getI(); - if(symbolType != null) - symbol = symbolType.getI(); - if(lineWidthPar != null) - lineWidth = lineWidthPar.getI(); - //for etmiss, line width scaled by energy by using the stroke setting - if(lineWidth<=0) - lineWidth = 1; - - if(type == 0) - { - AParameter noiseSymbolType = parameterStore.getUnknown(PARAMETER_GROUP, "Noise"); - - if(noiseSymbolType != null && noiseSymbolType.getStatus()) - { - AParameter noiseSymbolSize = parameterStore.getUnknown(PARAMETER_GROUP, "NoiseSize"); - AParameter noiseWidth = parameterStore.getUnknown(PARAMETER_GROUP, "NoiseWidth"); - - if(noiseSymbolSize != null) - size = noiseSymbolSize.getI(); - if(noiseWidth != null) - lineWidth = noiseWidth.getI(); - symbol = noiseSymbolType.getI(); - } - else - { - AParameter noiseWidth = parameterStore.getUnknown(PARAMETER_GROUP, "NoiseWidth"); - - if(noiseWidth != null && noiseWidth.getStatus()) - lineWidth = noiseWidth.getI(); - } - } - - if(layer == 0) - { - AParameter frameWidthPar = parameterStore.getUnknown(PARAMETER_GROUP, "FrameWidth"); - if(parameterStore.get(PARAMETER_GROUP, "Frame")!=null) - { - boolean drawFrame = parameterStore.get(PARAMETER_GROUP, "Frame").getStatus(); - singleColor = parameterStore.get(PARAMETER_GROUP, "Frame").getI(); - //only draw frames for Grey/BW color maps if is selected to draw frames - if(drawFrame && AColorMap.drawFrames()) - { - if(frameWidthPar != null) - frameWidth = frameWidthPar.getI(); - } - } - } - return new ADrawParameters(draw, singleColor, size, lineWidth, - frameWidth, symbol, forceSymbols, minSize, getDrawOrFill()); - } - - /** Provide an array of indices with increasing a, - * used e.g. by coloring. - * @param a - * @return - */ - protected int[] indexBy(double[] a) - { - int[] index = new int[a.length]; - - for(int i = 0; i < a.length; i++) - index[i] = i; - // this is only cosmetic improvement in appearance so if input data too - // large simply return null - if(a.length > 1000) - return index; - - for(int i = 0; i < a.length - 1; i++) - for(int j = i + 1; j < a.length; j++) - if(a[index[i]] > a[index[j]]) - { - int temp = index[i]; - index[i] = index[j]; - index[j] = temp; - } - return index; - } - - /** - * Colour items in this class by the associated class that is given by - * association. The difference with the method colorByAssociation is that - * colorBy is called on the target class, while colorByAssociation is called - * on the source class of the colour. (i.e. colour hits by tracks invokes - * AHitData.colorBy("Tracks"), calling ATrackData.colourByAssociation(...) - * internally. - * - * @param otherClass source class for the colours - */ - protected void colorBy(String otherClass) - { - AData source = eventManager.getCurrentEvent().get(otherClass); - byte unconnected = (byte) parameterStore.get(PARAMETER_GROUP, "Unconnected").getI(); - if(source != null) - { - byte shared = (byte) parameterStore.get(PARAMETER_GROUP, "Shared").getI(); - String assocKey = getFullName(); - int[][] assoc = event.getAssociationManager().get(otherClass, assocKey); - source.makeDrawList(); - source.color(); - source.colorByAssociation(this, assoc, unconnected, shared); - - } - else - { - /* - * given association doesn't exist. for instance, there are only - * hits in the event file and nothing to associate them with. - * if some 'association colouring' (e.g. colour by reconstructed - * track) is selected in that case, the items appear all in - * 'unconnected' colour. another option is to colour them in - * constant colour, simply by calling only colorByConstant(); - */ - for(int i = 0; i < numData; i++) - { - color[i] = (byte) unconnected; - } - } - - } // colorBy() ---------------------------------------------------------- - - protected void colorByObjects() - { - // initially set all with unconnected color, connected will be changed later - byte unconnectedColor = (byte) parameterStore.get(PARAMETER_GROUP, "Unconnected").getI(); - setColor(unconnectedColor); - String[] objectList = new String[] {"Jet", "BJet", "TauJet", "Photon", "Electron", "Muon"}; - for(int i=0; i<objectList.length; ++i) - { - if (parameterStore.get("Data", objectList[i]).getStatus()) - colorByObject(getObjectCollection(objectList[i])); - } - } - - private void colorByObject(AData objectData) - { - if(objectData == null) - { - return; - } - - AEnumeratorParameter listBox = (AEnumeratorParameter) parameterStore.get(getName(), getName() + "Collections"); - String selectedCollection = listBox.getCurrentText(); - if(!("All".equals(selectedCollection) || "None".equals(selectedCollection))) - { - String assName = getName(); - if(getName().indexOf("Track") >= 0) - assName = "Track"; - AAssociation assoc = event.getAssociationManager().getAssociation(objectData.getName()+objectData.getStoreGateKey(), assName); - if(assoc != null) - { - if(!(assoc instanceof AObjectsAssociation)) - { - logger.warn(getClass().getName() + ": no objects association is found!"); - return; - } - int[][] associatedIndex = ((AObjectsAssociation) assoc).getData(); - String[] associatedKey = ((AObjectsAssociation) assoc).getKey(); - - // if currently selected collection is included in associatedKey, show associations - // otherwise using the color set for unconnected cluster/track - int objectIndex = 0; - for(int i=0; i<associatedKey.length;) - { - // objectIndex is the index of the associated object (e.g. Electron) - // associatedIndex[objectIndex][] contain the index of the associated Cluster/Track - if ("none".equals(associatedKey[i])) - { - i++; - objectIndex++; - } - else - { - if (associatedKey[i].equals(selectedCollection)) - for(int j=0; j<associatedIndex[objectIndex].length; ++j) - setColor(associatedIndex[objectIndex][j], objectData.getColor()[objectIndex]); - i+=associatedIndex[objectIndex++].length; - } - } - } - } - } - - /** - * The same as name, but if it's multiple collection datatype, the full - * name is getName() + getStoreGateKey() - * @return String - */ - public String getFullName() - { - String k = this.getStoreGateKey(); - String full = this.getName() + (k != null ? k : ""); - return full; - } - - public int getIdFromIndex(int index) - { - return id[index]; - } - - // sets the color of each hit - protected final void color() - { - // standard scheme - internalColor(); - int[][] temp = AListManager.getInstance().getColorMapping(this); - int[] index = temp[0]; - int[] c = temp[1]; - // now add in colors specified in lists - - for(int i = 0; i < index.length; ++i) - if(c[i] >= 0) - color[index[i]] = (byte) c[i]; - int others = AListManager.getInstance().getColorOfOthers(); - // need to check if this data could have been picked - // so that coloring of hits by STr works even if STr - // is not in list because it wasn't on.... - if(others >= 0 && parameterStore.get("Data", getName()).getStatus()) - { - boolean[] inList = new boolean[numData]; - for(int i = 0; i < index.length; ++i) - inList[index[i]] = true; - - for(int i = 0; i < numData; ++i) - if(!inList[i]) - color[i] = (byte) others; - } - - - - } - - - /** Type = e.g. noise/good */ - public int[] getType(int[] dl) - { - return new int[dl.length]; - } - - // get data representation in user space in different projections - // empty by default - protected ACoord getYXUser() - { - return ACoord.NO_DATA; - } - - protected ACoord getRZUser() - { - return ACoord.NO_DATA; - } - - protected ACoord getYZUser() - { - return ACoord.NO_DATA; - } - - protected ACoord getXZUser() - { - return ACoord.NO_DATA; - } - - protected ACoord get3DUser() - { - return ACoord.NO_DATA; - } - - protected ACoord getUserUser() - { - return ACoord.NO_DATA; - } - - protected ACoord getUserUser2() - { - return ACoord.NO_DATA; - } - - protected ACoord getFRUser() - { - return ACoord.NO_DATA; - } - - protected ACoord getFZUser() - { - return ACoord.NO_DATA; - } - - protected ACoord getVPUser() - { - return ACoord.NO_DATA; - } - - public int getNumTypes() - { - return 1; - } - - - /** The only method from AListProcessor interface. */ - @Override - public Action[] getActions(Collection nodes) - { - return new Action[0]; - } // getActions() ------------------------------------------------------- - - /** - * Function to split a list of items seperated by - - */ - public String[] splitItems(String origItems) - { - char[] origItemsChar = origItems.toCharArray(); - int origItemsLength = origItems.length(); - int spacePosition=0, noOfItems=0, count=0; - //calculate the number of items - for(int i=0;i<origItemsLength;i++) - if((i!=0 && origItemsChar[i]=='-') || (i==origItemsLength-1 && origItemsChar[i]!='-')) - noOfItems++; - //split up the array into newItems - if(noOfItems>0) - { - //string array to hold individual items - String[] newItems=new String[noOfItems]; - for(int i=0;i<origItemsLength;i++) - { - if(i==0 && origItemsChar[i]=='-') - spacePosition=i+1;//ignore first'-' - else if(i==origItemsLength-1 && origItemsChar[i]!='-') - { - //store the text from previous '-' upto end if doesn't end with '-' - newItems[count]=origItems.substring(spacePosition,i+1); - spacePosition=i+1; - count++; - } - else if(origItemsChar[i]=='-' && i!=0) - { - //store the text from previous '-' upto current '-' - newItems[count]=origItems.substring(spacePosition,i); - spacePosition=i+1; - count++; - } - } - return newItems; - } - else - return null; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AEpsImageProducer.java b/graphics/AtlantisJava/src/atlantis/event/AEpsImageProducer.java deleted file mode 100644 index eef4e9615f1f0c40179c97dde9f1eb44d311f220..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AEpsImageProducer.java +++ /dev/null @@ -1,117 +0,0 @@ -package atlantis.event; - -import java.io.File; -import java.io.IOException; - -import atlantis.utils.*; -import atlantis.canvas.ACanvas; -import atlantis.graphics.encoders.AImageEncoder; -import java.awt.Dimension; - - -/** - * Implements ANewEventListener and creates EPS files - * upon each newEvent call. A scale factor allows to e.g. produce thumbnails by - * scaling down image. The image producer works in two modes: - * a) If no file name is given, a file name will be generated from run and event - * number. In case the output file exists, no file is created but a warning is written out. - * b) If a file name is given, a temporary file is generated first, and then - * renamed to the given file name. If renaming fails, a warning is written out - * and the temporary file is deleted. - * - * @author Sebastian Boeser - */ - -public class AEpsImageProducer extends AImageProducer -{ - // the logger - private static final ALogger logger = ALogger.getLogger(AEpsImageProducer.class); - - // Our image encode - private final AImageEncoder imageEncoder = new AImageEncoder(); - - /** - * Fully qualified constructor, - * intializing all the attributes and check the parameters validity - * @param dir the directory in which to save all the files - * @param size the dimensions of the images - * @param scale the factor by which to scale the images - * @param fileName if not null, that file will be overwritten for each event - * @throws InstantiationException if we fail to create the object - */ - public AEpsImageProducer(String dir, Dimension size, double scale, String fileName) throws InstantiationException - { - super(dir, size, scale, fileName); - } - - /** - * Called whenever a new event appears. Store an EPS in the directory, - * either with a generated file name (no overwrite) or with a fixed file name (overwrite) - * @param event the event from which to generate the EPS - */ - public void newEvent(AEvent event) - { - - //If auto had been set for size (height is negative), get height from Canvas - if (imageSize.height < 0) imageSize.setSize(imageSize.width, ACanvas.getCanvas().getRespectiveHeight(imageSize.width)); - - //Create the file to write the data into - File outFile; - //If we don't have a fixed file name, - //generate a unique one based on run- and event number - if (fixedFileName==null){ - - //Now construct all the full path for the file we want to save - String outFileName = String.format("%s%s%s.eps",directory, - System.getProperty("file.separator"), - getEventFileName(event)); - - // Create file handles to the file and check if it exists - outFile = new File(outFileName); - //Do not overwrite any existing files - if (outFile.exists()) { - logger.warn("File "+ outFileName +" already exists - will not overwrite"); - return; - } - //otherwise generate a temporary file first, - //then move it in place later - } else { - //make a temporary file in the final directory - try { - outFile = File.createTempFile(filePrefix+"_", ".eps",directory); - } catch (IOException ex) { - logger.warn("Failed to create temporary file in "+directory.getAbsolutePath()); - return; - } - } - - //Now try saving the acquired data, - //and if it shall go to a fixed file, move it there - try { - imageEncoder.saveEPS(imageSize.width, imageSize.height, outFile); - - //move to fixed file name if requested - if (fixedFileName != null){ - - //Get a handle to the final destination - File fixedFile = new File(directory,fixedFileName); - - //delete target if exits - if (fixedFile.exists() && (!fixedFile.delete())) - throw new IOException("Failed to delete existing file "+fixedFile.getAbsolutePath()); - - //And move the new file in place - if (!outFile.renameTo(fixedFile)) - throw new IOException("Failed to rename temporary file to "+fixedFile.getAbsolutePath()); - } - } catch (IOException ioe) { - //If we fail, throw a warning - logger.warn("Could not save EPS files for history\n"+ioe.toString()); - } finally { - //In any case, delete the pngFile, if it was just temporary - if (fixedFileName != null) outFile.delete(); - } - - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AEvent.java b/graphics/AtlantisJava/src/atlantis/event/AEvent.java deleted file mode 100755 index beeae482f160b77d55d6ec05024e5945bb5d019b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AEvent.java +++ /dev/null @@ -1,1051 +0,0 @@ -package atlantis.event; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; -import java.util.TreeMap; -import java.util.LinkedHashMap; -import java.util.Set; - -import atlantis.list.AListManager; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AEnumeratorParameter; -import atlantis.parameters.APar; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; -import atlantis.data.*; -import atlantis.globals.AGlobals; - -/** - * AEvent is the Container for an ATLAS physics event. - * It is identified by deriving from AEventInfo and holds a map of all the - * data that is available in the event. - * - */ -public class AEvent extends AEventInfo -{ - private static ALogger logger = ALogger.getLogger(AEvent.class); - - // container with all datatypes within the event - private Map<String,AData> data = new HashMap<String,AData>(); - // storegate keys for collections-aware datatypes - // Use parameterized type but keep Hashtable and Vector instead of HashMap - // and ArrayList until I work out if thread safety is an issue. - Ben 31/1/11 - private Hashtable<String,Vector<String>> collections = new Hashtable<String,Vector<String>>(); - - private AAssociationManager assocmgr = new AAssociationManager(); - - private static APar parameterStore = APar.instance(); - - /** - * @param eventNumber the event number - * @param runNumber the run number - * @param dateTime the date and time of the event - * @param sourceName the name of the event source - * @param lumiBlock the lumiBlock number - */ - public AEvent(String eventNumber, String runNumber, String dateTime, String sourceName, String lumiBlock, String eventProperties) { - - //Initialize event information - super(Integer.parseInt(eventNumber), Integer.parseInt(runNumber), dateTime, sourceName, lumiBlock, eventProperties); - - } // AEvent() ----------------------------------------------------------- - - /** - * @return the hashtable of available collections - */ - public Hashtable<String,Vector<String>> getCollections(){ - return collections; - } // getCollections() --------------------------------------------------- - - - public void add(AData dataSet) throws AAtlantisException - { - String name = dataSet.getClass().getName(); - - int index = name.lastIndexOf('.'); - if(index >= 0 && index < name.length() - 1) - { - name = name.substring(index + 1); - } - - // remove the "A" and "Data" - name = name.substring(1, name.length() - 4); - String newKey = dataSet.getStoreGateKey(); - - if(newKey == null) - { - // no storegatekey comes with this dataset (datatype) - // hash data shouldn't contain entry under sourceName key, if it does - // the old one is replaced - data.put(name, dataSet); - } - else - { - // just checking for the same key at the datatypes in the event - if(data.containsKey(name + newKey)) - { - String msg = "Error - datatype " + name + " with storeGateKey\n" + - newKey + " already exists in this event."; - AAtlantisException aaex = new AAtlantisException(msg); - // Stuck the trace in the logging for good measure - AD - logger.error("\n" + msg, aaex); - throw aaex; - } - else - { - data.put(name + newKey, dataSet); - // saving key of a particular sourceName (datatype) - Vector<String> keys = new Vector<String>(); - if(collections.containsKey(name)) - { - keys = collections.get(name); - if(keys.contains(newKey)) - { - String msg = "Previously read datatype " + name + "\n" + - "(different collection) contained " + - "storeGateKey " + newKey + ". Error."; - AAtlantisException aaex = new AAtlantisException(msg); - logger.error(msg, aaex); - throw aaex; - } - else - { - keys.add(newKey); - collections.put(name, keys); - } - } - else - { - keys.add(newKey); - collections.put(name, keys); - } - } - } - - } // add() --------------------------------------------------------------- - - - - - - // < get<DATA_TYPE> methods > ------------------------------------------- - - - public AData get(String name) - { - return data.get(name); - } - - public AData[] getData() - { - AData[] aData = new AData[data.size()]; - Collection<AData> collection = data.values(); - return collection.toArray(aData); - } - - - /** - * AJetData getJetData() - * returns collection of Jet datatype according to selected - * collection (Jet storeGateKey) in ATLAS -> Jet -> Jet Collection - * if 'all' (or 'none') is selected - returns null (no association will - * be taken into account) - * @return AJetData - */ - public AJetData getJetData() - { - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get("Jet", "JetCollections"); - String selectedKey = listBox.getCurrentText(); - if("All".equals(selectedKey) || "None".equals(selectedKey)) -{ - logger.debug("AEvent.getJetData(): " + selectedKey + - " is selected in Jet->JetCollection, no association " + - " to Jet is taken into account, null is returned"); - return null; - } - else - { - AJetData jet = (AJetData) data.get("Jet" + selectedKey); - return jet; - } - } - - - // can combine with the other methods (e.g. getClusterData) - public AData getData(String type) - { - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get(type, type+"Collections"); - String selectedKey = (listBox == null) ? "" : listBox.getCurrentText(); - if("All".equals(selectedKey) || "None".equals(selectedKey)) { - - logger.debug("AEvent.getData(String type): " + selectedKey + - " is selected in " + type + "->" + type + " Collections, " + - "no association to " + type + " is taken into account."); - - return null; - } - else - { - return data.get(type + selectedKey); - } - } - - /** - * AClusterData getClusterData() - * returns collection of Cluster datatype according to selected - * collection (Cluster storeGateKey) in ATLAS -> Cluster -> Cluster Collection - * if 'all' (or 'none') is selected - returns null (no association will - * be taken into account) - * @return AClusterData - */ - public AClusterData getClusterData() - { - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get("Cluster", "ClusterCollections"); - String selectedKey = listBox.getCurrentText(); - if ("All".equals(selectedKey) || "None".equals(selectedKey)) { - - logger.debug("AEvent.getClusterData(): " + selectedKey + - " is selected in Cluster->ClusterCollection, no association " + - " to Cluster is taken into account, null is returned"); - - return null; - } - else - { - AClusterData cluster = (AClusterData) data.get("Cluster" + selectedKey); - return cluster; - } - } - - - /** - * ATrackData getTrackData(String type) - * type is InDetTrack, MuonTrack - the internal datatype sourceName for Track - * returns collection of Track datatype according to selected - * collection (Track storeGateKey) in InDet -> Track -> TrackCollection - * if 'all' (or 'none') is selected - returns null (no association will - * be taken into account) - * @param type String - * @return ATrackData - */ - public ATrackData getTrackData(String type) - { - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get(type, type + "Collections"); - String selectedKey = listBox.getCurrentText(); - if("All".equals(selectedKey) || "None".equals(selectedKey)) - { - logger.debug("AEvent.getTrackData(" + type + "): " + selectedKey + - " is selected in Track->TrackCollection, no association " + - " to Track is taken into account, null is returned"); - return null; - } - else - { - ATrackData track = (ATrackData) data.get(type + selectedKey); - return track; - } - } - - - /** - * ATrackData getTrackData(String type, String key) - * returns specified collection of Track datatype if it exists - * @param type String - * @param key String - * @return ATrackData - */ - public ATrackData getTrackData(String type, String key) - { - Vector<String> keys = collections.get(type); - if(keys == null) { - logger.warn("AEvent: " + type + " datatype doesn't exist " + - "in current event"); - return null; - } - else - { - if(keys.contains(key)) - { - return (ATrackData) data.get(type + key); - } - else { - - logger.warn("AEvent: " + type + " datatype: storeGateKey " + - key + " doesn't exist in current event"); - return null; - } - } - } - - - - - public ASTrData getSTrData() - { - return (ASTrData) data.get("STr"); - } - - public ASNPData getSNPData() - { - return (ASNPData) data.get("SNP"); - } - - public APixelClusterData getPixelClusterData() - { - return (APixelClusterData) data.get("PixelCluster"); - } - - public ASiClusterData getSiClusterData() - { - return (ASiClusterData) data.get("SiCluster"); - } - - public AS3DData getS3DData() - { - return (AS3DData) data.get("S3D"); - } - - public ATRTData getTRTData() - { - return (ATRTData) data.get("TRT"); - } - - public ALArData getLArData() - { - return (ALArData) data.get("LAr"); - } - - public ATILEData getTILEData() - { - return (ATILEData) data.get("TILE"); - } - - public AHECData getHECData() - { - return (AHECData) data.get("HEC"); - } - - public AFCALData getFCALData() - { - return (AFCALData) data.get("FCAL"); - } - - public AMBTSData getMBTSData() - { - return (AMBTSData) data.get("MBTS"); - } - - //Because some things need to access the data before the parameters are filled, another method - //for accessing the data has been added. This method first checks the list of available storegate keys - //and see's if there is one starting with MDT. As the dataType + storegatekey is hard coded into how - //the hash map keys are created this should be a stable way of doing it. If there are multiple - //results for the search, it then checks which one is currently selected by the user. - - public AMDTData getMDTData() - { - Vector<String> storeGateKeys = new Vector<String>(); - Set<String> keys = data.keySet(); - for(String entry : keys){ - if(entry.startsWith("MDT")){ - storeGateKeys.add(entry); - } - } - if(storeGateKeys.size() == 1){ - return (AMDTData) data.get(storeGateKeys.get(0)); - }else{ - - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get("MDT", "MDTCollections"); - String selectedKey = listBox.getCurrentText(); - if("All".equals(selectedKey) || "None".equals(selectedKey)) - { - logger.debug("AEvent.getMDTata(): " + selectedKey + - " is selected in MDT->MDTCollection, no association " + - " to MDT is taken into account, null is returned"); - return null; - - } - else{ - AMDTData mdt = (AMDTData) data.get("MDT" + selectedKey); - return mdt; - } - - - } - - } - - //See description for getMDTData - - public ARPCData getRPCData() - { - - Vector<String> storeGateKeys = new Vector<String>(); - Set<String> keys = data.keySet(); - for(String entry : keys){ - if(entry.startsWith("RPC")){ - storeGateKeys.add(entry); - } - } - if(storeGateKeys.size() == 1){ - return (ARPCData) data.get(storeGateKeys.get(0)); - }else{ - - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get("RPC", "RPCCollections"); - String selectedKey = listBox.getCurrentText(); - if("All".equals(selectedKey) || "None".equals(selectedKey)) - { - logger.debug("AEvent.getRPCData(): " + selectedKey + - " is selected in RPC->RPCCollection, no association " + - " to RPC is taken into account, null is returned"); - return null; - - } - else{ - ARPCData rpc = (ARPCData) data.get("RPC" + selectedKey); - return rpc; - } - - - } - } - //See description for getMDTData - - public ATGCData getTGCData() - { - Vector<String> storeGateKeys = new Vector<String>(); - Set<String> keys = data.keySet(); - for(String entry : keys){ - if(entry.startsWith("TGC")){ - storeGateKeys.add(entry); - } - } - if(storeGateKeys.size() == 1){ - return (ATGCData) data.get(storeGateKeys.get(0)); - }else{ - - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get("TGC", "TGCCollections"); - String selectedKey = listBox.getCurrentText(); - if("All".equals(selectedKey) || "None".equals(selectedKey)) - { - logger.debug("AEvent.getTGCData(): " + selectedKey + - " is selected in TGC->TGCCollection, no association " + - " to TGC is taken into account, null is returned"); - return null; - - } - else{ - ATGCData tgc = (ATGCData) data.get("TGC" + selectedKey); - return tgc; - } - - - } - } - //See description for getMDTData - - public ACSCDData getCSCDData() - { - Vector<String> storeGateKeys = new Vector<String>(); - Set<String> keys = data.keySet(); - for(String entry : keys){ - if(entry.startsWith("CSC")){ - storeGateKeys.add(entry); - } - } - if(storeGateKeys.size() == 1){ - return (ACSCDData) data.get(storeGateKeys.get(0)); - }else{ - - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get("CSC", "CSCCollections"); - String selectedKey = listBox.getCurrentText(); - if("All".equals(selectedKey) || "None".equals(selectedKey)) - { - logger.debug("AEvent.getCSCData(): " + selectedKey + - " is selected in CSC->CSCCollection, no association " + - " to CSC is taken into account, null is returned"); - return null; - - } - else{ - ACSCDData csc = (ACSCDData) data.get("CSC" + selectedKey); - return csc; - } - - - } - } - - public ASVxData getSVxData() - { - return (ASVxData) data.get("SVx"); - } - - public ARVxData getRVxData() - { - AEnumeratorParameter listBox = - (AEnumeratorParameter) parameterStore.get("RVx", "RVxCollections"); - String selectedKey = listBox.getCurrentText(); - if ("All".equals(selectedKey)) { - - logger.debug("AEvent.getRVxData(): " + selectedKey + - " is selected in InDet->RecVertex, no association " + - " to vertex is taken into account, null is returned"); - - return null; - } else if ("None".equals(selectedKey)) { - // Return collection without for backwards compatibility - return (ARVxData) data.get("RVx"); - } else - { - ARVxData rvx = (ARVxData) data.get("RVx" + selectedKey); - return rvx; - } - } - - public ATrigS3DData getTrigS3DData() - { - return (ATrigS3DData) data.get("TrigS3D"); - } - - public ALVL1TriggerTowerData getLvl1TriggerTowerData() - { - return (ALVL1TriggerTowerData) data.get("LVL1TriggerTower"); - } - - public ALVL1ResultData getLvl1ResultData() - { - return (ALVL1ResultData) data.get("LVL1Result"); - } - - public ALVL1JetElementData getLvl1JetElementData() - { - return (ALVL1JetElementData) data.get("LVL1JetElement"); - } - - public ATriggerInfoData getTriggerInfoData() - { - return (ATriggerInfoData) data.get("TriggerInfo"); - } - - /** - * This function returns the names currently selected for a certain collection - * which has its data draw status set to true - * @param collectionType String sourceName of the collection - * @return string of collection names length 0 if none in event - */ - public String[] getActiveCollectionNames(String collectionType) - { - //LVL1Result is not on the Data list as it is always on hence check this first - boolean collectionStatus = collectionType.equals("LVL1Result"); - if(!collectionStatus) - collectionStatus=parameterStore.get("Data", collectionType).getStatus(); - if (collectionStatus) - { - return getCollectionNames(collectionType); - } - else - return new String[0]; - } - - /** - * This function returns the names currently selected for a certain collection - * @param collectionType String sourceName of the collection - * @return string of collection names length 0 if none in event - */ - public String[] getCollectionNames(String collectionType) - { - String[] col; - Vector<String> keys = collections.get(collectionType); - if (keys != null) - { - String[] collec = keys.toArray(new String[keys.size()]); - AEnumeratorParameter listBox = (AEnumeratorParameter) parameterStore.get(collectionType, collectionType + "Collections"); - String currentSelection = listBox.getCurrentText(); - int count=0; - //count how many items in list - for (int i = 0; i < collec.length; i++) - { - if ("All".equals(currentSelection) || collec[i].equals(currentSelection)) - count++; - } - col=new String[count]; - count=0; - //now save items into string array - for (int i = 0; i < collec.length; i++) - { - if ("All".equals(currentSelection) || collec[i].equals(currentSelection)) - { - col[count] = collectionType + collec[i]; - count++; - } - } - return col; - } - else - return new String[0]; - } - - // </ get<DATA_TYPE> methods > -------------------------------------------- - - public List<ACalorimeterData> getCalorimeters() - { - List<ACalorimeterData> v = new ArrayList<ACalorimeterData>(); - Iterator<AData> i = data.values().iterator(); - while(i.hasNext()) - { - AData data = i.next(); - if(data instanceof ACalorimeterData) - { - ACalorimeterData calorimeter = (ACalorimeterData) data; - if(parameterStore.get("Data", calorimeter.getCalorimeterName()).getStatus() && - (parameterStore.getUnknown("Det", calorimeter.getCalorimeterName() + "Fill") == null - || parameterStore.get("Det", calorimeter.getCalorimeterName() + "Fill").getStatus())) - { - v.add(calorimeter); - } - } - } - return v; - - } // getCalorimeters() --------------------------------------------------- - - - - public List<AData> getHitsAndTracks(AProjection projection) - { - int mode = parameterStore.get(projection.getName(), "Mode").getI(); - String[][] det = new String[0][0]; - String[] simTr = new String[0]; - String[] recTr = new String[0]; - String[] hits = new String[0]; - String[] aod = new String[0]; - - if(mode == 0 || projection instanceof AProjectionVP - || projection instanceof AProjectionLegoPlot) - { - simTr = new String[] { "STr", "SNP", "SMTr" }; - recTr = new String[] { "InDetSegment", "MuonSegment", "G4Step", - "InDetTrack", "MuonTrack" }; - - aod = new String[] {"CompositeParticle", "BJet", "TauJet", "Photon", "Electron", "Muon" }; - - if(parameterStore.get("InDetDrawingOrder", "SpacePoints").getI() == 0) - { - hits = new String[] {"UserHit", "RVx", "TRT", "SiCluster", - "SiClusterRDO", "S3D", "PixelCluster", "PixelRDO", "TrigS3D", - "MDT", "CSCD", "CSC", "RPC", "R3D", "TGC", "T3D", "SVx", - "Jet", "EmTauROI", "Particle", "Cluster", "ETMis", - "JetROI", "MuonROI", "LVL1TriggerTower", "LVL1JetElement"}; - } - else - { - hits = new String[] {"UserHit", "RVx", "TRT", "SiCluster", - "SiClusterRDO", "TrigS3D", "S3D", "PixelCluster", "PixelRDO", - "MDT", "CSCD", "CSC", "RPC", "R3D", "TGC", "T3D", "SVx", - "Jet", "EmTauROI", "Particle", "Cluster", "ETMis", - "JetROI", "MuonROI", "LVL1TriggerTower", "LVL1JetElement"}; - } - } - else if(projection instanceof AProjectionYX - || projection instanceof AProjectionFR) - { - if(mode >= AProjectionYX.MODE_MDT_INNER && mode <= AProjectionYX.MODE_MDT_OUTER) - { - simTr = new String[] { "SMTr", "SMTr" }; - recTr = new String[] { "MuonTrack", "MuonSegment" }; - if(mode == AProjectionYX.MODE_MDT_INNER) - { - hits = new String[] { "MDT", "CSCD", "CSC" }; - } - else - { - hits = new String[] { "MDT" }; - } - } - else if(mode < AProjectionYX.MODE_MDT_INNER) - { - simTr = new String[] { "SMTr", "SMTr" }; - recTr = new String[] { "MuonTrack", "MuonSegment" }; - hits = new String[] { "TGC", "T3D" }; - } - } - else if(projection instanceof AProjectionFZ) - { - if(mode >= 4) - { - simTr = new String[] { "SMTr", "SMTr" }; - recTr = new String[] { "MuonTrack", "MuonSegment" }; - hits = new String[] { "MDT" }; - } - else - { - simTr = new String[] { "SMTr", "SMTr" }; - recTr = new String[] { "MuonTrack", "MuonSegment" }; - hits = new String[] { "RPC", "R3D" }; - } - } - - if(parameterStore.get("InDetDrawingOrder", "SpacePointsTracks").getI() == 0) - { - // Simulated tracks, reconstructed tracks, hits - det = new String[][] { simTr, recTr, hits, aod }; - } - else if(parameterStore.get("InDetDrawingOrder", "SpacePointsTracks").getI() == 1) - { - // Simulated tracks, hits, reconstructed tracks - det = new String[][] { simTr, hits, recTr, aod }; - } - else - { - // Reconstructed tracks, hits, simulated tracks - det = new String[][] { recTr, hits, simTr, aod }; - } - - AEnumeratorParameter listBox = null; - List<AData> v = new ArrayList<AData>(); - for(int i = 0; i < det.length; ++i) - { - for(int j = 0; j < det[i].length; ++j) - { - if(collections.containsKey(det[i][j])) - { - Vector<String> keys = collections.get(det[i][j]); - String[] array; - array = keys.toArray(new String[keys.size()]); - // GUI listbox sourceName datatype + "Collections" - listBox = (AEnumeratorParameter) parameterStore.get(det[i][j], - det[i][j] + "Collections"); - String currentSelection = listBox.getCurrentText(); - for(int c = 0; c < array.length; c++) - { - if("All".equals(currentSelection) || - array[c].equals(currentSelection)) - { - AData a = data.get(det[i][j] + array[c]); - processDataSet(v, a); - } - } - } - else - { - AData a = data.get(det[i][j]); - processDataSet(v, a); - } - } - } - return v; - - } // getHitsAndTracks() ------------------------------------------------- - - - private static void processDataSet(List<AData> v, AData a) - { - if(a != null) - { - if(parameterStore.getUnknown("Data", a.getName()) != null && - parameterStore.get("Data", a.getName()).getStatus() && - (parameterStore.getUnknown("Det", a.getName() + "Fill") == null || - parameterStore.get("Det", a.getName() + "Fill").getStatus())) - { - v.add(a); - } - } - - } // processDataSet() --------------------------------------------------- - - - - public List<ACalorimeterData> getElectromagneticCalorimeters() - { - List<ACalorimeterData> v = new ArrayList<ACalorimeterData>(); - Iterator<AData> i = data.values().iterator(); - while(i.hasNext()) - { - AData a = i.next(); - if(a instanceof ALArData || a instanceof AFCALData) - { - v.add((ACalorimeterData)a); - } - } - return v; - - } // getElectromagneticCalorimeters() ------------------------------------ - - - - public List<ACalorimeterData> getHadronicCalorimeters() - { - List<ACalorimeterData> v = new ArrayList<ACalorimeterData>(); - Iterator<AData> i = data.values().iterator(); - while(i.hasNext()) - { - AData a = i.next(); - if(a instanceof ATILEData || a instanceof AHECData - || a instanceof AFCALData || a instanceof AMBTSData) - { - v.add((ACalorimeterData)a); - } - } - return v; - - } // getHadronicCalorimeters() ------------------------------------------- - - - - /** - * setPrimaryVertex() called during event finalisation - * sets Event: XVtx, YVtx, ZVtx in the internal parameter store - * (in GUI: Projection -> eta-phi -> XVtx, YVtx, ZVtx) - - * 1) gets values from RecVertex (RVx) - see conditions in ARVxData class - * 2) gets values from simulated vertices with highest pt sum (STr) - * 3) if above fail, sets 0.0, 0.0, 0.0 - * - * (taking primary vertex from reconstructed tracks was removed) - * - */ - public void setPrimaryVertex() - { - double[] vtx = null; - - // (1) - if(getRVxData() != null) - { - // RVx data exists, try to retrieve primary vertex information - vtx = getRVxData().getPrimaryVertex(); - } - // (2) - if(vtx == null && getSTrData() != null) - { - // STr data exists, try to get primary vertex information - int vtxIndex = getSTrData().getMaxSumPtVertex(); - - //retrieve that vertex - vtx = getSVxData().getVertex(vtxIndex); - - //Completely unclear to me... why 4? - if(vtx[0] * vtx[0] + vtx[1] * vtx[1] > 4.) - { - logger.info("replacing primary with first"); - logger.info(" was " + vtx[0] + " " + vtx[1] + " " + vtx[2]); - vtx = getSVxData().getVertex(0); - if(vtx[0] * vtx[0] + vtx[1] * vtx[1] > 4.) - { - vtx[0] = 0.; - vtx[1] = 0.; - vtx[2] = 0.; - } - logger.info(" now is " + vtx[0] + " " + vtx[1] + " " + vtx[2]); - } - } - - if(vtx == null) - { - vtx = new double[] { 0.0, 0.0, 0.0 }; - } - - parameterStore.get("Event", "XVtx").setD(vtx[0]); - parameterStore.get("Event", "YVtx").setD(vtx[1]); - parameterStore.get("Event", "ZVtx").setD(vtx[2]); - - AOutput.append("\n\nPrimary vertex set for projection " + - AMath.PHI + AMath.ETA + ":\n" + - " XVtx = " + String.format("%.5f",vtx[0]) + " cm\n" + - " YVtx = " + String.format("%.5f",vtx[1]) + " cm\n" + - " ZVtx = " + String.format("%.5f",vtx[2]) + " cm\n", ALogInterface.NORMAL); - - } // setPrimaryVertex() ------------------------------------------------- - - - - /** - * Finalize event construction: - * - finalize all data objects - * - set primary vertex - * - calculate the number of hits on a track - * - create associations - * - update collections - * @return the event - */ - public AEvent finalizeEvent() - { - - // setting primary vertex must be done before finalizeConstruction() - // happens on datatypes! - setPrimaryVertex(); - - Iterator<AData> iter = data.values().iterator(); - while(iter.hasNext()) - { - AData data = iter.next(); - if(data instanceof AData) - { - try { - ((AData) data).finalizeConstruction(); - } catch ( Exception e ){ - //Get sourceName of the object where the error occured - String ObjName = ((AData)data).getFullName(); - logger.error("Exception while finalizing construction of "+ObjName,e); - AOutput.append("\n\nError while constructing " + ObjName +"\n", ALogInterface.WARNING); - AOutput.append(" - object will not be shown!\n",ALogInterface.WARNING); - iter.remove(); - - } - } - } - - if (!AGlobals.isAtlantisHeadless()) { - AListManager.getInstance().resetAndPreserveInvisible(); - } - - // are there any RVx read in from the event file? if so, cut the tracks - // which form vertices (when drawn as helices) to the reconstructed - // vertices. - ARVxData rvxData = this.getRVxData(); - if(rvxData != null) - { - rvxData.cutTracksToRVx(this); - } - - assocmgr.correct(); - - return this; - - } // AEvent finalizeEvent() --------------------------------------------- - - - /** - * Returns information about datatypes and number of items datatypes in - * the current event - * First item of the result array is the datatype sourceName followed - * by ":<storeGateKey>" if that exists for a datatype and second item is - * integer number (numData). - * The array is alphabetically sorted. - * - * @return String[][] - */ - public String[][] getInfo() - { - AData[] sources = getData(); - Map<String,String> m = new LinkedHashMap<String,String>(); - m.clear(); - for(int i = 0; i < sources.length; i++) - { - String sg = sources[i].getStoreGateKey(); - String a = sources[i].getNameScreenName(); - a += sg != null ? ":" + sg : ""; - m.put(a, String.valueOf(sources[i].getNumData())); - } - - TreeMap<String,String> tm = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER); - tm.clear(); - tm.putAll(m); - - String[][] s = new String[tm.size()][2]; - int i = 0; - for(Iterator<String> iter = tm.keySet().iterator() ; iter.hasNext() ; i++) - { - String key = iter.next(); - s[i][0] = key; - s[i][1] = tm.get(key); - } - - return s; - - } // getInfo() ----------------------------------------------------------- - - - /** - * Returns information about datatypes and number of items datatypes in - * the current event drawn for all event data, and data passing cuts - * First item of the result array is the datatype sourceName followed - * by ":<storeGateKey>" if that exists for a datatype and second/third items are - * integer number (numData, numDraw). - * The array is alphabetically sorted. - * - * @return String[][] - */ - public String[][] getInfoDraw() - { - AData[] sources = getData(); - Map<String,String> m = new LinkedHashMap<String,String>(); - m.clear(); - Map<String,String> mDraw = new LinkedHashMap<String,String>(); - mDraw.clear(); - - for(int i = 0; i < sources.length; i++) - { - String sg = sources[i].getStoreGateKey(); - String a = sources[i].getNameScreenName(); - a += sg != null ? ":" + sg : ""; - m.put(a, String.valueOf(sources[i].getNumData())); - mDraw.put(a, String.valueOf(sources[i].getNumDraw())); - } - - TreeMap<String,String> tm = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER); - tm.clear(); - tm.putAll(m); - TreeMap<String,String> tmDraw = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER); - tmDraw.clear(); - tmDraw.putAll(mDraw); - - - String[][] s = new String[tm.size()][3]; - int i = 0; - for(Iterator<String> iter = tm.keySet().iterator() ; iter.hasNext() ; i++) - { - String key = iter.next(); - - s[i][0] = key; - s[i][1] = tm.get(key); - s[i][2] = tmDraw.get(key); - } - - return s; - - } // getInfoDraw() ----------------------------------------------------------- - - - /** - * Get coordinates of event vertex. - * - * The coordinates are obtained from the parameter store rather than - * from the event itself, since the vertex position can be changed by the - * user through the GUI. - * - * @return (x,y,z) of vertex - */ - public double[] getPrimaryVertex() - { - return AParameterUtilities.getPrimaryVertex(); - } - - public AAssociationManager getAssociationManager() { - return assocmgr; - } - - -} // class AEvent ------------------------------------------------------------ diff --git a/graphics/AtlantisJava/src/atlantis/event/AEventInfo.java b/graphics/AtlantisJava/src/atlantis/event/AEventInfo.java deleted file mode 100644 index 0fe0aca7a014cacdda8674e19ec5c05e707bd00c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AEventInfo.java +++ /dev/null @@ -1,212 +0,0 @@ -package atlantis.event; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Comparator; -import java.util.Date; - -/** - * The AEventInfo class summarizes the information that uniquely identifies a event. - * It also provides an "equals" function allowing to compare if two events are identical. - * @author sboeser - */ -public class AEventInfo { - - // number of the run of the event - private final long runNumber; - // event number in a run - private final long eventNumber; - // Athena time when XML event file was made in JiveXML - private final String dateTime; - // the name of the source this event was coming from (filename, servername, ...) - private final String sourceName; - // the lumiBlock number - private final String lumiBlock; - // Any additional eventProperties that may be important - private final String eventProperties; - // any additional info that is needed - - //the date format to use with the event info - public final static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss"); - - /** - * Fully qualified constructor - * @param run the run number - * @param event the event number - * @param time the date and time of the event - */ - AEventInfo(long event, long run, String time, String source, String lumiBlock, String eventProperties){ - this.runNumber = run; - this.eventNumber = event; - this.dateTime = time != null ? time : "n/a"; - this.sourceName = source != null ? source : "n/a"; - this.lumiBlock = checkString(lumiBlock); - this.eventProperties = checkString(eventProperties); - } - - /** - * Copy constructor - * @param the evenInfo object to copy - */ - AEventInfo(AEventInfo event){ - this(event.getEventNumber(),event.getRunNumber(), - event.getDateTime(),event.getSourceName(), - event.getLumiBlock(),event.getEventProperties()); - } - - /** - * @return the run number - */ - public long getRunNumber() { - return runNumber; - } // getRunNumber() ----------------------------------------------------- - - /** - * @return the event number - */ - public long getEventNumber(){ - return eventNumber; - } // getEventNumber() --------------------------------------------------- - - - /** - * @return the date and time of the event - */ - public String getDateTime() { - return dateTime; - } // getEventNumber() --------------------------------------------------- - - /** - * @return the name of the event source - */ - public String getSourceName() { - return sourceName; - } // getSourceName() ---------------------------------------------------------- - - /** - * @return the lumiBlock - */ - public String getLumiBlock() { - return lumiBlock; - } // getSourceName() ---------------------------------------------------------- - - /** - * @return the eventProperties - */ - public String getEventProperties() { - return eventProperties; - } // getSourceName() ---------------------------------------------------------- - - - - /** - * Performs test to see if there is a valid value for send string - */ - private String checkString(String receivedString){ - String temp; - if(receivedString == null || receivedString.endsWith("-1")){ - temp = "default"; - }else{ - temp = receivedString; - } - return temp; - } - - - - - /** - * Check whether this event is identical to the event described by info - * @param info the event information for the event to compare to - * @return true if identical - */ - // FIXME: Should take Object as argument. Need to consider how to deal with - // subclasses like AEvent. - public boolean equals(AEventInfo info){ - //check if info is valid - if (info == null) return false; - //Only compare run- and event number and time, source may be different - return ((info.getRunNumber() == runNumber)&& - (info.getEventNumber() == eventNumber)); - } - -// Need to override hashCode() to guarantee correct behaviour of equals() -@Override -public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (int) (eventNumber ^ (eventNumber >>> 32)); - result = prime * result + (int) (runNumber ^ (runNumber >>> 32)); - return result; -} - - -/** - * Implementation of Comparable interface - sort events by run- and event number - */ - public static class RunEventNumberComparator implements Comparator { - - /** - * @param o1 , o2 the two eventInfo objects to compare - * @return negative/zero/positive int if o1 is less/equal/larger than o2 - */ - public int compare(Object o1, Object o2) { - - /** - * Cast to an event info object - if this fails, someone has mixed this with - * another class in a collection and we better crash with ClassCastException than catch - */ - AEventInfo info1 = (AEventInfo)o1; - AEventInfo info2 = (AEventInfo)o2; - - //compare by run number first - Long run = info1.getRunNumber(); - if (run.compareTo(info2.getRunNumber()) != 0) - return run.compareTo(info2.getRunNumber()); - - //otherwise return by event number - Long event = info2.getEventNumber(); - return event.compareTo(info2.getEventNumber()); - } - } - - /** - * Implementation of Comparable interface - sort events by date and time - */ - public static class DateTimeComparator implements Comparator { - - /** - * @param o1 , o2 the two eventInfo objects to compare - * @return negative/zero/positive int if o1 is less/equal/larger than o2 - */ - public int compare(Object o1, Object o2) { - - /** - * Cast to an event info object - if this fails, someone has mixed this with - * another class in a collection and we better crash with ClassCastException than catch - */ - AEventInfo info1 = (AEventInfo)o1; - AEventInfo info2 = (AEventInfo)o2; - - //return zero for events that are equal - if (info1.equals(info2)) return 0; - - //Now get date and time objects - Date date1 = null; Date date2=null; - try { - date1 = dateTimeFormat.parse(info1.getDateTime()); - date2 = dateTimeFormat.parse(info2.getDateTime()); - } catch (ParseException pex) { - throw new ClassCastException("Parse exception when comparing dates"); - } - - //If there is not date assoicated with any of these, throw an exception - if ((date1==null)||(date2==null)) - throw new ClassCastException("Could not parse valid date comparing " - +info1.getDateTime()+" to "+info2.getDateTime()); - - //Finally, compare the two dates - return date1.compareTo(date2); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AEventInfoPrinter.java b/graphics/AtlantisJava/src/atlantis/event/AEventInfoPrinter.java deleted file mode 100644 index 174eed015a787e842b4c5269fdee7d4ae4294458..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AEventInfoPrinter.java +++ /dev/null @@ -1,60 +0,0 @@ -package atlantis.event; - -import atlantis.globals.AGlobals; -import atlantis.output.ALogInterface; - -/** - * Print event information for each new event to the log pane - * @author sboeser - */ -public class AEventInfoPrinter implements ANewEventListener { - - private ALogInterface logPane = null; - - /** - * Constructor with the log pane where the information shall be printed - * @param output the output pane to which to write - */ - public AEventInfoPrinter(ALogInterface output){ - logPane = output; - } - - private void printEventInfo(AEvent event, ALogInterface dest) - { - //For Minerva just output name and coded event and run numbers - //Not on canvas title, but teachers may want to see the number to help - //with recognising difficult events - if(AGlobals.instance().getSimpleOutput()>0) - { - String r = "\n" + event.getSourceName() + - " (" + event.getRunNumber() + "00"+ event.getEventNumber() + ")\n"; - dest.append(r + "\n", ALogInterface.NORMAL); - return; - } - - int lineLen = 39; - String r = "\n" + event.getSourceName() + "\n" + - "run number: " + event.getRunNumber() + - " event number: " + event.getEventNumber() + "\n" + - "--------------------------------------\n"; - - String[][] s = event.getInfo(); - - for(int i = 0; i < s.length; i++) - { - r += String.format("%-"+lineLen+"s", s[i][0]) + ": " + s[i][1] + "\n"; - } - dest.append(r + "\n", ALogInterface.NORMAL); - - } // printEventInfo() ---------------------------------------------------*/ - - /** - * For each new event print log information to the log pane - * @param event the change event - */ - public void newEvent(AEvent event) { - //simply print it - printEventInfo(event,logPane); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AEventManager.java b/graphics/AtlantisJava/src/atlantis/event/AEventManager.java deleted file mode 100755 index ba5b27b035be0b364b1e0e7fcc5218d3e892afb1..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AEventManager.java +++ /dev/null @@ -1,319 +0,0 @@ -package atlantis.event; - -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; -import atlantis.event.AEventSource.NavigationMode; -import atlantis.event.oncrpc.AONCRPCEventSource; -import atlantis.event.xmlrpc.AXMLRPCEventSource; -import java.util.Vector; - -import atlantis.utils.ALogger; - -/** - * All new physics events come into Atlantis via the AEventManager - * The AEventManager may hold a list of event, has the index of the - * current event int the list and informs its listeners about new events. - * Only one event can be active at one time. - * - * @author sboeser - */ -public class AEventManager -{ - private final static ALogger logger = ALogger.getLogger(AEventManager.class); - private static AEventManager instance; - - /** Private constructor for singleton. */ - private AEventManager() {} - - /** Get the singleton instance. */ - public synchronized static AEventManager instance() { - if (instance==null) instance = new AEventManager(); - return instance; - } - - //The current event source - private AEventSource eventSource = null; - - //The current event - i.e. the last delivered by any event source - private AEvent currentEvent = null; - - //A list of listeners for new events - private Vector<ANewEventListener> NewEventListeners = new Vector<ANewEventListener>(); - - //A list of listeners for new events sources - private Vector<ANewEventSourceListener> NewEventSourceListeners = new Vector<ANewEventSourceListener>(); - - /** - * Return the currently active event - * @return AEvent - */ - public synchronized AEvent getCurrentEvent() - { - //simply return the current event - return currentEvent; - } - - - /** - * Set the event with the given index as the current event - * @param index the index of the new event - */ - private synchronized void setCurrentEvent(AEvent event) - { - //Now simply set the current event - currentEvent = event; - //Inform all listeners - fireNewEvent(getCurrentEvent()); - } - - - /** - * @return the current active event source - */ - public synchronized AEventSource getEventSource(){ - return eventSource; - } - - /** - * Set a new already constructed event source. Note that this constructor - * does not throw InvalidEventSource exception as the AEventSource object - * is already constructed. - * @param source the AEventSource object - */ - public synchronized void setEventSource( AEventSource source ) - { - //Simply set the source and we are done - eventSource = source; - fireNewEventSource(getEventSource()); - } - - - /** - * Set the source given by name as new event source. If the event source is - * not valid (e.g invalid file name) we rely on the constructor to fail, throwing - * an InvalidEventSourceException. Thus, the old source is retained if the new one - * can not be created. - * @param sourceName the name of the source (e.g. file name, url, server name,...) - * @throws InvalidEventSourceException - */ - public synchronized void setEventSource(String sourceName) throws InvalidEventSourceException - { - //Make a nice string out of it - String theSourceName = sourceName.toLowerCase().trim(); - - // XMLRPC Server source given as "xmlrpc://server:port" - if(theSourceName.startsWith("xmlrpc://")) { - eventSource = new AXMLRPCEventSource(sourceName); - // ONCRPC Server source given as "oncrpc://server[:port]" - } else if(theSourceName.startsWith("oncrpc://")) { - eventSource = new AONCRPCEventSource(sourceName); - // Metwork sources possibilities - // .xml, .zip or web directory containing event files - } else if(theSourceName.startsWith("http://")) { - // normal xml file - if(theSourceName.endsWith(".xml")){ - eventSource = new AURLEventSource(sourceName); - // zip file on the web - } else if(theSourceName.endsWith(".zip")) { - eventSource = new AZipEventSource(sourceName); - //Anything else should be a web directory - } else { - eventSource = new AURLEventSource(sourceName); - } - - // local disk access possibilities (.xml, .zip, .gz, .gzip) - // event source starts with file:// - } else if(theSourceName.startsWith("file://")) { - // normal xml file - if (theSourceName.endsWith(".xml")) { - eventSource = new AFileEventSource(sourceName); - // normal zip file - } else if (theSourceName.endsWith(".zip")) { - eventSource = new AZipEventSource(sourceName); - // compressed single xml file - } else if (theSourceName.endsWith(".gz") || theSourceName.endsWith(".gzip")) { - eventSource = new AFileEventSource(sourceName); - } else { - String msg = "Could not identify event source: "+sourceName; - logger.error(msg); - throw new InvalidEventSourceException(msg); - } - } else { - String msg = "Could not identify event source: "+sourceName; - logger.error(msg); - throw new InvalidEventSourceException(msg); - } - fireNewEventSource(getEventSource()); - } - - /** - * Sets event navigation mode: random, push, loop or sequential. - * Throws InvalidEventSourceException if there is no source - * or if it doesn't support the requested mode. - * @throws InvalidEventSourceException - */ - public synchronized void setNavigationMode(NavigationMode mode) throws InvalidEventSourceException - { - if(eventSource == null) throw new InvalidEventSourceException("Current event source is NULL"); - - NavigationMode oldMode = eventSource.getNavigationMode(); - - // check if we're really setting a new mode, or if - // the user just clicked on the same button twice - if(oldMode != mode) { - if(eventSource.supportsNavigationMode(mode)) { - eventSource.setNavigationMode(mode); - fireNewEventSource(getEventSource()); - // go to the next event - try { - nextEvent(); - } catch (NoMoreEventsException nme) { - String msg = "No more events from current source"; - logger.error(msg); - } catch (ReadEventException re) { - String msg = "Error while reading the event"; - logger.error(msg); - } - } else throw new InvalidEventSourceException("Current event source does not support the selected display mode"); - } - } - - /** - * Gets the current event navigation mode. - * @return event navigation mode - */ - public synchronized NavigationMode getNavigationMode() throws InvalidEventSourceException - { - if(eventSource == null) throw new InvalidEventSourceException("Current event source is NULL"); - return eventSource.getNavigationMode(); - } - - /** - * Check if the current source supports a specific event navigation mode. - * @param mode the requested event navigation mode - * @return true if the event navigation mode is supported - */ - public boolean supportseventNavigationMode(NavigationMode mode) throws InvalidEventSourceException - { - if(eventSource == null) throw new InvalidEventSourceException("Current event source is NULL"); - return eventSource.supportsNavigationMode(mode); - } - - /** - * Read the next event from the current event source. - * Throws NoMoreEvents if there is none. - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - public void nextEvent() throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException - { - - // Check for valid event source. - if (eventSource==null) - throw new InvalidEventSourceException("Current event source is NULL"); - - // Simply read next event from it. - AEvent event = eventSource.nextEvent(); - setCurrentEvent(event); - - } - - - /** - * Read previous event from current event source. - * Throws NoMoreEvents if there is none. - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - public void previousEvent() throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException - { - - // Check for valid event source. - if (eventSource==null) - throw new InvalidEventSourceException("Current event source is NULL"); - - // Simply read previous event from it. - setCurrentEvent(eventSource.previousEvent()); - - } - - /** - * Add a new listener for newEvent incidents - * @param listener to be added to list - */ - public void addNewEventListener(ANewEventListener listener) - { - //Add this listener - NewEventListeners.addElement(listener); - //If there are already some events - if (getCurrentEvent() == null) return; - //Make the new listener aware of the current event - listener.newEvent(getCurrentEvent()); - } - - /** - * Remove a listener from the list. - * @param listener to be removed from list - */ - public void removeNewEventListener(ANewEventListener listener) - { - //Remove this listener - NewEventListeners.removeElement(listener); - } - - /** - * Call stateChanges of all newEvent listeners - * @param event the new event passed on to all listeners - */ - private synchronized void fireNewEvent(AEvent event) - { - - // Loop over all listeners - for ( ANewEventListener listener : NewEventListeners ) - // give them the new event - listener.newEvent(event); - } - - /** - * Add a new listener for newEventSource incidents - * @param listener to be added to list - */ - public void addNewEventSourceListener(ANewEventSourceListener listener) - { - //Add this listener - NewEventSourceListeners.addElement(listener); - //If there are already some events - if (getEventSource() == null) return; - //Make the new listener aware of the current event - listener.newEventSource(getEventSource()); - } - - /** - * Remove a listener from the list - * @param listener to be removed from list - */ - public void removeNewEventSourceListener(ANewEventSourceListener listener) - { - NewEventSourceListeners.removeElement(listener); - } - - /** - * Call eventSourceChanged of all event source changes listeners - * @param eventSource the new event source - */ - private synchronized void fireNewEventSource(AEventSource eventSource) - { - // Loop over all listeners - for ( ANewEventSourceListener listener : NewEventSourceListeners ) - // give them the new event - listener.newEventSource(eventSource); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AEventSource.java b/graphics/AtlantisJava/src/atlantis/event/AEventSource.java deleted file mode 100755 index 01fef1e727de90d8e2f5c443bb55946e95f5fcbe..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AEventSource.java +++ /dev/null @@ -1,114 +0,0 @@ -package atlantis.event; - -/** - * Basic interface class to be implemented by all event sources - * @author sboeser - */ - -public interface AEventSource -{ - - /*** - * Exception that is thrown if an event can not be read from this source - */ - public class ReadEventException extends AEventSourceException - { - //Default constructor - public ReadEventException() { super(); } - //Constructor with a string - public ReadEventException( String message ){ super( message ); } - //Constructor with a description and cause - public ReadEventException( String message, Throwable cause ){ super( message, cause ); } - } - - /*** - * Exception that is thrown if there are no more events from this source - */ - public class NoMoreEventsException extends AEventSourceException - { - //Default constructor - public NoMoreEventsException() { super(); } - //Constructor with a string - public NoMoreEventsException( String message ){ super( message ); } - //Constructor with a description and cause - public NoMoreEventsException( String message, Throwable cause ){ super( message, cause ); } - } - - /** - * Exception that is thrown if the event source is invalid - */ - public class InvalidEventSourceException extends AEventSourceException - { - //Default constructor - public InvalidEventSourceException() { super(); } - //Constructor with a string - public InvalidEventSourceException( String message ){ super( message ); } - //Constructor with a description and cause - public InvalidEventSourceException( String message, Throwable cause ){ super( message, cause ); } - } - - /** - * Read the next event from the source, throws NoMoreEvents - * if no next event is available - * @return the next event - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - AEvent nextEvent() throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException; - - /** - * Read the previous event from the source, throws NoMoreEvents - * if no previous event is available - * @return the previous event - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - AEvent previousEvent() throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException; - /** - * Get a string uniquly identifying the event source, e.g the URL, the zip - * archive name or the server:port string - * @return a unique name describing the source - */ - String getSourceName(); - - /*** - * Enum that stores the possible event navigation modes - */ - public enum NavigationMode { - SEQUENTIAL, //go through events in their natural order - LOOP, //start from beginning when reaching the end - RANDOM, //take a random event - PUSH //event loop is driven from outside (see AServerXMLRPC) - } - - /** - * Get the event navigation mode for the current source. - * @return current navigation mode - */ - NavigationMode getNavigationMode(); - - /** - * Set the event navigation mode for the current source. - * Throws InvalidEventSourceException if the current - * source does not support the requested mode - * @param mode requested event navigation mode - * @throws InvalidEventSourceException if the mode is not supported - */ - void setNavigationMode(NavigationMode mode) throws InvalidEventSourceException; - - /** - * Checks whether the current event source supports - * a particular display mode. - * @return true if the mode is supported - * @param mode requested event navigation mode - */ - boolean supportsNavigationMode(NavigationMode mode); - -} - diff --git a/graphics/AtlantisJava/src/atlantis/event/AEventSourceException.java b/graphics/AtlantisJava/src/atlantis/event/AEventSourceException.java deleted file mode 100644 index 94061279df36cc27d31dbef8549ab28f43a17d73..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AEventSourceException.java +++ /dev/null @@ -1,65 +0,0 @@ - -package atlantis.event; - -/** - * All exceptions occuring while attempting to read events shall be chaught - * and converted into one of the three generic event source exceptions: - * - * -NoMoreEventsException: there is no next/previous event - * -InvalidEventSourceException: the specified event source is invalid - * -ReadEventException: there was an error reading in the event - * - * All three of them derive from AEventSourceException which provides printing methods. - * - * These three exceptions are then handed up to the GUI level, where they are treated - * differently, depending on the current reading mode (e.g. NoMoreEvents can be ignored - * when waiting for events to appear on a server, web-dir, etc..) - * - * @author sboeser - */ -public class AEventSourceException extends Exception{ - - //Default constructor - public AEventSourceException() { super(); } - //Constructor with a string - public AEventSourceException( String message ){ super( message ); } - //Constructor with a description and cause - public AEventSourceException( String message, Throwable cause ){ super( message, cause ); } - - /** - * Generates a string with the cause of this message and all causing ones - * @return the generated string - */ - public String getCauseMessages(){ - - //Create the string buffer - StringBuffer msg = new StringBuffer(); - - //Add all cause messages starting from this exception - addCauseMessage(this,msg); - - //return string - return msg.toString(); - } - - /** - * Recursively add cause messages to string buffer - * @param t the exception - * @param msg the string buffer - */ - private void addCauseMessage(Throwable t, StringBuffer msg){ - - //Add the name of the exception class - msg.append(t.getClass().getName()); - //Add the description of the exception - msg.append(": "); - msg.append(t.getMessage()); - - //Check if there has been a cause given - if (t.getCause() != null){ - //Add cause messages in next line - msg.append("\n caused by "); - addCauseMessage(t.getCause(),msg); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AFileEventSource.java b/graphics/AtlantisJava/src/atlantis/event/AFileEventSource.java deleted file mode 100644 index 51625ac86d35349bdf4b12e9df1c4785c62a78b6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AFileEventSource.java +++ /dev/null @@ -1,309 +0,0 @@ -package atlantis.event; - -import atlantis.data.AEventFromXML; -import java.io.File; -import java.io.FilenameFilter; -import java.io.InputStream; - -import java.util.Arrays; -import java.util.zip.GZIPInputStream; -import java.util.Random; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; - - -/** - * Read a single event from an XML file in a directory - * @author sboeser - */ -public class AFileEventSource extends ABufferedEventSource -{ - - //The current directory - private File directory = null; - - //A filter for valid files in the current directory - private final XMLFilenameFilter filter = new XMLFilenameFilter(); - - // needed for random mode - private Random randomGenerator = new Random(); - - /** - * Constructor with file name given - * @param sourceName - * @throws AEventSource.InvalidEventSourceException - */ - public AFileEventSource(String sourceName) throws AEventSource.InvalidEventSourceException - { - // check if it's a well-formed event path - if(sourceName.startsWith("file://")) { - // strip file:// from the sourceName - sourceName = sourceName.substring(7); - //Check if the current file name is valid - directory = new File(sourceName); - - //Check that we can read that file or directory - if (!directory.canRead()) - throw new InvalidEventSourceException("Can not read from "+sourceName); - } else throw new InvalidEventSourceException(sourceName+" is not in the form file://path"); - } - - /** - * @return the full name of the file or directory - */ - public String getSourceName() { - return directory.getAbsolutePath(); - } - - /** - * @param mode event navigation mode - * @return true if the requested mode is supported by this source - */ - public boolean supportsNavigationMode(NavigationMode mode) { - if(mode == NavigationMode.SEQUENTIAL || - mode == NavigationMode.RANDOM || - mode == NavigationMode.LOOP) - return true; - return false; - } - - /** - * Read an event from the current file and directory - * @return the event - * @throws ReadEventException - * @throws InvalidEventSourceException - */ - protected AEvent readEventFromFile(File file) throws ReadEventException, - InvalidEventSourceException - { - //Reassemble full file name - String FullFileName = file.getAbsolutePath(); - - try{ - - //Use full path and name to specify the file - InputStream is = new FileInputStream(FullFileName); - - //Check if this might be a gzip stream - if ((file.getName().toLowerCase().endsWith(".gz"))|| - (file.getName().toLowerCase().endsWith(".gzip"))){ - - //Run through GZIPInput for decoding - is = new GZIPInputStream(is); - } - //Read file from stream - return AEventFromXML.read(is, file.getName()); - - } catch( OutOfMemoryError oom ) { - - //Check if we can clear the event container - if( getNumberOfEvents() > 0) clearEventContainer(); - - //Run garbage collector - System.gc(); - - //Retry reading the event - return readEventFromFile(file); - - } catch(FileNotFoundException fnfe){ - //rethrow - throw new InvalidEventSourceException("File not found: "+FullFileName,fnfe); - } catch(IOException ioe){ - //rethrow - throw new ReadEventException("I/O error readding file: "+FullFileName,ioe); - } - } - - /** - *Get a sorted list of files in the directory of the current file - */ - private String[] getListOfFiles(){ - - //get a list of files in the same directory using the filter - String[] FileList = directory.list(filter); - - //Sort the list - Arrays.sort(FileList); - - return FileList; - - } - - protected AEvent readRandom() throws ReadEventException, InvalidEventSourceException { - - //The file we want to pass on to the reading routine - File file = null; - //On the first encounter "directory" might be a file - if (directory.isFile()){ - //set this as the file we want to read - file = directory.getAbsoluteFile(); - //store its parent directory - directory = file.getParentFile(); - } else { - //Get a list of files - String[] FileList = getListOfFiles(); - //Check there are more files - if (FileList.length == 0) - throw new InvalidEventSourceException("No valid files in directory " - +directory.getAbsolutePath()); - //Loop over file list - int iName = randomGenerator.nextInt(FileList.length); - - //Now get the new file - file = new File(directory,FileList[iName]); - } - - //Should now have a file in any case, try to read from it - return readEventFromFile(file); - - } - - - /** - * Read the next event from the next XML file in the same directory - * @return the next event - * @throws NoMoreEventsException - * @throws ReadEventException - * @throws InvalidEventSourceException - */ - public AEvent readNext(AEventInfo currentEvent) throws NoMoreEventsException, - ReadEventException, - InvalidEventSourceException - { - // if random mode is set, return a random event - if(getNavigationMode() == NavigationMode.RANDOM) return readRandom(); - - //The file we want to pass on to the reading routine - File file = null; - //On the first encounter "directory" might be a file - if (directory.isFile()){ - //set this as the file we want to read - file = directory.getAbsoluteFile(); - //store its parent directory - directory = file.getParentFile(); - } else { - //Get a list of files - String[] FileList = getListOfFiles(); - //Check there are more files - if (FileList.length == 0) - throw new NoMoreEventsException("No valid files in directory " - +directory.getAbsolutePath()); - //Loop over file list - int iName = 0; - //search for next entry that is lexicographically larger - //taking first one if there is no current event to compare to - while ((currentEvent != null ) && - (currentEvent.getSourceName().compareTo(FileList[iName]) >= 0)){ - //Go to next file - ++iName; - // if we have reached the end of the list - if (iName == FileList.length) { - // if in loop mode, go back to the first file - if(getNavigationMode() == NavigationMode.LOOP) { - iName = 0; - break; - } - // if not in loop mode, abort - else throw new NoMoreEventsException("No more files after" - + currentEvent.getSourceName() + " in directory "+directory.getAbsolutePath()); - } - } - - //Now get the new file - file = new File(directory,FileList[iName]); - } - - //Should now have a file in any case, try to read from it - return readEventFromFile(file); - - } - - /** - * Read the next event from the previous XML file in the same directory - * @return the previous event - * @throws NoMoreEventsException - * @throws ReadEventException - * @throws InvalidEventSourceException - */ - public AEvent readPrevious(AEventInfo currentEvent) throws NoMoreEventsException, - ReadEventException, - InvalidEventSourceException - { - // in random mode there's no looking back - if(getNavigationMode() == NavigationMode.RANDOM) throw new NoMoreEventsException("No more random events left in the buffer"); - //The file we want to pass on to the reading routine - File file = null; - //On the first encounter "directory" might be a file - if (directory.isFile()){ - //set this as the file we want to read - file = directory.getAbsoluteFile(); - //store its parent directory - directory = file.getParentFile(); - } else { - //Get a list fo files - String[] FileList = getListOfFiles(); - //Check there are more files - if (FileList.length == 0) - throw new NoMoreEventsException("No valid files in directory " - +directory.getAbsolutePath()); - //Loop over file list - int iName = FileList.length-1; - //search for next entry that is lexicographically smaller - //taking last one if there is no current one to compare to - while ((currentEvent != null) && - (currentEvent.getSourceName().compareTo(FileList[iName]) <= 0)){ - //Go to next file - --iName; - // if we have reached the end of the list - if (iName < 0) { - // if in loop mode, go to the last event - if(getNavigationMode() == NavigationMode.LOOP) { - iName = FileList.length - 1; - break; - } - // if not in loop mode, abort - else throw new NoMoreEventsException("No more files before" - + currentEvent.getSourceName() + " in directory "+directory.getName()); - } - } - - //Now get the new file - file = new File(directory,FileList[iName]); - } - - //Should now have a file in any case, try to read from it - return readEventFromFile(file); - } -} -/** - * Filter helper class only accepting file names ending in .xml, .gz or .gzip - * @author sboeser - */ -class XMLFilenameFilter implements FilenameFilter -{ - - // accept all readable .xml .gz and .gzip files, no directories - public boolean accept(File dir, String name) - { - //First check the name - if ( ! name.toLowerCase().endsWith(".xml")) - if ( ! name.toLowerCase().endsWith(".gzip")) - if ( ! name.toLowerCase().endsWith(".gz")) - //invalid ending - return false; - - //Check file properties - File f = new File(dir, name); - - //Reject directories - if(! f.isFile()) return false; - //Reject unreadable files - if(! f.canRead()) return false; - - //Finally accept - return true; - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AFilter.java b/graphics/AtlantisJava/src/atlantis/event/AFilter.java deleted file mode 100755 index e6293cba5dfca344c4bcb303e6de1d927e9198bf..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AFilter.java +++ /dev/null @@ -1,275 +0,0 @@ -package atlantis.event; - - -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.APar; -import atlantis.data.AS3DData; - - -/** - * Filter of S3D hits ask Hans Drevermann - */ - -public class AFilter { - - final static int FILTER_GROUP=76; - - static int[] h=null; - static int[] eta=null; - static int[] phi=null; - static int[] layer=null; - static int[] group=null; - static int[] skewGroup=null; - static int[] groupMapping=null; - - static int[] bin=null; - static int[] ll=null; - static int[] hitLayers=null; - static int[] id=null; - static boolean[] good=null; - static int numEtaBins=0; - - private static APar parameterStore = APar.instance(); - - final static int[] layerAsBits=new int[32]; - static { - layerAsBits[0]=1; - for(int i=1; i<32; i++) - layerAsBits[i]=2*layerAsBits[i-1]; - } - - - public static void filter(AS3DData aS3DData) { - if(aS3DData==null) { - AOutput.append("AS3DData not found can't filter\n", ALogInterface.BAD_COMMAND); - return; - } - - int numUsefulPhiBins=parameterStore.get("Fil", "NumPhi").getI(); - int numUsefulEtaBins=parameterStore.get("Fil", "NumEta").getI(); - // +2 for wrap around and edge effect - int numPhiBins=numUsefulPhiBins+2; - - // +2 for edge effects - numEtaBins=numUsefulEtaBins+2; - - double etaRange=parameterStore.get("Fil", "EtaRange").getD(); - int requiredHitsInBin=parameterStore.get("Fil", "NumHits").getI(); - int numSkewSteps=parameterStore.get("Fil", "NumSkew").getI(); - double skewStepSize=parameterStore.get("Fil", "SkewStep").getD(); - - int numHits=aS3DData.makeFilterDrawList(etaRange); - int maxBins=numHits+1; - - if(h==null||h.length<numPhiBins*numEtaBins) h=new int[numPhiBins*numEtaBins]; - if(layer==null||layer.length<numHits) layer=new int[numHits]; - if(eta==null||eta.length<numHits) eta=new int[numHits]; - if(phi==null||phi.length<numHits) phi=new int[numHits]; - if(group==null||group.length<numHits) group=new int[numHits]; - if(skewGroup==null||skewGroup.length<numHits) skewGroup=new int[numHits]; - if(groupMapping==null||groupMapping.length<numHits) groupMapping=new int[numHits]; - // - if(bin==null||bin.length<maxBins) bin=new int[maxBins]; - if(hitLayers==null||hitLayers.length<maxBins) hitLayers=new int[maxBins]; - if(id==null||id.length<maxBins) id=new int[maxBins]; - if(ll==null||ll.length<maxBins) ll=new int[maxBins]; - if(good==null||good.length<maxBins) good=new boolean[maxBins]; - - layer=aS3DData.getLayer(layer); - eta=aS3DData.getIntegerEta(numUsefulEtaBins, etaRange, eta); - - // initialise - for(int i=0; i<numHits; ++i) - group[i]=0; - - if(!parameterStore.get("Fil", "Loop").getStatus()) numSkewSteps=0; - - int numGroups=0; - - for(int step=-numSkewSteps; step<=numSkewSteps; step++) { - double skew=0.; - - // TODO: Check if 166.666 should be the curvature parameter from the parameter store - if(numSkewSteps!=0) - skew=(1./skewStepSize)*step/(numSkewSteps*2*166.666); - - for(int i=0; i<maxBins; ++i) { - hitLayers[i]=0; - good[i]=false; - } - - phi=aS3DData.getIntegerPhi(numUsefulPhiBins, skew, phi); - - int numBins=1; - - for(int i=0; i<numHits; ++i) { - int b=phi[i]*numEtaBins+eta[i]; - - if(h[b]==0) { - h[b]=numBins; - bin[numBins]=b; - numBins++; - } - hitLayers[h[b]]|=layerAsBits[layer[i]]; - } - - // must treat the phi wraparound here...... - - for(int e=0; e<numEtaBins; e++) { - h[(0)*numEtaBins+e]=h[(numUsefulPhiBins)*numEtaBins+e]; - h[(numUsefulPhiBins+1)*numEtaBins+e]=h[(1)*numEtaBins+e]; - } - - int ngood=0; - - for(int i=1; i<numBins; i++) { - int b=bin[i]; - int hitLayersSummed=0; - - // add hits from 3x3 region around this bin - for(int p=b-numEtaBins; p<b+2*numEtaBins; p+=numEtaBins) - for(int e=p-1; e<p+2; ++e) { - int ibin=h[e]; - - if(ibin>0) - hitLayersSummed|=hitLayers[ibin]; - } - if(countBits(hitLayersSummed)>=requiredHitsInBin) { - good[i]=true; - ll[ngood++]=i; - } - } - - for(int i=0; i<ngood; ++i) - id[ll[i]]=0; - - int firstGroup=numGroups+1; - - for(int i=0; i<ngood; ++i) - if(id[ll[i]]==0) - add(ll[i], ++numGroups); - - for(int j=firstGroup; j<=numGroups; ++j) { - int hls=0; - - for(int i=0; i<ngood; i++) - if(id[ll[i]]==j) { - hls|=hitLayers[ll[i]]; - } - if(countBits(hls)<requiredHitsInBin) - for(int i=0; i<ngood; i++) - if(id[ll[i]]==j) - good[ll[i]]=false; - } - - for(int i=0; i<numHits; ++i) { - int b=h[phi[i]*numEtaBins+eta[i]]; - - if(good[b]) - skewGroup[i]=id[b]; - else - skewGroup[i]=0; - } - - // now zero the histogram for next call - for(int i=1; i<numBins; i++) - h[bin[i]]=0; - // wrap around - for(int e=0; e<numEtaBins; e++) { - h[(0)*numEtaBins+e]=0; - h[(numPhiBins-1)*numEtaBins+e]=0; - } - - group=mergeGroups(numHits, numGroups, group, skewGroup); - - } - - group=renumberGroups(numHits, group); - - int num=0; - - for(int i=0; i<numHits; ++i) - if(group[i]>0) num++; - - AOutput.alwaysAppend("\nFiltering:\n Input hits = "+numHits+"\n Num grouped = "+num+"\n",ALogInterface.NORMAL_BOLD); - - aS3DData.setGroup(group); - } - - public static void add(int i, int numGroup) { - id[i]=numGroup; - int b=bin[i]; - - // add hits from 3x3 region around this bin - for(int p=b-numEtaBins; p<b+2*numEtaBins; p+=numEtaBins) - for(int e=p-1; e<p+2; ++e) { - int ibin=h[e]; - - if(good[ibin]&&id[ibin]==0) - add(ibin, numGroup); - } - } - - public static int[] mergeGroups(int numHits, int numGroups, int[] group, int[] skewgroup) { - - for(int i=1; i<=numGroups; ++i) - groupMapping[i]=i; - - for(int i=0; i<numHits; ++i) - if(skewGroup[i]>0&&group[i]>0) { - int g1=groupMapping[group[i]]; - int g2=groupMapping[skewGroup[i]]; - - if(g1!=g2) - for(int g=1; g<=numGroups; ++g) - if(groupMapping[g]==g1||groupMapping[g]==g2) groupMapping[g]=g1; - } - - for(int i=0; i<numHits; ++i) - if(skewGroup[i]>0||group[i]>0) { - int g=skewGroup[i]; - - if(g==0) - g=group[i]; - group[i]=groupMapping[g]; - } - return group; - } - - public static int[] renumberGroups(int numHits, int[] group) { - int numGroups=0; - - for(int i=0; i<numHits; ++i) - if(group[i]>0) { - int g=group[i]; - - numGroups++; - for(int j=i; j<numHits; ++j) - if(group[j]==g) - group[j]=-numGroups; - } - for(int i=0; i<numHits; ++i) - group[i]=-group[i]; - return group; - } - - // Return the number of bits currently set. This is done via a lookup table - - final static int[] countLUT= {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, - 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, - 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, - 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, - 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, - 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, - 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, - 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, - 7, 5, 6, 6, 7, 6, 7, 7, 8}; - - final static int maskByte=255; - - public static int countBits(int bits) { - return countLUT[bits&maskByte]+countLUT[(bits>>>8)&maskByte]+countLUT[(bits>>>16)&maskByte]; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AImageProducer.java b/graphics/AtlantisJava/src/atlantis/event/AImageProducer.java deleted file mode 100644 index 74615cbd896c7140eac9b0e336dd6e199f8f9348..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AImageProducer.java +++ /dev/null @@ -1,129 +0,0 @@ -package atlantis.event; - -import atlantis.utils.*; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import atlantis.Atlantis; -import atlantis.canvas.ACanvas; -import atlantis.graphics.encoders.AImageEncoder; -import java.awt.Dimension; - - -/** - * Implements ANewEventListener and creates image files - * upon each newEvent call. A scale factor allows to e.g. produce thumbnails by - * scaling down image. The image producer works in two modes: - * a) If no file name is given, a file name will be generated from run and event - * number. In case the output file exists, no file is created but a warning is written out. - * b) If a file name is given, a temporary file is generated first, and then - * renamed to the given file name. If renaming fails, a warning is written out - * and the temporary file is deleted. - * - * @author Sebastian Boeser - */ - -public abstract class AImageProducer implements ANewEventListener -{ - /** File name prefix */ - protected static final String filePrefix = "atlantis"; - /** Minimum number of digits for event- and run-number when writing files */ - protected static final int encodeNumberDigits = 6; - - /** directory to store files in */ - protected final File directory ; - /** Default image dimensions */ - protected final Dimension imageSize; - /** The thumbnail scale */ - protected final double scaleFactor; - /** A fixed filename if given on the command line */ - protected final String fixedFileName; - - /** - * Inner exception class - */ - public static class InstantiationException extends Exception { - //only declare constructor - InstantiationException(String what){ - super(what); - } - }; - - /** - * Fully qualified constructor, - * intializing all the attributes and check the parameters validity - * @param dir the directory in which to save all the files - * @param size the dimensions of the images - * @param scale the factor by which to scale the images - * @param fileName if not null, that file will be overwritten for each event - * @throws InstantiationException if we fail to create the object - */ - protected AImageProducer(String dir, Dimension size, double scale, String fileName) throws InstantiationException - { - // First check the directory parameter - directory = new File(dir); - - //That it exists - if(! directory.exists()) throw new InstantiationException("Directory "+dir+" doesn't exist"); - - //That it is a directory - if(! directory.isDirectory()) throw new InstantiationException(dir + " is not a directory"); - - //And that we can write in it - if(! directory.canWrite()) throw new InstantiationException("Cannot write to directory "+dir); - - //Check frequency and history length arguments - if (scale <= 0) throw new InstantiationException("Negative or zero scale factor"); - - // store all parameters - imageSize = size; - scaleFactor = scale; - fixedFileName = fileName; - - } - - - /** - * Return the string build from this events file name - * @param evt the event info from which to build the filename - * @param minDigit minimum number of digits for run- and event-number - * @return the file name - */ - protected String getEventFileName(AEventInfo evt){ - String nameFormat = String.format("%%s_%%0%dd_%%0%dd",encodeNumberDigits,encodeNumberDigits); - return String.format(nameFormat, - filePrefix,evt.getRunNumber(),evt.getEventNumber()); - } - - - /** - * Safes a byteArray of data into a file given by a fileName - * @param data the data - * @param file the file to write into - * @throws Exception in case of saving fails - */ - protected void saveDataIntoFile(byte[] data, File file) throws IOException - { - - //Sanity check - if ((data == null) ||(file == null)) return; - - //Open output stream and write to output stream - FileOutputStream fos = new FileOutputStream(file); - OutputStream os = new BufferedOutputStream(fos); - os.write(data); - os.flush(); - os.close(); - - } - - /** - * Called whenever a new event appears. Store an image in the directory, - * either with a generated file name (no overwrite) or with a fixed file name (overwrite) - * @param event the event from which to generate the image - */ - public abstract void newEvent(AEvent event); -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/event/ANewEventListener.java b/graphics/AtlantisJava/src/atlantis/event/ANewEventListener.java deleted file mode 100644 index 7657cbe48392accd572107947a1c5cf18ba85308..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/ANewEventListener.java +++ /dev/null @@ -1,18 +0,0 @@ - -package atlantis.event; - -/** - * Interface for all NewEventListener classes. Each time a new event is - * brought to the event manager, the NewEvent:isteners newEvent method is - * called with the new event as an argument - * @author sboeser - */ -public interface ANewEventListener { - - /** - * This method gets called each time a new new is available. - * @param event the new event - */ - abstract public void newEvent(AEvent event); - -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/event/ANewEventSourceListener.java b/graphics/AtlantisJava/src/atlantis/event/ANewEventSourceListener.java deleted file mode 100644 index 6101f3a4f1b900bf3a1ff25760fdc5fb6931a55f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/ANewEventSourceListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package atlantis.event; - -/** - * Interface for all NewEventSourceListener classes. Each time the event source - * is changed, the newEventSourcemethod is called. - * @author maillard - */ -public interface ANewEventSourceListener { - - /** - * This method gets called each time the layout is changed. - * @param eventSource the new event source - */ - abstract public void newEventSource(AEventSource eventSource); - -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AObjectsAssociation.java b/graphics/AtlantisJava/src/atlantis/event/AObjectsAssociation.java deleted file mode 100644 index 6f4b148b43689dd6e9976a2441e68b1b378e3e41..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AObjectsAssociation.java +++ /dev/null @@ -1,26 +0,0 @@ -package atlantis.event; - -/** - * @author Qiang Lu - * - */ -public class AObjectsAssociation extends AAssociation -{ - private String[] key; - - public AObjectsAssociation(String a, String b, String[] associatedKey, - int[] associatedIndex, int[] associatedLinkCount, AEvent e) - { - super(a, b, associatedLinkCount, associatedIndex,e); - this.key = new String[associatedKey.length]; - for (int i=0; i<associatedKey.length; i++) - { - this.key[i] = associatedKey[i]; - } - } - - public String[] getKey() - { - return key; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/APngImageProducer.java b/graphics/AtlantisJava/src/atlantis/event/APngImageProducer.java deleted file mode 100644 index 21cd4d7199bf99186a3a39534ebed8edaa08030e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/APngImageProducer.java +++ /dev/null @@ -1,119 +0,0 @@ -package atlantis.event; - -import atlantis.utils.*; -import java.io.File; -import java.io.IOException; - -import atlantis.canvas.ACanvas; -import atlantis.graphics.encoders.AImageEncoder; -import java.awt.Dimension; - - -/** - * Implements ANewEventListener and creates PNG files - * upon each newEvent call. A scale factor allows to e.g. produce thumbnails by - * scaling down image. The image producer works in two modes: - * a) If no file name is given, a file name will be generated from run and event - * number. In case the PNG file exists, no file is created but a warning is written out. - * b) If a file name is given, a temporary file is generated first, and then - * renamed to the given file name. If renaming fails, a warning is written out - * and the temporary file is deleted. - * - * @author Sebastian Boeser - */ - -public class APngImageProducer extends AImageProducer -{ - // the logger - private static final ALogger logger = ALogger.getLogger(APngImageProducer.class); - - // Our image encode - private final AImageEncoder imageEncoder = new AImageEncoder(); - - /** - * Fully qualified constructor, - * intializing all the attributes and check the parameters validity - * @param dir the directory in which to save all the files - * @param size the dimensions of the images - * @param scale the factor by which to scale the images - * @param fileName if not null, that file will be overwritten for each event - * @throws InstantiationException if we fail to create the object - */ - public APngImageProducer(String dir, Dimension size, double scale, String fileName) throws InstantiationException - { - super(dir, size, scale, fileName); - } - - /** - * Called whenever a new event appears. Store a PNG in the directory, - * either with a generated file name (no overwrite) or with a fixed file name (overwrite) - * @param event the event from which to generate the PNG - */ - public void newEvent(AEvent event) - { - - //If auto had been set for size (height is negative), get height from Canvas - if (imageSize.height < 0) imageSize.setSize(imageSize.width, ACanvas.getCanvas().getRespectiveHeight(imageSize.width)); - - //Create the file to write the data into - File pngFile; - //If we don't have a fixed file name, - //generate a unique one based on run- and event number - if (fixedFileName==null){ - - //Now construct all the full path for the file we want to save - String pngName = String.format("%s%s%s.png",directory, - System.getProperty("file.separator"), - getEventFileName(event)); - - // Create file handles to the file and check if it exists - pngFile = new File(pngName); - //Do not overwrite any existing files - if (pngFile.exists()) { - logger.warn("File "+ pngName +" already exists - will not overwrite"); - return; - } - //otherwise generate a temporary file first, - //then move it in place later - } else { - //make a temporary file in the final directory - try { - pngFile = File.createTempFile(filePrefix+"_", ".png",directory); - } catch (IOException ex) { - logger.warn("Failed to create temporary file in "+directory.getAbsolutePath()); - return; - } - } - - //Now create the image. If the scaleFactor equals 1, no scaling will happen. - byte[] pngData = imageEncoder.getScaledPNGData(imageSize.width,imageSize.height,scaleFactor); - - //Now try saving the acquired data, - //and if it shall go to a fixed file, move it there - try { - //Save the PNG - saveDataIntoFile(pngData, pngFile); - //move to fixed file name if requested - if (fixedFileName != null){ - - //Get a handle to the final destination - File fixedFile = new File(directory,fixedFileName); - - //delete target if exits - if (fixedFile.exists() && (!fixedFile.delete())) - throw new IOException("Failed to delete existing file "+fixedFile.getAbsolutePath()); - - //And move the new file in place - if (!pngFile.renameTo(fixedFile)) - throw new IOException("Failed to rename temporary file to "+fixedFile.getAbsolutePath()); - } - } catch (IOException ioe) { - //If we fail, throw a warning - logger.warn("Could not save PNG files for history\n"+ioe.toString()); - } finally { - //In any case, delete the pngFile, if it was just temporary - if (fixedFileName != null) pngFile.delete(); - } - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AStreamedEventSource.java b/graphics/AtlantisJava/src/atlantis/event/AStreamedEventSource.java deleted file mode 100644 index b41e007072f92bc62610ea8c9d065ba3dd61647d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AStreamedEventSource.java +++ /dev/null @@ -1,52 +0,0 @@ -package atlantis.event; - -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import java.util.Vector; - -/** - * This interface shall be implemented by all event sources that support event - * streams. Only provides simple get and set methods. - * @author sboeser - */ -public interface AStreamedEventSource extends AEventSource { - - /** - * Exception that is thrown if the stream is invalid - */ - public class InvalidStreamException extends AEventSourceException - { - //Default constructor - public InvalidStreamException() { super(); } - //Constructor with a string - public InvalidStreamException( String message ){ super( message ); } - //Constructor with a description and cause - public InvalidStreamException( String message, Throwable cause ){ super( message, cause ); } - } - - /** - * Get an array of names of all available streams - * @return the array of stream names - * @throws InvalidEventSourceException if the list of streams can not be obtained - */ - Vector<String> getAvailableStreams() throws InvalidEventSourceException; - - /** - * Set the stream from which to provide events - * @param streamName the stream from which to get events - * @throws InvalidStreamException if the given name does not specify a valid stream - * @throws InvalidEventSourceException if the server cannot be contacted to get the stream names - */ - void setStream(String streamName) throws InvalidStreamException, - InvalidEventSourceException; - - /** - * Get the currently selected stream, or the default stream if none is selected - * @return the name of the currently selected stream - * @throws InvalidEventSourceException if the list of streams can not be obtained - * @throws NoMoreEventsException if no stream is available - * - */ - String getStream() throws InvalidEventSourceException, - NoMoreEventsException; -} diff --git a/graphics/AtlantisJava/src/atlantis/event/ASvgImageProducer.java b/graphics/AtlantisJava/src/atlantis/event/ASvgImageProducer.java deleted file mode 100644 index a27830547d92048bb0df102dd37c8a4c96027c74..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/ASvgImageProducer.java +++ /dev/null @@ -1,117 +0,0 @@ -package atlantis.event; - -import java.io.File; -import java.io.IOException; - -import atlantis.utils.*; -import atlantis.canvas.ACanvas; -import atlantis.graphics.encoders.AImageEncoder; -import java.awt.Dimension; - - -/** - * Implements ANewEventListener and creates SVG files - * upon each newEvent call. A scale factor allows to e.g. produce thumbnails by - * scaling down image. The image producer works in two modes: - * a) If no file name is given, a file name will be generated from run and event - * number. In case the output file exists, no file is created but a warning is written out. - * b) If a file name is given, a temporary file is generated first, and then - * renamed to the given file name. If renaming fails, a warning is written out - * and the temporary file is deleted. - * - * @author Tom McLaughlan - */ - -public class ASvgImageProducer extends AImageProducer -{ - // the logger - private static final ALogger logger = ALogger.getLogger(ASvgImageProducer.class); - - // Our image encode - private final AImageEncoder imageEncoder = new AImageEncoder(); - - /** - * Fully qualified constructor, - * intializing all the attributes and check the parameters validity - * @param dir the directory in which to save all the files - * @param size the dimensions of the images - * @param scale the factor by which to scale the images - * @param fileName if not null, that file will be overwritten for each event - * @throws InstantiationException if we fail to create the object - */ - public ASvgImageProducer(String dir, Dimension size, double scale, String fileName) throws InstantiationException - { - super(dir, size, scale, fileName); - } - - /** - * Called whenever a new event appears. Store an SVG in the directory, - * either with a generated file name (no overwrite) or with a fixed file name (overwrite) - * @param event the event from which to generate the SVG - */ - public void newEvent(AEvent event) - { - - //If auto had been set for size (height is negative), get height from Canvas - if (imageSize.height < 0) imageSize.setSize(imageSize.width, ACanvas.getCanvas().getRespectiveHeight(imageSize.width)); - - //Create the file to write the data into - File outFile; - //If we don't have a fixed file name, - //generate a unique one based on run- and event number - if (fixedFileName==null){ - - //Now construct all the full path for the file we want to save - String outFileName = String.format("%s%s%s.svg",directory, - System.getProperty("file.separator"), - getEventFileName(event)); - - // Create file handles to the file and check if it exists - outFile = new File(outFileName); - //Do not overwrite any existing files - if (outFile.exists()) { - logger.warn("File "+ outFileName +" already exists - will not overwrite"); - return; - } - //otherwise generate a temporary file first, - //then move it in place later - } else { - //make a temporary file in the final directory - try { - outFile = File.createTempFile(filePrefix+"_", ".svg",directory); - } catch (IOException ex) { - logger.warn("Failed to create temporary file in "+directory.getAbsolutePath()); - return; - } - } - - //Now try saving the acquired data, - //and if it shall go to a fixed file, move it there - try { - imageEncoder.saveSVG(imageSize.width, imageSize.height, outFile); - - //move to fixed file name if requested - if (fixedFileName != null){ - - //Get a handle to the final destination - File fixedFile = new File(directory,fixedFileName); - - //delete target if exits - if (fixedFile.exists() && (!fixedFile.delete())) - throw new IOException("Failed to delete existing file "+fixedFile.getAbsolutePath()); - - //And move the new file in place - if (!outFile.renameTo(fixedFile)) - throw new IOException("Failed to rename temporary file to "+fixedFile.getAbsolutePath()); - } - } catch (IOException ioe) { - //If we fail, throw a warning - logger.warn("Could not save SVG files for history\n"+ioe.toString()); - } finally { - //In any case, delete the pngFile, if it was just temporary - if (fixedFileName != null) outFile.delete(); - } - - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/AURLEventSource.java b/graphics/AtlantisJava/src/atlantis/event/AURLEventSource.java deleted file mode 100644 index 530a3793cd81c0b9e3d728bf2ca2cf64a555e7d3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AURLEventSource.java +++ /dev/null @@ -1,385 +0,0 @@ -package atlantis.event; - -import atlantis.data.AEventFromXML; - -import java.util.ArrayList; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.FileNotFoundException; -import java.net.URL; -import java.net.MalformedURLException; - -import java.util.regex.Pattern; -import java.util.regex.Matcher; -import java.util.Random; - -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.utils.ALogger; - -import java.util.Collections; - - -/** - * This class obtains an event from an XML file which is read from - * URL address (from a remote source). - * - * Once the file is read the classes tries to create an internal - * list of XML event files from this remote source which is utilised - * when the user accesses next, resp. previous event from this address. - * - * It is dependent on the fact that the web server supports directory - * listings - i.e. it returns an HTML page which this class parses - * and gets all files conforming ".*\.xml" regular expression. - * - * It is possible to specify only URL with a directory where the event - * files are. - * - * @author sboeser - */ -public class AURLEventSource extends ABufferedEventSource -{ - // get the logger - private static final ALogger logger = ALogger.getLogger(AURLEventSource.class); - // the name of the event source - private String directoryURL = null; - - // needed for random mode - private Random randomGenerator = new Random(); - - /** - * @param mode event navigation mode - * @return true if the requested mode is supported by this source - */ - public boolean supportsNavigationMode(NavigationMode mode) { - if(mode == NavigationMode.SEQUENTIAL || - mode == NavigationMode.RANDOM || - mode == NavigationMode.LOOP) - return true; - return false; - } - - /** - * Constructor with the URL of the directory - * @param sourceName - * @throws atlantis.event.AEventSource.InvalidEventSourceException - */ - public AURLEventSource(String sourceName) throws InvalidEventSourceException - { - - //Make sure the event source starts with http:// - if( ! sourceName.toLowerCase().startsWith("http://")) - throw new InvalidEventSourceException("URL event source name does"+ - "not start with \"http://\""); - - //Store event source - directoryURL = sourceName; - } - - /** - * @return the directory URL string - */ - public String getSourceName() { - return directoryURL; - } - - /** - * Get a list of files in a directory given by a URL - * @param url the url of the directory - * @return a list of urls to the individual files - * @throws atlantis.event.AEventSource.InvalidEventSourceException - */ - private ArrayList<String> getEventListForURL(String url) throws InvalidEventSourceException { - - //the url of the directory we are searching - String baseUrl = url; - //trim any file endings from url - if (url.endsWith(".xml")) - baseUrl = url.substring(0, url.lastIndexOf('/')); - - - //The input stream - need to be closed in the end - InputStreamReader urlStream = null; - BufferedReader br = null; - - //be a bit verbose - logger.info("Trying to get directory listing from " + baseUrl); - - //Create an array to return - ArrayList<String> eventList = new ArrayList<String>(); - - //Now try reading stuff from the web - try { - //Get an input stream reader - urlStream = new InputStreamReader(new URL(baseUrl).openStream()); - //get a buffered reader for that stream - br = new BufferedReader(urlStream); - - // input is the whole line from HTML directory listing - // example to match: <a href="atlantis_event_70417_93.xml"> - // We use regular expressions patterns to catch the lines of interest - // ( ) defines group, group 0 is the whole match and group 1 is - // just the desired file name within the parentheses - Pattern pattern = Pattern.compile("<a href=\"(.*\\.xml)\">"); - - //Loop over all lines - String line = null; - while ((line = br.readLine()) != null) { - //try to match the patter - Matcher matcher = pattern.matcher(line); - if (matcher.find()) // not .match() (!) - { - //Get the first group from the pattern - //i.e the file name and add to our event list - eventList.add(matcher.group(1)); - } - } - - //be a bit verbose - logger.debug("List of " + eventList.size() + " events loaded from " + baseUrl); - - - } catch (MalformedURLException mue) { - String msg = "Incorrect URL address: " + baseUrl; - logger.error(msg); - AOutput.alwaysAppend("\n" + msg + "\n", ALogInterface.WARNING); - throw new InvalidEventSourceException(msg, mue); - } catch (IOException ioe) { - String msg = "IO error while reading URL: " + baseUrl; - logger.error(msg); - AOutput.alwaysAppend("\n" + msg + "\n", ALogInterface.WARNING); - throw new InvalidEventSourceException(msg, ioe); - } finally { - //In any case close everything - try { - br.close(); - urlStream.close(); - } catch (Throwable t) { - //do nothing here - } - } - - //check if there were at least some events - if (eventList.size()==0) - throw new InvalidEventSourceException("No events found at "+baseUrl); - - //In the end sort the event list - Collections.sort(eventList); - - //and return it - return eventList; - - } - - /** - * Read in an event from a fully specified path - * @param fileName the URL to the file - * @param directoryURL the name of the event source - * @return the event - */ - private AEvent readEventFromURL(String fileName, String directoryURL) - throws ReadEventException { - //Things we need to close in the end - InputStream urlStream = null; - BufferedInputStream buffStream = null; - AEvent event = null; - - try { - //Open the url as stream - String fullURL = directoryURL + "/" + fileName; - URL eventURL = new URL(fullURL); - urlStream = eventURL.openStream(); - buffStream = new BufferedInputStream(urlStream); - //then read the event from there - logger.debug("Reading event data stream from " + eventURL.toString() + "..."); - event = AEventFromXML.read(buffStream, fileName); - - } catch (FileNotFoundException fnfe) { - //Show as a warning and rethrow - String msg = "File not found at " + directoryURL+"/"+fileName; - logger.error(msg); - AOutput.alwaysAppend("\n" + msg + "\n", ALogInterface.WARNING); - throw new ReadEventException(msg, fnfe); - } catch (IOException ioe) { - //Show as an error and rethrow - String msg = "IO error when reading " + directoryURL; - logger.error(msg); - AOutput.alwaysAppend("\n" + msg + "\n", ALogInterface.WARNING); - throw new ReadEventException(msg, ioe); - } finally { - try { - if (urlStream != null) { - urlStream.close(); - } - if (buffStream != null) { - buffStream.close(); - } - } catch (Throwable t) { - //Ignore all errors - } - } - return event; - } - - /** - * Read a random event - * @return the random event - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - protected AEvent readRandom() throws InvalidEventSourceException, ReadEventException - { - - String fileName = null; - - //Check if we have been given a fully specified file url - if(directoryURL.endsWith(".xml")){ - //Store the file name from the url - fileName = directoryURL.substring(directoryURL.lastIndexOf('/')+1,directoryURL.length()); - //trim file endings from url - directoryURL = directoryURL.substring(0, directoryURL.lastIndexOf('/')); - - } else { - - //Update event list every time, so we get new files - ArrayList<String> eventList=getEventListForURL(directoryURL); - - //Check there are more files - if (eventList.size() == 0) - throw new InvalidEventSourceException("No valid files at "+directoryURL); - - //Pick a random event - int iName = randomGenerator.nextInt(eventList.size()); - - //Now get the new file - fileName = eventList.get(iName); - } - - //Now read exactly that event and return it - return readEventFromURL(fileName,directoryURL); - } - - - /** - * Read the previous event from the URL directory - * @return the previous event - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - public AEvent readNext(AEventInfo currentEvent) throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException - { - // if random mode is set, return a random event - if(getNavigationMode() == NavigationMode.RANDOM) return readRandom(); - - String fileName = null; - - //Check if we have been given a fully specified file url - if(directoryURL.endsWith(".xml")){ - //Store the file name from the url - fileName = directoryURL.substring(directoryURL.lastIndexOf('/')+1,directoryURL.length()); - //trim file endings from url - directoryURL = directoryURL.substring(0, directoryURL.lastIndexOf('/')); - - } else { - - //Update event list every time, so we get new files - ArrayList<String> eventList=getEventListForURL(directoryURL); - - //Check there are more files - if (eventList.size() == 0) - throw new NoMoreEventsException("No valid files at "+directoryURL); - //Loop over file list - int iName = 0; - //search for next entry that is lexicographically larger - //taking first one if there is no current one to compare to - while ((currentEvent != null) && - (currentEvent.getSourceName().compareTo(eventList.get(iName)) >= 0)){ - //Go to next file - ++iName; - // if we have reached the end of the list... - if (iName == eventList.size()) - // if in loop mode go to the first event - if(getNavigationMode() == NavigationMode.LOOP) { - iName = 0; - break; - } - // if not in loop mode, abort - else throw new NoMoreEventsException("No more files after " - + currentEvent.getSourceName() + " in directory "+directoryURL); - } - - //Now get the new file - fileName = eventList.get(iName); - } - - //Now read exactly that event and return it - return readEventFromURL(fileName,directoryURL); - } - - /** - * Read the previous event from the current URL directory - * @return the previous event - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - public AEvent readPrevious(AEventInfo currentEvent) throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException - { - // in random mode there's no looking back - if(getNavigationMode() == NavigationMode.RANDOM) throw new NoMoreEventsException("No more random events left in the buffer"); - - String fileName = null; - - //Check if we have been given a fully specified file url - if(directoryURL.endsWith(".xml")){ - //Store the file name from the url - fileName = directoryURL.substring(directoryURL.lastIndexOf('/')+1,directoryURL.length()); - //trim file endings from url - directoryURL = directoryURL.substring(0, directoryURL.lastIndexOf('/')); - - } else { - - //Update event list every time, so we get new files - ArrayList<String> eventList=getEventListForURL(directoryURL); - - //Check there are more files - if (eventList.size() == 0) - throw new NoMoreEventsException("No valid files at "+directoryURL); - //Loop over file list - int iName = eventList.size()-1; - //search from the end for the first entry that is lexicographically smaller - //taking last one if there is no previous one to compare to - while ((currentEvent != null) && - (currentEvent.getSourceName().compareTo(eventList.get(iName)) <= 0)){ - //Go to next file - --iName; - // if we have reached the end of the list... - if (iName < 0) - // if in loop mode, go to the last file - if(getNavigationMode() == NavigationMode.LOOP) { - iName = eventList.size()-1; - break; - } - // if not in loop mode, abort - else throw new NoMoreEventsException("No more files before " - + currentEvent.getSourceName() + " in directory "+directoryURL); - } - - //Now get the new file - fileName = eventList.get(iName); - } - - //Now read exactly that event and return it - return readEventFromURL(fileName,directoryURL); - } - -} // class AURLEventSource diff --git a/graphics/AtlantisJava/src/atlantis/event/AZipEventSource.java b/graphics/AtlantisJava/src/atlantis/event/AZipEventSource.java deleted file mode 100644 index 16aeb4d0f5e6b94295701217395b3dfd336a3a0d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/AZipEventSource.java +++ /dev/null @@ -1,478 +0,0 @@ -package atlantis.event; - -import atlantis.data.AEventFromXML; - -import java.io.IOException; -import java.io.File; -import java.io.InputStream; -import java.util.Enumeration; -import java.util.ArrayList; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; -import java.util.zip.ZipInputStream; - -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AUtilities; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.zip.ZipException; -import java.util.Random; - -/** - * Reading zip archives from local or network files or from zip files stored within .jar file - */ -public class AZipEventSource implements AEventSource -{ - - //define the source type - private enum SourceType { - JAR_FILE, - ZIP_FILE, - ZIP_NETWORK_FILE - }; - - // current event navigation mode - private NavigationMode eventNavigationMode = NavigationMode.SEQUENTIAL; - - // needed for random mode - private Random randomGenerator = new Random(); - - // A list of entries in the zip file - ArrayList<ZipEntry> ZipEntries = new ArrayList<ZipEntry>(); - // pointer to the current zip entry - int eventIndex = -1; - // flag if zip file is read from jar file (as stream) - SourceType sourceType = null; - // event file name (or event archive name) - String eventSource = null; - - /** - * @return current event navigation mode - */ - public NavigationMode getNavigationMode() { - return eventNavigationMode; - } - - /** - * @param mode sets the event navigation mode - */ - public void setNavigationMode(NavigationMode mode) throws InvalidEventSourceException { - if(supportsNavigationMode(mode)) { - eventNavigationMode = mode; - // go to the first event - eventIndex = -1; - } - else - throw new InvalidEventSourceException("Mode '"+mode+"' not supported by current source"); - } - - /** - * @param mode event navigation mode - * @return true if the requested mode is supported by this source - */ - public boolean supportsNavigationMode(NavigationMode mode) { - if(mode == NavigationMode.SEQUENTIAL || - mode == NavigationMode.RANDOM || - mode == NavigationMode.LOOP) - return true; - return false; - } - - /** - * Constructor with event source - * @param sourceName the name of the source - * @throws InvalidEventSourceException - */ - public AZipEventSource(String sourceName) throws InvalidEventSourceException - { - //Locally opened things - ZipFile zipfile = null; - ZipInputStream stream = null; - - try { - // first check if it is an network file - if (sourceName.startsWith("http://")) { - - //open network zip file input stream - stream = openNetworkStream(sourceName); - //try to read entries from network file - readEntriesFromStream(stream); - //set the source type - sourceType = SourceType.ZIP_NETWORK_FILE; - - } else if (sourceName.startsWith("file://")) { - - // strip the file:// from the source name - sourceName = sourceName.substring(7); - - // Check if this is a regular file - File file = new File(sourceName); - - //Read entries from regular file - if( (file.exists() && file.canRead())){ - - //Now try to open as a zipfile - zipfile = new ZipFile(sourceName); - //Try to read the entries from that file - readEntriesFromFile(zipfile); - //set the source type - sourceType = SourceType.ZIP_FILE; - - - } else { - //might still be a zip file in a jar archive - stream = openJarStream(sourceName); - //try to read entries from jar file - readEntriesFromStream(stream); - //set the source type - sourceType = SourceType.JAR_FILE; - } - } - } catch(AAtlantisException ae) { - //Rethrow - throw new InvalidEventSourceException("Atlantis exception reading from: "+eventSource,ae); - } catch(MalformedURLException mue) { - //Rethrow - throw new InvalidEventSourceException("An unknown protocol is specified: "+eventSource,mue); - } catch(ZipException zfe) { - //Rethrow - throw new InvalidEventSourceException("ZIP format error has occurred: "+eventSource,zfe); - } catch(IOException ioe) { - //Rethrow - throw new InvalidEventSourceException("I/O error has occurred reading: "+eventSource,ioe); - } finally { - //Try to close everthing that has been opened - try { - if (zipfile != null) zipfile.close(); - if (stream != null) stream.close(); - } catch (Throwable t){ - //Do nothing if closing fails - } - } - - //If we have not got a valid source type, throw an error - if (sourceType == null) - throw new InvalidEventSourceException("Could not identify source type of "+sourceName); - - //Make sure there are valid events in the file - if (ZipEntries.size() == 0) - throw new InvalidEventSourceException("No entries in ZIP archive: "+sourceName); - - //Store source name - eventSource=sourceName; - //Otherwise set counter to first event - eventIndex = -1; - } - - /** - * @return the name of the event file or archive - */ - public String getSourceName() { - return eventSource; - } - - /** - * Try to open a zip file in a jar file as input stream - * @param sourceName the name of the zip file - * @return the zip stream - */ - private ZipInputStream openJarStream(String sourceName) throws AAtlantisException - { - //Open as zip input stream - return new ZipInputStream(AUtilities.getFileAsStream(sourceName)); - } - - /** - * Try to open a zip file on the net as input stream - * @param sourceName the URL of the zip file - * @return the zip stream - */ - private ZipInputStream openNetworkStream(String sourceName) throws ZipException, - MalformedURLException, - IOException - { - //Open a network zip file as input stream - return new ZipInputStream(new URL(sourceName).openStream()); - } - - - /** - * Check if this is a valid name of an entry in a zip file or stream - * @param entryName the name of the entry - * @return true if valid - */ - private boolean checkZipEntry(ZipEntry entry){ - //Make sure it is not a directory - if(entry.isDirectory()) return false; - //Make sure it ends with .xml - if (! entry.getName().toLowerCase().endsWith(".xml")) return false; - //everthing fine - return true; - } - - /** - * Get a list of all valid entries from a zip stream - * @param zis the input stream - */ - private void readEntriesFromStream(ZipInputStream zis) throws InvalidEventSourceException - { - try { - //Loop over zip entries - ZipEntry next = null; - while((next = zis.getNextEntry()) != null){ - //If it is valid add it to our list fo entries - if (checkZipEntry(next)) ZipEntries.add(next); - } - } catch(ZipException ze) { - //Rethrow - throw new InvalidEventSourceException("ZIP exception reading entry from zip stream",ze); - } catch(IOException ioe){ - //rethrow - throw new InvalidEventSourceException("I/O exception reading entry from zip stream",ioe); - } - } - - /** - * Get a list of all valid XML file entries from a zip file - * @param file the zip input file - * @throws InvalidEventSourceException - */ - private void readEntriesFromFile(ZipFile file) throws InvalidEventSourceException{ - - //Seems to be a regular file - try{ - //Get the zip file entries - Enumeration<? extends ZipEntry> myenum = file.entries(); - //Loop over zip entries - while(myenum.hasMoreElements()){ - //get the entry - ZipEntry next = (ZipEntry) myenum.nextElement(); - //If it is valid add it to our list fo entries - if (checkZipEntry(next)) ZipEntries.add(next); - } - } catch(IllegalStateException ise){ - //rethrow - throw new InvalidEventSourceException("Zip file was cleased while trying to read entries: "+file.getName()); - } - } - /** - * Read a particular event from a stream. - * Since the file is read as stream, it's not possible to reference a - * particular zip entry. However, we know the number of a zip entry - * we want to get (eventIndex), so we seek (getNextEntry()) to the - * zip entry of interest and then read it. - * @return the event - */ - private AEvent readEventFromStream() throws ReadEventException - { - //Things we need to close in the end - ZipInputStream zis = null; - AEvent event = null; - - try{ - //Check which kind of stream we have and open it - if (sourceType == SourceType.JAR_FILE) - zis = openJarStream(eventSource); - else if (sourceType == SourceType.ZIP_NETWORK_FILE) - zis = openNetworkStream(eventSource); - else - throw new ReadEventException("Trying to read stream from neither jar file nor network file:" +eventSource); - - //Now seek through file to current entry - ZipEntry entry = null; - for(int i = 0; i <= eventIndex; i++) - entry = zis.getNextEntry(); - - //Check if we have reached EOF while skipping - if (entry == null) - throw new ReadEventException("Reached EOF while skippeng to entry #"+eventIndex - +" with name "+ZipEntries.get(eventIndex).getName()+ " in "+eventSource); - - //Next check if this is the entry we wanted to have - if (! entry.getName().equals(ZipEntries.get(eventIndex).getName())) - throw new ReadEventException("Content of zip stream changed since opening it:"+eventSource); - - //Finally read-in this entry - event = AEventFromXML.read(zis, entry.getName()); - } catch (AAtlantisException ae) { - throw new ReadEventException("Atlantis exception reading from: " + eventSource, ae); - } catch (ZipException ze) { - throw new ReadEventException("A ZIP format error has occurred reading entry " + - ZipEntries.get(eventIndex).getName() + " from " + eventSource, ze); - } catch (IllegalStateException ise) { - throw new ReadEventException("The zip file has been closed while reading entry" + - ZipEntries.get(eventIndex).getName() + " from " + eventSource, ise); - } catch (IOException ioe) { - throw new ReadEventException("I/O exception reading from: " + eventSource, ioe); - - } finally { - try { - //Always close the files in the end; - if (zis != null) { - zis.close(); - } - } catch (Throwable t) { - //Do nothing if closing the stream fails - } - } - - //Evertthing is fine, return the event - return event; - } - - /** - * Read a particular event from a zip file - * @param file the zip file - * @return the event - * @throws ReadEventException - */ - private AEvent readEventFromFile() throws ReadEventException - { - ZipFile file = null; - AEvent event = null; - try { - //Open the zip file - file = new ZipFile(eventSource); - //Get the input stream for the requested entry - InputStream stream = file.getInputStream(ZipEntries.get(eventIndex)); - //Get the entry name - String eventName = ZipEntries.get(eventIndex).getName(); - //Read the event - event = AEventFromXML.read(stream,eventName); - } catch (ZipException ze){ - throw new ReadEventException("A ZIP format error has occurred reading entry "+ - ZipEntries.get(eventIndex).getName() + " from "+ eventSource, ze); - } catch (IllegalStateException ise){ - throw new ReadEventException("The zip file has been closed while reading entry"+ - ZipEntries.get(eventIndex).getName() + " from "+ eventSource, ise); - } catch(IOException ioe){ - throw new ReadEventException("I/O error reading entry "+ - ZipEntries.get(eventIndex).getName() + " from "+ eventSource, ioe); - } finally { - //Always close the input stream - try { - if(file != null) file.close(); - } catch (Throwable t) { - //Ignore all errors here - } - } - - //Everything fine so we can return the event - return event; - } - - /** - * Reads a random event from a zipped source - * @return the event - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - protected AEvent randomEvent() throws InvalidEventSourceException, - ReadEventException - { - //Check if we have a valid source - if(( sourceType == null ) || ( eventSource==null )) - throw new InvalidEventSourceException("No valid input source"); - - //Now go to next event - eventIndex = randomGenerator.nextInt(ZipEntries.size()); - - //Now get this stream from its proper source - switch (sourceType){ - case JAR_FILE: return readEventFromStream(); - case ZIP_NETWORK_FILE: return readEventFromStream(); - case ZIP_FILE: return readEventFromFile(); - default: throw new ReadEventException("Unknown event source type"); - } - } - - /** - * Read the next event from a zipped source - * @return the event - * @throws InvalidEventSourceException - * @throws NoMoreEventsException - * @throws ReadEventException - */ - public AEvent nextEvent() throws InvalidEventSourceException, - NoMoreEventsException, - ReadEventException - { - // if random mode is selected, return a random event - if(getNavigationMode() == NavigationMode.RANDOM) return randomEvent(); - - //Check if we have a valid source - if(( sourceType == null ) || ( eventSource==null )) - throw new InvalidEventSourceException("No valid input source"); - - // if we're in loop mode and at the last event, go to the first one - if(getNavigationMode() == NavigationMode.LOOP && eventIndex >= ZipEntries.size() - 1) - eventIndex = 0; - // if we're not in loop mode and at the last event... - else { - // check that there are still some events - if(eventIndex >= ZipEntries.size() - 1){ - String msg="Already at last event in archive"; - // inform user - AOutput.alwaysAppend("\n" + msg+"\n", ALogInterface.WARNING); - throw new NoMoreEventsException(msg); - } - // go to next event. - eventIndex++; - } - - //Now get this stream from its proper source - switch (sourceType){ - case JAR_FILE: return readEventFromStream(); - case ZIP_NETWORK_FILE: return readEventFromStream(); - case ZIP_FILE: return readEventFromFile(); - default: throw new ReadEventException("Unknown event source type"); - } - } - - - /** - * Read the previous event from a zipped source - * @return the event - * @throws InvalidEventSourceException - * @throws NoMoreEventsException - * @throws ReadEventException - */ - public AEvent previousEvent() throws InvalidEventSourceException, - NoMoreEventsException, - ReadEventException - { - - // in random mode there's no looking back - if(getNavigationMode() == NavigationMode.RANDOM) throw new NoMoreEventsException("Cannot go back in random mode"); - - //Check if we have a valid source - if(( sourceType == null ) || ( eventSource==null )) - throw new InvalidEventSourceException("No valid input source"); - - // if we're in loop mode and we're at the first event, go to the last one - if(getNavigationMode() == NavigationMode.LOOP && eventIndex == 0) - eventIndex = ZipEntries.size() -1; - // if we're not il loop mode and at the first event... - else { - // check that there are still some events - if(eventIndex == 0){ - String msg="Already at first event in archive"; - // inform user - AOutput.alwaysAppend("\n" + msg+"\n", ALogInterface.WARNING); - throw new NoMoreEventsException(msg); - } - // go to previous event. - eventIndex--; - } - - //Now get this stream from its proper source - switch (sourceType){ - case JAR_FILE: return readEventFromStream(); - case ZIP_NETWORK_FILE: return readEventFromStream(); - case ZIP_FILE: return readEventFromFile(); - default: throw new ReadEventException("Unknown event source type"); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/oncrpc/AONCRPCEventSource.java b/graphics/AtlantisJava/src/atlantis/event/oncrpc/AONCRPCEventSource.java deleted file mode 100644 index 42410d71941835d35f8333275d14bb71c34c0351..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/oncrpc/AONCRPCEventSource.java +++ /dev/null @@ -1,304 +0,0 @@ - -package atlantis.event.oncrpc; - -import atlantis.data.AEventFromXML; -import atlantis.utils.ALogger; - -import atlantis.event.ABufferedEventSource; -import atlantis.event.AEvent; -import atlantis.event.AEventInfo; -import atlantis.event.AStreamedEventSource; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; - -import org.acplt.oncrpc.XdrVoid; -import org.acplt.oncrpc.OncRpcTcpClient; -import org.acplt.oncrpc.OncRpcException; -import org.acplt.oncrpc.OncRpcProgramNotRegisteredException; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.net.ConnectException; -import java.net.InetAddress; -import java.util.Arrays; -import java.util.Vector; - -/** - * Implements an event source retrieving events from an ONC/RPC server. - * By implementing a ABufferedEventSource, a number of previous events will be - * available to the user. Care is taken to clear the buffer in case we run into - * memory problems. This event source also provides event streams by implementing - * AStreamedEventSource. - * - * @author sboeser - */ - -public class AONCRPCEventSource extends ABufferedEventSource implements AStreamedEventSource { - - //The logger - private static final ALogger logger = ALogger.getLogger(AONCRPCEventSource.class); - - //The ONC/RPC client - private OncRpcTcpClient client = null; - - //The default timeout value in milliseconds for calling the server - private static final int DEFAULT_TIMEOUT = 2000; - //The name of the stream to read events from - private String currentStream = null; - - /** - * Constructor with the server name and port as a string value - * @param sourceName - * @throws InvalidEventSourceException - */ - public AONCRPCEventSource(String sourceName) throws InvalidEventSourceException { - - //Remove any leading "oncrpc://" indicator - sourceName = sourceName.replaceFirst("oncrpc://", ""); - - //Check if we can split the sourceName in hostName:port pair - String[] sourceParams = sourceName.split(":"); - //Do some sanity check - if (sourceParams.length > 3) - throw new InvalidEventSourceException("Invalid <server[:port][:stream]> specification: "+sourceName); - - //Now try to get the port number if it was given, - //Otherwise get port from portmapper by using 0; - int port = 0; - if ((sourceParams.length > 1)&&(sourceParams[1].length() > 0)){ - try { - port = Integer.decode(sourceParams[1]); - } catch (NumberFormatException nfe){ - throw new InvalidEventSourceException("Invalid port number: "+sourceParams[1]); - } - } - - //More sanity checks - if (port < 0) - throw new InvalidEventSourceException("Invalid port number: "+port); - - //If a stream name was given, set it now - if (sourceParams.length > 2) currentStream = sourceParams[2]; - - - //Now call the fully qualified constructor with the defaul timeout value - createClient(sourceParams[0],port,DEFAULT_TIMEOUT); - - } - - /** - * Constructor with server name, port number and timeout - * @param hostName the name or IP-address of the remote server - * @param port the port number to which the request is send - can be 0 - * @param timeout a timeout value in milliseconds - * @throws InvalidEventSourceException - */ - public AONCRPCEventSource(String hostName, int port, int timeout) throws InvalidEventSourceException { - //Call common constructor entry - createClient(hostName,port,timeout); - } - - /** - * @return a string of the form oncrpc://hostName:port:stream - */ - public String getSourceName() { - return "oncrpc://"+client.getHost().getHostName()+":"+ client.getPort()+ - ((currentStream != null) ? ":"+currentStream : ""); - } - - /** - * This source only supports sequential mode. - * @param mode event navigation mode to test - * @return true if the requested mode is supported by this source - */ - public boolean supportsNavigationMode(NavigationMode mode) { - if(mode == NavigationMode.SEQUENTIAL) - return true; - return false; - } - - /** - * Common entry point for all constructors - * @param hostName the name or IP-address of the remote server - * @param port the port number to which the request is send - * @param timeout a timeout value in milliseconds - * @throws InvalidEventSourceException - */ - private void createClient(String hostName, int port, int timeout) throws InvalidEventSourceException { - - //Now try to create the client - try { - client = new OncRpcTcpClient(InetAddress.getByName(hostName), - Server.ONCRPCSERVERPROG,Server.ONCRPCSERVERVERS,port); - } catch ( ConnectException e ) { - throw new InvalidEventSourceException("Could not connect to "+hostName,e); - } catch ( OncRpcProgramNotRegisteredException e ) { - throw new InvalidEventSourceException("Server not (yet) registered on "+hostName,e); - } catch ( OncRpcException e ) { - throw new InvalidEventSourceException("ONC/RPC exception while connecting to "+hostName,e); - } catch ( IOException e ) { - throw new InvalidEventSourceException("I/O Exception while connecting to "+hostName,e); - } - - //Set the requested timeout - client.setTimeout(timeout); - } - - /** - * Read the next event from the server - * @param currentEvent the current event - * @return the next event - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - @Override - protected synchronized AEvent readNext(AEventInfo currentEvent) throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException { - - //Be verbose - logger.info("Call to remote server "+getSourceName()); - - //Ping the server to make sure it is alive, otherwise try to recreate client - try { - client.call(Server.ONCRPC_NULL_PROC,XdrVoid.XDR_VOID, XdrVoid.XDR_VOID); - } catch (OncRpcException e) { - //Server does not respond to ping, try to recreate client - logger.info("Failed to ping server "+getSourceName()+", trying to recreate client"); - //Use setting from old client to create new client, but allow new port number - createClient(client.getHost().getHostName(),0,client.getTimeout()); - } - - //Create an event request - this may als set the default stream - EventRequest eventReq = new EventRequest(-1,-1,getStream()); - - - //use information from existing event if there is - if (currentEvent != null){ - eventReq.EventNumber = currentEvent.getEventNumber(); - eventReq.RunNumber = currentEvent.getRunNumber(); - } - - //Also prepare the return structure - Event event = new Event(); - - //record calling time - long startTime = System.currentTimeMillis(); - - - // perform the remote call - try { - client.call(Server.ONCRPC_GETEVENT_PROC, eventReq, event); - } catch (OncRpcException e) { - throw new InvalidEventSourceException("Failed to get new event from server",e); - } - - //do some statistics - long callDuration = System.currentTimeMillis() - startTime; - logger.debug("Received " + event.EventData.length + " bytes in " + callDuration + " ms"); - - //Now analyze the event we got - //Check if we already have the event - if (event.isIdentical) - //already have this event - throw new NoMoreEventsException("Already have event "+event.EventNumber + - " from run "+event.RunNumber); - //Check if the stream was available - if (!event.isAvailable) - //make event source invalid - throw new InvalidEventSourceException("No event available for stream "+eventReq.StreamName); - - //Check if the event is compressed - if (event.isCompressed) - //not supported yet - throw new UnsupportedOperationException("Support for compressed events not yet implemented"); - - //It seems we got something worth processing - //Strip the trailing null character - event.EventData=(new String(event.EventData)).trim().getBytes(); - //Wrap the data as an inputstream - ByteArrayInputStream bais = new ByteArrayInputStream(event.EventData); - - //Finally construct a new event and return it - return AEventFromXML.read(bais, currentStream); - } - -/** - * Requesting to read the previouse event from the server only appears - * if we have already reached the beginning of the event buffer. - * Only one current events are provided by the server at any time, thus we - * will always throw a NoMoreEventsException. Handling of the exception is left - * to the GUI interface. - * @param currentEvent will be ignored - * @return nothing as it will always raise an exception - * @throws NoMoreEventsException - */ - @Override - protected AEvent readPrevious(AEventInfo currentEvent) throws NoMoreEventsException - { - throw new NoMoreEventsException("ONC/RPC server does not provide a previous event"); - } - - /** - * Get a list of available streams from the server - * @return the list of stream names - * @throws InvalidEventSourceException if the server cannot be contacted - */ - public synchronized Vector<String> getAvailableStreams() throws InvalidEventSourceException { - - //Prepare response structure - Streams streams = new Streams(); - - - //Call the server - try { - client.call(Server.ONCRPC_GETSTREAMS_PROC, XdrVoid.XDR_VOID, streams); - } catch (OncRpcException e) { - throw new InvalidEventSourceException("Failed to get new stream list from server",e); - } - //We got stream names, so just return them - return new Vector(Arrays.asList(streams.StreamNames)); - } - - /** - * Set a new stream as current stream - * @param streamName the name of the stream - * @throws InvalidStreamException if the stream does not exist at the server - */ - public synchronized void setStream(String streamName) throws InvalidStreamException, - InvalidEventSourceException{ - //Check if the requested stream is available - if (! getAvailableStreams().contains(streamName)) - throw new InvalidStreamException("Stream \""+streamName+"\" not available at server"); - - //Store this as the new current stream - currentStream = streamName; - } - - /** - * Get the currently selected stream - * @return the name of the currently selected stream - * @throws NoMoreEventsException if no streams are available - * @throws InvalidEventSourceException if the list of streams can not be obtained - */ - public synchronized String getStream() throws InvalidEventSourceException, - NoMoreEventsException - { - - //If stream name is not set, set it to first available by default - if (currentStream==null){ - //Get list of streams - Vector<String> streams = getAvailableStreams(); - //If there are none throw a "NoMoreEventsException" - if (streams.size()<1) throw new NoMoreEventsException("No streams available"); - //Now set current stream as first one in list - currentStream=streams.firstElement(); - //be verbose - logger.info("Stream not set, using '"+currentStream+"'"); - } - - return currentStream; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/oncrpc/Event.java b/graphics/AtlantisJava/src/atlantis/event/oncrpc/Event.java deleted file mode 100644 index cf34cf74cb0f4f28d38ec18e475252976a64fd1f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/oncrpc/Event.java +++ /dev/null @@ -1,86 +0,0 @@ -package atlantis.event.oncrpc; -import org.acplt.oncrpc.*; -import java.io.IOException; - -/** - * This structure declares the event as returned from a call - * to the ONCRPC_GETEVENT_PROC. - * @author Sebastian Boeser - */ -public class Event implements XdrAble { - - - /** False if no event exists for the requested stream at the server*/ - public boolean isAvailable; - /** True if no new event exists at the server */ - public boolean isIdentical; - /** True if the event data is compressed */ - public boolean isCompressed; - /** The name fo the stream this event belongs to */ - public String StreamName; - /** The number of the event */ - public long EventNumber; - /** The number of the run */ - public long RunNumber; - /** The event data as byte array */ - public byte [] EventData; - - /** - * Constructor - */ - public Event() { - //Initialize variables - isAvailable = false ; - isIdentical = false ; - isCompressed = false ; - StreamName = ""; - EventNumber = -1; - RunNumber = -1; - EventData = null; - } - - /** - * Constructor that can be used with RPC client call - * @param xdr the stream that holds the encoded event - * @throws OncRpcException if decoding fails - * @throws IOException - */ - public Event(XdrDecodingStream xdr) throws OncRpcException, IOException { - xdrDecode(xdr); - } - - /** - * Encode the information in XDR representation - * @param xdr the stream to encode into - * @throws OncRpcException if encoding fails - * @throws IOException - */ - public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException { - //Encode all fields in proper order into the stream - xdr.xdrEncodeBoolean(isAvailable); - xdr.xdrEncodeBoolean(isIdentical); - xdr.xdrEncodeBoolean(isCompressed); - xdr.xdrEncodeString(StreamName); - xdr.xdrEncodeLong(EventNumber); - xdr.xdrEncodeLong(RunNumber); - xdr.xdrEncodeByteVector(EventData); - } - - /** - * Decode the information from XDR representation - * @param xdr the stream to decode from - * @throws OncRpcException if decoding fails - * @throws IOException - */ - public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException { - //Decode all fields in proper order from stream - isAvailable = xdr.xdrDecodeBoolean(); - isIdentical = xdr.xdrDecodeBoolean(); - isCompressed = xdr.xdrDecodeBoolean(); - StreamName = xdr.xdrDecodeString(); - EventNumber = xdr.xdrDecodeLong(); - RunNumber = xdr.xdrDecodeLong(); - EventData = xdr.xdrDecodeDynamicOpaque(); - } - -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/event/oncrpc/EventRequest.java b/graphics/AtlantisJava/src/atlantis/event/oncrpc/EventRequest.java deleted file mode 100644 index fa60d7828576b939e7eba61f7d8e74bc8accad39..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/oncrpc/EventRequest.java +++ /dev/null @@ -1,79 +0,0 @@ -package atlantis.event.oncrpc; -import org.acplt.oncrpc.*; -import java.io.IOException; - -/** - * Data structure as passed to the ONCRPC_GETEVENT_PROC - * When sending an event request to the server, we have to specify the stream name, - * along with informatian about events we already have. Negative event and run number - * indicates we don't have any events yet. - * @author Sebastian Boeser - */ -public class EventRequest implements XdrAble { - - /** The event number of the event we already have */ - public long EventNumber; - /** The run number of the event we already have */ - public long RunNumber; - /** The name of the stream we are asking events from */ - public String StreamName; - - /** - * Constructor - */ - public EventRequest() { - //Initialize values - EventNumber = -1; - RunNumber = -1; - StreamName = ""; - } - - /** - * Fully qualified constructor - * @param eventNumber the event number of the event we already have - * @param runNumber the run number of the event we already have - * @param streamName the stream we are asking events from - */ - public EventRequest(long eventNumber, long runNumber, String streamName){ - EventNumber = eventNumber; - RunNumber = runNumber; - StreamName = streamName; - } - - /** - * Construct an event request returned from an rpc call - * @param xdr the stream to construct the request from - * @throws OncRpcException if decoding fails - * @throws IOException - */ - public EventRequest(XdrDecodingStream xdr) throws OncRpcException, IOException { - xdrDecode(xdr); - } - - /** - * Encode the information in XDR representation - * @param xdr the stream to encode into - * @throws OncRpcException if encoding fails - * @throws IOException - */ - public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException { - //Encode into stream in proper order - xdr.xdrEncodeLong(EventNumber); - xdr.xdrEncodeLong(RunNumber); - xdr.xdrEncodeString(StreamName); - } - - /** - * Decode the information in XDR representation - * @param xdr the stream to decode from - * @throws OncRpcException if decoding fails - * @throws IOException - */ - public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException { - //Decode from stream in proper order - EventNumber = xdr.xdrDecodeLong(); - RunNumber = xdr.xdrDecodeLong(); - StreamName = xdr.xdrDecodeString(); - } - -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/event/oncrpc/Server.java b/graphics/AtlantisJava/src/atlantis/event/oncrpc/Server.java deleted file mode 100644 index be83e8e71c9fc90f572950e9b216522ea2feab19..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/oncrpc/Server.java +++ /dev/null @@ -1,47 +0,0 @@ -package atlantis.event.oncrpc; - -/** - * A collection of constants used by the "ONCRPCServer" ONC/RPC program. - * These constants need to match the respective definitons on the C++ server - * side, where they are defined in JiveXML/JiveXML/ONCRPCServer.h - * @author Sebastian Boeser - */ -public interface Server { - - /** - * The ID by which the server is identified - */ - public static final int ONCRPCSERVERPROG = 200048965; - - /** - * The version of the current server interface - */ - public static final int ONCRPCSERVERVERS = 2; - - /** - * The ID of the void procdure - */ - public static final int ONCRPC_NULL_PROC = 0; - - /** - * The ID of the getStatus procedure - */ - public static final int ONCRPC_GETSTATUS_PROC = 1; - - /** - * The ID of the getStreams procedure - */ - public static final int ONCRPC_GETSTREAMS_PROC = 2; - - - /** - * The ID of the getEvent procedure - */ - public static final int ONCRPC_GETEVENT_PROC = 3; - - /** - * The ID of the SetNewEvent procedure - is not implemented in this client - */ - //public static final int ONCRPC_SETEVENT_PROC = 4; -} - diff --git a/graphics/AtlantisJava/src/atlantis/event/oncrpc/Streams.java b/graphics/AtlantisJava/src/atlantis/event/oncrpc/Streams.java deleted file mode 100644 index b61d84cb9732befcf307554de160ac1cd1e40cac..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/oncrpc/Streams.java +++ /dev/null @@ -1,53 +0,0 @@ -package atlantis.event.oncrpc; -import org.acplt.oncrpc.*; -import java.io.IOException; - -/** - * Data structure as returned from ONCRPC_GETSTREAMS_PROC is a list of stream names - * available at the server. - * @author Sebastian Boeser - */ -public class Streams implements XdrAble { - - /** The array of stream names */ - public String [] StreamNames; - - /** - * Constructor - */ - public Streams() { - //Array is empty by default, nothing to initialize - } - - /** - * Constructure that can be passed to an RPC client call - * @param xdr the stream to decode from - * @throws OncRpcException if decoding fails - * @throws IOException - */ - public Streams(XdrDecodingStream xdr) throws OncRpcException, IOException { - xdrDecode(xdr); - } - - /** - * Encode the information in XDR representation - * @param xdr the XDR stream to encode into - * @throws OncRpcException if encoding fails - * @throws IOException - */ - public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException { - //Encode the stream name - xdr.xdrEncodeStringVector(StreamNames); - } - - /** - * Decode the information from XDR representation - * @param xdr the XDR stream to decode from - * @throws OncRpcException if decoding fails - * @throws IOException - */ - public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException { - //Encode stream names - StreamNames = xdr.xdrDecodeStringVector(); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/event/package.html b/graphics/AtlantisJava/src/atlantis/event/package.html deleted file mode 100644 index b6788c40f433dd2fc0f0a279918517f57222e121..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/package.html +++ /dev/null @@ -1,9 +0,0 @@ -<html> -<head></head> -<body> -<p>This package holds all the main event base classes, such as - the data type base AData or the event class AEvent. It also hold the event - sourc managers and interfaces, as well as their concrete implementations. -</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AClientXMLRPC.java b/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AClientXMLRPC.java deleted file mode 100755 index 2e795e433c13e7686a6207568cd94105993d9e96..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AClientXMLRPC.java +++ /dev/null @@ -1,244 +0,0 @@ -package atlantis.event.xmlrpc; - -import atlantis.utils.*; -import java.net.URL; -import java.net.MalformedURLException; -import java.util.Vector; - -import org.apache.xmlrpc.client.XmlRpcClient; -import org.apache.xmlrpc.client.AsyncCallback; -import org.apache.xmlrpc.XmlRpcException; -import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; -import org.apache.xmlrpc.client.TimingOutCallback; - - -/** - * Implementation of XMLRPC client communicating to the - * server side running within the Athena framework - JiveXML C++ ulxmlrpcpp server, - * Python Interactive server. - * - * @author Zdenek Maxa - */ -public class AClientXMLRPC -{ - private final static ALogger logger = ALogger.getLogger(AClientXMLRPC.class); - - private String methodName = ""; - private AsyncCallback caller = null; - - // timeout - default timeout delay for synchronous calls [ms] - private int timeout = 6000; - - - - - /** - * Constructor for synchronous XMLRPC calls - * @param method - */ - public AClientXMLRPC(String method) - { - this.methodName = method; - this.caller = null; // synchronous calls will be demanded - - } // AClientXMLRPC() ---------------------------------------------------- - - - - /** - * Constructor for asynchronous XMLRPC calls - * @param method - * @param caller - */ - public AClientXMLRPC(String method, AsyncCallback caller) - { - this.methodName = method; - this.caller = caller; // asynchronous calls - - } // AClientXMLRPC() ---------------------------------------------------- - - - - public void setTimeout(int value) - { - this.timeout = value; - - } // setTimeout() ------------------------------------------------------- - - - - /** - * Asynchronous XMLRPC call, returns immediately and callback - * caller is later invoked when result is available. - * @param client - * @param params - * @throws ARemoteCallerException - */ - private void asynchronousCallXMLRPCServer(XmlRpcClient client, Vector params) - throws ARemoteCallerException - { - String msg = ""; - - logger.debug("Asynchronous XMLRPC call ..."); - try - { - client.executeAsync(methodName, params, caller); - - } - catch(Throwable t) - { - if(t instanceof XmlRpcException) - { - msg = "XMLRPC exception occured, performing the remote call failed."; - } - else - { - msg = "Unspecified exception occured, reason: " + t.getMessage(); - } - logger.debug(msg, t); - throw new ARemoteCallerException(msg); - } - - } // asynchronousCallXMLRPCServer() ------------------------------------- - - - - /** - * Synchronous XMLRPC call. Implemented as asynchronous but timing-out - * call so that we wait until the result is available. This way it prevents - * Atlantis from hanging if remote server (Athena) crashes. - * @param client - * @param params - * @return - * @throws ARemoteCallerException - */ - private String synchronousCallXMLRPCServer(XmlRpcClient client, Vector params) - throws ARemoteCallerException - { - String msg = ""; - String result = null; - - logger.debug("Synchronous timing-out XMLRPC call (timeout " + - timeout / 1000 + "s) ..."); - - TimingOutCallback callback = new TimingOutCallback(timeout); - try - { - client.executeAsync(methodName, params, callback); - } - catch(XmlRpcException xmle) - { - msg = "XMLRPC exception occured, performing the remote call failed."; - logger.debug(msg, xmle); - throw new ARemoteCallerException(msg); - } - - - try - { - result = (String) callback.waitForResponse(); - - // no error, result should be event data - all well - logger.debug("Performing timing out XMLRPC call successful."); - } - catch(Throwable t) - { - if(t instanceof InterruptedException) - { - msg = "The request was interrupted, timed out after " + - timeout / 1000 + "s, try increasing the timer."; - } - else if(t instanceof TimingOutCallback.TimeoutException) - { - msg = "No response was received after waiting " + - timeout / 1000 + "s, try increasing the timer."; - } - else - { - msg = "An error was returned by the server, reason: " + t.getMessage(); - } - logger.debug(msg, t); - throw new ARemoteCallerException(msg); - } - - return result; - - } // synchronousCallXMLRPCServer() -------------------------------------- - - - - /** - * Main method calling remote server methods via XMLRPC - * - * @param serverName - name of the XMLRPC server to call method on - * @param port - where XMLRPC runs - * @param params - Vector containing either command to execute, - * name of a remote variable to get its value or expression to - * process (to change some variables's value) - * @return String - result - * @throws ARemoteCallerException - */ - public String callXMLRPCServer(String serverName, int port, Vector params) - throws ARemoteCallerException - { - - XmlRpcClient client = null; - String result = null; - String msg = null; // logging temporary variable - - msg = "Calling " + serverName + ":" + port; - logger.info(msg); - - - // create instance of XMLRPC client - try - { - // Vector type is only acceptable for XmlRpcClient.execute() / - // .executeAsync() - // String is expected on the remote side by C++ ulxmlrpcpp server - // String, among others, is accepted by Python server as well - - // throws MalformedURLException - XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); - config.setServerURL(new URL(serverName + ":" + port)); - client = new XmlRpcClient(); - client.setConfig(config); - logger.debug("XMLRPC client instantiated successfully."); - } - catch(Throwable t) - { - if(t instanceof MalformedURLException) - { - msg = "Could not create XMLRPC client, bad address " + - serverName + ":" + port + "\n" + - "reason: " + t.getMessage(); - } - else - { - msg = "Unspecified exception occured\n" + - "reason: " + t.getMessage(); - } - - logger.debug(msg, t); - throw new ARemoteCallerException(msg); - } - - - if(caller != null) - { - // perform asynchronous XMLRPC call, returns immediately - asynchronousCallXMLRPCServer(client, params); - } - else - { - // synchronous call, timing out synchronous call - result = synchronousCallXMLRPCServer(client, params); - } - - client = null; - return result; - - } // callXMLRPCServer() ------------------------------------------------- - - -} // class AClientXMLRPC ==================================================== \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/ARemoteCallerException.java b/graphics/AtlantisJava/src/atlantis/event/xmlrpc/ARemoteCallerException.java deleted file mode 100755 index b6958f4d1ea06b061a145f4e1c6d2d4def78442a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/ARemoteCallerException.java +++ /dev/null @@ -1,22 +0,0 @@ -package atlantis.event.xmlrpc; - -import atlantis.utils.*; - - -/** - * - * Exception thrown after errors occured during calls - * to remote server methods (within Athena) via XMLRPC - * - * @author Zdenek Maxa - */ -public class ARemoteCallerException extends AAtlantisException -{ - public ARemoteCallerException(String msg) - { - super("Exception while calling remote procedure.\n" + msg); - - } // ARemoteCallerException() ------------------------------------------- - - -} // class ARemoteCallerException =========================================== diff --git a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AServerXMLRPC.java b/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AServerXMLRPC.java deleted file mode 100644 index 8d481b260b6e3973522d8dc73703ebdf40c95773..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AServerXMLRPC.java +++ /dev/null @@ -1,43 +0,0 @@ -package atlantis.event.xmlrpc; - -import atlantis.utils.*; -import java.io.IOException; -import org.apache.xmlrpc.XmlRpcException; -import org.apache.xmlrpc.webserver.WebServer; -import org.apache.xmlrpc.server.XmlRpcServer; -import org.apache.xmlrpc.server.PropertyHandlerMapping; - -/** - * - * @author Adam Davison - */ -public class AServerXMLRPC { - - private static ALogger logger = ALogger.getLogger(AServerXMLRPC.class); - - private WebServer m_ws; - - public AServerXMLRPC(int port, Class handler) throws XmlRpcException { - - logger.debug("Attempting to create XMLRPC server on port " + port); - logger.debug("Serving requests to handler of type " + handler.getName()); - - m_ws = new WebServer(port); - XmlRpcServer xmlRpcServer = m_ws.getXmlRpcServer(); - PropertyHandlerMapping phm = new PropertyHandlerMapping(); - phm.addHandler(handler.getName(), handler); - xmlRpcServer.setHandlerMapping(phm); - - logger.debug("XMLRPC server created successfully"); - - } - - public void start() throws IOException { - - logger.debug("Attempting to start XMLRPC server"); - m_ws.start(); - logger.info("XMLRPC server started"); - - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AServerXMLRPCEventSource.java b/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AServerXMLRPCEventSource.java deleted file mode 100644 index f3bf0fe2c6840549d5ec4d88c0af8298c051f9bc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AServerXMLRPCEventSource.java +++ /dev/null @@ -1,146 +0,0 @@ -package atlantis.event.xmlrpc; - -import atlantis.utils.*; -import atlantis.canvas.ACanvas; -import atlantis.data.AEventFromXML; -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.event.AEventSource; -import atlantis.globals.AGlobals; -import atlantis.graphics.encoders.AImageEncoder; -import java.io.ByteArrayInputStream; - -/** - * - * @author Adam Davison - */ -public class AServerXMLRPCEventSource implements AEventSource{ - - private static ALogger logger = ALogger.getLogger(AServerXMLRPCEventSource.class); - - private AEventManager m_aem; - private ACanvas m_canv; - private AImageEncoder m_ie; - - private AEvent m_event = null; // Current event - private String m_sourcename = ""; // Source name - - private NavigationMode eventNavigationMode = NavigationMode.PUSH; - - public AServerXMLRPCEventSource() { - m_aem = AEventManager.instance(); - m_canv = ACanvas.getCanvas(); - m_ie = new AImageEncoder(); - } - - public String getVersion() { - return AGlobals.instance().getVersion(); - } - - public boolean isReady() { - return true; - } - - public boolean shutdown() { - logger.info("Exiting atlantis..."); - System.exit(0); - return true; - } - - public NavigationMode getNavigationMode() { - return eventNavigationMode; - } - - public boolean supportsNavigationMode(NavigationMode mode) { - if(mode == NavigationMode.PUSH) - return true; - return false; - } - - public void setNavigationMode(NavigationMode mode) throws InvalidEventSourceException { - if(mode != NavigationMode.PUSH) - throw new InvalidEventSourceException("Mode '"+mode.name()+"' not supported by current source"); - eventNavigationMode = mode; - } - - private void setEventFromBytes(byte[] eventdata, String sourcename) throws Exception { - AEvent e = AEventFromXML.read(new ByteArrayInputStream(eventdata), sourcename); - - m_event = e; - m_sourcename = sourcename; - - // Force update from event manager - m_aem.setEventSource(this); - m_aem.nextEvent(); - } - - private byte[] getSingleImage(int w, int h, String type, double s) throws Exception { - if (type.equalsIgnoreCase("png")) { - return m_ie.getPNGData(w, h); - } else if (type.equalsIgnoreCase("scaledpng")) { - return m_ie.getScaledPNGData(w, h, s); - } - - throw new Exception("Unknown image format: " + type); - } - - private byte[] getSingleImageAspect(int w, String type, double s) throws Exception { - int h = m_canv.getRespectiveHeight(w); - return getSingleImage(w, h, type, s); - } - - public byte[][] generateDefaultImages(byte[] eventdata, String sourcename, - int width, double thumb_scale) { - - byte ret[][] = new byte[2][]; - - try { - setEventFromBytes(eventdata, sourcename); - ret[0] = getSingleImageAspect(width, "png", 0.0); - ret[1] = getSingleImageAspect(width, "scaledpng", thumb_scale); - } catch (Exception e) { - logger.error("Error while handling request to generateDefaultImages()", e); - return null; - } - - return ret; - } - - public AEvent nextEvent() throws NoMoreEventsException, InvalidEventSourceException, ReadEventException { - if (m_event == null) { - throw new InvalidEventSourceException(); - } - return m_event; - } - - public AEvent previousEvent() throws NoMoreEventsException, InvalidEventSourceException, ReadEventException { - throw new NoMoreEventsException(); - } - - public String getSourceName() { - return m_sourcename; - } - - /*public byte[][] generateImages(byte[] eventdata, String sourcename, - Integer nimgs, Object[] w, Object[] h, Object[] type, Object[] s) { - - byte ret[][] = new byte[nimgs][]; - - try { - setEventFromBytes(eventdata, sourcename); - - for (int i = 0; i < nimgs; i++) { - // Handle cast of s better here - ret[i] = getSingleImage((Integer) (w[i]), (Integer) (h[i]), - (String) (type[i]), (Double) (s[i])); - } - - } catch (Exception e) { - logger.error("Error while handling request to generateImages()", e); - return null; - } - - return ret; - }*/ - -} diff --git a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AXMLRPCEventSource.java b/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AXMLRPCEventSource.java deleted file mode 100644 index 29967b6e31068802992ea9c0dd1d6631d78738d5..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/event/xmlrpc/AXMLRPCEventSource.java +++ /dev/null @@ -1,238 +0,0 @@ - -package atlantis.event.xmlrpc; - -import atlantis.event.*; -import atlantis.data.AEventFromXML; -import atlantis.Atlantis; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; - -import atlantis.utils.ALogger; - -import java.io.ByteArrayInputStream; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Vector; - - -/** - * Implements an event source retrieving events from an XMLRCP server. - * By implementing a ABufferedEventSource, a number of previous events will be - * available to the user. Care is taken to clear the buffer in case we run into - * memory problems. - * - * @author sboeser - */ - -public class AXMLRPCEventSource extends ABufferedEventSource { - - //The logger - private static final ALogger logger = ALogger.getLogger(AXMLRPCEventSource.class); - - //The XMLRPC client - private AClientXMLRPC XMLRPCClient = null; - //The Method to call on the server side - private static final String GETEVENTDATA = "getEventData"; - //The default timeout value in milliseconds for calling the server - private static final int DEFAULT_TIMEOUT = 2000; - //The name of the local machine (send along with event request) - private String localMachineName = "<unknown>"; - //The name and port number of the remote host - private String remoteMachineName = null; - //The port number to which we should connect - private Integer portNumber = null; - //The timeout for a request - private Integer timeOut = null; - - /** - * Constructor with the server name and port as a string value - * @param sourceName - * @throws InvalidEventSourceException - */ - public AXMLRPCEventSource(String sourceName) throws InvalidEventSourceException { - - //Remove any leading "xmlrpc://" indicator - sourceName = sourceName.replaceFirst("xmlrpc://", ""); - //try to split sourceName in serverName:port pair - String[] sourceParams = sourceName.split(":"); - //Do some checks - if (sourceParams.length != 2) - throw new InvalidEventSourceException("Invalid <server:port> specification: "+sourceName); - - //Try to get the port number - int port = -1; - try { - port = Integer.decode(sourceParams[1]); - } catch (NumberFormatException nfe){ - throw new InvalidEventSourceException("Invalid port number: "+sourceParams[1]); - } - - if (port < 0) - throw new InvalidEventSourceException("Invalid port number: "+port); - - //Now call the fully qualified constructor with the defaul timeout value - CreateXMLRPCEventSource(sourceParams[0],port,DEFAULT_TIMEOUT); - - } - - /** - * Constructor with server name, port number and timeout - * @param serverName the name or IP-address of the remote server - * @param port the port number to which the request is send - * @param timeout a timeout value in milliseconds - * @throws InvalidEventSourceException - */ - public AXMLRPCEventSource(String serverName, int port, int timeout) - throws InvalidEventSourceException { - //Call common constructor entry - CreateXMLRPCEventSource(serverName,port,timeout); - } - - /** - * @return a string of the form xmlrpc://servername:port - */ - public String getSourceName() { - return "xmlrpc://"+remoteMachineName+":"+portNumber; - } - - /** - * @param mode event navigation mode - * @return true if the requested mode is supported by this source - */ - public boolean supportsNavigationMode(NavigationMode mode) { - if(mode == NavigationMode.SEQUENTIAL) - return true; - return false; - } - - /** - * Common entry point for all constructors - * @param serverName the name or IP-address of the remote server - * @param port the port number to which the request is send - * @param timeout a timeout value in milliseconds - * @throws InvalidEventSourceException - */ - private void CreateXMLRPCEventSource(String serverName, int port, int timeout) - throws InvalidEventSourceException { - - //Store the input values - remoteMachineName = serverName; - portNumber = port; - timeOut = timeout; - - //try to obtain the name of the local machine - try { - localMachineName = InetAddress.getLocalHost().getHostName(); - } catch (UnknownHostException ex) { - //Can't get name of local host - String msg = "Unable to obtain local machine name, using \"" - + localMachineName +"\" instead"; - logger.error(msg); - } catch(Exception ex) { - //Rethrow everything else as invalid source exception - throw new InvalidEventSourceException("Exception trying to obtain local machine name",ex); - } - - //Finally create a new AClientXMLRPC object - XMLRPCClient = new AClientXMLRPC(GETEVENTDATA); - - } - - /** - * Read the next event from the server - * @param currentEvent the current event - * @return the next event - * @throws NoMoreEventsException - * @throws InvalidEventSourceException - * @throws ReadEventException - */ - @Override - protected AEvent readNext(AEventInfo currentEvent) throws NoMoreEventsException, - InvalidEventSourceException, - ReadEventException { - //Be verbose - logger.info("Call to remote server xmlrpc://" + remoteMachineName + ":" + portNumber.toString()); - - //send the name of the local machine to the JiveXML server - Vector<String> parameters = new Vector(); - parameters.add(localMachineName); - - //record calling time - long startTime = System.currentTimeMillis(); - - //The XMLRPC client will return data as a string - String eventXMLData = null; - - // perform the remote call - try { - eventXMLData = XMLRPCClient.callXMLRPCServer("http://"+remoteMachineName, portNumber, parameters); - } catch (ARemoteCallerException ex) { - //An error occured - String msg = "readNext(): Exception while calling remote server"; - logger.error(msg,ex); - //rethrow - throw new InvalidEventSourceException(msg, ex); - } - - //do some statistics - long callDuration = System.currentTimeMillis() - startTime; - logger.debug("Received " + eventXMLData.length() + " bytes in " + callDuration + " ms"); - - - //If there is just no new event, we should get back an empty string - if (eventXMLData.length() == 0) { - throw new NoMoreEventsException("No event available from the server (yet)"); // something was received, going to process the result - } - if (!(eventXMLData.startsWith("<?xml"))) { - String msg = "Invalid event data received from JiveXML server"; - logger.error(msg); - throw new ReadEventException(msg); - } - - - - //So it seems we got something worth processing - logger.info("Received data from remote server, going to process it ..."); - - // Wrap the string as an inputstream - ByteArrayInputStream bais = new ByteArrayInputStream(eventXMLData.getBytes()); - - //Construct a new event - AEvent event = AEventFromXML.read(bais, remoteMachineName+":"+portNumber); - - /** - * The XMLRPC server is not clever enough to return no event if there is no - * new one. In order to avoid filling the buffer with identical events, we - * therefore check here if we don't already have that event, and throw a - * NoMoreEventsException in case we do. - */ - if (event.equals(currentEvent)){ - String msg = "Already have event "+event.getEventNumber()+" in run " - + event.getRunNumber() + " - ignored!"; - throw new NoMoreEventsException(msg); - } - - - //Now we are sure we have a next event, return it - return event; - - } - -/** - * Requesting to read the previous event from the server only appears - * if we have already reached the beginning of the event buffer. - * Only one current events are provided by the server at any time, thus we - * will always throw a NoMoreEventsException. Handling of the exception is left - * to the GUI interface, and may e.g be ignored in loop mode. - * @param currentEvent will be ignored - * @return nothing as it will always raise an exception - * @throws NoMoreEventsException - */ - @Override - protected AEvent readPrevious(AEventInfo currentEvent) throws NoMoreEventsException - { - throw new NoMoreEventsException("XMLRPC server does not provide a previous event"); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/AAtlasDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/AAtlasDetector.java deleted file mode 100755 index bf8b9a267fbf1e30513cf28aacc2ab8d5102833d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/AAtlasDetector.java +++ /dev/null @@ -1,119 +0,0 @@ -package atlantis.geometry; - -import java.util.regex.Pattern; - -import atlantis.config.ADefaultValues; -import atlantis.utils.ALogger; - - -/** - * AAtlasDetector - * contains one instance of - * ABoxDetectors (which contains all instances of ABoxDetector) (MDT,RPC in barrel) - * ATrapezoidDetectors (which contains all instances of ATrapezoidDetector) (MDT,TGC endcap) - * AGeneralDetectors (which contains all instances of AGeneralPathDetector, - * ADiscDetector, ARectangleDetector) (all others) - */ -public class AAtlasDetector extends ADetectorSystem -{ - private static ALogger logger = ALogger.getLogger(AAtlasDetector.class); - private static ADetectorSystem theDetector; - - public AAtlasDetector(String geomIdCalo) - { - super(new ADetectors[] - { - new AGeneralDetectors( - new AGeometryFromXMLReader().readDetectorGeometryFromXML(geomIdCalo)) - }); - - logger.info("Using geometry file: " + geomIdCalo); - - setGeometryName(geomIdCalo); - - } // AAtlasDetector(String fileName) ------------------------------------ - - - - public AAtlasDetector(String geomIdCalo, String geomMuon) - { - super(new ADetectors[] - { - new ABoxDetectors( - new AGeometryFromXMLReader().readDetectorGeometryFromXML(geomMuon)), - new ATrapezoidDetectors( - new AGeometryFromXMLReader().readDetectorGeometryFromXML(geomMuon)), - new AGeneralDetectors( - new AGeometryFromXMLReader().readDetectorGeometryFromXML(geomMuon)), - new AGeneralDetectors( - new AGeometryFromXMLReader().readDetectorGeometryFromXML(geomIdCalo)) - }); - - logger.info("Using geometry file: " + geomIdCalo); - logger.info("Using geometry file: " + geomMuon); - - setGeometryName(geomIdCalo); - - } // AAtlasDetector(String fileName, String muFileName) ----------------- - - - - private static void setGeometryName(String absFileName) - { - // default geometry file, shall always be AGeometry.xml - // arbitrary, named geometry file, geometry name after '_' character - // (but there is also AGeometryTB.xml) - String name = "AGeometry"; - String ext = ".xml"; - String pattern = ".*" + name + "_?.*" + ext; - - if(Pattern.compile(pattern).matcher(absFileName).matches()) - { - int s = absFileName.lastIndexOf(name); - int e = absFileName.lastIndexOf(ext); - String r = absFileName.substring(s + name.length(), e); - if(r.startsWith("_")) - { - // arbitrary, named geometry - geometryName = r.substring(1); // without leading _ - ADefaultValues.set("GeometryName", geometryName); - } - else if("".equals(r)) - { - // default geometry (no name given: "") - geometryName = "<default>"; - ADefaultValues.set("GeometryName", ""); - } - else - { - geometryName = r; - ADefaultValues.set("GeometryName", geometryName); - } - } - else - { - logger.warn("Geometry name not matching regular expression: " + - pattern + "\n geometry name will be: n/a"); - geometryName = "n/a"; - } - - } // setGeometryName() -------------------------------------------------- - - - /** - * @return the detector - */ - public static ADetectorSystem getDetector() { - return theDetector; - } - - - /** - * @param theDetector the ATLAS detector geometry to be used - */ - public static void setDetector(ADetectorSystem theDetector) { - AAtlasDetector.theDetector = theDetector; - } - - -} // class class AAtlasDetector ============================================= diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ABarrelCalorimeterDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ABarrelCalorimeterDetector.java deleted file mode 100755 index 870a7d46f7efaad662fde89ff511a6c20fcadb8d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ABarrelCalorimeterDetector.java +++ /dev/null @@ -1,284 +0,0 @@ -package atlantis.geometry; - -import atlantis.graphics.ACoord; -import atlantis.graphics.AClipper; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AMath; - -/** - * Class representing a calorimeter part in the barrel section of ATLAS. - * - * @author Eric Jansen - */ -public class ABarrelCalorimeterDetector extends ACalorimeterDetector { - - /** - * Constructs a new barrel calorimeter object. - * @param name String name of the object - * @param color String name of the color used to draw this object - * @param sampling int sampling of this calorimeter part - * @param region int region of this calorimeter part - * @param rMin double inner radius - * @param rMax double outer radius - * @param zMin double inner z - * @param zMax double outer z - * @param eta0 double start of the first cell in eta - * @param deta double size of a cell in eta - * @param neta int number of cells in eta - * @param meta int eta index of the first cell - * @param phi0 double start of the first cell in phi - * @param nphi int number of cells in phi - */ - public ABarrelCalorimeterDetector(String name, String color, int sampling, int region, - double rMin, double rMax, double zMin, double zMax, - double eta0, double deta, int neta, int meta, - double phi0, int nphi) { - super(name, color); - - // Just to be sure we take absolute values here. - this.sampling = Math.abs(sampling); - this.region = Math.abs(region); - - this.rMin = rMin; - this.rMax = rMax; - this.zMin = zMin; - this.zMax = zMax; - this.eta0 = eta0; - this.deltaEta = deta; - this.numEta = neta; - this.minEta = meta; - this.phi0 = Math.toRadians(phi0); - this.numPhi = nphi; - this.deltaPhi = 2.*Math.PI/numPhi; - - this.detEtaMin = AMath.etaAbs(this.zMax, this.rMax); - this.detEtaMax = AMath.etaAbs(this.zMin, this.rMin); - - if (this.eta0 <= 0.0) { - this.zMin = -this.zMax; - this.detEtaMin = -this.detEtaMax; - } - - // This one is used for clipping the cell geometry in rho-z. - this.clipper = new AClipper(this.zMin, this.zMax, this.rMin, this.rMax); - - // These arrays are used by the getDetectorIndex() method in ACalorimeterData. - // They provide fast mapping of hits to detectors. - if (this.name.indexOf("LAr") >= 0 && this.sampling < lar[1].length - && this.region < lar[1][this.sampling].length) { - - lar[1][this.sampling][this.region] = detectors.indexOf(this); - } else if (this.name.equals("TILE Barrel") && this.sampling < tile.length) { - tile[this.sampling] = detectors.indexOf(this); - - } else if (this.name.equals("Extended TILE") && this.sampling < tile_ext.length) { - tile_ext[this.sampling] = detectors.indexOf(this); - - } else { - System.out.println("Unknown calorimeter object: '" + this.name + "'" - + " some hits might not be displayed correctly."); - } - } - - /** - * Returns the y-x geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getYXUser() { - if (!globals.getUseOpenGL()) { - int numPoints = 2 * (numPhi + 1); - double[][] hv = new double[2][numPoints]; - for (int i = 0; i < numPhi + 1; i++) { - hv[0][i] = rMin * Math.cos(phi0 + i * deltaPhi); - hv[1][i] = rMin * Math.sin(phi0 + i * deltaPhi); - hv[0][numPhi + 1 + i] = rMax * Math.cos(phi0 - i * deltaPhi); - hv[1][numPhi + 1 + i] = rMax * Math.sin(phi0 - i * deltaPhi); - } - return new ACoord(hv); - } else { - return new ACoord(generateAnnulusTris(numPhi, phi0, rMin, rMax)); - } - } - - /** - * Returns the rho-z geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getRZUser() { - double[] h, v; - - double etaMax = eta0 + numEta * deltaEta; - double etaMin; - if (eta0 <= 0.0) { - etaMin = -etaMax; - } else { - etaMin = eta0; - } - - // Calculate the polygon in the positive h and v. - if (name.indexOf("TILE") >= 0) { - h = new double[] {zMax, zMin, zMin, zMax}; - v = new double[] {rMax, rMax, rMin, rMin}; - } else { - double z0 = rMax*Math.sinh(etaMax); - double z1 = rMax*Math.sinh(etaMin); - double z2 = rMin*Math.sinh(etaMin); - double z3 = rMin*Math.sinh(etaMax); - - h = new double[] {z0, z1, z2, z3}; - v = new double[] {rMax, rMax, rMin, rMin}; - } - - // Clip the polygon. - ACoord coord = clipper.clipPolygon(h, v, h.length); - - // Copy it to negative v. - coord = new ACoord(coord, coord.mirrorV()); - if (eta0 > 0.0) { - // If it doesn't continue through h=0, copy it to negative h. - coord = new ACoord(coord, coord.mirrorH()); - } - - return coord; - } - - /** - * Returns the phi-rho geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getFRUser() { - double[][] hv = new double[2][]; - - hv[0] = new double[] {rMin, rMax, rMax, rMin}; - hv[1] = new double[] {360., 360., 0., 0.}; - - return new ACoord(hv); - } - - /** - * Returns the y-x geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getYXCell(int eta, int phi) { - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_STANDARD) return ACoord.NO_DATA; - double[][] hv = new double[2][]; - double phiMin = phi0+phi*deltaPhi; - double phiMax = phiMin+deltaPhi; - - hv[0] = new double[] {rMax*Math.cos(phiMin), rMax*Math.cos(phiMax), - rMin*Math.cos(phiMax), rMin*Math.cos(phiMin)}; - hv[1] = new double[] {rMax*Math.sin(phiMin), rMax*Math.sin(phiMax), - rMin*Math.sin(phiMax), rMin*Math.sin(phiMin)}; - - return new ACoord(hv); - } - - /** - * Returns the rho-z geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getRZCell(int eta, int phi, int side) { - double[][] hv = new double[2][]; - int sign = getRSign(phi); - - if (side != 0) side /= Math.abs(side); - - if (name.indexOf("TILE") >= 0) { - // Outer layer of TILE has eta increments of two. - if (sampling == 2) eta = minEta + (eta-minEta)/2; - - double etaMin = eta0+(eta-minEta)*deltaEta; - double etaMax = etaMin+deltaEta; - - if (name.indexOf("Barrel") >= 0 && sampling == 1) { - double dr = (rMax-rMin); - double r0 = rMin; - double r1 = rMin+dr/2.; - double r2 = rMax; - double z0 = (rMin+dr/4.) * Math.sinh(etaMin); - double z1 = (rMax-dr/4.) * Math.sinh(etaMin); - double z2 = (rMin+dr/4.) * Math.sinh(etaMax); - double z3 = (rMax-dr/4.) * Math.sinh(etaMax); - - if (eta == this.minEta && this.zMin > 0) z0 = z1 = this.zMin; - if (eta == this.minEta + this.numEta - 1) z2 = z3 = this.zMax; - - hv[0] = new double[] {z3, z1, z1, z0, z0, z2, z2, z3}; - hv[1] = new double[] {r2, r2, r1, r1, r0, r0, r1, r1}; - } else { - double zMin = (rMin+rMax)/2. * Math.sinh(etaMin); - double zMax = (rMin+rMax)/2. * Math.sinh(etaMax); - - if (eta == this.minEta && this.zMin > 0)zMin = this.zMin; - if (eta == this.minEta + this.numEta - 1) zMax = this.zMax; - - hv[0] = new double[] {zMax, zMin, zMin, zMax}; - hv[1] = new double[] {rMax, rMax, rMin, rMin}; - } - } else if (name.indexOf("LAr") >= 0) { - double etaMin = eta0+(eta-minEta)*deltaEta; - double etaMax = etaMin+deltaEta; - - hv[0] = new double[] {rMax*Math.sinh(etaMax), rMax*Math.sinh(etaMin), - rMin*Math.sinh(etaMin), rMin*Math.sinh(etaMax)}; - hv[1] = new double[] {rMax, rMax, rMin, rMin}; - } else { - return ACoord.NO_DATA; - } - - // Clip the cell and send it to the right quadrant. - ACoord coord = clipper.clipPolygon(hv[0], hv[1], hv[0].length); - for (int i=0; i<coord.hv[0][0].length; i++) { - coord.hv[0][0][i] *= side; - coord.hv[1][0][i] *= sign; - } - - return coord; - } - - /** - * Returns the eta-phi geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getVPCell(int eta, int phi, int side) { - double[][] hv = new double[2][]; - double etaMin = eta0+(eta-minEta)*deltaEta; - double etaMax = etaMin+deltaEta; - double phiMin = Math.toDegrees(phi0 + phi*deltaPhi); - double phiMax = phiMin + Math.toDegrees(deltaPhi); - - side /= Math.abs(side); - - hv[0] = new double[] {side*etaMax, side*etaMin, side*etaMin, side*etaMax}; - hv[1] = new double[] { phiMax, phiMax, phiMin, phiMin}; - - return new ACoord(hv); - } - - /** - * Returns the eta value of the center (in eta) of a cell. - * @param eta int eta index of the cell - * @param side int sign of the z coordinate of the cell - * @return double eta value - */ - public double getEta(int eta, int side) { - if (side < 0) { - return -getEta(eta, -side); - } else { - if (name.indexOf("TILE") >= 0) { - // Outer layer of TILE has eta increments of two. - if (sampling == 2) eta = minEta + (eta-minEta)/2; - } - - return eta0 + (eta - minEta + 0.5) * deltaEta; - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ABarrelSiliconDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ABarrelSiliconDetector.java deleted file mode 100755 index 14e53e77d059237b6cb5c277a5d2783d89234cd3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ABarrelSiliconDetector.java +++ /dev/null @@ -1,276 +0,0 @@ -package atlantis.geometry; - -import atlantis.canvas.AWindow; -import atlantis.data.AS3DData; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionYX; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -/** - * Class representing a pixel/SCT barrel detector part. - * Also implements methods to draw more detailed structure of the detector. - * - * @author Eric Jansen - */ -public class ABarrelSiliconDetector extends ADetector { - - private static List detectors = null; - - protected int layer; - protected double length; - protected double width; - protected double thickness; - protected int numZ; - protected int numPhi; - protected double tilt; - protected double r0; - protected double phi0; - protected double zMin; - protected double zMax; - - protected double deltaPhi; - protected double deltaZ; - protected double rMin; - protected double rMax; - - public ABarrelSiliconDetector(String name, String color, int layer, double length, double width, double thickness, - int numZ, int numPhi, double tilt, double r0, double phi0, double zMin, double zMax) { - super(name, " ", color); - - if (detectors == null) { - detectors = new ArrayList(); - } - detectors.add(this); - - this.layer = layer; - this.length = length; - this.width = width; - this.thickness = thickness; - this.numZ = numZ; - this.numPhi = numPhi; - this.tilt = Math.toRadians(tilt); - this.r0 = r0; - this.phi0 = Math.toRadians(phi0); - this.zMin = zMin; - this.zMax = zMax; - - this.deltaPhi = 2.*Math.PI / this.numPhi; - this.deltaZ = (this.zMax - this.zMin) / this.numZ; - - // We do not take thickness/2 and width/2 to have some extra margin - this.rMin = this.r0 - Math.abs(this.thickness*Math.cos(this.tilt)) - - Math.abs(this.width*Math.sin(this.tilt)); - this.rMax = this.r0 + Math.abs(this.thickness*Math.cos(this.tilt)) - + Math.abs(this.width*Math.sin(this.tilt)); - } - - /** - * Empties the list of instances of this class. - */ - public static void clear() { - if (detectors != null) { - detectors.clear(); - } - } - - /** - * This function draws the wafer/stave structure of the silicon detectors. It is called - * from ADetectorSystem.draw(). - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - */ - public static void drawAdditionalItems(AWindow window, AGraphics ag, AProjection2D projection) { - AParameter inDetDetail = parameterStore.getUnknown("Det", "SiliconDetail"); - if (inDetDetail != null && detectors != null && inDetDetail.getStatus()) { - for (int i=0; i<detectors.size(); i++) { - ACoord coord = ACoord.NO_DATA; - ABarrelSiliconDetector detector = (ABarrelSiliconDetector) detectors.get(i); - if (projection instanceof AProjectionYX) { - coord = detector.getYXDetail(); - } else if (projection instanceof AProjectionRZ) { - coord = detector.getRZDetail(); - } else if (projection instanceof AProjectionFZ) { - coord = detector.getFZDetail(); - } else if (projection instanceof AProjectionFR) { - coord = detector.getYXDetail().convertYXToFR().includePhiWrapAround("FR"); - } - - if (coord != ACoord.NO_DATA) { - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[parameterStore.get("Det", "SiliconDetail").getI()]); - - ACoord display = window.calculateDisplay(projection.nonLinearTransform(coord)); - for (int j=0; j<display.hv[0].length; j++) { - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - } - } - - /** - * Determines if this element should be visible or not. - * @return visibility - */ - protected boolean isVisible() { - int cut = parameterStore.get("CutsInDet", "SCT").getI(); - - if (cut == AS3DData.CUT_INDET_SCT_ALL || cut == AS3DData.CUT_INDET_SCT_BARREL) { - return true; - } else { - return false; - } - } - - /** - * Returns the detector outline in the y-x projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getYXUser() { - if (!isVisible()) { - return ACoord.NO_DATA; - } - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_STANDARD) { - return ACoord.NO_DATA; - } - - if (!globals.getUseOpenGL()) { - int numPoints = 2 * (numPhi + 1); - double[][] hv = new double[2][numPoints]; - - for (int i = 0; i < numPhi + 1; i++) { - hv[0][i] = rMin * Math.cos(phi0 + (i + 0.5) * deltaPhi); - hv[1][i] = rMin * Math.sin(phi0 + (i + 0.5) * deltaPhi); - - hv[0][numPhi + 1 + i] = rMax * Math.cos(phi0 - (i + 0.5) * deltaPhi); - hv[1][numPhi + 1 + i] = rMax * Math.sin(phi0 - (i + 0.5) * deltaPhi); - } - return new ACoord(hv); - } else { - return new ACoord(generateAnnulusTris(numPhi, phi0, rMin, rMax)); - } - } - - /** - * Returns the detector outline in the rho-z projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getRZUser() { - //if (!isVisible()) return ACoord.NO_DATA; - - double[][][] hv = new double[2][2][]; - - hv[0][0] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][1] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][1] = new double[] {-rMin, -rMin, -rMax, -rMax}; - - return new ACoord(hv); - } - - /** - * Returns the detector outline in the phi-z projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getFZUser() { - if (!isVisible()) return ACoord.NO_DATA; - - double[][] hv = new double[2][]; - - hv[0] = new double[] {zMax, zMin, zMin, zMax}; - hv[1] = new double[] {360., 360., 0., 0.}; - - return new ACoord(hv); - } - - /** - * Returns the detector outline in the phi-rho projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getFRUser() { - if (!isVisible()) return ACoord.NO_DATA; - - double[][] hv = new double[2][]; - - hv[0] = new double[] {rMin, rMax, rMax, rMin}; - hv[1] = new double[] {360., 360., 0., 0.}; - - return new ACoord(hv); - } - - /** - * Returns the wafer/stave structure in the y-x projection. - * @return ACoord polygons representing the wafers/staves - */ - protected ACoord getYXDetail() { - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_STANDARD) return ACoord.NO_DATA; - if (!isVisible()) return ACoord.NO_DATA; - - double[][][] hv = new double[2][numPhi][]; - for (int i=0; i<numPhi; i++) { - double phi = phi0 + i*deltaPhi; - - double x1 = r0*Math.cos(phi) + width/2.*Math.sin(phi+tilt) + thickness/2.*Math.cos(phi+tilt); - double x2 = r0*Math.cos(phi) - width/2.*Math.sin(phi+tilt) + thickness/2.*Math.cos(phi+tilt); - double x3 = r0*Math.cos(phi) - width/2.*Math.sin(phi+tilt) - thickness/2.*Math.cos(phi+tilt); - double x4 = r0*Math.cos(phi) + width/2.*Math.sin(phi+tilt) - thickness/2.*Math.cos(phi+tilt); - - double y1 = r0*Math.sin(phi) - width/2.*Math.cos(phi+tilt) + thickness/2.*Math.sin(phi+tilt); - double y2 = r0*Math.sin(phi) + width/2.*Math.cos(phi+tilt) + thickness/2.*Math.sin(phi+tilt); - double y3 = r0*Math.sin(phi) + width/2.*Math.cos(phi+tilt) - thickness/2.*Math.sin(phi+tilt); - double y4 = r0*Math.sin(phi) - width/2.*Math.cos(phi+tilt) - thickness/2.*Math.sin(phi+tilt); - - hv[0][i] = new double[] {x1, x2, x3, x4}; - hv[1][i] = new double[] {y1, y2, y3, y4}; - } - return new ACoord(hv); - } - - /** - * Returns the wafer/stave structure in the rho-z projection. - * @return ACoord polygons representing the wafers/staves - */ - protected ACoord getRZDetail() { - // if (!isVisible()) return ACoord.NO_DATA; - - double[][][] hv = new double[2][2*numZ][]; - - for (int i=0; i<numZ; i++) { - hv[0][i] = new double[] {zMin+(i+1)*deltaZ, zMin+i*deltaZ, zMin+i*deltaZ, zMin+(i+1)*deltaZ}; - hv[1][i] = new double[] {rMax, rMax, rMin, rMin}; - - hv[0][numZ+i] = new double[] {zMin+(i+1)*deltaZ, zMin+i*deltaZ, zMin+i*deltaZ, zMin+(i+1)*deltaZ}; - hv[1][numZ+i] = new double[] {-rMin, -rMin, -rMax, -rMax}; - } - return new ACoord(hv); - } - - /** - * Returns the wafer/stave structure in the phi-z projection. - * @return ACoord polygons representing the wafers/staves - */ - protected ACoord getFZDetail() { - if (!isVisible()) return ACoord.NO_DATA; - - // Phi geometry is a mess, draw only the staves in this projection. - double[][][] hv = new double[2][numZ+1][2]; - for (int i=0; i<=numZ; i++) { - hv[0][i][0] = zMin + i*deltaZ; - hv[1][i][0] = 360.; - hv[0][i][1] = zMin + i*deltaZ; - hv[1][i][1] = 0.; - } - - return new ACoord(hv).includePhiWrapAround("FZ"); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ABarrelTRTDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ABarrelTRTDetector.java deleted file mode 100755 index 8ccd0a795285c91a4e653b02023f28a55470d2f7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ABarrelTRTDetector.java +++ /dev/null @@ -1,184 +0,0 @@ -package atlantis.geometry; - -import atlantis.canvas.AWindow; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionYX; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -/** - * Class representing a TRT barrel detector part. - * Also implements methods to draw more detailed structure of the detector. - * - * @author Eric Jansen - */ -public class ABarrelTRTDetector extends ADetector { - - private static List detectors = null; - - protected int layer; - protected int numPhi; - protected double rMin; - protected double rMax; - protected double phiIn; - protected double phiOut; - protected double zMin; - protected double zMax; - protected double deltaPhi; - - public ABarrelTRTDetector(String name, String color, int layer, int numPhi, double rMin, double rMax, - double phiIn, double phiOut, double zMin, double zMax) { - super(name, " ", color); - - if (detectors == null) { - detectors = new ArrayList(); - } - detectors.add(this); - - this.layer = layer; - this.numPhi = numPhi; - this.rMin = rMin; - this.rMax = rMax; - this.phiIn = Math.toRadians(phiIn); - this.phiOut = Math.toRadians(phiOut); - this.zMin = zMin; - this.zMax = zMax; - - this.deltaPhi = 2.*Math.PI / numPhi; - } - - /** - * Empties the list of instances of this class. - */ - public static void clear() { - if (detectors != null) { - detectors.clear(); - } - } - - /** - * This function draws the module structure of the TRT detector. It is called - * from ADetectorSystem.draw(). - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - */ - public static void drawAdditionalItems(AWindow window, AGraphics ag, AProjection2D projection) { - AParameter inDetDetail = parameterStore.getUnknown("Det", "TRTDetail"); - if (inDetDetail != null && detectors != null && inDetDetail.getStatus()) { - for (int i=0; i<detectors.size(); i++) { - ACoord coord = ACoord.NO_DATA; - ABarrelTRTDetector detector = (ABarrelTRTDetector) detectors.get(i); - if (projection instanceof AProjectionYX) { - coord = detector.getYXDetail(); - } else if (projection instanceof AProjectionFR) { - coord = detector.getYXDetail().convertYXToFR().includePhiWrapAround("FR"); - } - - if (coord != ACoord.NO_DATA) { - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[parameterStore.get("Det", "TRTDetail").getI()]); - - ACoord display = window.calculateDisplay(projection.nonLinearTransform(coord)); - for (int j=0; j<display.hv[0].length; j++) { - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - } - } - - /** - * Returns the detector outline in the y-x projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getYXUser() { - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_STANDARD) return ACoord.NO_DATA; - - if (!globals.getUseOpenGL()) { - int numPoints = 2 * (numPhi + 1); - double[][] hv = new double[2][numPoints]; - - for (int i = 0; i < numPhi + 1; i++) { - hv[0][i] = rMin * Math.cos(phiIn + i * deltaPhi); - hv[1][i] = rMin * Math.sin(phiIn + i * deltaPhi); - - hv[0][numPhi + 1 + i] = rMax * Math.cos(phiOut - i * deltaPhi); - hv[1][numPhi + 1 + i] = rMax * Math.sin(phiOut - i * deltaPhi); - } - return new ACoord(hv); - } else { - return new ACoord(generateAnnulusTris(numPhi, phiIn, rMin, rMax)); - } - } - - /** - * Returns the detector outline in the rho-z projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getRZUser() { - double[][][] hv = new double[2][2][]; - - hv[0][0] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][1] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][1] = new double[] {-rMin, -rMin, -rMax, -rMax}; - - return new ACoord(hv); - } - - /** - * Returns the detector outline in the phi-z projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getFZUser() { - return ACoord.NO_DATA; - } - - /** - * Returns the detector outline in the phi-rho projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getFRUser() { - double[][] hv = new double[2][]; - - hv[0] = new double[] {rMin, rMax, rMax, rMin}; - hv[1] = new double[] {360., 360., 0., 0.}; - - return new ACoord(hv); - } - - /** - * Returns the module structure in the y-x projection. - * @return ACoord polygons representing the modules - */ - protected ACoord getYXDetail() { - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_STANDARD) return ACoord.NO_DATA; - - double[][][] hv = new double[2][numPhi][]; - for (int i=0; i<numPhi; i++) { - double phiMin = i*deltaPhi; - double phiMax = (i+1)*deltaPhi; - - double x1 = rMax*Math.cos(phiMin+phiOut); - double x2 = rMax*Math.cos(phiMax+phiOut); - double x3 = rMin*Math.cos(phiMax+phiIn); - double x4 = rMin*Math.cos(phiMin+phiIn); - - double y1 = rMax*Math.sin(phiMin+phiOut); - double y2 = rMax*Math.sin(phiMax+phiOut); - double y3 = rMin*Math.sin(phiMax+phiIn); - double y4 = rMin*Math.sin(phiMin+phiIn); - - hv[0][i] = new double[] {x1, x2, x3, x4}; - hv[1][i] = new double[] {y1, y2, y3, y4}; - } - return new ACoord(hv); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ABoxDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ABoxDetector.java deleted file mode 100755 index 68fda4c768eb77b2d176fbbd15a43521a9e04d1d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ABoxDetector.java +++ /dev/null @@ -1,172 +0,0 @@ -package atlantis.geometry; - -import atlantis.utils.AMath; -import atlantis.parameters.*; -import atlantis.graphics.ACoord; - -/** - * in ATLAS boxes are RPC and MDT in the barrel - */ - -public class ABoxDetector extends ADetector { - - double zMin; - double zMax; - double rMin; - double rMax; - double phi; - double excl; - double size; - String stationName; - int stationEta; - int stationPhi; - int sector; - - public ABoxDetector(String name, double zMin, double zMax, double rMin, - double rMax, double phi, double excl, double size, int stationEta, int stationPhi) { - super(name, " ", name.substring(0, 3)); - this.zMin=zMin; - this.zMax=zMax; - this.rMin=rMin; - this.rMax=rMax; - this.phi=phi; - this.excl=excl; - this.size=size; - this.stationName=name.substring(4, 7); - this.stationEta=stationEta; - this.stationPhi=stationPhi; - this.sector=((int)((phi+Math.PI/16)/(Math.PI/8)))%16; - } - - protected ACoord getFZUser() { - double cosPhi=Math.cos(phi); - double sinPhi=Math.sin(phi); - double d=size/2.; - double r=rMin; - double x=r*cosPhi-excl*sinPhi; - double y=r*sinPhi+excl*cosPhi; - double dsinPhi=d*sinPhi; - double dcosPhi=d*cosPhi; - double phi1=Math.toDegrees(Math.atan2(y-dcosPhi, x+dsinPhi)); - double phi2=Math.toDegrees(Math.atan2(y+dcosPhi, x-dsinPhi)); - - if(phi1<0.) phi1+=360.; - if(phi2<0.) phi2+=360.; - if(phi1-phi2>180.) phi1-=360.; - if(phi2-phi1>180.) phi2-=360.; - - return new ACoord(AMath.xBox((zMin+zMax)/2.,(zMax-zMin)/2.), - AMath.yBox((phi1+phi2)/2.,(phi1-phi2)/2.)); - } - - protected ACoord getRZUser() { - double phiMid=Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff=Math.abs(phi-phiMid); - double sign=-1.; - if(phiDiff<Math.PI/2.||phiDiff>3*Math.PI/2.) - sign=+1.; - return getXZRZUser(sign); - } - - protected ACoord getXZUser() { - AParameter p=parameterStore.get("XZ", "Phi"); - - // display muon data when phi is in the middle of a sector - if(p.getD() % 22.5 < 1e-2) { - int sect=(int)Math.round((p.getD() % 360.) / 22.5); - if(sector==sect) { - return getXZRZUser(1.); - } else if(sector==sect-8||sector==sect+8) { - return getXZRZUser(-1.); - } - } - return ACoord.NO_DATA; - } - - protected ACoord getXZRZUser(double sign) { - return new ACoord( - AMath.xBox( (zMin + zMax) / 2., (zMax - zMin) / 2.), - AMath.yBox( sign*(rMin + rMax) / 2., sign*(rMax - rMin) / 2.)); - } - - - protected ACoord getYXUser() { - return getYXUser(0); - } - - protected ACoord getFRUser() { - return convertYXToFR(getYXUser(1)); - } - - private ACoord getYXUser(int flag) { - int[] split= {12, 1, 12, 1}; - int numPoints=4; - boolean splitIt=parameterStore.get("YX", "FishEye").getStatus()||parameterStore.get("YX", "Clock").getStatus() - ||flag==1; - - if(splitIt) - numPoints=26; - double[] temp=new double[4]; - double[][] hv=new double[2][numPoints]; - double cosPhi=Math.cos(phi); - double sinPhi=Math.sin(phi); - double d=size/2.; - double r=rMin; - double x=r*cosPhi-excl*sinPhi; - double y=r*sinPhi+excl*cosPhi; - double dx=d*sinPhi; - double dy=d*cosPhi; - - hv[0][0]=x+dx; - hv[1][0]=y-dy; - hv[0][1]=x-dx; - hv[1][1]=y+dy; - r=rMax; - x=r*cosPhi-excl*sinPhi; - y=r*sinPhi+excl*cosPhi; - - hv[0][3]=x+dx; - hv[1][3]=y-dy; - hv[0][2]=x-dx; - hv[1][2]=y+dy; - if(splitIt) - for(int j=0; j<2; ++j) { - for(int k=0; k<4; ++k) - temp[k]=hv[j][k]; - AMath.splitArrayIntoPieces(temp, hv[j], split); - } - return new ACoord(hv); - } - - protected boolean equalsYX(ADetector o) { - if (o instanceof ABoxDetector) { - ABoxDetector that = (ABoxDetector) o; - return this.rMin == that.rMin && - this.rMax == that.rMax && - this.phi == that.phi && - this.size == that.size && - this.excl == that.excl; - } else - return false; - } - - protected boolean equalsRZ(ADetector o) { - if (o instanceof ABoxDetector) { - ABoxDetector that = (ABoxDetector) o; - return this.rMin == that.rMin && - this.rMax == that.rMax && - this.zMin == that.zMin && - this.zMax == that.zMax; - } else - return false; - } - - public double getZMin() { return zMin; } - public double getZMax() { return zMax; } - public double getRMin() { return rMin; } - public double getRMax() { return rMax; } - public double getPhi() { return phi; } - public double getSize() { return size; } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ABoxDetectors.java b/graphics/AtlantisJava/src/atlantis/geometry/ABoxDetectors.java deleted file mode 100755 index a4b10b150709f791392c024e0f668109dc660c1f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ABoxDetectors.java +++ /dev/null @@ -1,168 +0,0 @@ -package atlantis.geometry; - -import atlantis.parameters.AParameter; -import atlantis.parameters.APar; -import atlantis.utils.AMath; -import java.util.*; - - -/** - * ABoxDetector's contains all instances of ABoxDetector. - * In different projections not all Boxes need to be drawn - * as they may exactly overlap. Filling of these areas is - * slow, so only the Boxes needed are drawn in each projection. - * (That is why boxes are group into ABoxDetectors) - * This is achieved by making a drawlist before drawing. - */ -public final class ABoxDetectors extends ADetectors { - - private int numRZTypes; - private int[] typeRZ; - private int numYXTypes; - private int[] typeYX; - - private ABoxDetector[] box; - - public ABoxDetectors(List detectors) { - super(filterBoxDetectors(detectors)); - box= new ABoxDetector[det.length]; - for(int i=0;i<box.length;++i) - box[i]=(ABoxDetector)det[i]; - - typeYX=new int[numData]; - for(int i=0; i<numData; ++i) - typeYX[i]=-1; - - numYXTypes=0; - for(int i=0; i<numData; ++i) - if(typeYX[i]==-1) { - typeYX[i]=numYXTypes; - for(int j=i+1; j<numData; ++j) - if(typeYX[j]==-1&&det[i].equalsYX(det[j])) - typeYX[j]=numYXTypes; - numYXTypes++; - } - - typeRZ=new int[numData]; - for(int i=0; i<numData; ++i) - typeRZ[i]=-1; - - numRZTypes=0; - for(int i=0; i<numData; ++i) - if(typeRZ[i]==-1) { - typeRZ[i]=numRZTypes; - for(int j=i+1; j<numData; ++j) - if(typeRZ[j]==-1&&det[i].equalsRZ(det[j])) - typeRZ[j]=numRZTypes; - numRZTypes++; - } - } - - private static ADetector[] filterBoxDetectors(List detectors) { - - List tempDetectors=new ArrayList(detectors.size()); - Iterator it=detectors.iterator(); - - while(it.hasNext()) { - Object o=it.next(); - if(o instanceof ABoxDetector || o instanceof ATBxDetector) tempDetectors.add(o); - } - return (ADetector[])tempDetectors.toArray(new ADetector[tempDetectors.size()]); - } - - private void makeDrawListYX() { - int mode=parameterStore.get("YX", "Mode").getI(); - - if(mode==0) { - numDraw=numYXTypes; - for(int i=0; i<numData; ++i) - listdl[typeYX[i]]=i; - } else - numDraw=0; - } - - private void makeDrawListXZ() { - AParameter p=parameterStore.get("XZ", "Phi"); - - // display muon data when phi is in the middle of a sector - if(p.getD() % 22.5 < 1e-2) { - int sect=(int)Math.round((p.getD() % 360.) / 22.5); - int num=0; - for(int i=0; i<numData; i++) { - int s=box[i].sector; - if(s==sect||s==sect-8||s==sect+8) { - listdl[num++]=i; - } - } - numDraw=num; - } else { - numDraw=0; - } - } - - private void makeDrawListRZ() { - // first make the draw list - // for each type find out if it has both +ve and negative sign - int[] pos=new int[typeRZ.length]; - int[] neg=new int[typeRZ.length]; - double phiMid=Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - - for(int i=0; i<numRZTypes; ++i) - neg[i]=pos[i]=-1; - - for(int i=0; i<numData; ++i) { - double phiDiff=Math.abs(box[i].phi-phiMid); - - if(phiDiff<Math.PI/2.||phiDiff>3*Math.PI/2.) - pos[typeRZ[i]]=i; - else - neg[typeRZ[i]]=i; - } - - int num=0; - for(int i=0; i<numRZTypes; ++i) { - if(pos[i]!=-1) - listdl[num++]=pos[i]; - if(neg[i]!=-1) - listdl[num++]=neg[i]; - } - numDraw=num; - } - - private void makeDrawListFZ() { - int mode=parameterStore.get("FZ", "Mode").getI(); - - if(mode==0) - numDraw=0; - else { - int num=0; - - for(int i=0; i<numData; ++i) { - char type=det[i].getName().charAt(0); - char station=det[i].getName().charAt(5); - char io=det[i].getName().charAt(det[i].getName().length()-1); - - if((mode==1&&station=='M'&&io=='I'&&type=='R')||(mode==2&&station=='M'&&io=='O'&&type=='R') - ||(mode==3&&station=='O'&&type=='R')||(mode==4&&(station=='I'||station=='E')&&type=='M') - ||(mode==5&&station=='M'&&type=='M')||(mode==6&&station=='O'&&type=='M')) - listdl[num++]=i; - numDraw=num; - } - } - } - - protected void makeDrawList(String projection) { - if (projection.equals("YX") || projection.equals("FR") ) - makeDrawListYX(); - else if (projection.equals("FZ")) - makeDrawListFZ(); - else if (projection.equals("RZ")) - makeDrawListRZ(); - else if (projection.equals("XZ")) - makeDrawListXZ(); - else - numDraw=0; - } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ACalorimeterDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ACalorimeterDetector.java deleted file mode 100755 index da80146936d7ec90dfccee3994b0d0733d299dd4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ACalorimeterDetector.java +++ /dev/null @@ -1,699 +0,0 @@ -package atlantis.geometry; - -import atlantis.canvas.AWindow; -import atlantis.graphics.ACoord; -import atlantis.graphics.AClipper; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AIdHelper; -import atlantis.utils.AMath; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionYX; -import java.awt.Color; -import java.util.List; -import java.util.ArrayList; - -/** - * Abstract class representing a region of a certain sampling of a ATLAS - * calorimeter. Based on the parameters given to the constructor, the - * derived classes should be able to calculate the geometrical properties - * of the cells they contain. This behavior is required for drawing the data. - * - * @author Eric Jansen - */ -abstract public class ACalorimeterDetector extends ADetector { - - // Keep a static list of instances for easy access - protected static List detectors = null; - - // These arrays are used for fast cell to detector mapping. - protected static int[][][] lar = null; - protected static int[][] hec = null; - protected static int[] tile = null; - protected static int[] tile_ext = null; - protected static int[][] tile_gap = null; - protected static int[] mbts = null; - - protected int sampling; - protected int region; - protected double rMin; - protected double rMax; - protected double zMin; - protected double zMax; - protected double phi0; - protected int numPhi; - protected double deltaPhi; - protected double eta0; - protected double deltaEta; - protected int numEta; - protected int minEta; - - protected double detEtaMin; - protected double detEtaMax; - protected AClipper clipper; - - /** - * Constructs a new calorimeter object. - * @param name String name of the object - * @param color String name of the color used to draw this object - */ - public ACalorimeterDetector(String name, String color) { - super(name, " ", color); - - if (detectors == null) { - detectors = new ArrayList(40); - - // These numbers correspond to the maximum number of values that can - // be encoded in the identifier. - lar = new int[4][4][8]; - hec = new int[4][2]; - tile = new int[16]; - tile_ext = new int[16]; - tile_gap = new int[16][64]; - mbts = new int[2]; - - // Initialize them to -1, which means no detector element known. - for (int i=0; i<lar.length; i++) - for (int j=0; j<lar[i].length; j++) - for (int k=0; k<lar[i][j].length; k++) - lar[i][j][k] = -1; - - for (int i=0; i<hec.length; i++) - for (int j=0; j<hec[i].length; j++) - hec[i][j] = -1; - - for (int i=0; i<tile.length; i++) - tile[i] = -1; - - for (int i=0; i<tile_ext.length; i++) - tile_ext[i] = -1; - - for (int i=0; i<tile_gap.length; i++) - for (int j=0; j<tile_gap[i].length; j++) - tile_gap[i][j] = -1; - - for (int i=0; i<mbts.length; i++) - mbts[i] = -1; - } - - detectors.add(this); - } - - /** - * Returns one of the instances of this class. - * @param index int index of instance - * @return ACalorimeterDetector instance at the requested index - */ - public static ACalorimeterDetector get(int index) { - return (ACalorimeterDetector) detectors.get(index); - } - - /** - * Shows the number of instances of this class that have been created. - * @return int number of instances - */ - public static int count() { - if (detectors != null) { - return detectors.size(); - } else { - return 0; - } - } - - /** - * This functions maps the calorimeter cells to a geometry object. In principle we could - * compare every cell to every geometry object, but that would be too slow. Therefore we - * organize the geometry in an array structure. - * @param id int identifier of a cell - * @return int index of the geometry object in the detector array - */ - public static int getDetectorIndex(int id) { - if (detectors == null) return -1; - - try { - switch (AIdHelper.subDetector(id)) { - case 4: - switch (AIdHelper.larPart(id)) { - case 1: - // LAr EM - return lar[Math.abs(AIdHelper.larBarrelEndcap(id))] - [AIdHelper.larSampling(id)][AIdHelper.larRegion(id)]; - case 2: - // HEC - return hec[AIdHelper.larSampling(id)][AIdHelper.larRegion(id)]; - case 3: - // FCAL - return -1; - default: - return -1; - } - case 5: - switch (AIdHelper.tileSection(id)) { - case 1: - // TILE barrel - return tile[AIdHelper.tileSampling(id)]; - case 2: - // TILE extended barrel - return tile_ext[AIdHelper.tileSampling(id)]; - case 3: - // ITC gap/crack - return tile_gap[AIdHelper.tileSampling(id)][AIdHelper.tileTower(id)]; - case 4: - // MBTS - return -1; - default: - return -1; - } - default: - return -1; - } - } catch (AAtlantisException e) { - return -1; - } - } - - /** - * Clear the list of instances. This is called before reading another geometry file. - */ - public static void clear() { - if (detectors != null) { - detectors.clear(); - } - detectors = null; - lar = null; - hec = null; - tile = null; - tile_ext = null; - tile_gap = null; - mbts = null; - } - - /** - * Get the outline of a certain cell in a certain projection. - * @param projection AProjection projection - * @param eta int eta index of the cell - * @param phi int phi index of the cell - * @param side int side sign of the z coordinate of the cell - * @return ACoord cell outline - */ - public ACoord getCell(AProjection projection, int eta, int phi, int side) { - if (projection instanceof AProjectionYX) { - return getYXCell(eta, phi); - } else if (projection instanceof AProjectionRZ) { - return getRZCell(eta, phi, side); - } else if (projection instanceof AProjectionFR) { - return getFRCell(eta, phi); - } else if (projection instanceof AProjectionFZ) { - return getFZCell(eta, phi, side); - } else if (projection instanceof AProjectionVP) { - return getVPCell(eta, phi, side); - } else { - return ACoord.NO_DATA; - } - } - - /** - * Returns the y-x geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getYXCell(int eta, int phi) { - return ACoord.NO_DATA; - } - - /** - * Returns the rho-z geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getRZCell(int eta, int phi, int side) { - return ACoord.NO_DATA; - } - - /** - * Returns the phi-rho geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getFRCell(int eta, int phi) { - return convertYXToFR(getYXCell(eta, phi)); - } - - /** - * Returns the phi-z geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord - */ - public ACoord getFZCell(int eta, int phi, int side) { - return ACoord.NO_DATA; - } - - /** - * Returns the eta-phi geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getVPCell(int eta, int phi, int side) { - return ACoord.NO_DATA; - } - - /** - * Returns the eta value of the center (in eta) of a cell. - * @param eta int eta index of the cell - * @param side int sign of the z coordinate of the cell - * @return double eta value - */ - public double getEta(int eta, int side) { - if (side < 0) { - return -getEta(eta, -side); - } else { - return eta0 + (eta - minEta + 0.5) * deltaEta; - } - } - - /** - * Returns the lowest eta value of a cell. - * @param eta int eta index of the cell - * @param side int sign of the z coordinate of the cell - * @return double lowest eta value - */ - public double getEtaMin(int eta, int side) { - if (side < 0) { - return -getEtaMax(eta, -side); - } else { - return eta0 + (eta - minEta) * deltaEta; - } - } - - /** - * Returns the highest eta value of a cell. - * @param eta int eta index of the cell - * @param side int sign of the z coordinate of the cell - * @return double highest eta value - */ - public double getEtaMax(int eta, int side) { - if (side < 0) { - return -getEtaMin(eta, -side); - } else { - return eta0 + (eta - minEta + 1) * deltaEta; - } - } - - /** - * Returns the phi value of the center of a cell. - * @param phi int phi index of the cell - * @return double phi value - */ - public double getPhi(int phi) { - return phi0 + (phi + 0.5) * deltaPhi; - } - - /** - * Returns the lowest phi value of a cell. - * @param phi int phi index of the cell - * @return double lowest phi value - */ - public double getPhiMin(int phi) { - return phi0 + phi * deltaPhi; - } - - /** - * Returns the highest phi value of a cell. - * @param phi int phi index of the cell - * @return double highest phi value - */ - public double getPhiMax(int phi) { - return phi0 + (phi + 1) * deltaPhi; - } - - /** - * Determines on which side a certain cell should be drawn in the RZ projection, - * based on the phi angle the user has set in the menu. - * @param phi int phi index of the cell - * @return int 1 or -1, meaning top or bottom repectively - */ - public int getRSign(int phi) { - double cellPhi = phi0 + phi*deltaPhi + deltaPhi/2.; - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(cellPhi-phiMid); - if (phiDiff <= Math.PI/2.|| phiDiff > 3*Math.PI/2.) { - return 1; - } else { - return -1; - } - } - - /** - * Returns the number of cells in phi for this calorimeter part. - * @return int number of cells in phi - */ - public int getNumPhi() { - return numPhi; - } - - /** - * Returns the size of a cell in phi for this calorimeter part (this is the same for all cells). - * @return double size of a cell in radians - */ - public double getDeltaPhi() { - return deltaPhi; - } - - /** - * Returns the number of cells in eta for this calorimeter part. - * @return double number of cells in eta - */ - public int getNumEta() { - return numEta; - } - - /** - * Returns the size of a cell in eta for this calorimeter part (this is the same for all cells). - * @return double size of a cell in eta - */ - public double getDeltaEta() { - return deltaEta; - } - - /** - * Returns the center radius of the calorimeter part. - * @return double center radius - */ - public double getR() { - return (rMin+rMax)/2.; - } - - /** - * Returns the inner radius of the calorimter part. - * @return double inner radius - */ - public double getRMin() { - return rMin; - } - - /** - * Returns the outer radius of the calorimeter part. - * @return double outer radius - */ - public double getRMax() { - return rMax; - } - - /** - * Returns the center z of the calorimeter part. - * @return double center z - */ - public double getZ() { - return (zMin+zMax)/2.f; - } - - /** - * Returns the inner z of the calorimeter part. - * @return double inner z - */ - public double getZMin() { - return zMin; - } - - /** - * Returns the outer z of the calorimter part. - * @return double outer z - */ - public double getZMax() { - return zMax; - } - - /** - * Returns the inner eta of the calorimeter part. - * @return double inner eta - */ - public double getEtaMin() { - return eta0; - } - - /** - * Returns the outer eta of the calorimeter part. - * @return double outer eta - */ - public double getEtaMax() { - return eta0 + numEta*deltaEta; - } - - /** - * Returns the sampling of the calorimeter part. This corresponds to the layers of the calorimeter. - * @return int sampling - */ - public int getSampling() { - return sampling; - } - - /** - * Returns the region of this calorimeter part. Within a layer a new region is started when the - * size of the cells changes. - * @return int region - */ - public int getRegion() { - return region; - } - - /** - * Returns the eta index of the first cell in eta for this calorimeter part. - * @return int eta - */ - public int getFirstEta() { - return minEta; - } - - /** - * Returns the eta index of the last cell in eta for this calorimeter part. - * @return int eta - */ - public int getLastEta() { - if (sampling == 2 && name.indexOf("TILE") >= 0) - return minEta + 2*numEta; - else - return minEta + numEta-1; - } - - /** - * Returns the phi index of the first cell in phi for this calorimeter part. - * @return int phi - */ - public int getFirstPhi() { - // This is always 0, still we provide this method for consistency. - return 0; - } - - /** - * Returns the phi index of the last cell in phi for this calorimeter part. - * @return int phi - */ - public int getLastPhi() { - return numPhi-1; - } - - /** - * This function draws the module structure of the calorimeter. It is called - * from ADetectorSystem.draw(). - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - */ - public static void drawAdditionalItems(AWindow window, AGraphics ag, AProjection2D projection) { - AParameter caloDetail = parameterStore.getUnknown("Det", "CaloDetail"); - if (caloDetail != null && detectors != null && caloDetail.getStatus()) - { - for (int i=0; i<detectors.size(); i++) - { - ACalorimeterDetector detector = (ACalorimeterDetector) detectors.get(i); - - // Only draw region 0 in YX, not the few different cells at the ends - if ((projection instanceof AProjectionYX && detector.getRegion() == 0) || projection instanceof AProjectionFR) - { - int start; - int mode = parameterStore.get("YX", "Mode").getI(); - if(mode==AProjectionYX.MODE_STANDARD) - //only needs one eta for standard view - start = detector.getFirstEta(); - else if(mode>=AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER && mode <=AProjectionYX.MODE_HEC_4) - //need to loop over eta for endcaps - start = detector.getLastEta(); - else - start=0; - if(mode==AProjectionYX.MODE_STANDARD || (mode>=AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER && mode <=AProjectionYX.MODE_HEC_4) || mode==AProjectionYX.MODE_MBTS) - { - for (int eta=start; eta>=detector.getFirstEta(); eta--) - { - for (int phi=detector.getFirstPhi(); phi<=detector.getLastPhi(); phi++) - { - ACoord coord = detector.getCell(projection, eta, phi, 1); - if (coord != ACoord.NO_DATA) { - ACoord display; - if (projection instanceof AProjectionYX) - display = window.calculateDisplay(projection.nonLinearTransform(coord)); - else - display = window.calculateDisplay(projection.nonLinearTransform( - coord.includePhiWrapAround("FR")) - ); - - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[parameterStore.get("Det", "CaloDetail").getI()]); - - for (int j=0; j<display.hv[0].length; j++) - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - } - else if((mode==AProjectionYX.MODE_LAR_ENDCAP_SUMMED && (detector.getName().equals("LAr Endcap Presampler")||detector.getName().equals("LAr_EC_Presampler"))) - || (mode==AProjectionYX.MODE_HEC_SUMMED && detector.getName().equals("HEC") && detector.getSampling()==0)) - { - //For summed endcaps only need to do this once - //The cells match the bining used but are not specific to the detector - //hence they do not all lie inside the detector - double etaBin=0.1,phiBin=(2*Math.PI/64); - int binvalue; - if(mode==AProjectionYX.MODE_HEC_SUMMED) - { - binvalue = parameterStore.get("YX", "HECBin").getI(); - } - else - { - binvalue = parameterStore.get("YX", "LArBin").getI(); - } - if(binvalue==3) - { - etaBin=0.1; - phiBin=(2*Math.PI/64); - } - else - { - etaBin*=binvalue; - phiBin*=binvalue; - } - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[parameterStore.get("Det", "CaloDetail").getI()]); - double firstZMin=detector.getZMin(); - //check etaSplit is set correct - if(binvalue==3) - { - setEtaSplit(); - } - //loop between values greater and less than the actual size - for(double Eta=1.2; Eta<3.3; Eta+=etaBin) - { - if(binvalue==3 && Eta>=parameterStore.get("YX", "SplitEta").getD()) - { - etaBin=0.2; - phiBin=(2*Math.PI/32); - } - double RMax=firstZMin/Math.sinh(Eta); - double RMin=firstZMin/Math.sinh(Eta+etaBin); - for(double Phi=0.0; Phi<(2*Math.PI); Phi+=phiBin) - { - double[][] hv = new double[2][]; - hv[0] = new double[] {RMax*Math.cos(Phi), RMax*Math.cos(Phi+phiBin), - RMin*Math.cos(Phi+phiBin), RMin*Math.cos(Phi)}; - hv[1] = new double[] {RMax*Math.sin(Phi), RMax*Math.sin(Phi+phiBin), - RMin*Math.sin(Phi+phiBin), RMin*Math.sin(Phi)}; - - ACoord coord = new ACoord(hv); - ACoord display; - - if (projection instanceof AProjectionYX) - display = window.calculateDisplay(projection.nonLinearTransform(coord)); - else - display = window.calculateDisplay(projection.nonLinearTransform( - coord.convertYXToFR().includePhiWrapAround("FR")) - ); - for(int j=0; j<display.hv[0].length; j++) - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - - } - else if (projection instanceof AProjectionRZ) - { - for (int eta=detector.getFirstEta(); eta<=detector.getLastEta(); eta++) - { - - for (int phi=detector.getFirstPhi(); - phi<=detector.getFirstPhi()+detector.getNumPhi()/2; - phi+=detector.getNumPhi()/2) - { - - for (int side=-1; side<=1; side+=2) { - ACoord coord = detector.getCell(projection, eta, phi, side); - - if (coord != ACoord.NO_DATA) - { - ACoord display = window.calculateDisplay(projection.nonLinearTransform(coord)); - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[parameterStore.get("Det", "CaloDetail").getI()]); - ag.drawPolygon(display.hv[0][0], display.hv[1][0], display.hv[0][0].length); - } - } - } - } - } - else if (projection instanceof AProjectionFZ) - { - int eta = detector.getFirstEta(); - - for (int phi=detector.getFirstPhi(); phi<=detector.getLastPhi(); phi++) - { - for (int side=-1; side<=1; side+=2) - { - ACoord coord = detector.getCell(projection, eta, phi, side).includePhiWrapAround("FZ"); - - if (coord != ACoord.NO_DATA) - { - ACoord display = window.calculateDisplay(projection.nonLinearTransform(coord)); - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[parameterStore.get("Det", "CaloDetail").getI()]); - - for (int j=0; j<display.hv[0].length; j++) - { - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - } - } - } - } - } - - /** - * This function sets the value of EtaSplit to a minimum of 1.2 and - * to an accuracy of 1 decimal place - * 1.2 is minimum as is minimum of where cells outline is drawn - */ - public static void setEtaSplit() { - if(parameterStore.get("YX", "SplitEta").getD()<1.2) - parameterStore.get("YX", "SplitEta").setD(1.2); - else - { - int temp=(int) Math.floor(parameterStore.get("YX", "SplitEta").getD()*10.0); - parameterStore.get("YX", "SplitEta").setD(temp/10.0); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ADetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ADetector.java deleted file mode 100755 index b7196bfe34a709856fc65bc4567e3e3f500f3e85..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ADetector.java +++ /dev/null @@ -1,157 +0,0 @@ -package atlantis.geometry; - -import atlantis.parameters.AParameter; -import atlantis.parameters.APar; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; - -/** - * Base class of all individual detectors - */ - -public abstract class ADetector { - - String name; - String projection; - String color; - AParameter fillColorParameter; - - protected static APar parameterStore = APar.instance(); - protected static AGlobals globals = AGlobals.instance(); - - final static protected double[][] NO_DETECTORS=new double[2][0]; - - ADetector(String name, String projection, String color) { - this.name=name; - this.projection=projection; - this.color=color; - fillColorParameter=APar.instance().get("Det", color+"Fill"); - } - - protected ACoord getYXUser() { - return ACoord.NO_DATA; - } - - protected ACoord getRZUser() { - return ACoord.NO_DATA; - } - - protected ACoord getYZUser() { - return ACoord.NO_DATA; - } - - protected ACoord getXZUser() { - return ACoord.NO_DATA; - } - - protected ACoord getFRUser() { - return ACoord.NO_DATA; - } - - protected ACoord getFZUser() { - return ACoord.NO_DATA; - } - - protected ACoord getVPUser() { - return ACoord.NO_DATA; - } - - protected ACoord getUser(String projection) { - if (projection.equals("YX")) - return getYXUser(); - else if (projection.equals("RZ")) - return getRZUser(); - else if (projection.equals("XZ")) - return getXZUser(); - else if (projection.equals("YZ")) - return getYZUser(); - else if (projection.equals("FZ")) - return getFZUser(); - else if (projection.equals("FR")) - return getFRUser(); - else if (projection.equals("VP")) - return getVPUser(); - else - return ACoord.NO_DATA; - } - - public String getName() { - return name; - } - - public int getFillColor() { - return fillColorParameter.getI(); - } - - protected boolean getDraw() { - return fillColorParameter.getStatus(); - } - - protected boolean equalsYX(ADetector that) { - return false; - } - - protected boolean equalsRZ(ADetector that) { - return false; - } - - protected ACoord convertYXToFR(ACoord coord) { - double phiLast=0.; - - for (int i=0; i<coord.hv[0].length; i++) { - for (int j=0; j<coord.hv[0][i].length; j++) { - double xx=coord.hv[0][i][j]; - double yy=coord.hv[1][i][j]; - double rho=Math.sqrt(xx*xx+yy*yy); - double phi=Math.toDegrees(Math.atan2(yy, xx)); - - if(phi<0.) - phi+=360.; - if(j>0) { - if(phi-phiLast>180.) phi-=360.; - if(phi-phiLast<-180.) phi+=360.; - } - coord.hv[0][i][j]=rho; - coord.hv[1][i][j]=phi; - phiLast=phi; - } - } - - return coord; - } - - protected double[][][] generateAnnulusTris(int numPhi, double phi0, - double rMin, double rMax) { - - //rMin *= 1.02; - - int numTris = 2 * (numPhi); - double[][][] hv = new double[2][numTris][3]; - - double deltaPhi = 2. * Math.PI / numPhi; - - for (int i = 0; i < numPhi; i++) { - hv[0][i][0] = rMax * Math.cos(phi0 + i * deltaPhi); - hv[1][i][0] = rMax * Math.sin(phi0 + i * deltaPhi); - - hv[0][i][1] = rMax * Math.cos(phi0 + (i + 1) * deltaPhi); - hv[1][i][1] = rMax * Math.sin(phi0 + (i + 1) * deltaPhi); - - float midi = ((float) i) + 0.5f; - hv[0][i][2] = rMin * Math.cos(phi0 + midi * deltaPhi); - hv[1][i][2] = rMin * Math.sin(phi0 + midi * deltaPhi); - - int offi = i + (numPhi); - hv[0][offi][0] = rMin * Math.cos(phi0 + midi * deltaPhi); - hv[1][offi][0] = rMin * Math.sin(phi0 + midi * deltaPhi); - - hv[0][offi][1] = rMax * Math.cos(phi0 + (i + 1) * deltaPhi); - hv[1][offi][1] = rMax * Math.sin(phi0 + (i + 1) * deltaPhi); - - hv[0][offi][2] = rMin * Math.cos(phi0 + (midi + 1) * deltaPhi); - hv[1][offi][2] = rMin * Math.sin(phi0 + (midi + 1) * deltaPhi); - } - - return hv; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ADetectorSystem.java b/graphics/AtlantisJava/src/atlantis/geometry/ADetectorSystem.java deleted file mode 100755 index e0c93a93856d7b4062e47e6d5a834f46482a6fe8..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ADetectorSystem.java +++ /dev/null @@ -1,122 +0,0 @@ -package atlantis.geometry; - - -import java.awt.*; - -import atlantis.canvas.*; -import atlantis.graphics.*; -import atlantis.graphics.colormap.AColorMap; -import atlantis.gui.*; -import atlantis.parameters.*; -import atlantis.projection.*; - - -public class ADetectorSystem -{ - - private ADetectors[] detectors; - protected static String geometryName = null; - - protected static APar parameterStore = APar.instance(); - - ADetectorSystem(ADetectors[] detectors) - { - this.detectors=detectors; - } - - public ADetectors[] getDetectors() - { - return detectors; - } - - // The whole of atlas is drawn in one loop to avoid problem with frames - // overlapping - - - public void draw(AWindow window, AGraphics ag, AProjection2D projection) - { - if(!parameterStore.get("Det", "Detectors").getStatus()) return; - boolean drawFrames=parameterStore.get("Det", "HideDetectors").getStatus(); - //also draw frames for Grey/BW color maps - boolean colorBW=AColorMap.drawFrames(); - Color[] colorMap=AColorMap.getColors(); - ADetectors[] detectors=getDetectors(); - ACoord[] display=new ACoord[detectors.length]; - int[][] index=new int[detectors.length][]; - int[][] detColor=new int[detectors.length][]; - boolean[][] draw=new boolean[detectors.length][]; - int bkgColor = parameterStore.get("Color","BkgFill").getI(); - - for(int det=0; det<detectors.length; ++det) { - display[det]=window.calculateDisplay(detectors[det].getUser(projection)); - index[det]=display[det].index; - detColor[det]=detectors[det].getColor(index[det]); - draw[det]=detectors[det].getDraw(index[det]); - } - - boolean modeSelection = parameterStore.get(projection.getName(), "Mode").getI()==0 - ||(parameterStore.get(projection.getName(), "Mode").getI()>8 - &&(projection instanceof AProjectionYX||projection instanceof AProjectionFR)); - - for(int layer=0; layer<2; ++layer) - { - for(int det=0; det<detectors.length; ++det) - { - ADrawParameters dp=detectors[det].getDrawParameters(layer, 0); - ag.updateDrawParameters(dp); - for(int i=0; i<display[det].hv[0].length; ++i) - { - int numPoints=display[det].hv[0][i].length; - ag.setColor(colorMap[detColor[det][i]]); - if(draw[det][i]&& numPoints>0) - { - if(modeSelection) - { - if(layer==0 && (drawFrames||colorBW)) - { - if(colorBW) - ag.setColor(colorMap[AColorMap.BK]); - ag.drawPolygon(display[det].hv[0][i], display[det].hv[1][i], numPoints); - } - else if(layer==1) - { - if(drawFrames) - ag.setColor(colorMap[bkgColor]); - ag.fillPolygon(detectors[det], index[det][i], display[det].hv[0][i], - display[det].hv[1][i], numPoints); - } - } - else - { - if(layer==0) - { - if(drawFrames) - ag.setColor(colorMap[bkgColor]); - ag.fillPolygon(detectors[det], index[det][i], display[det].hv[0][i], - display[det].hv[1][i], numPoints); - } - else if(layer==1 && (drawFrames||colorBW)) - { - if(colorBW) - ag.setColor(colorMap[AColorMap.BK]); - ag.drawPolygon(display[det].hv[0][i], display[det].hv[1][i], numPoints); - } - } - } - } - } - } - ABarrelSiliconDetector.drawAdditionalItems(window, ag, projection); - AEndcapSiliconDetector.drawAdditionalItems(window, ag, projection); - ABarrelTRTDetector.drawAdditionalItems(window, ag, projection); - AEndcapTRTDetector.drawAdditionalItems(window, ag, projection); - ACalorimeterDetector.drawAdditionalItems(window, ag, projection); - } - - public static String getGeometryName() - { - return geometryName == null ? "n/a" : geometryName; - - } // getName() ------------------------------------------------------------ - -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ADetectors.java b/graphics/AtlantisJava/src/atlantis/geometry/ADetectors.java deleted file mode 100755 index 1f11913e80d18965ea1ab08ef6c10f3fe5154282..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ADetectors.java +++ /dev/null @@ -1,114 +0,0 @@ -package atlantis.geometry; - -import atlantis.graphics.*; -import atlantis.parameters.APar; -import atlantis.projection.*; - -/** - * Base class of all collections of detectors - * All non muon geometry is in AGeometry.xml - * All muon geometry is in AMuonGeometry.xml - * ADetectors is the interface to the rest of the program and contains - * collections of detectors. - * When a line in our XML file describes several detectors these are stored - * individually. - */ -public abstract class ADetectors { - - protected ADetector[] det=null; - - protected int[] listdl; - protected int numDraw; - protected int numData; - - protected static APar parameterStore = APar.instance(); - - public ADetectors(ADetector[] det) { - this.det=det; - numData=det.length; - numDraw=0; - listdl=new int[numData]; - } - - public ADetector[] getDetectors() { - return det; - } - - protected void constructDefaultDrawList() { - numDraw=numData; - for(int i=0; i<numDraw; ++i) - listdl[i]=i; - } - - protected void makeDrawList(String projection){ - constructDefaultDrawList(); - } - - protected ACoord getUser(String projection) { - makeDrawList(projection); - int[] numPoly = new int[numDraw]; - int numTotal = 0; - for (int i=0; i<numDraw; i++) { - int len = det[listdl[i]].getUser(projection).hv[0].length; - numPoly[i] = len; - numTotal += len; - } - double[][][] hv = new double[2][numTotal][]; - int[] index = new int[numTotal]; - for (int i=0, k=0; i<numDraw; i++) { - double temp[][][] = det[listdl[i]].getUser(projection).hv; - for(int j = 0; j < numPoly[i]; j++, k++) { - hv[0][k] = temp[0][j]; - hv[1][k] = temp[1][j]; - index[k] = listdl[i]; - } - } - return new ACoord(hv, index); - } - - protected int[] getColor(int[] dl) { - int[] col=new int[dl.length]; - - for(int i=0; i<dl.length; ++i) - col[i]=det[dl[i]].getFillColor(); - return col; - } - - protected boolean[] getDraw(int[] dl) { - boolean[] draw=new boolean[dl.length]; - - for(int i=0; i<dl.length; ++i) - draw[i]=det[dl[i]].getDraw(); - return draw; - } - - public String getInfo(int index) { - return det[index].getName(); - } - - protected ADrawParameters getDrawParameters(int layer, int type) { - if(layer==0) - return new ADrawParameters(true, 0, 0, 0, 1, 0); - else - return new ADrawParameters(true, 0, 0, 1, 0, 0); - } - - protected ACoord getUserNoTransform(AProjection projection) { - String name=projection.getName(); - ACoord data=getUser(name); - if(name.charAt(0)=='F') - data.includePhiWrapAround(name); - return data; - } - - protected ACoord getUser(AProjection2D projection) { - return projection.nonLinearTransform(getUserNoTransform(projection)); - } - - /* - protected void draw(AWindow window,AGraphics ag,AProjection2D projection) { - // in a simple world the implementation would be here - throw new RuntimeException(); - } - */ -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ADiscDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ADiscDetector.java deleted file mode 100755 index a8241c1889ce547f843598fbe243586cb2a37dd6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ADiscDetector.java +++ /dev/null @@ -1,57 +0,0 @@ -package atlantis.geometry; - -import atlantis.utils.*; -import atlantis.graphics.ACoord; - -public class ADiscDetector extends ADetector { - - double rInner; - double rOuter; - int nInner; - int nOuter; - - ADiscDetector(String name, String projection, String color, double rInner, double rOuter, int nInner, int nOuter) { - super(name, projection, color); - this.rInner=rInner; - this.nInner=nInner; - this.rOuter=rOuter; - this.nOuter=nOuter; - } - - protected ACoord getYXUser() { - if (!projection.equals("YX")) { - return ACoord.NO_DATA; - } - - if (!globals.getUseOpenGL()) { - int numPoints = nInner + nOuter + 2; - double[][] hv = new double[2][numPoints]; - - for (int j = 0; j < nInner + 1; j++) { - hv[0][j] = rInner * Math.cos(Math.PI * 2 * j / nInner); - hv[1][j] = rInner * Math.sin(Math.PI * 2 * j / nInner); - } - for (int j = 0; j < nOuter + 1; j++) { - hv[0][j + nInner + 1] = rOuter * Math.cos(Math.PI * 2 * (nOuter - j) / nOuter); - hv[1][j + nInner + 1] = rOuter * Math.sin(Math.PI * 2 * (nOuter - j) / nOuter); - } - return new ACoord(hv); - } else { - //FIXME: - //Note that generateAnnulusTris can't really handle this different number - //of inner and outer points thing so we're just going to take the mean here - //Maybe one day we fix this somehow or just remove one of the ns - //All the other round detectors get along fine without it... - // -- Adam - return new ACoord(generateAnnulusTris((nInner + nOuter) / 2, 0.0, rInner, rOuter)); - } - } - - protected ACoord getFRUser() { - if(!projection.equals("FR")) return ACoord.NO_DATA; - return new ACoord (AMath.xBox((rInner+rOuter)/2.,(rOuter-rInner)/2.), - AMath.yBox(180.,180.)); - } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/geometry/AEndcapCalorimeterDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/AEndcapCalorimeterDetector.java deleted file mode 100755 index a5df48ac54f2c79f97694ab3ccad411522340a52..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/AEndcapCalorimeterDetector.java +++ /dev/null @@ -1,328 +0,0 @@ -package atlantis.geometry; - -import atlantis.graphics.ACoord; -import atlantis.graphics.AClipper; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AMath; - -/** - * Class representing a calorimeter part in the endcap section of ATLAS. - */ -public class AEndcapCalorimeterDetector extends ACalorimeterDetector { - - /** - * Constructs a new endcap calorimeter object - * @param name String name of the object - * @param color String name of the color used to draw this object - * @param sampling int sampling of this calorimeter part - * @param region int region of this calorimeter part - * @param rMin double inner radius - * @param rMax double outer radius - * @param zMin double inner z - * @param zMax double outer z - * @param eta0 double start of the first cell in eta - * @param deta double size of a cell in eta - * @param neta int number of cells in eta - * @param meta int eta index of the first cell - * @param phi0 double start of the first cell in phi - * @param nphi int number of cells in phi - */ - public AEndcapCalorimeterDetector(String name, String color, int sampling, int region, - double rMin, double rMax, double zMin, double zMax, - double eta0, double deta, int neta, int meta, - double phi0, int nphi) { - super(name, color); - - this.sampling = sampling; - this.region = region; - this.rMin = rMin; - this.rMax = rMax; - this.zMin = zMin; - this.zMax = zMax; - this.eta0 = eta0; - this.deltaEta = deta; - this.numEta = neta; - this.minEta = meta; - this.phi0 = Math.toRadians(phi0); - this.numPhi = nphi; - this.deltaPhi = 2.*Math.PI / numPhi; - - this.detEtaMin = AMath.etaAbs(this.zMin, this.rMax); - this.detEtaMax = AMath.etaAbs(this.zMax, this.rMax); - - // This one is used for clipping the cell geometry in rho-z. - this.clipper = new AClipper(zMin, zMax, rMin, rMax); - - // These arrays are used by the getDetectorIndex() method in ACalorimeterData. - // They provide fast mapping of hits to detectors. - if (this.name.indexOf("LAr") >= 0 && this.name.indexOf("Inner") >= 0 - && this.sampling < lar[3].length && this.region < lar[3][this.sampling].length) { - - lar[3][this.sampling][this.region] = detectors.indexOf(this); - } else if (this.name.indexOf("LAr") >= 0 && this.sampling < lar[2].length - && this.region < lar[2][this.sampling].length) { - - lar[2][this.sampling][this.region] = detectors.indexOf(this); - } else if (this.name.equals("HEC") && this.sampling < hec.length - && this.region < hec[this.sampling].length) { - - hec[this.sampling][this.region] = detectors.indexOf(this); - } else { - System.out.println("Unknown calorimeter object: '" + this.name + "'" - + " some hits might not be displayed correctly."); - } - } - - /** - * Returns the y-x geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getYXUser() { - int mode = parameterStore.get("YX", "Mode").getI(); - if ( mode < AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER) - return ACoord.NO_DATA; - else if((mode==AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER && (name.equals("LAr Endcap Presampler")||name.equals("LAr_EC_Presampler"))) - || (name.equals("LAr Outer Endcap") && sampling==mode-AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER) - || (name.equals("LAr Inner Endcap") && sampling==mode-AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER-1) - || (name.equals("HEC") && sampling==mode-AProjectionYX.MODE_HEC_1) - || (mode==AProjectionYX.MODE_LAR_ENDCAP_SUMMED && name.indexOf("LAr")>=0) - || (mode==AProjectionYX.MODE_HEC_SUMMED && name.equals("HEC"))) - { - - double etaMax = eta0 + numEta * deltaEta; - double etaMin = eta0; - double r1, r2; - if (name.equals("HEC")) - { - r1=rMax; - r2=rMin; - } - else - { - if (name.indexOf("Inner") >= 0 || name.indexOf("Presampler") >= 0) - r1 = zMin/Math.sinh(etaMin); - else - r1=rMax; - r2 = zMin/Math.sinh(etaMax); - } - - if (!globals.getUseOpenGL()) { - int numPoints = 2 * (numPhi + 1); - double[][] hv = new double[2][numPoints]; - for (int i = 0; i < numPhi + 1; i++) { - hv[0][i] = r2 * Math.cos(phi0 + i * deltaPhi); - hv[1][i] = r2 * Math.sin(phi0 + i * deltaPhi); - hv[0][numPhi + 1 + i] = r1 * Math.cos(phi0 - i * deltaPhi); - hv[1][numPhi + 1 + i] = r1 * Math.sin(phi0 - i * deltaPhi); - } - return new ACoord(hv); - } else { - return new ACoord(generateAnnulusTris(numPhi, phi0, r1, r2)); - } - } - else - return ACoord.NO_DATA; - } - - /** - * Returns the rho-z geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getRZUser() { - double h[], v[]; - double etaMax = eta0 + numEta * deltaEta; - double etaMin = eta0; - - // Calculate the polygon in the positive h and v. - if (name.indexOf("HEC") >= 0) { - h = new double[] {zMax, zMin, zMin, zMax}; - v = new double[] {rMax, rMax, rMin, rMin}; - } else { - double r0 = zMax/Math.sinh(etaMin); - double r1 = zMin/Math.sinh(etaMin); - double r2 = zMin/Math.sinh(etaMax); - double r3 = zMax/Math.sinh(etaMax); - - h = new double[] {zMax, zMin, zMin, zMax}; - v = new double[] {r0, r1, r2, r3}; - } - - // Clip the polygon. - ACoord coord = clipper.clipPolygon(h, v, h.length); - - // Copy it to negative v. - coord = new ACoord(coord, coord.mirrorV()); - // Copy it to negative h. - coord = new ACoord(coord, coord.mirrorH()); - - return coord; - } - - /** - * Returns the phi-rho geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getFRUser() { - return getYXUser().convertYXToFR(); - } - - /** - * Returns the phi-z geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getFZUser() { - double[][][] hv = new double[2][2][]; - double phiMin = 0.; - double phiMax = 360.; - hv[0][0] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] {phiMax, phiMax, phiMin, phiMin}; - hv[0][1] = new double[] { -zMax, -zMin, -zMin, -zMax}; - hv[1][1] = new double[] {phiMax, phiMax, phiMin, phiMin}; - return new ACoord(hv); - } - - /** - * Returns the y-x geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getYXCell(int eta, int phi) - { - int mode = parameterStore.get("YX", "Mode").getI(); - if(mode < AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER || mode > AProjectionYX.MODE_HEC_SUMMED) - return ACoord.NO_DATA; - else if((mode==AProjectionYX.MODE_LAR_ENDCAP_SUMMED && name.indexOf("LAr")>=0) - || (mode==AProjectionYX.MODE_HEC_SUMMED && name.equals("HEC"))) - { - //don't need to carry out calculation just needs return a blank ACoord - double[][] hv = new double[2][]; - hv[0] = new double[] {0}; - hv[1] = new double[] {0}; - return new ACoord(hv); - } - else if((mode==AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER && (name.equals("LAr Endcap Presampler") || name.equals("LAr_EC_Presampler"))) - || (name.equals("LAr Outer Endcap") && sampling==mode-AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER) - || (name.equals("LAr Inner Endcap") && sampling==mode-AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER-1) - || (name.equals("HEC") && sampling==mode-AProjectionYX.MODE_HEC_1)) - { - double[][] hv = new double[2][]; - double phiMin = phi0+phi*deltaPhi; - double phiMax = phiMin+deltaPhi; - double newrMax=0, newrMin=0; - double etaMin = eta0+(eta-minEta)*deltaEta; - double etaMax = etaMin+deltaEta; - newrMax=zMin/Math.sinh(etaMin); - newrMin=zMin/Math.sinh(etaMax); - if (name.equals("HEC")) - { - if(newrMax>rMax) - newrMax=rMax; - if(newrMin<rMin) - newrMin=rMin; - } - hv[0] = new double[] {newrMax*Math.cos(phiMin), newrMax*Math.cos(phiMax), - newrMin*Math.cos(phiMax), newrMin*Math.cos(phiMin)}; - hv[1] = new double[] {newrMax*Math.sin(phiMin), newrMax*Math.sin(phiMax), - newrMin*Math.sin(phiMax), newrMin*Math.sin(phiMin)}; - return new ACoord(hv); - } - else - return ACoord.NO_DATA; - } - - /** - * Returns the rho-z geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getRZCell(int eta, int phi, int side) { - double[][] hv = new double[2][]; - int sign = getRSign(phi); - - // This shouldn't be 0, but just to be on the safe side. - if (side != 0) side /= Math.abs(side); - - double etaMin = eta0+(eta-minEta)*deltaEta; - double etaMax = etaMin+deltaEta; - - if (name.indexOf("HEC") >= 0) { - if (sampling == 0) { - double rMin = (zMin+zMax)/2. / Math.sinh(etaMax); - double rMax = (zMin+zMax)/2. / Math.sinh(etaMin); - - hv[0] = new double[] {zMax, zMin, zMin, zMax}; - hv[1] = new double[] {rMax, rMax, rMin, rMin}; - } else { - double dz = (zMax-zMin); - double z0 = zMin; - double z1 = zMin+dz/2.; - double z2 = zMax; - double r0 = (zMin+dz/4.) / Math.sinh(etaMax); - double r1 = (zMax-dz/4.) / Math.sinh(etaMax); - double r2 = (zMin+dz/4.) / Math.sinh(etaMin); - double r3 = (zMax-dz/4.) / Math.sinh(etaMin); - - hv[0] = new double[] {z2, z1, z1, z0, z0, z1, z1, z2}; - hv[1] = new double[] {r3, r3, r2, r2, r0, r0, r1, r1}; - } - } else { - hv[0] = new double[] {zMax, zMin, zMin, zMax}; - hv[1] = new double[] {zMax/Math.sinh(etaMin), zMin/Math.sinh(etaMin), - zMin/Math.sinh(etaMax), zMax/Math.sinh(etaMax)}; - } - - // Clip the cell and send it to the right quadrant. - ACoord coord = clipper.clipPolygon(hv[0], hv[1], hv[0].length); - for (int i=0; i<coord.hv[0][0].length; i++) { - coord.hv[0][0][i] *= side; - coord.hv[1][0][i] *= sign; - } - - return coord; - } - - /** - * Returns the phi-z geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord - */ - public ACoord getFZCell(int eta, int phi, int side) { - double[][] hv = new double[2][]; - double phiMin = Math.toDegrees(phi0 + phi*deltaPhi); - double phiMax = phiMin + Math.toDegrees(deltaPhi); - - side /= Math.abs(side); - - hv[0] = new double[] {side*zMax, side*zMin, side*zMin, side*zMax}; - hv[1] = new double[] { phiMax, phiMax, phiMin, phiMin}; - - return new ACoord(hv); - } - - /** - * Returns the eta-phi geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getVPCell(int eta, int phi, int side) { - double[][] hv = new double[2][]; - double etaMin = eta0+(eta-minEta)*deltaEta; - double etaMax = etaMin+deltaEta; - double phiMin = Math.toDegrees(phi0 + phi*deltaPhi); - double phiMax = phiMin + Math.toDegrees(deltaPhi); - - side /= Math.abs(side); - - hv[0] = new double[] {side*etaMax, side*etaMin, side*etaMin, side*etaMax}; - hv[1] = new double[] { phiMax, phiMax, phiMin, phiMin}; - - return new ACoord(hv); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/AEndcapCryostatDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/AEndcapCryostatDetector.java deleted file mode 100755 index 8d1122eba4bf2f89214d8c143c0e5d394bdd1236..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/AEndcapCryostatDetector.java +++ /dev/null @@ -1,158 +0,0 @@ -package atlantis.geometry; - -import atlantis.graphics.ACoord; -import atlantis.graphics.AClipper; -import atlantis.projection.AProjectionYX; -import atlantis.utils.AMath; - -/** - * Class representing a detector part in the endcap cryostat section of ATLAS. - */ -public class AEndcapCryostatDetector extends ACalorimeterDetector { - - /** - * Constructs a new endcap calorimeter object - * @param name String name of the object - * @param color String name of the color used to draw this object - * @param sampling int sampling of this calorimeter part - * @param region int region of this calorimeter part - * @param rMin double inner radius - * @param rMax double outer radius - * @param zMin double inner z - * @param zMax double outer z - * @param neta int number of cells in eta - * @param nphi int number of cells in phi - */ - public AEndcapCryostatDetector(String name, String color, int sampling, int region, double rMin, - double rMax, double zMin, double zMax, int neta, int nphi) { - super(name, color); - - this.sampling = sampling; - this.region = region; - this.rMin = rMin; - this.rMax = rMax; - this.zMin = zMin; - this.zMax = zMax; - this.numEta = neta; - this.numPhi = nphi; - this.deltaPhi = 2.*Math.PI / numPhi; - this.phi0 = 0.0; - this.eta0 = AMath.etaAbs(this.zMin, this.rMin); - - this.detEtaMin = AMath.etaAbs(this.zMin, this.rMax); - this.detEtaMax = AMath.etaAbs(this.zMax, this.rMax); - - // This one is used for clipping the cell geometry in rho-z. - this.clipper = new AClipper(zMin, zMax, rMin, rMax); - - // These arrays are used by the getDetectorIndex() method in ACalorimeterData. - // They provide fast mapping of hits to detectors. - if (this.name.equals("Minimum Bias Trigger Scintillators")) { - mbts[this.sampling] = detectors.indexOf(this); - } else { - System.out.println("Unknown calorimeter object: '" + this.name + "'" - + " some hits might not be displayed correctly."); - } - } - - /** - * Returns the y-x geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getYXUser() { - int mode = parameterStore.get("YX", "Mode").getI(); - if (mode!=AProjectionYX.MODE_MBTS) - return ACoord.NO_DATA; - else - { - if (!globals.getUseOpenGL()) { - int numPoints = 2 * (numPhi + 1); - double[][] hv = new double[2][numPoints]; - for (int j = 0; j < numPhi + 1; j++) { - hv[0][j] = rMin * Math.cos(Math.PI * 2 * j / numPhi); - hv[1][j] = rMin * Math.sin(Math.PI * 2 * j / numPhi); - } - for (int j = 0; j < numPhi + 1; j++) { - hv[0][j + numPhi + 1] = rMax * Math.cos(Math.PI * 2 * (numPhi - j) / numPhi); - hv[1][j + numPhi + 1] = rMax * Math.sin(Math.PI * 2 * (numPhi - j) / numPhi); - } - return new ACoord(hv); - } else { - return new ACoord(generateAnnulusTris(numPhi, phi0, rMin, rMax)); - } - } - } - - /** - * Returns the rho-z geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getRZUser() { - double h[], v[]; - // Calculate the polygon in the positive h and v. - h = new double[] {zMax, zMin, zMin, zMax}; - v = new double[] {rMax, rMax, rMin, rMin}; - // Clip the polygon. - ACoord coord = clipper.clipPolygon(h, v, h.length); - // Copy it to negative v. - coord = new ACoord(coord, coord.mirrorV()); - // Copy it to negative h. - coord = new ACoord(coord, coord.mirrorH()); - return coord; - } - - /** - * Returns the phi-rho geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getFRUser() { - return getYXUser().convertYXToFR(); - } - - /** - * Returns the y-x geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getYXCell(int eta, int phi) - { - int mode = parameterStore.get("YX", "Mode").getI(); - if(mode!=AProjectionYX.MODE_MBTS) - return ACoord.NO_DATA; - else - { - double[][] hv = new double[2][]; - double phiMin = Math.PI*2*phi/numPhi; - double phiMax = Math.PI*2*(1+phi)/numPhi; - hv[0] = new double[] {rMax*Math.cos(phiMin), rMax*Math.cos(phiMax), - rMin*Math.cos(phiMax), rMin*Math.cos(phiMin)}; - hv[1] = new double[] {rMax*Math.sin(phiMin), rMax*Math.sin(phiMax), - rMin*Math.sin(phiMax), rMin*Math.sin(phiMin)}; - return new ACoord(hv); - } - } - - /** - * Returns the rho-z geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getRZCell(int eta, int phi, int side) { - double[][] hv = new double[2][]; - int sign = getRSign(phi); - // This shouldn't be 0, but just to be on the safe side. - if (side != 0) side /= Math.abs(side); - hv[0] = new double[] {zMax, zMin, zMin, zMax}; - hv[1] = new double[] {rMax, rMax, rMin, rMin}; - // Clip the cell and send it to the right quadrant. - ACoord coord = clipper.clipPolygon(hv[0], hv[1], hv[0].length); - for (int i=0; i<coord.hv[0][0].length; i++) { - coord.hv[0][0][i] *= side; - coord.hv[1][0][i] *= sign; - } - return coord; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/AEndcapSiliconDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/AEndcapSiliconDetector.java deleted file mode 100755 index e28c5f168695aa81f115e9194ac08f280272cf6f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/AEndcapSiliconDetector.java +++ /dev/null @@ -1,220 +0,0 @@ -package atlantis.geometry; - -import atlantis.canvas.AWindow; -import atlantis.data.AS3DData; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionYX; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -/** - * Class representing a pixel/SCT endcap detector part. - * Also implements methods to draw more detailed structure of the detector. - * - * @author Eric Jansen - */ -public class AEndcapSiliconDetector extends ADetector { - - private static List detectors = null; - - protected int layer; - protected double length; - protected double width; - protected double thickness; - protected int numZ; - protected int numPhi; - protected double phi0; - protected double zMin; - protected double zMax; - - protected double deltaPhi; - protected double deltaZ; - protected double rMin; - protected double rMax; - - public AEndcapSiliconDetector(String name, String color, int layer, double length, double width, double thickness, - int numZ, int numPhi, double rMin, double rMax, double phi0, double zMin, double zMax) { - super(name, " ", color); - - if (detectors == null) { - detectors = new ArrayList(); - } - detectors.add(this); - - this.layer = layer; - this.length = length; - this.width = width; - this.thickness = thickness; - this.numZ = numZ; - this.numPhi = numPhi; - this.rMin = rMin; - this.rMax = rMax; - this.phi0 = Math.toRadians(phi0); - this.zMin = zMin; - this.zMax = zMax; - - this.deltaPhi = 2.*Math.PI / this.numPhi; - this.deltaZ = (this.zMax - this.zMin) / this.numZ; - } - - /** - * Empties the list of instances of this class. - */ - public static void clear() { - if (detectors != null) { - detectors.clear(); - } - } - - /** - * This function draws the wafer/stave structure of the silicon detectors. It is called - * from ADetectorSystem.draw(). - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - */ - public static void drawAdditionalItems(AWindow window, AGraphics ag, AProjection2D projection) { - AParameter inDetDetail = parameterStore.getUnknown("Det", "SiliconDetail"); - if (inDetDetail != null && detectors != null && inDetDetail.getStatus()) { - for (int i=0; i<detectors.size(); i++) { - ACoord coord = ACoord.NO_DATA; - AEndcapSiliconDetector detector = (AEndcapSiliconDetector) detectors.get(i); - if (projection instanceof AProjectionYX) { - coord = detector.getYXDetail(); - } else if (projection instanceof AProjectionFR) { - coord = detector.getYXDetail().convertYXToFR().includePhiWrapAround("FR"); - } - - if (coord != ACoord.NO_DATA) { - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[parameterStore.get("Det", "SiliconDetail").getI()]); - - ACoord display = window.calculateDisplay(projection.nonLinearTransform(coord)); - for (int j=0; j<display.hv[0].length; j++) { - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - } - } - - /** - * Determines if this element should be visible or not. - * @return visibility - */ - protected boolean isVisible() { - int cut = parameterStore.get("CutsInDet", "SCT").getI(); - - if (cut == AS3DData.CUT_INDET_SCT_ALL || cut == AS3DData.CUT_INDET_SCT_EC_NEG - || cut == AS3DData.CUT_INDET_SCT_EC_POS) { - return true; - } else { - return false; - } - } - - /** - * Returns the detector outline in the y-x projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getYXUser() { - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_STANDARD) return ACoord.NO_DATA; - if (!isVisible()) return ACoord.NO_DATA; - - if (!globals.getUseOpenGL()) { - int numPoints = 2 * (numPhi + 1); - double[][] hv = new double[2][numPoints]; - - for (int i = 0; i < numPhi + 1; i++) { - hv[0][i] = rMin * Math.cos(phi0 + (i + 0.5) * deltaPhi); - hv[1][i] = rMin * Math.sin(phi0 + (i + 0.5) * deltaPhi); - - hv[0][numPhi + 1 + i] = rMax * Math.cos(phi0 - (i + 0.5) * deltaPhi); - hv[1][numPhi + 1 + i] = rMax * Math.sin(phi0 - (i + 0.5) * deltaPhi); - } - return new ACoord(hv); - } else { - return new ACoord(generateAnnulusTris(numPhi, phi0, rMin, rMax)); - } - } - - /** - * Returns the detector outline in the rho-z projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getRZUser() { - double[][][] hv = new double[2][4][]; - - hv[0][0] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][1] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][1] = new double[] {-rMin, -rMin, -rMax, -rMax}; - - hv[0][2] = new double[] {-zMax, -zMin, -zMin, -zMax}; - hv[1][2] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][3] = new double[] {-zMax, -zMin, -zMin, -zMax}; - hv[1][3] = new double[] {-rMin, -rMin, -rMax, -rMax}; - - return new ACoord(hv); - } - - /** - * Returns the detector outline in the phi-z projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getFZUser() { - if (!isVisible()) return ACoord.NO_DATA; - - double[][][] hv = new double[2][2][]; - - hv[0][0] = new double[] {zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] {360., 360., 0., 0.}; - hv[0][1] = new double[] {-zMax, -zMin, -zMin, -zMax}; - hv[1][1] = new double[] {360., 360., 0., 0.}; - - return new ACoord(hv); - } - - /** - * Returns the detector outline in the phi-rho projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getFRUser() { - if (!isVisible()) return ACoord.NO_DATA; - - return getYXUser().convertYXToFR(); - } - - /** - * Returns the wafer/stave structure in the y-x projection. - * @return ACoord polygons representing the wafers/staves - */ - protected ACoord getYXDetail() { - if (parameterStore.get("YX", "Mode").getI() != AProjectionYX.MODE_STANDARD) return ACoord.NO_DATA; - if (!isVisible()) return ACoord.NO_DATA; - - double[][][] hv = new double[2][numPhi][]; - for (int i=0; i<numPhi; i++) { - hv[0][i] = new double[] { - rMax*Math.sin(phi0+(i-0.5)*deltaPhi), - rMax*Math.sin(phi0+(i+0.5)*deltaPhi), - rMin*Math.sin(phi0+(i+0.5)*deltaPhi), - rMin*Math.sin(phi0+(i-0.5)*deltaPhi) - }; - hv[1][i] = new double[] { - rMax*Math.cos(phi0+(i-0.5)*deltaPhi), - rMax*Math.cos(phi0+(i+0.5)*deltaPhi), - rMin*Math.cos(phi0+(i+0.5)*deltaPhi), - rMin*Math.cos(phi0+(i-0.5)*deltaPhi) - }; - } - - return new ACoord(hv); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/AEndcapTRTDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/AEndcapTRTDetector.java deleted file mode 100755 index a23bfaf0d0221be8770250642a8503cf60b10355..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/AEndcapTRTDetector.java +++ /dev/null @@ -1,173 +0,0 @@ -package atlantis.geometry; - -import atlantis.canvas.AWindow; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionRZ; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -/** - * Class representing a TRT endcap detector part. - * Also implements methods to draw more detailed structure of the detector. - * - * @author Eric Jansen - */ -public class AEndcapTRTDetector extends ADetector { - - private static List detectors = null; - - protected int layer; - protected int numPhi; - protected double rMin; - protected double rMax; - protected double phi0; - protected double zMin; - protected double zMax; - protected double deltaPhi; - - public AEndcapTRTDetector(String name, String color, int layer, int numPhi, double rMin, double rMax, - double phi0, double zMin, double zMax) { - super(name, " ", color); - - if (detectors == null) { - detectors = new ArrayList(); - } - detectors.add(this); - - this.layer = layer; - this.numPhi = numPhi; - this.rMin = rMin; - this.rMax = rMax; - this.phi0 = Math.toRadians(phi0); - this.zMin = zMin; - this.zMax = zMax; - - this.deltaPhi = 2.*Math.PI / numPhi; - } - - /** - * Empties the list of instances of this class. - */ - public static void clear() { - if (detectors != null) { - detectors.clear(); - } - } - - /** - * This function draws the module structure of the TRT detector. It is called - * from ADetectorSystem.draw(). - * @param window AWindow window to use - * @param ag AGraphics graphics object to draw onto - * @param projection AProjection2D current projection - */ - public static void drawAdditionalItems(AWindow window, AGraphics ag, AProjection2D projection) { - AParameter inDetDetail = parameterStore.getUnknown("Det", "TRTDetail"); - if (inDetDetail != null && detectors != null && inDetDetail.getStatus()) { - for (int i=0; i<detectors.size(); i++) { - ACoord coord = ACoord.NO_DATA; - AEndcapTRTDetector detector = (AEndcapTRTDetector) detectors.get(i); - if (projection instanceof AProjectionRZ) { - coord = detector.getRZDetail(); - } else if (projection instanceof AProjectionFZ) { - coord = detector.getFZDetail(); - } - - if (coord != ACoord.NO_DATA) { - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[parameterStore.get("Det", "TRTDetail").getI()]); - - ACoord display = window.calculateDisplay(projection.nonLinearTransform(coord)); - for (int j=0; j<display.hv[0].length; j++) { - ag.drawPolygon(display.hv[0][j], display.hv[1][j], display.hv[0][j].length); - } - } - } - } - } - - /** - * Returns the detector outline in the y-x projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getYXUser() { - return ACoord.NO_DATA; - } - - /** - * Returns the detector outline in the rho-z projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getRZUser() { - double[][][] hv = new double[2][4][]; - - hv[0][0] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][1] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][1] = new double[] {-rMin, -rMin, -rMax, -rMax}; - hv[0][2] = new double[] {-zMax, -zMin, -zMin, -zMax}; - hv[1][2] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][3] = new double[] {-zMax, -zMin, -zMin, -zMax}; - hv[1][3] = new double[] {-rMin, -rMin, -rMax, -rMax}; - - return new ACoord(hv); - } - - /** - * Returns the detector outline in the phi-z projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getFZUser() { - double[][][] hv = new double[2][2][]; - - hv[0][0] = new double[] {zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] {360., 360., 0., 0.}; - hv[0][1] = new double[] {-zMax, -zMin, -zMin, -zMax}; - hv[1][1] = new double[] {360., 360., 0., 0.}; - - return new ACoord(hv); - } - - /** - * Returns the detector outline in the phi-rho projection. - * @return ACoord polygon representing the detector - */ - protected ACoord getFRUser() { - return ACoord.NO_DATA; - } - - /** - * Returns the module structure in the rho-z projection. - * @return ACoord polygons representing the modules - */ - protected ACoord getRZDetail() { - return ACoord.NO_DATA; - } - - /** - * Returns the module structure in the phi-z projection. - * @return ACoord polygons representing the modules - */ - protected ACoord getFZDetail() { - double[][][] hv = new double[2][2*numPhi][2]; - for (int i=0; i<numPhi; i++) { - hv[0][i][0] = zMin; - hv[1][i][0] = Math.toDegrees(phi0 + i*deltaPhi); - hv[0][i][1] = zMax; - hv[1][i][1] = Math.toDegrees(phi0 + i*deltaPhi); - hv[0][numPhi+i][0] = -zMax; - hv[1][numPhi+i][0] = Math.toDegrees(phi0 + i*deltaPhi); - hv[0][numPhi+i][1] = -zMin; - hv[1][numPhi+i][1] = Math.toDegrees(phi0 + i*deltaPhi); - } - - return new ACoord(hv).includePhiWrapAround("FZ"); - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/geometry/AGapCalorimeterDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/AGapCalorimeterDetector.java deleted file mode 100755 index a27a9872377ab9ab57c9988cdf9c3a51d4011fb0..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/AGapCalorimeterDetector.java +++ /dev/null @@ -1,179 +0,0 @@ -package atlantis.geometry; - -import atlantis.graphics.ACoord; -import atlantis.parameters.AParameterUtilities; - -/** - * Class representing a calorimeter in the gap region between TILE and extended TILE. - * This is a fairly straightforward implementation of ACalorimeterDetector with only - * one cell per object. - * - * @author Eric Jansen - */ -public class AGapCalorimeterDetector extends ACalorimeterDetector { - - protected int eta; - - /** - * Constructs a new gap calorimeter object (one cell in eta). - * @param name String name of the object - * @param color String name of the color used to draw this object - * @param sampling int sampling of this calorimeter part - * @param region int region of this calorimeter part - * @param rMin double inner radius - * @param rMax double outer radius - * @param zMin double inner z - * @param zMax double outer z - * @param eta int eta index of this cell - * @param phi0 double start of the first cell in phi - * @param nphi int number of cells in phi - */ - public AGapCalorimeterDetector(String name, String color, int sampling, int region, - double rMin, double rMax, double zMin, double zMax, - int eta, double phi0, int nphi) { - super(name, color); - - // Just to be sure we take absolute values here. - this.sampling = Math.abs(sampling); - this.region = Math.abs(region); - this.eta = Math.abs(eta); - - this.rMin = rMin; - this.rMax = rMax; - this.zMin = zMin; - this.zMax = zMax; - this.phi0 = Math.toRadians(phi0); - this.numPhi = nphi; - this.deltaPhi = 2.*Math.PI/numPhi; - - // These arrays are used by the getDetectorIndex() method in ACalorimeterData. - // They provide fast mapping of hits to detectors. - if (this.name.indexOf("ITC") >= 0 && this.sampling < tile_gap.length - && this.eta < tile_gap[this.sampling].length) { - - tile_gap[this.sampling][this.eta] = detectors.indexOf(this); - } else { - System.out.println("Unknown calorimeter object: '" + this.name + "'" - + " some hits might not be displayed correctly."); - } - } - - /** - * Returns the eta value of the center (in eta) of a cell. - * @param eta int eta index of the cell - * @param side int sign of the z coordinate of the cell - * @return double eta value - */ - public double getEta(int eta, int side) { - if (side < 0) { - return -getEta(eta, -side); - } else { - return AParameterUtilities.eta((zMin+zMax)/2.f, (rMin+rMax)/2.f); - } - } - - /** - * Returns the lowest eta value of a cell. - * @param eta int eta index of the cell - * @param side int sign of the z coordinate of the cell - * @return double lowest eta value - */ - public double getEtaMin(int eta, int side) { - if (side < 0) { - return -getEtaMax(eta, -side); - } else { - return AParameterUtilities.eta((zMin+zMax)/2.f, rMax); - } - } - - /** - * Returns the highest eta value of a cell. - * @param eta int eta index of the cell - * @param side int sign of the z coordinate of the cell - * @return double highest eta value - */ - public double getEtaMax(int eta, int side) { - if (side < 0) { - return -getEtaMin(eta, -side); - } else { - return AParameterUtilities.eta((zMin+zMax)/2.f, rMin); - } - } - - /** - * Returns the rho-z geometry of the full calorimeter part. - * @return ACoord polygons representing geometry - */ - protected ACoord getRZUser() { - double[][][] hv; - if (zMin < 0) { - hv = new double[2][2][]; - hv[0][0] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][1] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][1] = new double[] {-rMin, -rMin, -rMax, -rMax}; - } else { - hv = new double[2][4][]; - hv[0][0] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][0] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][1] = new double[] { zMax, zMin, zMin, zMax}; - hv[1][1] = new double[] {-rMin, -rMin, -rMax, -rMax}; - hv[0][2] = new double[] {-zMin, -zMax, -zMax, -zMin}; - hv[1][2] = new double[] { rMax, rMax, rMin, rMin}; - hv[0][3] = new double[] {-zMin, -zMax, -zMax, -zMin}; - hv[1][3] = new double[] {-rMin, -rMin, -rMax, -rMax}; - } - return new ACoord(hv); - } - - /** - * Returns the rho-z geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getRZCell(int eta, int phi, int side) { - double[][] hv = new double[2][]; - int sign = getRSign(phi); - - // This shouldn't be 0, but just to be on the safe side. - if (side != 0) { - side /= Math.abs(side); - } - - hv[0] = new double[] {zMax, zMin, zMin, zMax}; - hv[1] = new double[] {rMax, rMax, rMin, rMin}; - - // Send it to the right quadrant. - ACoord coord = new ACoord(hv); - for (int i=0; i<coord.hv[0][0].length; i++) { - coord.hv[0][0][i] *= side; - coord.hv[1][0][i] *= sign; - } - - return coord; - } - - /** - * Returns the eta-phi geometry of a specific cell in this calorimeter part. - * @param eta int eta index of cell - * @param phi int phi index of cell - * @param side int sign of the z coordinate of cell - * @return ACoord polygon representing cell geometry - */ - public ACoord getVPCell(int eta, int phi, int side) { - double[][] hv = new double[2][]; - double etaMin = AParameterUtilities.eta((zMin+zMax)/2.f, rMax); - double etaMax = AParameterUtilities.eta((zMin+zMax)/2.f, rMin); - double phiMin = Math.toDegrees(phi0 + phi*deltaPhi); - double phiMax = phiMin + Math.toDegrees(deltaPhi); - - side /= Math.abs(side); - - hv[0] = new double[] {side*etaMax, side*etaMin, side*etaMin, side*etaMax}; - hv[1] = new double[] { phiMax, phiMax, phiMin, phiMin}; - - return new ACoord(hv); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/AGeneralDetectors.java b/graphics/AtlantisJava/src/atlantis/geometry/AGeneralDetectors.java deleted file mode 100755 index bb939996da5013f63d3f8cd39cd9e77537274bde..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/AGeneralDetectors.java +++ /dev/null @@ -1,71 +0,0 @@ -package atlantis.geometry; - -import atlantis.parameters.APar; -import java.util.*; - -/** - * Used to store all detectors which are not part of the muon system - * these may be of different types. - */ - -public final class AGeneralDetectors extends ADetectors { - - public AGeneralDetectors(List detectors) { - super(filterGeneralDetectors(detectors)); - } - - private static ADetector[] filterGeneralDetectors(List detectors) { - - List tempDetectors=new ArrayList(detectors.size()); - Iterator it=detectors.iterator(); - - while(it.hasNext()) { - Object o=it.next(); - if((o instanceof ADetector)&&!(o instanceof ABoxDetector)&&!(o instanceof ATrapezoidDetector)) tempDetectors.add(o); - } - return (ADetector[])tempDetectors.toArray(new ADetector[tempDetectors.size()]); - } - - private void makeDrawListYX() { - int mode=parameterStore.get("YX", "Mode").getI(); - if(mode==0) { - int num=0; - for(int i=0; i<numData; ++i) - if(det[i].getName().indexOf("FCAL")<0) - listdl[num++]=i; - numDraw=num; - } - else if(mode>8) - { - int num=0; - for(int i=0; i<numData; ++i) - if((mode==9 && det[i].getName().equals("FCAL EM")) - ||(mode==10 && det[i].getName().equals("FCAL HAD 1")) - ||(mode==11 && det[i].getName().equals("FCAL HAD 2")) - ||(mode==12 && (det[i].getName().equals("LAr Endcap Presampler"))||det[i].getName().equals("LAr_EC_Presampler")) - ||(mode>=13 && mode<= 15 && (det[i].getName().equals("LAr Outer Endcap") || det[i].getName().equals("LAr Inner Endcap"))) - ||(mode>=16 && mode<= 19 && det[i].getName().equals("HEC")) - ||(parameterStore.get("YX", "DrawFCAL").getStatus() && mode==17 && det[i].getName().equals("FCAL EM")) - ||(parameterStore.get("YX", "DrawFCAL").getStatus() && mode==18 && det[i].getName().equals("FCAL HAD 1")) - ||(parameterStore.get("YX", "DrawFCAL").getStatus() && mode==19 && det[i].getName().equals("FCAL HAD 2")) - ||(mode==20 && (det[i].getName().indexOf("LAr")>=0 || det[i].getName().indexOf("Endcap")>=0 || det[i].getName().indexOf("EC")>=0)) - ||(mode==21 && det[i].getName().equals("HEC")) - ||(mode==22)&& det[i].getName().equals("Minimum Bias Trigger Scintillators")) - listdl[num++]=i; - numDraw=num; - } else - numDraw=0; - } - - protected void makeDrawList(String projection) { - if (projection.equals("YX") || projection.equals("FR")) - makeDrawListYX(); - else { - if(parameterStore.get(projection, "Mode").getI()==0) - constructDefaultDrawList(); - else - numDraw=0; - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/AGeometryFromXMLReader.java b/graphics/AtlantisJava/src/atlantis/geometry/AGeometryFromXMLReader.java deleted file mode 100755 index 8b7eb48bf4891a0fd4501d7e3692a9a5dc820338..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/AGeometryFromXMLReader.java +++ /dev/null @@ -1,286 +0,0 @@ -package atlantis.geometry; - -import java.io.InputStream; -import java.util.List; -import java.util.ArrayList; - -import atlantis.output.AExceptionHandler; -import atlantis.utils.xml.AXMLErrorHandler; -import atlantis.utils.AUtilities; -import org.xml.sax.helpers.*; - -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; -import org.xml.sax.Attributes; - - -class AGeometryFromXMLReader extends DefaultHandler { - - private static final boolean VALIDATION=false; - private SAXParser parser; - - private static List<ADetector> detectors; - - public AGeometryFromXMLReader() { - try { - SAXParserFactory factory=SAXParserFactory.newInstance(); - - factory.setValidating(true); - factory.setNamespaceAware(true); - parser=factory.newSAXParser(); - if(VALIDATION) - parser.getXMLReader().setErrorHandler(new AXMLErrorHandler()); - } catch(Exception e) { - AExceptionHandler.processException("Cannot create AGeometryFromXMLReader", e); - } - } - - protected List<ADetector> readDetectorGeometryFromXML(String fileName) - { - detectors = new ArrayList<ADetector>(2500); - try - { - InputStream isGeom = AUtilities.getFileAsStream(fileName); - parser.parse(isGeom, this); - } - catch(Exception e) - { - String msg = "Error when reading geometry file:\n" + e.getMessage(); - AExceptionHandler.processException(msg, e); - } - - return detectors; - } - - static private double calculatePhi(String name, double phi0, int phiIndex) { - String technology = name.substring(0, 3); - if (technology.equals("TGC")) { - if (name.charAt(6) == 'E' && name.charAt(5) != '4') - return Math.toRadians(phi0) + (phiIndex - 1) * Math.PI / 24.; - else - return Math.toRadians(phi0) + (phiIndex - 1) * Math.PI / 12.; - } else { - return Math.toRadians(phi0) + (phiIndex - 1) * Math.PI / 4.; - } - } - - // ContentHandler Implementation - - public void startElement(String namespaceURI, String localName, String qName, Attributes atts) { - if(localName.equals("ABox")||localName.equals("ATBx")) { - String name=atts.getValue("n"); - double zi=Double.parseDouble(atts.getValue("zi")); - double zo=Double.parseDouble(atts.getValue("zo")); - double ri=Double.parseDouble(atts.getValue("ri")); - double ro=Double.parseDouble(atts.getValue("ro")); - double w=Double.parseDouble(atts.getValue("w")); - double dPhi=Double.parseDouble(atts.getValue("dphi")); - double rpci=Double.parseDouble(atts.getValue("RPCi")); - double rpco=Double.parseDouble(atts.getValue("RPCo")); - double s=Double.parseDouble(atts.getValue("sh")); - int stationEta=Integer.parseInt(atts.getValue("eta")); - String[] phis=atts.getValue("phi").split(" "); - - if(localName.equals("ABox")) { - for(int i=0; i<phis.length; ++i) - for(int zSide=-1; zSide<=1; zSide+=2) { - int stationPhi = Integer.parseInt(phis[i]); - double phi = calculatePhi(name, dPhi, stationPhi); - detectors.add(new ABoxDetector(name, zSide*zi, zSide*zo, ri+rpci, ro-rpco, phi, s, w, - zSide*stationEta, stationPhi)); - if(rpci>0.) - detectors.add(new ABoxDetector("RPC"+name.substring(3)+"_I", zSide*zi, zSide*zo, ri, - ri+rpci, phi, s, w, zSide*stationEta, stationPhi)); - if(rpco>0.) - detectors.add(new ABoxDetector("RPC"+name.substring(3)+"_O", zSide*zi, zSide*zo, - ro-rpco, ro, phi, s, w, zSide*stationEta, stationPhi)); - } - } else if(localName.equals("ATBx")) { - double zis=Double.parseDouble(atts.getValue("zis")); - double zos=Double.parseDouble(atts.getValue("zos")); - double ws=Double.parseDouble(atts.getValue("ws")); - double or=Double.parseDouble(atts.getValue("or")); - for(int i=0; i<phis.length; ++i) - for(int zSide=-1; zSide<=1; zSide+=2) { - int stationPhi = Integer.parseInt(phis[i]); - double phi = calculatePhi(name, dPhi, stationPhi); - detectors.add(new ATBxDetector(name, zSide*zi, zSide*zo, ri+rpci, ro-rpco, phi, s, w, - zSide*zis, zSide*zos, ws, or, zSide*stationEta, stationPhi)); - if(rpci>0.) - detectors.add(new ATBxDetector("RPC"+name.substring(3)+"_I", zSide*zi, zSide*zo, ri, - ri+rpci, phi, s, w, zSide*zis, zSide*zos, ws, or, zSide*stationEta, stationPhi)); - if(rpco>0.) - detectors.add(new ATBxDetector("RPC"+name.substring(3)+"_O", zSide*zi, zSide*zo, - ro-rpco, ro, phi, s, w, zSide*zis, zSide*zos, ws, or, zSide*stationEta, stationPhi)); - } - } - - } else if(localName.equals("ATrd")) { - String name=atts.getValue("n"); - double zi=Double.parseDouble(atts.getValue("zi")); - double zo=Double.parseDouble(atts.getValue("zo")); - double ri=Double.parseDouble(atts.getValue("ri")); - double ro=Double.parseDouble(atts.getValue("ro")); - - double wi=Double.parseDouble(atts.getValue("wi")); - double wo=Double.parseDouble(atts.getValue("wo")); - double dPhi=Double.parseDouble(atts.getValue("dphi")); - double alpha=Double.parseDouble(atts.getValue("a")); - int stationEta=Integer.parseInt(atts.getValue("eta")); - String[] phis=atts.getValue("phi").split(" "); - - for(int i=0; i<phis.length; ++i) { - for(int zSide = -1; zSide <= 1; zSide += 2) { - int stationPhi = Integer.parseInt(phis[i]); - double phi = calculatePhi(name, dPhi, stationPhi); - detectors.add(new ATrapezoidDetector(name, zSide*zi, zSide*zo, ri, ro, phi, wi, wo, - alpha, zSide*stationEta, stationPhi)); - } - } - } else if(localName.equals("ABarrelCalorimeter")) { - String name = atts.getValue("n"); - String color = atts.getValue("c"); - int sampling = Integer.parseInt(atts.getValue("sampling")); - int region = Integer.parseInt(atts.getValue("region")); - double rMin = Double.parseDouble(atts.getValue("rMin")); - double rMax = Double.parseDouble(atts.getValue("rMax")); - double zMin = Double.parseDouble(atts.getValue("zMin")); - double zMax = Double.parseDouble(atts.getValue("zMax")); - double eta0 = Double.parseDouble(atts.getValue("eta0")); - double deta = Double.parseDouble(atts.getValue("deta")); - int neta = Integer.parseInt(atts.getValue("neta")); - int meta = Integer.parseInt(atts.getValue("meta")); - double phi0 = Double.parseDouble(atts.getValue("phi0")); - int nphi = Integer.parseInt(atts.getValue("nphi")); - detectors.add(new ABarrelCalorimeterDetector(name, color, sampling, region, rMin, rMax, - zMin, zMax, eta0, deta, neta, meta, phi0, nphi)); - } else if(localName.equals("AEndcapCalorimeter")) { - String name = atts.getValue("n"); - String color = atts.getValue("c"); - int sampling = Integer.parseInt(atts.getValue("sampling")); - int region = Integer.parseInt(atts.getValue("region")); - double rMin = Double.parseDouble(atts.getValue("rMin")); - double rMax = Double.parseDouble(atts.getValue("rMax")); - double zMin = Double.parseDouble(atts.getValue("zMin")); - double zMax = Double.parseDouble(atts.getValue("zMax")); - double eta0 = Double.parseDouble(atts.getValue("eta0")); - double deta = Double.parseDouble(atts.getValue("deta")); - int neta = Integer.parseInt(atts.getValue("neta")); - int meta = Integer.parseInt(atts.getValue("meta")); - double phi0 = Double.parseDouble(atts.getValue("phi0")); - int nphi = Integer.parseInt(atts.getValue("nphi")); - detectors.add(new AEndcapCalorimeterDetector(name, color, sampling, region, rMin, rMax, - zMin, zMax, eta0, deta, neta, meta, phi0, nphi)); - } else if(localName.equals("AEndcapCryostat")) { - String name = atts.getValue("n"); - String color = atts.getValue("c"); - int sampling = Integer.parseInt(atts.getValue("sampling")); - int region = Integer.parseInt(atts.getValue("region")); - double rMin = Double.parseDouble(atts.getValue("rMin")); - double rMax = Double.parseDouble(atts.getValue("rMax")); - double zMin = Double.parseDouble(atts.getValue("zMin")); - double zMax = Double.parseDouble(atts.getValue("zMax")); - int neta = Integer.parseInt(atts.getValue("neta")); - int nphi = Integer.parseInt(atts.getValue("nphi")); - detectors.add(new AEndcapCryostatDetector(name, color, sampling, region, rMin, rMax, zMin, - zMax, neta, nphi)); - } else if(localName.equals("AGapCalorimeter")) { - String name = atts.getValue("n"); - String color = atts.getValue("c"); - int sampling = Integer.parseInt(atts.getValue("sampling")); - int region = Integer.parseInt(atts.getValue("region")); - double rMin = Double.parseDouble(atts.getValue("rMin")); - double rMax = Double.parseDouble(atts.getValue("rMax")); - double zMin = Double.parseDouble(atts.getValue("zMin")); - double zMax = Double.parseDouble(atts.getValue("zMax")); - int eta = Integer.parseInt(atts.getValue("eta")); - double phi0 = Double.parseDouble(atts.getValue("phi0")); - int nphi = Integer.parseInt(atts.getValue("nphi")); - detectors.add(new AGapCalorimeterDetector(name, color, sampling, region, rMin, rMax, - zMin, zMax, eta, phi0, nphi)); - } else if(localName.equals("ABarrelSiliconDetector")) { - String name = atts.getValue("n"); - String color = atts.getValue("c"); - int layer = Integer.parseInt(atts.getValue("layer")); - double length = Double.parseDouble(atts.getValue("length")); - double width = Double.parseDouble(atts.getValue("width")); - double thickness = Double.parseDouble(atts.getValue("thickness")); - int nphi = Integer.parseInt(atts.getValue("nphi")); - int nz = Integer.parseInt(atts.getValue("nz")); - double tilt = Double.parseDouble(atts.getValue("tilt")); - double r0 = Double.parseDouble(atts.getValue("r0")); - double phi0 = Double.parseDouble(atts.getValue("phi0")); - double zMin = Double.parseDouble(atts.getValue("zMin")); - double zMax = Double.parseDouble(atts.getValue("zMax")); - detectors.add(new ABarrelSiliconDetector(name, color, layer, length, width, thickness, nz, - nphi, tilt, r0, phi0, zMin, zMax)); - } else if(localName.equals("AEndcapSiliconDetector")) { - String name = atts.getValue("n"); - String color = atts.getValue("c"); - int layer = Integer.parseInt(atts.getValue("layer")); - double length = Double.parseDouble(atts.getValue("length")); - double width = Double.parseDouble(atts.getValue("width")); - double thickness = Double.parseDouble(atts.getValue("thickness")); - int nphi = Integer.parseInt(atts.getValue("nphi")); - int nz = Integer.parseInt(atts.getValue("nz")); - double rMin = Double.parseDouble(atts.getValue("rMin")); - double rMax = Double.parseDouble(atts.getValue("rMax")); - double phi0 = Double.parseDouble(atts.getValue("phi0")); - double zMin = Double.parseDouble(atts.getValue("zMin")); - double zMax = Double.parseDouble(atts.getValue("zMax")); - detectors.add(new AEndcapSiliconDetector(name, color, layer, length, width, thickness, nz, - nphi, rMin, rMax, phi0, zMin, zMax)); - } else if(localName.equals("ABarrelTRTDetector")) { - String name = atts.getValue("n"); - String color = atts.getValue("c"); - int layer = Integer.parseInt(atts.getValue("layer")); - int nphi = Integer.parseInt(atts.getValue("nphi")); - double rMin = Double.parseDouble(atts.getValue("rMin")); - double rMax = Double.parseDouble(atts.getValue("rMax")); - double phiIn = Double.parseDouble(atts.getValue("phiIn")); - double phiOut = Double.parseDouble(atts.getValue("phiOut")); - double zMin = Double.parseDouble(atts.getValue("zMin")); - double zMax = Double.parseDouble(atts.getValue("zMax")); - detectors.add(new ABarrelTRTDetector(name, color, layer, nphi, rMin, rMax, phiIn, phiOut, zMin, zMax)); - } else if(localName.equals("AEndcapTRTDetector")) { - String name = atts.getValue("n"); - String color = atts.getValue("c"); - int layer = Integer.parseInt(atts.getValue("layer")); - int nphi = Integer.parseInt(atts.getValue("nphi")); - double rMin = Double.parseDouble(atts.getValue("rMin")); - double rMax = Double.parseDouble(atts.getValue("rMax")); - double phi0 = Double.parseDouble(atts.getValue("phi0")); - double zMin = Double.parseDouble(atts.getValue("zMin")); - double zMax = Double.parseDouble(atts.getValue("zMax")); - detectors.add(new AEndcapTRTDetector(name, color, layer, nphi, rMin, rMax, phi0, zMin, zMax)); - } else if(localName.equals("ADisc")) { - String name=atts.getValue("n"); - String projection=atts.getValue("p"); - String color=atts.getValue("c"); - double rInner=Double.parseDouble(atts.getValue("rIn")); - double rOuter=Double.parseDouble(atts.getValue("rOut")); - int nInner=Integer.parseInt(atts.getValue("nIn")); - int nOuter=Integer.parseInt(atts.getValue("nOut")); - - detectors.add(new ADiscDetector(name, projection, color, rInner, rOuter, nInner, nOuter)); - } else if(localName.equals("ARectangle")) { - String name=atts.getValue("n"); - String projection=atts.getValue("p"); - String color=atts.getValue("c"); - double xMin=Double.parseDouble(atts.getValue("xMin")); - double xMax=Double.parseDouble(atts.getValue("xMax")); - double yMin=Double.parseDouble(atts.getValue("yMin")); - double yMax=Double.parseDouble(atts.getValue("yMax")); - boolean xReflect=atts.getValue("xR").equals("YES"); - boolean yReflect=atts.getValue("yR").equals("YES"); - - detectors.add(new ARectangleDetector(name, projection, color, xMin, xMax, yMin, yMax)); - if(xReflect) detectors.add(new ARectangleDetector(name, projection, color, -xMin, -xMax, yMin, - yMax)); - if(yReflect) detectors.add(new ARectangleDetector(name, projection, color, xMin, xMax, -yMin, - -yMax)); - if(xReflect&&yReflect) detectors.add(new ARectangleDetector(name, projection, color, -xMin, - -xMax, -yMin, -yMax)); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ARectangleDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ARectangleDetector.java deleted file mode 100755 index 3af8f2f9b901ad263996e5e419a585908317c19a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ARectangleDetector.java +++ /dev/null @@ -1,49 +0,0 @@ -package atlantis.geometry; - -import atlantis.graphics.ACoord; -import atlantis.utils.AMath; - -public class ARectangleDetector extends ADetector -{ - double xMin; - double xMax; - double yMin; - double yMax; - - ARectangleDetector(String name, String projection, String color, double xMin, double xMax, double yMin, double yMax) - { - super(name, projection, color); - this.xMin = xMin; - this.xMax = xMax; - this.yMin = yMin; - this.yMax = yMax; - } - - protected ACoord getRZUser() - { - return getUser("RZ"); - } - - protected ACoord getFZUser() - { - return getUser("FZ"); - } - - protected ACoord getXZUser() - { - return getUser("XZ"); - } - - protected ACoord getYZUser() - { - return getUser("YZ"); - } - - protected ACoord getUser(String proj) - { - if (!projection.equals(proj)) - return ACoord.NO_DATA; - return new ACoord(AMath.xBox((xMin + xMax) / 2., (xMax - xMin) / 2.), AMath.yBox((yMin + yMax) / 2., (yMax - yMin) / 2.)); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ATBxDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ATBxDetector.java deleted file mode 100755 index e4c3dc8204e58032c93698c0e45022a15ea43c66..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ATBxDetector.java +++ /dev/null @@ -1,81 +0,0 @@ -package atlantis.geometry; - -import atlantis.graphics.ACoord; -import atlantis.utils.AMath; - -/** - * Special t shape Box used for MDT chambers near the feet. - * These are only different in th FZ projection - */ - -public class ATBxDetector extends ABoxDetector { - - double zis; - double zos; - double ws; - double or; - - public ATBxDetector(String name, double zMin, double zMax, double rMin, - double rMax, double phi, double excl, double size, double zis, double zos, - double ws, double or, int etaIndex, int phiIndex) { - super(name, zMin, zMax, rMin, rMax, phi, excl, size, etaIndex, phiIndex); - this.zis=zis; - this.zos=zos; - this.ws=ws; - this.or=or; - } - - protected ACoord getFZUser() { - double[][] hv=new double[2][8]; - double cosPhi=Math.cos(phi); - double sinPhi=Math.sin(phi); - double d=size/2.; - double r=rMin; - double x=r*cosPhi-excl*sinPhi; - double y=r*sinPhi+excl*cosPhi; - double dsinPhi=d*sinPhi; - double dcosPhi=d*cosPhi; - double phi1=Math.toDegrees(Math.atan2(y-dcosPhi, x+dsinPhi)); - double phi2=Math.toDegrees(Math.atan2(y+dcosPhi, x-dsinPhi)); - - if(phi1<0.) phi1+=360.; - if(phi2<0.) phi2+=360.; - if(phi1-phi2>180.) phi1-=360.; - if(phi2-phi1>180.) phi2-=360.; - double phiLower=Math.min(phi1, phi2); - double phiUpper=Math.max(phi1, phi2); - double phiMid=phiLower+ws/size*(phiUpper-phiLower); - hv[0][0]=zMin; - hv[0][1]=zMin; - hv[0][2]=zis; - hv[0][3]=zis; - hv[0][4]=zos; - hv[0][5]=zos; - hv[0][6]=zMax; - hv[0][7]=zMax; - if(or>90.) { - phiMid=phiLower+ws/size*(phiUpper-phiLower); - hv[1][0]=phiUpper; - hv[1][1]=phiMid; - hv[1][2]=phiMid; - hv[1][3]=phiLower; - hv[1][4]=phiLower; - hv[1][5]=phiMid; - hv[1][6]=phiMid; - hv[1][7]=phiUpper; - } else { - phiMid=phiUpper-ws/size*(phiUpper-phiLower); - hv[1][0]=phiLower; - hv[1][1]=phiMid; - hv[1][2]=phiMid; - hv[1][3]=phiUpper; - hv[1][4]=phiUpper; - hv[1][5]=phiMid; - hv[1][6]=phiMid; - hv[1][7]=phiLower; - } - - return new ACoord(hv); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ATrapezoidDetector.java b/graphics/AtlantisJava/src/atlantis/geometry/ATrapezoidDetector.java deleted file mode 100755 index 7850795a05c0e4cfa84775766b8f5d5d7a6296df..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ATrapezoidDetector.java +++ /dev/null @@ -1,211 +0,0 @@ -package atlantis.geometry; - - -import atlantis.utils.AMath; -import atlantis.parameters.*; -import atlantis.graphics.ACoord; - -/** - * In ATLAS Trapezoids are TGC and MDT in the endcap. - */ - -public class ATrapezoidDetector extends ADetector { - - double zMin; - double zMax; - double rMin; - double rMax; - double phi; - double sizeS; - double sizeL; - double alpha; - int stationEta; - int stationPhi; - int sector; - - public ATrapezoidDetector(String name, double zMin, double zMax, double rMin, - double rMax, double phi, double sizeS, double sizeL, - double alpha, int stationEta, int stationPhi) { - super(name, " ", name.substring(0, 3)); - this.zMin = zMin; - this.zMax = zMax; - this.rMin = rMin; - this.rMax = rMax; - this.phi = phi; - this.sizeS = sizeS; - this.sizeL = sizeL; - this.alpha = alpha; - this.stationEta = stationEta; - this.stationPhi = stationPhi; - this.sector = ( (int) ( (phi + Math.PI / 16) / (Math.PI / 8))) % 16; - } - - protected boolean equalsYX(ADetector o) { - if (o instanceof ATrapezoidDetector) { - ATrapezoidDetector that = (ATrapezoidDetector) o; - return this.rMin == that.rMin && - this.rMax == that.rMax && - this.phi == that.phi && - this.sizeS == that.sizeS && - this.sizeL == that.sizeL; - } else - return false; - } - - protected boolean equalsRZ(ADetector o) { - if (o instanceof ATrapezoidDetector) { - ATrapezoidDetector that = (ATrapezoidDetector) o; - return this.rMin == that.rMin && - this.rMax == that.rMax && - this.zMin == that.zMin && - this.zMax == that.zMax && - this.alpha == that.alpha; - } - else - return false; - } - - protected ACoord getRZUser() { - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi - phiMid); - double sign = -1.; - if (phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) - sign = +1.; - return getXZRZUser(sign); - } - - protected ACoord getXZUser() { - AParameter p=parameterStore.get("XZ", "Phi"); - - // display muon data when phi is in the middle of a sector - if(p.getD() % 22.5 < 1e-2) { - int sect=(int)Math.round((p.getD() % 360.) / 22.5); - if (sector == sect) { - return getXZRZUser(1.); - } - else if (sector == sect - 8 || sector == sect + 8) { - return getXZRZUser( -1.); - } - } - return ACoord.NO_DATA; - } - - protected ACoord getXZRZUser(double sign) { - if (alpha == 0.) { - return new ACoord( - AMath.xBox( (zMin + zMax) / 2., (zMax - zMin) / 2.), - AMath.yBox(sign * (rMin + rMax) / 2., sign * (rMax - rMin) / 2.)); - } - else { - double[][] hv = new double[2][]; - double zMid = (zMin + zMax) / 2.; - double rMid = (rMin + rMax) / 2.; - double dRho = (rMax - rMin) / 2; - double dZ = (zMax - zMin) / 2; - double sinAlpha = Math.sin(Math.toRadians(alpha)); - double cosAlpha = Math.cos(Math.toRadians(alpha)); - - if (zMid * rMid > 0.) - sinAlpha *= -1.; - - hv[0] = new double[] { - zMid - sinAlpha * dRho - cosAlpha * dZ, - zMid - sinAlpha * dRho + cosAlpha * dZ, - zMid + sinAlpha * dRho + cosAlpha * dZ, - zMid + sinAlpha * dRho - cosAlpha * dZ}; - hv[1] = new double[] { - sign * (rMid + cosAlpha * dRho - sinAlpha * dZ), - sign * (rMid + cosAlpha * dRho + sinAlpha * dZ), - sign * (rMid - cosAlpha * dRho + sinAlpha * dZ), - sign * (rMid - cosAlpha * dRho - sinAlpha * dZ)}; - return new ACoord(hv); - } - } - - protected ACoord getFZUser() { - double deltaPhi = Math.max(Math.atan2(sizeL / 2., rMax), - Math.atan2(sizeS / 2., rMin)); - - if (alpha == 0.) { - return new ACoord( - AMath.xBox( (zMin + zMax) / 2., (zMax - zMin) / 2.), - AMath.yBox( Math.toDegrees(phi), Math.toDegrees(deltaPhi) )); - } - else { - double[][] hv = new double[2][]; - double zMid = (zMin + zMax) / 2.; - double rMid = (rMin + rMax) / 2.; - double dRho = (rMax - rMin) / 2; - double dZ = (zMax - zMin) / 2; - double sinAlpha = Math.sin(Math.toRadians(alpha)); - double cosAlpha = Math.cos(Math.toRadians(alpha)); - - if (zMid * rMid > 0.) - sinAlpha *= -1.; - - hv[0] = new double[] { - zMid - sinAlpha * dRho - cosAlpha * dZ, - zMid - sinAlpha * dRho - cosAlpha * dZ, - zMid + sinAlpha * dRho + cosAlpha * dZ, - zMid + sinAlpha * dRho + cosAlpha * dZ}; - hv[1] = new double[] { - Math.toDegrees(phi - deltaPhi), - Math.toDegrees(phi + deltaPhi), - Math.toDegrees(phi + deltaPhi), - Math.toDegrees(phi - deltaPhi)}; - return new ACoord(hv); - } - } - - protected ACoord getYXUser() { - return getYXUser(0); - } - - protected ACoord getFRUser() { - return convertYXToFR(getYXUser(1)); - } - - private ACoord getYXUser(int flag) { - int[] split= {12, 1, 12, 1}; - int numPoints=4; - boolean splitIt=parameterStore.get("YX", "FishEye").getStatus()||parameterStore.get("YX", "Clock").getStatus() - ||flag==1; - - if(splitIt) - numPoints=26; - double[] temp=new double[4]; - double[][] hv=new double[2][numPoints]; - double cosPhi=Math.cos(phi); - double sinPhi=Math.sin(phi); - double d=sizeS/2.; - double r=rMin; - double x=r*cosPhi; - double y=r*sinPhi; - double dx=d*sinPhi; - double dy=d*cosPhi; - - hv[0][0]=x+dx; - hv[1][0]=y-dy; - hv[0][1]=x-dx; - hv[1][1]=y+dy; - r=rMax; - x=r*cosPhi; - y=r*sinPhi; - d=sizeL/2.; - dx=d*sinPhi; - dy=d*cosPhi; - - hv[0][3]=x+dx; - hv[1][3]=y-dy; - hv[0][2]=x-dx; - hv[1][2]=y+dy; - if(splitIt) - for(int j=0; j<2; ++j) { - for(int k=0; k<4; ++k) - temp[k]=hv[j][k]; - AMath.splitArrayIntoPieces(temp, hv[j], split); - } - return new ACoord(hv); - } -} - diff --git a/graphics/AtlantisJava/src/atlantis/geometry/ATrapezoidDetectors.java b/graphics/AtlantisJava/src/atlantis/geometry/ATrapezoidDetectors.java deleted file mode 100755 index 943c34722fa6ea73c4f65b3f3ead298d0b8ab574..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/ATrapezoidDetectors.java +++ /dev/null @@ -1,163 +0,0 @@ -package atlantis.geometry; - -// not quite correct for CSC (alpha!=0.) in YX and FR - -import atlantis.parameters.AParameter; -import atlantis.parameters.APar; -import atlantis.utils.AMath; -import java.util.*; - -/** - * see comments in ABoxDetectors - */ - -public final class ATrapezoidDetectors extends ADetectors { - - private int numRZTypes; - private int[] typeRZ; - private int numYXTypes; - private int[] typeYX; - - private ATrapezoidDetector[] trapezoid; - - public ATrapezoidDetectors(List detectors) { - super(filterTrapezoidDetectors(detectors)); - trapezoid= new ATrapezoidDetector[det.length]; - for(int i=0;i<trapezoid.length;++i) - trapezoid[i]=(ATrapezoidDetector)det[i]; - - - typeYX=new int[numData]; - for(int i=0; i<numData; ++i) - typeYX[i]=-1; - - numYXTypes=0; - for(int i=0; i<numData; ++i) - if(typeYX[i]==-1) { - typeYX[i]=numYXTypes; - for(int j=i+1; j<numData; ++j) - if(typeYX[j]==-1&&det[i].equalsYX(det[j])) - typeYX[j]=numYXTypes; - numYXTypes++; - } - - typeRZ=new int[numData]; - for(int i=0; i<numData; ++i) - typeRZ[i]=-1; - - numRZTypes=0; - for(int i=0; i<numData; ++i) - if(typeRZ[i]==-1) { - typeRZ[i]=numRZTypes; - for(int j=i+1; j<numData; ++j) - if(typeRZ[j]==-1&&det[i].equalsRZ(det[j])) - typeRZ[j]=numRZTypes; - numRZTypes++; - } - } - - private static ADetector[] filterTrapezoidDetectors(List detectors) { - - List tempDetectors=new ArrayList(detectors.size()); - Iterator it=detectors.iterator(); - - while(it.hasNext()) { - Object o=it.next(); - if(o instanceof ATrapezoidDetector) tempDetectors.add(o); - } - return (ADetector[])tempDetectors.toArray(new ADetector[tempDetectors.size()]); - } - - private void makeDrawListYX() { - int mode=parameterStore.get("YX", "Mode").getI(); - - if(mode==0) - numDraw=0; - else { - int num=0; - for(int i=0; i<numData; ++i) { - double z=trapezoid[i].zMin; - String name=det[i].getName().substring(4, 6); - if(z>0.) - if((mode==1&&name.equals("T4"))||(mode==2&&name.equals("T1")) - ||(mode==3&&name.equals("T2"))||(mode==4&&name.equals("T3")) - ||(mode==5&&(name.equals("EI")||name.equals("CS")))||(mode==6&&name.equals("EE")) - ||(mode==7&&name.equals("EM"))||(mode==8&&name.equals("EO"))) - listdl[num++]=i; - numDraw=num; - } - } - } - - private void makeDrawListXZ() { - AParameter p=parameterStore.get("XZ", "Phi"); - - // display muon data when phi is in the middle of a sector - if(p.getD() % 22.5 < 1e-2) { - int sect=(int)Math.round((p.getD() % 360.) / 22.5); - int num=0; - for(int i=0; i<numData; i++) { - int s=trapezoid[i].sector; - - if(s==sect||s==sect-8||s==sect+8) { - listdl[num++]=i; - } - } - numDraw=num; - } else { - numDraw=0; - } - } - - private void makeDrawListRZ() { - // first make the draw list - // for each type find out if it has both +ve and negative sign - int[] pos=new int[typeRZ.length]; - int[] neg=new int[typeRZ.length]; - double phiMid=Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - - for(int i=0; i<numRZTypes; ++i) - neg[i]=pos[i]=-1; - - for(int i=0; i<numData; ++i) { - double phiDiff=Math.abs(trapezoid[i].phi-phiMid); - - if(phiDiff<Math.PI/2.||phiDiff>3*Math.PI/2.) - pos[typeRZ[i]]=i; - else - neg[typeRZ[i]]=i; - } - - int num=0; - for(int i=0; i<numRZTypes; ++i) { - if(pos[i]!=-1) - listdl[num++]=pos[i]; - if(neg[i]!=-1) - listdl[num++]=neg[i]; - } - numDraw=num; - } - - private void makeDrawListFZ() { - if(parameterStore.get("FZ", "Mode").getI()==0) { - constructDefaultDrawList(); - } else { - numDraw=0; - } - } - - protected void makeDrawList(String projection) { - if (projection.equals("YX") || projection.equals("FR") ) - makeDrawListYX(); - else if (projection.equals("FZ")) - makeDrawListFZ(); - else if (projection.equals("RZ")) - makeDrawListRZ(); - else if (projection.equals("XZ")) - makeDrawListXZ(); - else - numDraw=0; - } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/geometry/package.html b/graphics/AtlantisJava/src/atlantis/geometry/package.html deleted file mode 100644 index 8c66987e1f11e98c22a2e5ac0188377c515be57d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/geometry/package.html +++ /dev/null @@ -1,8 +0,0 @@ -<html> -<head></head> -<body> -<p>Classes handling the detector description - ADetectorSystem -contains the information used to draw detector components on the -screen.</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/globals/AGlobals.java b/graphics/AtlantisJava/src/atlantis/globals/AGlobals.java deleted file mode 100644 index ce6bce2447e285bd0d72daf92093fe9ec8b8402a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/globals/AGlobals.java +++ /dev/null @@ -1,202 +0,0 @@ -/** - * - */ -package atlantis.globals; - -import java.awt.Frame; -import java.awt.GraphicsEnvironment; - - -/** - * Provides access to Atlantis global variables in a slightly less bad way than - * using the main atlantis.Atlantis class. - * - * @author waugh - * - */ -public class AGlobals { - /** The singleton instance. No point in lazy instantiation. */ - private static AGlobals globals = new AGlobals(); - - /** Get the singleton instance */ - public static AGlobals instance() {return globals;} - - /** Prevent instantiation except through singleton accessor. */ - private AGlobals() {} - - /** Normally the directory that Atlantis was loaded from. */ - private String homeDirectory; - - /** The version of AtlantisJava from Svn. */ - private String version; - - /** Flag for displaying HLTAutoKey data. */ - private boolean showHLTAutoKeys = false; - - /** Flag for using simple output, used by Minerva. */ - private int SIMPLE_OUTPUT = 0; - - /** This is the URL that is used as default for "Read events from URL". */ - private String LIVE_POINT_1_EVENTS_URL; - - /** The path to the user's configuration file. */ - private String userConfigFile; - - /** Whether to use OpenGL. */ - private boolean useOpenGL; - - /** Whether we are in demo mode. */ - private boolean demoMode; - - /** Component representing the GUI, if any. */ - private Frame guiFrame; - - /** - * Set the Atlantis home directory, normally the directory that Atlantis was loaded from. - * - * @param homeDirectory the Atlantis home directory - */ - public void setHomeDirectory(String homeDirectory) { - this.homeDirectory = homeDirectory; - } - - /** - * Get the Atlantis home directory, normally the directory that Atlantis was loaded from. - * - * @return the Atlantis home directory - */ - public String getHomeDirectory() { - return homeDirectory; - } - - /** - * Get AtlantisJava version. - * @return the Svn version, set in Atlantis.main() - */ - public String getVersion() { - return version; - } - - /** - * Set AtlantisJava version, called from Atlantis.main(). - * @param version the version to set - */ - public void setVersion(String version) { - this.version = version; - } - - /** - * Whether to show data with storeGateKey containing "HLTAutoKey". - * - * @return true to show, false to ignore - */ - public boolean showHLTAutoKeys() { - return showHLTAutoKeys; - } - - /** - * Whether to show data with storeGateKey containing "HLTAutoKey". - * - * @param showHLTAutoKeys true to show, false to ignore - */ - public void setHLTAutoKeys(boolean showHLTAutoKeys) { - this.showHLTAutoKeys = showHLTAutoKeys; - } - - /** - * @return the sIMPLE_OUTPUT - */ - public int getSimpleOutput() { - return SIMPLE_OUTPUT; - } - - /** - * @param sIMPLE_OUTPUT the sIMPLE_OUTPUT to set - */ - public void setSimpleOutput(int sIMPLE_OUTPUT) { - SIMPLE_OUTPUT = sIMPLE_OUTPUT; - } - - /** - * @return the URL for the Point 1 live events server - */ - public String getLivePoint1EventsURL() { - return LIVE_POINT_1_EVENTS_URL; - } - - /** - * @param livePoint1EventsURL the URL for the Point 1 live events server - */ - public void setLivePoint1EventsURL(String livePoint1EventsURL) { - LIVE_POINT_1_EVENTS_URL = livePoint1EventsURL; - } - - /** - * @param userConfigFilePath the path to the user's configuration file - */ - public void setUserConfigFile(String userConfigFilePath) { - this.userConfigFile = userConfigFilePath; - } - - /** - * @return the path to the user's configuration file - */ - public String getUserConfigFile() { - return this.userConfigFile; - } - - /** - * @return true if we should be using OpenGL - */ - public boolean getUseOpenGL() { - return useOpenGL; - } - - /** - * @param useOpenGL true to use OpenGL, false otherwise - */ - public void setUseOpenGL(boolean useOpenGL) { - this.useOpenGL = useOpenGL; - } - - /** - * Check whether we are in headless mode - * @return true if headless (no graphics available) - */ - public static boolean isAtlantisHeadless() { - return GraphicsEnvironment.isHeadless(); - } - - /** - * Whether the demo mode loop is running. - * @return true if in demo mode - */ - public boolean isDemoMode() { - return demoMode; - } - - /** - * Signal whether the demo loop is running. - * @param demoMode true when starting loop, false when stopping - */ - public void setDemoMode(boolean demoMode) { - this.demoMode = demoMode; - } - - /** - * For use as parent of dialogues, avoiding dependency on AGUI class itself. - * @return the GUI frame - */ - public Frame getGuiFrame() { - return guiFrame; - } - - /** - * Set the GUI frame, called from AGUI when the instance is created. - * @param guiFrame the GUI frame - */ - public void setGuiFrame(Frame guiFrame) { - this.guiFrame = guiFrame; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/globals/package.html b/graphics/AtlantisJava/src/atlantis/globals/package.html deleted file mode 100644 index e763965d1afb43aaddc28398c98d1edf8af58d7c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/globals/package.html +++ /dev/null @@ -1,13 +0,0 @@ -<html> -<head></head> -<body> -<p>Provides access to Atlantis global variables.</p> -<p>This has been introduced as part of a process of breaking unwanted - dependencies between packages. This package can contain any required - global state so that other packages (atlantis.data etc.) do not need - to depend on the "atlantis" package that contains the main Atlantis - class, and which unavoidably depends on the rest of the - packages.</p> -<p>With luck this will prove not to be necessary in the long term!</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/graphics/AAbstractGraphics2D.java b/graphics/AtlantisJava/src/atlantis/graphics/AAbstractGraphics2D.java deleted file mode 100755 index ddfeba3edb9c0ba8c12dd4caf7c7919b1c213db3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/AAbstractGraphics2D.java +++ /dev/null @@ -1,315 +0,0 @@ -package atlantis.graphics; - -import java.awt.*; -import java.awt.font.*; -import java.awt.geom.*; -import java.awt.image.*; -import java.awt.image.renderable.*; - -/** - * This graphics is used when nothing should really be drawn on the screen - */ - -public abstract class AAbstractGraphics2D extends Graphics2D { - - public void transform(AffineTransform z) { - if(true) throw new RuntimeException(); - } - - public void fill(Shape z) { - if(true) throw new RuntimeException(); - } - - public void draw(Shape z) { - if(true) throw new RuntimeException(); - } - - public void drawImage(BufferedImage a, BufferedImageOp b, int c, int z) { - if(true) throw new RuntimeException(); - } - - public boolean drawImage(Image a, AffineTransform b, ImageObserver z) { - if(true) throw new RuntimeException(); - return false; - } - - public void drawRenderedImage(RenderedImage a, AffineTransform z) { - if(true) throw new RuntimeException(); - } - - public void drawRenderableImage(RenderableImage a, AffineTransform z) { - if(true) throw new RuntimeException(); - } - - public void drawString(java.text.AttributedCharacterIterator a, float b, float z) { - if(true) throw new RuntimeException(); - } - - public void drawString(String a, int b, int z) { - if(true) throw new RuntimeException(); - } - - public void drawString(String a, float b, float z) { - if(true) throw new RuntimeException(); - } - - public void drawString(java.text.AttributedCharacterIterator a, int b, int z) { - if(true) throw new RuntimeException(); - } - - public void drawGlyphVector(GlyphVector a, float b, float z) { - if(true) throw new RuntimeException(); - } - - public boolean hit(Rectangle a, Shape b, boolean z) { - if(true) throw new RuntimeException(); - return false; - } - - public GraphicsConfiguration getDeviceConfiguration() { - if(true) throw new RuntimeException(); - return null; - } - - public void setComposite(Composite z) { - if(true) throw new RuntimeException(); - } - - public void setPaint(Paint z) { - if(true) throw new RuntimeException(); - } - - public void setStroke(Stroke z) { - if(true) throw new RuntimeException(); - } - - public void setRenderingHint(RenderingHints.Key a, Object z) { - if(true) throw new RuntimeException(); - } - - public Object getRenderingHint(RenderingHints.Key z) { - if(true) throw new RuntimeException(); - return null; - } - - public void setRenderingHints(java.util.Map z) { - if(true) throw new RuntimeException(); - } - - public void addRenderingHints(java.util.Map z) { - if(true) throw new RuntimeException(); - } - - public RenderingHints getRenderingHints() { - if(true) throw new RuntimeException(); - return null; - } - - public void translate(double a, double z) { - if(true) throw new RuntimeException(); - } - - public void translate(int a, int z) { - if(true) throw new RuntimeException(); - } - - public void rotate(double a, double b, double z) { - if(true) throw new RuntimeException(); - } - - public void rotate(double z) { - if(true) throw new RuntimeException(); - } - - public void scale(double a, double z) { - if(true) throw new RuntimeException(); - } - - public void shear(double a, double z) { - if(true) throw new RuntimeException(); - } - - public void setTransform(AffineTransform z) { - if(true) throw new RuntimeException(); - } - - public AffineTransform getTransform() { - if(true) throw new RuntimeException(); - return null; - } - - public Paint getPaint() { - if(true) throw new RuntimeException(); - return null; - } - - public Composite getComposite() { - if(true) throw new RuntimeException(); - return null; - } - - public void setBackground(Color z) { - if(true) throw new RuntimeException(); - } - - public Color getBackground() { - if(true) throw new RuntimeException(); - return null; - } - - public Stroke getStroke() { - if(true) throw new RuntimeException(); - return null; - } - - public void clip(Shape z) { - if(true) throw new RuntimeException(); - } - - public FontRenderContext getFontRenderContext() { - if(true) throw new RuntimeException(); - return null; - } - - public void setColor(Color z) { - if(true) throw new RuntimeException(); - } - - public Graphics create() { - if(true) throw new RuntimeException(); - return null; - } - - public boolean drawImage(Image a, int b, int c, int d, int e, int f, int g, int h, int i, ImageObserver z) { - if(true) throw new RuntimeException(); - return false; - } - - public boolean drawImage(Image a, int b, int c, ImageObserver z) { - if(true) throw new RuntimeException(); - return false; - } - - public boolean drawImage(Image a, int b, int c, Color d, ImageObserver z) { - if(true) throw new RuntimeException(); - return false; - } - - public boolean drawImage(Image a, int b, int c, int d, int e, Color f, ImageObserver z) { - if(true) throw new RuntimeException(); - return false; - } - - public boolean drawImage(Image a, int b, int c, int d, int e, ImageObserver z) { - if(true) throw new RuntimeException(); - return false; - } - - public boolean drawImage(Image a, int b, int c, int d, int e, int f, int g, int h, int i, Color j, ImageObserver z) { - if(true) throw new RuntimeException(); - return false; - } - - public Color getColor() { - if(true) throw new RuntimeException(); - return null; - } - - public void fillRect(int a, int b, int c, int z) { - if(true) throw new RuntimeException(); - } - - public void setPaintMode() { - if(true) throw new RuntimeException(); - } - - public void setXORMode(Color z) { - if(true) throw new RuntimeException(); - } - - public Font getFont() { - if(true) throw new RuntimeException(); - return null; - } - - public void setFont(Font z) { - if(true) throw new RuntimeException(); - } - - public FontMetrics getFontMetrics(Font z) { - if(true) throw new RuntimeException(); - return null; - } - - public Rectangle getClipBounds() { - if(true) throw new RuntimeException(); - return null; - } - - public void clipRect(int a, int b, int c, int z) { - if(true) throw new RuntimeException(); - } - - public void setClip(int a, int b, int c, int z) { - if(true) throw new RuntimeException(); - } - - public void setClip(Shape z) { - if(true) throw new RuntimeException(); - } - - public Shape getClip() { - if(true) throw new RuntimeException(); - return null; - } - - public void copyArea(int a, int b, int c, int d, int e, int z) { - if(true) throw new RuntimeException(); - } - - // public void drawLine(int a,int b,int c,int z) { if (true) throw new RuntimeException(); } - public void clearRect(int a, int b, int c, int z) { - if(true) throw new RuntimeException(); - } - - public void drawRoundRect(int a, int b, int c, int d, int e, int z) { - if(true) throw new RuntimeException(); - } - - public void fillRoundRect(int a, int b, int c, int d, int e, int z) { - if(true) throw new RuntimeException(); - } - - public void drawOval(int a, int b, int c, int z) { - if(true) throw new RuntimeException(); - } - - public void fillOval(int a, int b, int c, int z) { - if(true) throw new RuntimeException(); - } - - public void drawArc(int a, int b, int c, int d, int e, int z) { - if(true) throw new RuntimeException(); - } - - public void fillArc(int a, int b, int c, int d, int e, int z) { - if(true) throw new RuntimeException(); - } - - public void drawPolyline(int[] a, int[] b, int z) { - if(true) throw new RuntimeException(); - } - - public void drawPolygon(int[] a, int[] b, int z) { - if(true) throw new RuntimeException(); - } - - public void fillPolygon(int[] a, int[] b, int z) { - if(true) throw new RuntimeException(); - } - - public void dispose() { - if(true) throw new RuntimeException(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/AClipper.java b/graphics/AtlantisJava/src/atlantis/graphics/AClipper.java deleted file mode 100755 index c525102c7021f33142f198b5800391a768b9ef5f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/AClipper.java +++ /dev/null @@ -1,226 +0,0 @@ -package atlantis.graphics; - -import atlantis.utils.AClipPolygon; -import atlantis.utils.APolygon; -import java.awt.Rectangle; - - -/** - * Implement uniform treatment of Clipping for screen, - * postscript and picking. - */ - -public class AClipper { - double[] upper; - double[] lower; - double[][] x; - boolean[][] below; - boolean[][] within; - boolean[][] above; - double hLower; - double hUpper; - double vLower; - double vUpper; - - public static final int NONE_WITHIN=0; - public static final int MAYBE_WITHIN=1; - public static final int ALL_WITHIN=2; - - public AClipper(double hLower, double hUpper, double vLower, double vUpper) { - - x=new double[2][2]; - upper=new double[2]; - lower=new double[2]; - below=new boolean[2][2]; - within=new boolean[2][2]; - above=new boolean[2][2]; - upper[0]=hUpper; - upper[1]=vUpper; - lower[0]=hLower; - lower[1]=vLower; - this.hUpper=hUpper; - this.hLower=hLower; - this.vUpper=vUpper; - this.vLower=vLower; - } - - public AClipper(Rectangle clipBounds) { - this(clipBounds.getX(), clipBounds.getX()+clipBounds.getWidth(), clipBounds.getY(), - clipBounds.getY()+clipBounds.getHeight()); - } - - public boolean isPointWithin(double h0, double v0) { - return hLower<=h0&&h0<=hUpper&&vLower<=v0&&v0<=vUpper; - } - - public boolean isLineWithin(double h0, double v0, double h1, double v1) { - int roughCheck=fastWithin(h0, v0, h1, v1); - - if(roughCheck==0) return false; - x[0][0]=h0; - x[1][0]=v0; - x[0][1]=h1; - x[1][1]=v1; - if(roughCheck==2) return true; - - update(0); - update(1); - - outer: - while(!lineFullyInside()) { - if(lineFullyOutside()) return false; - - for(int i=0; i<2; i++) - for(int point=0; point<2; point++) { - if(!within[i][point]) { - if(below[i][point]) { - x[1-i][point]+=((x[1-i][1-point]-x[1-i][point])/(x[i][1-point]-x[i][point])) - *(lower[i]-x[i][point]); - x[i][point]=lower[i]; - } else if(above[i][point]) { - x[1-i][point]+=((x[1-i][1-point]-x[1-i][point])/(x[i][1-point]-x[i][point])) - *(upper[i]-x[i][point]); - x[i][point]=upper[i]; - } - update(point); - continue outer; - } - } - } - // don't allow non-zero length line to be given zero length - // by th clipper - if((x[0][0]==x[0][1])&&(x[1][0]==x[1][1])) - return false; - return true; - } - - private void update(int p) { - for(int i=0; i<2; i++) { - below[i][p]=false; - within[i][p]=false; - above[i][p]=false; - if(x[i][p]<lower[i]) - below[i][p]=true; - else if(x[i][p]>upper[i]) - above[i][p]=true; - else - within[i][p]=true; - } - } - - public boolean lineFullyInside() { - boolean inside=true; - - for(int i=0; i<2; i++) - for(int j=0; j<2; j++) - inside=inside&&within[i][j]; - return inside; - } - - public boolean lineFullyOutside() { - boolean outside=false; - - for(int i=0; i<2; i++) { - outside=outside||(below[i][0]&&below[i][1]); - outside=outside||(above[i][0]&&above[i][1]); - } - return outside; - } - - public double[][] getHV() { - return x; - } - - public double getH0() { - return x[0][0]; - } - - public double getV0() { - return x[1][0]; - } - - public double getH1() { - return x[0][1]; - } - - public double getV1() { - return x[1][1]; - } - - public int fastWithin(double h0, double v0, double h1, double v1) { - if(h0<hLower&&h1<hLower) return NONE_WITHIN; - if(h0>hUpper&&h1>hUpper) return NONE_WITHIN; - if(v0<vLower&&v1<vLower) return NONE_WITHIN; - if(v0>vUpper&&v1>vUpper) return NONE_WITHIN; - if(hLower<=h0&&h0<=hUpper&&hLower<=h1&&h1<=hUpper&&vLower<=v0&&v0<=vUpper&&vLower<=v1 - &&v1<=vUpper) return ALL_WITHIN; - return MAYBE_WITHIN; - } - - public int fastWithin(double[] h, double[] v, int numPoints) { - if(numPoints==0) return NONE_WITHIN; - boolean firstWithin=hLower<=h[0]&&h[0]<=hUpper&&vLower<=v[0]&&v[0]<=vUpper; - - if(firstWithin) { - for(int i=1; i<numPoints; ++i) - if(!(hLower<=h[i]&&h[i]<=hUpper&&vLower<=v[i]&&v[i]<=vUpper)) return MAYBE_WITHIN; - return ALL_WITHIN; - } else { - if(h[0]<hLower) { - int num=1; - - for(int i=1; i<numPoints; ++i) - if(h[i]<hLower) - num++; - else - break; - if(num==numPoints) return NONE_WITHIN; - } - if(h[0]>hUpper) { - int num=1; - - for(int i=1; i<numPoints; ++i) - if(h[i]>hUpper) - num++; - else - break; - if(num==numPoints) return NONE_WITHIN; - } - if(v[0]<vLower) { - int num=1; - - for(int i=1; i<numPoints; ++i) - if(v[i]<vLower) - num++; - else - break; - if(num==numPoints) return NONE_WITHIN; - } - if(v[0]>vUpper) { - int num=1; - - for(int i=1; i<numPoints; ++i) - if(v[i]>vUpper) - num++; - else - break; - if(num==numPoints) return NONE_WITHIN; - } - return MAYBE_WITHIN; - } - } - - public ACoord clipPolygon(double[] h, double[] v, int numPoints) { - double[] clipH=new double[] { lower[0], upper[0], upper[0], lower[0] }; - double[] clipV=new double[] { lower[1], lower[1], upper[1], upper[1] }; - AClipPolygon clipArea=new AClipPolygon(clipH, clipV); - APolygon badPolygon=new APolygon(h, v); - - badPolygon.clip(clipArea); - h=badPolygon.getX(); - v=badPolygon.getY(); - return new ACoord(h, v); - } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/graphics/ACoord.java b/graphics/AtlantisJava/src/atlantis/graphics/ACoord.java deleted file mode 100755 index 71aa2156379203e4df32bd188cd9f70c17abe275..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/ACoord.java +++ /dev/null @@ -1,355 +0,0 @@ -package atlantis.graphics; - -import atlantis.parameters.APar; -import atlantis.utils.*; - -/** - * Used to store a collection of User or display 2D coordinates of hits or tracks - * together with their indices in the corresponding AData - * (used for picking, colors etc.). N.B. the storage model is different for - * SYMBOLS/LINES(with two end points) than for POLYLINES/POLYGONS for - * efficiency reasons. Transformations between user/display coordinaates are based - * on ACoords. - */ -public class ACoord { - - private static ALogger logger = ALogger.getLogger(ACoord.class); - - public double[][][] hv; - public int[] index; - protected int type=POLYGONS; - public ADrawable source; - - final static public int SYMBOLS=1; - final static public int LINES=2; - final static public int POLYLINES=3; - final static public int POLYGONS=4; - final static public int DOTTED_POLYGONS=5; // for drawing missing ET in V-Plot - final static public int SMOOTH_POLYLINES=6; - final static public int TRANSPARENT_POLYGONS=7; - - final static public ACoord NO_DATA=new ACoord(new double[2][0][0], new int[0]); - final static public ACoord NO_POLYGONS=new ACoord(new double[2][0][0], new int[0]); - final static public ACoord NO_POLYLINES=new ACoord(new double[2][0][0], new int[0]); - final static public ACoord[] NO_HISTOGRAMS=new ACoord[0]; - - protected static APar parameterStore = APar.instance(); - - public ACoord(double h, double v, int index) { - this(h, v); - this.index=new int[] {index}; - } - - public ACoord(double h, double v) { - this.hv=new double[2][1][1]; - this.hv[0][0][0]=h; - this.hv[1][0][0]=v; - this.index=null; - this.type=SYMBOLS; - } - - public ACoord(double[] h, double[] v) { - this.hv=new double[2][1][]; - this.hv[0][0]=h; - this.hv[1][0]=v; - this.index=new int[] {0}; - } - - private ACoord(double[][] hv, int[] index) { - if(hv.length!=2) throw new IllegalArgumentException("hv.length="+hv.length); - this.hv = new double[2][1][0]; - this.hv[0][0]=hv[0]; - this.hv[1][0]=hv[1]; - this.index=index; - } - - private ACoord(double[][] hv, int[] index, ADrawable source) { - this(hv, index); - this.source=source; - } - - public ACoord(double[][] hv) { - if(hv.length!=2) throw new IllegalArgumentException("hv.length="+hv.length); - this.hv = new double[2][1][]; - this.hv[0][0]=hv[0]; - this.hv[1][0]=hv[1]; - this.index=null; - } - - public ACoord(double[][][] hv, int[] index) { - if(hv.length!=2) throw new IllegalArgumentException("hv.length="+hv.length); - this.hv=hv; - this.index=index; - } - - public ACoord(double[][][] hv, int[] index, ADrawable source) { - this(hv, index); - this.source=source; - } - - public ACoord(double[][][] hv) { - if(hv.length!=2) throw new IllegalArgumentException("hv.length="+hv.length); - this.hv=hv; - this.index=null; - } - - private ACoord(ACoord a) { - this.hv=new double[a.hv.length][][]; - for(int i=0; i<a.hv.length; i++) { - this.hv[i]=new double[a.hv[i].length][]; - for(int j=0; j<a.hv[i].length; j++) { - this.hv[i][j]=new double[a.hv[i][j].length]; - for(int k=0; k<a.hv[i][j].length; k++) - this.hv[i][j][k]=a.hv[i][j][k]; - } - } - this.index=new int[a.index.length]; - for(int i=0; i<a.index.length; i++) - this.index[i]=a.index[i]; - this.type=a.type; - this.source=a.source; - } - - public ACoord(double[][] hv, int[] index, ADrawable source, int type) { - this(hv, index, source); - this.type=type; - } - - public ACoord(double[][][] hv, int[] index, ADrawable source, int type) { - this(hv, index, source); - this.type=type; - } - - public ACoord(double[] h, double[] v, int[] index, ADrawable source) { - if(h.length!=v.length) - throw new IllegalArgumentException("h.length "+h.length+" !=v.length "+v.length); - if(h.length!=index.length) - throw new IllegalArgumentException("h.length "+h.length+" !=index.length "+index.length); - this.hv=new double[2][1][]; - this.hv[0][0]=h; - this.hv[1][0]=v; - this.index=index; - this.type=SYMBOLS; - this.source=source; - } - - public void print() { - for(int j=0; j<hv[0].length; j++) { - logger.debug(" index = "+index[j]); - for(int i=0; i<2; i++) { - if(i==0) - logger.debug("h "); - else - logger.debug("v "); - for(int k=0; k<hv[0][j].length; k++) - logger.debug((float)hv[i][j][k]+"\t"); - } - } - } - - // careful this does not make an independent copy - public ACoord(ACoord a, ACoord b) { - this.hv=new double[2][a.hv[0].length+b.hv[0].length][]; - this.index=new int[a.hv[0].length+b.hv[0].length]; - this.type=a.type; - this.source=a.source; - - for(int i=0; i<2; i++) { - int num=0; - - for(int j=0; j<a.hv[i].length; j++) { - this.hv[i][num]=a.hv[i][j]; - this.index[num]=a.index[j]; - num++; - } - for(int j=0; j<b.hv[i].length; j++) { - this.hv[i][num]=b.hv[i][j]; - this.index[num]=b.index[j]; - num++; - } - } - } - - public ACoord convertYXToFR() { - if(type==SYMBOLS||type==LINES) { - for(int j=0; j<hv[0][0].length; j++) { - double phiLast=0.; - - for(int i=0; i<hv[0].length; i++) { - double xx=hv[0][i][j]; - double yy=hv[1][i][j]; - double rho=Math.sqrt(xx*xx+yy*yy); - double phi=Math.toDegrees(Math.atan2(yy, xx)); - - if(phi<0.) - phi+=360.; - if(i>0) { - if(phi-phiLast>180.) phi-=360.; - if(phi-phiLast<-180.) phi+=360.; - } - hv[0][i][j]=rho; - hv[1][i][j]=phi; - phiLast=phi; - } - } - - } else { - for(int i=0; i<hv[0].length; i++) { - double phiLast=0.; - - for(int j=0; j<hv[0][i].length; j++) { - double xx=hv[0][i][j]; - double yy=hv[1][i][j]; - double rho=Math.sqrt(xx*xx+yy*yy); - double phi=Math.toDegrees(Math.atan2(yy, xx)); - - if(phi<0.) - phi+=360.; - if(j>0) { - if(phi-phiLast>180.) phi-=360.; - if(phi-phiLast<-180.) phi+=360.; - } - hv[0][i][j]=rho; - hv[1][i][j]=phi; - phiLast=phi; - } - } - } - return this; - } - - public ACoord includePhiWrapAround(String projectionName) { - // assumes phi is always the v coordinaate - int numFrames=parameterStore.get(projectionName, "FramesCount").getI(); - int initialFrame=parameterStore.get(projectionName, "InitialFrame").getI(); - - if(type==SYMBOLS||type==LINES) { - int numPoints=hv[1].length; - int numInitialData=hv[1][0].length; - - double[][][] hvtemp=new double[2][numPoints][numFrames*numInitialData]; - int[] indextemp=new int[numFrames*numInitialData]; - - int num=0; - - for(int f=initialFrame; f<initialFrame+numFrames; f++) { - for(int i=0; i<numInitialData; i++) { - if(index!=null) indextemp[num]=index[i]; - for(int j=0; j<numPoints; ++j) { - hvtemp[0][j][num]=this.hv[0][j][i]; - hvtemp[1][j][num]=this.hv[1][j][i]+f*360.; - } - num++; - } - } - hv=hvtemp; - if (index!=null) index=indextemp; - } else { - int numInitialData=hv[1].length; - double[][][] hvtemp=new double[2][numFrames*numInitialData][]; - int[] indextemp=new int[numFrames*numInitialData]; - - int num=0; - - for(int f=initialFrame; f<initialFrame+numFrames; f++) { - for(int i=0; i<numInitialData; i++) { - int numPoints=hv[1][i].length; - - hvtemp[0][num]=new double[numPoints]; - hvtemp[1][num]=new double[numPoints]; - for(int j=0; j<numPoints; j++) { - hvtemp[0][num][j]=this.hv[0][i][j]; - hvtemp[1][num][j]=this.hv[1][i][j]+f*360.; - } - if (index!=null) indextemp[num]=index[i]; - num++; - } - } - hv=hvtemp; - if (index!=null) index=indextemp; - } - return this; - } - - /** - * used in ATLAS context for the TRT - * Force data to be drawn as symbols if - * forceSymbols=true - * or - * all lines are smaller than minSize - */ - public ACoord toSymbols(boolean forceSymbols, int minSize) { - if(type==LINES) { - double dmax2=0.; - - for(int i=0; i<hv[0][0].length; i++) { - double dh=(hv[0][0][i]-hv[0][1][i]); - double dv=(hv[1][0][i]-hv[1][1][i]); - double d=dh*dh+dv*dv; - - if(d>dmax2) dmax2=d; - } - if(Math.sqrt(dmax2)<minSize||forceSymbols) { - type=SYMBOLS; - for(int i=0; i<hv[0][0].length; i++) { - hv[0][0][i]=(hv[0][0][i]+hv[0][1][i])/2.; - hv[1][0][i]=(hv[1][0][i]+hv[1][1][i])/2.; - } - } - } else if(type==POLYLINES||type==POLYGONS||type==TRANSPARENT_POLYGONS) { - double dmax2=0.; - - for(int j=0; j<hv[0].length; j++) { - for(int i=0; i<hv[0][j].length; i++) { - double dh=(hv[0][j][0]-hv[0][j][i]); - double dv=(hv[1][j][0]-hv[1][j][i]); - double d=dh*dh+dv*dv; - - if(d>dmax2) dmax2=d; - } - } - - if(Math.sqrt(dmax2)<minSize||forceSymbols) { - type=SYMBOLS; - double[][][] hvnew=new double[2][1][hv[0].length]; - - for(int j=0; j<hv[0].length; j++) { - double h=0.; - double v=0.; - - for(int i=0; i<hv[0][j].length; i++) { - h+=hv[0][j][i]; - v+=hv[1][j][i]; - } - h/=hv[0][j].length; - v/=hv[0][j].length; - hvnew[0][0][j]=h; - hvnew[1][0][j]=v; - } - hv=hvnew; - } - } - return this; - } - - public ACoord mirrorH () { - ACoord coord = new ACoord(this); - for(int i=0; i<coord.hv[0].length; i++) { - for(int j=0; j<coord.hv[0][i].length; j++) { - coord.hv[0][i][j] *= -1; - } - } - return coord; - } - - public ACoord mirrorV () { - ACoord coord = new ACoord(this); - for(int i=0; i<coord.hv[1].length; i++) { - for(int j=0; j<coord.hv[1][i].length; j++) { - coord.hv[1][i][j] *= -1; - } - } - return coord; - } -} - diff --git a/graphics/AtlantisJava/src/atlantis/graphics/ACursorFactory.java b/graphics/AtlantisJava/src/atlantis/graphics/ACursorFactory.java deleted file mode 100755 index 133abd8f8d49737f849ed25198804a4a9ee3784c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/ACursorFactory.java +++ /dev/null @@ -1,227 +0,0 @@ -package atlantis.graphics; - - -import java.awt.Toolkit; -import java.awt.Dimension; -import java.awt.Cursor; -import java.awt.Point; -import java.awt.Image; -import java.awt.dnd.DragSource; - -import atlantis.globals.AGlobals; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; - -/** - * Singleton class factory for producing cursors. - * Due to difference in the default cursors provided by the different OSs, - * all cursors are generated by Atlantis itself. - */ - -public class ACursorFactory { - - private static ALogger logger = ALogger.getLogger(ACursorFactory.class); - - /** singleton class, pointer to this instance */ - private static ACursorFactory instance; - - /** Cursor size string, either "64x64" or "32x32" */ - private String cursorSize; - - /** Cursor color string, either "bw" or "" */ - private String bAndW=""; - - /** - * @return true if if system supports custom cursors - */ - public boolean getCustomCursors() { return customCursors; } - private final boolean customCursors; - - /** - * @return the default Cursor - */ - public Cursor getDefaultCursor() { return defaultCursor; } - private Cursor defaultCursor = null; - - /** Drag-and-drop valid cursor */ - private Cursor dragValidCursor=null; - public Cursor getDragValidCursor() { return dragValidCursor; } - /** Drag-and-drop invalid cursor */ - private Cursor dragInvalidCursor=null; - public Cursor getDragInvalidCursor() { return dragValidCursor; } - - /** Zoom cursor */ - public Cursor getZoomCursor() { return zoomCursor; } - private Cursor zoomCursor=null; - /** Move cursor */ - public Cursor getMoveCursor() { return moveCursor; } - private Cursor moveCursor=null; - /** Rotate cursor */ - public Cursor getRotateCursor() { return rotateCursor; } - private Cursor rotateCursor=null; - - /** Pick cursor */ - public Cursor getPickCursor() { return pickCursor; } - private Cursor pickCursor=null; - /** Rectangular selection cursor */ - public Cursor getRectSelectCursor() { return rectSelectCursor; } - private Cursor rectSelectCursor=null; - - /** Syncro cursor */ - public Cursor getSyncCursor() { return syncCursor; } - private Cursor syncCursor=null; - /** FishEye cursor */ - public Cursor getFishEyeCursor() { return fishEyeCursor; } - private Cursor fishEyeCursor=null; - - /** FishEye symbol also needed as a FishEye on/off indicator */ - public Image getFishEyeIndicator() { return fishEyeIndicator; } - private Image fishEyeIndicator=null; - - /** ATLAS logo can be printed on canvas */ - public Image getAtlasLogo() { return atlasLogo; } - private Image atlasLogo=null; - - /** - * Public singleton instantiation accessor - * @return the singleton instance - */ - public static ACursorFactory getInstance() { - - //Check if we already have an instance - if (instance == null) instance = new ACursorFactory(); - - //Return the singleton instance - return instance; - } - - - /** Constructor */ - private ACursorFactory(){ - - logger.debug("Creating cursor and image factory ..."); - String FILE_SEPAR = System.getProperty("file.separator"); - String homeDirectory = AGlobals.instance().getHomeDirectory(); - - //Provide images and indicators even in headless mode - //Fisheye - String path = homeDirectory + "img" + FILE_SEPAR + - "cursor_fisheye_"+bAndW+"32x32.gif"; - fishEyeIndicator = AUtilities.getFileAsImageIcon(path).getImage(); - - //Atlas logo - path = homeDirectory + "img" + FILE_SEPAR + - "atlas_logo_big.png"; - atlasLogo = AUtilities.getFileAsImageIcon(path).getImage(); - - - //Don't create any cursors in headless mode - if (AGlobals.isAtlantisHeadless()){ - //Custom cursors not supported on this platform - customCursors=false; - return; - } - - //Check for best cursor size on this system - trying largest - Dimension bestCursorSize=Toolkit.getDefaultToolkit().getBestCursorSize(64,64); - - //Check if custom cursors are allowed - if (bestCursorSize.width > 0){ - - customCursors=true; - - //We only support 32x32 and 64x64 cursors. Check which one we are closer to - if (bestCursorSize.width < 48) cursorSize="32x32"; - else cursorSize="64x64"; - - //Check if we have enough colours for greyscale cursors - if (Toolkit.getDefaultToolkit().getMaximumCursorColors() < 255) - bAndW="bw_"; - else bAndW=""; - - logger.info("Using "+bAndW+cursorSize+" cursors"); - - //Now create the individual cursors - Toolkit tools = Toolkit.getDefaultToolkit(); - - - //Drag and drop cursors ----------------------------------------------- - - //Valid DnD - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_DnD_valid_" + cursorSize+ ".gif"; - Image validDnDImg = AUtilities.getFileAsImageIcon(path).getImage(); - - dragValidCursor=tools.createCustomCursor(validDnDImg, new Point(1, 1),"ValidDnD"); - - //Invalid Dnd - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_DnD_invalid_" + cursorSize + ".gif"; - Image invalidDnDImg = AUtilities.getFileAsImageIcon(path).getImage(); - dragInvalidCursor=tools.createCustomCursor(invalidDnDImg,new Point(9, 9),"InvalidDnD"); - - //Zoom, move and rotate cursors ----------------------------------------------- - //Zoom - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_zoom_"+bAndW+cursorSize+".gif"; - Image zoomImg = AUtilities.getFileAsImageIcon(path).getImage(); - zoomCursor=tools.createCustomCursor(zoomImg, new Point(9, 9),"Zoom"); - - //Move - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_move_" + cursorSize+".gif"; - Image moveImg = AUtilities.getFileAsImageIcon(path).getImage(); - moveCursor=tools.createCustomCursor(moveImg,new Point(10, 10),"Move"); - - //Rotate - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_rotate_"+bAndW+cursorSize+".gif"; - Image rotateImg = AUtilities.getFileAsImageIcon(path).getImage(); - rotateCursor=tools.createCustomCursor(rotateImg,new Point(11, 11),"Rotate"); - - //Pick and RectSelect cursors ----------------------------------------------- - //Pick - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_pick_"+cursorSize+".gif"; - Image pickImg = AUtilities.getFileAsImageIcon(path).getImage(); - pickCursor=tools.createCustomCursor(pickImg, new Point(6, 1),"Pick"); - - //Rectangle select - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_rectsel_"+cursorSize+".gif"; - Image rectSelectImg = AUtilities.getFileAsImageIcon(path).getImage(); - rectSelectCursor=tools.createCustomCursor(rectSelectImg,new Point(12, 12),"RectSelect"); - - //Syncro and FishEye cursors ----------------------------------------------------- - //Sync - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_sync_" + cursorSize + ".gif"; - Image syncImg = AUtilities.getFileAsImageIcon(path).getImage(); - syncCursor=tools.createCustomCursor(syncImg, new Point(10, 10),"Sync"); - - //FishEye - path = homeDirectory + "img" + FILE_SEPAR + - "cursor_fisheye_"+bAndW+cursorSize+".gif"; - Image fishEyeImg = AUtilities.getFileAsImageIcon(path).getImage(); - fishEyeCursor=tools.createCustomCursor(fishEyeImg, new Point(1, 8),"FishEye"); - - } else customCursors=false; - - - //Now check for any cursors that have not been set yet - //And set them to system defaults - if (defaultCursor == null) defaultCursor = new Cursor(Cursor.DEFAULT_CURSOR); - - if (dragValidCursor == null) dragValidCursor = DragSource.DefaultMoveDrop; - if (dragInvalidCursor == null) dragInvalidCursor = DragSource.DefaultMoveNoDrop; - - if (zoomCursor == null) zoomCursor = new Cursor(Cursor.DEFAULT_CURSOR); - if (moveCursor == null) moveCursor = new Cursor(Cursor.MOVE_CURSOR); - if (rotateCursor == null) rotateCursor = new Cursor(Cursor.DEFAULT_CURSOR); - - if (pickCursor == null) pickCursor = new Cursor(Cursor.HAND_CURSOR); - if (rectSelectCursor == null) rectSelectCursor = new Cursor(Cursor.NW_RESIZE_CURSOR); - if (syncCursor == null) syncCursor = new Cursor(Cursor.CROSSHAIR_CURSOR); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/ADrawParameters.java b/graphics/AtlantisJava/src/atlantis/graphics/ADrawParameters.java deleted file mode 100755 index 214b6e05b459a381afb0b5952328ecad50e3e299..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/ADrawParameters.java +++ /dev/null @@ -1,98 +0,0 @@ -package atlantis.graphics; - -import atlantis.graphics.colormap.AColorMap; - -import java.awt.Color; - -/** - * Contains graphics attributes of a collection of data - */ -public class ADrawParameters { - - boolean draw; - Color color; - int size; - int minSize=0; - boolean forceSymbols=false; - int lineWidth; - int frameWidth; - int symbol; - int drawOrFill=AGraphics.DRAW; - - public ADrawParameters(boolean draw, int color, int size, int lineWidth, int frameWidth, int symbol) { - Color[] colorMap=AColorMap.getColors(); - - this.draw=draw; - if(color!=-1) - this.color=colorMap[color]; - else - this.color=null; - this.size=size; - this.lineWidth=lineWidth; - this.frameWidth=frameWidth; - this.symbol=symbol; - } - - public ADrawParameters(boolean draw, int color, int size, int lineWidth, int frameWidth, int symbol, - boolean forceSymbols, int minSize, int drawOrFill) { - Color[] colorMap=AColorMap.getColors(); - - this.draw=draw; - if(color!=-1) - this.color=colorMap[color]; - else - this.color=null; - this.size=size; - this.lineWidth=lineWidth; - this.frameWidth=frameWidth; - this.symbol=symbol; - this.forceSymbols=forceSymbols; - this.minSize=minSize; - this.drawOrFill=drawOrFill; - } - - public ADrawParameters(boolean draw, Color color, int size, int lineWidth, int frameWidth, int symbol, int drawOrFill) { - this.draw=draw; - this.color=color; - this.size=size; - this.lineWidth=lineWidth; - this.frameWidth=frameWidth; - this.symbol=symbol; - this.drawOrFill=drawOrFill; - } - - public void setColor(int color) { - Color[] colorMap=AColorMap.getColors(); - - this.color=colorMap[color]; - } - - public void setFrameWidth(int width) { - this.frameWidth=width; - } - - public void setSize(int size) { - this.size=size; - } - - public boolean toBeDrawn() { - return draw; - } - - public int getSize() { - return size; - } - - public int getMinSize() { - return minSize; - } - - public boolean getForceSymbols() { - return forceSymbols; - } - - public int getDrawOrFill() { - return drawOrFill; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/ADrawable.java b/graphics/AtlantisJava/src/atlantis/graphics/ADrawable.java deleted file mode 100755 index bf36d13b60e756b2fb09890f64984b750892c1d7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/ADrawable.java +++ /dev/null @@ -1,24 +0,0 @@ -package atlantis.graphics; - - -import atlantis.canvas.AWindow; -import atlantis.projection.AProjection2D; - - -public interface ADrawable { - void draw(AWindow window, AGraphics ag, AProjection2D projection); - int[] getColor(int[] dl); - int[] getType(int[] dl); - int getNumTypes(); - - /** - * The data are normally drawn in two layers - * (layer=0 is for frames) - * (layer=1 is the data) - * The data may be of more than 1 type which are drawn in sequence - * e.g. type=0 noise - * type=1 others - */ - ADrawParameters getDrawParameters(int layer, int type); -} - diff --git a/graphics/AtlantisJava/src/atlantis/graphics/ADrawnGraphics2D.java b/graphics/AtlantisJava/src/atlantis/graphics/ADrawnGraphics2D.java deleted file mode 100755 index 5cd633a5e933910fad11cc646ea8d4f4dbe88c40..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/ADrawnGraphics2D.java +++ /dev/null @@ -1,149 +0,0 @@ -package atlantis.graphics; - -import java.awt.Graphics; -import java.awt.Rectangle; -import java.awt.Shape; -import java.awt.geom.PathIterator; -import java.util.ArrayList; -import java.util.HashMap; - -import atlantis.data.ACalorimeterData; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.data.AHistogram; -import atlantis.list.AList; -import atlantis.list.AListManager; -import atlantis.utils.ALogger; - -/** - * Simple graphics context simply decides whether something was drawn or not - */ - -public class ADrawnGraphics2D extends ATemplateGraphics2D -{ - private static ALogger logger = ALogger.getLogger(ADrawnGraphics2D.class); - private static AEventManager eventManager = AEventManager.instance(); - - private static HashMap map; - private static ArrayList histogramList; - - public ADrawnGraphics2D(Rectangle bounds) - { - super(bounds); - map = new HashMap(); - histogramList = new ArrayList(); - AEvent event = eventManager.getCurrentEvent(); - if (event != null) - { - AData[] data = event.getData(); - for (int i = 0; i < data.length; ++i) - { - map.put(data[i], new boolean[data[i].getNumData()]); - } - } - } // ADrawnGraphics2D() ---------------------------------------------------- - - ADrawnGraphics2D(ADrawnGraphics2D a) - { - super(a); - } // ADrawnGraphics2D() ---------------------------------------------------- - - public static void updateLastDrawn() - { - AListManager.getInstance().clearLastDrawn(); - AEvent event = eventManager.getCurrentEvent(); - if (event != null) - { - AData[] data = event.getData(); - for (int i = 0; i < data.length; ++i) - { - boolean[] drawn = (boolean[]) map.get(data[i]); - if (data[i] instanceof ACalorimeterData) - { - drawn = ((ACalorimeterData) data[i]).expandDrawn(drawn); - } - AListManager.getInstance().addLastDrawn(new AList(data[i], drawn)); - } - for (int i = 0; i < histogramList.size(); ++i) - { - boolean[] drawn = (boolean[]) map.get(histogramList.get(i)); - AListManager.getInstance().addLastDrawn(new AList((AData)histogramList.get(i), drawn)); - } - } - } // updateLastDrawn() ----------------------------------------------------- - - public Graphics create() - { - return new ADrawnGraphics2D(this); - } - - public void drawLine(double h0, double v0, double h1, double v1) - { - if (AGraphics.currentData != null) - { - ((boolean[]) map.get(AGraphics.currentData))[AGraphics.currentIndex] = true; - } - } - - public void fillRect(int h, int v, int width, int height) - { - double dh = width / 2.; - double dv = height / 2.; - drawLine(h - dh, v - dv, h + dh, v - dv); - drawLine(h + dh, v - dv, h + dh, v + dv); - drawLine(h + dh, v + dv, h - dh, v + dv); - drawLine(h - dh, v + dv, h - dh, v - dv); - } - - public void draw(Shape s) - { - PathIterator path = s.getPathIterator(null); - double[] coords = new double[6]; - double h0 = 0.; - double v0 = 0.; - double h1 = 0.; - double v1 = 0.; - while (!path.isDone()) - { - int segType = path.currentSegment(coords); - - switch (segType) - { - case PathIterator.SEG_MOVETO: - h0 = coords[0]; - v0 = coords[1]; - break; - - case PathIterator.SEG_LINETO: - case PathIterator.SEG_CUBICTO: - h1 = coords[0]; - v1 = coords[1]; - drawLine(h0, v0, h1, v1); - h0 = h1; - v0 = v1; - break; - - case PathIterator.SEG_CLOSE: - break; - - default: - logger.error(" Error unknown segment type"); - break; - } - path.next(); - } - } - - public void fill(Shape s) - { - draw(s); - } - - public void addHistogramData(AHistogram data) - { - histogramList.add(data); - map.put(data, new boolean[data.getNumData()]); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/ADummyGraphics2D.java b/graphics/AtlantisJava/src/atlantis/graphics/ADummyGraphics2D.java deleted file mode 100755 index 9c8cded5a0a8a442307039e4aaa88e084ebbf62e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/ADummyGraphics2D.java +++ /dev/null @@ -1,215 +0,0 @@ -package atlantis.graphics; - -import java.awt.*; -import java.awt.image.*; -import java.awt.image.renderable.*; -import java.awt.geom.*; -import java.awt.font.*; - -/** - * This graphics is used when nothing should really be drawn on the screen - */ - -public class ADummyGraphics2D extends Graphics2D { - - private int x; - private int y; - private int width; - private int height; - - public ADummyGraphics2D() {} - - public Rectangle getClipBounds() { - return new Rectangle(x, y, width, height); - } - - public void setClip(int x, int y, int width, int height) { - this.x=x; - this.y=y; - this.width=width; - this.height=height; - } - - public void transform(AffineTransform z) {} - - public void fill(Shape z) {} - - public void draw(Shape z) {} - - public void drawImage(BufferedImage a, BufferedImageOp b, int c, int z) {} - - public boolean drawImage(Image a, AffineTransform b, ImageObserver z) { - return false; - } - - public void drawRenderedImage(RenderedImage a, AffineTransform z) {} - - public void drawRenderableImage(RenderableImage a, AffineTransform z) {} - - public void drawString(java.text.AttributedCharacterIterator a, float b, float z) {} - - public void drawString(String a, int b, int z) {} - - public void drawString(String a, float b, float z) {} - - public void drawString(java.text.AttributedCharacterIterator a, int b, int z) {} - - public void drawGlyphVector(GlyphVector a, float b, float z) {} - - public boolean hit(Rectangle a, Shape b, boolean z) { - return false; - } - - public GraphicsConfiguration getDeviceConfiguration() { - return null; - } - - public void setComposite(Composite z) {} - - public void setPaint(Paint z) {} - - public void setStroke(Stroke z) {} - - public void setRenderingHint(RenderingHints.Key a, Object z) {} - - public Object getRenderingHint(RenderingHints.Key z) { - return null; - } - - public void setRenderingHints(java.util.Map z) {} - - public void addRenderingHints(java.util.Map z) {} - - public RenderingHints getRenderingHints() { - return null; - } - - public void translate(double a, double z) {} - - public void translate(int a, int z) {} - - public void rotate(double a, double b, double z) {} - - public void rotate(double z) {} - - public void scale(double a, double z) {} - - public void shear(double a, double z) {} - - public void setTransform(AffineTransform z) {} - - public AffineTransform getTransform() { - return null; - } - - public Paint getPaint() { - return null; - } - - public Composite getComposite() { - return null; - } - - public void setBackground(Color z) {} - - public Color getBackground() { - return null; - } - - public Stroke getStroke() { - return null; - } - - public void clip(Shape z) {} - - public FontRenderContext getFontRenderContext() { - return null; - } - - public void setColor(Color z) {} - - public Graphics create() { - return null; - } - - public boolean drawImage(Image a, int b, int c, int d, int e, int f, int g, int h, int i, ImageObserver z) { - return false; - } - - public boolean drawImage(Image a, int b, int c, ImageObserver z) { - return false; - } - - public boolean drawImage(Image a, int b, int c, Color d, ImageObserver z) { - return false; - } - - public boolean drawImage(Image a, int b, int c, int d, int e, Color f, ImageObserver z) { - return false; - } - - public boolean drawImage(Image a, int b, int c, int d, int e, ImageObserver z) { - return false; - } - - public boolean drawImage(Image a, int b, int c, int d, int e, int f, int g, int h, int i, Color j, ImageObserver z) { - return false; - } - - public Color getColor() { - return null; - } - - public void fillRect(int a, int b, int c, int z) {} - - public void setPaintMode() {} - - public void setXORMode(Color z) {} - - public Font getFont() { - return null; - } - - public void setFont(Font z) {} - - public FontMetrics getFontMetrics(Font z) { - return null; - } - - // public Rectangle getClipBounds () { return null;} - public void clipRect(int a, int b, int c, int z) {} - - // public void setClip(int a,int b,int c,int z) { } - public void setClip(Shape z) {} - - public Shape getClip() { - return null; - } - - public void copyArea(int a, int b, int c, int d, int e, int z) {} - - public void drawLine(int a, int b, int c, int z) {} - - public void clearRect(int a, int b, int c, int z) {} - - public void drawRoundRect(int a, int b, int c, int d, int e, int z) {} - - public void fillRoundRect(int a, int b, int c, int d, int e, int z) {} - - public void drawOval(int a, int b, int c, int z) {} - - public void fillOval(int a, int b, int c, int z) {} - - public void drawArc(int a, int b, int c, int d, int e, int z) {} - - public void fillArc(int a, int b, int c, int d, int e, int z) {} - - public void drawPolyline(int[] a, int[] b, int z) {} - - public void drawPolygon(int[] a, int[] b, int z) {} - - public void fillPolygon(int[] a, int[] b, int z) {} - - public void dispose() {} - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/AGLPixelGraphics.java b/graphics/AtlantisJava/src/atlantis/graphics/AGLPixelGraphics.java deleted file mode 100644 index 299aa5fd26b0b229d4edf90356e9e0d3cc8a62ea..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/AGLPixelGraphics.java +++ /dev/null @@ -1,47 +0,0 @@ -package atlantis.graphics; - -import atlantis.canvas.AGLGraphics; - -/* - * This class subclasses APixelGraphics to allow some optimisations slightly - * higher up the graphics chain in cases where OpenGL renders faster in - * certain ways - * - * @author Adam Davison - */ - -public class AGLPixelGraphics extends APixelGraphics { - - protected AGLGraphics m_glg; - - public AGLPixelGraphics(AGLGraphics g) { - super(g); - m_glg = g; - } - - @Override - public void fillPolygon(double[] h, double[] v, int numPoints) { - /*int type = getContainmentType(h, v, numPoints, POLYGON); - if (type == FULLY_INSIDE || type == INTERSECTS) { - if (type == INTERSECTS) { - ACoord clipped = clipper.clipPolygon(h, v, numPoints); - h = clipped.hv[0][0]; - v = clipped.hv[1][0]; - numPoints = h.length; - }*/ - /*int[] hInt = new int[numPoints]; - int[] vInt = new int[numPoints]; - for (int i = 0; i < numPoints; ++i) { - hInt[i] = (int) h[i]; - vInt[i] = (int) v[i]; - }*/ - updateColor(); - m_glg.fillPolygon(h, v, numPoints); - //g.drawPolygon(hInt, vInt, numPoints); - /*} else if (type == CONTAINS) { - Rectangle bounds = g.getClipBounds(); - updateColor(); - g.fillRect((int) Math.rint(bounds.getX()), (int) Math.rint(bounds.getY()), (int) Math.rint(bounds.getWidth()), (int) Math.rint(bounds.getHeight())); - }*/ - } -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/AGraphics.java b/graphics/AtlantisJava/src/atlantis/graphics/AGraphics.java deleted file mode 100755 index 225eb608a8870edd3dd666872678473496ab5189..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/AGraphics.java +++ /dev/null @@ -1,407 +0,0 @@ -package atlantis.graphics; - -import atlantis.canvas.AGLGraphics; -import java.awt.Color; -import java.awt.AlphaComposite; -import java.awt.Composite; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Rectangle; -import java.awt.Shape; -import java.awt.Image; -import java.awt.Stroke; - -import atlantis.event.AData; -import atlantis.geometry.ADetectors; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.APar; -import atlantis.utils.APolygon; - -import org.sourceforge.jlibeps.epsgraphics.*; -import org.apache.batik.svggen.SVGGraphics2D; - -/** - * Normally all drawing should be done on an AGraphics. For special uses, e.g. - * Braintest projections, standard Java Graphics may be used. To allow this, - * projections are always given a graphics which they must convert to an - * AGraphics with AGraphics.makeAGraphics. AGraphics provides picking of drawn - * objects. - */ - -public abstract class AGraphics -{ - protected Graphics2D g; - AClipper clipper = null; - Color currentColor; - Color lastDrawnColor = null; - Rectangle bounds; - int lineWidth = 1; - int size; - int symbol; - ADrawParameters lastDrawParameters = null; - - static AData currentData = null; - static ADetectors currentDetector = null; - static int currentIndex; - - public static final int SYMBOL_FILLED_BOX = 0; - public static final int SYMBOL_HORIZONTAL_LINE = 1; - public static final int SYMBOL_VERTICAL_LINE = 2; - public static final int SYMBOL_PLUS = 3; - public static final int SYMBOL_FILLED_CIRCLE = 4; - - public static final int DRAW = 0; - public static final int FILL = 1; - - protected static final int NUM_LAYERS = 2; - - protected static final int FULLY_INSIDE = 0; - protected static final int FULLY_OUTSIDE = 1; - protected static final int CONTAINS = 2; - protected static final int INTERSECTS = 3; - - protected static final int POLYGON = 0; - protected static final int POLYLINE = 1; - - AGraphics(Graphics g) - { - this.g = (Graphics2D) g; - if (g.getClipBounds() != null) - clipper = new AClipper(g.getClipBounds()); - currentColor = g.getColor(); - } - - public Graphics2D getGraphics2D() - { - return g; - } - - public static AGraphics makeAGraphics(Graphics g) - { - if (g instanceof EpsGraphics2D || g instanceof APickingGraphics2D || - g instanceof ADrawnGraphics2D || g instanceof SVGGraphics2D) - { - return new AVectorGraphics(g); - } - else if (g instanceof AGLGraphics) - { - return new AGLPixelGraphics((AGLGraphics)g); - } - else - { - return new APixelGraphics(g); - } - } - - public static void setCurrentDataAndIndex(AData current, int index) - { - currentData = current; - currentIndex = index; - } - - public static void setCurrentDetectorAndIndex(ADetectors current, int index) - { - currentDetector = current; - currentIndex = index; - } - - public static void clearCurrentDetectorAndIndex() - { - currentDetector = null; - currentIndex = -1; - } - - public static void clearCurrentDataAndIndex() - { - currentData = null; - currentIndex = -1; - } - - public void setFont(Font f) - { - g.setFont(f); - } - - public void setStroke(Stroke s) - { - g.setStroke(s); - } - - public void setColor(Color c) - { - currentColor = c; - } - - public void updateColor() - { - if (currentColor != lastDrawnColor) - { - g.setColor(currentColor); - lastDrawnColor = currentColor; - } - } - - public abstract void setLineWidth(int lineWidth); - - public void updateDrawParameters(ADrawParameters dp) - { - if (dp != lastDrawParameters) - { - setColor(dp.color); - lineWidth = Math.max(dp.lineWidth, 1) + 2 * dp.frameWidth; - setLineWidth(lineWidth); - size = dp.size + 2 * dp.frameWidth; - symbol = dp.symbol; - lastDrawParameters = dp; - } - } - - public void drawString(String str, double x, double y) - { - g.drawString(str, (int) x, (int) y); - } - - public void draw(Shape s) - { - g.draw(s); - } - - public void drawPoint(AData detector, int index, double h, double v, int pixelsH, int pixelsV) - { - setCurrentDataAndIndex(detector, index); - drawPoint(h, v, pixelsH, pixelsV); - clearCurrentDataAndIndex(); - } - - public void drawPoint(double h, double v, int pixelsH, int pixelsV) - { - if (clipper.isPointWithin(h, v)) - fillRect(h, v, pixelsH, pixelsV); - } - - public void drawSymbol(double h, double v) - { - if (clipper.isPointWithin(h, v)) - { - if (symbol == SYMBOL_FILLED_BOX) - { - fillRect(h, v, size, size); - } - else if (symbol == SYMBOL_HORIZONTAL_LINE) - { - fillRect(h, v, size, lineWidth); - } - else if (symbol == SYMBOL_VERTICAL_LINE) - { - fillRect(h, v, lineWidth, size); - } - else if (symbol == SYMBOL_PLUS) - { - fillRect(h, v, size, lineWidth); - fillRect(h, v, lineWidth, size); - } - else if (symbol == SYMBOL_FILLED_CIRCLE) - { - fillOval(h, v, size, size); - } - } - } - - //Draw an image at postion x,y of this graphics context - //Introduced for FishEye symbol showing FishEye status - public void drawImage(Image img, int x, int y){ - //Draw the image on screen - g.drawImage(img,x,y,null); - } - - - public void fillPolygon(AData detector, int index, double[] h, double[] v, int numPoints) - { - setCurrentDataAndIndex(detector, index); - fillPolygon(h, v, numPoints); - clearCurrentDataAndIndex(); - } - - public void fillRect(int h, int v, int width, int height) - { - updateColor(); - g.fillRect(h, v, width, height); - } - - public void fillOval(int h, int v, int width, int height) - { - g.fillOval(h, v, width, height); - } - - public abstract void drawPolyline(double[] h, double[] v, int numPoints); - - public abstract void drawDottedPolyline(double[] h, double[] v, int numPoints); - - public abstract void drawSmoothPolyline(double[] h0, double[] v0, int numPoints0); - - public abstract void drawLine(double h0, double v0, double h1, double v1); - - public abstract void drawPolygon(double[] h, double[] v, int numPoints); - - protected abstract void fillRect(double h, double v, int width, int height); - - protected abstract void fillOval(double h, double v, int width, int height); - - public void fillPolygon(ADetectors det, int index, double[] h, double[] v, int numPoints) - { - setCurrentDetectorAndIndex(det, index); - fillPolygon(h, v, numPoints); - clearCurrentDetectorAndIndex(); - } - - public void fillPolygon(double[] h, double[] v, int numPoints, float alpha) - { - Composite originalComposite = g.getComposite(); - int ACtype = AlphaComposite.SRC_OVER; - g.setComposite(AlphaComposite.getInstance(ACtype, alpha)); - fillPolygon(h, v, numPoints); - g.setComposite(originalComposite); - } - - protected int getContainmentType(double[] h, double[] v, int numPoints, int shape) - { - int within = clipper.fastWithin(h, v, numPoints); - if (within == AClipper.NONE_WITHIN) - return FULLY_OUTSIDE; - if (within == AClipper.ALL_WITHIN) - return FULLY_INSIDE; - for (int i = 0; i < numPoints - 1; ++i) - if (clipper.isLineWithin(h[i], v[i], h[i + 1], v[i + 1])) - return INTERSECTS; - if (shape == POLYGON && numPoints > 1) - if (clipper.isLineWithin(h[numPoints - 1], v[numPoints - 1], h[0], v[0])) - return INTERSECTS; - Rectangle bounds = g.getClipBounds(); - double xCentreClipped = bounds.getX() + bounds.getWidth() / 2.; - double yCentreClipped = bounds.getY() + bounds.getHeight() / 2.; - if (isPointInside(h, v, numPoints, xCentreClipped, yCentreClipped)) - return CONTAINS; - return FULLY_OUTSIDE; - } - - public abstract void fillPolygon(double[] h, double[] v, int numPoints); - - public void drawPolygon(APolygon p) - { - drawPolygon(p.getX(), p.getY(), p.nrNodes()); - } - - public static boolean isPointInside(double[] h, double[] v, int numPoints, double hP, double vP) - { - double[] a = new double[numPoints]; - - for (int i = 0; i < numPoints; ++i) - { - a[i] = Math.atan2(v[i] - vP, h[i] - hP); - } - double[] d = new double[numPoints]; - - for (int i = 0; i < numPoints; ++i) - { - if (i < numPoints - 1) - d[i] = a[i + 1] - a[i]; - else - d[i] = a[0] - a[i]; - if (d[i] > Math.PI) - d[i] -= 2. * Math.PI; - else if (d[i] < -Math.PI) - d[i] += 2. * Math.PI; - } - double sum = 0.; - - for (int i = 0; i < numPoints; ++i) - { - sum += d[i]; - } - if (Math.abs(sum) > Math.PI) - return true; - else - return false; - } - - public void draw(ACoord display) - { - ADrawable source = display.source; - - if (source == null) - return; - ADrawParameters adp = source.getDrawParameters(0, 0); - - if (adp.getForceSymbols() == true || adp.getMinSize() > 0) - display.toSymbols(adp.getForceSymbols(), adp.getMinSize()); - Color[] colorMap = AColorMap.getColors(); - int[] index = display.index; - int[] c = source.getColor(index); - int[] t = source.getType(index); - double[][] h = display.hv[0]; - double[][] v = display.hv[1]; - - for (int layer = 0; layer < NUM_LAYERS; layer++) - { - for (int type = 0; type < source.getNumTypes(); type++) - { - ADrawParameters dp = source.getDrawParameters(layer, type); - int drawType = dp.getDrawOrFill(); - updateDrawParameters(dp); - if (dp.draw) - { - for (int j = 0; j < t.length; j++) - { - if (t[j] == type) - { - if (layer == NUM_LAYERS - 1) - { - setColor(colorMap[c[j]]); - if (source instanceof AData) - setCurrentDataAndIndex((AData) source, index[j]); - } - if (display.type == ACoord.SYMBOLS) - drawSymbol(h[0][j], v[0][j]); - else if (display.type == ACoord.POLYGONS && h[j].length == 1) - drawSymbol(h[j][0], v[j][0]); - else if (display.type == ACoord.LINES) - drawLine(h[0][j], v[0][j], h[1][j], v[1][j]); - else if (display.type == ACoord.POLYLINES) - drawPolyline(h[j], v[j], h[j].length); - else if (display.type == ACoord.SMOOTH_POLYLINES) - drawSmoothPolyline(h[j], v[j], h[j].length); - else if (display.type == ACoord.DOTTED_POLYGONS) - drawDottedPolyline(h[j], v[j], h[j].length); - else if (display.type == ACoord.POLYGONS) - { - if (drawType == DRAW) - drawPolygon(h[j], v[j], h[j].length); - else if (drawType == FILL) - fillPolygon(h[j], v[j], h[j].length); - } - else if (display.type == ACoord.TRANSPARENT_POLYGONS) - { - if(g instanceof EpsGraphics2D){ - // setComposite is currently unsupported for EpsGraphics2D - // for now just draw as an outline, so we can still see - // jets and the underlying objects - drawPolygon(h[j], v[j], h[j].length); - } - else { - Composite originalComposite = g.getComposite(); - int ACtype = AlphaComposite.SRC_OVER; - g.setComposite(AlphaComposite.getInstance(ACtype, (float)APar.instance().get("Jet","Alpha").getD())); - fillPolygon(h[j], v[j], h[j].length); - g.setComposite(originalComposite); - } - } - clearCurrentDataAndIndex(); - } - } - } - } - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/AIcon.java b/graphics/AtlantisJava/src/atlantis/graphics/AIcon.java deleted file mode 100644 index a2add88871f92442620d9e123aa7f1f9ba630e08..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/AIcon.java +++ /dev/null @@ -1,28 +0,0 @@ -package atlantis.graphics; - -import java.awt.Frame; - -import javax.swing.ImageIcon; - -import atlantis.globals.AGlobals; -import atlantis.utils.AUtilities; - -/** - * - * @author waugh - * - */ -public class AIcon { - /** Set icon image for a frame to be the Atlantis icon. */ - public static void setIconImage(Frame f) - { - String path = AGlobals.instance().getHomeDirectory() + "img" + - System.getProperty("file.separator") + - "atlantis_icon.gif"; - ImageIcon ii = AUtilities.getFileAsImageIcon(path); - f.setIconImage(ii.getImage()); - - } // setIconImage() ----------------------------------------------------- - - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/ALegoDraw.java b/graphics/AtlantisJava/src/atlantis/graphics/ALegoDraw.java deleted file mode 100755 index ab9137ea80ad3a4cb9c9a65e53e6729ff7c04ac4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/ALegoDraw.java +++ /dev/null @@ -1,1150 +0,0 @@ -package atlantis.graphics; -import java.awt.BasicStroke; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Stroke; -import java.awt.geom.Point2D; - -import atlantis.canvas.AWindow; -import atlantis.event.AEvent; -import atlantis.data.ALVL1ResultData; -import atlantis.data.ATriggerInfoData; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.AEnumeratorParameter; -import atlantis.parameters.APar; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.utils.AMath; - -public class ALegoDraw -{ - - protected static APar parameterStore = APar.instance(); - - private static int legendHeight=0; - private static int lineHeight = 17;//seperation of lines - //colors to use in legend - - //width of lines in lego grid - private static float legoGridWidth = 1.6f; - private static float legoTowersWidth = 1.0f; - - private static Color textColor=Color.white, - backgroundColor=AColorMap.getColors()[parameterStore.get("Color", "BkgFill").getI()], - borderColor=Color.lightGray; - - public static Color getBackgroundColor() - { - return backgroundColor; - } - - public static void fillBackground(AWindow window, AGraphics ag) - { - - backgroundColor = AColorMap.getColors()[parameterStore.get("Color", "BkgFill").getI()]; // inherit bkg colour from main background colour - - ag.setColor(backgroundColor); - ag.fillRect(0, 0, window.getWidth(), window.getHeight()); - } - - public static void drawLegend(AWindow window, AGraphics ag, AEvent event, double met, double maxEt, double AODmaxEt) - { - //colors to use - textColor=Color.black; - if(backgroundColor.getBlue()+backgroundColor.getGreen()+backgroundColor.getRed() < 400) - textColor=Color.white; - //change the font size (reset at end) - float originalFontSize= ag.g.getFont().getSize2D(); - float newFontSize= (float) 0.9*originalFontSize; - ag.g.setFont(ag.g.getFont().deriveFont(newFontSize)); - //variables to locate where to write/draw - legendHeight = lineHeight+2;//distance from top of legend - int indent = window.getWidth()- 200;//distance from left of legend - int pos = 90;//distance to start writing second half of line - //loop over Lvl1resultdata collections - String[] colLvl1=event.getActiveCollectionNames("LVL1Result"); - ALVL1ResultData lvl1ResultData[] = null; - if(colLvl1.length>0) - lvl1ResultData = new ALVL1ResultData[colLvl1.length]; - for(int i=0;i<colLvl1.length;i++) - { - lvl1ResultData[i] = (ALVL1ResultData) event.get(colLvl1[i]); - } - ATriggerInfoData triggerInfoData = event.getTriggerInfoData(); - - //check window is large enough - if(window.getWidth()<250 || window.getHeight()<250) - { - drawWindowTooSmall(window, ag, indent); - //reset font size - ag.g.setFont(ag.g.getFont().deriveFont(originalFontSize)); - return; - } - - //draw main legend - if(parameterStore.get("LegoPlot", "MainLegend").getStatus()) - drawLegendMain(window, ag, event, met, maxEt, AODmaxEt, lvl1ResultData, indent, pos); - //draw lvl1 sumEt and missEt - if(parameterStore.get("LegoPlot", "L1EtLegend").getStatus()) - drawLegendL1ET(ag, lvl1ResultData, triggerInfoData, indent); - //draw the item list - boolean drawLegend=false; - if(!drawLegend && parameterStore.get("LegoPlot", "L1Items").getStatus())drawLegend=true; - if(!drawLegend && parameterStore.get("LegoPlot", "L2Items").getStatus())drawLegend=true; - if(!drawLegend && parameterStore.get("LegoPlot", "EFItems").getStatus())drawLegend=true; - if(drawLegend) - drawLegendItems(window, ag, lvl1ResultData, indent); - - //reset font size - ag.g.setFont(ag.g.getFont().deriveFont(originalFontSize)); - } - - public static void drawWindowTooSmall(AWindow window, AGraphics ag, int indent) - { - - //change indent to make legend smaller - indent+=135; - // create legend boarder with two concentric rectangles - // outer rectangle: - ag.setColor(borderColor); - ag.fillRect(indent - 4, 5, 65, 3*lineHeight); - // inner rectangle: - ag.setColor(backgroundColor); - ag.fillRect(indent - 4 + 2, 7, 65 - 4, 3*lineHeight-4); - ag.setColor(textColor); - ag.updateColor(); - - ag.drawString("Window", indent + 6, legendHeight); - legendHeight += lineHeight; - ag.drawString("too small", indent + 6, legendHeight); - legendHeight += lineHeight; - ag.drawString("for legend", indent + 6, legendHeight); - legendHeight += lineHeight; - } - - public static void drawLegendMain(AWindow window, AGraphics ag, AEvent event, double met, double maxEt, double AODmaxEt, ALVL1ResultData lvl1ResultData[], int indent, int pos) - { - - // create legend boarder with two concentric rectangles - // outer rectangle: - ag.setColor(borderColor); - //ag.fillRect(/*indent - 4*/window.getWidth()/1.8, /*5*/window.getHeight()/3.0, (int)(1-(window.getWidth()/1.8)), (int)(1-(window.getHeight()/3.0))); - ag.fillRect(indent - 4, 5, 200, 105); - - // inner rectangle: - ag.setColor(backgroundColor); - ag.fillRect(indent - 4 + 2, 7, 200 - 4, 105 - 4); - //ag.fillRect(/*indent - 4*/window.getWidth()/1.8 +2, /*5*/window.getHeight()/3.0 +2, (int)(1-(window.getWidth()/1.8))+4, (int)(1-(window.getHeight()/3.0))+4); - - ag.setColor(textColor); - ag.updateColor(); - - //First item Missing ET (may remove met box from plot later) - if(met!=0) - drawLegendPartMain1(ag, event, met, indent, pos); - else - ag.drawString("No Missing Et", indent + 6, legendHeight); - legendHeight += lineHeight; - ag.setColor(textColor); - ag.updateColor(); - - //Second item colourby - //make sure there are cells by checking the maximum energy - //and that there have been colours added to the colourset - //(can have maxE and no colours when scaling to AOD) - if(maxEt!=0 && AProjectionLegoPlot.colorset.size()>0) - drawLegendMain2(ag, indent, pos); - else - { - ag.setColor(textColor); - ag.updateColor(); - ag.drawString("No cells", indent + 6, legendHeight); - } - legendHeight += lineHeight; - ag.setColor(textColor); - ag.updateColor(); - - //Third item maximum height of towers - if(maxEt!=0 || AODmaxEt!=0) - drawLegendMain3(ag, maxEt, AODmaxEt, indent, pos); - else - { - ag.drawString("No towers", indent + 6, legendHeight); - legendHeight += lineHeight; - } - legendHeight += lineHeight; - ag.setColor(textColor); - ag.updateColor(); - - //Fourth item lvl1 result - if (lvl1ResultData == null){ - ag.drawString("Trigger Decision N/A", indent+6, legendHeight); - legendHeight+=lineHeight;//move by a line to keep same spacing - }else if (lvl1ResultData.length>1){ - ag.drawString(">1 LVL1Result collections selected", indent+6, legendHeight); - legendHeight+=lineHeight; - ag.drawString("View on event properties or choose 1", indent+6, legendHeight); - }else{ - drawLegendMain4(ag, lvl1ResultData[0], indent, pos); - } - legendHeight+=lineHeight; - ag.setColor(textColor); - ag.updateColor(); - } - - public static void drawLegendPartMain1(AGraphics ag, AEvent event, double met, int indent, int pos) - { - ag.setColor(AProjectionLegoPlot.defaultColorMap[parameterStore.get("ETMis", "Constant").getI()]); - //draw dashed line - ag.fillRect(indent + 6, 11, 5, 3); - ag.fillRect(indent + 6 + 10, 11, 5, 3); - ag.fillRect(indent + 6 + 20, 11, 5, 3); - ag.fillRect(indent + 6 + 30, 11, 5, 3); - ag.setColor(textColor); - ag.updateColor(); - String[] names = event.getActiveCollectionNames("ETMis"); - if(names.length==1) - ag.drawString("Missing ET= " + Math.round(met) + " GeV" , indent + 0.6*pos, legendHeight); - else - ag.drawString("Max Missing ET= " + Math.round(met) + " GeV" , indent + 0.6*pos, legendHeight); - } - - public static void drawLegendMain2(AGraphics ag, int indent, int pos) - { - String modeName; - if (AProjectionLegoPlot.mode == 0) - { - modeName="LAr"; - } - else if (AProjectionLegoPlot.mode == 1) - { - modeName="LVL1TriggerTower"; - } - else - { - modeName="LVL1JetElement"; - } - AEnumeratorParameter param = (AEnumeratorParameter) parameterStore.get(modeName, "ColorFunction"); - String colorFunction = param.getText(param.getI()); - ag.drawString(colorFunction + " (1-" + AProjectionLegoPlot.colorset.size() + ")",indent + pos, legendHeight); - int barwidth = 6, barheight = 6; - if(AProjectionLegoPlot.getDrawEMHAD()) - { - if(AProjectionLegoPlot.colorset.size()==2) - { - //for Em/had option should only have 2 colors - ag.setColor(AProjectionLegoPlot.defaultColorMap[AProjectionLegoPlot.colorEM]); - ag.fillRect(indent + barwidth * 2, 28, barwidth * 2, barheight); - ag.setColor(AProjectionLegoPlot.defaultColorMap[AProjectionLegoPlot.colorHad]); - ag.fillRect(indent + 2 * barwidth* 2, 28, barwidth * 2, barheight); - } - else - { - //if more colors then lists must be in use - int c = 0; - ++c; - ag.setColor(AProjectionLegoPlot.defaultColorMap[AProjectionLegoPlot.colorEM]); - ag.fillRect(indent + c * barwidth, 28, barwidth, barheight); - ++c; - ag.setColor(AProjectionLegoPlot.defaultColorMap[AProjectionLegoPlot.colorHad]); - ag.fillRect(indent + c * barwidth, 28, barwidth, barheight); - for (int i = 0; i <AProjectionLegoPlot.caloColorMap.length ; i++) - { - if (!AProjectionLegoPlot.colorset.contains(new Integer(i))) - continue; - if(i==AProjectionLegoPlot.colorEM || i==AProjectionLegoPlot.colorHad) - continue; - ++c; - ag.setColor(AProjectionLegoPlot.caloColorMap[i]); - ag.fillRect(indent + c * barwidth, 28, barwidth, barheight); - } - } - } - else - { - //if not Em/Had then loop over colors - int c = 0; - barwidth = 90/AProjectionLegoPlot.caloColorMap.length; - for (int i = 0; i <AProjectionLegoPlot.caloColorMap.length ; i++) - { - if (!AProjectionLegoPlot.colorset.contains(new Integer(i))) - continue; - ++c; - ag.setColor(AProjectionLegoPlot.caloColorMap[i]); - ag.fillRect(indent + c * barwidth, 28, barwidth, barheight); - } - } - } - - public static void drawLegendMain3(AGraphics ag, double maxEt, double AODmaxEt, int indent, int pos) - { - ag.drawString( "Height of tallest tower:", indent + 6, legendHeight); - //next line has the values - legendHeight += lineHeight; - if (parameterStore.get("LegoPlot", "ETAxisHeight").getD() > 0.0) - ag.drawString("User selection: " + Math.round(maxEt) + " GeV ", indent +6, legendHeight); - else if (parameterStore.get("LegoPlot", "ScaleToAOD").getStatus()) - ag.drawString("Scale to AOD: " + Math.round(maxEt) + " GeV ", indent +6, legendHeight); - else - { - if(maxEt!=0) - { - ag.drawString("Cells: " + Math.round(maxEt) + " GeV ", indent +6, legendHeight); - if(AODmaxEt!=0) - ag.drawString("AOD: " + Math.round(AODmaxEt) + " GeV ", indent + pos, legendHeight); - } - else - ag.drawString("AOD: " + Math.round(AODmaxEt) + " GeV ", indent + 6, legendHeight); - } - } - - public static void drawLegendMain4(AGraphics ag, ALVL1ResultData lvl1ResultData, int indent, int pos) - { - ag.drawString("Trigger Decision:", indent +6, legendHeight); - legendHeight+=lineHeight; - String[] trigRes={"NA","NA","NA"}; - int[] temp=new int[3]; - temp[0]=lvl1ResultData.getPassedL1(0); - temp[1]=lvl1ResultData.getPassedL2(0); - temp[2]=lvl1ResultData.getPassedEF(0); - for(int i=0;i<3;i++) - { - switch(temp[i]) - { - case -1: - trigRes[i]="N/C"; - break; - case 0: - trigRes[i]="failed"; - break; - case 1: - trigRes[i]="passed"; - break; - default: - trigRes[i]="NA"; - } - } - ag.drawString("L1:" + trigRes[0] +" L2:" + trigRes[1]+" EF:" + trigRes[2], indent +6, legendHeight); - } - - public static void drawLegendL1ET(AGraphics ag, ALVL1ResultData lvl1ResultData[], ATriggerInfoData triggerInfoData, int indent) - { - // create legend boarder with two concentric rectangles - // outer rectangle: - ag.setColor(borderColor); - ag.fillRect(indent - 4, legendHeight, 200, (int) (lineHeight*1.5)); - // inner rectangle: - ag.setColor(backgroundColor); - ag.fillRect(indent - 4 + 2, legendHeight + 2, 200 - 4, (int) (lineHeight*1.5 - 4)); - ag.setColor(textColor); - ag.updateColor(); - legendHeight+=lineHeight; - //if no trigger info and "All" Lvlresult selected display warning - if(triggerInfoData==null && lvl1ResultData!=null && lvl1ResultData.length>1){ - ag.drawString(">1 LVL1Result collections selected", indent+6, legendHeight); - legendHeight+=lineHeight; - return; - } - - float LVL1EtMiss=-1.0f,LVL1SumEt=-1.0f; - if(triggerInfoData!=null) - { - LVL1EtMiss=triggerInfoData.getEnergyEtMiss(0); - LVL1SumEt=triggerInfoData.getEnergySumEt(0); - } - else if(lvl1ResultData!=null && lvl1ResultData.length==1) - { - LVL1EtMiss=lvl1ResultData[0].getEnergyEtMiss(0); - LVL1SumEt=lvl1ResultData[0].getEnergySumEt(0); - } - String LVL1EtMissOutput,LVL1SumEtOutput; - if(LVL1EtMiss>0) - LVL1EtMissOutput=""+LVL1EtMiss; - else - LVL1EtMissOutput="N/A"; - if(LVL1SumEt>0) - LVL1SumEtOutput=""+LVL1SumEt; - else - LVL1SumEtOutput="N/A"; - - ag.drawString("L1-EtMiss: "+LVL1EtMissOutput+" L1-SumEt: "+LVL1SumEtOutput, indent , legendHeight); - legendHeight+=lineHeight; - } - - public static void drawLegendItems(AWindow window, AGraphics ag, ALVL1ResultData lvl1ResultData[], int indent) - { - // ag.setStroke(new BasicStroke(legoTowersWidth)); returning to original line width - - if(lvl1ResultData!=null && lvl1ResultData.length>1){ - //create legend boarder with two concentric rectangles - //outer rectangle: - ag.setColor(borderColor); - ag.fillRect(indent - 4, legendHeight, 200, (int) (lineHeight*5.5)); - // inner rectangle: - ag.setColor(backgroundColor); - ag.fillRect(indent - 4 + 2, legendHeight + 2, 200 - 4, (int) (lineHeight*5.5 - 4)); - ag.setColor(textColor); - ag.updateColor(); - legendHeight+=lineHeight; - ag.drawString(">1 LVL1Result collections selected", indent+6, legendHeight); - legendHeight+=lineHeight; - ag.drawString("Either select 1 LVL1Result collection", indent+6, legendHeight); - legendHeight+=lineHeight; - ag.drawString("from: Calo->LVL1Result", indent+6, legendHeight); - legendHeight+=lineHeight; - ag.drawString("or to see all items select:", indent+6, legendHeight); - legendHeight+=lineHeight; - ag.drawString("file->Event Properties", indent+6, legendHeight); - legendHeight+=lineHeight; - return; - } - - //output message to say no lvl1result - if(lvl1ResultData==null){ - ag.setColor(borderColor); - ag.updateColor(); - ag.fillRect(window.getWidth() -200 - 4, legendHeight+4, 200, (int) Math.round(1.5*lineHeight)); - ag.setColor(backgroundColor); - ag.updateColor(); - ag.fillRect(window.getWidth() -200 - 4 + 2, legendHeight +4+ 2, 200 - 4, (int) Math.round(1.5*lineHeight)-4); - ag.setColor(textColor); - ag.updateColor(); - legendHeight+=lineHeight; - ag.drawString("No LVL1Result collection in event", window.getWidth() - 200 + 2, legendHeight+4); - return; - } - - int origlineHeight =lineHeight;//save lineheight to be reset at end of function - lineHeight*=0.8;//for item list bunch together - int startrowHeight =legendHeight; - - //now output items in columns in new legend box - - //lists to draw - int dolist1 = parameterStore.get("LegoPlot", "L1Items").getStatus()?1:0; - int dolist2 = parameterStore.get("LegoPlot", "L2Items").getStatus()?1:0; - int dolist3 = parameterStore.get("LegoPlot", "EFItems").getStatus()?1:0; - - //number of items per column and number of columns - int maxItems=(int) Math.round(((0.8*window.getHeight()-legendHeight)/lineHeight )-0.5); - int columnWidth= 72; - int maxColumns=(int) Math.floor((0.9*window.getWidth())/columnWidth); - - // store items and headers - String[][] items=new String[3][]; - if(dolist1>0) items[0]=newList("---L1 items---", lvl1ResultData[0].getCtpItemListSplit(0,true)); - if(dolist2>0) items[1]=newList("---L2 items---", lvl1ResultData[0].getitemListL2Split(0,true)); - if(dolist3>0) items[2]=newList("---EF items---", lvl1ResultData[0].getitemListEFSplit(0,true)); - - //number of columns for each list - int[] num=new int[3]; - num[0]= (dolist1==0)? 0 : (int) Math.ceil(items[0].length/((double)maxItems)); - num[1]= (dolist2==0)? 0 : (int) Math.ceil(items[1].length/((double)maxItems)); - num[2]= (dolist3==0)? 0 : (int) Math.ceil(items[2].length/((double)maxItems)); - - boolean doWarning=false;//for printing see event properties message - //calculate total number of columns - if(num[0]+num[1]+num[2]>maxColumns){ - //too many in list so each can just have the average - int av = (int) Math.floor(maxColumns/((double)(dolist1+dolist2+dolist3))); - if(dolist1>0) num[0]=av; - if(dolist2>0) num[1]=av; - if(dolist3>0) num[2]=av; - doWarning=true; - } - int noOfColumns=num[0]+num[1]+num[2]; - - //now store each column into an array [column][row] - String[][] list=new String[noOfColumns][maxItems]; - int list_counter=0; - //loop over each list - for(int i=0; i<3; i++){ - //loop over items in a list - int item_counter=0; - //only loop over columns can display for each list - for(int j=0; j<num[i]; j++){ - //loop over all items for a column - for(int k=0; k<maxItems; k++){ - if(item_counter<items[i].length) - list[list_counter][k]=items[i][item_counter]; - else - list[list_counter][k]=""; - item_counter++; - } - //next column - list_counter++; - } - } - - // makes outer and inner borders of table: - ag.setColor(borderColor); - ag.fillRect(window.getWidth() -noOfColumns*columnWidth - 4, legendHeight, (int)(noOfColumns*columnWidth), (int) Math.round((maxItems+0.5)*lineHeight)); - - //draw columns - for(int i=0; i<noOfColumns; i++){ - //draw column to draw onto - legendHeight=startrowHeight; - ag.setColor(backgroundColor); - ag.updateColor(); - ag.fillRect(window.getWidth() -(noOfColumns-i)*columnWidth - 4 + 2, legendHeight + 2, columnWidth - 4, (int) Math.round((maxItems+0.5)*lineHeight)-4); - ag.setColor(textColor); - ag.updateColor(); - //draw item - for(int j=0; j<maxItems; j++){ - legendHeight+=lineHeight; - ag.drawString(list[i][j], window.getWidth() - (noOfColumns-i)*columnWidth + 2, legendHeight); - } - } - - //output warning if too many items - if(doWarning){ - legendHeight+=lineHeight; - //draw under columns - ag.setColor(borderColor); - ag.updateColor(); - ag.fillRect(window.getWidth() -90 - 4, legendHeight+4, 90, (int) Math.round(2.5*lineHeight)); - ag.setColor(backgroundColor); - ag.updateColor(); - ag.fillRect(window.getWidth() -90 - 4 + 2, legendHeight +4+ 2, 90 - 4, (int) Math.round(2.5*lineHeight)-4); - ag.setColor(textColor); - ag.updateColor(); - legendHeight+=lineHeight; - ag.drawString(" more items in", window.getWidth() - 90 + 2, legendHeight+4); - legendHeight+=lineHeight; - ag.drawString("event properties", window.getWidth() - 90 + 2, legendHeight+4); - } - lineHeight=origlineHeight;//reset line height - } - - static String[] newList(String first, String[] rest){ - int counter = 2;//1 for title 1 for N/A if needed - if(rest!=null) counter+=rest.length-1;//now don't need N/A - - String[] editedList=new String[counter]; - editedList[0]=first; - if(rest!=null){ - System.arraycopy(rest, 0, editedList, 1, rest.length); - }else{ - editedList[1]="N/A"; - } - - return editedList; - } - - static void drawline(AWindow window, AGraphics ag, Point2D.Double from, Point2D.Double to) - { - from=window.calculateDisplay(from); - to=window.calculateDisplay(to); - ag.drawLine( from.x,from.y,to.x,to.y); - } - - static void drawline(AWindow window, AGraphics ag, double fromX, double fromY, double toX, double toY) - { - Point2D.Double from= new Point2D.Double(fromX,fromY); - Point2D.Double to= new Point2D.Double(toX,toY); - drawline(window, ag, from, to); - } - - //converts from energy into eta coords - static void drawline(AWindow window, AGraphics ag, double fromX, double fromY, double toX, double toY, int etAxisMaximum) - { - fromY=-5-(1-AProjectionLegoPlot.getyz(window.getIndex()))*50*(fromY/etAxisMaximum)*0.9; - toY=-5-(1-AProjectionLegoPlot.getyz(window.getIndex()))*50*(toY/etAxisMaximum)*0.9; - Point2D.Double from= new Point2D.Double(fromX,fromY); - Point2D.Double to= new Point2D.Double(toX,toY); - drawline(window, ag, from, to); - } - - static void drawstring(AWindow window, AGraphics ag, String str, double hereX, double hereY) - { - Point2D.Double here= new Point2D.Double(hereX,hereY); - here=window.calculateDisplay(here); - ag.drawString(str, here.x,here.y); - } - - //converts from energy into eta coords - static void drawstring(AWindow window, AGraphics ag, String str, double hereX, double hereY, int etAxisMaximum) - { - hereY=-5-(1-AProjectionLegoPlot.getyz(window.getIndex()))*50*(hereY/etAxisMaximum)*0.9; - Point2D.Double here= new Point2D.Double(hereX,hereY); - here=window.calculateDisplay(here); - ag.drawString(str, here.x,here.y); - } - - public static void drawGrid(AWindow window, AGraphics ag, double maxEt) - { - ag.setStroke(new BasicStroke(legoGridWidth)); //setting grid line width - int width = window.getSize().width; - int dpi = 72; - // Set a scaling font size with window width (sqrt prevents text from going too small in the small window) - int newFontSize = (int) Math.round(35.0 * Math.sqrt(width) / (double) dpi); - - //change the font size (reset at end) - float originalFontSize= ag.g.getFont().getSize2D(); - Font f = new Font("SansSerif", Font.PLAIN, newFontSize); - ag.setFont(f); - - // Draw the scale and labels on Et axis - ag.setColor(Color.darkGray); - if(backgroundColor.getBlue()+backgroundColor.getGreen()+backgroundColor.getRed() < 400) - ag.setColor(Color.lightGray); - ag.updateColor(); - int etAxisMaximum=(int) maxEt;//convert to int for use later on - int etAxisScale = 10;//seperation of ticks in ET - if (AProjectionLegoPlot.defaultScale ==1 ) - { - etAxisScale=1; - } - else if (maxEt > 10.0) - { - //set scale to 0.1 of nearest hundred to maximum - etAxisScale = 10 * ((int) Math.ceil(maxEt / 100.0)); - } - else if (maxEt == 10.0) - { - etAxisScale = 5; - } - else if (maxEt < 10.0) - { - etAxisScale = 2; - } - double lowPhi=-360*AProjectionLegoPlot.getxz(window.getIndex()); - //lowPhi = 1; - int ticksizex = 10; - double ticksizey = 0.5; - //Draw Et axis - drawline(window,ag,lowPhi,0.0,lowPhi,etAxisMaximum, etAxisMaximum); - //Draw the ticks - for(int s = etAxisMaximum-etAxisScale; s >= 0.0; s-=etAxisScale) - { - drawline(window,ag,lowPhi, s,lowPhi + ticksizex,s, etAxisMaximum); - if (AProjectionLegoPlot.defaultScale ==1 ) - drawstring(window,ag,"10^" + Integer.toString( s + AProjectionLegoPlot.minimumofLogScale ),lowPhi + 2*ticksizex,s,etAxisMaximum); - else - drawstring(window,ag,Integer.toString( s ),lowPhi + 2*ticksizex,s,etAxisMaximum); - } - // Draw the title on Et axis - drawline(window,ag,lowPhi, etAxisMaximum,lowPhi + ticksizex,etAxisMaximum, etAxisMaximum); - if (AProjectionLegoPlot.defaultScale ==1) - drawstring(window,ag,"10^" + Integer.toString( etAxisMaximum + AProjectionLegoPlot.minimumofLogScale) + " ET (GeV)",lowPhi + 2*ticksizex,etAxisMaximum,etAxisMaximum); - else if(AProjectionLegoPlot.defaultScale ==2) - drawstring(window,ag,Integer.toString( etAxisMaximum ) + " ET (GeV)^1/2",lowPhi + 2*ticksizex,etAxisMaximum,etAxisMaximum); - else - drawstring(window,ag,Integer.toString( etAxisMaximum ) + " ET (GeV)",lowPhi + 2*ticksizex,etAxisMaximum,etAxisMaximum); - - // Draw a grid - int t = -1; - for (double p = 0.; p <= 1.; p += 1. / 8.) - { - // parallel to the right side - drawline(window, ag, 360*p+lowPhi, -5.0, 360*p, 5.0); - if (++t % 2 == 0) - { - // a tick - drawline(window,ag,360*p,5.0,360*p,5.0+ticksizey); - String str = new Integer(((int) (360. * p))).toString(); - drawstring(window,ag,str,360*p-7.0,5.0+2.0*Math.sqrt(ticksizey)); - } - } - //Draw the title on phi axis - drawstring(window,ag,AMath.PHI,0.6*360,5.0+3.0*Math.sqrt(ticksizey)); - - for (double e = 0.; e <= 1.; e += 1. / 10.) - { - // parallel to the bottom - drawline(window, ag, lowPhi*(1-e), 10.0*e-5.0, 360.0+lowPhi*(1-e), 10.0*e-5.0); - // a tick - drawline(window, ag, lowPhi*(1-e), 10.0*e-5.0, lowPhi*(1-e), 10.0*e-5.0+ticksizey); - String str = new Integer((int)Math.round(e*10)-5).toString(); - if (AProjectionLegoPlot.reverse) - str = new Integer((int)Math.round(-e*10)+5).toString(); - drawstring(window,ag,str,lowPhi*(1-e)-20, 10.0*e-5.0+3.0*Math.sqrt(ticksizey)); - } - //Draw the title on eta axis - drawstring(window,ag,AMath.ETA,0.5*lowPhi-30,+5.0*Math.sqrt(ticksizey)); - - //reset font size - ag.g.setFont(ag.g.getFont().deriveFont(originalFontSize)); - } - - public static void drawJet(double et, double eta, double phi, Color color, AWindow window, AGraphics ag, double radius) - { - ag.setStroke(new BasicStroke(legoTowersWidth)); //Setting Lego Towers Width - double x = (phi*360)/ AMath.TWO_PI;//x is phi converted from rad to deg - int numPoints = 128;//points around circumference of circle - double[][] hj = new double[2][numPoints]; - double[][] vj = new double[2][numPoints]; - int phiwrap = 0; - double old_jetx = -1; - int[] pj = new int[2]; - pj[0] = pj[1] = 0; - for (int p = 0; p < numPoints; p++) - { - //add on fraction of diameter of circle in phi - double jetx = x + radius*36 * Math.cos(AMath.TWO_PI * p / (numPoints - 1)); - if (jetx < 0) - jetx += 360; - if(jetx >= 360) - jetx -= 360; - if(old_jetx > 0) - { - double jetx_diff = Math.abs(jetx - old_jetx); - if(jetx_diff > 360 / 2) - phiwrap = (phiwrap + 1) % 2; - } - // remember the last jetx, to see if we've wrapped around next time - old_jetx = jetx; - double y = eta; - if (AProjectionLegoPlot.reverse) - y = -y; - //add on fraction of diameter of circle in eta - double jety = y + radius * Math.sin(AMath.TWO_PI * p / (numPoints - 1)); - jetx=AProjectionLegoPlot.adjustPhi(window,jetx,jety);//move phi value due to slant of eta axis - Point2D.Double[] corners=window.getUserCorners(); - if(jetx < corners[0].x || jetx > corners[1].x || jety < corners[1].y || jety > corners[2].y) - continue;//exits loop if not in limits of drawn plot - hj[phiwrap][pj[phiwrap]] = jetx; - vj[phiwrap][pj[phiwrap]] = jety; - ++pj[phiwrap]; - } - - Point2D.Double p= new Point2D.Double(0,0); - for(int i=0; i<pj[0]; i++) - { - p = window.calculateDisplay(hj[0][i],vj[0][i]); - hj[0][i]=p.x; - vj[0][i]=p.y; - } - p.x=0; p.y=0; - for(int i=0; i<pj[1]; i++) - { - p = window.calculateDisplay(hj[1][i],vj[1][i]); - hj[1][i]=p.x; - vj[1][i]=p.y; - } - Stroke origStroke = ag.getGraphics2D().getStroke(); - boolean drawFrames = AColorMap.drawFrames(); - //if drawing frames this part draws the frame otherwise draws the fill - ag.setStroke(new BasicStroke(3)); - if(drawFrames) - ag.setColor(AProjectionLegoPlot.defaultColorMap[AColorMap.BK]); - else - ag.setColor(color); - - if (pj[0] > 2) - { - ag.drawPolygon(hj[0], vj[0], pj[0]); - } - if (pj[1] > 2) - { - ag.drawPolygon(hj[1], vj[1], pj[1]); - } - - //this part will draw the fill color inside the frame if is not black otherwise already drawn - if(drawFrames && !color.equals(AProjectionLegoPlot.defaultColorMap[AColorMap.BK])) - { - ag.setStroke(new BasicStroke(1)); - ag.setColor(color); - - if (pj[0] > 2) - { - ag.drawPolygon(hj[0], vj[0], pj[0]); - } - if (pj[1] > 2) - { - ag.drawPolygon(hj[1], vj[1], pj[1]); - } - } - - //reset stroke - ag.setStroke(origStroke); - } - - public static void drawJetText(double et, double eta, double phi, Color color, AWindow window, AGraphics ag, double radius) - { - double x = (phi*360)/ AMath.TWO_PI;//x is phi converted from rad to deg - int numPoints = 128;//points around circumference of circle - double[][] hj = new double[2][numPoints]; - double[][] vj = new double[2][numPoints]; - int phiwrap = 0; - double old_jetx = -1; - int[] pj = new int[2]; - pj[0] = pj[1] = 0; - for (int p = 0; p < numPoints; p++) - { - //add on fraction of diameter of circle in phi - double jetx = x + radius*36 * Math.cos(AMath.TWO_PI * p / (numPoints - 1)); - if (jetx < 0) - jetx += 360; - if(jetx >= 360) - jetx -= 360; - if(old_jetx > 0) - { - double jetx_diff = Math.abs(jetx - old_jetx); - if(jetx_diff > 360 / 2) - phiwrap = (phiwrap + 1) % 2; - } - // remember the last jetx, to see if we've wrapped around next time - old_jetx = jetx; - double y = eta; - if (AProjectionLegoPlot.reverse) - y = -y; - //add on fraction of diameter of circle in eta - double jety = y + radius * Math.sin(AMath.TWO_PI * p / (numPoints - 1)); - jetx=AProjectionLegoPlot.adjustPhi(window,jetx,jety);//move phi value due to slant of eta axis - Point2D.Double[] corners=window.getUserCorners(); - if(jetx < corners[0].x || jetx > corners[1].x || jety < corners[1].y || jety > corners[2].y) - continue;//exits loop if not in limits of drawn plot - hj[phiwrap][pj[phiwrap]] = jetx; - vj[phiwrap][pj[phiwrap]] = jety; - ++pj[phiwrap]; - } - - Point2D.Double p= new Point2D.Double(0,0); - for(int i=0; i<pj[0]; i++) - { - p = window.calculateDisplay(hj[0][i],vj[0][i]); - hj[0][i]=p.x; - vj[0][i]=p.y; - } - - //draw the jet et as text - String s = Double.toString(et); - int dot = s.indexOf('.'); - String ss = s.substring(0, dot+0); - float originalFontSize= ag.g.getFont().getSize2D(); - float newFontSize= (float) 25.; - ag.g.setFont(ag.g.getFont().deriveFont(newFontSize)); - ag.g.setColor(color); - ag.drawString(" "+ss, hj[0][0], vj[0][0]); - ag.g.setFont(ag.g.getFont().deriveFont(originalFontSize)); - } - - public static void drawMissEt(AWindow window, AGraphics ag, int phi, double pt, Color color, double maxEt) - { - //color - ag.setColor(color); - - drawBox(window, ag, phi, 0, AProjectionLegoPlot.DRAW_MET, 0, pt, maxEt, 0.5); - - double phibinsize=360.0/AProjectionLegoPlot.nPhiCells; - double[] h = new double[4]; - double[] v = new double[4]; - double etaChange = 0.5; - for(double etaStart=-5.0; etaStart<5.0; etaStart+=2*etaChange) - { - v[0] = etaStart; - h[0] = AProjectionLegoPlot.adjustPhi(window,phi*phibinsize,v[0]); - v[1] = v[0]+etaChange; - h[1] = AProjectionLegoPlot.adjustPhi(window,phi*phibinsize,v[1]); - v[2] = v[1]; - h[2] = h[1] + phibinsize; - v[3] = v[0]; - h[3] = h[0] + phibinsize; - //convert to window coords - Point2D.Double p= new Point2D.Double(0,0); - for(int i=0; i<4; i++) - { - p = window.calculateDisplay(h[i],v[i]); - h[i]=p.x; - v[i]=p.y; - } - //draw - ag.fillPolygon(h, v, 4); - } - } - - public static void drawBox(AWindow window, AGraphics ag, int phi, int eta, int colouring, double et1, double et2, double maxEt, double boxsize) - { - Color drawingColor; - //if colouring < 0 ->AOD object, otherwise its cells - switch(colouring){ - case AProjectionLegoPlot.DRAW_MET: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("ETMis", "Constant").getI()]; - break; - case AProjectionLegoPlot.DRAW_MUON: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("Muon", "Constant").getI()]; - break; - case AProjectionLegoPlot.DRAW_ELECTRON: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("Electron", "Constant").getI()]; - break; - case AProjectionLegoPlot.DRAW_PHOTON: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("Photon", "Constant").getI()]; - break; - case AProjectionLegoPlot.DRAW_CLUSTER: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("Cluster", "Constant").getI()]; - break; - case AProjectionLegoPlot.DRAW_COMPOSITEPARTICLE: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("CompositeParticle", "Constant").getI()]; - break; - case AProjectionLegoPlot.DRAW_BJET: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("BJet", "Constant").getI()]; - break; - case AProjectionLegoPlot.DRAW_TAUJET: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("TauJet", "Constant").getI()]; - break; - case AProjectionLegoPlot.DRAW_JET: - drawingColor=AProjectionLegoPlot.defaultColorMap[parameterStore.get("Jet", "Constant").getI()]; - break; - default: drawingColor=AProjectionLegoPlot.caloColorMap[colouring]; - } - - int object = -colouring;//should be positive for "objects" and negative for calo cells - - //now check transparency option - //result is transparent if colouring is < 0 - switch(parameterStore.get("LegoPlot", "TowerOutlines").getI()){ - //AOD: colouring is already correct - case 0: break; - //cells: reverse so now AOD solid - case 1: colouring*=-1; break; - //both - case 2: colouring=-1; break; - //neither - case 3: colouring=1; break; - } - double phibinsize=360.0/AProjectionLegoPlot.nPhiCells; - double etabinsize=10.0/AProjectionLegoPlot.nEtaCells; - double x = phi*phibinsize;//x is real phi position - double y = eta*etabinsize-5;//y is real eta position - if (object>0) {phibinsize=360./64.; etabinsize=10./100.;} - double x1 = AProjectionLegoPlot.adjustPhi(window,x, y);//x1 is real phi position - double x2 = AProjectionLegoPlot.adjustPhi(window,x, y-etabinsize);//shifted x due to eta bin size - double[][] h = new double[3][4]; - double[][] v = new double[3][4]; - //adjust the values of the energies - et1=(1-AProjectionLegoPlot.getyz(window.getIndex()))*50*(et1/maxEt)*0.9; - et2=et1+(1-AProjectionLegoPlot.getyz(window.getIndex()))*50*(et2/maxEt)*0.9; - - double phishift = boxsize * (phibinsize/2); //to center towers with recpt eta-phi coordinates x1 and x2 - double etashift = boxsize * ((etabinsize)/2); - - //front - h[0][0] = x1 - phishift; - v[0][0] = y-et1 - etashift; // (bottom front) - h[0][1] = x1 - phishift; - v[0][1] = y-et2 - etashift; - h[0][2] = x1 + phishift; - v[0][2] = y-et2 - etashift; - h[0][3] = x1 + phishift; - v[0][3] = y-et1 - etashift; - //top - h[1][0] = x2 - phishift; - v[1][0] = y-et2- etashift-etashift; //SHIFT to make top squared - h[1][1] = x1 - phishift; - v[1][1] = y-et2 - etashift; - h[1][2] = x1 + phishift; - v[1][2] = y-et2 - etashift; - h[1][3] = x2 + phishift; - v[1][3] = y-et2- etashift-etashift; //SHIFT to make top squared - //side - h[2][0] = x2 - (phishift); - v[2][0] = y-(et2)- etashift -etashift; // top back SHIFT to make top squared - h[2][1] = x1 - phishift; - v[2][1] = y-et2 - etashift; // top front - h[2][2] = x1 - phishift; - v[2][2] = y-(et1) - etashift; // bottom front - h[2][3] = x2 - (phishift); - v[2][3] = y-et1 -(etashift); // bottom back - - - //convert to window coords - Point2D.Double p= new Point2D.Double(0,0); - for(int i=0; i<4; i++) - { - p = window.calculateDisplay(h[0][i],v[0][i]); - h[0][i]=p.x; - v[0][i]=p.y; - p.x=0; p.y=0; - p = window.calculateDisplay(h[1][i],v[1][i]); - h[1][i]=p.x; - v[1][i]=p.y; - p.x=0; p.y=0; - p = window.calculateDisplay(h[2][i],v[2][i]); - h[2][i]=p.x; - v[2][i]=p.y; - } - - //draw sides - ag.setColor(drawingColor); - if (colouring>=0) - ag.fillPolygon(h[2], v[2], 4); - else if(colouring == AProjectionLegoPlot.DRAW_JET){ - ag.fillPolygon(h[2], v[2], 4, (float)APar.instance().get("Jet","AlphaJets").getD()); //f specifies transparency fraction - } - else - ag.fillPolygon(h[2], v[2], 4, 0.8f); //f specifies transparency fraction - - //colour front - ag.setColor(drawingColor); - //draw front - if (colouring>=0) - ag.fillPolygon(h[0], v[0], 4); - else if(colouring == AProjectionLegoPlot.DRAW_JET){ - ag.fillPolygon(h[0], v[0], 4, (float)APar.instance().get("Jet","AlphaJets").getD()); //f specifies transparency fraction - } - else - ag.fillPolygon(h[0], v[0], 4, 0.8f); //f specifies transparency fraction - - //colour top - Color ddc = drawingColor.darker().darker(); - ag.setColor(new Color(ddc.getRed(),ddc.getGreen(),ddc.getBlue())); - //draw top - if (colouring>=0) - ag.fillPolygon(h[1], v[1], 4); - else if(colouring == AProjectionLegoPlot.DRAW_JET){ - ag.fillPolygon(h[1], v[1], 4, (float)APar.instance().get("Jet","AlphaJets").getD()); //f specifies transparency fraction - } - else - ag.fillPolygon(h[1], v[1], 4, 0.8f); //f specifies transparency fraction - - } - - //draw box method that can be used when not all the towers of certain object have assigned the same colour - the parameter color specifies the i color component - public static void drawBox(AWindow window, AGraphics ag, int phi, int eta, int colouring, Color color, double et1, double et2, double maxEt, double boxsize) - { - Color drawingColor; - switch(colouring){ - case AProjectionLegoPlot.DRAW_MET: - drawingColor= color; - break; - case AProjectionLegoPlot.DRAW_MUON: - drawingColor= color; - break; - case AProjectionLegoPlot.DRAW_ELECTRON: - drawingColor= color; - break; - case AProjectionLegoPlot.DRAW_PHOTON: - drawingColor= color; - break; - case AProjectionLegoPlot.DRAW_CLUSTER: - drawingColor= color; - break; - case AProjectionLegoPlot.DRAW_COMPOSITEPARTICLE: - drawingColor= color; - break; - case AProjectionLegoPlot.DRAW_BJET: - drawingColor= color; - break; - case AProjectionLegoPlot.DRAW_TAUJET: - drawingColor= color; - break; - case AProjectionLegoPlot.DRAW_JET: - drawingColor= color; - break; - default: drawingColor=AProjectionLegoPlot.caloColorMap[colouring]; - } - - int object = -colouring;//should be positive for "objects" and negative for calo cells - - //now check transparency option - //result is transparent if colouring is < 0 - switch(parameterStore.get("LegoPlot", "TowerOutlines").getI()){ - //AOD: colouring is already correct - case 0: break; - //cells: reverse so now AOD solid - case 1: colouring*=-1; break; - //both - case 2: colouring=-1; break; - //neither - case 3: colouring=1; break; - } - double phibinsize=360.0/AProjectionLegoPlot.nPhiCells; - double etabinsize=10.0/AProjectionLegoPlot.nEtaCells; - double x = phi*phibinsize;//x is real phi position - double y = eta*etabinsize-5;//y is real eta position - if (object>0) {phibinsize=360./64.; etabinsize=10./100.;} - double x1 = AProjectionLegoPlot.adjustPhi(window,x, y);//x1 is real phi position - double x2 = AProjectionLegoPlot.adjustPhi(window,x, y-etabinsize);//shifted x due to eta bin size - double[][] h = new double[3][4]; - double[][] v = new double[3][4]; - //adjust the values of the energies - et1=(1-AProjectionLegoPlot.getyz(window.getIndex()))*50*(et1/maxEt)*0.9; - et2=et1+(1-AProjectionLegoPlot.getyz(window.getIndex()))*50*(et2/maxEt)*0.9; - - double phishift = boxsize * (phibinsize/2); //to center towers with recpt eta-phi coordinates x1 and x2 - double etashift = boxsize * ((etabinsize)/2); - - //front - h[0][0] = x1 - phishift; - v[0][0] = y-et1 - etashift; // (bottom front) - h[0][1] = x1 - phishift; - v[0][1] = y-et2 - etashift; - h[0][2] = x1 + phishift; - v[0][2] = y-et2 - etashift; - h[0][3] = x1 + phishift; - v[0][3] = y-et1 - etashift; - //top - h[1][0] = x2 - phishift; - v[1][0] = y-et2- etashift-etashift; //SHIFT to make top squared - h[1][1] = x1 - phishift; - v[1][1] = y-et2 - etashift; - h[1][2] = x1 + phishift; - v[1][2] = y-et2 - etashift; - h[1][3] = x2 + phishift; - v[1][3] = y-et2- etashift-etashift; //SHIFT to make top squared - //side - h[2][0] = x2 - (phishift); - v[2][0] = y-(et2)- etashift -etashift; // top back SHIFT to make top squared - h[2][1] = x1 - phishift; - v[2][1] = y-et2 - etashift; // top front - h[2][2] = x1 - phishift; - v[2][2] = y-(et1) - etashift; // bottom front - h[2][3] = x2 - (phishift); - v[2][3] = y-et1 -(etashift); // bottom back - - //convert to window coords - Point2D.Double p= new Point2D.Double(0,0); - for(int i=0; i<4; i++) - { - p = window.calculateDisplay(h[0][i],v[0][i]); - h[0][i]=p.x; - v[0][i]=p.y; - p.x=0; p.y=0; - p = window.calculateDisplay(h[1][i],v[1][i]); - h[1][i]=p.x; - v[1][i]=p.y; - p.x=0; p.y=0; - p = window.calculateDisplay(h[2][i],v[2][i]); - h[2][i]=p.x; - v[2][i]=p.y; - } - - //draw sides - ag.setColor(drawingColor); - if (colouring>=0) - ag.fillPolygon(h[2], v[2], 4); - else if(colouring == AProjectionLegoPlot.DRAW_JET){ - ag.fillPolygon(h[2], v[2], 4, (float)APar.instance().get("Jet","AlphaJets").getD()); - }else if (colouring == AProjectionLegoPlot.DRAW_BJET) { - ag.fillPolygon(h[2], v[2], 4, 0.4f); - }else - ag.fillPolygon(h[2], v[2], 4, 0.8f); //f specifies transparency fraction - - //colour front - ag.setColor(drawingColor); - //draw front - if (colouring>=0) - ag.fillPolygon(h[0], v[0], 4); - else if(colouring == AProjectionLegoPlot.DRAW_JET){ - ag.fillPolygon(h[0], v[0], 4, (float)APar.instance().get("Jet","AlphaJets").getD()); - }else if(colouring == AProjectionLegoPlot.DRAW_BJET) { - ag.fillPolygon(h[0], v[0], 4, 0.4f); - }else - ag.fillPolygon(h[0], v[0], 4, 0.8f); //f specifies transparency fraction - - //colour top - Color ddc = drawingColor.darker().darker(); - ag.setColor(new Color(ddc.getRed(),ddc.getGreen(),ddc.getBlue())); - //draw top - if (colouring>=0) - ag.fillPolygon(h[1], v[1], 4); - else if(colouring == AProjectionLegoPlot.DRAW_JET){ - ag.fillPolygon(h[1], v[1], 4, (float)APar.instance().get("Jet","AlphaJets").getD()); //f specifies transparency fraction - }else if(colouring == AProjectionLegoPlot.DRAW_BJET) { - ag.fillPolygon(h[1], v[1], 4, 0.4f); //f specifies transparency fraction - } - else - ag.fillPolygon(h[1], v[1], 4, 0.8f); //f specifies transparency fraction - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/graphics/APickingGraphics2D.java b/graphics/AtlantisJava/src/atlantis/graphics/APickingGraphics2D.java deleted file mode 100755 index 9757b84ccdd1e9a8934d449ef2d79e569b97b2dc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/APickingGraphics2D.java +++ /dev/null @@ -1,432 +0,0 @@ -package atlantis.graphics; - -import java.awt.Graphics; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Shape; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.geom.PathIterator; -import java.util.ArrayList; - -import javax.swing.JPopupMenu; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.event.AData; -import atlantis.data.ATrackData; -import atlantis.data.ATrackResidualData; -import atlantis.list.AList; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.projection.AProjectionTrackResidual; -import atlantis.projection.AProjectionsManager; -import atlantis.utils.ALogger; - -/** - * A very limited PostScript graphics context for output of Atlantis functions - * Any call to a none implemented will throw an exception - */ - -public class APickingGraphics2D extends ATemplateGraphics2D -{ - private static ALogger logger = ALogger.getLogger(APickingGraphics2D.class); - - public final static int PICK_HITS_AND_TRACKS = 0; - public final static int PICK_DETECTORS = 1; - public final static int MOVE = 2; - public final static int PICK_RESIDUAL = 3; - - public static int mode; - - static AData pickedData = null; - static ATrackResidualData pickedResidual = null; - static ArrayList pickedDetectors; - static int pickedIndex; - - public static Point pickedPoint; - static double minDist; - public static double pickedH; - public static double pickedV; - - private static JPopupMenu residualPopupMenu; - private static final String SHOW_RESIDUALS_X = "Show Residual X"; - private static final String SHOW_PULLS_X = "Show Pull X"; - - static - { - residualPopupMenu = new JPopupMenu(); - ActionListener residualPopupActionListener = - new APickingGraphics2D.ResidualPopupMenuActionListener(); - residualPopupMenu.add(SHOW_RESIDUALS_X).addActionListener(residualPopupActionListener); - residualPopupMenu.add(SHOW_PULLS_X).addActionListener(residualPopupActionListener); - } - - static class ResidualPopupMenuActionListener implements ActionListener - { - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - - // Use window "B" to show track residual - String residualWindowName = "B"; - if(ACanvas.getCanvas().isValidWindowName(residualWindowName)) - { - AWindow residualWindow = ACanvas.getCanvas().getWindow(residualWindowName); - AProjectionTrackResidual residualProj = - (AProjectionTrackResidual) AProjectionsManager.getProjection("TrackResidual"); - if (action.equals(SHOW_RESIDUALS_X)) - residualProj.setResidualType(ATrackResidualData.RESIDUAL_X); - else if (action.equals(SHOW_PULLS_X)) - residualProj.setResidualType(ATrackResidualData.PULL_X); - - // when this action is activated, the pickedData must be a track - ATrackData trackData = (ATrackData) pickedData; - residualProj.setResidual(trackData.getTrackResidual(pickedIndex)); - ACanvas.getCanvas().moveToFrontWindow(residualWindowName); - residualWindow.setProjection(residualProj); - } - else - AOutput.append("\nWindow " + residualWindowName + " is not available in current layout" - + "\n", ALogInterface.WARNING); - } - } - - public APickingGraphics2D(Rectangle bounds, int m, Point p) - { - super(bounds); - mode = m; - pickedPoint = p; - minDist = 10000000.; - if (mode != MOVE) - { - pickedData = null; - pickedIndex = -1; - } - if (pickedDetectors == null) - { - pickedDetectors = new ArrayList(); - } - else - { - pickedDetectors.clear(); - } - } - - APickingGraphics2D(APickingGraphics2D a) - { - super(a); - } - - public Graphics create() - { - return new APickingGraphics2D(this); - } - - public void drawLine(double h0, double v0, double h1, double v1) - { - if (mode == PICK_DETECTORS) - return; - if (AGraphics.currentData == null) - return; - if (mode == MOVE && - !(AGraphics.currentData == pickedData && AGraphics.currentIndex == pickedIndex)) - return; - double hPicked = pickedPoint.getX(); - double vPicked = pickedPoint.getY(); - // treat first two endpoints - double delH = h0 - hPicked; - double delV = v0 - vPicked; - double dist = delH * delH + delV * delV; - - if (dist < minDist) - { - minDist = dist; - setPicked(h0, v0); - } - delH = h1 - hPicked; - delV = v1 - vPicked; - dist = delH * delH + delV * delV; - if (dist < minDist) - { - minDist = dist; - setPicked(h1, v1); - } - // now treat point within line being closest - double h10 = h1 - h0; - double v10 = v1 - v0; - double hp0 = hPicked - h0; - double vp0 = vPicked - v0; - double size = h10 * h10 + v10 * v10; - - if (size > 0.0) - { - double u = (h10 * hp0 + v10 * vp0) / size; - - if (u > 0. && u < 1.) - { - double hClosest = h0 + u * h10; - double vClosest = v0 + u * v10; - - delH = hClosest - hPicked; - delV = vClosest - vPicked; - dist = delH * delH + delV * delV; - if (dist < minDist) - { - minDist = dist; - setPicked(hClosest, vClosest); - } - } - } - } - - public void fillRect(int h, int v, int width, int height) - { - if (mode == PICK_DETECTORS && AGraphics.currentDetector != null) - { - // Collect the different detector names. - String info = AGraphics.currentDetector.getInfo(AGraphics.currentIndex); - if (!pickedDetectors.contains(info)) - { - pickedDetectors.add(info); - } - } - double dh = width / 2.; - double dv = height / 2.; - drawLine(h - dh, v - dv, h + dh, v - dv); - drawLine(h + dh, v - dv, h + dh, v + dv); - drawLine(h + dh, v + dv, h - dh, v + dv); - drawLine(h - dh, v + dv, h - dh, v - dv); - } - - public void draw(Shape s) - { - PathIterator path = s.getPathIterator(null); - double[] coords = new double[6]; - double h0 = 0.; - double v0 = 0.; - double h1 = 0.; - double v1 = 0.; - double hInit = 0.; - double vInit = 0.; - while (!path.isDone()) - { - int segType = path.currentSegment(coords); - - switch (segType) - { - case PathIterator.SEG_MOVETO: - h0 = coords[0]; - v0 = coords[1]; - hInit = h0; - vInit = v0; - break; - - case PathIterator.SEG_LINETO: - case PathIterator.SEG_CUBICTO: - h1 = coords[0]; - v1 = coords[1]; - drawLine(h0, v0, h1, v1); - h0 = h1; - v0 = v1; - break; - - case PathIterator.SEG_CLOSE: - drawLine(h0, v0, hInit, vInit); - break; - - default: - logger.error(" Error unknown segment type"); - break; - } - path.next(); - } - } - - public void fill(Shape s) - { - if (mode == PICK_DETECTORS && AGraphics.currentDetector != null) - { - double[][] hv = getPolygon(s); - if (AGraphics.isPointInside(hv[0], hv[1], hv[0].length, pickedPoint.getX(), pickedPoint.getY())) - { - // Collect the different detector names. - String info = AGraphics.currentDetector.getInfo(AGraphics.currentIndex); - if (!pickedDetectors.contains(info)) - { - pickedDetectors.add(info); - } - } - } - else - { - draw(s); - } - } - - public double[][] getPolygon(Shape s) - { - double[] coords = new double[6]; - - int numPoints = 0; - PathIterator path = s.getPathIterator(null); - while (!path.isDone()) - { - int segType = path.currentSegment(coords); - switch (segType) - { - case PathIterator.SEG_MOVETO: - numPoints++; - break; - - case PathIterator.SEG_LINETO: - case PathIterator.SEG_CUBICTO: - numPoints++; - break; - - case PathIterator.SEG_CLOSE: - // numPoints++; - break; - - default: - break; - } - path.next(); - } - double[][] hv = new double[2][numPoints]; - numPoints = 0; - path = s.getPathIterator(null); - while (!path.isDone()) - { - int segType = path.currentSegment(coords); - - switch (segType) - { - case PathIterator.SEG_MOVETO: - hv[0][numPoints] = coords[0]; - hv[1][numPoints] = coords[1]; - numPoints++; - break; - - case PathIterator.SEG_LINETO: - case PathIterator.SEG_CUBICTO: - hv[0][numPoints] = coords[0]; - hv[1][numPoints] = coords[1]; - numPoints++; - break; - - case PathIterator.SEG_CLOSE: - // drawLine(h0,v0,hInit,vInit); - break; - - default: - logger.error(" Error unknown segment type"); - break; - } - path.next(); - } - return hv; - } - - private static void setPicked(double h, double v) - { - pickedData = AGraphics.currentData; - pickedIndex = AGraphics.currentIndex; - pickedH = h; - pickedV = v; - } - - public static AData getPickedData() - { - return pickedData; - - } // getPickedData() - - public static ATrackResidualData getPickedResidual() - { - return pickedResidual; - } - - public static int getPickedH() - { - return (int) Math.rint(pickedH); - } - - public static int getPickedV() - { - return (int) Math.rint(pickedV); - } - - public static AList getPickedHit() - { - if (pickedData != null) - return new AList(pickedData, pickedIndex); - else - return null; - } - - public static Integer getPickedHitIndex() - { - if (pickedData != null) - { - return new Integer(pickedIndex); - } - else - { - return null; - } - } - - public static void setPicked(AData data, int index) - { - pickedData = data; - pickedIndex = index; - } - - public static void setPicked(ATrackResidualData data) - { - pickedResidual = data; - } - - public static void printPicked() - { - if(mode == APickingGraphics2D.PICK_RESIDUAL) - { - AOutput.alwaysAppend("\n\n" + pickedResidual.getHitInfo(), ALogInterface.PICK); - mode = APickingGraphics2D.PICK_HITS_AND_TRACKS; - } - else - { - if (pickedData != null) - { - AOutput.alwaysAppend("\n\n" + pickedData.getHitInfo(pickedIndex), ALogInterface.PICK); - } - else if (pickedDetectors != null && pickedDetectors.size() > 0) - { - AOutput.alwaysAppend("\n\nYou are inside:\n", ALogInterface.PICK); - for (int i = 0; i < pickedDetectors.size(); i++) - { - AOutput.alwaysAppend(" " + pickedDetectors.get(i) + "\n", ALogInterface.PICK); - } - } - } - } - - /** - * Method is called after pick+n (navigate = show data associations) - */ - public static void navigatePicked() - { - if(pickedData != null) - { - String navigateInfo = pickedData.navigate(pickedIndex); - AOutput.alwaysAppend("\n" + navigateInfo + "\n", ALogInterface.PICK); - } - } - - public static void showTrackResiduals(AWindow window, int x, int y) - { - APickingGraphics2D.residualPopupMenu.show(window, x, y); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/APixelGraphics.java b/graphics/AtlantisJava/src/atlantis/graphics/APixelGraphics.java deleted file mode 100755 index 44a5136d93c11ac6a96add448645ea65e180318f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/APixelGraphics.java +++ /dev/null @@ -1,304 +0,0 @@ -package atlantis.graphics; - -import java.awt.Graphics; -import java.awt.Rectangle; -import java.awt.geom.GeneralPath; - -/** - * This graphics is used for drawing on the screen and making pixel based - * images. In the end all drawing is done in pixels(integers). Picking is - * implemented here. Provide high quality pixel based drawing of thin frames - * around lines and areas, in the method draw. - */ -// When drawing borders could speed things up by only drawing what is needed -public class APixelGraphics extends AGraphics -{ - APixelGraphics(Graphics g) - { - super(g); - } - - public void setLineWidth(int lineWidth) - {} - - public void drawLine(double h0, double v0, double h1, double v1) - { - if (clipper.isLineWithin(h0, v0, h1, v1)) - { - double[][] hvClipped = clipper.getHV(); - double h0Clipped = hvClipped[0][0]; - double v0Clipped = hvClipped[1][0]; - double h1Clipped = hvClipped[0][1]; - double v1Clipped = hvClipped[1][1]; - if (lineWidth == 1) - { - updateColor(); - g.drawLine((int) h0Clipped, (int) v0Clipped, (int) h1Clipped, (int) v1Clipped); - } - else - { - drawThickLine(h0Clipped, v0Clipped, h1Clipped, v1Clipped); - } - } - - } // drawLine() - - private void drawThickLine(double h0, double v0, double h1, double v1) - { - // Drawing thick line this way is quicker than using setLine width - // correct for Postscipt - // pretty good for pixel device (assume java line drawing is Bresenhams - // or similar) - double h = Math.abs(h1 - h0); - double v = Math.abs(v1 - v0); - - for (int i = 0; i < lineWidth; ++i) - { - // 101/50 to avoid rounding toward 0 problem - int d = i + (101 - lineWidth) / 2 - 50; - - int h0new = (int) h0; - int v0new = (int) v0; - int h1new = (int) h1; - int v1new = (int) v1; - - if (h > v) - { - v0new += d; - v1new += d; - } - else - { - h0new += d; - h1new += d; - } - - // Caution!!! - // When point (h0, v0) or (h1, v1) is close to the border of the - // drawing area, after +/- d, the (h0new, v0new) or (h1new, v1new) - // might beyond the valid value range, which will cause an - // IndexArrayOutOfBound error thrown from g.drawLine method. - if(clipper.isLineWithin(h0new, v0new, h1new, v1new)) - { - updateColor(); - h0new = (int) clipper.getH0(); - v0new = (int) clipper.getV0(); - h1new = (int) clipper.getH1(); - v1new = (int) clipper.getV1(); - g.drawLine(h0new, v0new, h1new, v1new); - } - } - } - - public void drawSmoothLine(double h0, double v0, double ch0, double cv0, - double ch1, double cv1, double h1, double v1) - { - GeneralPath curve = new GeneralPath(); - for (int i=0; i<lineWidth; ++i) { - // 101/50 to avoid rounding toward 0 problem - int d = i + (101 - lineWidth) / 2 - 50; - float dh, dv; - - if (Math.abs(h1 - h0) > Math.abs(v1 - v0)) { - dh = 0; - dv = d; - } else { - dh = d; - dv = 0; - } - - curve.moveTo((float)h0+dh, (float)v0+dv); - curve.curveTo((float)ch0+dh, (float)cv0+dv, (float)ch1+dh, (float)cv1+dv, (float)h1+dh, (float)v1+dv); - } - updateColor(); - g.draw(curve); - } - - protected void fillRect(double h, double v, int width, int height) - { - updateColor(); - g.fillRect((int) (h - width / 2.), (int) (v - height / 2.), width, height); - } - - @Override - protected void fillOval(double h, double v, int width, int height) { - - g.fillOval((int) (h - width / 2.), (int) (v - height / 2.), width, height); - g.drawOval((int) (h - width / 2.), (int) (v - height / 2.), width, height); - } - - public void drawPolygon(double[] h, double[] v, int numPoints) - { - int type = getContainmentType(h, v, numPoints, POLYGON); - - if (type == FULLY_INSIDE || type == INTERSECTS) - { - for (int i = 0; i < numPoints - 1; ++i) - { - drawLine(h[i], v[i], h[i + 1], v[i + 1]); - } - if (numPoints > 1) - { - drawLine(h[numPoints - 1], v[numPoints - 1], h[0], v[0]); - } - } - } // drawPolygon() - - public void drawPolyline(double[] h, double[] v, int numPoints) - { - int type = getContainmentType(h, v, numPoints, POLYLINE); - if (type == FULLY_INSIDE || type == INTERSECTS) - { - // Some code here to simplify polylines by only drawing segments - // at least 1 pixel long, speeds up the ellipses for recvertices - // quite a lot since they're often very small but have thousands - // of line segments - AD - double lasth = 0.0; - double lastv = 0.0; - - for (int i = 0; i < numPoints - 1; ++i) { - if (i == 0) { - // Always draw something - lasth = h[1]; - lastv = v[1]; - drawLine(h[0], v[0], h[1], v[1]); - } - - double diffh = h[i+1] - lasth; - double diffv = v[i+1] - lastv; - - if ((diffh*diffh + diffv*diffv) > 1.0) { - drawLine(lasth, lastv, h[i + 1], v[i + 1]); - lasth = h[i+1]; - lastv = v[i+1]; - } - } - } - } // drawPolyline() - - public void drawDottedPolyline(double[] h, double[] v, int numPoints) - { - int type = getContainmentType(h, v, numPoints, POLYLINE); - if (type == FULLY_INSIDE || type == INTERSECTS) - { - for (int i = 0; i < numPoints - 1; i += 2) - drawLine(h[i], v[i], h[i + 1], v[i + 1]); - } - } // drawDottedPolyline() - - public void drawSmoothPolyline(double[] h0, double[] v0, int numPoints0) { - - // For curves having less than 3 points and for picking use the normal polyline. - if (numPoints0 < 3 || g instanceof APickingGraphics2D) { - drawPolyline(h0, v0, numPoints0); - return; - } - - int type = getContainmentType(h0, v0, numPoints0, POLYLINE); - if (type == FULLY_INSIDE || type == INTERSECTS) { - - int numPoints = 3 * numPoints0 - 2; - - // Add the control points to the array, at 1/3 and 2/3 - // between the already existing points. - float[] h = new float[numPoints]; - float[] v = new float[numPoints]; - for (int i=0; i<numPoints; i++) { - - switch (i%3) { - case 0: - // One of the fixed points. - h[i] = (float)h0[i/3]; - v[i] = (float)v0[i/3]; - break; - case 1: - // First control point. - h[i] = (float)(2./3. * h0[i/3] + 1./3. * h0[i/3+1]); - v[i] = (float)(2./3. * v0[i/3] + 1./3. * v0[i/3+1]); - break; - case 2: - // Second control point. - h[i] = (float)(1./3. * h0[i/3] + 2./3. * h0[i/3+1]); - v[i] = (float)(1./3. * v0[i/3] + 2./3. * v0[i/3+1]); - break; - } - } - - // Now we have a normal polyline (straight line segments between fixed points), - // but as a cubic Bezier curve. All we need to do to make it smooth is to move - // the control points away from the curve, in such a way that [control point 2] - - // [fixed point] - [control point 1] is a straight line for every fixed point. - // We do this by averaging the angles of the line segments on either side of a - // fixed point. - for (int i=3; i<numPoints-2; i+=3) { - double lenLeft = Math.sqrt(Math.pow(h[i]-h[i-1], 2) + Math.pow(v[i]-v[i-1], 2)); - double lenRight = Math.sqrt(Math.pow(h[i+1]-h[i], 2) + Math.pow(v[i+1]-v[i], 2)); - - // Without length we cannot define an angle, so skip the point. - if (lenLeft < 1e-6 || lenRight < 1e-6) continue; - - double phiLeft = Math.atan2(v[i]-v[i-1], h[i]-h[i-1]); - double phiRight = Math.atan2(v[i+1]-v[i], h[i+1]-h[i]); - - if (phiLeft-phiRight > Math.PI) { - phiRight += 2.*Math.PI; - } else if (phiRight-phiLeft > Math.PI) { - phiLeft += 2.*Math.PI; - } - - if (Math.abs(phiLeft-phiRight) > Math.PI/2.) { - // The line turns more than 90 degrees, this is wrong. Move the control points - // back in so they are the same as the point on the line. This disables the smooth - // curve locally, reverting to a normal connect-the-dots polyline. - h[i-1] = h[i+1] = h[i]; - v[i-1] = v[i+1] = v[i]; - } else { - // Calculate the desired angle for the tangent by weighting the angle on each side, - // the weight is inverse proportional to the distance to the next point. - double phi = (lenRight*phiLeft + lenLeft*phiRight) / (lenLeft+lenRight); - - h[i-1] = h[i] - (float)(lenLeft*Math.cos(phi)); - v[i-1] = v[i] - (float)(lenLeft*Math.sin(phi)); - h[i+1] = h[i] + (float)(lenRight*Math.cos(phi)); - v[i+1] = v[i] + (float)(lenRight*Math.sin(phi)); - } - } - - for (int i=0; i<numPoints-1; i+=3) { - drawSmoothLine(h[i], v[i], h[i+1], v[i+1], h[i+2], v[i+2], h[i+3], v[i+3]); - } - } - } - - public void fillPolygon(double[] h, double[] v, int numPoints) - { - int type = getContainmentType(h, v, numPoints, POLYGON); - if (type == FULLY_INSIDE || type == INTERSECTS) - { - if (type == INTERSECTS) - { - ACoord clipped = clipper.clipPolygon(h, v, numPoints); - h = clipped.hv[0][0]; - v = clipped.hv[1][0]; - numPoints = h.length; - } - int[] hInt = new int[numPoints]; - int[] vInt = new int[numPoints]; - for (int i = 0; i < numPoints; ++i) - { - hInt[i] = (int) h[i]; - vInt[i] = (int) v[i]; - } - updateColor(); - g.fillPolygon(hInt, vInt, numPoints); - drawPolygon(h, v, numPoints); - } - else if (type == CONTAINS) - { - Rectangle bounds = g.getClipBounds(); - updateColor(); - g.fillRect((int) Math.rint(bounds.getX()), (int) Math.rint(bounds.getY()), (int) Math.rint(bounds.getWidth()), (int) Math.rint(bounds.getHeight())); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/ATemplateGraphics2D.java b/graphics/AtlantisJava/src/atlantis/graphics/ATemplateGraphics2D.java deleted file mode 100755 index 12dcf005ccc476942dc760297c3e6cb5e8f188d2..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/ATemplateGraphics2D.java +++ /dev/null @@ -1,47 +0,0 @@ -package atlantis.graphics; - -import java.awt.*; - -/** - * A very limited template graphics which implements the default behaviour - * of the clip region. - */ - -public abstract class ATemplateGraphics2D extends ADummyGraphics2D { - - private Rectangle currentClip; - private Rectangle imageBounds; - - public ATemplateGraphics2D(Rectangle bounds) { - currentClip=new Rectangle(bounds); - imageBounds=new Rectangle(bounds); - } - - protected ATemplateGraphics2D(ATemplateGraphics2D parent) { - currentClip=new Rectangle(parent.currentClip); - imageBounds=new Rectangle(parent.imageBounds); - } - - public abstract Graphics create(); - - public Rectangle getClipBounds() { - return new Rectangle(currentClip); - } - - public void setClip(int x, int y, int width, int height) { - currentClip=new Rectangle(x, y, width, height); - } - - public void clipRect(int x, int y, int width, int height) { - currentClip=currentClip.intersection(new Rectangle(x, y, width, height)); - } - - public void translate(int x, int y) { - translate((double)x, (double)y); - } - - public void translate(double x, double y) { - currentClip.setLocation((int)Math.round(currentClip.x-x), (int)Math.round(currentClip.y-y)); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/AVectorGraphics.java b/graphics/AtlantisJava/src/atlantis/graphics/AVectorGraphics.java deleted file mode 100755 index 058f8c075aa079288306b8d3b0b9630a029f3d92..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/AVectorGraphics.java +++ /dev/null @@ -1,309 +0,0 @@ -package atlantis.graphics; - -import java.awt.*; -import java.awt.geom.Ellipse2D; -import java.awt.geom.GeneralPath; - -/** - * Used when drawing to postscript - */ -public class AVectorGraphics extends AGraphics { - - private GeneralPath path=new GeneralPath(); - - AVectorGraphics(Graphics g) { - super(g); - } - - public void setLineWidth(int lineWidth) { - setStroke(new BasicStroke(lineWidth)); - } - - public void drawLine(int h0, int v0, int h1, int v1) { - drawLine((double)h0, (double)v0, (double)h1, (double)v1); - } - - public void drawLine(double h0, double v0, double h1, double v1) { - if(clipper.isLineWithin(h0, v0, h1, v1)) { - double[][] hvClipped=clipper.getHV(); - double h0Clipped=hvClipped[0][0]; - double v0Clipped=hvClipped[1][0]; - double h1Clipped=hvClipped[0][1]; - double v1Clipped=hvClipped[1][1]; - - path.reset(); - path.moveTo((float)h0Clipped, (float)v0Clipped); - path.lineTo((float)h1Clipped, (float)v1Clipped); - updateColor(); - g.draw(path); - } - } - - protected void fillRect(double h, double v, int width, int height) { - path.reset(); - float h0=(float)h; - float v0=(float)v; - float dh=(float)(width/2.); - float dv=(float)(height/2.); - - path.moveTo(h0-dh, v0-dv); - path.lineTo(h0+dh, v0-dv); - path.lineTo(h0+dh, v0+dv); - path.lineTo(h0-dh, v0+dv); - path.closePath(); - updateColor(); - g.fill(path); - } - - protected void fillOval(double h, double v, int width, int height) { - - Ellipse2D oval = new Ellipse2D.Float((float)(h-width/2.), (float)(v-height/2.), width, height); - updateColor(); - g.fill(oval); - } - - public void drawPolygon(double[] h, double[] v, int numPoints) { - - int type=getContainmentType(h, v, numPoints, POLYGON); - if(type==FULLY_INSIDE||type==INTERSECTS) { - if(type==INTERSECTS) { - ACoord clipped=clipper.clipPolygon(h, v, numPoints); - h=clipped.hv[0][0]; - v=clipped.hv[1][0]; - numPoints=h.length; - } - - path.reset(); - for(int i=0; i<numPoints; ++i) { - if(i==0) - path.moveTo((float)h[i], (float)v[i]); - else - path.lineTo((float)h[i], (float)v[i]); - } - if(numPoints>0) { - path.closePath(); - updateColor(); - g.draw(path); - } - } - } - - public void drawPolyline(double[] h, double[] v, int numPoints) { - int type=getContainmentType(h, v, numPoints, POLYLINE); - if(type==FULLY_INSIDE||type==INTERSECTS) { - int start=0; - int end=numPoints-1; - - if(type==INTERSECTS) { - // clip polylines if there is only one interval - for(int i=0; i<numPoints-1; i++) { - if(clipper.isLineWithin(h[i], v[i], h[i+1], v[i+1])) { - start=i; - break; - } - } - for(int i=numPoints-1; i>start; i--) { - if(clipper.isLineWithin(h[i], v[i], h[i-1], v[i-1])) { - end=i; - break; - } - } - for(int i=start; i<end; i++) { - if(!clipper.isLineWithin(h[i], v[i], h[i+1], v[i+1])) { - start=0; - end=numPoints-1; - break; - } - } - } - - /* - if (type == INTERSECTS) { - ACoord clipped = clipper.clipPolygon(h, v, numPoints); - h = clipped.hv[0][0]; - v = clipped.hv[1][0]; - numPoints = h.length; - } - */ - - path.reset(); - for(int i=start; i<=end; ++i) { - if(i==start) - path.moveTo((float)h[i], (float)v[i]); - else - path.lineTo((float)h[i], (float)v[i]); - } - if(end-start>0) { - updateColor(); - g.draw(path); - } - } - } - - // very similar with drawPolyline, but draw a dotted instead - public void drawDottedPolyline(double[] h, double[] v, int numPoints) { - int type=getContainmentType(h, v, numPoints, POLYLINE); - if(type==FULLY_INSIDE||type==INTERSECTS) { - int start=0; - int end=numPoints-1; - - if(type==INTERSECTS) { - // clip polylines if there is only one interval - for(int i=0; i<numPoints-1; i++) { - if(clipper.isLineWithin(h[i], v[i], h[i+1], v[i+1])) { - start=i; - break; - } - } - for(int i=numPoints-1; i>start; i--) { - if(clipper.isLineWithin(h[i], v[i], h[i-1], v[i-1])) { - end=i; - break; - } - } - for(int i=start; i<end; i++) { - if(!clipper.isLineWithin(h[i], v[i], h[i+1], v[i+1])) { - start=0; - end=numPoints-1; - break; - } - } - } - - path.reset(); - boolean drawFlag = false; - for(int i=start; i<=end; ++i) { - if(drawFlag) - path.lineTo((float)h[i], (float)v[i]); - else - path.moveTo((float)h[i], (float)v[i]); - drawFlag = !drawFlag; - } - if(end-start>0) { - updateColor(); - g.draw(path); - } - } - - } - - public void drawSmoothPolyline(double[] h0, double[] v0, int numPoints0) { - - // For curves having less than 3 points and for picking use the normal polyline. - if (numPoints0 < 3 || g instanceof APickingGraphics2D) { - drawPolyline(h0, v0, numPoints0); - return; - } - - int type = getContainmentType(h0, v0, numPoints0, POLYLINE); - if (type == FULLY_INSIDE || type == INTERSECTS) { - - GeneralPath curve = new GeneralPath(); - int numPoints = 3 * numPoints0 - 2; - - // Add the control points to the array, at 1/3 and 2/3 - // between the already existing points. - float[] h = new float[numPoints]; - float[] v = new float[numPoints]; - for (int i=0; i<numPoints; i++) { - - switch (i%3) { - case 0: - // One of the fixed points. - h[i] = (float)h0[i/3]; - v[i] = (float)v0[i/3]; - break; - case 1: - // First control point. - h[i] = (float)(2./3. * h0[i/3] + 1./3. * h0[i/3+1]); - v[i] = (float)(2./3. * v0[i/3] + 1./3. * v0[i/3+1]); - break; - case 2: - // Second control point. - h[i] = (float)(1./3. * h0[i/3] + 2./3. * h0[i/3+1]); - v[i] = (float)(1./3. * v0[i/3] + 2./3. * v0[i/3+1]); - break; - } - } - - // Now we have a normal polyline (straight line segments between fixed points), - // but as a cubic Bezier curve. All we need to do to make it smooth is to move - // the control points away from the curve, in such a way that [control point 2] - - // [fixed point] - [control point 1] is a straight line for every fixed point. - // We do this by averaging the angles of the line segments on either side of a - // fixed point. - for (int i=3; i<numPoints-2; i+=3) { - double lenLeft = Math.sqrt(Math.pow(h[i]-h[i-1], 2) + Math.pow(v[i]-v[i-1], 2)); - double lenRight = Math.sqrt(Math.pow(h[i+1]-h[i], 2) + Math.pow(v[i+1]-v[i], 2)); - - // Without length we cannot define an angle, so skip the point. - if (lenLeft < 1e-6 || lenRight < 1e-6) continue; - - double phiLeft = Math.atan2(v[i]-v[i-1], h[i]-h[i-1]); - double phiRight = Math.atan2(v[i+1]-v[i], h[i+1]-h[i]); - - if (phiLeft-phiRight > Math.PI) { - phiRight += 2.*Math.PI; - } else if (phiRight-phiLeft > Math.PI) { - phiLeft += 2.*Math.PI; - } - - if (Math.abs(phiLeft-phiRight) > Math.PI/2.) { - // The line turns more than 90 degrees, this is wrong. Move the control points - // back in so they are the same as the point on the line. This disables the smooth - // curve locally, reverting to a normal connect-the-dots polyline. - h[i-1] = h[i+1] = h[i]; - v[i-1] = v[i+1] = v[i]; - } else { - // Calculate the desired angle for the tangent by weighting the angle on each side, - // the weight is inverse proportional to the distance to the next point. - double phi = (lenRight*phiLeft + lenLeft*phiRight) / (lenLeft+lenRight); - - h[i-1] = h[i] - (float)(lenLeft*Math.cos(phi)); - v[i-1] = v[i] - (float)(lenLeft*Math.sin(phi)); - h[i+1] = h[i] + (float)(lenRight*Math.cos(phi)); - v[i+1] = v[i] + (float)(lenRight*Math.sin(phi)); - } - } - - curve.moveTo(h[0], v[0]); - for (int i=3; i<numPoints; i+=3) { - curve.curveTo(h[i-2], v[i-2], h[i-1], v[i-1], h[i], v[i]); - } - - updateColor(); - g.draw(curve); - } - } - - public void fillPolygon(double[] h, double[] v, int numPoints) { - int type=getContainmentType(h, v, numPoints, POLYGON); - if(type==FULLY_INSIDE||type==INTERSECTS) { - if(type==INTERSECTS) { - ACoord clipped=clipper.clipPolygon(h, v, numPoints); - h=clipped.hv[0][0]; - v=clipped.hv[1][0]; - numPoints=h.length; - } - path.reset(); - - for(int i=0; i<numPoints; ++i) - if(i==0) - path.moveTo((float)h[i], (float)v[i]); - else - path.lineTo((float)h[i], (float)v[i]); - if(numPoints>0) { - path.closePath(); - updateColor(); - g.fill(path); - g.draw(path); - } - } else if(type==CONTAINS) { - Rectangle bounds=g.getClipBounds(); - updateColor(); - g.fillRect((int)Math.rint(bounds.getX()), (int)Math.rint(bounds.getY()), - (int)Math.rint(bounds.getWidth()), (int)Math.rint(bounds.getHeight())); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/colormap/AColorMap.java b/graphics/AtlantisJava/src/atlantis/graphics/colormap/AColorMap.java deleted file mode 100755 index 423a613163a37a9d59f4793f023bc78b5f33ca11..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/colormap/AColorMap.java +++ /dev/null @@ -1,365 +0,0 @@ -package atlantis.graphics.colormap; - -import java.io.File; -import java.io.InputStream; -import java.awt.Color; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.NamedNodeMap; - -import atlantis.globals.AGlobals; -import atlantis.output.AExceptionHandler; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.APar; -import atlantis.utils.AUtilities; -import atlantis.utils.ALogger; -import atlantis.utils.xml.AXMLErrorHandler; - - -public final class AColorMap -{ - private static ALogger logger = ALogger.getLogger(AColorMap.class); - - private static final boolean VALIDATION = true; - final public static int NO_COLOR = -1; - final public static int INVISIBLE = -2; - static final public int BG = 8; //background - static final public int WH = 0; //white - static final public int GY = 14; //grey - static final public int RD = 20; //red - static final public int GN = 21; //green - static final public int BL = 22; //blue - static final public int YE = 23; //yellow - static final public int MA = 24; //magenta - static final public int CY = 25; //cyan - static final public int BK = 26; //black - static final public int OR = 27; //orange - static final public int CB = 28; //cornflower blue - private static final String[] mapNames = {"Default(1)", "Default(2)", "M4+M5", "GrayDet", - "Original", "Gray", "B/W", "HitCol", "GrayHitCol"}; - private static final String[] mapNamesPS = {"default1","default2","m4m5", "graydet", - "original", "gray", "bw", "hitcol", "grayhitcol"}; - private static MappedColor[][] maps; - private static int numColors; - private static int numMaps; - - // Color map indices. - public static final int COLOR_MAP_DEFAULT1 = 0; - public static final int COLOR_MAP_DEFAULT2 = 1; - public static final int COLOR_MAP_M4M5 = 2; - public static final int COLOR_MAP_GRAYDET = 3; - public static final int COLOR_MAP_ORIGINAL = 4; - public static final int COLOR_MAP_GRAY = 5; - public static final int COLOR_MAP_BW = 6; - public static final int COLOR_MAP_HITCOL = 7; - public static final int COLOR_MAP_GRAY_HITCOL = 8; - - //color map used if wrong value in config file - static int currentMap = COLOR_MAP_DEFAULT1; - - - public static void readColorMap(String name) - { - String fileName = null; - String FILE_SEPAR = System.getProperty("file.separator"); - - if(name != null && new File(name).canRead()) - { - // color map file specified as command line argument - fileName = name; - } - else - { - if(name != null) - { - logger.warn("Can't read color map file: " + name); - } - // color map file wasn't specified as command line argument - fileName = ".Atlantis-colormap.xml"; // default name - String fileNameFull = System.getProperty("user.home") + FILE_SEPAR + fileName; - if(new File(fileNameFull).canRead()) - { - // use existing user's color map file - fileName = fileNameFull; - } - else - { - // use default color map file from Atlantis distribution - fileName = AGlobals.instance().getHomeDirectory() + "configuration" + - FILE_SEPAR + "colormap.xml"; - } - } - - logger.info("Using color map file: " + fileName); - try - { - InputStream isColorMap = AUtilities.getFileAsStream(fileName); - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setValidating(VALIDATION); - DocumentBuilder parser = factory.newDocumentBuilder(); - parser.setErrorHandler(new AXMLErrorHandler()); - Node colormap = parser.parse(isColorMap).getDocumentElement(); - NamedNodeMap cm = colormap.getAttributes(); - numMaps = Integer.parseInt(cm.getNamedItem("numMaps").getNodeValue(). - trim()); - numColors = Integer.parseInt(cm.getNamedItem("numColors"). - getNodeValue().trim()); - maps = new MappedColor[numMaps][numColors]; - NodeList list = colormap.getChildNodes(); - int count = list.getLength(); - for(int i = 0; i < count; i++) - { - Node mapping = list.item(i); - if(mapping.getNodeType() == Node.ELEMENT_NODE) - { - NamedNodeMap atts = mapping.getAttributes(); - try - { - int map = Integer.parseInt(atts.getNamedItem("map"). - getNodeValue().trim()); - int index = Integer.parseInt(atts.getNamedItem("index"). - getNodeValue().trim()); - int r = Integer.parseInt(atts.getNamedItem("r"). - getNodeValue().trim()); - int g = Integer.parseInt(atts.getNamedItem("g"). - getNodeValue().trim()); - int b = Integer.parseInt(atts.getNamedItem("b"). - getNodeValue().trim()); - if(map < maps.length) - { - if(index < maps[map].length) - { - maps[map][index] = new MappedColor(r, g, b, - index); - } - } - } - catch(NumberFormatException e) - { - AExceptionHandler.processException("Colour map error:\n" + - mapping, e); - } - } // if - } // for - } - catch(Exception e) - { - AExceptionHandler.processException("Error while reading colour map:\n" + - fileName, e); - } - for(int i = 0; i < maps.length; i++) - { - for(int j = 0; j < maps[i].length; j++) - { - if(maps[i][j] == null) - { - AOutput.append("\nColorMap (" + i + "," + j + - ") is not present", - ALogInterface.BAD_COMMAND); - } - } - } - - } // readColorMap() ----------------------------------------------------- - - - - public static int getNumMaps() - { - return numMaps; - } - - - public static int getNumColors() - { - return numColors; - } - - - /** - * Returns color map in the XML format. - * [Former method writeColorMap() was writing the XML data directly into - * the file.] - * @return String - */ - public static String getColorMapXML() - { - StringBuffer buffer = new StringBuffer(); - // color map DTD - buffer.append( - "<?xml version=\"1.0\"?>\n" + - "<!DOCTYPE colormap [\n" + - " <!ELEMENT colormap (Mapping*)>" + - " <!ATTLIST colormap\n" + - " numMaps CDATA #REQUIRED\n" + - " numColors CDATA #REQUIRED>\n" + - " <!ELEMENT Mapping EMPTY>\n" + - " <!ATTLIST Mapping\n" + - " map CDATA #REQUIRED\n" + - " index CDATA #REQUIRED\n" + - " r CDATA #REQUIRED\n" + - " g CDATA #REQUIRED\n" + - " b CDATA #REQUIRED>\n" + - "]>\n\n\n"); - buffer.append("<colormap numMaps=\"" + maps.length + - "\" numColors=\"" + maps[0].length + "\" >\n"); - for(int i = 0; i < maps.length; i++) - { - for(int j = 0; j < maps[i].length; j++) - { - int r = maps[i][j].getRed(); - int g = maps[i][j].getGreen(); - int b = maps[i][j].getBlue(); - buffer.append(" <Mapping map=\"" + i + "\" index=\"" + j + - "\" r=\"" + r + "\" g=\"" + g + "\" b=\"" + - b + "\"/>\n"); - } - } - buffer.append("</colormap>\n"); - return buffer.toString(); - - } // getColorMapXML() --------------------------------------------------- - - - - public static String getPSPrologColorMap() - { - StringBuffer s = new StringBuffer(); - String newLine = System.getProperty("line.separator"); - s.append(newLine); - for(int i = 0; i < maps.length; ++i) - { - s.append("/" + mapNamesPS[i] + "ColorMap" + newLine); - s.append("<<" + newLine); - for(int j = 0; j < maps[i].length; ++j) - s.append(" /C" + j + " [" + - String.format("%.3f",maps[i][j].getRed() / 255.) + " " - + String.format("%.3f",maps[i][j].getGreen() / 255.) + " " + - String.format("%.3f",maps[i][j].getBlue() / 255.) - + "]" + newLine); - s.append(">> def" + newLine); - s.append(newLine); - } - return s.toString(); - - } // getPSPrologColorMap() ---------------------------------------------- - - - - public static Color[] getColors(int map) - { - Color[] col = new Color[maps[map].length]; - for(int i = 0; i < col.length; ++i) - col[i] = (Color) maps[map][i]; - return col; - } - - //From hot (red), index 255, to cold (blue), index 0 - public static Color[] getShades(int num) - { - assert (num>=2); - Color[] col = new Color[num]; - col[0]=new Color(170,170,170);//grey for "other" - for(int i = 1; i < num-1; ++i) - col[i] = new Color(((255*i)/num),80,255-((255*i)/num)); - return col; - } - - public static Color[] getColors() - { - return getColors(currentMap); - } - - - public static void setColorMap(int map) - { - if(map >= 0 && map < maps.length) - { - currentMap = map; - APar parameterStore = APar.instance(); - parameterStore.get("Prefs","ColorMap").setI(map); - } - } - - - public static void setColorMap(String mapName) - { - for(int i = 0; i < mapNames.length; i++) - if(mapNames[i].equals(mapName)) - setColorMap(i); - } - - - public static int getColorMap() - { - return currentMap; - } - - public static boolean drawFrames() - { - if(currentMap==COLOR_MAP_GRAY || currentMap==COLOR_MAP_BW) - return true; - else - return false; - } - - public static String getPSColorMapName() - { - return mapNamesPS[getColorMap()]; - - } // getPSColorMapName() ------------------------------------------------ - - - public MappedColor getMappedColor(int colorIndex) - { - if(colorIndex < 0 && colorIndex >= maps[currentMap].length) - { - return null; - } - else - { - return maps[currentMap][colorIndex]; - } - } - - - public Color getColor(int colorIndex) - { - if(colorIndex < 0 && colorIndex >= maps[currentMap].length) - { - return null; - } - else - { - return(Color) maps[currentMap][colorIndex]; - } - } - - - public static String getTag(int colorIndex) - { - if(colorIndex < 0 && colorIndex >= maps[0].length) - { - return null; - } - else - { - return "C" + colorIndex; - } - } - - - public static String[] getMapNames() - { - return(String[]) mapNames.clone(); - } - - public static MappedColor[][] getMaps() { - return maps; - } - -} // class AColorMap ======================================================== diff --git a/graphics/AtlantisJava/src/atlantis/graphics/colormap/MappedColor.java b/graphics/AtlantisJava/src/atlantis/graphics/colormap/MappedColor.java deleted file mode 100755 index 53ace099fe82ef30ec9b4688dccd3dafca1fbdaf..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/colormap/MappedColor.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2000, CERN, Geneva, Switzerland and University of Santa Cruz, California, U.S.A. -package atlantis.graphics.colormap; - - -import java.awt.Color; - - -/** - * - * @author Charles Loomis - **/ -public class MappedColor extends java.awt.Color { - - /** - * Index of the color in the color map. */ - protected int colorIndex; - - /** - * Value of the brightness/darkness of this color. Larger values - * indicate darker colors and vice versa. */ - protected int brightness; - - /** - * Constructor takes the RGB color components and the color index. */ - public MappedColor(int r, int g, int b, - int colorIndex) { - - // Call the Color constructor. - super(r, g, b); - - // Set the color index and brightness. - this.colorIndex=colorIndex; - brightness=0; - } - - /** - * Constructor takes the RGB color components, the color index, - * and the brightness. */ - public MappedColor(int r, int g, int b, - int colorIndex, - int brightness) { - - // Call the Color constructor. - super(r, g, b); - - // Set the color index and brightness. - this.colorIndex=colorIndex; - this.brightness=brightness; - } - - /** - * Make a brightened color based on this color. */ - public Color brighter() { - - int r=getRed()*10/7; - int g=getGreen()*10/7; - int b=getBlue()*10/7; - - r=Math.max(0, Math.min(255, r)); - g=Math.max(0, Math.min(255, g)); - b=Math.max(0, Math.min(255, b)); - - return (Color)new MappedColor(r, g, b, colorIndex, brightness-1); - } - - /** - * Make a darkened color based on this color. */ - public Color darker() { - - int r=getRed()*7/10; - int g=getGreen()*7/10; - int b=getBlue()*7/10; - - r=Math.max(0, Math.min(255, r)); - g=Math.max(0, Math.min(255, g)); - b=Math.max(0, Math.min(255, b)); - - return (Color)new MappedColor(r, g, b, colorIndex, brightness-1); - } - - /** - * Get the brightness of this color. */ - public int getBrightness() { - return brightness; - } - - /** - * Get the tag associated with this color. */ - public String getColorTag() { - return AColorMap.getTag(colorIndex); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/dnd/ACallBack.java b/graphics/AtlantisJava/src/atlantis/graphics/dnd/ACallBack.java deleted file mode 100755 index 5cc4ec0a64c44f2e55b3694531f89eb1124bfb50..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/dnd/ACallBack.java +++ /dev/null @@ -1,9 +0,0 @@ -package atlantis.graphics.dnd; - - -/** - * Used in the Drag and Drop operations. - */ -public interface ACallBack { - void callBack(Object from); -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADnDButton.java b/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADnDButton.java deleted file mode 100755 index f637b28172b4b5529eb3964fe8fc0af8d01a17ef..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADnDButton.java +++ /dev/null @@ -1,88 +0,0 @@ -package atlantis.graphics.dnd; - -import java.awt.Point; -import java.awt.Graphics; -import javax.swing.JButton; -import java.awt.image.BufferedImage; -import java.awt.dnd.DragSourceDropEvent; -import java.awt.dnd.DragSourceListener; -import java.awt.dnd.DnDConstants; -import java.awt.dnd.DragGestureListener; -import java.awt.dnd.DragGestureEvent; -import java.awt.dnd.DragSource; -import java.awt.dnd.DragSourceDragEvent; -import java.awt.dnd.DragSourceEvent; -import java.util.Vector; - -/** - * A button wich has Drag and Drop support ( see java.awt.dnd.*) - * Used by the rubberbands. - */ - -public class ADnDButton extends JButton - implements DragSourceListener, DragGestureListener, ACallBack { - - private DragSource dragSource; - private Vector dragListeners; - - public ADnDButton(String name) { - super(name); - setName(name); - - dragSource=DragSource.getDefaultDragSource(); - dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this); - - dragListeners=new Vector(); - } - - // implementation of DragSourceListener - - // This method is invoked to signify that the Drag and Drop operation is complete. - public void dragDropEnd(DragSourceDropEvent dsde) {} - - // Called as the hotspot enters a platform dependent drop site. - public void dragEnter(DragSourceDragEvent dsde) { - dsde.getDragSourceContext().setCursor(ADnDLabel.DROP_VALID); - } - - // Called as the hotspot exits a platform dependent drop site. - public void dragExit(DragSourceEvent dse) { - dse.getDragSourceContext().setCursor(ADnDLabel.DROP_INVALID); - } - - // Called as the hotspot moves over a platform dependent drop site. - public void dragOver(DragSourceDragEvent dsde) { - dsde.getDragSourceContext().setCursor(ADnDLabel.DROP_VALID); - } - - // Called when the user has modified the drop gesture. - public void dropActionChanged(DragSourceDragEvent dsde) {} - - // implementation of DragGestureListener - - public void dragGestureRecognized(DragGestureEvent dge) { - BufferedImage resizeCursorImage=new BufferedImage(64, 64, BufferedImage.TYPE_4BYTE_ABGR); - - Graphics g=resizeCursorImage.getGraphics(); - - g.drawLine(0, 0, 64, 64); - g.dispose(); - - // return Toolkit.getDefaultToolkit().createCustomCursor(resizeCursorImage, center, "resize") - - - AObjectTransferable cbt=new AObjectTransferable(this); - - dragSource.startDrag(dge, ADnDLabel.DROP_INVALID, resizeCursorImage, new Point(0, 0), cbt, this); - } - - public void callBack(Object to) { - for(int i=0; i<dragListeners.size(); i++) - ((ADragListener)dragListeners.get(i)).dragPerformed(this, to, -1); - } - - public void addDragListener(ADragListener l) { - dragListeners.addElement(l); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADnDLabel.java b/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADnDLabel.java deleted file mode 100755 index 2b1873f55637307b2d0a3f268accf21cbc92bf91..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADnDLabel.java +++ /dev/null @@ -1,184 +0,0 @@ -package atlantis.graphics.dnd; - -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.Transferable; -import java.awt.dnd.DnDConstants; -import java.awt.dnd.DragGestureEvent; -import java.awt.dnd.DragGestureListener; -import java.awt.dnd.DragSource; -import java.awt.dnd.DragSourceDragEvent; -import java.awt.dnd.DragSourceDropEvent; -import java.awt.dnd.DragSourceEvent; -import java.awt.dnd.DragSourceListener; -import java.awt.dnd.DropTarget; -import java.awt.dnd.DropTargetDragEvent; -import java.awt.dnd.DropTargetDropEvent; -import java.awt.dnd.DropTargetEvent; -import java.awt.dnd.DropTargetListener; -import java.util.Vector; - -import javax.swing.JLabel; - -import atlantis.graphics.ACursorFactory; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; - -/** - * A label which has Drag and Drop support. - * Used in the Window Control. - */ -public class ADnDLabel extends JLabel -implements DropTargetListener, DragSourceListener, DragGestureListener { - - private DragSource dragSource=null; - private Vector dragListeners; - private boolean dragHighlight; - private String[] page; - - public JLabel getLabel() { - return this; - } - - public static final Cursor DROP_VALID; - public static final Cursor DROP_INVALID; - - static { - /* if(Toolkit.getDefaultToolkit().getBestCursorSize(64, 64).equals(new Dimension(64, 64))) { - DROP_VALID=Toolkit.getDefaultToolkit().createCustomCursor(Toolkit.getDefaultToolkit().getImage(Atlantis.getHomeDirectory() - +"img"+Atlantis.fileSep+"cursor_DnD_valid_64x64.gif"), - new Point(1, 1), "ValidDnD"); - DROP_INVALID=Toolkit.getDefaultToolkit().createCustomCursor(Toolkit.getDefaultToolkit().getImage(Atlantis.getHomeDirectory() - +"img"+Atlantis.fileSep+"cursor_DnD_invalid_64x64.gif"), - new Point(9, 9), "InvalidDnD"); - } else { - DROP_VALID=DragSource.DefaultMoveDrop; - DROP_INVALID=DragSource.DefaultMoveNoDrop; - } */ - DROP_VALID = ACursorFactory.getInstance().getDragValidCursor(); - DROP_INVALID = ACursorFactory.getInstance().getDragInvalidCursor(); - } - - public ADnDLabel(String name, boolean dragHighlight) { - super(name, JLabel.CENTER); - setName(name); - setOpaque(true); - page=null; - this.dragHighlight=dragHighlight; - - dragSource=new DragSource(); - dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this); - this.setDropTarget(new DropTarget(this, this)); - dragListeners=new Vector(); - } - - public ADnDLabel(String name, String[] wnames, boolean dragHighlight) { - super(name, JLabel.CENTER); - setName(name); - setOpaque(true); - page=wnames; - this.dragHighlight=dragHighlight; - - dragSource=new DragSource(); - dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this); - this.setDropTarget(new DropTarget(this, this)); - dragListeners=new Vector(); - } - - public Dimension getPreferredSize() { - return new Dimension(15, 15); - } - - // implementation of DropTargetListener - - private Color old; - - // Called when a drag operation has encountered the DropTarget. - public void dragEnter(DropTargetDragEvent dtde) { - dtde.acceptDrag(DnDConstants.ACTION_MOVE); - if(dragHighlight) { - old=getBackground(); - setBackground(new Color(150, 150, 150)); - } - } - - // The drag operation has departed the DropTarget without dropping. - public void dragExit(DropTargetEvent dte) { - if(dragHighlight) - setBackground(old); - } - - // Called when a drag operation is ongoing on the DropTarget. - public void dragOver(DropTargetDragEvent dtde) { - } - - // The drag operation has terminated with a drop on this DropTarget. - public void drop(DropTargetDropEvent dtde) { - try { - Transferable transferable=dtde.getTransferable(); - DataFlavor javaObjectDataFlavor=new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType); - - if(transferable.isDataFlavorSupported(javaObjectDataFlavor)) { - dtde.acceptDrop(DnDConstants.ACTION_MOVE); - Object object=transferable.getTransferData(javaObjectDataFlavor); - - if(object instanceof ACallBack) - ((ACallBack)object).callBack(this); - else - fireDragEvent(object); - dtde.getDropTargetContext().dropComplete(true); - } else - AOutput.append("Cannot accept drop\n", ALogInterface.BAD_COMMAND); - } catch(Exception e) { - e.printStackTrace(); - dtde.rejectDrop(); - } - } - - private void fireDragEvent(Object from) { - for(int i=0; i<dragListeners.size(); i++) - ((ADragListener)dragListeners.get(i)).dragPerformed(from, this, -1); - } - - // Called if the user has modified the current drop gesture. - public void dropActionChanged(DropTargetDragEvent dtde) {} - - // implementation of DragSourceListener - - // This method is invoked to signify that the Drag and Drop operation is complete. - public void dragDropEnd(DragSourceDropEvent dsde) {} - - // Called as the hotspot enters a platform dependent drop site. - public void dragEnter(DragSourceDragEvent dsde) { - dsde.getDragSourceContext().setCursor(DROP_VALID); - } - - // Called as the hotspot exits a platform dependent drop site. - public void dragExit(DragSourceEvent dse) { - dse.getDragSourceContext().setCursor(DROP_INVALID); - } - - // Called as the hotspot moves over a platform dependent drop site. - public void dragOver(DragSourceDragEvent dsde) { - dsde.getDragSourceContext().setCursor(DROP_VALID); - } - - // Called when the user has modified the drop gesture. - public void dropActionChanged(DragSourceDragEvent dsde) {} - - // implementation of DragGestureListener - public void dragGestureRecognized(DragGestureEvent dge) { - dragSource.startDrag(dge, DROP_VALID, new AObjectTransferable(this), this); - } - - public void addDragListener(ADragListener l) { - dragListeners.addElement(l); - } - - public String[] returnPageName() - { - return page; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADragListener.java b/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADragListener.java deleted file mode 100755 index 429b9a0af1441242ac757d288cfec4c33e52b93d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/dnd/ADragListener.java +++ /dev/null @@ -1,9 +0,0 @@ -package atlantis.graphics.dnd; - - -/** - * The listener to drag operations. It is suported by ADnDLabel and ADnDButton. - */ -public interface ADragListener { - void dragPerformed(Object from, Object to, int action); -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/dnd/AObjectTransferable.java b/graphics/AtlantisJava/src/atlantis/graphics/dnd/AObjectTransferable.java deleted file mode 100755 index d823077f674bc9013561559c8867629d230e4a09..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/dnd/AObjectTransferable.java +++ /dev/null @@ -1,62 +0,0 @@ -package atlantis.graphics.dnd; - - -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.Transferable; - - -/** - * Used by Drag and Drop - * A implementation of a transferable which - * transfers an Java object (really an pointer to it). - */ -public class AObjectTransferable implements Transferable { - private Object object; - - /** - * Creates the Transferable which will transfer the specified object. - * @param object The object to be transferred - */ - public AObjectTransferable(Object object) { - this.object=object; - } - - /** - * Returns the transferred for a specific DataFlavor. - * @param flavor The DataFlavor for which to get the transferred object. - * @return The transferred object. - */ - public Object getTransferData(DataFlavor flavor) { - return object; - } - - /** - * Returns an array of DataFlavor objects indicating the flavors the - * data can be provided in. - * @return The set of available flavors. - */ - public DataFlavor[] getTransferDataFlavors() { - DataFlavor df=null; - - try { - df=new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType); - } catch(ClassNotFoundException e) { - throw new Error("Cannot create DataFlavor.javaJVMLocalObjectMimeType "+e.getMessage()); - } - return new DataFlavor[] {df}; - } - - /** - * Returns whether or not the specified data flavor is - * supported by this transferable. - * @param flavor The data flavor that needs to be checked - * @return True if the flavor is supported. False Otherwise. - */ - public boolean isDataFlavorSupported(DataFlavor flavor) { - if(flavor.getHumanPresentableName().equals(DataFlavor.javaJVMLocalObjectMimeType)) - return true; - else - return false; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/encoders/AImageEncoder.java b/graphics/AtlantisJava/src/atlantis/graphics/encoders/AImageEncoder.java deleted file mode 100644 index a27b4f07d8b19157278619cbd10a522a1ef1df20..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/encoders/AImageEncoder.java +++ /dev/null @@ -1,167 +0,0 @@ -package atlantis.graphics.encoders; - -import atlantis.canvas.ACanvas; -import atlantis.utils.ALogger; - -import java.awt.Dimension; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.File; -import java.io.FileOutputStream; -import java.io.BufferedOutputStream; - -import org.apache.batik.dom.svg.SVGDOMImplementation; -import org.apache.batik.svggen.SVGGraphics2D; - -import org.sourceforge.jlibeps.epsgraphics.*; -import org.w3c.dom.*; -import org.w3c.dom.svg.SVGDocument; - -/** - * Takes the image drawn on the canvas and encodes it in the given format - * @author sboeser - */ -public class AImageEncoder { - - //The logger - private final static ALogger logger = ALogger.getLogger(AImageEncoder.class); - - /** - * Grabs canvas and encodes the data in PNG format. - * @param imageWidth resulting image width - * @param imageHeight resulting image height - * @return byte[] - */ - public byte[] getPNGData(int imageWidth, int imageHeight){ - - // Draw image - Image image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_ARGB); - ACanvas.getCanvas().drawScaledCanvas(image.getGraphics(), imageWidth, imageHeight, "png"); - - // Encode as PNG. - PngEncoder encoder = new PngEncoder(image, true, PngEncoder.FILTER_NONE, 9); - byte[] data = encoder.pngEncode(); - return data; - - } - - /** - * Get a scaled version of the PNG image - mostly used to create thumbnails - * NOTE: in contrast to getPNGData, this will first create the image with given - * width and height and then scale everything (including window - * borders, title bar, etc...) - * @param width image width before scaling - * @param height image height before scaling - * @param scale the scale factor - * @return the PNG data - */ - public byte[] getScaledPNGData(int width, int height, double scale){ - - // Draw a temporary full-size image - Image inputImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); - ACanvas.getCanvas().drawScaledCanvas(inputImage.getGraphics(), width, height, "png"); - - //Calculate target height keeping aspect ratio - int targetHeight = (int)(scale*height); - int targetWidth = (int)(scale*width); - - - /** - * Now rescale the image in steps - do not use Image.getScaledInstance, - * which is outdated and way to slow! - */ - - while (inputImage.getWidth(null) != targetWidth){ - - //Resize by no more than a factor of two in one step - if (inputImage.getWidth(null)/targetWidth > 2. ){ - width = (int)(inputImage.getWidth(null)/2.); - height = (int)(inputImage.getHeight(null)/2.); - } else { - width = targetWidth; - height = targetHeight; - } - - //log for debugging - logger.debug("Rescaling image from "+inputImage.getWidth(null)+"x"+inputImage.getHeight(null)+ - " to "+width+"x"+height); - - //Now redraw that to the scaled image - BufferedImage scaledImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); - Graphics2D scaledGraphics = scaledImage.createGraphics(); - scaledGraphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BICUBIC); - scaledGraphics.drawImage(inputImage, 0, 0, width, height, null); - scaledGraphics.dispose(); - - //Provide the scaled image as new input in case we need to rescale once more - inputImage = scaledImage; - } - - // Encode as PNG. - PngEncoder encoder = new PngEncoder(inputImage, true, PngEncoder.FILTER_NONE, 9); - byte[] data = encoder.pngEncode(); - return data; - - } - - - /** - * Grab canvas, encode the information as EPS and save to a file - * @param imageWidth image width - * @param imageHeight image height - * @param saveFile save file - */ - - public void saveEPS(int imageWidth, int imageHeight, File saveFile) throws IOException{ - - //Create the output stream - FileOutputStream fos = new FileOutputStream(saveFile); - BufferedOutputStream bos = new BufferedOutputStream(fos); - - // Create a new postscript graphics object - EpsGraphics2D g = new EpsGraphics2D("Atlantis",bos,0,0,imageWidth,imageHeight); - // Draw text as shapes - g.setAccurateTextMode(true); - // Draw into the postscript graphics - ACanvas.getCanvas().drawScaledCanvas(g, imageWidth, imageHeight, "eps"); - g.flush(); - g.close(); - fos.close(); - bos.close(); - - } - - /** - * Grab canvas, encode the information as SVG and save to a file - * @param imageWidth image width - * @param imageHeight image height - * @param saveFile save file - */ - - public void saveSVG(int imageWidth, int imageHeight, File saveFile) throws IOException{ - - // Document Object Model to define our SVG Document - DOMImplementation domImpl = - SVGDOMImplementation.getDOMImplementation(); - - // We need to write the SVG into a Document - String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI; - SVGDocument doc = (SVGDocument) domImpl.createDocument(svgNS, "svg", null); - - // Construct an SVGGraphics2D from our Document - SVGGraphics2D g = new SVGGraphics2D(doc); - - g.setSVGCanvasSize(new Dimension(imageWidth, imageHeight)); - - // Paint the scaled Canvas onto our SVG Graphics2D - ACanvas.getCanvas().drawScaledCanvas(g, imageWidth, imageHeight, "svg"); - - // Stream the output into our chosen file - g.stream(saveFile.getAbsolutePath()); - - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/encoders/PngEncoder.java b/graphics/AtlantisJava/src/atlantis/graphics/encoders/PngEncoder.java deleted file mode 100755 index a9c7b5aa61b30677fea0d3996970d8d60bb155df..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/encoders/PngEncoder.java +++ /dev/null @@ -1,582 +0,0 @@ -package atlantis.graphics.encoders; - -// package com.keypoint; - - -import java.awt.*; -import java.awt.image.*; -import java.util.zip.*; -import java.io.*; - -/** - * PngEncoder takes a Java Image object and creates a byte string which can be saved as a PNG file. - * The Image is presumed to use the DirectColorModel. - * - * Thanks to Jay Denny at KeyPoint Software - * http://www.keypoint.com/ - * who let me develop this code on company time. - * - * You may contact me with (probably very-much-needed) improvements, - * comments, and bug fixes at: - * - * david@catcode.com - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * A copy of the GNU LGPL may be found at - * http://www.gnu.org/copyleft/lesser.html, - * - * @author J. David Eisenberg - * @version 1.4, 31 March 2000 - * - * Added ImageObserver so that getHeight, getWidth calls work properly. - * - * @author M.Donszelmann - */ -public class PngEncoder extends Object implements ImageObserver { - - /** Constant specifying that alpha channel should be encoded. */ - public static final boolean ENCODE_ALPHA=true; - - /** Constant specifying that alpha channel should not be encoded. */ - public static final boolean NO_ALPHA=false; - - /** Constants for filters */ - public static final int FILTER_NONE=0; - public static final int FILTER_SUB=1; - public static final int FILTER_UP=2; - public static final int FILTER_LAST=2; - - protected byte[] pngBytes; - protected byte[] priorRow; - protected byte[] leftBytes; - protected Image image; - protected int width, height; - protected int bytePos, maxPos; - protected int hdrPos, dataPos, endPos; - protected CRC32 crc=new CRC32(); - protected long crcValue; - protected boolean encodeAlpha; - protected int filter; - protected int bytesPerPixel; - protected int compressionLevel; - - public PngEncoder() { - this(null, false, FILTER_NONE, 0); - } - - /** - * Class constructor specifying Image to encode, with no alpha channel encoding. - * - * @param image A Java Image object which uses the DirectColorModel - * @see java.awt.Image - */ - public PngEncoder(Image image) { - this(image, false, FILTER_NONE, 0); - } - - /** - * Class constructor specifying Image to encode, and whether to encode alpha. - * - * @param image A Java Image object which uses the DirectColorModel - * @param encodeAlpha Encode the alpha channel? false=no; true=yes - * @see java.awt.Image - */ - public PngEncoder(Image image, boolean encodeAlpha) { - this(image, encodeAlpha, FILTER_NONE, 0); - } - - /** - * Class constructor specifying Image to encode, whether to encode alpha, and filter to use. - * - * @param image A Java Image object which uses the DirectColorModel - * @param encodeAlpha Encode the alpha channel? false=no; true=yes - * @param whichFilter 0=none, 1=sub, 2=up - * @see java.awt.Image - */ - public PngEncoder(Image image, boolean encodeAlpha, int whichFilter) { - this(image, encodeAlpha, whichFilter, 0); - } - - /** - * Class constructor specifying Image source to encode, whether to encode alpha, filter to use, and compression level. - * - * @param image A Java Image object - * @param encodeAlpha Encode the alpha channel? false=no; true=yes - * @param whichFilter 0=none, 1=sub, 2=up - * @param compLevel 0..9 - * @see java.awt.Image - */ - public PngEncoder(Image image, boolean encodeAlpha, int whichFilter, - int compLevel) { - this.image=image; - this.encodeAlpha=encodeAlpha; - setFilter(whichFilter); - if(compLevel>=0&&compLevel<=9) { - this.compressionLevel=compLevel; - } - } - - /** - * Set the image to be encoded - * - * @param image A Java Image object which uses the DirectColorModel - * @see java.awt.Image - */ - public void setImage(Image image) { - this.image=image; - pngBytes=null; - } - - /** method to wait for image */ - private int imageStatus; - - public boolean imageUpdate(Image image, int flags, int x, int y, int width, int height) { - imageStatus=flags; - if(((flags&ALLBITS)==ALLBITS)||((flags&(ABORT|ERROR))!=0)) { - return false; - } - return true; - } - - /** - * Creates an array of bytes that is the PNG equivalent of the current image, specifying whether to encode alpha or not. - * - * @param encodeAlpha boolean false=no alpha, true=encode alpha - * @return an array of bytes, or null if there was a problem - */ - public byte[] pngEncode(boolean encodeAlpha) { - byte[] pngIdBytes= { -119, 80, 78, 71, 13, 10, 26, 10 }; - - if(image==null) { - return null; - } - - imageStatus=0; - boolean status=Toolkit.getDefaultToolkit().prepareImage(image, -1, -1, this); - - if(!status) { - while(((imageStatus&(ALLBITS))==0)&&((imageStatus&(ABORT|ERROR))==0)) { - try { - Thread.sleep(100); - } catch(Exception e) {} - } - // FIXED: moved this inside the "if (!status)" area - if((imageStatus&(ALLBITS))==0) { - return null; - } - } - - width=image.getWidth(null); - height=image.getHeight(null); - - /* - * start with an array that is big enough to hold all the pixels - * (plus filter bytes), and an extra 200 bytes for header info - */ - pngBytes=new byte[((width+1)*height*3)+200]; - - /* - * keep track of largest byte written to the array - */ - maxPos=0; - - bytePos=writeBytes(pngIdBytes, 0); - hdrPos=bytePos; - writeHeader(); - dataPos=bytePos; - if(writeImageData()) { - writeEnd(); - pngBytes=resizeByteArray(pngBytes, maxPos); - } else { - pngBytes=null; - } - return pngBytes; - } - - /** - * Creates an array of bytes that is the PNG equivalent of the current image. - * Alpha encoding is determined by its setting in the constructor. - * - * @return an array of bytes, or null if there was a problem - */ - public byte[] pngEncode() { - return pngEncode(encodeAlpha); - } - - /** - * Set the alpha encoding on or off. - * - * @param encodeAlpha false=no, true=yes - */ - public void setEncodeAlpha(boolean encodeAlpha) { - this.encodeAlpha=encodeAlpha; - } - - /** - * Retrieve alpha encoding status. - * - * @return boolean false=no, true=yes - */ - public boolean getEncodeAlpha() { - return encodeAlpha; - } - - /** - * Set the filter to use - * - * @param whichFilter from constant list - */ - public void setFilter(int whichFilter) { - this.filter=FILTER_NONE; - if(whichFilter<=FILTER_LAST) { - this.filter=whichFilter; - } - } - - /** - * Retrieve filtering scheme - * - * @return int (see constant list) - */ - public int getFilter() { - return filter; - } - - /** - * Set the compression level to use - * - * @param level 0 through 9 - */ - public void setCompressionLevel(int level) { - if(level>=0&&level<=9) { - this.compressionLevel=level; - } - } - - /** - * Retrieve compression level - * - * @return int in range 0-9 - */ - public int getCompressionLevel() { - return compressionLevel; - } - - /** - * Increase or decrease the length of a byte array. - * - * @param array The original array. - * @param newLength The length you wish the new array to have. - * @return Array of newly desired length. If shorter than the - * original, the trailing elements are truncated. - */ - protected byte[] resizeByteArray(byte[] array, int newLength) { - byte[] newArray=new byte[newLength]; - int oldLength=array.length; - - System.arraycopy(array, 0, newArray, 0, Math.min(oldLength, newLength)); - return newArray; - } - - /** - * Write an array of bytes into the pngBytes array. - * Note: This routine has the side effect of updating - * maxPos, the largest element written in the array. - * The array is resized by 1000 bytes or the length - * of the data to be written, whichever is larger. - * - * @param data The data to be written into pngBytes. - * @param offset The starting point to write to. - * @return The next place to be written to in the pngBytes array. - */ - protected int writeBytes(byte[] data, int offset) { - maxPos=Math.max(maxPos, offset+data.length); - if(data.length+offset>pngBytes.length) { - pngBytes=resizeByteArray(pngBytes, pngBytes.length+Math.max(1000, data.length)); - } - System.arraycopy(data, 0, pngBytes, offset, data.length); - return offset+data.length; - } - - /** - * Write an array of bytes into the pngBytes array, specifying number of bytes to write. - * Note: This routine has the side effect of updating - * maxPos, the largest element written in the array. - * The array is resized by 1000 bytes or the length - * of the data to be written, whichever is larger. - * - * @param data The data to be written into pngBytes. - * @param nBytes The number of bytes to be written. - * @param offset The starting point to write to. - * @return The next place to be written to in the pngBytes array. - */ - protected int writeBytes(byte[] data, int nBytes, int offset) { - maxPos=Math.max(maxPos, offset+nBytes); - if(nBytes+offset>pngBytes.length) { - pngBytes=resizeByteArray(pngBytes, pngBytes.length+Math.max(1000, nBytes)); - } - System.arraycopy(data, 0, pngBytes, offset, nBytes); - return offset+nBytes; - } - - /** - * Write a two-byte integer into the pngBytes array at a given position. - * - * @param n The integer to be written into pngBytes. - * @param offset The starting point to write to. - * @return The next place to be written to in the pngBytes array. - */ - protected int writeInt2(int n, int offset) { - byte[] temp= { (byte)((n>>8)&0xff), (byte)(n&0xff) }; - return writeBytes(temp, offset); - } - - /** - * Write a four-byte integer into the pngBytes array at a given position. - * - * @param n The integer to be written into pngBytes. - * @param offset The starting point to write to. - * @return The next place to be written to in the pngBytes array. - */ - protected int writeInt4(int n, int offset) { - byte[] temp= { (byte)((n>>24)&0xff), (byte)((n>>16)&0xff), (byte)((n>>8)&0xff), (byte)(n&0xff) }; - return writeBytes(temp, offset); - } - - /** - * Write a single byte into the pngBytes array at a given position. - * - * @param b The integer to be written into pngBytes. - * @param offset The starting point to write to. - * @return The next place to be written to in the pngBytes array. - */ - protected int writeByte(int b, int offset) { - byte[] temp= { (byte)b }; - return writeBytes(temp, offset); - } - - /** - * Write a string into the pngBytes array at a given position. - * This uses the getBytes method, so the encoding used will - * be its default. - * - * @param s The string to be written into pngBytes. - * @param offset The starting point to write to. - * @return The next place to be written to in the pngBytes array. - * @see java.lang.String#getBytes() - */ - protected int writeString(String s, int offset) { - return writeBytes(s.getBytes(), offset); - } - - /** - * Write a PNG "IHDR" chunk into the pngBytes array. - */ - protected void writeHeader() { - int startPos; - - startPos=bytePos=writeInt4(13, bytePos); - bytePos=writeString("IHDR", bytePos); - width=image.getWidth(null); - height=image.getHeight(null); - bytePos=writeInt4(width, bytePos); - bytePos=writeInt4(height, bytePos); - bytePos=writeByte(8, bytePos); // bit depth - bytePos=writeByte((encodeAlpha)?6:2, bytePos); // direct model - bytePos=writeByte(0, bytePos); // compression method - bytePos=writeByte(0, bytePos); // filter method - bytePos=writeByte(0, bytePos); // no interlace - crc.reset(); - crc.update(pngBytes, startPos, bytePos-startPos); - crcValue=crc.getValue(); - bytePos=writeInt4((int)crcValue, bytePos); - } - - /** - * Perform "sub" filtering on the given row. - * Uses temporary array leftBytes to store the original values - * of the previous pixels. The array is 16 bytes long, which - * will easily hold two-byte samples plus two-byte alpha. - * - * @param pixels The array holding the scan lines being built - * @param startPos Starting position within pixels of bytes to be filtered. - * @param width Width of a scanline in pixels. - */ - protected void filterSub(byte[] pixels, int startPos, int width) { - int i; - int offset=bytesPerPixel; - int actualStart=startPos+offset; - int nBytes=width*bytesPerPixel; - int leftInsert=offset; - int leftExtract=0; - - for(i=actualStart; i<startPos+nBytes; i++) { - leftBytes[leftInsert]=pixels[i]; - pixels[i]=(byte)((pixels[i]-leftBytes[leftExtract])%256); - leftInsert=(leftInsert+1)%0x0f; - leftExtract=(leftExtract+1)%0x0f; - } - } - - /** - * Perform "up" filtering on the given row. - * Side effect: refills the prior row with current row - * - * @param pixels The array holding the scan lines being built - * @param startPos Starting position within pixels of bytes to be filtered. - * @param width Width of a scanline in pixels. - */ - protected void filterUp(byte[] pixels, int startPos, int width) { - int i, nBytes; - byte current_byte; - - nBytes=width*bytesPerPixel; - - for(i=0; i<nBytes; i++) { - current_byte=pixels[startPos+i]; - pixels[startPos+i]=(byte)((pixels[startPos+i]-priorRow[i])%256); - priorRow[i]=current_byte; - } - } - - /** - * Write the image data into the pngBytes array. - * This will write one or more PNG "IDAT" chunks. In order - * to conserve memory, this method grabs as many rows as will - * fit into 32K bytes, or the whole image; whichever is less. - * - * - * @return true if no errors; false if error grabbing pixels - */ - protected boolean writeImageData() { - int rowsLeft=height; // number of rows remaining to write - int startRow=0; // starting row to process this time through - int nRows; // how many rows to grab at a time - - byte[] scanLines; // the scan lines to be compressed - int scanPos; // where we are in the scan lines - int startPos; // where this line's actual pixels start (used for filtering) - - byte[] compressedLines; // the resultant compressed lines - int nCompressed; // how big is the compressed area? - - PixelGrabber pg; - - bytesPerPixel=(encodeAlpha)?4:3; - - Deflater scrunch=new Deflater(compressionLevel); - ByteArrayOutputStream outBytes=new ByteArrayOutputStream(1024); - - DeflaterOutputStream compBytes=new DeflaterOutputStream(outBytes, scrunch); - try { - while(rowsLeft>0) { - nRows=Math.min(32767/(width*(bytesPerPixel+1)), rowsLeft); - // nRows = rowsLeft; - int[] pixels=new int[width*nRows]; - - pg=new PixelGrabber(image, 0, startRow, width, nRows, pixels, 0, width); - try { - pg.grabPixels(); - } catch(Exception e) { - System.err.println("interrupted waiting for pixels!"); - return false; - } - if((pg.getStatus()&ImageObserver.ABORT)!=0) { - System.err.println("image fetch aborted or errored"); - return false; - } - - /* - * Create a data chunk. scanLines adds "nRows" for - * the filter bytes. - */ - scanLines=new byte[width*nRows*bytesPerPixel+nRows]; - - if(filter==FILTER_SUB) { - leftBytes=new byte[16]; - } - if(filter==FILTER_UP) { - priorRow=new byte[width*bytesPerPixel]; - } - - scanPos=0; - startPos=1; - for(int i=0; i<width*nRows; i++) { - if(i%width==0) { - scanLines[scanPos++]=(byte)filter; - startPos=scanPos; - } - scanLines[scanPos++]=(byte)((pixels[i]>>16)&0xff); - scanLines[scanPos++]=(byte)((pixels[i]>>8)&0xff); - scanLines[scanPos++]=(byte)((pixels[i])&0xff); - if(encodeAlpha) { - scanLines[scanPos++]=(byte)((pixels[i]>>24)&0xff); - } - if((i%width==width-1)&&(filter!=FILTER_NONE)) { - if(filter==FILTER_SUB) { - filterSub(scanLines, startPos, width); - } - if(filter==FILTER_UP) { - filterUp(scanLines, startPos, width); - } - } - } - - /* - * Write these lines to the output area - */ - compBytes.write(scanLines, 0, scanPos); - - startRow+=nRows; - rowsLeft-=nRows; - } - compBytes.close(); - - /* - * Write the compressed bytes - */ - compressedLines=outBytes.toByteArray(); - nCompressed=compressedLines.length; - - crc.reset(); - bytePos=writeInt4(nCompressed, bytePos); - bytePos=writeString("IDAT", bytePos); - crc.update("IDAT".getBytes()); - bytePos=writeBytes(compressedLines, nCompressed, bytePos); - crc.update(compressedLines, 0, nCompressed); - - crcValue=crc.getValue(); - bytePos=writeInt4((int)crcValue, bytePos); - scrunch.finish(); - return true; - } catch(IOException e) { - System.err.println(e.toString()); - return false; - } - } - - /** - * Write a PNG "IEND" chunk into the pngBytes array. - */ - protected void writeEnd() { - bytePos=writeInt4(0, bytePos); - bytePos=writeString("IEND", bytePos); - crc.reset(); - crc.update("IEND".getBytes()); - crcValue=crc.getValue(); - bytePos=writeInt4((int)crcValue, bytePos); - } -} - diff --git a/graphics/AtlantisJava/src/atlantis/graphics/layout/AFlowLayout.java b/graphics/AtlantisJava/src/atlantis/graphics/layout/AFlowLayout.java deleted file mode 100755 index 1d391e05e845e478a4585df9d7c4504da0c8952c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/layout/AFlowLayout.java +++ /dev/null @@ -1,115 +0,0 @@ -package atlantis.graphics.layout; - -import java.awt.Container; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.Component; -import java.awt.Dimension; - -/** - * This Layout manager aranges the components in a flow like awt.FlowLayout. - * The difference is that this layout resizes the container to the minimum - * size after every layout operation, and therefore ensures that all components - * it laysout are visible. Nothing to do with the layout of the Atlantis canvas. - */ - -public class AFlowLayout implements LayoutManager { - private int hgap; - private int vgap; - - public AFlowLayout(int hgap, int vgap) { - this.hgap=hgap; - this.vgap=vgap; - } - - public void addLayoutComponent(String name, Component comp) {} - - public void removeLayoutComponent(Component comp) {} - - public Dimension minimumLayoutSize(Container target) { - return preferredLayoutSize(target); - } - - public Dimension preferredLayoutSize(Container target) { - Insets insets=target.getInsets(); - Dimension D=target.getSize(); - int W=D.width-insets.left-insets.right; - int L=hgap; - int y=vgap; - int w, h, hmax=0; - - for(int i=0; i<target.getComponentCount(); i++) { - Dimension d=target.getComponent(i).getPreferredSize(); - - w=d.width; - h=d.height; - - if(L+w+hgap<W) { - L+=w+hgap; - if(h>hmax) hmax=h; - } else { - L=hgap+w+hgap; - y+=hmax+vgap; - hmax=0; - if(h>hmax) hmax=h; - } - } - if(target.getComponentCount()>0) - y+=hmax+vgap; - - return new Dimension(W, y); - } - - public void layoutContainer(Container target) { - Insets insets=target.getInsets(); - Dimension D=target.getSize(); - int W=D.width-insets.left-insets.right; - int L=hgap; - int y=vgap; - int from=0; - int to=0; - int w, h, hmax=0; - - for(int i=0; i<target.getComponentCount(); i++) { - Dimension d=target.getComponent(i).getPreferredSize(); - - w=d.width; - h=d.height; - - if(L+w+hgap<W) { - L+=w+hgap; - to=i; - if(h>hmax) hmax=h; - } else { - layout(target, hgap+insets.left+(W/2-L/2), y, from, to); - L=hgap+w+hgap; - from=i; - to=i; - y+=hmax+vgap; - hmax=0; - if(h>hmax) hmax=h; - } - } - - if(target.getComponentCount()>0) - layout(target, hgap+insets.left+(W/2-L/2), y, from, to); - - /* - if (y + hmax + vgap != D.height) - SwingUtilities.invokeLater(new ARunAnotherLayout(target)); - */ - } - - public void layout(Container target, int x, int y, int from, int to) { - int xi=x; - - for(int i=from; i<=to; i++) { - Component comp=target.getComponent(i); - Dimension d=comp.getPreferredSize(); - - comp.setBounds(xi, y, d.width, d.height); - xi+=d.width+hgap; - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/layout/AGridLayout.java b/graphics/AtlantisJava/src/atlantis/graphics/layout/AGridLayout.java deleted file mode 100755 index 034287a49e1f92d4d91090a08d58d1df79b3b7bb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/layout/AGridLayout.java +++ /dev/null @@ -1,214 +0,0 @@ -package atlantis.graphics.layout; - -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.LayoutManager2; -import java.awt.Rectangle; - -import javax.swing.JComponent; -import javax.swing.SwingUtilities; - -import atlantis.canvas.ACanvas; - -/** - * This layout manager is a simplification of the - * <code>ConstrainedGridLayout</code> layout manager written by Charles A. - * Loomis. This layout manager hase two modes of operation: 1) CONSTRAINED - - * cell size is calculated by dividing the container size acording to aspect - * ratio. 2) PREFERRED - cell size is given at creation time - * - * @author Dumitru Petrusca. - */ -public class AGridLayout implements LayoutManager2 -{ - private Dimension gridSize; - private int cellSize; - private Dimension initialSize; - - public final static int CONSTRAINED = 0; - public final static int PREFERRED = 1; - private int layoutType; - private boolean secondLayout; - - final public static String GRID_SIZE_ERROR = "Grid size must have width and height > 0."; - - final public static String ASPECT_RATIO_ERROR = "Aspect ratio must have width and height > 0."; - - final public static String CONSTRAINT_ERROR = "Constraint must be a Rectangle with positive width and height."; - - final public static String AGRID_LAYOUT_CONSTRAINT = "ConstrainedGridLayout.RectangularConstraint"; - - /** - * Creates a new GridLayout of type CONSTRAINNED. - */ - public AGridLayout(Dimension gridSize, Dimension initialSize) - { - layoutType = CONSTRAINED; - setGridSize(gridSize); - secondLayout = true; - this.initialSize = initialSize; - } - - /** - * Creates a new GridLayout of type PREFERRED - */ - public AGridLayout(Dimension gridSize, int cellSize) - { - layoutType = PREFERRED; - setGridSize(gridSize); - this.cellSize = cellSize; - secondLayout = false; - initialSize = null; - } - - private void setGridSize(Dimension gridSize) - { - // Check that all of the dimensions given are reasonable. - if (gridSize.width <= 0 || gridSize.height <= 0 || gridSize.width > 100 || gridSize.height > 100) - throw new IllegalArgumentException(GRID_SIZE_ERROR); - - // Copy the information into the layout manager. - this.gridSize = new Dimension(0, 0); - this.gridSize.setSize(gridSize); - } - - public Dimension getGridSize() - { - return new Dimension(gridSize); - } - - /** - * Set (or reset) the constraints for the given component. - */ - public void setConstraints(Component comp, Rectangle constraints) - { - if (comp instanceof JComponent) - { - Rectangle copy = new Rectangle(constraints); - JComponent jc = (JComponent) comp; - - jc.putClientProperty(AGRID_LAYOUT_CONSTRAINT, copy); - } - } - - /** - * Get the constraints being used for the given component. - */ - public Rectangle getConstraints(Component comp) - { - Rectangle r = null; - - if (comp instanceof JComponent) - { - JComponent jc = (JComponent) comp; - Object constraint = jc.getClientProperty(AGRID_LAYOUT_CONSTRAINT); - - if (constraint instanceof Rectangle) - r = (Rectangle) constraint; - } - - return (r != null) ? new Rectangle(r) : null; - } - - // implementation of LayoutMamager interface - - public void addLayoutComponent(String name, Component comp) - {} - - public void removeLayoutComponent(Component comp) - {} - - public Dimension preferredLayoutSize(Container parent) - { - if (layoutType == CONSTRAINED) - { - Dimension d = parent.getSize(); - if (initialSize != null) - { - d = new Dimension(initialSize); - initialSize = null; - } - - int hCellSize = d.width / gridSize.width; - int vCellSize = d.height / gridSize.height; - if(ACanvas.getCanvas().getCurrentLayout().getName().equals("FULL SCREEN")) - { - return new Dimension(gridSize.width * hCellSize, gridSize.height * vCellSize); - } - cellSize = Math.min(hCellSize, vCellSize); - } - - return new Dimension(gridSize.width * cellSize, gridSize.height * cellSize); - } - - public Dimension minimumLayoutSize(Container parent) - { - return preferredLayoutSize(parent); - } - - public void layoutContainer(Container parent) - { - Dimension d = parent.getSize(); - int hCellSize = d.width / gridSize.width; - int vCellSize = d.height / gridSize.height; - int compCount = parent.getComponentCount(); - - for (int i = 0; i < compCount; i++) - { - Component comp = parent.getComponent(i); - Rectangle r = getConstraints(comp); - - if (r != null) - { - if(ACanvas.getCanvas().getCurrentLayout().getName().equals("FULL SCREEN")) - comp.setBounds(r.x * hCellSize, r.y * vCellSize, r.width * hCellSize, r.height * vCellSize); - else - comp.setBounds(r.x * cellSize, r.y * cellSize, r.width * cellSize, r.height * cellSize); - } - } - - if (secondLayout) - SwingUtilities.invokeLater(new ARunAnotherLayout(parent)); - } - - // implementation of LayoutMamager2 interface - - /** - * Adds the specified component to the layout, using the specified - * constraint object. - */ - public void addLayoutComponent(Component comp, Object constraints) - { - if (constraints instanceof Rectangle) - { - Rectangle r = (Rectangle) constraints; - - if (r.width <= 0 || r.height <= 0) - throw new IllegalArgumentException(CONSTRAINT_ERROR); - - setConstraints(comp, r); - } - else if (constraints != null) - throw new IllegalArgumentException(CONSTRAINT_ERROR); - } - - public Dimension maximumLayoutSize(Container target) - { - return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); - } - - public float getLayoutAlignmentX(Container target) - { - return 0.5f; - } - - public float getLayoutAlignmentY(Container target) - { - return 0.5f; - } - - public void invalidateLayout(Container target) - {} - -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/layout/ARunAnotherLayout.java b/graphics/AtlantisJava/src/atlantis/graphics/layout/ARunAnotherLayout.java deleted file mode 100755 index ce1330374e3fba8fcfce39fb94225e97187f38b3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/layout/ARunAnotherLayout.java +++ /dev/null @@ -1,26 +0,0 @@ -package atlantis.graphics.layout; - - -import java.awt.Container; -import java.awt.Window; -import javax.swing.SwingUtilities; - - -/** - * Used by the Layout Managers to invoke another layout operation. - * Needed to resize the canvas preserving aspect ratio. - */ - -public class ARunAnotherLayout implements Runnable { - private Container parent; - - public ARunAnotherLayout(Container parent) { - this.parent=parent; - } - - public void run() { - Window window=SwingUtilities.getWindowAncestor(parent); - - if(window!=null) window.pack(); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/graphics/package.html b/graphics/AtlantisJava/src/atlantis/graphics/package.html deleted file mode 100644 index 0d498ed42593055703f002fbf16519819c5c1cae..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/graphics/package.html +++ /dev/null @@ -1,6 +0,0 @@ -<html> -<head></head> -<body> -<p>2D graphical classes, graphical primitives.</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/gui/AAboutDialog.java b/graphics/AtlantisJava/src/atlantis/gui/AAboutDialog.java deleted file mode 100755 index 62546b209703960e740782fd91204402c58fb6cb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AAboutDialog.java +++ /dev/null @@ -1,214 +0,0 @@ -package atlantis.gui; - -import java.awt.BorderLayout; -import java.awt.GridLayout; -import java.awt.Font; -import java.awt.Color; -import java.awt.event.ActionListener; -import java.awt.event.ActionEvent; - -import javax.swing.JPanel; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JTextPane; -import javax.swing.BorderFactory; -import javax.swing.JFrame; - -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.utils.AUtilities; - - -/** - * - * About information dialog (Help -> About) - * - * @author Zdenek Maxa, Mark Stockton - */ -public class AAboutDialog extends JFrame -{ - - private static JPanel a_panel1 = null; - private static JPanel a_panel2 = null; - private static JPanel a_panel3 = null; - private static JPanel a_panel4 = null; - private static JPanel a_textPanel = null; - private static JLabel a_label1 = null; - private static JTextPane a_label2 = null; - private static JLabel a_label3 = null; - private static JTextPane a_label4 = null; - - private static JPanel m_panel1 = null; - private static JPanel m_panel2 = null; - private static JPanel m_panel3 = null; - private static JPanel m_panel4 = null; - private static JPanel m_textPanel = null; - private static JLabel m_label1 = null; - private static JTextPane m_label2 = null; - private static JTextPane m_label3 = null; - private static JTextPane m_label4 = null; - - private static JPanel c_panel1 = null; - - private static JPanel mainPanel = null; - - - private static JButton closeButton = null; - - private static AAboutDialog instance = null; - - private static final AGlobals globals = AGlobals.instance(); - - - private AAboutDialog(String title) - { - super(title); - try - { - createGUI(); - pack(); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - AIcon.setIconImage(this); - - } // AAboutDialog() ----------------------------------------------------- - - - - private void createGUI() - { - // top panel - atlantis - a_panel1 = new JPanel(); - a_panel1.setLayout(new GridLayout(1,2)); - - // top left text panel (4 lines of text) - a_panel2 = new JPanel(); - a_label2 = new JTextPane(); - Font font = new Font(a_panel2.getFont().getName(), - Font.BOLD, - a_panel2.getFont().getSize() + 6); - a_label2.setFont(font); - a_label2.setEditable(false); - a_label2.setBackground(a_panel2.getBackground()); - a_label2.setText(AGlobals.instance().getVersion()); - a_panel2.add(a_label2); - - a_panel3 = new JPanel(); - a_label3 = new JLabel("Event display for ATLAS"); - a_panel3.add(a_label3); - - a_panel4 = new JPanel(); - a_label4 = new JTextPane(); - a_label4.setBackground(a_panel4.getBackground()); - a_label4.setForeground(Color.blue); - a_label4.setText("http://www.cern.ch/atlantis" + "\n" + - "hn-atlas-AtlantisDisplay@cern.ch"); - a_label4.setEditable(false); - a_panel4.add(a_label4); - - a_textPanel = new JPanel(); - a_textPanel.setLayout(new GridLayout(3,1)); - a_textPanel.add(a_panel2); - a_textPanel.add(a_panel3); - a_textPanel.add(a_panel4); - - a_panel1.add(a_textPanel); - - String FILE_SEPAR = System.getProperty("file.separator"); - String homeDirectory = AGlobals.instance().getHomeDirectory(); - - // top right atlantis image - String path = homeDirectory + "img" + FILE_SEPAR + - "atlantis_log.gif"; - a_label1 = new JLabel(AUtilities.getFileAsImageIcon(path)); - a_panel1.add(a_label1); - - // middle panel - minerva - m_panel1 = new JPanel(); - m_panel1.setLayout(new GridLayout(1,2)); - - // middle left minerva image - path = homeDirectory + "img" + FILE_SEPAR + - "minerva_log.gif"; - m_label1 = new JLabel(AUtilities.getFileAsImageIcon(path)); - m_panel1.add(m_label1); - - // middle right text panel - m_panel2 = new JPanel(); - m_label2 = new JTextPane(); - m_label2.setFont(font); - m_label2.setEditable(false); - m_label2.setBackground(m_panel2.getBackground()); - m_label2.setText("MINERVA"); - m_panel2.add(m_label2); - - m_panel3 = new JPanel(); - m_label3 = new JTextPane(); - m_label3.setBackground(m_panel3.getBackground()); - m_label3.setEditable(false); - m_label3.setText(" Masterclass INvolving Event \n Recognition Visualised with Atlantis"); - m_panel3.add(m_label3); - - m_panel4 = new JPanel(); - m_label4 = new JTextPane(); - m_label4.setBackground(m_panel4.getBackground()); - m_label4.setForeground(Color.blue); - m_label4.setText("http://www.cern.ch/atlas-minerva"); - m_label4.setEditable(false); - m_panel4.add(m_label4); - - m_textPanel = new JPanel(); - m_textPanel.setLayout(new GridLayout(3,1)); - m_textPanel.add(m_panel2); - m_textPanel.add(m_panel3); - m_textPanel.add(m_panel4); - - m_panel1.add(m_textPanel); - - // bottom panel - close button - c_panel1 = new JPanel(new BorderLayout()); - closeButton = new JButton("Close"); - closeButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AAboutDialog.getInstance().dispose(); - } - }); - c_panel1.add(closeButton, BorderLayout.EAST); - c_panel1.setBorder(BorderFactory.createEmptyBorder(15, 0, 15, 15)); - - - // main panel - mainPanel = new JPanel(); - mainPanel.setLayout(new BorderLayout()); - mainPanel.add(a_panel1, BorderLayout.NORTH); - mainPanel.add(m_panel1, BorderLayout.CENTER); - mainPanel.add(c_panel1, BorderLayout.SOUTH); - - this.getContentPane().add(mainPanel, BorderLayout.CENTER); - - this.setResizable(false); - - this.setLocation(globals.getGuiFrame().getLocation()); - - } // createGUI() -------------------------------------------------------- - - - public static AAboutDialog getInstance() - { - if(instance == null) - { - instance = new AAboutDialog("About Atlantis"); - } - return instance; - - } // getInstance() ------------------------------------------------------ - - - -} // class AAboutDialog ===================================================== diff --git a/graphics/AtlantisJava/src/atlantis/gui/ACheckBox.java b/graphics/AtlantisJava/src/atlantis/gui/ACheckBox.java deleted file mode 100755 index f4af0033a9fa61693959ee66f03977555151e6ad..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ACheckBox.java +++ /dev/null @@ -1,33 +0,0 @@ -package atlantis.gui; - -import java.awt.event.ActionListener; -import javax.swing.JCheckBox; - -/** - * This class does not generate an ActionEvent - * when the setSelected() method is called. - */ -public class ACheckBox extends JCheckBox { - ActionListener listener; - - public ACheckBox(String text) { - super(text); - } - - public ACheckBox() { - super(); - } - - public void addActionListener(ActionListener l) { - if(listener==null) { - super.addActionListener(listener); - listener=l; - } - } - - public void setSelected(boolean b) { - if(listener!=null) super.removeActionListener(listener); - super.setSelected(b); - if(listener!=null) super.addActionListener(listener); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ACheckNode.java b/graphics/AtlantisJava/src/atlantis/gui/ACheckNode.java deleted file mode 100755 index e2bac2cf8a3ce042ded701f7f3ed6d86719a1ce4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ACheckNode.java +++ /dev/null @@ -1,86 +0,0 @@ -package atlantis.gui; - -import java.util.Iterator; -import atlantis.parameters.AParameter; -import atlantis.parameters.AStatusParameter; -import atlantis.parameters.ACommandProcessor; -import hep.wired.util.DefaultTristateTreeNode; -import hep.wired.util.TristateCheckBox; - -/** - * - * @author Qiang - */ - -public class ACheckNode extends DefaultTristateTreeNode { - - public static final byte SINGLE_SELECTION = 0; - - public static final byte MULTI_SELECTION = 1; - - private byte selectionMode; - - private AParameter parameter; - - public ACheckNode(Object userObject, boolean selectionValue, byte selectionMode, AParameter parameter) { - super(userObject, selectionValue, true); - setSelectionMode(selectionMode); - this.parameter = parameter; - } - - public void setSelectionMode(byte selectionMode) { - this.selectionMode = selectionMode; - } - - public byte getSelectionMode() { - return this.selectionMode; - } - - public AParameter getParameter(){ - return this.parameter; - } - - public void updateState(){ - if(children!=null){ - int checkedNumber = 0; - for(Iterator it=children.iterator(); it.hasNext();){ - ACheckNode aChildNode = (ACheckNode)it.next(); - aChildNode.updateState(); - if(aChildNode.isSelected()) - checkedNumber++; - } - if(checkedNumber==0) - this.setSelected(false); - else - this.setSelected(true); - } else{ - ACheckBox cellComponent = (ACheckBox)getUserObject(); - cellComponent.setSelected(getParameter().getStatus()); - setSelected(cellComponent.isSelected()); - } - } - - public void getClicked(boolean selectionFlag, boolean statusChange) { - setSelected(selectionFlag); - if((parameter instanceof AStatusParameter) && statusChange){ - // a leaf node is found here - AStatusParameter theStatusParameter = (AStatusParameter)parameter; - ACommandProcessor.receive(theStatusParameter.getName()); - theStatusParameter.apply(); - } else{ - // parameter is either AStatusRootParameter or AStatusGroupParameter - if((selectionMode==MULTI_SELECTION) && (children!=null)){ - ((TristateCheckBox)this.getUserObject()).setSelected(selectionFlag); - for(Iterator it=children.iterator(); it.hasNext();){ - ACheckNode aChildNode = (ACheckNode)it.next(); - // either AStatusGrooupParameter node or AStatusParameter node - aChildNode.getClicked(selectionFlag, !(aChildNode.isSelected()==selectionFlag)); - } - } - } - if(parent!=null){ - ((ACheckNode)parent).updateState(); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AClosingConfirmationDialog.java b/graphics/AtlantisJava/src/atlantis/gui/AClosingConfirmationDialog.java deleted file mode 100755 index 3872b0960e51e0d6d736e10498e3fa759917d4a5..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AClosingConfirmationDialog.java +++ /dev/null @@ -1,63 +0,0 @@ -package atlantis.gui; - -import java.awt.Frame; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import javax.swing.JOptionPane; - -import atlantis.config.ADefaultValues; -import atlantis.utils.ALogger; - -/** - * - * Atlantis application closing confirmation dialog. - * All Atlantis closing actions can be added here and this - * class shall be used for closing the application. - * - */ -public class AClosingConfirmationDialog extends WindowAdapter -{ - private static ALogger logger = ALogger.getLogger(AClosingConfirmationDialog.class); - - private Frame adaptee; - - - public AClosingConfirmationDialog(Frame adaptee) - { - this.adaptee = adaptee; - - } // AClosingConfirmationDialog() --------------------------------------- - - - - public void windowClosing(WindowEvent e) - { - exitApp(); - - } // windowClosing() ---------------------------------------------------- - - - - public void exitApp() - { - - String msg = "Do you really want to quit Atlantis?"; - int i = JOptionPane.showConfirmDialog(adaptee, msg, "Exit Atlantis", - JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null); - if(i == JOptionPane.YES_OPTION) - { - logger.debug("Shutting down, going to save runtime values..."); - ADefaultValues.saveRuntimeValues(); - logger.warn("Shutting down, calling System.exit(0)"); - System.exit(0); - } - else - { - return; - } - - } // exitApp() ---------------------------------------------------------- - - - -} // class AClosingConfirmationDialog ======================================= diff --git a/graphics/AtlantisJava/src/atlantis/gui/AColorComboBoxRenderer.java b/graphics/AtlantisJava/src/atlantis/gui/AColorComboBoxRenderer.java deleted file mode 100755 index d0eed9427aafb559b3e7a7ea8c0ab14148d5c7f7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AColorComboBoxRenderer.java +++ /dev/null @@ -1,126 +0,0 @@ -package atlantis.gui; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Graphics; -import javax.swing.Icon; -import javax.swing.JLabel; -import javax.swing.ToolTipManager; -import javax.swing.BorderFactory; -import javax.swing.JList; -import javax.swing.ListCellRenderer; -import javax.swing.border.Border; - -import atlantis.graphics.colormap.AColorMap; - -/** - * The class used as a renderer when displaying the colors in the UI. - */ -public class AColorComboBoxRenderer extends JLabel - implements ListCellRenderer { - - private ColorIcon icon=new ColorIcon(); - private Border selectedBorder; - private Border deselectedBorder=BorderFactory.createEmptyBorder(2, 2, 2, 2); - - public Component getListCellRendererComponent( - JList list, Object value, int index, - boolean isSelected, boolean cellHasFocus) { - - int colorIndex=((Integer)value).intValue(); - Color[] colorMap=AColorMap.getColors(); - Color color=colorMap[colorIndex]; - - icon.setColor(color); - setIcon(icon); - setText(""+((Integer)value).intValue()); - - if(isSelected) { - selectedBorder=BorderFactory.createLineBorder(list.getSelectionBackground(), 2); - - setBorder(selectedBorder); - - ToolTipManager.sharedInstance().setInitialDelay(1); - ToolTipManager.sharedInstance().setReshowDelay(1); - - String message; - - if(color.equals(Color.black)) - message="Black: "; - else if(color.equals(Color.blue)) - message="Blue: "; - else if(color.equals(Color.cyan)) - message="Cyan: "; - else if(color.equals(Color.darkGray)) - message="DarkGray: "; - else if(color.equals(Color.gray)) - message="Gray: "; - else if(color.equals(Color.green)) - message="Green: "; - else if(color.equals(Color.lightGray)) - message="LightGray: "; - else if(color.equals(Color.magenta)) - message="Magenta: "; - else if(color.equals(Color.orange)) - message="Orange: "; - else if(color.equals(Color.pink)) - message="Pink: "; - else if(color.equals(Color.red)) - message="Red: "; - else if(color.equals(Color.white)) - message="White: "; - else if(color.equals(Color.yellow)) - message="Yellow: "; - else - message=""; - - list.setToolTipText(message+color.getRed()+", "+color.getGreen()+", "+color.getBlue()); - } else setBorder(deselectedBorder); - - return this; - } - - private static class ColorIcon implements Icon { - private int w, h; - private Color color; - - public ColorIcon() { - this(Color.gray, 50, 15); - } - - public ColorIcon(Dimension d) { - this.w=d.width; - this.h=d.height; - } - - public ColorIcon(Color color, int w, int h) { - this.color=color; - this.w=w; - this.h=h; - } - - public void paintIcon(Component c, Graphics g, int x, int y) { - g.setColor(Color.black); - g.drawRect(x, y, w-1, h-1); - g.setColor(color); - g.fillRect(x+1, y+1, w-2, h-2); - } - - public Color getColor() { - return color; - } - - public void setColor(Color color) { - this.color=color; - } - - public int getIconWidth() { - return w; - } - - public int getIconHeight() { - return h; - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AColorHelpDialog.java b/graphics/AtlantisJava/src/atlantis/gui/AColorHelpDialog.java deleted file mode 100755 index 695a2814bd378d10d51506b293e3262167f41280..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AColorHelpDialog.java +++ /dev/null @@ -1,260 +0,0 @@ -package atlantis.gui; - -import java.awt.Color; -import java.awt.GridLayout; -import java.awt.Toolkit; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; - -import javax.swing.JFrame; -import javax.swing.JTextField; - -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.APar; - -/** - * The help dialog displays the current color of objects - * - * @author Mark Stockton - */ -public class AColorHelpDialog extends JFrame implements WindowListener -{ - private static JTextField[] textField; - public static Color[] colorMap = AColorMap.getColors(); - private static AColorHelpDialog instance = null; - - private static APar parameterStore = APar.instance(); - private static AEventManager eventManager = AEventManager.instance(); - - public static AColorHelpDialog getInstance() - { - if (AGlobals.isAtlantisHeadless()) { - return null; - } - if (instance == null) - instance = new AColorHelpDialog(); - return instance; - } - - public void update() - { - if(!this.isVisible()) - return; - getContentPane().removeAll(); - validate(); - - String[] dataObjectsToDisplay={"RVx", "TRT", "SiCluster", "SiClusterRDO", "S3D", "PixelCluster", "PixelRDO", "TrigS3D", - "MDT", "CSC", "RPC", "TGC", - "EmTauROI", "JetROI", "MuonROI", "LVL1TriggerTower", "LVL1JetElement", - "STr", "SNP", "SMTr", "SVx"}; - String[] dataObjectsWithCollectionsToDisplay={"InDetTrack", "InDetSegment", "Cluster", "MuonTrack", - "MuonSegment", "Jet", "ETMis", "BJet","Electron","Muon","Photon","TauJet","CompositeParticle"}; - String[] geometryObjectsToDisplay={"PIXFill", "SILFill", "TRTFill", "SolFill", "ECALFill", - "HCALFill", "RPCFill", "TGCFill", "MDTFill", "CSCFill", "BkgFill"}; - - int numObjects = Math.max(dataObjectsWithCollectionsToDisplay.length,dataObjectsToDisplay.length); - int numOfColumns = 4; - getContentPane().setLayout(new GridLayout(numObjects+1,numOfColumns)); - textField = new JTextField[(numObjects+1)*4]; - AEvent event = eventManager.getCurrentEvent(); - - //table column titles - fillTextField(0, Color.white, Color.black, " Geometry color"); - fillTextField(1, Color.white, Color.black, " Color of objects without collections"); - fillTextField(2, Color.white, Color.black, " Color of objects with collections"); - fillTextField(3, Color.white, Color.black, " Object Collection"); - - //loop over objects - for(int j=0; j<numObjects; j++) - { - int i=4*j + 4; - //display geometry color - if(j<geometryObjectsToDisplay.length) - { - String source = "Det"; - if(geometryObjectsToDisplay[j].equals("BkgFill")) - source = "Color"; - Color backgroundColor=colorMap[parameterStore.get(source, geometryObjectsToDisplay[j]).getI()]; - //display screen name - String text=parameterStore.get(source, geometryObjectsToDisplay[j]).getScreenName(); - fillTextField(i, backgroundColor, text); - }else{ - fillTextField(i);//nothing to display - } - - i++; - //display object without collection color - if(j<dataObjectsToDisplay.length){ - fillTextField(i,dataObjectsToDisplay[j]); - }else{ - fillTextField(i);//nothing to display - } - - i++; - //display object with collection color - if(j<dataObjectsWithCollectionsToDisplay.length){ - fillTextField(i,dataObjectsWithCollectionsToDisplay[j]); - }else{ - fillTextField(i);//nothing to display - } - - //display object collection - i++; - if(j<dataObjectsWithCollectionsToDisplay.length){ - //get collections - String[] collections=event.getActiveCollectionNames(dataObjectsWithCollectionsToDisplay[j]); - String text; - //check is on/has collectons/not all selected - if(!parameterStore.get("Data", dataObjectsWithCollectionsToDisplay[j]).getStatus() || - collections==null || collections.length==0) - text = "n/a"; - else if(collections.length>1) - text = ">1 selected"; - else - { - text = collections[0].substring(dataObjectsWithCollectionsToDisplay[j].length()); - } - fillTextField(i, Color.white, Color.black, text); - - }else{ - fillTextField(i);//nothing to display - } - } - - invalidate(); - pack(); - } - - /** - * Fills the text field with chosen colours and text - * foreground colour and text can be null to just fill background - * - * @param index - textfield index - * @param background - background colour - * @param foreground - foreground color - * @param text - text to display - */ - private void fillTextField(int index, Color background, Color foreground, String text) - { - if(textField[index]==null) - textField[index]=new JTextField(); - textField[index].setEditable(false); - textField[index].setBackground(background); - if(foreground!=null) - textField[index].setForeground(foreground); - if(text!=null) - textField[index].setText(text); - getContentPane().add(textField[index]); - } - - /** - * Will fill a blank text field - * - * @param index - textfield index - */ - private void fillTextField(int index) - { - //nothing to display so set color to be the - //same as the outline color of the text boxes - fillTextField(index, (new Color(184,207,229)), null, null); - } - - /** - * Automatically decides the forground text colour - * depending on the background color - * - * @param index - textfield index - * @param background - background colour - * @param text - text to display - */ - private void fillTextField(int index, Color background, String text) - { - //find out if too dark for black text - if( background.getBlue()==background.getRed() - && background.getBlue()==background.getGreen() - && background.getBlue()<=128) - fillTextField(index, background, Color.white, text); - else - fillTextField(index, background, Color.black, text); - } - - /** - * Get information from object for background - * colour and objedct name + status gives the text - * - * @param index - textfield index - * @param object - name of object - */ - private void fillTextField(int index, String object) - { - //if color by constant or has no colour option (e.g. vertex) - if(parameterStore.get(object, "ColorFunction")==null - || parameterStore.get(object, "ColorFunction").getI()==0) - { - Color backgroundColor=colorMap[parameterStore.get(object, "Constant").getI()]; - String text = object; - if(!parameterStore.get("Data", object).getStatus()) - text += " - data type not active"; - fillTextField(index, backgroundColor, text); - } - else - { - String text = object; - if(parameterStore.get("Data", object).getStatus()) - text += " is not being colored constant"; - else - text += " - data type not active"; - fillTextField(index, Color.white, Color.black, text); - } - } - - private AColorHelpDialog() - { - this.setTitle("Current window Geometry and Object colors and Object Collection"); - AIcon.setIconImage(this); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - - this.update(); - this.setResizable(false); - addWindowListener(this); - - // set the initial location - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit().getScreenSize().getWidth()); - int screenHeight = Math.round((float) Toolkit.getDefaultToolkit().getScreenSize().getHeight()); - this.setLocation((int) Math.max(0, 0.1*screenWidth), (int) Math.max(0, 0.1*screenHeight)); - } - - public void dispose() - { - instance = null; - super.dispose(); - } - - public void windowOpened(WindowEvent e) - { - this.update(); - } - - public void windowClosing(WindowEvent e) - {} - - public void windowClosed(WindowEvent e) - {} - - public void windowIconified(WindowEvent e) - {} - - public void windowDeiconified(WindowEvent e) - {} - - public void windowActivated(WindowEvent e) - {} - - public void windowDeactivated(WindowEvent e) - {} - -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/gui/AColorMapDialog.java b/graphics/AtlantisJava/src/atlantis/gui/AColorMapDialog.java deleted file mode 100755 index e0b91297e22988e67daa2aefa09df9c047382d15..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AColorMapDialog.java +++ /dev/null @@ -1,109 +0,0 @@ -package atlantis.gui; - -import java.awt.BorderLayout; -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JPanel; -import javax.swing.JRadioButton; - -import atlantis.canvas.ACanvas; -import atlantis.globals.AGlobals; -import atlantis.graphics.colormap.AColorMap; - -/** - * This dialog is displayed when the user wants to change the current color set. - */ -public class AColorMapDialog extends JDialog implements ActionListener -{ - private JPanel choosePanel; - private JPanel buttonsPanel; - private JButton okButton, cancelButton; - private JRadioButton selected; - - private static final AGlobals globals = AGlobals.instance(); - - public AColorMapDialog() - { - super(globals.getGuiFrame(), "Select Map Dialog", true); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - setResizable(false); - - choosePanel = new JPanel(); - choosePanel.setBorder(BorderFactory.createTitledBorder(" Select Color Map ")); - - ButtonGroup group = new ButtonGroup(); - - choosePanel.setLayout(new GridLayout(5, 1)); - for (int i = 0; i < AColorMap.getMapNames().length - 2; i++) - { // quick fix to not select hitcolor CT - JRadioButton r = new JRadioButton(AColorMap.getMapNames()[i]); - - r.addActionListener(this); - if (AColorMap.getColorMap() == i) - { - selected = r; - r.setSelected(true); - } - else - r.setSelected(false); - group.add(r); - choosePanel.add(r); - } - getContentPane().setLayout(new BorderLayout()); - getContentPane().add(choosePanel, BorderLayout.CENTER); - - okButton = new JButton("OK"); - okButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AColorMap.setColorMap(selected.getText()); - ACanvas.getCanvas().repaintAllFromScratch(); - dispose(); - } - }); - - cancelButton = new JButton("Cancel"); - cancelButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - dispose(); - } - }); - - buttonsPanel = new JPanel(); - buttonsPanel.add(okButton); - buttonsPanel.add(cancelButton); - getContentPane().add(buttonsPanel, BorderLayout.SOUTH); - pack(); - - // set the initial location - Frame owner = globals.getGuiFrame(); - int guiWidth = owner.getWidth(); - int guiHeight = owner.getHeight(); - int guiX = owner.getX(); - int dialogWidth = (int) this.getPreferredSize().getWidth(); - int dialogHeight = (int) this.getPreferredSize().getHeight(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit().getScreenSize().getWidth()); - if(guiX+guiWidth+(dialogWidth-guiWidth)/2>screenWidth) - this.setLocation(Math.max(0, screenWidth - dialogWidth), Math.max(0, (guiHeight - dialogHeight) / 3)); - else - this.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), Math.max(0, (guiHeight - dialogHeight) / 3)); - setVisible(true); - } - - public void actionPerformed(ActionEvent e) - { - selected = (JRadioButton) e.getSource(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AColorMapEditor.java b/graphics/AtlantisJava/src/atlantis/gui/AColorMapEditor.java deleted file mode 100755 index 1c534d12967718f01a955398bfdad4db14433e99..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AColorMapEditor.java +++ /dev/null @@ -1,281 +0,0 @@ -package atlantis.gui; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Font; -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JColorChooser; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; - -import atlantis.canvas.ACanvas; -import atlantis.globals.AGlobals; -import atlantis.graphics.colormap.AColorMap; -import atlantis.graphics.colormap.MappedColor; -import atlantis.graphics.layout.AFlowLayout; -import atlantis.graphics.dnd.ADnDLabel; -import atlantis.graphics.dnd.ADragListener; -import atlantis.utils.AUtilities; - -/** - * The dialog allows the user to edit the colors maps (at runtime). - */ -public class AColorMapEditor extends JDialog implements ADragListener -{ - private static AColorMapEditor instance; - private ADnDLabel[][] labels = new ADnDLabel[AColorMap.getNumMaps()][AColorMap.getNumColors()]; - private int colorMap; - private int index; - private MappedColor previousColor; - private ADnDLabel source; - - private JPanel colorPanel, buttonsPanel; - private JButton okButton, applyButton, cancelButton; - - private static final AGlobals globals = AGlobals.instance(); - - private AColorMapEditor() - { - super(globals.getGuiFrame(), "Color Map Editor", false); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - setResizable(false); - colorPanel = new JPanel(); - colorPanel.setLayout(new GridLayout(AColorMap.getNumColors() + 1, AColorMap.getNumMaps() + 1, 0, 0)); - - // creating the names row - JLabel padding = new JLabel(""); - colorPanel.add(padding); - for (int i = 0; i < AColorMap.getNumMaps(); i++) - { - JLabel label = new JLabel(" " + AColorMap.getMapNames()[i] + " ", JLabel.CENTER); - label.setFont(new Font("Dialog", Font.BOLD, 14)); - colorPanel.add(label); - } - - // creating the color table - Color[] col; - MouseListener labelMouseListener = new LabelMouseListener(); - - for (int j = 0; j < AColorMap.getNumColors(); j++) - { - JLabel label = new JLabel("" + j, JLabel.CENTER); - label.setFont(new Font("Dialog", Font.BOLD, 14)); - colorPanel.add(label); - for (int i = 0; i < AColorMap.getNumMaps(); i++) - { - col = AColorMap.getColors(i); - labels[i][j] = new ADnDLabel("text", false); - labels[i][j].addDragListener(this); - labels[i][j].setOpaque(true); - labels[i][j].setBackground(col[j]); - labels[i][j].setForeground(col[j]); - labels[i][j].setToolTipText(col[j].getRed() + ", " + col[j].getGreen() + ", " + col[j].getBlue()); - setLineBorder(labels[i][j]); - labels[i][j].addMouseListener(labelMouseListener); - colorPanel.add(labels[i][j]); - } - } - - buttonsPanel = new JPanel(); - buttonsPanel.setLayout(new AFlowLayout(10, 10)); - - okButton = new JButton("OK"); - okButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - applyColors(); - dispose(); - instance = null; - } - }); - buttonsPanel.add(okButton); - - applyButton = new JButton("Apply"); - applyButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - applyColors(); - } - }); - buttonsPanel.add(applyButton); - - cancelButton = new JButton("Cancel"); - cancelButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - dispose(); - instance = null; - } - }); - buttonsPanel.add(cancelButton); - - getContentPane().setLayout(new BorderLayout()); - getContentPane().add(colorPanel, BorderLayout.CENTER); - getContentPane().add(buttonsPanel, BorderLayout.SOUTH); - pack(); - - // set the initial location - Frame owner = globals.getGuiFrame(); - int guiWidth = owner.getWidth(); - int guiHeight = owner.getHeight(); - int guiX = owner.getX(); - int dialogWidth = (int) this.getPreferredSize().getWidth(); - int dialogHeight = (int) this.getPreferredSize().getHeight(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit().getScreenSize().getWidth()); - if(guiX+guiWidth+(dialogWidth-guiWidth)/2>screenWidth) - this.setLocation(Math.max(0, screenWidth - dialogWidth), Math.max(0, (guiHeight - dialogHeight) / 3)); - else - this.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), Math.max(0, (guiHeight - dialogHeight) / 3)); - setVisible(true); - } - - public static AColorMapEditor getInstance() - { - if (instance == null) - { - instance = new AColorMapEditor(); - } - return instance; - } - - public void updateColors() - { - if (instance != null) - { - MappedColor[][] maps = AColorMap.getMaps(); - for (int i = 0; i < maps.length; i++) - for (int j = 0; j < maps[i].length; j++) - { - Color c = maps[i][j]; - - labels[i][j].setBackground(c); - labels[i][j].setForeground(c); - labels[i][j].setToolTipText(c.getRed() + ", " + c.getGreen() + ", " + c.getBlue()); - } - repaint(); - } - } - - public void dragPerformed(Object from, Object to, int action) - { - ADnDLabel fromLabel = (ADnDLabel) from; - ADnDLabel toLabel = (ADnDLabel) to; - - toLabel.setBackground(fromLabel.getBackground()); - } - - class LabelMouseListener extends MouseAdapter - { - public void mouseClicked(MouseEvent e) - { - if (SwingUtilities.isLeftMouseButton(e)) - { - source = (ADnDLabel) e.getSource(); - Color color = JColorChooser.showDialog(instance, "Color Map Editor - Chooser", source.getBackground()); - if (color != null) - { - source.setBackground(color); - source.setForeground(color); - setLineBorder(source); - source.setToolTipText(color.getRed() + ", " + color.getGreen() + ", " + color.getBlue()); - } - } - } - - public void mousePressed(MouseEvent e) - { - source = (ADnDLabel) e.getSource(); - getPosition(); - - if (AUtilities.isRightMouseButton(e)) - { - if (index < 8) - for (int j = 8; j < AColorMap.getNumColors(); j++) - labels[colorMap][j].setBackground(labels[colorMap][index].getBackground()); - else - for (int j = 0; j < 8; j++) - labels[colorMap][j].setForeground(labels[colorMap][index].getForeground()); - - } - else if (SwingUtilities.isMiddleMouseButton(e)) - { - MappedColor[][] maps = AColorMap.getMaps(); - previousColor = maps[colorMap][index]; - MappedColor c = maps[colorMap][index]; - - if (c.getGreen() > 128) - maps[colorMap][index] = maps[colorMap][AColorMap.BK]; - else - maps[colorMap][index] = maps[colorMap][AColorMap.WH]; - ACanvas.getCanvas().repaintAllFromScratch(); - } - } - - public void mouseReleased(MouseEvent e) - { - if (AUtilities.isRightMouseButton(e)) - { - if (index < 8) - for (int j = 8; j < AColorMap.getNumColors(); j++) - labels[colorMap][j].setBackground(labels[colorMap][j].getForeground()); - else - for (int j = 0; j < 8; j++) - labels[colorMap][j].setForeground(labels[colorMap][j].getBackground()); - } - else if (SwingUtilities.isMiddleMouseButton(e)) - { - MappedColor[][] maps = AColorMap.getMaps(); - maps[colorMap][index] = previousColor; - ACanvas.getCanvas().repaintAllFromScratch(); - } - } - } - - private void setLineBorder(JComponent comp) - { - comp.setBorder(BorderFactory.createLineBorder(new Color(207, 207, 207), 3)); - } - - private void getPosition() - { - for (int i = 0; i < AColorMap.getNumMaps(); i++) - for (int j = 0; j < AColorMap.getNumColors(); j++) - if (labels[i][j] == source) - { - colorMap = i; - index = j; - break; - } - } - - private void applyColors() - { - MappedColor[][] maps = AColorMap.getMaps(); - for (int i = 0; i < maps.length; i++) - for (int j = 0; j < maps[i].length; j++) - { - Color c = labels[i][j].getBackground(); - - maps[i][j] = new MappedColor(c.getRed(), c.getGreen(), c.getBlue(), j); - } - AGUI.getGUI().repaintTable(); - ACanvas.getCanvas().repaintAllFromScratch(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AComboBox.java b/graphics/AtlantisJava/src/atlantis/gui/AComboBox.java deleted file mode 100755 index d91a35879b6ea5a3c0afac1d54c6bfda7777976c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AComboBox.java +++ /dev/null @@ -1,51 +0,0 @@ -package atlantis.gui; - - -import java.awt.event.ItemListener; -import javax.swing.JComboBox; - - -/** - * This class does not generate an ItemEvent - * when the setSelectedItem() method is called. - */ - -public class AComboBox extends JComboBox { - private ItemListener listener; - - /** - * Just calls the superclass constructor. - */ - public AComboBox() { - super(); - } - - /** - * Set the GUIItemListener to be informed of ItemEvents. - * Only one listener is allowed. - * @param aListener - */ - public void setGUIItemListener(ItemListener aListener) { - // Remove any existing listeners. - for (ItemListener listener : this.getItemListeners()) this.removeItemListener(listener); - super.addItemListener(aListener); - listener=aListener; - } - - /** - * Check whether the GUIItemListener has already been set. - * @return true if this AComboBox has a GUIItemListener - */ - public boolean hasGUIItemListener() {return (listener!=null);} - - /** - * Set the selected item without telling any item listeners. - * @param item - */ - public void setGUISelectedItem(Object item) { - if(listener!=null) super.removeItemListener(listener); - super.setSelectedItem(item); - if(listener!=null) super.addItemListener(listener); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AConfigWriter.java b/graphics/AtlantisJava/src/atlantis/gui/AConfigWriter.java deleted file mode 100755 index a903e939ef449a46908060ed74ad625319f82aa5..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AConfigWriter.java +++ /dev/null @@ -1,417 +0,0 @@ -package atlantis.gui; - -import java.awt.geom.Point2D; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.util.Vector; - -import javax.swing.JOptionPane; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParametersGroup; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; - -/** - * - * <ul><li>Reads the configuration file (given file name) and makes the corrections - * according to the actual configuration which might have been changed by the - * user.</li> - * <li>Reads parameters differences (values from the parameters store).</li> - * <li>Reads canvas / window configuration.</li> - * <li>Creates XML config files from three above parts.</li></ul> - * - * <p>Writes out the current status. This is not a robust piece of code and make - * break if the format of config.xml is changed by hand. - * This class should throw an exception if there is a problem. - * </p> - * - * @author Gary Taylor, Zdenek Maxa - */ -public class AConfigWriter -{ - - private static ALogger logger = ALogger.getLogger(AConfigWriter.class); - - protected static APar parameterStore = APar.instance(); - - private AConfigWriter() - { - } - - /** - * Main method from the class - * @param sourceFile String - * @return String - */ - public static String getConfiguration(String sourceFile) - { - logger.trace("Trying to read the distribution configuration ..."); - String config = null; - StringBuffer output = new StringBuffer(""); - - config = readConfiguration(sourceFile); - - if(config != null) - { - logger.debug("Loading source configuration successful."); - output.append(config); - output.append(getParametersDifferences()); - output.append(getWindowCorners()); - output.append("\n</AtlantisConfiguration>\n"); - return output.toString(); - } - else - { - logger.error("Loading source configuration failed."); - return null; - } - } // getConfiguration() ------------------------------------------------- - - - - private static String getParametersDifferences() - { - StringBuffer output = new StringBuffer(""); - - output.append("\n\n"); - output.append("\t<ParameterDifferences>\n"); - - AParametersGroup[][] group = parameterStore.getUIGroups(); - for(int i = 0; i < group.length; i++) - { - for(int j = 0; j < group[i].length; j++) - { - Vector v = group[i][j].getParameters(999); - for(int k = 0; k < v.size(); ++k) - { - output.append(((AParameter)v.elementAt(k)).getDifferences(group[i][j].getGroupName())); - } - } - } - output.append("\t</ParameterDifferences>\n\n"); - - return output.toString(); - - } // getParametersDifferences() ----------------------------------------- - - - - private static String getWindowCorners() - { - StringBuffer output = new StringBuffer(""); - - output.append("\n\n"); - output.append("\t<WindowCorners>\n"); - - String[] windowNames = ACanvas.getCanvas().getKnownWindowNames(); - - for(int i = 0; i < windowNames.length; i++) - { - Point2D.Double[] corners = - ACanvas.getCanvas().getWindow(windowNames[i]).getUserCorners(); - if(corners != null) - { - output.append("\t\t<CORNERS windowName=\"" + - windowNames[i] + "\""); - for(int j = 0; j < corners.length; ++j) - { - output.append(" x" + j + "=\"" + corners[j].getX() + "\""); - output.append(" y" + j + "=\"" + corners[j].getY() + "\""); - } - output.append("/>\n"); - } - } - - output.append("\t</WindowCorners>\n\n\n"); - - return output.toString(); - } // getWindowCorners() ------------------------------------------------- - - - // Read one logic line from xml file - // contain <....> or <..../> - private static String readLogicLine(BufferedReader reader) throws IOException - { - String startLine = reader.readLine(); - if(startLine == null) - return null; - - StringBuffer logicLine = new StringBuffer(startLine); - - while(logicLine.indexOf("<") >= 0 && logicLine.indexOf(">") < 0) - { - logicLine.append("\n"); - logicLine.append(reader.readLine()); - } - return logicLine.toString(); - } - - - private static String readConfiguration(String fileName) - { - String groupName = ""; - String parameterName = ""; - AParameter aParam = null; - BufferedReader curr = null; - String str; - StringBuffer buffer = new StringBuffer(""); // working buffer - StringBuffer output = new StringBuffer(""); // final result - boolean inComment = false; - - try - { - logger.debug("Trying to open configuration file: " + fileName); - InputStream fis = AUtilities.getFileAsStream(fileName); - InputStreamReader isr = new InputStreamReader(fis); - curr = new BufferedReader(isr, 10000); - - while((str = readLogicLine(curr)) != null) - { - buffer = new StringBuffer(str); - // in a comment ? - if(buffer.indexOf("<!--") >= 0) - { - inComment = true; - } - if(buffer.indexOf("-->") >= 0) - { - inComment = false; - } - if(!inComment) - { - // nearly finished writing - if(buffer.indexOf("</Parameters>") >= 0) - { - output.append(buffer); - output.append("\n"); - break; - } - - // modification in the initialisation - if(buffer.indexOf("<Canvas") >= 0) { - buffer = replace(buffer, "startupLayout", ACanvas.getCanvas().getCurrentLayout().getName()); - String ar = Double.toString(ACanvas.getCanvas().getAspectRatio()); - buffer = replace(buffer, "aspectRatio", ar); - } - - if(buffer.indexOf("<UsedWindow") >= 0) - { - String name = get(buffer, "name"); - if(name != null) - { - AWindow w = ACanvas.getCanvas().getWindow(name); - if(w != null) - { - if(w.getProjection() != null) - { - buffer = replace(buffer, "projection", w.getProjection().getName()); - } - buffer = replace(buffer, "group", w.getGroupName()); - } - } - } - - if(buffer.indexOf("<Layout") >= 0) - { - String name = get(buffer, "name"); - if(name != null && name.equals(ACanvas.getCanvas().getCurrentLayout().getName())) - { - buffer = replace(buffer, "startupWindow", ACanvas.getCanvas().getCurrentWindowName()); - buffer = replace(buffer, "startup", ACanvas.getCanvas().getStartupString()); - } - } - - // new group encountered - if(buffer.indexOf("<Group") >= 0) - { - groupName = get(buffer, "name"); - } - - // new parameter encountered - aParam = null; - if(buffer.indexOf(" fn=\"") >= 0 && - buffer.indexOf("<StatusRoot") < 0 && - buffer.indexOf("<StatusGroup") < 0) - { - parameterName = removeSpaces(get(buffer, "fn")); - aParam = parameterStore.getUnknown(groupName, parameterName); - } - if(aParam != null) - { - // replacing status - if(buffer.indexOf(" st=\"") >= 0) - { - String status = "OFF"; - if(aParam.getStatus()) - { - status = "ON"; - } - buffer = replace(buffer, "st", status); - } - - // replacing value - if(buffer.indexOf(" va=\"") >= 0) - { - String value = aParam.getValue(); - - if(parameterName.equals("Area/Energy")) - { - value = "0.0"; - } - // for instance Track Collections listbox should - // always remain: - // sn="Track Collections" va="0" pv="none=0" - // current 'value' mustn't be put there - else if(parameterName.endsWith("Collections")) - { - value = "0"; - } - buffer = replace(buffer, "va", value); - - } - - // replacing operator - if(buffer.indexOf(" dop=\"") >= 0) - { - String dop = aParam.getOperator(); - if(dop.equals("<")) - { - dop = "<"; - } - if(dop.equals("<=")) - { - dop = "≤"; - } - if(dop.equals(">")) - { - dop = ">"; - } - if(dop.equals(">=")) - { - dop = "≥"; - } - buffer = replace(buffer, "dop", dop); - } - - // replacing scope - if(buffer.indexOf(" scope=\"") >= 0) - { - if(aParam.getScope() == AParameter.GLOBAL) - { - buffer = replace(buffer, "scope", "GLOBAL"); - } - else if(aParam.getScope() == AParameter.LOCAL) - { - buffer = replace(buffer, "scope", "LOCAL"); - } - } - else if(buffer.indexOf(" fn=\"") > 0) - { - // in a parameter - adding scope if needed - if(aParam.getScope() != parameterStore.getGroup(groupName).getScope()) - { - int index = buffer.indexOf("/>"); - if(index > 0) - { - if(aParam.getScope() == AParameter.GLOBAL) - { - buffer.insert(index, - " scope=\"GLOBAL\""); - } - else - { - buffer.insert(index, - " scope=\"LOCAL\""); - } - } - } - } - } // aParam != null - } // !inComment - output.append(buffer); - output.append("\n"); - } // while - curr.close(); - } // try - catch(IOException ex) - { - String m = "I/O error occured when reading the source " + - "configuration file: " + fileName; - logger.error(m); - logger.debug(m, ex); - output = null; - } - catch(AAtlantisException ae) - { - //throw ae; - } - - - return (output != null) ? output.toString() : null; - - } // readConfiguration() ------------------------------------------------ - - - - /** - * Removing spaces from the parameter name - * @param name String - * @return String - */ - private static String removeSpaces(String name) - { - StringBuffer strBuffer = new StringBuffer(name); - int i = 0; - while(i < strBuffer.length()) - { - if(Character.isWhitespace(strBuffer.charAt(i))) - { - strBuffer.deleteCharAt(i); - } - else - { - i++; - } - } - return new String(strBuffer); - } // removeSpaces() ----------------------------------------------------- - - - private static StringBuffer replace(StringBuffer s, String variable, String text) - { - int name = s.indexOf(variable + "=\""); - if(name >= 0) - { - int start = s.indexOf("\"", name); - int stop = s.indexOf("\"", start + 1); - s.delete(start + 1, stop); - s.insert(start + 1, text); - } - - return s; - } // replace() ---------------------------------------------------------- - - - private static String get(StringBuffer s, String variable) - { - // insert a space before the variable name to prevent from the variable - // name is a substring of another variable name - int name = s.indexOf(" " + variable + "=\""); - if(name >= 0) - { - int start = s.indexOf("\"", name); - int stop = s.indexOf("\"", start + 1); - return s.substring(start + 1, stop); - } - return null; - } // get() -------------------------------------------------------------- - -} // class AConfigWriter ==================================================== diff --git a/graphics/AtlantisJava/src/atlantis/gui/AControlButton.java b/graphics/AtlantisJava/src/atlantis/gui/AControlButton.java deleted file mode 100755 index 007cd04275719ba024d9bead8fd30f42993a5d80..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AControlButton.java +++ /dev/null @@ -1,84 +0,0 @@ -package atlantis.gui; - -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.Timer; -import javax.swing.JButton; - -/** - * This class is not used at the moment. - * Was used to control animation. - */ -public class AControlButton extends JButton { - - public static final int STANDARD_ACTION=0; - public static final int ACCELERATED_ACTION=1; - - private ActionListener controlListener; - private ActionEvent standardAction, acceleratedAction; - private long ticks; - private Timer timer; - private int initialDelay; - private int tickLength; - private int accelerationLimit; - private boolean ignoreClick=false; - - public AControlButton(String text, int initialDelay, int tickLength, int accelerationLimit) { - super(text); - this.initialDelay=initialDelay; - this.tickLength=tickLength; - this.accelerationLimit=accelerationLimit; - initialize(); - } - - private void initialize() { - standardAction=new ActionEvent(this, 0, "", STANDARD_ACTION); - acceleratedAction=new ActionEvent(this, 0, "", ACCELERATED_ACTION); - - timer=new Timer(tickLength, new ActionListener() { - public void actionPerformed(ActionEvent e) { - ticks++; - fireControlActionPerformed(); - ignoreClick=true; - } - }); - timer.setInitialDelay(initialDelay); - - addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - ticks=0; - timer.restart(); - } - - public void mouseReleased(MouseEvent e) { - timer.stop(); - } - - public void mouseClicked(MouseEvent e) { - if(ignoreClick) - ignoreClick=false; - else - fireControlActionPerformed(); - } - }); - - } - - private void fireControlActionPerformed() { - if(controlListener!=null) { - if(ticks>accelerationLimit) - controlListener.actionPerformed(acceleratedAction); - else - controlListener.actionPerformed(standardAction); - } - } - - public void addControlActionListener(ActionListener controlListener) { - if(this.controlListener!=null) - throw new Error("AControlButton supports only 1 listener"); - this.controlListener=controlListener; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ACrashReporter.java b/graphics/AtlantisJava/src/atlantis/gui/ACrashReporter.java deleted file mode 100644 index d47949481a8fca9bdf66d845d3895f41872e2a52..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ACrashReporter.java +++ /dev/null @@ -1,232 +0,0 @@ -// NOTE: revert to previous version once support for Java 1.5 is dropped - -package atlantis.gui; - -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.globals.AGlobals; -import java.awt.Desktop; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.lang.Thread.UncaughtExceptionHandler; -import java.net.URI; -import java.net.URLEncoder; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; - -/** - * This class handles any unhandled exception (program crash). It asks the user for - * permission to submit a crash report by e-mail and pre-formats the message. It then - * fires the default system mail client with this message to allow the user to add - * additional commands and send it. - * - * @author Eric Jansen - */ -public class ACrashReporter implements UncaughtExceptionHandler { - - // Dialog asking for permission to report the crash - private static final String title = "An uncaught exception occured"; - private static final String msg = - "An uncaught exception occured!\n\n" - + "Please help us prevent this in the future by reporting this incident.\n" - + "If you click yes, Atlantis will try to open your mail client and create\n" - + "a preformatted crash report for you. You can review the information\n" - + "and add additional comments before it is sent.\n\n" - + "Do you want to report this crash?"; - - // Address that receives crash reports, chopped up in case spiders go through this code - private static final String address = "atlas-atlantis-developers" + "@" + "cern" + "." + "ch"; - - // Tag for easy filtering, prefix for the mail subject - private static final String tag = "[crash-report] "; - - // System properties included in the report - private static final String[] properties = { - "java.version", "java.vendor", "java.vm.specification.version", - "java.vm.specification.vendor", "java.vm.specification.name", "java.vm.version", - "java.vm.vendor", "java.vm.name", "java.specification.version", "java.specification.vendor", - "java.specification.name", "os.name", "os.arch", "os.version"}; - - /** Flag indicating whether CrashReporter has already been shown */ - private static boolean shownCrashReporter = false; - - /** - * Exception handler for uncaught exceptions in Atlantis. The only way to - * "handle" such an exception is to tell the developers that they failed. - * So that is what we will do. - * @param t thread - * @param e uncaught exception - */ - public void uncaughtException(Thread t, Throwable e) { - // Ensure this only happens once - if (shownCrashReporter) return; - shownCrashReporter = true; - - int confirm = JOptionPane.showConfirmDialog(null, msg, title, - JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null); - - if (confirm == JOptionPane.YES_OPTION) { - String report = "### Please explain briefly what you did when the problem occured (optional)\n\n"; - - report += "\n### Exception information\n\n"; - report += getExceptionInformation(e); - - report += "\n### General information\n\n"; - report += getGeneralInformation(); - - report += "\n### Event information\n\n"; - report += getEventInformation(); - - // If possible, we open the mail client and create a new message - if (Desktop.isDesktopSupported()) { - Desktop desktop = Desktop.getDesktop(); - - if (desktop.isSupported(Desktop.Action.MAIL)) { - String subject = getSubject(e); - try { - URI uri = new URI("mailto:" + address + "?SUBJECT=" - + encode(subject) + "&BODY=" + encode(report)); - desktop.mail(uri); - } catch (Throwable ex) { - // Something went wrong, save report to file instead - saveToFile(report); - } - } else { - // No mail support, save report to file instead - saveToFile(report); - } - } else { - // No desktop support, save report to file instead - saveToFile(report); - } - } - } - - /** - * Provides mail encoding of a string (URLEncoding but with %20 for space) - * @param s string to encode - * @return encoded string - */ - private static String encode(String s) { - try { - return URLEncoder.encode(s, "utf-8").replaceAll("\\+", "%20"); - } catch (Throwable ex) { - return s; - } - } - - /** - * This provides is the backup option if starting the mail client doesn't - * work. The report will be saved to a local file and we ask the user to - * send it. - * @param report crash report contents - */ - private void saveToFile(String report) { - String directory = AGlobals.instance().getHomeDirectory(); - JFileChooser chooser = new JFileChooser(directory); - chooser.setDialogTitle("Save crash report"); - chooser.setSelectedFile(new File("crash-report.txt")); - - // Remind people where this report should go at the top of the file - report = "### Atlantis crash report, please send to " + address + "\n\n" - + report; - - // Continue asking until the user chooses a valid file or cancels - while (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) { - File file = chooser.getSelectedFile(); - try { - OutputStream out = new FileOutputStream(file.getAbsolutePath()); - out.write(report.getBytes()); - out.close(); - - JOptionPane.showMessageDialog(null, "The crash report has been saved successfully.\n" - + "Please send the file to " + address); - return; - } catch (Throwable ex) { - JOptionPane.showMessageDialog(null, "Cannot write file: " + ex.toString()); - } - } - } - - /** - * Takes the exception and finds the most helpful mail subject, in general - * the exact location of the crash should be helpful when dealing with a - * lot of reports. - * @param e uncaught exception - * @return subject string - */ - private static String getSubject(Throwable e) { - StackTraceElement[] st = e.getStackTrace(); - if (st.length > 0) { - return tag + st[0].toString(); - } else { - return tag + e.toString(); - } - } - - /** - * Formats general information about the system, Java and Atlantis - * @return information string - */ - private static String getGeneralInformation() { - StringBuilder s = new StringBuilder(); - s.append("Atlantis version = " + AGlobals.instance().getVersion() + "\n"); - - for (String property : properties) { - String value = System.getProperty(property); - if (value == null) { - value = "(not set)"; - } - s.append(property + " = " + value + "\n"); - } - - return s.toString(); - } - - /** - * Formats stack trace and exception information - * @param e unhandled exception - * @return information string - */ - private static String getExceptionInformation(Throwable e) { - StringBuilder s = new StringBuilder(); - String pad = ""; - - s.append(e.toString() + "\n\n"); - - StackTraceElement[] st = e.getStackTrace(); - for (StackTraceElement traceline : st) { - s.append(pad + traceline + "\n"); - pad = " "; - } - - return s.toString(); - } - - /** - * Formats event information, such as source, file, run/event and datatypes - * @return information string - */ - private static String getEventInformation() { - StringBuilder s = new StringBuilder(); - AEventManager eventManager = AEventManager.instance(); - AEvent event = eventManager.getCurrentEvent(); - if (event == null) { - return "(no current event)"; - } - - s.append("Source = " + event.getSourceName() + "\n"); - s.append("Run = " + event.getRunNumber() + "\n"); - s.append("Event = " + event.getEventNumber() + "\n"); - - s.append("\nData types present:\n"); - String[][] info = event.getInfo(); - for (String[] item : info) { - s.append(" " + item[0] + " (" + item[1] + ")\n"); - } - - return s.toString(); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ADefaultCellAttribute.java b/graphics/AtlantisJava/src/atlantis/gui/ADefaultCellAttribute.java deleted file mode 100755 index 1a17ebd0ef9781dbd990f94c82ac52c7b062c993..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ADefaultCellAttribute.java +++ /dev/null @@ -1,129 +0,0 @@ -package atlantis.gui; - -import java.awt.Dimension; - -public class ADefaultCellAttribute -{ - public static final int ROW = 0; - public static final int COLUMN = 1; - - // - // !!!! CAUTION !!!!! - // these values must be synchronized to Table data - // - protected int rowSize; - protected int columnSize; - protected int[][][] span; - - public ADefaultCellAttribute() - { - this(1, 1); - } - - public ADefaultCellAttribute(int numRows, int numColumns) - { - setSize(new Dimension(numColumns, numRows)); - } - - protected void initValue() - { - for (int i = 0; i < span.length; i++) - { - for (int j = 0; j < span[i].length; j++) - { - span[i][j][COLUMN] = 1; - span[i][j][ROW] = 1; - } - } - } - - public int[] getSpan(int row, int column) - { - if (isOutOfBounds(row, column)) - { - int[] ret_code = { 1, 1 }; - return ret_code; - } - return span[row][column]; - } - - public boolean isVisible(int row, int column) - { - if (isOutOfBounds(row, column)) - return false; - if ((span[row][column][COLUMN] < 1) - || (span[row][column][ROW] < 1)) - return false; - return true; - } - - public void combine(int[] rows, int[] columns) - { - if (isOutOfBounds(rows, columns)) - return; - int rowSpan = rows.length; - int columnSpan = columns.length; - int startRow = rows[0]; - int startColumn = columns[0]; - for (int i = 0; i < rowSpan; i++) - { - for (int j = 0; j < columnSpan; j++) - { - if ((span[startRow + i][startColumn + j][COLUMN] != 1) - || (span[startRow + i][startColumn + j][ROW] != 1)) - { - return; - } - } - } - for (int i = 0, ii = 0; i < rowSpan; i++, ii--) - { - for (int j = 0, jj = 0; j < columnSpan; j++, jj--) - { - span[startRow + i][startColumn + j][COLUMN] = jj; - span[startRow + i][startColumn + j][ROW] = ii; - } - } - span[startRow][startColumn][COLUMN] = columnSpan; - span[startRow][startColumn][ROW] = rowSpan; - } - - public Dimension getSize() - { - return new Dimension(rowSize, columnSize); - } - - public void setSize(Dimension size) - { - columnSize = size.width; - rowSize = size.height; - span = new int[rowSize][columnSize][2]; // 2: COLUMN,ROW - initValue(); - } - - protected boolean isOutOfBounds(int row, int column) - { - if ((row < 0) || (rowSize <= row) || (column < 0) - || (columnSize <= column)) - { - return true; - } - return false; - } - - protected boolean isOutOfBounds(int[] rows, int[] columns) - { - for (int i = 0; i < rows.length; i++) - { - if ((rows[i] < 0) || (rowSize <= rows[i])) - return true; - } - for (int i = 0; i < columns.length; i++) - { - if ((columns[i] < 0) || (columnSize <= columns[i])) - return true; - } - return false; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ADemoDialog.java b/graphics/AtlantisJava/src/atlantis/gui/ADemoDialog.java deleted file mode 100755 index be69b6c21e26ecb79846586f4f3dca471762322e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ADemoDialog.java +++ /dev/null @@ -1,434 +0,0 @@ -package atlantis.gui; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.GridLayout; -import java.awt.Toolkit; -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.JTextField; -import javax.swing.SpinnerNumberModel; -import javax.swing.SwingConstants; -import javax.swing.WindowConstants; -import javax.swing.border.Border; - -import java.util.Arrays; -import java.util.Vector; - -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.projection.AProjectionsManager; -import atlantis.parameters.ACommandProcessor; -import atlantis.utils.ALogger; - - - - - -/** - * A Dialog in which user can set parameters for demo mode, as well as start and - * stop the demo mode. This class holds and controls the demo loop thread. - * This is a singleton, but there is no point why it needs to be. - * - * @author Sebastian Boeser (with traces from Qiang Lu) - */ -public class ADemoDialog extends JFrame implements ActionListener -{ - //Get a logger - private final static ALogger logger = ALogger.getLogger(ADemoDialog.class); - - //Some GUI elements - private JSpinner timerSpinner; - private SpinnerNumberModel timerSpinnerModel; - private static final Integer TIMER_MIN = new Integer(1); - private static final Integer TIMER_MAX = new Integer(120); - private static final Integer TIMER_INIT = new Integer(3); - - //The text label showing the projection sequence - private JTextField sequenceTextField = null; - //And the panel housing these - private JPanel projControlPanel=null; - - //The action buttons - private JButton startButton = null; - private JButton stopButton = null; - private JButton closeButton = null; - - - //The thread that is runing the loop - private ADemoLoop demo = null; - - private static final AGlobals globals = AGlobals.instance(); - - //The singleton instance - private static ADemoDialog instance = null; - - /** - * Public access-instantiation accessor - * @return the singleton instance - */ - public static ADemoDialog getInstance(){ - //Create instance if needed - if (instance == null) instance = new ADemoDialog(); - //and return it - return instance; - } - - /** - * Private Constructor - */ - private ADemoDialog() { - super("Demo"); - createGUI(); - pack(); - } - - // initialize the GUI - private void createGUI() - { - JPanel timerControlPanel = createTimeControlPanel(); - projControlPanel = createProjControlPanel(); - JPanel buttonControlPanel = createButtonControlPanel(); - - JPanel contentPane = new JPanel(new GridBagLayout()); - contentPane.setOpaque(true); - GridBagConstraints c = new GridBagConstraints(); - c.weightx = 1; - c.weighty = 1; - c.gridwidth = GridBagConstraints.REMAINDER; - c.fill=GridBagConstraints.HORIZONTAL; - c.anchor = GridBagConstraints.CENTER; - contentPane.add(timerControlPanel, c); - contentPane.add(projControlPanel, c); - contentPane.add(buttonControlPanel, c); - this.setResizable(false); - this.setContentPane(contentPane); - this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - this.setAlwaysOnTop(true); - - // set the initial location - Frame gui = globals.getGuiFrame(); - int guiWidth = gui.getWidth(); - int guiHeight = gui.getHeight(); - int guiX = gui.getX(); - int dialogWidth = (int) this.getPreferredSize().getWidth(); - int dialogHeight = (int) this.getPreferredSize().getHeight(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit().getScreenSize().getWidth()); - if(guiX + guiWidth + (dialogWidth - guiWidth) / 2 > screenWidth) - this.setLocation(Math.max(0, screenWidth - dialogWidth), - Math.max(0, (guiHeight - dialogHeight) / 3)); - else - this.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), - Math.max(0, (guiHeight - dialogHeight) / 3)); - AIcon.setIconImage(this); - } - - private JPanel createTimeControlPanel() - { - - JPanel aPanel = new JPanel(new GridBagLayout()); - GridBagConstraints c = new GridBagConstraints(); - aPanel.setOpaque(true); - //aPanel.setPreferredSize(new Dimension(FRAME_WIDTH, PANEL_HEIGHT)); - aPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - - //Add timer label - JLabel timerLabel= new JLabel("Interval"); - c.gridwidth = 1; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx=1; - c.gridx=0; - aPanel.add(timerLabel,c); - //Add timer spinner - timerSpinner = new JSpinner(); - timerSpinner.setEnabled(true); - timerSpinnerModel = new SpinnerNumberModel(TIMER_INIT, TIMER_MIN, - TIMER_MAX, new Integer(1)); - timerSpinner.setModel(timerSpinnerModel); - c.gridwidth = 1; - c.weightx=1; - c.fill = GridBagConstraints.HORIZONTAL; - c.gridx=1; - aPanel.add(timerSpinner,c); - //Add units label - c.weightx = 0.5; - c.gridwidth = GridBagConstraints.REMAINDER; - c.gridx=2; - aPanel.add(new JLabel(" sec"),c); - - - //Add the labels for th selected projections - c.gridx=GridBagConstraints.RELATIVE; - c.weightx=1; - c.gridwidth=1; - aPanel.add(new JLabel("Sequence:"), c); - - //Now generate the sequence label and make it span the remaining columns - sequenceTextField = new JTextField(); - c.gridwidth=GridBagConstraints.REMAINDER; - c.fill=GridBagConstraints.HORIZONTAL; - aPanel.add(sequenceTextField,c); - - return aPanel; - } - - private JPanel createProjControlPanel() - { - - JPanel aPanel = new JPanel(new GridLayout(3,4)); - aPanel.setOpaque(true); - Border outerBorder = BorderFactory.createEmptyBorder(5, 5, 5, 5); - Border innerBorder = BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.GRAY), - "Add Projection / Action"); - aPanel.setBorder(BorderFactory.createCompoundBorder(outerBorder, innerBorder)); - - //Create the list of check boxes - for (String projName : AProjectionsManager.getKnownProjectionNames()){ - - //Check wether this projection name should be used in the demo dialog - if (AProjectionsManager.useProjectionInDemoMode(projName)){ - - //Create the respective button with the screen name of the projection - String projScreenName = AProjectionsManager.getProjection(projName).getScreenName(); - JButton projButton = new JButton(projScreenName); - //Store the name of the projection as the name of the JCheckBox - //Where we can retrieve it once the demo dialog is started - projButton.setName(projName); - projButton.setFocusPainted(false); - - //Add ourselves as action listener of this button - projButton.addActionListener(this); - aPanel.add(projButton); - } - } - //Also add a "next event" button - JButton nextEvtBut = new JButton("Next event"); - nextEvtBut.setName("NE"); - nextEvtBut.addActionListener(this); - aPanel.add(nextEvtBut); - - return aPanel; - } - - private JPanel createButtonControlPanel() - { - //final int PANEL_HEIGHT = 40; - Dimension buttonDimension = new Dimension(100,25); - - JPanel aPanel = new JPanel(new GridBagLayout()); - aPanel.setOpaque(true); - //aPanel.setPreferredSize(new Dimension(FRAME_WIDTH, PANEL_HEIGHT)); - aPanel.setBorder(BorderFactory.createEmptyBorder(5,5,10,5)); - - GridBagConstraints c = new GridBagConstraints(); - startButton = new JButton("Start"); - //startButton.setFocusPainted(false); - startButton.setEnabled(true); - startButton.setPreferredSize(buttonDimension); - startButton.addActionListener(this); - c.weightx = 1; - c.weighty = 1; - c.anchor = GridBagConstraints.CENTER; - aPanel.add(startButton, c); - stopButton = new JButton("Stop"); - stopButton.setFocusPainted(false); - stopButton.setEnabled(false); - stopButton.setPreferredSize(buttonDimension); - stopButton.addActionListener(this); - aPanel.add(stopButton, c); - JSeparator aSeparator = new JSeparator(SwingConstants.VERTICAL); - //aSeparator.setPreferredSize(new Dimension(5, PANEL_HEIGHT)); - aPanel.add(aSeparator, c); - closeButton = new JButton("Close"); - closeButton.setFocusPainted(false); - closeButton.setEnabled(true); - closeButton.setPreferredSize(buttonDimension); - closeButton.addActionListener(this); - c.gridwidth = GridBagConstraints.REMAINDER; - aPanel.add(closeButton, c); - - return aPanel; - } - - /** - * @return true if demo thread is running, otherwise false - */ - boolean isRunning(){ - //no thread -> false - if (demo == null) return false; - //otherwise use thread status - return demo.isRunning(); - } - - - // return interval in millisecond - int getTimerInterval() - { - return 1000 * timerSpinnerModel.getNumber().intValue(); - } - - public void setTimerInterval(Integer intervalInSec) - { - try { - timerSpinnerModel.setValue(intervalInSec); - } catch (IllegalArgumentException iae){ - //Just ignore in case of illegal argument - } - } - - - /** - * Set the sequence of projections - * @param projNames colon seperated list of projection names - */ - public void setSequence(String projNames){ - //store this in our text entry - sequenceTextField.setText(projNames); - } - - /** - * Set the default sequence - */ - public void setDefaultSequence(){ - //Create default sequence - StringBuilder sequence = new StringBuilder(); - //Add all default projections - for (String projName : AProjectionsManager.getKnownProjectionNames()){ - if (AProjectionsManager.defaultProjectionInDemoMode(projName)) - sequence.append(projName+":"); - } - //End sequence with next event - sequence.append("NE"); - //And set this in the text field - sequenceTextField.setText(sequence.toString()); - } - - /** - * @return a vector with the names of the projections - */ - private Vector<String> getSequence() - { - return new Vector<String>(Arrays.asList(sequenceTextField.getText().split(":"))); - } - - /** - * Validate whether the given sequence is valid - * @return the number of selected projections - */ - private boolean validateSequence() - { - //Get the projections sequence - Vector<String> sequence = getSequence(); - - //Check on number of projections - if(sequence.size() < 1){ - JOptionPane.showMessageDialog(this, - "No projection/event is selected, please select at least select one", - "Warning", JOptionPane.WARNING_MESSAGE); - return false; - } - - //Now check each item of the sequence for validity - for (String projName : sequence){ - //The "new event" action is an exception here - if (projName.equals("NE")) continue; - //check wether this is a known and allowed projection - if ((! Arrays.asList(AProjectionsManager.getKnownProjectionNames()).contains(projName)) || - (! AProjectionsManager.useProjectionInDemoMode(projName))) - { - JOptionPane.showMessageDialog(this, - "Not a valid projection name: '"+projName+"'", - "Warning", JOptionPane.WARNING_MESSAGE); - return false; - } - - } - - //Seems all okay - return true; - } - - - - /** - * Start the demo thread - */ - public void startDemo() - { - - //First make sure some projections have been selected - if (!validateSequence()) return; - - //Set single full window mode - ACommandProcessor.receive("WW"); - - //Start the demo, setting "stopOnNoMoreEvents" to false - //TODO: make stopOnNoMoreEvents a checkbox in the Dialog - demo = new ADemoLoop(getTimerInterval(),getSequence(),false); - demo.startDemoLoop(); - //Now disable all GUI elements - timerSpinner.setEnabled(false); - sequenceTextField.setEnabled(false); - for (Component comp: projControlPanel.getComponents()) comp.setEnabled(false); - startButton.setEnabled(false); - stopButton.setEnabled(true); - closeButton.setEnabled(false); - //Do not allowe the user to close the window, so he doesn't loose access - this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); - } - - /** - * Stop the demo thread - */ - synchronized void stopDemo() - { - //exit the demo - demo.stopDemoLoop(); - //Now reenable all GUI elements - timerSpinner.setEnabled(true); - sequenceTextField.setEnabled(true); - for (Component comp: projControlPanel.getComponents()) comp.setEnabled(true); - stopButton.setEnabled(false); - startButton.setEnabled(true); - closeButton.setEnabled(true); - - this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - } - - /** - * Implementation of the Action listener - * - gets called for every button that is pressed - * @param e the action event - */ - public void actionPerformed(ActionEvent e) { - //Check for action buttons first - if (e.getSource() == startButton ) startDemo(); - else if (e.getSource() == stopButton) stopDemo(); - else if (e.getSource() == closeButton ) dispose(); - //this should be one of the projection buttons - else { - //get the projectio name to append - String projName = ((JButton)e.getSource()).getName(); - //get the existing sequence - String sequence = sequenceTextField.getText(); - //append new projection - sequence += ((sequence.length()!=0) ? ":" : "") + projName; - //Set this as new sequence - sequenceTextField.setText(sequence); - } - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ADemoFileChooser.java b/graphics/AtlantisJava/src/atlantis/gui/ADemoFileChooser.java deleted file mode 100755 index c9768ef7aab889827c054a0eb3421a22b969fc16..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ADemoFileChooser.java +++ /dev/null @@ -1,41 +0,0 @@ -package atlantis.gui; - -import java.awt.Component; -import java.io.File; - -import atlantis.config.ADefaultValues; - -/** -* A dialog which appears when a user asks to read a new event. -* -* @author Qiang Lu -*/ -public class ADemoFileChooser extends AXMLFileChooser -{ - private File fileSelected; - - public ADemoFileChooser(String path, Component parent) - { - super(path, parent); - } - - public boolean processSelectedFile(File file) - { - if (file.canRead()) - { - // save last visited location - ADefaultValues.set("LastEventFilesSourceDir", file.getParent() + - System.getProperty("file.separator")); - - fileSelected = file; - return true; - } - return false; - } - - public File getFileSelected() - { - return fileSelected; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ADemoLoop.java b/graphics/AtlantisJava/src/atlantis/gui/ADemoLoop.java deleted file mode 100755 index 85f387a9708008ffbedef8bf2b73c178ab12b5e9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ADemoLoop.java +++ /dev/null @@ -1,200 +0,0 @@ -package atlantis.gui; - -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.util.ArrayList; - -import atlantis.canvas.ACanvas; -import atlantis.event.AEventManager; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; -import atlantis.globals.AGlobals; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionsManager; -import atlantis.parameters.ACommandProcessor; -import atlantis.utils.ALogger; -import java.awt.event.ActionListener; -import java.util.Iterator; -import java.util.Vector; -import javax.swing.JOptionPane; - -import javax.swing.Timer; - -/** - * A class to automatically loop over different projections given in a - * colon-seperated list. The special projection name "NE" stands for next event. - * This is also used in headless mode to generate an event loop. The stopOnNoMoreEvents - * allows to control wether the loop ends if no more events can be obtained. - * - * NOTE: The previous implementation of this was using java.awt.Thread - we are - * far from providing the standards of a thread-safe application. - * - * @author Sebastian Boeser - */ -public class ADemoLoop extends Timer implements ActionListener -{ - //The logger - private static ALogger logger = ALogger.getLogger(ADemoLoop.class); - - //whether to stop the loop if there are no more events - private boolean stopOnNoMoreEvents = false; - - //A list of projections to show - private final ArrayList<String> projectionList = new ArrayList<String>(); - - //An iterator that loops through the list above - private Iterator<String> projIter = null; - - private static final AGlobals globals = AGlobals.instance(); - - /** - * Fully specified Constructor - * @param sleepTime time to sleep inbetween projections in milliseconds - * @param projectionList list of projections to loop through - * @param stopOnNoMoreEvents wether to stop loop if there are no more events - */ - public ADemoLoop(int sleepTime, Vector<String> projectionList, boolean stopOnNoMoreEvents){ - - //Initialize the timer - super(sleepTime,null); - addActionListener(this); - - //Initialize the timer to start immediately only on first event - setInitialDelay(0); - - //Store the list of projections - for (String projName : projectionList) - this.projectionList.add(projName); - - //Set the stop on no more events flag - this.stopOnNoMoreEvents = stopOnNoMoreEvents; - - } - - - /*** - * prepare the demo loop and start the timer thread - */ - public void startDemoLoop(){ - AGlobals.instance().setDemoMode(true); - - //be verbose - logger.trace("Starting demo loop with interval "+Integer.toString(getDelay())+ - " ms and projections "+projectionList.toString()); - - //Generate the list iterator to point to the start of the list - projIter = projectionList.listIterator(0); - - //Finally start the loop - start(); - } - - /** - * stop the demo loop - */ - public void stopDemoLoop(){ - stop(); - globals.setDemoMode(true); - } - - /** - * This gets fired by the timer every time after it returns from sleep - * @param event the action event - */ - public void actionPerformed(ActionEvent event) { - - //If we have reached the end, start from beginning - if (! projIter.hasNext()) projIter = projectionList.listIterator(0); - - //proceed to next element in list - String projName = projIter.next(); - - //add debugging output - logger.trace("Next in demo loop: "+projName); - - //Check if this is a next event tag - if (projName.equals("NE")) { - //Change the event or stop loop if this did not succeed - if (!changeEvent()) { - //stop the loop - stop(); - //notify everyone that we are done (so the application can finish) - synchronized(this) { notifyAll(); } - } - - //Immediatly go to the next projection if this is not just a nextEvent again - Iterator<String> nextProjIter = projIter; - if (nextProjIter.hasNext() && (!nextProjIter.next().equals("NE"))) restart(); - //be verbose - logger.trace("Timer is"+(isRunning()?" running":" stopped")+" with "+getDelay()+" ms delay"); - } - //else just change the projection - else changeProjection(projName); - - } - - - /** - * Change the current projection to the one given by projName - * and select that as active projeciton in the GUI - * @param projName the name of the projection - */ - private void changeProjection(String projName) - { - //First get the projection object - AProjection p = AProjectionsManager.getProjection(projName); - //And set the projection - ACanvas.getCanvas().getCurrentWindow().setProjection(p); - //Make sure aspect ratio is always okay - if(projName.equals("YX")||projName.equals("RZ")||projName.equals("XZ")||projName.equals("YZ")) - ((AProjection2D) p).setAspectRatio1(ACanvas.getCanvas().getCurrentWindow()); - //Finally Change the current GUI selection by signaling the command processor - ACommandProcessor.receive(projName + "."); - } - - /** - * Switch to the next event - * @return if the return value is true, the loop will be continued, otherwise not - */ - private boolean changeEvent(){ - Frame gui = globals.getGuiFrame(); - //try reading the next event - try{ - //Then get next event - AEventManager eventManager = AEventManager.instance(); - eventManager.nextEvent(); - return true; - } catch (NoMoreEventsException ex) { - //Just wait for next event - logger.info("No next event for demo - "+((stopOnNoMoreEvents)?"stopping loop":"keeping same")); - //return wether loop shall be stopped due to this or not. - return (!stopOnNoMoreEvents); - } catch (InvalidEventSourceException ex) { - //log warning - logger.warn("Invalid event source for demo - " - +((stopOnNoMoreEvents)?"stopping loop":"will try again") - +"\n"+ex.getCauseMessages()); - //quit here in headless mode - if (AGlobals.isAtlantisHeadless()) return (!stopOnNoMoreEvents); - //Otherwise give a user warning - JOptionPane.showMessageDialog(gui, - "Invalid event source for demo - stopping loop", - "Warning", JOptionPane.WARNING_MESSAGE); - //Always quit the loop if not in headless mode - return false; - } catch (ReadEventException ex) { - //log warning - logger.warn("Received invalid event - stopping loop:\n"+ex.getCauseMessages()); - //and tell user unless we are in headless - if (AGlobals.isAtlantisHeadless()) return false; - //in headless mode, don't show a dialog - JOptionPane.showMessageDialog(gui, - "Received invalid event for demo - stopping loop", - "Warning", JOptionPane.WARNING_MESSAGE); - return false; - } - } -} - diff --git a/graphics/AtlantisJava/src/atlantis/gui/AEventLoopDialog.java b/graphics/AtlantisJava/src/atlantis/gui/AEventLoopDialog.java deleted file mode 100755 index 152bc9f5c2cd408a41b126f96c773a9751c3f451..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AEventLoopDialog.java +++ /dev/null @@ -1,346 +0,0 @@ -package atlantis.gui; - -import java.util.Date; - -import java.awt.Color; -import java.awt.Frame; -import java.awt.event.WindowListener; -import java.awt.event.WindowEvent; -import java.awt.event.ActionListener; -import java.awt.event.ActionEvent; -import java.awt.BorderLayout; -import java.awt.Dimension; - -import java.text.SimpleDateFormat; - -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.border.Border; -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JSpinner; -import javax.swing.SpinnerNumberModel; -import javax.swing.Timer; - -import atlantis.event.AEventManager; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.ReadEventException; -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.output.ALogInterface; -import atlantis.utils.ALogger; - - -/** - * Read events in a loop using a given timer intervall - * This is a singleton class using the getInstance pattern. - * - * @author Sebastian Boeser - */ -public class AEventLoopDialog extends JFrame - implements WindowListener, ActionListener, ChangeListener -{ - // the logger - private static ALogger logger = ALogger.getLogger(AEventLoopDialog.class); - - private static final AGlobals globals = AGlobals.instance(); - - //create singleton instance - private static AEventLoopDialog instance; - - // some GUI attributes - private static final String TITLE = "Event loop"; - private static final Integer SPINNER_INIT = new Integer(4); - private static final Integer SPINNER_MIN = new Integer(1); - private static final Integer SPINNER_MAX = new Integer(120); - private static final Integer SPINNER_STEP = new Integer(2); - - // We don't need more than one button - private static JButton button = null; - - //The update time in seconds - private static JSpinner updateIntervalSpinner = null; - //A logging pane - private static ALogPane log = null; - - // The update timer - private static final Timer timer = new Timer(SPINNER_INIT*1000,null); - - - private AEventLoopDialog() - { - //Create dialog with title - super(TITLE); - - //Construct GUI - createGUI(); - - } // AReadEventFromServerDialog() --------------------------------------- - - /** - * @return the singleton instance - */ - public static AEventLoopDialog getInstance(){ - if (instance == null) instance = new AEventLoopDialog(); - return instance; - } // getInstance() ------------------------------------------------------ - - - /** - * Non-static set functions so user is forced to obtain an instance first - * @param UpdateInterval the update intervall - */ - public void setUpdateInterval(int UpdateInterval) { - try { - updateIntervalSpinner.setValue(UpdateInterval); - } catch (IllegalArgumentException iae){ - //Just ignore in case of an invalid argument - } - } - - /** - * Design of the dialog - panels, buttons, etc - */ - private void createGUI() { - - //Definde default component gap - final int defaultGap = 5; - final Border defaultBorder = BorderFactory.createEmptyBorder(5, 10, 5, 10); - - /** - * Looping panel - */ - //Create a spinner for the update time - SpinnerNumberModel numberModel = new SpinnerNumberModel(SPINNER_INIT, SPINNER_MIN, SPINNER_MAX, SPINNER_STEP); - updateIntervalSpinner = new JSpinner(numberModel); - updateIntervalSpinner.addChangeListener(this); - - // looping panel - JPanel loopingPanel = new JPanel(); - loopingPanel.setLayout(new BorderLayout(defaultGap, 0)); - loopingPanel.setBorder(defaultBorder); - loopingPanel.add(updateIntervalSpinner, BorderLayout.CENTER); - loopingPanel.add(new JLabel("[secs]"), BorderLayout.EAST); - - - /** - * Main action buttons - */ - // action button panel - JPanel buttonsPanel = new JPanel(); - buttonsPanel.setLayout(new BorderLayout(0, 0)); - buttonsPanel.setBorder(defaultBorder); - button = new JButton("Start"); - //Set a preferred size so it doesn't change if we change its label - button.setPreferredSize(new Dimension(100,25)); - buttonsPanel.add(button, BorderLayout.CENTER); - //React when button is pressed - button.addActionListener(this); - - //the top row panel - JPanel topRowPanel = new JPanel(); - topRowPanel.setLayout(new BorderLayout(defaultGap, 0)); - topRowPanel.add(loopingPanel, BorderLayout.CENTER); - topRowPanel.add(buttonsPanel, BorderLayout.EAST); - - - - /** - * Logging panel - */ - // the logging panel at the bottom - JPanel logPanel = new JPanel(); - logPanel.setLayout(new BorderLayout(0, 0)); - logPanel.setBorder(defaultBorder); - //Add a logpane to it - log = new ALogPane(); - log.setEnabled(true); - log.setBorder(BorderFactory.createLineBorder(Color.black)); - log.setRequestFocusEnabled(false); - log.setPreferredSize(new Dimension(350, 200)); - logPanel.add(log, BorderLayout.CENTER); - - - // main panel - JPanel mainPanel = new JPanel(); - mainPanel.setLayout(new BorderLayout(0, 0)); - // logPanel must be CENTER to be resisable vertically (otherwise, - // it keeps its size), hence upper part must be extra panel for - // NORTH position to accommodate topRowPanel and loopingPanel - JPanel upperMainPanel = new JPanel(); - upperMainPanel.setLayout(new BorderLayout(0, 0)); - upperMainPanel.add(topRowPanel, BorderLayout.NORTH); - mainPanel.add(upperMainPanel, BorderLayout.NORTH); - mainPanel.add(logPanel, BorderLayout.CENTER); - - // Finally add this MainPanel - getContentPane().add(mainPanel, BorderLayout.CENTER); - - //arrange all GUI items - pack(); - - //Set location to top left GUI corner so it does not hide Canvas - setLocation(globals.getGuiFrame().getLocation()); - - //give it a nice icon when minimized - AIcon.setIconImage(this); - - - /** - * end of dialog design, set listeners and handlers - */ //add ourselfs as state listeners to catch closing - addWindowListener(this); - - //also set ourselfs as action handler for the timer - timer.addActionListener(this); - //And have the timer start immediately on the first event - timer.setInitialDelay(0); - - - - } // createGUI() -------------------------------------------------------- - - /** - * State change events are only generated by the updateIntervalSpinner - * @param e the Change event - */ - public void stateChanged(ChangeEvent e) { - //Set timer delay to new value - timer.setDelay((Integer)updateIntervalSpinner.getValue()*1000); - } - - /** - * Stop event loop when closing the window - * @param e the Window event - */ - public void windowClosing(WindowEvent e){ - - //Make sure the timer is not running anymore - if (timer.isRunning()) stopEventLoop(); - - } // closeActionsAndDispose() ------------------------------------------ - - /** - * Small helper to print a message with timestamp to the log - * @param msg the message - */ - private void timeStampedLog(String msg){ - - //Record the time of the incident - SimpleDateFormat dateForm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - log.append("\n"+dateForm.format(new Date())+" ",ALogInterface.NORMAL_BOLD); - log.append(msg); - } - - - /** - * Try to read the next event from the server, handle all exceptions - */ - private void getNextEvent() { - - //try reading the next event - try{ - //tell the user - timeStampedLog("Reading next event..."); - //Then get next event - AEventManager.instance().nextEvent(); - } catch (NoMoreEventsException ex) { - //Just wait for next event - log.append("\n -- No next event available"); - logger.info("No next event available:\n"+ex.getCauseMessages()); - } catch (InvalidEventSourceException ex) { - //Do not break loop on invalid event source -- good for ACR - log.append("\n -- Invalid event source"); - logger.warn("Invalid event source:\n"+ex.getCauseMessages()); - } catch (ReadEventException ex) { - //Don't break loop on invalid events - log.append("\n -- Received invalid event"); - logger.warn("Received invalid event:\n"+ex.getCauseMessages()); - } - } - - /** - * Stop the event loop, reenabling all GUI elements - */ - private void stopEventLoop(){ - - //Stop the timer loop - timer.stop(); - - //Reset button label and states - button.setText("Start"); - updateIntervalSpinner.setEnabled(true); - - //tell the user - timeStampedLog("Stopped event loop..."); - } - - /** - * Start the event loop, disable all GUI elements - is public to facilitate - * automated start of event loop (e.g with command-line options) - */ - public void startEventLoop(){ - - //tell the user - timeStampedLog("Starting event loop..."); - - //enable/disable buttons - updateIntervalSpinner.setEnabled(false); - button.setText("Stop"); - - //Stop the timer loop - timer.start(); - - } - - /** - * Called every time the button is hit or we get a callback from the timer - * @param e the action event - */ - public void actionPerformed(ActionEvent e) { - - //Check if we got called from the timer loop - if (e.getSource() == timer){ - //If so just read next event and return - getNextEvent(); - return; - } - - //Being called because button was hit. - //Check if event loop is running - stop it - if (timer.isRunning()) { - stopEventLoop(); - } else { - startEventLoop(); - } - } - - - /** - * Show the dialog - */ - public void showDialog() { - - // clear the iconified bit (no matter whether or not it is iconified) - setExtendedState(getExtendedState() & ~Frame.ICONIFIED); - setVisible(true); - - } // show() ---------------------------------------------------- - - - /** - * Empty default implementation of WindowListeners - * @param e - */ - public void windowOpened(WindowEvent e) {} - public void windowClosed(WindowEvent e) {} - public void windowIconified(WindowEvent e) {} - public void windowDeiconified(WindowEvent e) {} - public void windowActivated(WindowEvent e) {} - public void windowDeactivated(WindowEvent e) {} - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AEventPropertiesDialog.java b/graphics/AtlantisJava/src/atlantis/gui/AEventPropertiesDialog.java deleted file mode 100755 index 8b7a7a332781aa3a6cefe049101a4ce28c509c2d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AEventPropertiesDialog.java +++ /dev/null @@ -1,721 +0,0 @@ -package atlantis.gui; - -import java.awt.BorderLayout; -import java.awt.Font; -import java.awt.Frame; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; -import java.util.List; -import java.util.Vector; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTabbedPane; -import javax.swing.JTable; -import javax.swing.JScrollPane; - -import com.Ostermiller.util.CSVParser; - -import atlantis.data.ACalorimeterData; -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.data.ALVL1ResultData; -import atlantis.event.ANewEventListener; -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.graphics.layout.AFlowLayout; -import atlantis.data.ATriggerInfoData; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; - -/** - * The dialog which is used to display the current event properties. - */ -public class AEventPropertiesDialog extends JFrame implements ANewEventListener -{ - private static ALogger logger = ALogger.getLogger(AEventPropertiesDialog.class); - private static AEventManager eventManager = AEventManager.instance(); - - private JTable table, propertiesTable, level1Table, level2Table, - eventFilterTable, trigInfoItemsTable, trigInfoStreamTable, - userSelectedTable, mbtsTable; - private JPanel buttonsPanel; - private JTabbedPane tabbedPane; - private JButton okButton; - private JButton refreshButton; - private static AEventPropertiesDialog instance = null; - protected static String[] USER_ITEMS = null; - private static final String LOOKUP_FILENAME = "epusti.csv"; - private static final AGlobals globals = AGlobals.instance(); - private static final String LOOKUP_FILE = - globals.getHomeDirectory() + "configuration" + - System.getProperty("file.separator") + - LOOKUP_FILENAME; - - public static boolean isInUse() - { - if(instance ==null || !instance.isVisible()) - return false; - else - return true; - } - - public static AEventPropertiesDialog getInstance() - { - if (instance == null) - instance = new AEventPropertiesDialog(); - return instance; - } - - public AEventPropertiesDialog() - { - Frame gui = globals.getGuiFrame(); - eventManager.addNewEventListener(this); - this.setTitle("Event Properties Dialog"); - AIcon.setIconImage(this); - // setResizable(false); - - // From Java 1.5 we can tell the window to be always on top - this.setAlwaysOnTop(true); - - // check whether there is any event data are present - if (eventManager.getCurrentEvent() == null) - { - JOptionPane.showMessageDialog(gui, - "Current event is null\n" + "(no event data currently present)", - "Event null", JOptionPane.WARNING_MESSAGE); - return; - } - - try - { - readFromLookupFile(); - } - catch(AAtlantisException ex) - { - logger.warn(": reading " + LOOKUP_FILE + - " failed, user trigger items will not " + - "be available, reason: " + ex.getMessage(), ex); - } - - fillTabbedPane(0); - addButtonPane(); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - pack(); - - // set the initial location - int guiWidth = gui.getWidth(); - int guiHeight = gui.getHeight(); - int guiX = gui.getX(); - int dialogWidth = (int) this.getPreferredSize().getWidth(); - int dialogHeight = (int) this.getPreferredSize().getHeight(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit() - .getScreenSize().getWidth()); - if (guiX + guiWidth + (dialogWidth - guiWidth) / 2 > screenWidth) - this.setLocation(Math.max(0, screenWidth - dialogWidth), Math.max( - 0, (guiHeight - dialogHeight) / 3)); - else - this.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), - Math.max(0, (guiHeight - dialogHeight) / 3)); - - setVisible(true); - } - - private void readFromLookupFile() throws AAtlantisException - { - if(USER_ITEMS==null) - { - try - { - InputStream is = AUtilities.getFileAsStream(LOOKUP_FILE); - CSVParser parser = new CSVParser(is); - parser.setCommentStart("#"); - String valueArray = parser.nextValue(); // shall now contain all values - CSVParser parserArray = new CSVParser(new StringReader(valueArray)); - String[][] s = parserArray.getAllValues(); - if(s!=null) - { - USER_ITEMS = s[0]; - } - } - catch (IOException e) - { - throw new AAtlantisException("exception while reading file: " + - LOOKUP_FILE); - } - catch (AAtlantisException e) - { - throw e; - } - } - } - - - public void dispose() - { - instance = null; - super.dispose(); - } - - public void updatePane() - { - - JTabbedPane currentTabbedPane = (JTabbedPane) getContentPane().getComponent(0); - int currentIndex = currentTabbedPane.getSelectedIndex(); - getContentPane().removeAll(); - validate(); - - fillTabbedPane(currentIndex); - addButtonPane(); - - pack(); - } - - private void addButtonPane() - { - okButton = new JButton("OK"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { - dispose(); - } - }); - - // Add button to refresh data after cuts have been applied - refreshButton = new JButton("Refresh Cuts"); - refreshButton.setToolTipText("Display data passing cuts for active window"); - refreshButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { - updatePane(); - } - }); - - buttonsPanel = new JPanel(new AFlowLayout(10, 5)); - buttonsPanel.add(okButton); - buttonsPanel.add(refreshButton); - getContentPane().add(buttonsPanel, BorderLayout.SOUTH); - - - - } - - /** fills the tabbed pane with the event information - * @param index the currently selected index - */ - private void fillTabbedPane(int index) - { - fillTablePane(); - AEvent event = eventManager.getCurrentEvent(); - - //now need to loop over the lvl1result collections - Vector<String> keys = event.getCollections().get("LVL1Result"); - ALVL1ResultData lvl1ResultData[]=null; - if(keys!=null){ - lvl1ResultData = new ALVL1ResultData[keys.size()]; - for(int i=0; i<keys.size();i++) - { - String colLvl1= "LVL1Result" + (String)keys.elementAt(i); - lvl1ResultData[i] = (ALVL1ResultData) event.get(colLvl1); - } - } - - ATriggerInfoData triggerInfoData = event.getTriggerInfoData(); - fillPropertiesPane(lvl1ResultData, triggerInfoData); - String[][] L1_items = fillLevel1Pane(lvl1ResultData); - String[][] L2_items = fillLevel2Pane(lvl1ResultData); - String[][] EF_items = fillEventFilterPane(lvl1ResultData); - fillTrigInfoItemsPane(triggerInfoData); - fillTrigInfoStreamPane(triggerInfoData); - fillUserSelectedPane(L1_items, L2_items, EF_items); - fillmbtsPane(); - - tabbedPane = new JTabbedPane(); - tabbedPane.addTab("Number of Hits", new JScrollPane(table)); - tabbedPane.addTab("Properties", new JScrollPane(propertiesTable)); - tabbedPane.addTab("Level 1 Trigger Items", new JScrollPane(level1Table)); - tabbedPane.addTab("Level 2 Trigger Items", new JScrollPane(level2Table)); - tabbedPane.addTab("Event Filter Trigger Items", new JScrollPane(eventFilterTable)); - tabbedPane.addTab("Trigger Info Items", new JScrollPane(trigInfoItemsTable)); - tabbedPane.addTab("Trigger Info Stream Tag", new JScrollPane(trigInfoStreamTable)); - tabbedPane.addTab("User Selected Trigger Items", new JScrollPane(userSelectedTable)); - tabbedPane.addTab("All MBTS cell details", new JScrollPane(mbtsTable)); - tabbedPane.setSelectedIndex(index); - - getContentPane().setLayout(new BorderLayout()); - getContentPane().add(tabbedPane, BorderLayout.CENTER); - } - - private void fillTablePane() - { - // For total data and data passing cuts, use .getInfoDraw() - // for total event data, use getInfo() - table = new JTable(eventManager.getCurrentEvent().getInfoDraw(), - new String[] { "detector / datatype", "data items", "passing cuts" }) { - public boolean isCellEditable(int row, int column) { return false; } - }; - table.setRowHeight(20); - table.setFont(new Font("Monospaced", Font.PLAIN, 16)); - table.getColumnModel().getColumn(0).setPreferredWidth(350); - table.getColumnModel().getColumn(1).setPreferredWidth(100); - table.getColumnModel().getColumn(2).setPreferredWidth(100); - } - - private void fillPropertiesPane(ALVL1ResultData lvl1ResultData[], ATriggerInfoData triggerInfoData) - { - double et = 0; - List<ACalorimeterData> calo = eventManager.getCurrentEvent().getCalorimeters(); - - for (int i = 0; i < calo.size(); i++) - et += calo.get(i).getTotalTransverseEnergy(); - - String[][] properties; - - if (lvl1ResultData == null) - { - if(triggerInfoData==null) - { - properties = new String[2][2]; - properties[1][0] = "Trigger Decision"; - properties[1][1] = "N/A"; - } - else - { - properties = new String[7][2]; - properties[1][0] = "Trigger Decision"; - properties[1][1] = "N/A"; - properties[2][0] = "Trigger Info: Level 1 EtMiss"; - properties[2][1] = String.valueOf(triggerInfoData.getEnergyEtMiss(0)); - properties[3][0] = "Trigger Info: Level 1 SumEt"; - properties[3][1] = String.valueOf(triggerInfoData.getEnergyEtMiss(0)); - properties[4][0] = "Trigger Info: ExtL1ID"; - properties[4][1] = triggerInfoData.getTrigInfoExtL1ID(0); - properties[5][0] = "Trigger Info: Lvl1Type"; - properties[5][1] = triggerInfoData.getTrigInfoLvl1Type(0); - properties[6][0] = "Trigger Info: Status"; - properties[6][1] = triggerInfoData.getTrigInfoStatus(0); - - } - } - else - { - properties = new String[5*lvl1ResultData.length+6][2]; - - //output the trigger info: - properties[1][0] = "Trigger Info: Level 1 EtMiss"; - properties[2][0] = "Trigger Info: Level 1 SumEt"; - properties[3][0] = "Trigger Info: ExtL1ID"; - properties[4][0] = "Trigger Info: Lvl1Type"; - properties[5][0] = "Trigger Info: Status"; - - if(triggerInfoData!=null) - { - properties[1][1] = String.valueOf(triggerInfoData.getEnergyEtMiss(0)); - properties[2][1] = String.valueOf(triggerInfoData.getEnergySumEt(0)); - properties[3][1] = triggerInfoData.getTrigInfoExtL1ID(0); - properties[4][1] = triggerInfoData.getTrigInfoLvl1Type(0); - properties[5][1] = triggerInfoData.getTrigInfoStatus(0); - }else{ - properties[1][1] = "N/A"; - properties[2][1] = "N/A"; - properties[3][1] = "N/A"; - properties[4][1] = "N/A"; - properties[5][1] = "N/A"; - } - - for(int j=0; j<lvl1ResultData.length;j++){ - int ref=j*5;//reference to allow >1 collection in the list - String name=lvl1ResultData[j].getStoreGateKey(); - - properties[6+ref][0] = name + ": Level 1 result"; - properties[7+ref][0] = name + ": Level 2 result"; - properties[8+ref][0] = name + ": Event Filter result"; - properties[9+ref][0] = name + ": Level 1 EtMiss"; - properties[10+ref][0] = name + ": Level 1 SumEt"; - - int[] temp=new int[3]; - temp[0]=lvl1ResultData[j].getPassedL1(0); - temp[1]=lvl1ResultData[j].getPassedL2(0); - temp[2]=lvl1ResultData[j].getPassedEF(0); - for(int i=0;i<3;i++) - { - switch(temp[i]) - { - case -1: - properties[i+6+ref][1]="N/C"; - break; - case 0: - properties[i+6+ref][1]="failed"; - break; - case 1: - properties[i+6+ref][1]="passed"; - break; - default: - properties[i+6+ref][1]="N/A"; - } - } - float LVL1EtMiss=lvl1ResultData[j].getEnergyEtMiss(0); - float LVL1SumEt=lvl1ResultData[j].getEnergySumEt(0); - if(LVL1EtMiss>0) - properties[9+ref][1] = String.valueOf(LVL1EtMiss); - else - properties[9+ref][1] = "N/A"; - if(LVL1SumEt>0) - properties[10+ref][1] = String.valueOf(LVL1SumEt); - else - properties[10+ref][1] = "N/A"; - } - } - - //first item always Transv. Energy - properties[0][0] = "Transv. Energy (GeV)"; - properties[0][1] = String.format("%.2f",et); - - propertiesTable = new JTable(properties, new String[] { "Name", "Value" }) { - public boolean isCellEditable(int row, int column) { return false; } - }; - propertiesTable.setRowHeight(20); - propertiesTable.setFont(new Font("Monospaced", Font.PLAIN, 16)); - propertiesTable.getColumnModel().getColumn(0).setPreferredWidth(350); - propertiesTable.getColumnModel().getColumn(1).setPreferredWidth(100); - } - - private String[][] fillLevel1Pane(ALVL1ResultData lvl1ResultData[]) - { - String[][] properties; - - if (lvl1ResultData == null) - { - properties = new String[1][2]; - properties[0][0] = "N/A"; - properties[0][1] = "N/A"; - } - else - { - String[][] items=new String[lvl1ResultData.length][]; - String[][] prescales=new String[lvl1ResultData.length][]; - int numItems=0; - for(int j=0; j<lvl1ResultData.length;j++){ - items[j]=lvl1ResultData[j].getCtpItemListSplit(0,false); - prescales[j]=lvl1ResultData[j].getPrescaleListL1Split(0); - numItems+=items[j].length; - } - properties = new String[numItems][2]; - numItems=0; - for(int j=0; j<lvl1ResultData.length;j++){ - String name=lvl1ResultData[j].getStoreGateKey(); - for(int i=0; i<items[j].length; i++) - { - properties[numItems][0]= name + ": " + items[j][i]; - properties[numItems][1]=(prescales[j] != null && i<prescales[j].length) ? prescales[j][i]: "N/A"; - numItems++; - } - } - } - level1Table = new JTable(properties, new String[] { "Item passed", "Prescale"}) { - public boolean isCellEditable(int row, int column) { return false; } - }; - level1Table.setRowHeight(20); - level1Table.setFont(new Font("Monospaced", Font.PLAIN, 16)); - level1Table.getColumnModel().getColumn(0).setPreferredWidth(350); - level1Table.getColumnModel().getColumn(1).setPreferredWidth(100); - - return properties; - } - - private String[][] fillLevel2Pane(ALVL1ResultData lvl1ResultData[]) - { - String[][] properties; - - if (lvl1ResultData == null) - { - properties = new String[1][2]; - properties[0][0] = "N/A"; - properties[0][1] = "N/A"; - } - else - { - String[][] items=new String[lvl1ResultData.length][]; - String[][] prescales=new String[lvl1ResultData.length][]; - int numItems=0; - for(int j=0; j<lvl1ResultData.length;j++){ - items[j]=lvl1ResultData[j].getitemListL2Split(0,false); - prescales[j]=lvl1ResultData[j].getPrescaleListL2Split(0); - numItems+=items[j].length; - } - properties = new String[numItems][2]; - numItems=0; - for(int j=0; j<lvl1ResultData.length;j++){ - String name=lvl1ResultData[j].getStoreGateKey(); - for(int i=0; i<items[j].length; i++) - { - properties[numItems][0]= name + ": " + items[j][i]; - properties[numItems][1]=(prescales[j] != null && i<prescales[j].length) ? prescales[j][i]: "N/A"; - numItems++; - } - } - } - level2Table = new JTable(properties, new String[] { "Item passed", "Prescale" }) { - public boolean isCellEditable(int row, int column) { return false; } - }; - level2Table.setRowHeight(20); - level2Table.setFont(new Font("Monospaced", Font.PLAIN, 16)); - level2Table.getColumnModel().getColumn(0).setPreferredWidth(350); - level2Table.getColumnModel().getColumn(1).setPreferredWidth(100); - - return properties; - } - - private String[][] fillEventFilterPane(ALVL1ResultData lvl1ResultData[]) - { - String[][] properties; - - if (lvl1ResultData == null) - { - properties = new String[1][2]; - properties[0][0] = "N/A"; - properties[0][1] = "N/A"; - } - else - { - String[][] items=new String[lvl1ResultData.length][]; - String[][] prescales=new String[lvl1ResultData.length][]; - int numItems=0; - for(int j=0; j<lvl1ResultData.length;j++){ - items[j]=lvl1ResultData[j].getitemListEFSplit(0,false); - prescales[j]=lvl1ResultData[j].getPrescaleListEFSplit(0); - numItems+=items[j].length; - } - properties = new String[numItems][2]; - numItems=0; - for(int j=0; j<lvl1ResultData.length;j++){ - String name=lvl1ResultData[j].getStoreGateKey(); - for(int i=0; i<items[j].length; i++) - { - properties[numItems][0]= name + ": " + items[j][i]; - properties[numItems][1]=(prescales[j] != null && i<prescales[j].length) ? prescales[j][i]: "N/A"; - numItems++; - } - } - } - eventFilterTable = new JTable(properties, new String[] { "Item passed", "Prescale" }) { - public boolean isCellEditable(int row, int column) { return false; } - }; - eventFilterTable.setDefaultEditor(String.class, null); - eventFilterTable.setRowHeight(20); - eventFilterTable.setFont(new Font("Monospaced", Font.PLAIN, 16)); - eventFilterTable.getColumnModel().getColumn(0).setPreferredWidth(350); - eventFilterTable.getColumnModel().getColumn(1).setPreferredWidth(100); - - return properties; - } - - private void fillTrigInfoItemsPane(ATriggerInfoData triggerInfoData) - { - String[][] properties; - - if (triggerInfoData == null) - { - properties = new String[1][3]; - properties[0][0] = "N/A"; - properties[0][1] = "N/A"; - properties[0][2] = "N/A"; - } - else - { - String[] itemsL1=triggerInfoData.getTrigInfoL1SplitHex(0); - String[] itemsL2=triggerInfoData.getTrigInfoL2SplitHex(0); - String[] itemsEF=triggerInfoData.getTrigInfoEFSplitHex(0); - //find list with largest amount of items - int items = Math.max(Math.max(itemsL1.length, itemsL2.length),itemsEF.length); - properties = new String[items][3]; - for(int i=0; i<items; i++) - { - properties[i][0]= (i<itemsL1.length) ? itemsL1[i] : ""; - properties[i][1]= (i<itemsL2.length) ? itemsL2[i] : ""; - properties[i][2]= (i<itemsEF.length) ? itemsEF[i] : ""; - } - } - trigInfoItemsTable = new JTable(properties, new String[] { "L1", "L2", "EF" }) { - public boolean isCellEditable(int row, int column) { return false; } - }; - trigInfoItemsTable.setRowHeight(20); - trigInfoItemsTable.setFont(new Font("Monospaced", Font.PLAIN, 16)); - trigInfoItemsTable.getColumnModel().getColumn(0).setPreferredWidth(100); - trigInfoItemsTable.getColumnModel().getColumn(1).setPreferredWidth(100); - trigInfoItemsTable.getColumnModel().getColumn(1).setPreferredWidth(100); - - } - - private void fillTrigInfoStreamPane(ATriggerInfoData triggerInfoData) - { - String[][] properties; - - if (triggerInfoData == null) - { - properties = new String[1][1]; - properties[0][0] = "N/A"; - } - else - { - String[] items=triggerInfoData.getTrigInfoStreamTagSplit(0); - properties = new String[items.length][1]; - for(int i=0; i<items.length; i++) - { - properties[i][0]=items[i]; - } - } - trigInfoStreamTable = new JTable(properties, new String[] { "Stream Tag"}) { - public boolean isCellEditable(int row, int column) { return false; } - }; - trigInfoStreamTable.setRowHeight(20); - trigInfoStreamTable.setFont(new Font("Monospaced", Font.PLAIN, 16)); - trigInfoStreamTable.getColumnModel().getColumn(0).setPreferredWidth(450); - } - - private void fillUserSelectedPane(String[][] L1_items, String[][] L2_items, String[][] EF_items) - { - String[][] properties; - if (USER_ITEMS==null) - { - properties = new String[1][2]; - properties[0][0] = "Please add items to: " + LOOKUP_FILENAME; - properties[0][1] = "N/A"; - } - else - { - Vector<String> v_c1 = new Vector<String>();//column 1 - item - Vector<String> v_c2 = new Vector<String>();//column 2 - prescales - Vector<String> v_u = new Vector<String>();//user items - for(int i=0; i<USER_ITEMS.length; i++) - { - v_u.add(USER_ITEMS[i]); - } - //loop over L1 items - for(int j=0; j<L1_items.length; j++) - { - for(int i=0; i<v_u.size(); i++) - { - if(v_u.elementAt(i).equals(L1_items[j][0])) - { - v_c1.add(L1_items[j][0]); - v_c2.add(L1_items[j][1]); - v_u.remove(i); - } - } - } - //if still have user items left loop over L2 - if(v_u.size()>0) - { - for(int j=0; j<L2_items.length; j++) - { - for(int i=0; i<v_u.size(); i++) - { - if(v_u.elementAt(i).equals(L2_items[j][0])) - { - v_c1.add(L2_items[j][0]); - v_c2.add(L2_items[j][1]); - v_u.remove(i); - } - } - } - } - //if still have user items left loop over EF - if(v_u.size()>0) - { - for(int j=0; j<EF_items.length; j++) - { - for(int i=0; i<v_u.size(); i++) - { - if(v_u.elementAt(i).equals(EF_items[j][0])) - { - v_c1.add(EF_items[j][0]); - v_c2.add(EF_items[j][1]); - v_u.remove(i); - } - } - } - } - //now store items in String[][] - properties = new String[v_c1.size()][2]; - for(int i=0; i<v_c1.size(); i++) - { - properties[i][0]=v_c1.elementAt(i).toString(); - properties[i][1]=v_c2.elementAt(i).toString(); - } - } - userSelectedTable = new JTable(properties, new String[] { "Item passed", "Prescale" }) { - public boolean isCellEditable(int row, int column) { return false; } - }; - userSelectedTable.setRowHeight(20); - userSelectedTable.setFont(new Font("Monospaced", Font.PLAIN, 16)); - userSelectedTable.getColumnModel().getColumn(0).setPreferredWidth(350); - userSelectedTable.getColumnModel().getColumn(1).setPreferredWidth(100); - } - - private void fillmbtsPane() - { - ACalorimeterData calorimeter=null; - List<ACalorimeterData> detectors = eventManager.getCurrentEvent().getCalorimeters(); - for (int det = 0; det < detectors.size(); det++) - { - ACalorimeterData testcalorimeter = detectors.get(det); - if (!testcalorimeter.getName().equals("MBTS")) continue; - if(testcalorimeter.getNumData()>0) calorimeter=testcalorimeter; - } - - - String[][] properties; - if (calorimeter==null) - { - properties = new String[1][5]; - properties[0][0] = "N/A"; - properties[0][1] = "N/A"; - properties[0][2] = "N/A"; - properties[0][3] = "N/A"; - properties[0][4] = "N/A"; - } - else - { - properties = new String[calorimeter.getNumData()][5]; - //AMBTSData mbtsdata = calorimeter.eta[i]; - for (int i = 0; i < calorimeter.getNumData(); ++i) - { - properties[i][0] = "" + i; - properties[i][1] = "" + String.format("%.3f",(calorimeter.getET(i))); - properties[i][2] = "" + String.format("%.1f",calorimeter.getEta(i)); - properties[i][3] = "" + String.format("%.1f",calorimeter.getPhi(i)); - properties[i][4] = "" + calorimeter.getSampling(i); - } - } - mbtsTable = new JTable(properties, new String[] { "Index", "Energy (MeV)", "Type", "Module", "Channel" }) { - public boolean isCellEditable(int row, int column) { return false; } - }; - mbtsTable.setRowHeight(20); - mbtsTable.setFont(new Font("Monospaced", Font.PLAIN, 16)); - mbtsTable.getColumnModel().getColumn(0).setPreferredWidth(90); - mbtsTable.getColumnModel().getColumn(1).setPreferredWidth(90); - mbtsTable.getColumnModel().getColumn(2).setPreferredWidth(90); - mbtsTable.getColumnModel().getColumn(3).setPreferredWidth(90); - mbtsTable.getColumnModel().getColumn(4).setPreferredWidth(90); - } - - /** - * Implementing NewEvent listener - * @param event the new event - */ - public void newEvent(AEvent event) { - if (isInUse()) updatePane(); - } - - - - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AEventQueue.java b/graphics/AtlantisJava/src/atlantis/gui/AEventQueue.java deleted file mode 100755 index 081e214dd295f4d6caab58c7c78e15292a577e9c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AEventQueue.java +++ /dev/null @@ -1,165 +0,0 @@ -package atlantis.gui; - -import java.awt.EventQueue; -import java.awt.AWTEvent; -import java.awt.Frame; -import java.awt.event.KeyEvent; -import atlantis.parameters.APar; -import atlantis.canvas.ACanvas; -import atlantis.data.AG4StepData; -import atlantis.event.AEventManager; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; -import atlantis.globals.AGlobals; -import atlantis.interactions.AModifier; -import javax.swing.JOptionPane; -import atlantis.utils.ALogger; - -/** - * Because we use Mouse Actions and Keyboard Modifiers (letters) we need a way of - * getting all the keyboard events independent of the focussed compenent. This is - * done by catching them directly from the Event Queue. So, we just replace the - * default Java Queue by this one. - */ -public class AEventQueue extends EventQueue { - - /** - * Contains the code of the key (is some key is pressed) - * or KeyEvent.VK_UNDEFINED if no key is holded down. - */ - private static int keyboardState; - private static AModifier defInt = new AModifier(KeyEvent.VK_UNDEFINED, false, ""); - - private KeyEvent keyEvent; - - private final static ALogger logger = ALogger.getLogger(AEventQueue.class); - private static AEventManager eventManager = AEventManager.instance(); - - private static boolean isRightMouseButton; - - protected static APar parameterStore = APar.instance(); - - private static final AGlobals globals = AGlobals.instance(); - - public static int getKeyboardState() { - int ret = 0; - - if (keyboardState == KeyEvent.VK_UNDEFINED) { - ret = defInt.getKeyCode(); - } else { - ret = keyboardState; - } - - // Bit of a hack because fastzoom is handled differently from other - // interactions - if (ret == KeyEvent.VK_F) { - parameterStore.get("Projection", "SkipData").setStatus(true); - } else { - parameterStore.get("Projection", "SkipData").setStatus(false); - } - - return ret; - } - - public static AModifier getDefault() { - return defInt; - } - - public static void setDefault(AModifier mod) { - defInt = mod; - - } - - public static int getKeyboardDefault() { - return defInt.getKeyCode(); - } - - public static boolean getIntRightMouseButton() { - if (keyboardState == KeyEvent.VK_UNDEFINED) { - // Non-default action selected, use the right click option from it - return defInt.getRightClick() || isRightMouseButton; - } else { - return isRightMouseButton; - } - } - - // FIXME: isRightMouseButton sometimes has spurious true value: see Trac #488 - protected void dispatchEvent(AWTEvent event) { - Frame gui = globals.getGuiFrame(); - super.dispatchEvent(event); - - if(event instanceof KeyEvent) { - keyEvent=(KeyEvent)event; -// this is the right mouse click on single mouse button mac's - switch(keyEvent.getID()) { - case KeyEvent.KEY_PRESSED: - if(keyEvent.getKeyCode()==17) { - isRightMouseButton=true; - return; - } - keyboardState=keyEvent.getKeyCode(); - //atlantis.utils.AOutput.append(" key pressed :" + keyboardState + ":\n", atlantis.utils.ALogPane.NORMAL_BOLD); - - if (keyEvent.getKeyCode()==33){//page up - System.out.println("Go to previous event"); - try { - eventManager.previousEvent(); - } catch (NoMoreEventsException nme) { - String msg = "Already at first event from this source!"; - JOptionPane.showMessageDialog(gui, msg, "No more events", JOptionPane.ERROR_MESSAGE); - logger.warn(nme.getCauseMessages()); - } catch (InvalidEventSourceException ies) { - String msg = "Not a valid event source - please select one!"; - JOptionPane.showMessageDialog(gui, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.warn(ies.getCauseMessages()); - } catch (ReadEventException ree) { - String msg = "Can not read event(s)!"; - JOptionPane.showMessageDialog(gui, msg, "Read error", JOptionPane.ERROR_MESSAGE); - logger.warn(ree.getCauseMessages()); - } - } - if (keyEvent.getKeyCode()==34) {//page down - System.out.println("Go to next event"); - try { - eventManager.nextEvent(); - } catch (NoMoreEventsException nme) { - String msg = "Already at last event from this source!"; - JOptionPane.showMessageDialog(gui, msg, "No more events", JOptionPane.ERROR_MESSAGE); - logger.warn(nme.getCauseMessages()); - } catch (InvalidEventSourceException ies) { - String msg = "Not a valid event source - please select one!"; - JOptionPane.showMessageDialog(gui, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.warn(ies.getCauseMessages()); - } catch (ReadEventException ree) { - String msg = "Can not read event(s)!"; - JOptionPane.showMessageDialog(gui, msg, "Read error", JOptionPane.ERROR_MESSAGE); - logger.warn(ree.getCauseMessages()); - } - } - - if (keyEvent.getKeyCode()==47) {// "/" - AG4StepData.ReadG4Steps(); - }//key "/" - - if (keyEvent.getKeyCode() == KeyEvent.VK_F) { - parameterStore.get("Projection", "SkipData").setStatus(true); - } - break; - - case KeyEvent.KEY_RELEASED: - if (keyEvent.getKeyCode() == 17) { - isRightMouseButton = false; - return; - } - keyboardState = KeyEvent.VK_UNDEFINED; - if (keyEvent.getKeyCode() == KeyEvent.VK_F) { - parameterStore.get("Projection", "SkipData").setStatus(false); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - } - break; - } - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AEventSourceToolBar.java b/graphics/AtlantisJava/src/atlantis/gui/AEventSourceToolBar.java deleted file mode 100644 index 8f5534a6dd52396dbb6be2d4926f16266500c50c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AEventSourceToolBar.java +++ /dev/null @@ -1,523 +0,0 @@ - -package atlantis.gui; - -import atlantis.config.ADefaultValues; -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.event.AEventSource; -import atlantis.event.ANewEventSourceListener; -import atlantis.event.AURLEventSource; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NavigationMode; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; -import atlantis.event.AStreamedEventSource; -import atlantis.event.AStreamedEventSource.InvalidStreamException; -import atlantis.globals.AGlobals; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Vector; -import javax.swing.Box; -import javax.swing.ButtonGroup; -import javax.swing.DefaultComboBoxModel; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.JRadioButton; -import javax.swing.JTextField; -import javax.swing.JToolBar; -import javax.swing.event.PopupMenuEvent; -import javax.swing.event.PopupMenuListener; - -/** - * This toolbar contains all the elements to set a new event source or stream, - * browse through the events or set the event navigation mode - * @author maillard - * @author sboeser - */ -class AEventSourceToolBar extends JToolBar implements ANewEventSourceListener { - - /** The text field that allows us to enter a new event source */ - private JTextField addressBar; - - /** The event stream selection combo box */ - private JComboBox eventStreamComboBox; - - /** The radio buttons that allow to select the event navigation mode */ - private JRadioButton randomButton, sequentialButton, loopButton; - - /** The logger */ - private final static ALogger logger = ALogger.getLogger(AEventSourceToolBar.class); - - private static AEventManager eventManager = AEventManager.instance(); - - /** Spacing between components in the toolbar */ - private static int SPACE = 4; - - /** - * Constructor - */ - public AEventSourceToolBar() { - - //call parent constructor - super(); - - setFloatable(false); - - //Get the path to the icon files - String iconPath = AGlobals.instance().getHomeDirectory()+"img"+System.getProperty("file.separator"); - - // setting up the 'open file' button - ImageIcon openIcon = AUtilities.getFileAsImageIcon(iconPath+"toolbar_open.png"); - JButton openFile = new JButton(openIcon); - openFile.setVerticalTextPosition(JButton.BOTTOM); - openFile.setHorizontalTextPosition(JButton.CENTER); - openFile.setMargin(new Insets(2, 2, 2, 2)); - openFile.setToolTipText("Open local file"); - // And add an action listener for it - openFile.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - openFileButtonAction(); - } - }); - // adding the open file button to the toolbar - - add(Box.createHorizontalStrut(SPACE)); - add(openFile); - add(Box.createHorizontalStrut(SPACE)); - - // setting up the address bar - addressBar = new JTextField(30); - // and an action listener - addressBar.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - addressBarAction((JTextField)e.getSource()); - } - }); - // adding the address bar to the toolbar - add(addressBar); - - //Set up previous and next buttons - ImageIcon nextIcon = AUtilities.getFileAsImageIcon(iconPath+"toolbar_next.png"); - ImageIcon previousIcon = AUtilities.getFileAsImageIcon(iconPath+"toolbar_previous.png"); - - JButton nextButton = new JButton(nextIcon); - JButton previousButton = new JButton(previousIcon); - - //customize and add action listener for next - nextButton.setName("nextButton"); - nextButton.setVerticalTextPosition(JButton.BOTTOM); - nextButton.setHorizontalTextPosition(JButton.CENTER); - nextButton.setMargin(new Insets(2, 2, 2, 2)); - nextButton.setToolTipText("Next event (PageDown)"); - nextButton.addActionListener(new ActionListener(){ - public void actionPerformed(ActionEvent e){ - nextButtonAction(); - } - }); - - //customize and add action listener for previous - previousButton.setName("previousButton"); - previousButton.setVerticalTextPosition(JButton.BOTTOM); - previousButton.setHorizontalTextPosition(JButton.CENTER); - previousButton.setMargin(new Insets(2, 2, 2, 2)); - previousButton.setToolTipText("Previous event (PageUp)"); - previousButton.addActionListener(new ActionListener(){ - public void actionPerformed(ActionEvent e){ - previousButtonAction(); - } - }); - //Add both to toolbar - add(Box.createHorizontalStrut(SPACE)); - add(previousButton); - add(nextButton); - add(Box.createHorizontalStrut(SPACE)); - - //Next add a seperator - addSeparator(); - - //Add a combo box, but set it to invisble - String[] streamNames = { "--n/a--" }; - eventStreamComboBox = new JComboBox(streamNames); - eventStreamComboBox.setVisible(false); - add(eventStreamComboBox); - - // set up the navigation mode button icons - ImageIcon sequentialIcon = AUtilities.getFileAsImageIcon(iconPath+"mode_sequential.png"); - ImageIcon loopIcon = AUtilities.getFileAsImageIcon(iconPath+"mode_loop.png"); - ImageIcon randomIcon = AUtilities.getFileAsImageIcon(iconPath+"mode_random.png"); - ImageIcon sequentialIconOn = AUtilities.getFileAsImageIcon(iconPath+"mode_sequential_on.png"); - ImageIcon loopIconOn = AUtilities.getFileAsImageIcon(iconPath+"mode_loop_on.png"); - ImageIcon randomIconOn = AUtilities.getFileAsImageIcon(iconPath+"mode_random_on.png"); - - //put these buttons in a group - ButtonGroup group = new ButtonGroup(); - // sequential mode - sequentialButton = new JRadioButton(sequentialIcon); - sequentialButton.setOpaque(false); - sequentialButton.setSelectedIcon(sequentialIconOn); - sequentialButton.setToolTipText("Sequential mode"); - sequentialButton.setName("Sequential mode"); - // loop mode - loopButton = new JRadioButton(loopIcon); - loopButton.setSelectedIcon(loopIconOn); - loopButton.setOpaque(false); - loopButton.setToolTipText("Loop mode"); - loopButton.setName("Loop mode"); - // random mode - randomButton = new JRadioButton(randomIcon); - randomButton.setOpaque(false); - randomButton.setSelectedIcon(randomIconOn); - randomButton.setToolTipText("Random mode"); - randomButton.setName("Random mode"); - // the mode buttons are initially disabled, since we - // don't know which event source will be loaded first - sequentialButton.setEnabled(false); - loopButton.setEnabled(false); - randomButton.setEnabled(false); - - // when one of the buttons is pressed, set the required display mode - sequentialButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - navigationModeAction(NavigationMode.SEQUENTIAL); - } - }); - - loopButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - navigationModeAction(NavigationMode.LOOP); - } - }); - - randomButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - navigationModeAction(NavigationMode.RANDOM); - } - }); - //Add all buttons to the group - group.add(sequentialButton); - group.add(loopButton); - group.add(randomButton); - - add(sequentialButton); - add(loopButton); - add(randomButton); - } - - /** - * Called whenever the event text field changed - */ - private synchronized void addressBarAction(JTextField tf){ - - //Get the new text - String sourceName = tf.getText(); - - // if sourceName is a local path but doesn't provide an [type]://, - // prepend file:// as default - if(! sourceName.contains("://")) sourceName = "file://" + sourceName; - try { - eventManager.setEventSource(sourceName); - eventManager.nextEvent(); - } catch (NoMoreEventsException nme) { - JOptionPane.showMessageDialog(this, "No more events found from this source!", "No more events", JOptionPane.ERROR_MESSAGE); - logger.warn(nme.getCauseMessages()); - } catch (InvalidEventSourceException ies) { - JOptionPane.showMessageDialog(this, "Not a valid event source: "+sourceName, "Invalid event source", JOptionPane.ERROR_MESSAGE); - logger.error(ies.getCauseMessages()); - } catch (ReadEventException ree ){ - JOptionPane.showMessageDialog(this, "Cannot read event(s).", "Read error", JOptionPane.ERROR_MESSAGE); - logger.warn(ree.getCauseMessages()); - } - } - - /** - * Called whenever the previous button is pressed - */ - private synchronized void previousButtonAction(){ - - try { - eventManager.previousEvent(); - } catch (NoMoreEventsException nme) { - String msg = "Already at first event from this source!"; - JOptionPane.showMessageDialog(this, msg, "No more events", JOptionPane.ERROR_MESSAGE); - logger.warn(nme.getCauseMessages()); - } catch (InvalidEventSourceException ies ){ - String msg = "Not a valid event source - please select one!"; - JOptionPane.showMessageDialog(this, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.warn(ies.getCauseMessages()); - } catch (ReadEventException ree ){ - String msg = "Can not read event(s)!"; - JOptionPane.showMessageDialog(this, msg, "Read error", JOptionPane.ERROR_MESSAGE); - logger.warn(ree.getCauseMessages()); - } - refreshAddressBar(); - } - - /** - * Called whenever the next button is pressed - */ - private synchronized void nextButtonAction(){ - try { - eventManager.nextEvent(); - } catch (NoMoreEventsException nme) { - String msg = "Already at last event from this source!"; - JOptionPane.showMessageDialog(this, msg, "No more events", JOptionPane.ERROR_MESSAGE); - logger.warn(nme.getCauseMessages()); - } catch (InvalidEventSourceException ies ){ - String msg = "Not a valid event source - please select one!"; - JOptionPane.showMessageDialog(this, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.warn(ies.getCauseMessages()); - } catch (ReadEventException ree ){ - String msg = "Can not read event(s)!"; - JOptionPane.showMessageDialog(this, msg, "Read error", JOptionPane.ERROR_MESSAGE); - logger.warn(ree.getCauseMessages()); - } - refreshAddressBar(); - } - - /** - * Update the address bar to show the current event source - */ - private synchronized void refreshAddressBar(){ - AEventSource source = eventManager.getEventSource(); - AEvent event = eventManager.getCurrentEvent(); - if (source != null && event != null) { - // if the source is a URL, we should always use '/' as the separator - // else we'll use the system file separator - if (source instanceof AURLEventSource) { - addressBar.setText(source.getSourceName() + "/" + event.getSourceName()); - } else { - addressBar.setText(source.getSourceName() + System.getProperty("file.separator") + event.getSourceName()); - } - } - } - - /** - * Open a file dialog and read the selected event or directory - */ - private synchronized void openFileButtonAction(){ - //get the last location from the default values - String lastLoc = ADefaultValues.get("LastEventFilesSourceDir"); - //Create a file chooser dialog - AReadFileChooser fileDialog = new AReadFileChooser(lastLoc); - //Check if the user pressed ok in the dialog - if ( fileDialog.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { - //Get the selected file path, prepend file:// - String fullFilePath = "file://" + fileDialog.getSelectedFile().getPath(); - - try { - //Now set this as a new event source - eventManager.setEventSource(fullFilePath); - eventManager.nextEvent(); - } catch (NoMoreEventsException nme) { - String msg = "No events found from this source!"; - JOptionPane.showMessageDialog(this, msg, "No more events", JOptionPane.ERROR_MESSAGE); - logger.warn(nme.getCauseMessages()); - } catch (InvalidEventSourceException ies ){ - String msg = "Not a valid event source"; - JOptionPane.showMessageDialog(this, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.warn(ies.getCauseMessages()); - } catch (ReadEventException ree ){ - String msg = "Can not read event(s)"; - JOptionPane.showMessageDialog(this, msg, "Read error", JOptionPane.ERROR_MESSAGE); - logger.warn(ree.getCauseMessages()); - } - } // okay pressed - otherwise do nothing - } // openFileButtonAction() ---------------------------------------------------- - - /** - * Called whenever the navigation mode is changed in the GUI - */ - private synchronized void navigationModeAction( NavigationMode mode ){ - try { - eventManager.setNavigationMode(mode); } - catch (InvalidEventSourceException ies) { - JOptionPane.showMessageDialog(this, ies.getCauseMessages(), "Invalid navigation mode", JOptionPane.ERROR_MESSAGE); - } - } - - /** - * Called whenever the event stream is changed in the GUI - */ - private synchronized void selectedStreamAction(AStreamedEventSource source){ - - //Get the newly selected stream - String stream = (String) eventStreamComboBox.getSelectedItem(); - - try { - //Try to set a new stream - source.setStream(stream); - //Also get a new event - eventManager.nextEvent(); - //And update the event source field - refreshAddressBar(); - - } catch (NoMoreEventsException nme){ - //In case we already have the latest event from this stream - ignore - } catch (InvalidStreamException ise) { - //This can happen if the stream list changes inbetween - //opening the popup and selecting an item - String msg = "Cannot set stream '"+stream+"' for event source"; - JOptionPane.showMessageDialog(this, msg, "Invalid stream", JOptionPane.ERROR_MESSAGE); - logger.error(msg+"\n"+ise.getCauseMessages()); - //Also clear the stream list - eventStreamComboBox.removeAllItems(); - } catch (InvalidEventSourceException ies) { - //This can happen if the source turned invalid inbetween - //opening the popup and selecting an item - String msg = "Invalid event source when setting new stream"; - JOptionPane.showMessageDialog(this, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.error(msg+"\n"+ies.getCauseMessages()); - //Also clear the stream list - eventStreamComboBox.removeAllItems(); - } catch (ReadEventException ree){ - //Do nothing special with stream list in this case - String msg = "Can not read event from new stream '"+stream+"'"; - JOptionPane.showMessageDialog(this, msg, "Invalid event", JOptionPane.ERROR_MESSAGE); - logger.error(msg+"\n"+ree.getCauseMessages()); - } - - } - - /** - * This is called whenever the event stream combo is poped up - * Use this to update the event list every time - */ - private synchronized void updateEventStreamCombo(AStreamedEventSource eventSource){ - /** - * NOTE: We are NOT using "removeAllItems" + "addItems" to update the - * combo box as this will always fire a new ActionEvent with the first - * added Item. The proper way to do is to change the data model, as the - * new data model will only fire AFTER the user selected from the open - * ComboBox. - */ - - //Create an empty list - Vector<String> streamNames = new Vector<String>(); - - try { - //Get the stream names - streamNames = eventSource.getAvailableStreams(); - } catch (InvalidEventSourceException ies) { - //If we fail to update the list show some messages - //NOTE: we can not show dialog here, as this will steal the focus - // from the combo box, so it does not pop-down later on - String msg = "Invalid event source when getting stream list"; - //JOptionPane.showMessageDialog(this, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.error(msg+"\n"+ies.getCauseMessages()); - } - - //In any case update the stream list by setting a new data model - // -- even if it is empty - finally { - //Create a new data model - DefaultComboBoxModel newDataModel = new DefaultComboBoxModel(streamNames); - //Select the same stream we had before, if its still there - newDataModel.setSelectedItem(eventStreamComboBox.getSelectedItem()); - //Now install the new DataModel - eventStreamComboBox.setModel(newDataModel); - } - } - - /** - * This implementation of the ANewEventSourceListener gets called whenever - * the event source changes in AEventManager - * @param eventSource the new event source (final as being bound by combo action listener) - */ - public synchronized void newEventSource(final AEventSource eventSource) { - - //Stream selection is off by default - eventStreamComboBox.setVisible(false); - - //Check if this event source supports streams - if (eventSource instanceof AStreamedEventSource){ - - AStreamedEventSource streamedSource = (AStreamedEventSource) eventSource; - - //Update the list in the event stream combo box - updateEventStreamCombo(streamedSource); - - //Temporarily remove all the update handler - for (ActionListener al : eventStreamComboBox.getActionListeners()) - eventStreamComboBox.removeActionListener(al); - for (PopupMenuListener pml : eventStreamComboBox.getPopupMenuListeners()) - eventStreamComboBox.removePopupMenuListener(pml); - - try { - //Now right away select the stream given by the event source - eventStreamComboBox.setSelectedItem(((AStreamedEventSource) eventSource).getStream()); - } catch (InvalidEventSourceException ies) { - //If we fail to update the list show some messages - String msg = "Invalid event source when getting stream list"; - JOptionPane.showMessageDialog(this, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.error(msg+"\n"+ies.getCauseMessages()); - } catch (NoMoreEventsException nme) { - //If we fail to update the list show some messages - String msg = "No streams (yet) available for this source"; - JOptionPane.showMessageDialog(this, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.error(msg+"\n"+nme.getCauseMessages()); - } - - //(Re-)set the update handler - eventStreamComboBox.addActionListener( new ActionListener () { - public void actionPerformed(ActionEvent e) { - selectedStreamAction((AStreamedEventSource)eventSource); - } - }); - - //Also have the combobox update its item list every time the - //popup is selected - eventStreamComboBox.addPopupMenuListener(new PopupMenuListener(){ - //update stream list when popup appears - public void popupMenuWillBecomeVisible(PopupMenuEvent e) { - updateEventStreamCombo((AStreamedEventSource)eventSource); - } - //Do nothing in other cases - public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {} - public void popupMenuCanceled(PopupMenuEvent e) {} - } - ); - - //Finally make it visible - eventStreamComboBox.setVisible(true); - } - - //And repaint to show/hide the combo box - repaint(); - - // disable all the mode buttons - sequentialButton.setEnabled(false); - loopButton.setEnabled(false); - randomButton.setEnabled(false); - - // enable the modes that are supported by the current event source - // and mark the current display mode as active - if(eventSource.supportsNavigationMode(NavigationMode.SEQUENTIAL)) { - if(eventSource.getNavigationMode() == NavigationMode.SEQUENTIAL) - sequentialButton.setSelected(true); - sequentialButton.setEnabled(true); - } - - if(eventSource.supportsNavigationMode(NavigationMode.LOOP)) { - if(eventSource.getNavigationMode() == NavigationMode.LOOP) - loopButton.setSelected(true); - loopButton.setEnabled(true); - } - - if(eventSource.supportsNavigationMode(NavigationMode.RANDOM)) { - if(eventSource.getNavigationMode() == NavigationMode.RANDOM) - randomButton.setSelected(true); - randomButton.setEnabled(true); - } - - // change the address in the address bar to the current event source - refreshAddressBar(); - - } // newEventSource() ----------------------------------------------------- -} - diff --git a/graphics/AtlantisJava/src/atlantis/gui/AFileControl.java b/graphics/AtlantisJava/src/atlantis/gui/AFileControl.java deleted file mode 100755 index 7cf12548f0ecfed6bd15980e5783473dea6e849b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AFileControl.java +++ /dev/null @@ -1,210 +0,0 @@ -package atlantis.gui; - -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JMenu; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; - -import atlantis.config.ADefaultValues; -import atlantis.data.AG4StepData; -import atlantis.event.AEventManager; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; -import atlantis.globals.AGlobals; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.APar; -import atlantis.utils.ALogger; -import javax.swing.JFileChooser; - - -/** - * The File menu in the GUI. - */ -public class AFileControl extends JMenu -{ - private static ALogger logger = ALogger.getLogger(AFileControl.class); - private static AEventManager eventManager = AEventManager.instance(); - private static final AGlobals globals = AGlobals.instance(); - - public AFileControl() - { - super("File"); - - add("Read Event Locally").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - readEventLocally(); - - } - }); // add("Read Event Locally") - - add("Read Event From URL (live)").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - readEventFromURL(); - } - }); // add("Read Event From URL") - - add(new JSeparator()); - - add("Loop over events").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AEventLoopDialog.getInstance().showDialog(); - } - }); - - add(new JSeparator()); - - add("Save Image of Canvas").addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { - //Create a new dialog - ASaveCanvasDialog dialog = new ASaveCanvasDialog(); - //And show it - dialog.showDialog(); - } - }); - - add(new JSeparator()); - - add("Event Properties").addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { - AEventPropertiesDialog.getInstance().setVisible(true); - } - }); // add("Event Properties") - - add(new JSeparator()); - - add("Read Geometry").addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { - new AReadGeometryChooser(); - } - }); // add("Read Geometry") - - add("Read G4Steps").addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { - AG4StepData.ReadG4Steps(); - } - }); // add ("Read G4Steps") - - int userLevel = APar.instance().getUserLevel(); - if(userLevel>=3) // TODO: Use name for "debug" instead of magic number - { - add("Memory information").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - System.gc(); - long total = Runtime.getRuntime().totalMemory(); - long free = Runtime.getRuntime().freeMemory(); - long max = Runtime.getRuntime().maxMemory(); - int fac = 1024 * 1024; // Mega factor - String newLine = System.getProperty("line.separator"); - AOutput.append("\nMemory information:"+newLine, ALogInterface.NORMAL); - AOutput.append(" total: " + total + " B " + total / fac + " MB"+newLine, ALogInterface.NORMAL); - AOutput.append(" free : " + free + " B " + free / fac + " MB"+newLine, ALogInterface.NORMAL); - AOutput.append(" max : " + max + " B " + max / fac + " MB"+newLine, ALogInterface.NORMAL); - } - }); - - } // if(logger.isDebugEnabled()) - - add(new JSeparator()); - - add("Exit").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - new AClosingConfirmationDialog(globals.getGuiFrame()).exitApp(); - } - }); - - } // AFileControl() ----------------------------------------------------- - - - /** - * Open a file dialog and read the selected event or directory - */ - private static void readEventLocally(){ - Frame gui = globals.getGuiFrame(); - //get the last location from the default values - String lastLoc = ADefaultValues.get("LastEventFilesSourceDir"); - //Create a file chooser dialog - AReadFileChooser fileDialog = new AReadFileChooser(lastLoc); - //Check if the user pressed ok in the dialog - if ( fileDialog.showOpenDialog(gui) == JFileChooser.APPROVE_OPTION) { - //Get the selected file path, prepend file:// - String fullFilePath = "file://" + fileDialog.getSelectedFile().getPath(); - - try { - //Now set this as a new event source - eventManager.setEventSource(fullFilePath); - eventManager.nextEvent(); - } catch (NoMoreEventsException nme) { - String msg = "No events found from this source!"; - JOptionPane.showMessageDialog(gui, msg, "No more events", JOptionPane.ERROR_MESSAGE); - logger.warn(nme.getCauseMessages()); - } catch (InvalidEventSourceException ies ){ - String msg = "Not a valid event source"; - JOptionPane.showMessageDialog(gui, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.warn(ies.getCauseMessages()); - } catch (ReadEventException ree ){ - String msg = "Can not read event(s)"; - JOptionPane.showMessageDialog(gui, msg, "Read error", JOptionPane.ERROR_MESSAGE); - logger.warn(ree.getCauseMessages()); - } - } // okay pressed - otherwise do nothing - } - - - private static void readEventFromURL() - { - // URL may end with .zip - archive of event files, .xml - single - // XML event file (in this case Read Next, Previous works on the web - // directory starting from this single file) or URL only of a web - // directory (string input considered to end with whatever else) - - // in this case Atlantis gets the first event in the directory, - // Read Next, Previous work as expected - // this URL should always start with http:// - - Frame gui = globals.getGuiFrame(); - String urlString = JOptionPane.showInputDialog(gui, - "Enter URL:", AGlobals.instance().getLivePoint1EventsURL()); - - //Make sure this is a proper string - otherwise abort - if(urlString == null || urlString.trim().length()==0) return; - - // event manager further distinguishes the particular event - // reader whether URL ends with .zip or .xml - try { - //Now set this as a new event source - eventManager.setEventSource(urlString); - eventManager.nextEvent(); - } catch (NoMoreEventsException nme) { - String msg = "No events found from this source!"; - JOptionPane.showMessageDialog(gui, msg, "No more events", JOptionPane.ERROR_MESSAGE); - logger.warn(nme.getCauseMessages()); - } catch (InvalidEventSourceException ies ){ - String msg = "Not a valid event source"; - JOptionPane.showMessageDialog(gui, msg, "Invalid source", JOptionPane.ERROR_MESSAGE); - logger.warn(ies.getCauseMessages()); - } catch (ReadEventException ree ){ - String msg = "Can not read event(s)"; - JOptionPane.showMessageDialog(gui, msg, "Read error", JOptionPane.ERROR_MESSAGE); - logger.warn(ree.getCauseMessages()); - } - } // readEventFromURL() ------------------------------------------------- - -} // class AFileControl ===================================================== diff --git a/graphics/AtlantisJava/src/atlantis/gui/AGUI.java b/graphics/AtlantisJava/src/atlantis/gui/AGUI.java deleted file mode 100644 index a4327b379589db6f727544e09266201cd026f364..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AGUI.java +++ /dev/null @@ -1,572 +0,0 @@ -package atlantis.gui; - -import java.awt.BorderLayout; - -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.JFrame; -import javax.swing.JMenuBar; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSplitPane; -import javax.swing.JTabbedPane; - -import java.net.Authenticator; -import java.util.List; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.ALayoutChangeListener; -import atlantis.canvas.AWindow; -import atlantis.event.AEventInfoPrinter; -import atlantis.event.AEventManager; -import atlantis.event.AEventSource.InvalidEventSourceException; -import atlantis.event.AEventSource.NoMoreEventsException; -import atlantis.event.AEventSource.ReadEventException; -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.graphics.dnd.ADnDLabel; -import atlantis.graphics.dnd.ADragListener; -import atlantis.list.AListManager; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.ACommandProcessor; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParameterChangeListener; -import atlantis.parameters.AParameterSuperGroup; -import atlantis.parameters.AParametersGroup; -import atlantis.projection.AProjection; -import atlantis.projection.AProjectionsManager; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; -import javax.swing.*; - -/** - * The Atlantis Graphical User Interface - * This is a singleton class (and probably one of the few cases where this is - * justified!). By implementing the ALayoutChangeListener it adjusts its size to - * the canvas size. - */ -public class AGUI extends JFrame implements ChangeListener, -ALayoutChangeListener, -AParameterChangeListener -{ - private final static ALogger logger = ALogger.getLogger(AGUI.class); - private final static AGlobals globals = AGlobals.instance(); - public AEventManager eventManager = AEventManager.instance(); - - private static AGUI instance; - - private static APar parameterStore = APar.instance(); - - /** Limit the total width of Atlantis to this number of pixels (0 = screen width). */ - private int maxWidth = 0; - - private AItemTabbedPane[] tabbedPane; - private AParametersPage[][] pages; - private AParametersGroup[][] groups; - private ChangeListener[] tabChangeListener; - private ChangeListener outerTabChangeListener; - private JPanel panel; - private JSplitPane split; - private JTabbedPane outerTabbedPane; - private AInteractionToolBar interactionToolBar; - - /** - * Public singleton instantian-accessor - * @return the singleton instance - */ - public static AGUI getGUI() - { - //Don't create any GUI in headless mode - if (AGlobals.isAtlantisHeadless()) return null; - //Create the GUI if it does not exist - if (instance == null) { - instance = new AGUI(); - globals.setGuiFrame(instance); - } - //return the singleton instance - return instance; - } - - /** - * Private singleton constructor - */ - private AGUI() - { - //intialize parent - super("Atlantis GUI"); - - //be verbose - logger.debug("Creating GUI..."); - - // AClosingConfirmationDialog class handles closing Atlantis - setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); - this.addWindowListener(new AClosingConfirmationDialog(this)); - - getContentPane().setLayout(new BorderLayout()); - AIcon.setIconImage(this); - - // Creating all menu bar items - JMenuBar menuBar = constructAndGetMenuBar(); - setJMenuBar(menuBar); // set menubar to this frame - - // Create a new toolbar for the event sources - AEventSourceToolBar toolBar = new AEventSourceToolBar(); - toolBar.setName("Atlantis event source toolbar"); - //Does not go into main panel as it need BorderLayout - add(toolBar, BorderLayout.PAGE_START); - // register as an event source listener - eventManager.addNewEventSourceListener(toolBar); - - // building the panel with our own layout manager - // Why do we actually need it?? - panel = new JPanel(new AGUILayoutManager()); - - // setting the Window Control - AWindowControl windowControl = new AWindowControl(); - windowControl.setName("windowControl"); - panel.add(windowControl, AGUILayoutManager.AVAILABLExPREFERRED); - - // setting the Parameters Table - groups = parameterStore.getUIGroups(); - pages = new AParametersPage[groups.length][]; - tabbedPane = new AItemTabbedPane[groups.length]; - tabChangeListener = new TabChangeListener[groups.length]; - - for(int i = 0; i < groups.length; i++) - { - pages[i] = new AParametersPage[groups[i].length]; - tabbedPane[i] = new AItemTabbedPane(JTabbedPane.LEFT); - - for(int j = 0; j < groups[i].length; j++) - { - pages[i][j] = new AParametersPage(groups[i][j]); - String title = groups[i][j].getScreenName(); - tabbedPane[i].addTab(title, null, - pages[i][j], groups[i][j].getToolTip()); - pages[i][j].setName(title); - if(groups[i][j].getScreenName().equals("Residual") || - groups[i][j].getScreenName().equals("Physics") ) - tabbedPane[i].setEnabledAt(tabbedPane[i].getTabCount()-1, false); - } - tabbedPane[i].setSelectedIndex(-1); - tabChangeListener[i] = new TabChangeListener(); - tabbedPane[i].addChangeListener(tabChangeListener[i]); - tabbedPane[i].addMouseListener(new MouseAdapter() - { - public void mousePressed(MouseEvent e) - { - if(AUtilities.isRightMouseButton(e)) - { - JTabbedPane tabbedPane = (JTabbedPane) e.getSource(); - int tab = tabbedPane.getUI().tabForCoordinate(tabbedPane, e.getX(), e.getY()); - int parentTab = ((JTabbedPane) tabbedPane.getParent()).getSelectedIndex(); - if(tab != -1) - { - String helpName = groups[parentTab][tab]. - getGroupName(); - AHelpSystem.getInstance().showPage(helpName); - } - } - } - }); - } - // for loop - setting the outer Table - - outerTabbedPane = new AItemTabbedPane(JTabbedPane.TOP); - outerTabbedPane.setName("parameterGroups"); - List<AParameterSuperGroup> superGroups = parameterStore.getUISuperGroups(); - for(int i = 0; i < superGroups.size(); i++) { - AParameterSuperGroup superGroup = superGroups.get(i); - String title = superGroup.getName(); - String toolTip = superGroup.getToolTip(); - outerTabbedPane.addTab(title, null, tabbedPane[i], toolTip); - tabbedPane[i].setName(title); - } - outerTabChangeListener = new OuterTabChangeListener(); - outerTabbedPane.addChangeListener(outerTabChangeListener); - outerTabbedPane.addMouseListener(new MouseAdapter() - { - public void mousePressed(MouseEvent e) - { - if(AUtilities.isRightMouseButton(e)) - { - JTabbedPane tabbedPane = (JTabbedPane) e.getSource(); - int tab = tabbedPane.getUI().tabForCoordinate(tabbedPane, e.getX(), e.getY()); - if(tab != -1) - { - String helpName = tabbedPane.getTitleAt(tab); - AHelpSystem.getInstance().showPage(helpName); - } - } - } - }); - panel.add(outerTabbedPane, AGUILayoutManager.AVAILABLExAVAILABLE); - - // Set up the output (log) pane. - AMainLogPane outputDisplay = new AMainLogPane(); - // Make it available to all - AOutput.setOutput(outputDisplay); - // Display details of each new event - AEventInfoPrinter eventInfoPrinter = new AEventInfoPrinter(outputDisplay); - eventManager.addNewEventListener(eventInfoPrinter); - // Put it in the GUI - split = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panel, outputDisplay); - split.setOneTouchExpandable(true); - split.setResizeWeight(0.75); //Give 25% to the log pane by default - getContentPane().add(split); - - // setting the window, projection and group listeners - ACanvas.getCanvas().addWindowChangeListener(this); - String[] wName = ACanvas.getCanvas().getKnownWindowNames(); - for(int i = 0; i < wName.length; i++) { - AWindow w = ACanvas.getCanvas().getWindow(wName[i]); - w.addProjectionChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - AWindow window = (AWindow) e.getSource(); - if(window.equals(ACanvas.getCanvas().getCurrentWindow())) { - if(interactionToolBar != null) panel.remove(interactionToolBar); - interactionToolBar = window.getInteractionToolBar(); - if(interactionToolBar == null) - window.getInteractionManager().forgetContext(); - else { - // the interactions tabpanes are added here - panel.add(interactionToolBar, AGUILayoutManager.AVAILABLExPREFERRED, 0); - interactionToolBar.connect(); - validate(); - } - } - } - }); - - w.addGroupChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - AWindow window = (AWindow) e.getSource(); - if(window.equals(ACanvas.getCanvas().getCurrentWindow())) - setSelectedTab(window.getGroupName()); - } - }); - } - - // Set Authenticator for password-protected URL access to use - // APasswordDialog. - Authenticator.setDefault(APasswordDialog.getAuthenticator(this)); - - } // AGUI() ------------------------------------------------------------- - - - - /** - * Limit the total width of Atlantis to this number of pixels. - * - * @param maxWidth the maximum allowed width in pixels (0 = screen width) - */ - public void setMaxWidth(int maxWidth) { - this.maxWidth = maxWidth; - } - - /** - * Constructs all menu bar (master) items and returns its instance - * @return JMenuBar - */ - private JMenuBar constructAndGetMenuBar() - { - JMenuBar menuBar = new JMenuBar(); - menuBar.add(new AFileControl()); // File menu bar item - menuBar.add(new APreferencesControl()); // Preferences menu bar item - menuBar.add(new AListsControl()); // List manager - - // Spacing, remaining buttons are aligned to the right - menuBar.add(Box.createHorizontalGlue()); - - // Reset button - AMenuButton defaults = new AMenuButton("Reset"); - defaults.setToolTipText("Reload default settings"); - defaults.setBorder(null); - defaults.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - restoreDefaults(); - } - }); - menuBar.add(defaults); - - // Demo button - AMenuButton demoButton = new AMenuButton("Demo"); - demoButton.setToolTipText("Start Demo mode"); - demoButton.setBorder(null); - demoButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - ADemoDialog.getInstance().setVisible(true); - } - }); - menuBar.add(demoButton); - - // Help menu item - menuBar.add(new AHelpControl()); - - return menuBar; - - } // constructAndGetMenuBar() ------------------------------------------- - - - - /** - * This gets called when the current layout changes in ACanvas - */ - public void layoutChanged(ACanvas canvas) { - - // adapt the width of the GUI - Rectangle screenSize = canvas.getScreenSize(); - - int useWidth = screenSize.width; - if (maxWidth > 0 && useWidth > maxWidth) { - useWidth = maxWidth; - } - - Rectangle canvbound = canvas.getStartupCanvasSize(); - int guiHeight = canvbound.height; - if (canvas.getCurrentLayout().getName().equals("FULL SCREEN")) { - int guiWidth = useWidth / 4; - setBounds(useWidth * 3 / 4, 0, guiWidth, guiHeight); - // minimise the gui in fullscreen mode - int state = getExtendedState(); - state |= JFrame.ICONIFIED; - setExtendedState(state); - } else { - int guiWidth = useWidth - canvbound.width - canvbound.x; - setBounds(canvbound.x + canvbound.width, canvbound.y, guiWidth, guiHeight); - } - } // layoutChanged() ----------------------------------------------------- - - /** - * This gets called when the current window changes in ACanvas - * @param e The ChangeEvent from the Window - */ - public void stateChanged(ChangeEvent e) - { - setSelectedTab(ACanvas.getCanvas().getCurrentWindow().getGroupName()); - if(interactionToolBar != null) panel.remove(interactionToolBar); - interactionToolBar = ACanvas.getCanvas().getCurrentWindow().getInteractionToolBar(); - // if there is an InteractionToolBar for this window (and projection) - // add it to the GUI. - if(interactionToolBar != null) - { - interactionToolBar.setName("Atlantis interaction toolbar"); - panel.add(interactionToolBar, AGUILayoutManager.AVAILABLExPREFERRED, 0); - interactionToolBar.connect(); - } - validate(); - } // stateChanged() ----------------------------------------------------- - - - - private void setSelectedTab(String newTabName) - { - for(int i = 0; i < groups.length; i++) - for(int j = 0; j < groups[i].length; j++) - if(groups[i][j].getGroupName().equals(newTabName)) - { - for(int k = 0; k < groups.length; k++) - if(k != i) - { - if(tabbedPane[k].getSelectedIndex() != -1) - { - tabbedPane[k].removeChangeListener(tabChangeListener[k]); - tabbedPane[k].setSelectedIndex( -1); - tabbedPane[k].addChangeListener(tabChangeListener[k]); - } - } - tabbedPane[i].removeChangeListener(tabChangeListener[i]); - tabbedPane[i].setSelectedIndex(j); - tabbedPane[i].addChangeListener(tabChangeListener[i]); - outerTabbedPane.setSelectedIndex(i); - if(pages[i][j].pTable != null) - pages[i][j].pTable.refresh(); - break; - } - } // setSelectedTab() --------------------------------------------------- - - - - public String getCurrentGroup() - { - return ACanvas.getCanvas().getCurrentWindow().getGroupName(); - } // getCurrentGroup() -------------------------------------------------- - - - - public void refresh() - { - if(groups != null) - { - for(int i = 0; i < groups.length; i++) - for(int j = 0; j < groups[i].length; j++) - if(pages[i][j].pTable != null) - pages[i][j].pTable.refresh(); - } - } // refresh() ---------------------------------------------------------- - - - public void repaintTable() - { - if(tabbedPane != null) - for(int i = 0; i < tabbedPane.length; i++) - if(tabbedPane[i] != null) - tabbedPane[i].repaint(); - } // repaintTable() ----------------------------------------------------- - - - - /** - * Restore all the default configuration - */ - public void restoreDefaults() - { - //restore default parameters - parameterStore.restoreDefaults(); - //reset primary vertex in current event if there is one - if (eventManager.getCurrentEvent() != null) { - eventManager.getCurrentEvent().setPrimaryVertex(); - } - //reset all list - AListManager.getInstance().reset(); - //Finally refresh GUI and canvas - this.refresh(); - ACanvas.getCanvas().restoreDefaults(); - - } // restoreDefaults() -------------------------------------------------- - - - - class TabChangeListener implements ChangeListener - { - public void stateChanged(ChangeEvent e) - { - JTabbedPane tabbedPane = (JTabbedPane) e.getSource(); - int index = tabbedPane.getSelectedIndex(); - if(index > -1) - { - int parentIndex = ((JTabbedPane) tabbedPane.getParent()). - getSelectedIndex(); - String name = groups[parentIndex][index].getGroupName(); - ACommandProcessor.receive(name + "."); - pages[parentIndex][index].repaint(); - pages[parentIndex][index].pTable.refresh(); - if(groups[parentIndex][index].getUIUsage() == - AParametersGroup.PROJECTION) - { - AProjection p = AProjectionsManager.getProjection(name); - ACanvas.getCanvas().getCurrentWindow().setProjection(p); - } - } - - } // stateChanged() ------------------------------------------------- - - } // class TabChangeListener ============================================ - - - - class OuterTabChangeListener implements ChangeListener - { - public void stateChanged(ChangeEvent e) - { - JTabbedPane tabbedPane = (JTabbedPane) e.getSource(); - int parentIndex = tabbedPane.getSelectedIndex(); - if(parentIndex > -1) - { - JTabbedPane child = (JTabbedPane) tabbedPane.getSelectedComponent(); - if(child.getTabCount() == 0) - { - child.setSelectedIndex( -1); - } - else - { - int index = 0; - String name = groups[parentIndex][index].getGroupName(); - // for projections don't change the current one - if(groups[parentIndex][index].getUIUsage() == - AParametersGroup.PROJECTION) - { - name = ACanvas.getCanvas().getCurrentWindow().getProjection(). - getName(); - for(int i = 0; i < groups[parentIndex].length; ++i) - { - if(groups[parentIndex][i].getGroupName().equals(name)) - index = i; - } - } - ACommandProcessor.receive(name + "."); - pages[parentIndex][index].repaint(); - pages[parentIndex][index].pTable.refresh(); - if(groups[parentIndex][index].getUIUsage() == - AParametersGroup.PROJECTION) - { - AProjection p = AProjectionsManager.getProjection(name); - ACanvas.getCanvas().getCurrentWindow().setProjection(p); - } - } - } - - } // stateChanged() ------------------------------------------------- - - } // class OuterTabChangeListener ======================================= - - - - static class TabDragListener implements ADragListener - { - public void dragPerformed(Object from, Object to, int action) - { - String wName; - if(to instanceof ADnDLabel) - wName = ((ADnDLabel) to).getText(); - else if(to instanceof AWindow) - wName = ((AWindow) to).getName(); - else - wName = "???"; - JTabbedPane tp = (JTabbedPane) from; - String tabName = tp.getTitleAt(tp.getSelectedIndex()); - AOutput.append("Drag of " + tabName + " into window " + wName + "\n", - ALogInterface.COMMAND); - parameterStore.copyCurrentGroupLocalsTo(wName); - ACanvas.getCanvas().getWindow(wName).repaintFromScratch(); - - } // dragPerformed() ------------------------------------------------ - - } // class TabDragListener ============================================== - - @Override - public void parameterChanged(AParameter parameter) { - this.repaintTable(); - - if(parameter.getName().equals("Mode")){ - int calomode = parameterStore.get("LegoPlot", "Mode").getI(); - - //set different nphicells and netacells combinations depending on the <calo view> selection as it is used in the L1Calo configuration file - if (calomode== 0){ - parameterStore.get("LegoPlot", "nphicells").setI(128); - parameterStore.get("LegoPlot", "netacells").setI(200); - } - else if (calomode== 1){ - parameterStore.get("LegoPlot", "nphicells").setI(64); - parameterStore.get("LegoPlot", "netacells").setI(100); - } - else if (calomode== 2){ - parameterStore.get("LegoPlot", "nphicells").setI(32); - parameterStore.get("LegoPlot", "netacells").setI(50); - } - } - } - -} // class AGUI ============================================================= diff --git a/graphics/AtlantisJava/src/atlantis/gui/AGUILayoutManager.java b/graphics/AtlantisJava/src/atlantis/gui/AGUILayoutManager.java deleted file mode 100755 index f7959d5155e9e39e00c55e694f7e6b597bce1e9d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AGUILayoutManager.java +++ /dev/null @@ -1,131 +0,0 @@ -package atlantis.gui; - -import java.awt.Container; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.LayoutManager2; -import javax.swing.JComponent; -import javax.swing.JToolBar; - -/** - * The layout manager used by the GUI. It arranges the componets in a column. - * The width is set to that of the window. - * The height is set to the preffered height of the component. - * One of the components will take all the remaining space. - */ -public class AGUILayoutManager implements LayoutManager2 { - - private final static int PxP=0; - private final static int AxP=1; - private final static int AxA=2; - - public final static Integer PREFERREDxPREFERRED=new Integer(PxP); - public final static Integer AVAILABLExPREFERRED=new Integer(AxP); - public final static Integer AVAILABLExAVAILABLE=new Integer(AxA); - - private final static String AGUI_LAYOUT_CONSTRAINT="AGUILayoutManager.StringConstraint"; - - /** - * Get the constraints registered for given component. - */ - public Integer getConstraints(Component comp) { - JComponent jc=(JComponent)comp; - - Integer constraint=(Integer)jc.getClientProperty(AGUI_LAYOUT_CONSTRAINT); - - return constraint; - } - - public void addLayoutComponent(Component comp, Object constraint) { - if(!(comp instanceof JComponent)) - throw new Error("AGUILayoutManager: not a JComponent"); - - if(!(constraint instanceof Integer)) - throw new Error("AGUILayoutManager: not a Integer"); - - JComponent jc=(JComponent)comp; - - jc.putClientProperty(AGUI_LAYOUT_CONSTRAINT, constraint); - } - - public void layoutContainer(Container parent) { - int W=parent.getSize().width; - int H=parent.getSize().height; - - Component[] comp=parent.getComponents(); - int[] constraint=new int[comp.length]; - - int AxA_Index=comp.length; - - for(int i=0; i<comp.length; i++) { - constraint[i]=getConstraints(comp[i]).intValue(); - if(constraint[i]==AxA) AxA_Index=i; - } - - int hi=0; - - for(int i=0; i<AxA_Index; i++) { - comp[i].setSize(W, 0); - Dimension cSize=comp[i].getPreferredSize(); - - switch(constraint[i]) { - case PxP: - comp[i].setBounds((W-cSize.width)/2, hi, cSize.width, cSize.height); - break; - - case AxP: - comp[i].setBounds(0, hi, W, cSize.height); - break; - } - hi+=cSize.height; - } - - int hi2=H; - - for(int i=comp.length-1; i>AxA_Index; i--) { - comp[i].setSize(W, 0); - Dimension cSize=comp[i].getPreferredSize(); - - hi2-=cSize.height; - switch(constraint[i]) { - case PxP: - comp[i].setBounds((W-cSize.width)/2, hi2, cSize.width, cSize.height); - break; - - case AxP: - comp[i].setBounds(0, hi2, W, cSize.height); - break; - } - } - - if(AxA_Index!=comp.length) - comp[AxA_Index].setBounds(0, hi, W, hi2-hi); - } - - public Dimension minimumLayoutSize(Container parent) { - return new Dimension(0, 0); - } - - public Dimension preferredLayoutSize(Container parent) { - return new Dimension(0, 0); - } - - public float getLayoutAlignmentX(Container target) { - return 0.5f; - } - - public float getLayoutAlignmentY(Container target) { - return 0.5f; - } - - public Dimension maximumLayoutSize(Container target) { - return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); - } - - public void addLayoutComponent(String name, Component comp) {} - - public void removeLayoutComponent(Component comp) {} - - public void invalidateLayout(Container target) {} - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AGUIUtilities.java b/graphics/AtlantisJava/src/atlantis/gui/AGUIUtilities.java deleted file mode 100644 index e699def52ebc27a83a33a17af428c1ff48dd2865..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AGUIUtilities.java +++ /dev/null @@ -1,167 +0,0 @@ -package atlantis.gui; - -import java.awt.Component; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.filechooser.FileFilter; - -import atlantis.globals.AGlobals; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AUtilities; - -/** - * Utility methods related to the GUI. Moved from utils.Utilities. - * - * @author waugh - */ -public class AGUIUtilities { - - private static final AGlobals globals = AGlobals.instance(); - - /** - * Save file dialog. Show the dialog with prepared name of the file in - * the directory. Returns the selected directory. - * - * @param component JDialog - * @param directory String - * @param fileName String - * @param data byte[] - * @param title String - * @param ext extension for file filter - * return selectedDirectory String - */ - public static String chooseFileAndWrite(Component component, String directory, - String fileName, byte[] data, String title, String ext) - throws AAtlantisException - { - String selectedDirectory = directory; - - if(directory == null) - { - directory = AGlobals.instance().getHomeDirectory(); - } - - JFileChooser chooser = new JFileChooser(directory); - chooser.setDialogTitle(title); - chooser.setSelectedFile(new File(fileName)); - SaveDialogFileFilter filter = new SaveDialogFileFilter(ext); - chooser.setFileFilter(filter); - - int returnVal = chooser.showSaveDialog(component); - - if(returnVal == JFileChooser.APPROVE_OPTION) - { - String absPath = chooser.getSelectedFile().getAbsolutePath(); - File f = new File(absPath); - if(f.exists()) - { - try - { - renameFile(absPath, title); - } - catch(Exception ex) - { - throw new AAtlantisException(ex.getMessage()); - } - } - // the selected file either existed and is now successfully - // renamed, or didn't exist so can proceed to store data - try - { - OutputStream s = - new BufferedOutputStream(new FileOutputStream(absPath)); - s.write(data); - s.close(); - selectedDirectory = chooser.getSelectedFile().getParent(); - } - catch(FileNotFoundException ex) - { - String msg = "Couldn't create the file.\nInsufficient permissions."; - throw new AAtlantisException(msg); - } - catch(IOException ex) - { - String msg = "IO Error when writing the\ndata into the file."; - throw new AAtlantisException(msg); - } - } - return selectedDirectory; - - } // chooseFileAndWrite() ----------------------------------------------- - - - /** - * renames file (backup when saving configuration, canvas plot, etc) - * to 'name' + backup suffix - */ - private static void renameFile(String name, String title) throws Exception - { - String backupSuffix = "-backup_on_" + AUtilities.getDateTimeString(); - String dstName = name + backupSuffix; - String errorMsg = "Renaming\n" + name + "\nto\n" + dstName + "\nfailed."; - String msg = name + "\nexists and was successfully renamed to\n" + dstName; - - try - { - AUtilities.logger.debug("Renaming file " + name + " to " + dstName + " ..."); - File f = new File(name); - if(! f.renameTo(new File(dstName))) - { - AUtilities.logger.error(errorMsg); - throw new Exception(errorMsg); - } - AUtilities.logger.debug(msg); - JOptionPane.showMessageDialog(globals.getGuiFrame(), msg, title, - JOptionPane.INFORMATION_MESSAGE); - } - catch(Exception ex) - { - AUtilities.logger.debug(ex.getMessage(), ex); - throw new Exception(errorMsg); - } - - } // renameFile() ------------------------------------------------------- - - - private static class SaveDialogFileFilter extends FileFilter - { - private String extension = null; - - public SaveDialogFileFilter(String acceptedExtension) - { - extension = acceptedExtension; - } - - // accept all directories and all files of "extension" - public boolean accept(File f) - { - if (f.isDirectory()) - { - return true; - } - - String s = f.getName(); - - if(s.toLowerCase().endsWith(extension)) - { - return true; - } - - return false; - } - - public String getDescription() - { - return extension; - } - - } // SaveDialogFileFilter =================================================== - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AHelpControl.java b/graphics/AtlantisJava/src/atlantis/gui/AHelpControl.java deleted file mode 100755 index 787c56609d767f1c3a32c446842806e751aac24c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AHelpControl.java +++ /dev/null @@ -1,45 +0,0 @@ -package atlantis.gui; - -import javax.swing.JMenu; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * The Help menu in the GUI. - */ -public class AHelpControl extends JMenu -{ - public AHelpControl() - { - super("Help"); - add("Online Help System").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AHelpSystem.getInstance().showPage("HelpHowTo"); - } - }); - add("Modifier Keys").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AMouseHelpDialog.getInstance().setVisible(true); - } - }); - add("Current color and collection summary").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AColorHelpDialog.getInstance().setVisible(true); - } - }); - add("About...").addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AAboutDialog.getInstance().setVisible(true); - } - }); - - } // AHelpControl() ----------------------------------------------------- -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AHelpSystem.java b/graphics/AtlantisJava/src/atlantis/gui/AHelpSystem.java deleted file mode 100755 index 43ee7551bd73e4491c591fba0e498f78167ad5e9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AHelpSystem.java +++ /dev/null @@ -1,118 +0,0 @@ -package atlantis.gui; - -import atlantis.graphics.AIcon; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.utils.ALogger; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.Toolkit; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URL; - -import javax.help.BadIDException; -import javax.help.HelpSet; -import javax.help.JHelp; -import javax.swing.JFrame; - - - -public class AHelpSystem extends JFrame -{ - private static ALogger logger = ALogger.getLogger(AHelpSystem.class); - - private static AHelpSystem instance = null; - private static String hsPath = "jhelpset.hs"; - private static JHelp helpViewer = null; - - - static - { - HelpSet hs = getHelpSet(hsPath); - // HelpBroker hb = hs.createHelpBroker(); - helpViewer = new JHelp(hs); - helpViewer.setCurrentID("HelpHowTo"); - } - - - private AHelpSystem() - { - super("Atlantis Online Help"); - addWindowListener(new WindowAdapter() - { - public void windowClosing(WindowEvent e) - { - dispose(); - instance = null; - } - }); - this.getContentPane().add(helpViewer); - this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - AIcon.setIconImage(this); - this.setSize(900, 600); - - } // AHelpSystem() ------------------------------------------------------ - - - - public static AHelpSystem getInstance() - { - if(instance == null) - { - instance = new AHelpSystem(); - } - return instance; - - } // getInstance() ------------------------------------------------------ - - - - public void showPage(String pageName) - { - try - { - helpViewer.setCurrentID(pageName); - // clear the iconified bit (no matter whether or not it is - // current iconified) - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - this.setLocation((int)(Math.max(0, (screenSize.getWidth()-this.getWidth())/2)), (int)((screenSize.getHeight()-this.getHeight())/3)); - this.setExtendedState(this.getExtendedState() & ~Frame.ICONIFIED); - this.setVisible(true); - } - catch(BadIDException ex) - { - AOutput.alwaysAppend("\nNo help for \"" + pageName + "\", sorry.\n", - ALogInterface.BAD_COMMAND); - } - - } // showPage() --------------------------------------------------------- - - - - private static HelpSet getHelpSet(String helpSetFile) - { - HelpSet hs = null; - // ClassLoader cl = this.getClass().getClassLoader(); // if not static - ClassLoader cl = AHelpSystem.class.getClassLoader(); - try - { - // helpSetFile must contain just the name of HelpSet file (.hs), - // .jar file containing the whole help must be in the classpath - // then the file is successfully found. returns null if helpSetFile - // contains the whole absolute / relative path - URL hsURL = HelpSet.findHelpSet(cl, helpSetFile); - // hs = new HelpSet(null, hsURL); - hs = new HelpSet(cl, hsURL); - } - catch(Exception ee) - { - logger.error("AHelpSystem: " + ee.getMessage(), ee); - logger.error("AHelpSystem: " + helpSetFile + " not found"); - } - return hs; - - } // getHelpSet() ------------------------------------------------------- - - -} // class AHelpSystem ====================================================== diff --git a/graphics/AtlantisJava/src/atlantis/gui/AInteractionToolBar.java b/graphics/AtlantisJava/src/atlantis/gui/AInteractionToolBar.java deleted file mode 100755 index ff7e0e6523445c4e6b4bdd6827fb66bb0b856a17..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AInteractionToolBar.java +++ /dev/null @@ -1,429 +0,0 @@ -package atlantis.gui; - -import java.awt.FlowLayout; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import java.lang.reflect.Constructor; -import java.util.Hashtable; -import java.util.Vector; - -import javax.swing.ButtonGroup; -import javax.swing.ImageIcon; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JToggleButton; -import javax.swing.JToolBar; - -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.globals.AGlobals; -import atlantis.graphics.layout.AFlowLayout; -import atlantis.interactions.AInteractionGroup; -import atlantis.interactions.AInteractionsConfigReader; -import atlantis.interactions.AInteractionsManager; -import atlantis.output.AExceptionHandler; -import atlantis.projection.AProjectionsManager; -import atlantis.utils.AUtilities; -import javax.swing.*; - -/** - * The ToolBar that appears in the GUI and shows the set of interactions for a - * window. - * @author maillard - */ - -public class AInteractionToolBar extends JToolBar { - // the interactionsmanager this toolbar talks to - private AInteractionsManager iManager; - - // currently selected group - private AInteractionGroup currentGroup; - - /* previously selected group, needed for the history feature: - * when we select a global interaction (eg SyncCursors), then all windows will use it. - * If then we deselect it, all the windows will go back to their previous interactions */ - private AInteractionGroup previousGroup; - - // a panel that displays the additional controls needed by some interaction groups - private JPanel controls; - - // base path for all radio button icons - private final static String iconBasePath = - AGlobals.instance().getHomeDirectory()+"img"+System.getProperty("file.separator")+"interaction_"; - - // button group for all radio buttons - private ButtonGroup buttonGroup; - - // vector containing all interactionsgroups belonging to this toolbar - Vector<AInteractionGroup> groups; - - // make the pool for holding the Interactions Control and the projections Menus - private static Hashtable<String, Hashtable<String, AInteractionToolBar>> interactionControlsPool = - new Hashtable<String, Hashtable<String, AInteractionToolBar>>(20); - - public static Hashtable<String, Hashtable<String, JPopupMenu>> interactionMenusPool = - new Hashtable<String, Hashtable<String, JPopupMenu>>(20); - - /** - * Creates an InteractionToolBar to work with a particular - * InteractionsManager. - * - * @param iManager The InteractionsManager. - */ - public AInteractionToolBar(AInteractionsManager iManager) { - // call parent constructor - super(); - this.setLayout(new AFlowLayout(5, 5)); - - //make the toolbar non-detachable (can not be detachable - //as long as it does not sit inside an BorderLayout) - this.setFloatable(false); - this.setOpaque(false); - - this.iManager = iManager; - - groups = new Vector<AInteractionGroup>(); - controls = new JPanel(); - buttonGroup = new ButtonGroup(); - } - - /** - * Returns the InteractionsManager associated with this InteractionToolBar. - * - * @return The InteractionsManager - */ - public AInteractionsManager getInteractionsManager() { - return iManager; - } - - /** - * Called each time by the InteractionsManager when the ToolBar is connected - * to it. Should be used to perform some initializations. - */ - public void connect() { - iManager.setContext(getSelectedGroup()); - if (getSelectedGroup() != null) - AMouseHelpDialog.getInstance().processInteractionChange(getSelectedGroup().getInteractions()); - } - - /** - * Adds the group to the InteractionToolBar. The group can - * register some interactions. - * @param group the group to be added. - */ - public void addGroup(AInteractionGroup group, String toolTipText) { - groups.addElement(group); - final String groupName = group.getGroupName(); - - // set up a button for the interaction group - String iconPath = iconBasePath + groupName.toLowerCase() + ".png"; - - ImageIcon newIcon = AUtilities.getFileAsImageIcon(iconPath); - JToggleButton newButton = new JToggleButton(newIcon); - newButton.setName(group.getGroupName()); - newButton.setToolTipText(toolTipText); - - // add the action listener - newButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - buttonClicked(groupName); - } - }); - - // add the mouse listener for the help system - newButton.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - // if the user right clicks on a button - if (AUtilities.isRightMouseButton(e)) { - JToggleButton butt = (JToggleButton) e.getSource(); - // find the corresponding interactions group - if(findGroup(butt.getName()) != null) { - String className = findGroup(butt.getName()).getClass().getName(); - String temp = className.substring(className.lastIndexOf('.') + ".A".length()); - className = temp.substring(0, temp.length() - "Group".length()); - // show the help page for the group - AHelpSystem.getInstance().showPage(className); - } - } - } - }); - - // remove the controls panel so that the new button will - // not appear after it - this.remove(controls); - - // add the button to the ButtonGroup and to the ToolBar - buttonGroup.add(newButton); - this.add(newButton); - - // now we can put the controls panel back - this.add(controls,-1); - - // repaint the toolbar - this.validate(); - this.repaint(); - } - - /** - * Returns an array containing all the groups registered in this ToolBar. - * @return the groups - */ - public AInteractionGroup[] getGroups() { - return (AInteractionGroup[]) groups.toArray(new AInteractionGroup[0]); - } - - /** - * Returns the current interactionsgroup. - * @return the selected group. - */ - public AInteractionGroup getSelectedGroup() { - return currentGroup; - } - - /** - * Returns the name of the current interactionsgroup. - * - * @return the selected group name. - */ - public String getSelectedGroupName() { - return currentGroup.getGroupName(); - } - - /** - * Sets the interactionsgroup given its name, by - * performing a click on it. - * @param groupName the name of the group. - */ - public void setSelectedGroup(String groupName) { - // loop through the interaction groups - for(AInteractionGroup iG : groups) { - // find the one with the corresponding name - if(iG.getGroupName().equals(groupName)) { - // click the corresponding button - for(int i = 0; i < groups.size(); i++) { - if(this.getComponentAtIndex(i) instanceof JToggleButton - && this.getComponentAtIndex(i).getName().equals(groupName)) { - ((JToggleButton) this.getComponentAtIndex(i)).doClick(); - return; - } - } - } - } - } - - /** - * Returns a group based on its name - * @return the interactionsgroup (if found) or null - */ - public AInteractionGroup findGroup(String screenName) { - for(AInteractionGroup iG : groups) { - if(iG.getGroupName().equals(screenName)) return iG; - } - return null; - } - - /** - * Activate the default interactionsgroup (the first one) - */ - public void setDefaultGroup() { - // if there are any interaction groups - if (groups.size() > 0) { - // select the first one - setSelectedGroup(groups.elementAt(0).getGroupName()); - } - } - - /** - * Restore the previously selected group, if there was one. - */ - public void restorePreviousGroup() { - if (previousGroup != null) - this.setSelectedGroup(previousGroup.getGroupName()); - } - - /** - * This gets called when one of the buttons in the toolbar - * is clicked. It notifies the InteractionManager. - * @param groupName the name of the InteractionGroup to be activated - */ - public void buttonClicked(String groupName) { - AInteractionGroup deselectedGroup = currentGroup; - // loop through the groups - for(AInteractionGroup iG : groups) { - // find the one with the corresponding name - if(iG.getGroupName().equals(groupName)) { - // notify the interactionsmanager of the change - iManager.setContext(iG); - - // remove the old additional controls panel, add the new one - this.remove(controls); - if(iG.hasAdditionalControls()) controls = iG.getAdditionalControls(); - else controls = new JPanel(); - this.add(controls,-1); - if (this.getParent() != null) { - this.getParent().validate(); - } - - // take care of the history (previousGroup remembers the last non-global group) - AMouseHelpDialog.getInstance().processInteractionChange(iG.getInteractions()); - if (currentGroup != null && currentGroup.isWindowGroup()) { - previousGroup = currentGroup; - } - currentGroup = iG; - - if(ACanvas.getCanvas().getCurrentWindow() != null) - // if the interactionsgroup is global, update the other windows - if ((iG.isCanvasGroup()) && iManager.getWindow().isCurrent()) { - String[] wName = ACanvas.getCanvas().getCurrentLayout().getWindowNames(); - for (int i = 0; i < wName.length; i++) - if (!wName[i].equals(iManager.getWindow().getName())) { - ACanvas.getCanvas().getWindow(wName[i]) - .getInteractionToolBar().setSelectedGroup(iG.getGroupName()); - } - } - // if a global interactionsgroup was deselected, restore the - // previous groups in all the other windows - if(deselectedGroup != null && deselectedGroup.isCanvasGroup() - && iManager.getWindow().isCurrent()) { - String[] wName = ACanvas.getCanvas().getCurrentLayout().getWindowNames(); - for (int i = 0; i < wName.length; i++) - if (!wName[i].equals(iManager.getWindow().getName())) - ACanvas.getCanvas().getWindow(wName[i]) - .getInteractionToolBar().restorePreviousGroup(); - } - } - } - } - - /** - * Used to get the InteractionControl object for a specific window and projection. - * @param wName The name of the window - * @param pName The name of the projection - * @return The AInteractionToolBar for that window and projection - */ - public static AInteractionToolBar getInteractionToolBar(String wName, String pName) { - if(!ACanvas.getCanvas().isValidWindowName(wName)) - throw new Error("Invalid window name"); - - if(!AProjectionsManager.isValidProjection(pName)) - throw new Error("Invalid projection name"); - - Hashtable<String, AInteractionToolBar> list = interactionControlsPool.get(wName); - - if(list==null) { - list=new Hashtable<String, AInteractionToolBar>(10); - interactionControlsPool.put(wName, list); - } - - AInteractionToolBar control=list.get(pName); - - if(control==null) { - control=makeInteractionToolBar(ACanvas.getCanvas().getWindow(wName), - AInteractionsConfigReader.getNode(pName)); - // if there really existed an InteractionControl register it. - if(control!=null) - list.put(pName, control); - } - - return control; - } - - /** - * Returns the Interaction's PopupMenu. - * @param window - * @return the new popup menu object - */ - public static JPopupMenu getInteractionMenu(AWindow window) { - String wName=window.getName(); - String pName=window.getProjection().getName(); - - if(!ACanvas.getCanvas().isValidWindowName(wName)) - throw new Error("Invalid window name"); - - if(!AProjectionsManager.isValidProjection(pName)) - throw new Error("Invalid projection name"); - - Hashtable<String, JPopupMenu> list=interactionMenusPool.get(wName); - - if(list==null) { - list=new Hashtable<String, JPopupMenu>(10); - interactionMenusPool.put(wName, list); - } - - JPopupMenu menu=list.get(pName); - - if(menu==null) { - menu=makePopupMenu(getInteractionToolBar(wName, pName)); - list.put(pName, menu); - } - - return menu; - } - - /** Creates the AInteractionToolBar and returns a pointer to it - * - * @param window - * @param node - * @return the interaction tool bar - */ - public static AInteractionToolBar makeInteractionToolBar(AWindow window, Node node) { - // check whether we really got a Node with information. If not return null; - if(node==null) return null; - - AInteractionToolBar root=new AInteractionToolBar(window.getInteractionManager()); - - NodeList childs=node.getChildNodes(); - - for(int i=0; i<childs.getLength(); i++) { - Node child=childs.item(i); - - if(child.getNodeType()==Node.ELEMENT_NODE) { - String fileName=child.getAttributes().getNamedItem("fileName").getNodeValue(); - String screenName=child.getAttributes().getNamedItem("screenName").getNodeValue(); - String toolTip=child.getAttributes().getNamedItem("toolTip").getNodeValue(); - - if(child.getNodeName().equals("Panel")) - root.addGroup(makeInteractionGroup(window, fileName, screenName), toolTip); - } - } - - //Also select the default interaction group - root.setDefaultGroup(); - - return root; - } - - private static AInteractionGroup makeInteractionGroup( - AWindow window, String fileName, String screenName) { - Object group=null; - - try { - Constructor[] c=Class.forName("atlantis.interactions.A"+fileName+"Group").getDeclaredConstructors(); - - group=c[0].newInstance(new Object[] {window.getInteractionManager()}); - } catch(Exception e) { - e.printStackTrace(); - AExceptionHandler.processException("Cannot make interaction group "+"A"+fileName+"Group", e); - } - ((AInteractionGroup)group).setGroupName(screenName); - return(AInteractionGroup)group; - } - - private static JPopupMenu makePopupMenu(AInteractionToolBar root) { - JPopupMenu menu=new JPopupMenu(); - - AInteractionGroup[] panels=root.getGroups(); - - for(int i=0; i<panels.length; i++) - menu.add(panels[i].getPopupItem()); - - return menu; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AItemTabbedPane.java b/graphics/AtlantisJava/src/atlantis/gui/AItemTabbedPane.java deleted file mode 100755 index 901642ad4d732d717f7b5c119690aaee84351117..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AItemTabbedPane.java +++ /dev/null @@ -1,144 +0,0 @@ -package atlantis.gui; - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.event.*; - -// Gary- DnD facility commented out as it does not fully work -// ( Window control is left in funny state) -// and is not something i have ever used..... - -/** - * A TabbedPane which generates events when a tab is selected - * and when a tab is deselected. - * Provides DnD support. - */ -public class AItemTabbedPane extends JTabbedPane - implements // for Item Selectability - ItemSelectable, ChangeListener { -// // for drag and drop -// DragSourceListener, DragGestureListener, ACallBack { - - private Component current; - private Component previous; - private ItemListener itemListener; - private ItemEvent itemEvent; - -// private DragSource dragSource=null; -// private Vector dragListeners; - - public AItemTabbedPane(int tabPlacement) { - super(tabPlacement); - // tabs don't change on right click rather help appears. - setUI(new ATabbedPaneUI()); - - current=null; - previous=null; - this.addChangeListener(this); - -// // initializing drag and drop -// dragSource=new DragSource(); -// dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this); - -// dragListeners=new Vector(); - } - - public Component getPreviousSelectedComponent() { - if(previous==null) - return getSelectedComponent(); - else - return previous; - } - - public void stateChanged(ChangeEvent e) { - previous=current; - - if((current!=null)&&(itemListener!=null)) { - itemEvent=new ItemEvent(this, 0, current, ItemEvent.DESELECTED); - itemListener.itemStateChanged(itemEvent); - } - - current=getSelectedComponent(); - - if(itemListener!=null) { - itemEvent=new ItemEvent(this, 0, current, ItemEvent.SELECTED); - itemListener.itemStateChanged(itemEvent); - } - } - - // Add a listener to recieve item events when the state of an tab changes. - public void addItemListener(ItemListener l) { - itemListener=l; - } - - // Returns the selected items or null if no items are selected. - public Object[] getSelectedObjects() { - return null; - } - - // Removes an item listener. - public void removeItemListener(ItemListener l) { - if(itemListener.equals(l)) - itemListener=null; - } - - public Dimension getPreferredSize() { - this.getLayout().layoutContainer(this); - return super.getPreferredSize(); - } - -/* - // implementation of DragSourceListener - - // This method is invoked to signify that the Drag and Drop operation is complete. - public void dragDropEnd(DragSourceDropEvent dsde) {} - - // Called as the hotspot enters a platform dependent drop site. - public void dragEnter(DragSourceDragEvent dsde) { - dsde.getDragSourceContext().setCursor(ADnDLabel.DROP_VALID); - } - - // Called as the hotspot exits a platform dependent drop site. - public void dragExit(DragSourceEvent dse) { - dse.getDragSourceContext().setCursor(ADnDLabel.DROP_INVALID); - } - - // Called as the hotspot moves over a platform dependent drop site. - public void dragOver(DragSourceDragEvent dsde) { - dsde.getDragSourceContext().setCursor(ADnDLabel.DROP_VALID); - } - - // Called when the user has modified the drop gesture. - public void dropActionChanged(DragSourceDragEvent dsde) {} - - // implementation of DragGestureListener - - public void dragGestureRecognized(DragGestureEvent dge) { - Point p=dge.getDragOrigin(); - - if(getSelectedIndex()==getUI().tabForCoordinate(this, p.x, p.y)) { - AObjectTransferable cbt=new AObjectTransferable(this); - - dragSource.startDrag(dge, ADnDLabel.DROP_INVALID, cbt, this); - } - } - - public void callBack(Object to) { - for(int i=0; i<dragListeners.size(); i++) - ((ADragListener)dragListeners.get(i)).dragPerformed(this, to, -1); - } - - public void addDragListener(ADragListener l) { - dragListeners.addElement(l); - } - - public void addChangeListener(ChangeListener l) { - super.addChangeListener(l); - } - - public void removeChangeListener(ChangeListener l) { - super.removeChangeListener(l); - } -*/ -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ALayoutDialog.java b/graphics/AtlantisJava/src/atlantis/gui/ALayoutDialog.java deleted file mode 100755 index 93e07f52794a9f911b179c286b097d3c7ff4c37e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ALayoutDialog.java +++ /dev/null @@ -1,109 +0,0 @@ -package atlantis.gui; - -import java.awt.BorderLayout; -import java.awt.GridLayout; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JPanel; -import javax.swing.JRadioButton; - -import atlantis.canvas.ACanvas; -import atlantis.globals.AGlobals; - -/** - * A dialog which lets the user to select between the different layouts of the - * canvas. - */ -public class ALayoutDialog extends JDialog implements ActionListener -{ - private JPanel choosePanel; - private JPanel buttonsPanel; - private JButton okButton, cancelButton; - private JRadioButton selected; - - private static final AGlobals globals = AGlobals.instance(); - - public ALayoutDialog() - { - super(globals.getGuiFrame(), "Layout Properties Dialog", true); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - setResizable(false); - - choosePanel = new JPanel(); - choosePanel.setBorder(BorderFactory.createTitledBorder(" Select Layout ")); - - String[] layoutNames = ACanvas.getCanvas().getLayoutNames(); - ButtonGroup group = new ButtonGroup(); - - choosePanel.setLayout(new GridLayout(layoutNames.length, 1)); - for (int i = 0; i < layoutNames.length; i++) - { - JRadioButton r = new JRadioButton(layoutNames[i]); - - r.addActionListener(this); - if (ACanvas.getCanvas().getCurrentLayout().getName().equals(layoutNames[i])) - { - selected = r; - r.setSelected(true); - } - else - r.setSelected(false); - group.add(r); - choosePanel.add(r); - } - getContentPane().setLayout(new BorderLayout()); - getContentPane().add(choosePanel, BorderLayout.CENTER); - - okButton = new JButton("OK"); - okButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - ACanvas.getCanvas().setCurrentLayout(selected.getText()); - dispose(); - ACanvas.getCanvas().bringToFront(); - } - }); - - cancelButton = new JButton("Cancel"); - cancelButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - dispose(); - } - }); - - buttonsPanel = new JPanel(); - buttonsPanel.add(okButton); - buttonsPanel.add(cancelButton); - getContentPane().add(buttonsPanel, BorderLayout.SOUTH); - pack(); - - // set the initial location - AGUI gui = AGUI.getGUI(); - int guiWidth = gui.getWidth(); - int guiHeight = gui.getHeight(); - int guiX = gui.getX(); - int dialogWidth = (int) this.getPreferredSize().getWidth(); - int dialogHeight = (int) this.getPreferredSize().getHeight(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit().getScreenSize().getWidth()); - if(guiX+guiWidth+(dialogWidth-guiWidth)/2>screenWidth) - this.setLocation(Math.max(0, screenWidth - dialogWidth), Math.max(0, (guiHeight - dialogHeight) / 3)); - else - this.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), Math.max(0, (guiHeight - dialogHeight) / 3)); - setVisible(true); - } - - public void actionPerformed(ActionEvent e) - { - selected = (JRadioButton) e.getSource(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ALazyPanel.java b/graphics/AtlantisJava/src/atlantis/gui/ALazyPanel.java deleted file mode 100755 index d6caed6c259b74b2d13c21ab8edbf8040f799169..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ALazyPanel.java +++ /dev/null @@ -1,109 +0,0 @@ -package atlantis.gui; - -import java.awt.Graphics; -import javax.swing.JPanel; - -/** - * LazyPanel is an abstract base class that provides functionality - * to defer populating a Panel object until it is actually viewed. - * This is extremely useful when using CardLayout and tab panel - * views because it allows the construction of the subviews to - * be done on a pay-as-you-go basis instead of absorbing all the cost - * of construction up front. - * - * If subclasses choose to override any of the following methods, - * it is their responsibility to ensure their overridden methods - * call the parent's method first. The methods are: - * - * public void paint (Graphics) - * public void paintComponents(Graphics) - * public void paintAll (Graphics) - * public void repaint () - * public void repaint (long) - * public void repaint (int, int, int, int) - * public void repaint (long, int, int, int, int) - * public void update (Graphics) - * - * Each of these methods ensures the panel is constructed - * and then simply forwards the call to the parent class. - * - * You use this class by extending it and moving as much of the - * constructor code as possible from the child class into the method - * lazyConstructor. - */ - -public abstract class ALazyPanel extends JPanel { - - // We want to call the lazyConstructor only once. - private boolean lazyConstructorCalled=false; - - public void paint(Graphics g) { - callLazyConstructor(); - super.paint(g); - } - - public void paintAll(Graphics g) { - callLazyConstructor(); - super.paintAll(g); - } - - public void paintComponents(Graphics g) { - callLazyConstructor(); - super.paintComponents(g); - } - - public void repaint() { - callLazyConstructor(); - super.repaint(); - } - - public void repaint(long l) { - callLazyConstructor(); - super.repaint(l); - } - - public void repaint(int i1, int i2, int i3, int i4) { - callLazyConstructor(); - super.repaint(i1, i2, i3, i4); - } - - public void repaint(long l, int i1, int i2, int i3, int i4) { - callLazyConstructor(); - super.repaint(l, i1, i2, i3, i4); - } - - public void update(Graphics g) { - callLazyConstructor(); - super.update(g); - } - - /** - * Force the lazyConstructor() method implemented in the child class - * to be called. If this method is called more than once on - * a given object, all calls but the first do nothing. - */ - public synchronized final void callLazyConstructor() { - // The general idea below is as follows: - // 1) See if this method has already been successfully called. - // If so, return without doing anything. - // - // 2) Otherwise ... call the lazy constructor. - // 3) Call validate so that any components added are visible. - // 4) Note that we have run. - - if((lazyConstructorCalled==false)&&(getParent()!=null)) { - lazyConstructor(); - lazyConstructorCalled=true; - validate(); - } - } - - /** - * This method must be implemented by any child class. Most of - * the component creation code that would have gone in the constructor - * of the child goes here instead. See the example - * at the top. - */ - abstract protected void lazyConstructor(); - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AListsControl.java b/graphics/AtlantisJava/src/atlantis/gui/AListsControl.java deleted file mode 100755 index 4e8810bc05c4111829ebcd179ba57310dfa7ef38..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AListsControl.java +++ /dev/null @@ -1,28 +0,0 @@ -package atlantis.gui; - -import atlantis.list.AListManager; -import atlantis.utils.AUtilities; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -/** - * The preferences menu. - */ -public class AListsControl extends AMenuButton { - - public AListsControl() { - super("Lists"); - this.setToolTipText("List control dialog" ); - this.setBorder(null); - this.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - if (AUtilities.isRightMouseButton(e)) { - AHelpSystem.getInstance().showPage("Lists"); - } else { - AListManager.getInstance().showLists(); - } - } - }); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ALogPane.java b/graphics/AtlantisJava/src/atlantis/gui/ALogPane.java deleted file mode 100644 index 693c6f4be771470ca93590de1523574f3b9cf10d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ALogPane.java +++ /dev/null @@ -1,205 +0,0 @@ -package atlantis.gui; - -import java.awt.Color; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import javax.swing.JMenuItem; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTextPane; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; -import javax.swing.text.Style; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyleContext; - -import atlantis.output.ALogInterface; -import atlantis.utils.ALogger; - -/** - * This class is a subclass of JTextPane which can be used for any kind of - * logging/text output window in Atlantis. It unifies the old AOutput and - * ALogOutput classes - * - * @author Adam Davison - */ -public class ALogPane extends JScrollPane implements ALogInterface { - - private static ALogger logger = ALogger.getLogger(ALogPane.class); - private Style m_systemDefaultStyle = null; - - private JTextPane m_textPane; - private JPopupMenu m_popupMenu; - private JMenuItem m_menuItemClearTextPane; - - public ALogPane() { - m_textPane = new JTextPane(); - m_textPane.setEditable(false); - m_textPane.setBackground(Color.white); - - setViewportView(m_textPane); - setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); - setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); - - // popup menu at text pane (info output at the bottom of the GUI) - m_popupMenu = new JPopupMenu(); - m_menuItemClearTextPane = new JMenuItem("Erase info output"); - m_menuItemClearTextPane.addActionListener(new PopupMenuActionListener(this)); - m_popupMenu.add(m_menuItemClearTextPane); - - m_textPane.addMouseListener(new PopupMenuListener_textPane(m_popupMenu)); - - // create style which are used to add text to the document - StyleContext context = StyleContext.getDefaultStyleContext(); - Style defaultStyle = context.getStyle(StyleContext.DEFAULT_STYLE); - - Style newStyle = m_textPane.addStyle(NORMAL, defaultStyle); - - StyleConstants.setFontFamily(newStyle, "Courier"); - StyleConstants.setFontSize(newStyle, 14); - - newStyle = m_textPane.addStyle(NORMAL_BOLD, defaultStyle); - StyleConstants.setFontFamily(newStyle, "Courier"); - StyleConstants.setFontSize(newStyle, 14); - StyleConstants.setBold(newStyle, true); - - newStyle = m_textPane.addStyle(COMMAND, defaultStyle); - StyleConstants.setFontFamily(newStyle, "Courier"); - StyleConstants.setFontSize(newStyle, 14); - StyleConstants.setForeground(newStyle, Color.blue); - - newStyle = m_textPane.addStyle(BAD_COMMAND, defaultStyle); - StyleConstants.setFontFamily(newStyle, "Courier"); - StyleConstants.setFontSize(newStyle, 14); - StyleConstants.setForeground(newStyle, Color.red); - - newStyle = m_textPane.addStyle(WARNING, defaultStyle); - // was Courier - didn't print some greek letters under Linux - StyleConstants.setFontFamily(newStyle, "Arial"); - StyleConstants.setFontSize(newStyle, 15); - StyleConstants.setBold(newStyle, true); - StyleConstants.setForeground(newStyle, Color.red); - - newStyle = m_textPane.addStyle(TITLE, defaultStyle); - StyleConstants.setFontFamily(newStyle, "Courier"); - StyleConstants.setFontSize(newStyle, 16); - StyleConstants.setItalic(newStyle, true); - StyleConstants.setForeground(newStyle, Color.blue); - - newStyle = m_textPane.addStyle(PICK, defaultStyle); - // was Courier - didn't print some greek letters under Linux - StyleConstants.setFontFamily(newStyle, "Arial"); - - StyleConstants.setFontSize(newStyle, 13); - StyleConstants.setItalic(newStyle, true); - StyleConstants.setForeground(newStyle, Color.blue); - - // This is the way ALogOutput styled it's text, perhaps we should - // use NORMAL instead to unify the look of all the output boxes? - AD - m_systemDefaultStyle = context.getStyle(StyleContext.DEFAULT_STYLE); - } - - @Override - public synchronized void append(String s) { - append(s, m_systemDefaultStyle); - } - - @Override - public synchronized void append(String s, String style) { - append(s, m_textPane.getStyle(style)); - } - - private synchronized void append(String s, Style style) { - Document document = m_textPane.getDocument(); - try { - int size = document.getLength(); - - // if the string being appended gets too long, which happens in the - // demo mode runs and leads to OutOfMemory here, cut off the first - // half of the string in the information output - if (size > 51200) // 50kB - { - document.remove(0, size / 2); - - // another option of cutting the string would be - // (but it doesn't preserve styles): - // String text = textPane.getText(); - // textPane.setText(""); // clear all - // s = text.substring(size / 2, size - 1) + s; - - size = document.getLength(); - } - - document.insertString(size, s, style); - - // set the scrollbar to the bottom of the window - // previous solution: - // scrollPane.getViewport().setViewPosition(new Point(0, 9999999)); - // was sometimes crashing with IndexOutOfBoundException - m_textPane.setCaretPosition(document.getLength()); - - if (style.equals(ALogInterface.BAD_COMMAND) || style.equals(ALogInterface.WARNING)) { - Toolkit.getDefaultToolkit().beep(); - } - } catch (BadLocationException e) { - logger.error("Problem in ALogPane", e); - } - } - - @Override - public void clear() { - m_textPane.setText(""); - } - -} - -class PopupMenuListener_textPane extends MouseAdapter -{ - private JPopupMenu popupMenu; - - PopupMenuListener_textPane(JPopupMenu popupMenu) - { - this.popupMenu = popupMenu; - } - - public void mousePressed(MouseEvent evt) - { - showPopupMenu(evt); - } - - public void mouseReleased(MouseEvent evt) - { - showPopupMenu(evt); - } - - private void showPopupMenu(MouseEvent evt) - { - // decides whether right 'trigger' action was performed to show - // the popup menu (on the text pane - info output in GUI) - if (evt.isPopupTrigger()) - { - popupMenu.show(evt.getComponent(), evt.getX(), evt.getY()); - } - } - -} // class PopupMenuListener_textPane ======================================= - -class PopupMenuActionListener implements ActionListener -{ - ALogInterface adaptee; - - PopupMenuActionListener(ALogInterface adaptee) - { - this.adaptee = adaptee; - } - - // clear info output if the popup menu item was pressed - public void actionPerformed(ActionEvent e) - { - adaptee.clear(); - } - -} // class PopupMenuActionListener ========================================== diff --git a/graphics/AtlantisJava/src/atlantis/gui/AMainLogPane.java b/graphics/AtlantisJava/src/atlantis/gui/AMainLogPane.java deleted file mode 100644 index c493fad653f5a7ad13b0871618e85774abb15b86..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AMainLogPane.java +++ /dev/null @@ -1,13 +0,0 @@ -package atlantis.gui; - -/** - * The main logging pane showing user information - * @author Adam Davison - */ -public class AMainLogPane extends ALogPane { - - public AMainLogPane() { - super(); - append("Welcome to Atlantis !\n", TITLE); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AMenuButton.java b/graphics/AtlantisJava/src/atlantis/gui/AMenuButton.java deleted file mode 100644 index 3a939230f0dc8f0146fd0ebd3a2d5349f6b0f170..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AMenuButton.java +++ /dev/null @@ -1,46 +0,0 @@ -package atlantis.gui; - -import java.awt.Dimension; -import java.awt.FontMetrics; -import javax.swing.JMenuItem; - -/** - * AMenuButton is an object that acts like a JMenuItem but looks like a JMenu. - * This is for the buttons that we add directly to the menu bar. It does not - * allow the layout manager to change it size. - * - * @author Eric Jansen - */ -public class AMenuButton extends JMenuItem { - - /** Extra space needed to make JMenuItem and JMenu look the same */ - private static int EXTRA_SPACE = 6; - - /** Initial preferred size */ - private Dimension size; - - public AMenuButton(String title) { - super(title); - setOpaque(false); - - FontMetrics fm = getFontMetrics(getFont()); - size = super.getPreferredSize(); - size.width = getMargin().left + fm.stringWidth(title) - + getMargin().right + EXTRA_SPACE; - } - - @Override - public Dimension getMinimumSize() { - return size; - } - - @Override - public Dimension getMaximumSize() { - return size; - } - - @Override - public Dimension getPreferredSize() { - return size; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AMouseHelpDialog.java b/graphics/AtlantisJava/src/atlantis/gui/AMouseHelpDialog.java deleted file mode 100755 index c8c691abe24cfefdae7c08dd8f028fc9a9aa843d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AMouseHelpDialog.java +++ /dev/null @@ -1,312 +0,0 @@ -package atlantis.gui; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Font; -import java.awt.Frame; -import java.awt.Toolkit; -import java.util.ArrayList; -import java.util.EventObject; -import java.util.Iterator; -import java.util.Vector; - -import javax.swing.JFrame; -import javax.swing.JTable; -import javax.swing.event.CellEditorListener; -import javax.swing.table.AbstractTableModel; -import javax.swing.ButtonGroup; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableModel; -import javax.swing.table.TableCellRenderer; -import javax.swing.JRadioButton; - -import atlantis.canvas.ACanvas; -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.interactions.AInteraction; -import atlantis.interactions.AModifier; - -import java.awt.event.*; - -/** - * This dialog is used to display the mouse modifiers which are currently active - * Once more a singleton, but at least a proper one (private constructor) - */ -public class AMouseHelpDialog extends JFrame { - - private static JTable table; - static Object[][] rowData; - static Object[] columnNames; - private static AMouseHelpDialog instance; - private static final AGlobals globals = AGlobals.instance(); - - /** - * Private singleton constructor - */ - private AMouseHelpDialog() { - super("Help - Modifier Keys"); - - AIcon.setIconImage(this); - - table = new JTable() { - public TableCellRenderer getCellRenderer(int row, int column) { - if (column == 0) { - return new RadioRenderer(); - } - // else... - return super.getCellRenderer(row, column); - } - - public TableCellEditor getCellEditor(int row, int column) { - if (column == 0) { - return new RadioEditor(); - } else { - return super.getCellEditor(row, column); - } - } - }; - - table.setRowHeight(20); - - table.setFont(new Font("Monospaced", Font.PLAIN, table.getFont().getSize())); - table.setRowSelectionAllowed(false); - - getContentPane().add(table.getTableHeader(), BorderLayout.NORTH); - getContentPane().add(table, BorderLayout.CENTER); - setResizable(false); - - // From Java 1.5 we can tell the window to be always on top - this.setAlwaysOnTop(true); - - this.addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - // Reset key modifier when closing the window - AEventQueue.setDefault(AModifier.nothing); - } - }); - - pack(); - - } - - /** - * Get an instance of this singleton - * @return the AMouseHelpDialog instance - */ - public static AMouseHelpDialog getInstance() { - //Make sure no GUI object is created in headless mode - if (AGlobals.isAtlantisHeadless()) return null; - - //Create instance if it does not exist - if (instance == null) instance = new AMouseHelpDialog(); - return instance; - } - - - /** - * Overwrite setVisible to ensure proper placement of the dialog - * @param visible wether the dialog should be visible - */ - @Override - public void setVisible(boolean visible){ - - //Set the proper location on the screen - Frame gui = globals.getGuiFrame(); - int guiWidth = gui.getWidth(); - int guiX = gui.getX(); - int guiY = gui.getY(); - int dialogWidth = (int) instance.getPreferredSize().getWidth(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit().getScreenSize().getWidth()); - if (guiX + guiWidth + (dialogWidth - guiWidth) / 2 > screenWidth) - instance.setLocation(Math.max(0, screenWidth - dialogWidth), Math.max(0, guiY)); - else - instance.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), Math.max(0, guiY)); - - //And finally do set it visible! - super.setVisible(visible); - } - - public static void processInteractionChange(Vector interactions) { - if (ACanvas.getCanvas().getCurrentWindow() == null) - return; - - AModifier[] modifiers = ACanvas.getCanvas().getCurrentWindow().getInteractionManager().getMouseModifiers(); - ArrayList<AModifier> m = new ArrayList<AModifier>(); - for (int i = 0; i < modifiers.length; ++i) - m.add(modifiers[i]); - for (int i = 0; i < interactions.size(); ++i) { - AModifier[] mod = ((AInteraction) interactions.get(i)).getModifiers(); - for (int j = 0; j < mod.length; ++j) - m.add(mod[j]); - } - - // remove duplicates - for (int i = 0; i < m.size(); ++i) - for (int j = i + 1; j < m.size(); ++j) - if (m.get(i) != null && m.get(j) != null && ((AModifier)m.get(i)).sameAs((AModifier)m.get(j))) { - m.set(i, null); - } - - Iterator<AModifier> it = m.iterator(); - while (it.hasNext()) - if (it.next() == null) - it.remove(); - - // sort - for (int i = 0; i < m.size(); ++i) - for (int j = i + 1; j < m.size(); ++j) { - String n = m.get(i).toKeyString(); - String o = m.get(j).toKeyString(); - if (o.length() > n.length() || (o.length() == n.length() && (o.length() > 0 && (o.charAt(0) < n.charAt(0))))) { - AModifier temp = m.get(i); - m.set(i, m.get(j)); - m.set(j, temp); - } - } - - int foundnull = -1; - for (int i = 0; i < m.size(); i++) { - AModifier mod = (AModifier)m.get(i); - if (mod.sameAs(AModifier.nothing)) { - foundnull = i; - } - } - - if (foundnull == -1) { - m.add(AModifier.nothing); - } - - ButtonGroup bgroup = new ButtonGroup(); - - rowData = new Object[m.size()][3]; - for (int i = 0; i < rowData.length; ++i) { - AModifier mod = (AModifier)m.get(i); - JRadioButton but = new MouseHelpRadio(mod); - - if (mod.sameAs(AEventQueue.getDefault())) { - but.setSelected(true); - } - - if (mod.sameAs(AModifier.nothing)) { - foundnull = i; - } - - bgroup.add(but); - - rowData[i][0] = but; - rowData[i][1] = mod.toKeyString(); - rowData[i][2] = mod.toDescString(); - } - - columnNames = new String[] { "", "Key", "Action" }; - TableModel model = new AbstractTableModel() { - public String getColumnName(int column) { - return columnNames[column].toString(); - } - - public int getRowCount() { - return rowData.length; - } - - public int getColumnCount() { - return columnNames.length; - } - - public Object getValueAt(int row, int col) { - return rowData[row][col]; - } - - public boolean isCellEditable(int row, int column) { - if (column == 0) { - return true; - } else { - return false; - } - } - - public void setValueAt(Object value, int row, int col) { - rowData[row][col] = value; - fireTableCellUpdated(row, col); - } - }; - - table.setModel(model); - table.getColumnModel().getColumn(0).setPreferredWidth(22); - table.getColumnModel().getColumn(1).setPreferredWidth(80); - table.getColumnModel().getColumn(2).setPreferredWidth(300); - instance.pack(); - } - - private static class MouseHelpRadio extends JRadioButton { - - AModifier m_mod; - - public MouseHelpRadio(AModifier mod) { - m_mod = mod; - - this.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (isSelected()) { - AEventQueue.setDefault(m_mod); - } - // Previously selected radio button doesn't always paint it's - // unselection if you aren't careful - getParent().repaint(); - } - }); - } - - } - - private static class RadioRenderer implements TableCellRenderer { - - public RadioRenderer() { - } - - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int column) { - - return (JRadioButton)value; - } - - } - - private static class RadioEditor implements TableCellEditor { - - private JRadioButton button; - - public RadioEditor() { - - } - - public Object getCellEditorValue() { - return button; - } - - public boolean shouldSelectCell(EventObject anEvent) { - return false; - } - - public boolean isCellEditable(EventObject anEvent) { - return true; - } - - public void removeCellEditorListener(CellEditorListener l) { - } - - public void addCellEditorListener(CellEditorListener l) { - } - - public boolean stopCellEditing() { - return true; - } - - public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { - button = (JRadioButton)value; - return button; - } - - public void cancelCellEditing() { - } - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/gui/AMultiSpanCellTableUI.java b/graphics/AtlantisJava/src/atlantis/gui/AMultiSpanCellTableUI.java deleted file mode 100755 index cf0054cee6d72c3cd79345fe44b00bfa6ec23d90..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AMultiSpanCellTableUI.java +++ /dev/null @@ -1,81 +0,0 @@ -package atlantis.gui; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Graphics; -import java.awt.Rectangle; - -import javax.swing.JComponent; -import javax.swing.plaf.basic.BasicTableUI; -import javax.swing.table.TableCellRenderer; - -public class AMultiSpanCellTableUI extends BasicTableUI -{ - public void paint(Graphics g, JComponent c) - { - for (int index = 0; index < table.getRowCount(); index++) - { - paintRow(g, index); - } - } - - private void paintRow(Graphics g, int row) - { - AParamGUIDataModel tableModel = (AParamGUIDataModel) table.getModel(); - ADefaultCellAttribute cellAtt = tableModel.getCellAttribute(); - int numColumns = table.getColumnCount(); - - for (int column = 0; column < numColumns; column++) - { - Rectangle cellRect = table.getCellRect(row, column, true); - int cellRow, cellColumn; - if (cellAtt.isVisible(row, column)) - { - cellRow = row; - cellColumn = column; - } - else - { - cellRow = row + cellAtt.getSpan(row, column)[ADefaultCellAttribute.ROW]; - cellColumn = column + cellAtt.getSpan(row, column)[ADefaultCellAttribute.COLUMN]; - } - paintCell(g, cellRect, cellRow, cellColumn); - } - } - - private void paintCell(Graphics g, Rectangle cellRect, int row, int column) - { - int spacingHeight = table.getRowMargin(); - int spacingWidth = table.getColumnModel().getColumnMargin(); - - Color c = g.getColor(); - g.setColor(table.getGridColor()); - g.drawRect(cellRect.x, cellRect.y, cellRect.width - 1, - cellRect.height - 1); - g.setColor(c); - - cellRect.setBounds(cellRect.x + spacingWidth / 2, cellRect.y - + spacingHeight / 2, cellRect.width - spacingWidth, - cellRect.height - spacingHeight); - - if (table.isEditing() && table.getEditingRow() == row - && table.getEditingColumn() == column) - { - Component component = table.getEditorComponent(); - component.setBounds(cellRect); - component.validate(); - } - else - { - TableCellRenderer renderer = table.getCellRenderer(row, column); - Component component = table.prepareRenderer(renderer, row, column); - - if (component.getParent() == null) - { - rendererPane.add(component); - } - rendererPane.paintComponent(g, component, table, cellRect.x, - cellRect.y, cellRect.width, cellRect.height, true); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AMutableCheckBox.java b/graphics/AtlantisJava/src/atlantis/gui/AMutableCheckBox.java deleted file mode 100755 index 92390995e52ebf912cb78924c25266c988b156a6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AMutableCheckBox.java +++ /dev/null @@ -1,183 +0,0 @@ -package atlantis.gui; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.LayoutManager; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.Vector; - -import javax.swing.BorderFactory; -import javax.swing.JLabel; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.LookAndFeel; - -import atlantis.utils.AUtilities; - -/** - * Used to display the status and the operator(<,>,=..etc) of a Cut Parameter. - */ -public class AMutableCheckBox extends JPanel { - private JLabel label; - private ACheckBox checkBox; - private javax.swing.Timer timer; - private JPopupMenu popup; - private String selectedText; - private ActionListener statusActionListener, textActionListener; - private Vector oper=new Vector(); - - public AMutableCheckBox(String name) { - setLayout(new AMutableCheckBoxLayout()); - setBorder(null); - - checkBox=new ACheckBox(name); - checkBox.setBackground(new Color(204, 204, 204)); - checkBox.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if(statusActionListener!=null) - statusActionListener.actionPerformed(new ActionEvent(get(), 0, "")); - } - }); - add("CHECKBOX", checkBox); - - popup=new JPopupMenu(); - } - - // must be called after all the parameters whose added - public void finalizeConstruction() { - label=new JLabel("", JLabel.CENTER); - label.setBorder(BorderFactory.createLineBorder(new Color(153, 153, 153), 1)); - LookAndFeel.installColorsAndFont(label, "CheckBox.background", "CheckBox.foreground", - "CheckBox.font"); - add("LABEL", label); - - // setting the timmer and popup (if more than 2 supportedOperators) - if(oper.size()>2) { - timer=new javax.swing.Timer(50, new ActionListener() { - public void actionPerformed(ActionEvent e) { - Dimension d=label.getSize(); - - popup.show(label, 0, d.height); - } - }); - timer.setRepeats(false); - } - - // setting the mouse listeners - if(oper.size()<=2) - label.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - if(AUtilities.isRightMouseButton(e)||oper.size()==1){ - return; - } - String text0=(String)oper.elementAt(0); - String text1=(String)oper.elementAt(1); - - if(selectedText.equals(text0)) setSelectedText(text1); - else if(selectedText.equals(text1)) setSelectedText(text0); - - if(textActionListener!=null) - textActionListener.actionPerformed(new ActionEvent(get(), 0, "")); - } - }); - else - label.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - if(!AUtilities.isRightMouseButton(e)) - timer.start(); - } - - public void mouseReleased(MouseEvent e) { - if(!AUtilities.isRightMouseButton(e)) - timer.stop(); - } - }); - } - - private JPanel get() { - return this; - } - - public ACheckBox getCheckBox(){ - return checkBox; - } - - public void addItem(String s) { - oper.addElement(s); - - popup.add(s).addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - JMenuItem item=(JMenuItem)e.getSource(); - - setSelectedText(item.getText()); - if(textActionListener!=null) - textActionListener.actionPerformed(new ActionEvent(get(), 0, "")); - } - }); - } - - public void setSelectedText(String text) { - selectedText=text; - label.setText(selectedText); - } - - public String getSelectedText() { - return selectedText; - } - - public boolean getStatus() { - return checkBox.isSelected(); - } - - public void setStatus(boolean status) { - checkBox.setSelected(status); - } - - public void addTextActionListener(ActionListener listener) { - textActionListener=listener; - } - - public void addStatusActionListener(ActionListener listener) { - statusActionListener=listener; - } - - public void setForeground(Color color) { - if(checkBox!=null) - checkBox.setForeground(color); - } -} - -class AMutableCheckBoxLayout implements LayoutManager { - private Component checkBox, label; - - public void addLayoutComponent(String name, Component comp) { - if(name.equals("CHECKBOX")) checkBox=comp; - else if(name.equals("LABEL")) label=comp; - } - - public void layoutContainer(Container parent) { - Dimension p=parent.getSize(); - Dimension l=label.getPreferredSize(); - Dimension c=checkBox.getPreferredSize(); - - checkBox.setBounds(0, (p.height-c.height)/2, p.width-l.width-10, c.height); - label.setBounds(p.width-l.width-10, -1, l.width+10+1, p.height+2); - } - - public Dimension minimumLayoutSize(Container parent) { - return new Dimension(10, 10); - } - - public Dimension preferredLayoutSize(Container parent) { - return new Dimension(100, 100); - } - - // Removes the specified component from the layout. - public void removeLayoutComponent(Component comp) {} -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AOpenGLControl.java b/graphics/AtlantisJava/src/atlantis/gui/AOpenGLControl.java deleted file mode 100644 index 3df9c139c0167525380641e86d8ce1049f31d8d1..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AOpenGLControl.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package atlantis.gui; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.canvas.AWindowGLView; -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.ButtonGroup; -import javax.swing.JCheckBoxMenuItem; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.JRadioButtonMenuItem; -import javax.swing.JSeparator; -import javax.swing.event.MenuEvent; -import javax.swing.event.MenuListener; - -/** - * - * @author Adam - */ -public class AOpenGLControl extends JMenu implements MenuListener, ActionListener { - - private ButtonGroup m_bg = new ButtonGroup(); - private JRadioButtonMenuItem m_fsaa0 = new JRadioButtonMenuItem("No AA"); - private JRadioButtonMenuItem m_fsaa2 = new JRadioButtonMenuItem("2x FSAA"); - private JRadioButtonMenuItem m_fsaa4 = new JRadioButtonMenuItem("4x FSAA"); - private JRadioButtonMenuItem m_fsaa6 = new JRadioButtonMenuItem("6x FSAA"); - private JRadioButtonMenuItem m_fsaa8 = new JRadioButtonMenuItem("8x FSAA"); - private JCheckBoxMenuItem m_blendborder = new JCheckBoxMenuItem("Blend Border"); - private boolean m_updating = false; - - public AOpenGLControl() { - super("OpenGL"); - - m_bg.add(m_fsaa0); - m_bg.add(m_fsaa2); - m_bg.add(m_fsaa4); - m_bg.add(m_fsaa6); - m_bg.add(m_fsaa8); - - add(m_fsaa0); - add(m_fsaa2); - add(m_fsaa4); - add(m_fsaa6); - add(m_fsaa8); - add(new JSeparator()); - add(m_blendborder); - - m_fsaa0.addActionListener(this); - m_fsaa2.addActionListener(this); - m_fsaa4.addActionListener(this); - m_fsaa6.addActionListener(this); - m_fsaa8.addActionListener(this); - - m_blendborder.addActionListener(this); - - addMenuListener(this); - } - - public void menuSelected(MenuEvent e) { - m_updating = true; - - int maxFSAA = AWindowGLView.getMaxFSAA(); - - m_fsaa2.setEnabled(false); - m_fsaa4.setEnabled(false); - m_fsaa6.setEnabled(false); - m_fsaa8.setEnabled(false); - - if (maxFSAA >= 2) { - m_fsaa2.setEnabled(true); - - if (maxFSAA >= 4) { - m_fsaa4.setEnabled(true); - - if (maxFSAA >= 6) { - m_fsaa6.setEnabled(true); - - if (maxFSAA >= 8) { - m_fsaa8.setEnabled(true); - } - } - } - } - - int currentFSAA = AWindowGLView.getCurrentFSAA(); - - switch (currentFSAA) { - case 0: - m_fsaa0.setSelected(true); - break; - case 2: - m_fsaa2.setSelected(true); - break; - case 4: - m_fsaa4.setSelected(true); - break; - case 6: - m_fsaa6.setSelected(true); - break; - case 8: - m_fsaa8.setSelected(true); - break; - default: - break; - } - - m_updating = false; - } - - public void menuDeselected(MenuEvent e) { - //throw new UnsupportedOperationException("Not supported yet."); - } - - public void menuCanceled(MenuEvent e) { - //throw new UnsupportedOperationException("Not supported yet."); - } - - public void actionPerformed(ActionEvent e) { - if (m_updating) { - return; - } - - JMenuItem src = (JMenuItem) (e.getSource()); - - if (src == m_fsaa0) { - AWindowGLView.setCurrentFSAA(0); - } else if (src == m_fsaa2) { - AWindowGLView.setCurrentFSAA(2); - } else if (src == m_fsaa4) { - AWindowGLView.setCurrentFSAA(4); - } else if (src == m_fsaa6) { - AWindowGLView.setCurrentFSAA(6); - } else if (src == m_fsaa8) { - AWindowGLView.setCurrentFSAA(8); - } else if (src == m_blendborder) { - int oldr = AWindow.BORDER_BACKGROUND_COLOR.getRed(); - int oldg = AWindow.BORDER_BACKGROUND_COLOR.getGreen(); - int oldb = AWindow.BORDER_BACKGROUND_COLOR.getBlue(); - int oldselr = AWindow.BORDER_SELECTED_BACKGROUND_COLOR.getRed(); - int oldselg = AWindow.BORDER_SELECTED_BACKGROUND_COLOR.getGreen(); - int oldselb = AWindow.BORDER_SELECTED_BACKGROUND_COLOR.getBlue(); - if (m_blendborder.getState()) { - AWindow.BORDER_BACKGROUND_COLOR = new Color(oldr, oldg, oldb, 127); - AWindow.BORDER_SELECTED_BACKGROUND_COLOR = new Color( - oldselr, oldselg, oldselb, 127); - } else { - AWindow.BORDER_BACKGROUND_COLOR = new Color(oldr, oldg, oldb, 255); - AWindow.BORDER_SELECTED_BACKGROUND_COLOR = new Color( - oldselr, oldselg, oldselb, 255); - } - ACanvas.getCanvas().repaintAllFromScratch(); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AParamGUIDataModel.java b/graphics/AtlantisJava/src/atlantis/gui/AParamGUIDataModel.java deleted file mode 100755 index b1b03a9a1ebf9ed63be66b001737c8960721121d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AParamGUIDataModel.java +++ /dev/null @@ -1,173 +0,0 @@ -package atlantis.gui; - -import java.awt.Component; -import java.util.EventObject; -import java.util.Vector; - -import javax.swing.JTable; -import javax.swing.JTree; -import javax.swing.event.CellEditorListener; -import javax.swing.table.AbstractTableModel; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; - -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.parameters.AParametersGroup; -import atlantis.parameters.AStatusRootParameter; - -/** - * The data model used to create the custom tables which contain parameters. - */ -class AParamGUIDataModel extends AbstractTableModel implements - TableCellEditor, TableCellRenderer -{ - private Vector<AParameter> parametersList; - // if there is a tree in a cell, the height of the cell should be decided by the tree - private int[] rowHeight; - // indicate if there is a tree in this table - private boolean isTree = false; - private JTree tree = null; - private int treeRowNumber = -1; - private ADefaultCellAttribute cellAtt; - - AParamGUIDataModel(AParametersGroup group) - { - parametersList = group.getParameters(APar.instance().getUserLevel()); - rowHeight = new int[parametersList.size()]; - - cellAtt = new ADefaultCellAttribute(rowHeight.length, 2); - - for (int i = 0; i < parametersList.size(); i++) - { - AParameter p = (AParameter) parametersList.elementAt(i); - if (!p.isInitialized()) - p.initialize(); - if (p instanceof AStatusRootParameter) - { - isTree = true; - tree = (JTree) ((AStatusRootParameter) p).getNameComponent(); - treeRowNumber = i; - rowHeight[i] = tree.getRowCount() - * (int) (tree.getRowBounds(0).getHeight()); - int[] columns = { 0, 1 }; - int[] rows = { i }; - cellAtt.combine(rows, columns); - } - else - rowHeight[i] = 25; - } - } - - public ADefaultCellAttribute getCellAttribute() - { - return cellAtt; - } - - int getRowHeight(int rowIndex) - { - return rowHeight[rowIndex]; - } - - public int getTreeRow() - { - return treeRowNumber; - } - - public boolean hasTree() - { - return isTree; - } - - public JTree getTree() - { - return tree; - } - - public int getRowCount() - { - return parametersList.size(); - } - - public int getColumnCount() - { - return 2; - } - - public Object getValueAt(int rowIndex, int columnIndex) - { - return new Integer(0); - } - - public boolean isCellEditable(int rowIndex, int columnIndex) - { - return true; - } - - public void refresh() - { - for (int i = 0; i < parametersList.size(); i++) - { - AParameter p = (AParameter) parametersList.elementAt(i); - p.refresh(); - } - } - - // TableCellRenderer implementation - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, int row, int column) - { - return getTableCellEditorComponent(table, value, isSelected, row, - column); - } - - // TableCellEditor implementation - public Component getTableCellEditorComponent(JTable table, Object value, - boolean isSelected, int row, int column) - { - AParameter p = (AParameter) parametersList.elementAt(row); - switch (column) - { - case 0: - return p.getNameComponent(); - case 1: - return p.getValueComponent(); - default: - return null; - } - } - - public AParameter getParameter(int row) - { - return (AParameter) parametersList.elementAt(row); - } - - public Object getCellEditorValue() - { - return new Integer(0); - } - - public boolean isCellEditable(EventObject anEvent) - { - return true; - } - - public boolean shouldSelectCell(EventObject anEvent) - { - return true; - } - - public boolean stopCellEditing() - { - return true; - } - - public void cancelCellEditing() - {} - - public void addCellEditorListener(CellEditorListener l) - {} - - public void removeCellEditorListener(CellEditorListener l) - {} -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AParametersPage.java b/graphics/AtlantisJava/src/atlantis/gui/AParametersPage.java deleted file mode 100755 index 6217ed42aa08a0dd1af069897e10b9bea75f25f2..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AParametersPage.java +++ /dev/null @@ -1,44 +0,0 @@ -package atlantis.gui; - -import atlantis.graphics.layout.AFlowLayout; -import atlantis.parameters.ACommand; -import atlantis.parameters.AParametersGroup; -import javax.swing.JScrollPane; -import javax.swing.JPanel; - -/** - * Used to display a table of parameters together with their associated - * commands in the Parameters Control. - */ -public class AParametersPage extends ALazyPanel { - private AParametersGroup group; - AParametersTable pTable; - - public AParametersPage(AParametersGroup group) { - this.group=group; - } - - protected void lazyConstructor() { - setLayout(new AGUILayoutManager()); - setBorder(null); - - add(createCommandsPanel(group), AGUILayoutManager.AVAILABLExPREFERRED); - - pTable=new AParametersTable(group); - pTable.setName(group.getScreenName()); - add(new JScrollPane(pTable), AGUILayoutManager.AVAILABLExAVAILABLE); - } - - private JPanel createCommandsPanel(AParametersGroup group) { - JPanel commandPanel=new JPanel(new AFlowLayout(5, 5)); - - commandPanel.setBorder(null); - ACommand[] commands=group.getCommands(); - - for(int j=0; j<commands.length; j++) - commandPanel.add(commands[j]); - - return commandPanel; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AParametersTable.java b/graphics/AtlantisJava/src/atlantis/gui/AParametersTable.java deleted file mode 100755 index 869510eaf7ff7cc02d9b7a28f97f4c79620ded8c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AParametersTable.java +++ /dev/null @@ -1,253 +0,0 @@ -package atlantis.gui; - -import java.awt.Dimension; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.Enumeration; - -import javax.swing.JPopupMenu; -import javax.swing.JTable; -import javax.swing.JTree; -import javax.swing.event.ListSelectionEvent; -import javax.swing.table.TableColumn; - -import atlantis.parameters.AParameter; -import atlantis.parameters.AParametersGroup; -import atlantis.parameters.AStatusRootParameter; -import atlantis.utils.AUtilities; - -/** - * The graphical object which contains all the parameter of a single group. - * Appears in the GUI. - */ -public class AParametersTable extends JTable -{ - private TableColumn column; - private AParamGUIDataModel dataModel; - public final static String SET_GLOBAL = "Set Global"; - public final static String SET_LOCAL = "Set Local"; - public final static String SET_ALL_GLOBAL = "Set All Global"; - public final static String SET_ALL_LOCAL = "Set All Local"; - - public AParametersTable(AParametersGroup g) - { - super(); - dataModel = new AParamGUIDataModel(g); - setModel(dataModel); - for (int i = 0; i < dataModel.getRowCount(); i++) - this.setRowHeight(i, dataModel.getRowHeight(i)); - if (dataModel.hasTree()) - { - JTree theTree = dataModel.getTree(); - theTree.addTreeExpansionListener(new ATreeExpansionListener( - theTree, this, dataModel.getTreeRow())); - } - column = getColumnModel().getColumn(0); - column.setHeaderValue("Name"); - column.setCellEditor(dataModel); - column.setCellRenderer(dataModel); - column.setPreferredWidth(110); - column = getColumnModel().getColumn(1); - column.setHeaderValue("Value"); - column.setCellEditor(dataModel); - column.setCellRenderer(dataModel); - column.setPreferredWidth(100); - setUI(new AMultiSpanCellTableUI()); - setCellSelectionEnabled(true); - - addMouseListener(new MouseAdapter() { - private int pressedX; - private int pressedY; - - public void mousePressed(MouseEvent e) - { - int clickedRow = rowAtPoint(e.getPoint()); - int clickedCol = columnAtPoint(e.getPoint()); - final AParameter p = ((AParamGUIDataModel) getModel()) - .getParameter(clickedRow); - if ((p instanceof AStatusRootParameter) && (clickedCol == 0)) - { - MouseListener[] theMLs = ((JTree) p.getNameComponent()) - .getMouseListeners(); - for (int i = 0; i < theMLs.length; i++) - { - if (theMLs[i] instanceof AStatusRootParameter.NodeSelectionListener) - { - Rectangle clickedRec = getCellRect(clickedRow, - clickedCol, false); - ((AStatusRootParameter.NodeSelectionListener) theMLs[i]) - .setOffset(clickedRec.x, clickedRec.y); - e.translatePoint(-clickedRec.x, -clickedRec.y); - if (AUtilities.isRightMouseButton(e)) - theMLs[i].mousePressed(e); - else - { - pressedX = e.getX(); - pressedY = e.getY(); - } - } - } - return; - } - if (AUtilities.isRightMouseButton(e) && (clickedCol == 0)) - { - JPopupMenu popupMenu = new JPopupMenu(); - if (p.getScope() == AParameter.LOCAL) - { - popupMenu.add(SET_GLOBAL).addActionListener( - new ActionListener() { - public void actionPerformed(ActionEvent e) - { - p.changeScope(AParameter.GLOBAL); - refresh(); - } - }); - } - else - { - popupMenu.add(SET_LOCAL).addActionListener( - new ActionListener() { - public void actionPerformed(ActionEvent e) - { - p.changeScope(AParameter.LOCAL); - refresh(); - } - }); - } - popupMenu.show(AParametersTable.this, e.getX(), e.getY()); - } - } - - // have no idea why mouseClicked cannot be invoked when clicking the - // table - // only mousePressed & mouseReleased can be invoked - public void mouseReleased(MouseEvent e) - { - int clickedRow = rowAtPoint(e.getPoint()); - // when the position of mouse releasing is out of the table, - // clickedRow = -1 - // e.g. when you change a value of a combo box, and the list of - // this combo box is rather long - if (clickedRow < 0) - return; - int clickedCol = columnAtPoint(e.getPoint()); - final AParameter p = ((AParamGUIDataModel) getModel()) - .getParameter(clickedRow); - if ((p instanceof AStatusRootParameter) && (clickedCol == 0)) - { - MouseListener[] theMLs = ((JTree) p.getNameComponent()) - .getMouseListeners(); - for (int i = 0; i < theMLs.length; i++) - { - if (theMLs[i] instanceof AStatusRootParameter.NodeSelectionListener) - { - Rectangle clickedRec = getCellRect(clickedRow, - clickedCol, false); - ((AStatusRootParameter.NodeSelectionListener) theMLs[i]) - .setOffset(clickedRec.x, clickedRec.y); - e.translatePoint(-clickedRec.x, -clickedRec.y); - if ((pressedX == e.getX()) - && (pressedY == e.getY())) - theMLs[i].mouseClicked(e); - } - } - return; - } - } - }); - // needed but I don't know why gary 25/10/2002 - refresh(); - } - - public void refresh() - { - dataModel.refresh(); - setEditingColumn(2); - setEditingRow(0); - } - - public Rectangle getCellRect(int row, int column, boolean includeSpacing) - { - Rectangle sRect = super.getCellRect(row, column, includeSpacing); - if ((row < 0) || (column < 0) || (getRowCount() <= row) - || (getColumnCount() <= column)) - { - return sRect; - } - ADefaultCellAttribute cellAtt = ((AParamGUIDataModel) getModel()).getCellAttribute(); - if (!cellAtt.isVisible(row, column)) - { - int temp_row = row; - int temp_column = column; - row += cellAtt.getSpan(temp_row, temp_column)[ADefaultCellAttribute.ROW]; - column += cellAtt.getSpan(temp_row, temp_column)[ADefaultCellAttribute.COLUMN]; - } - int[] n = cellAtt.getSpan(row, column); - - int index = 0; - int columnMargin = getColumnModel().getColumnMargin(); - Rectangle cellFrame = new Rectangle(); - int aCellHeight = sRect.height + rowMargin; - cellFrame.y = sRect.y; - cellFrame.height = n[ADefaultCellAttribute.ROW] * aCellHeight; - - Enumeration enumeration = getColumnModel().getColumns(); - while (enumeration.hasMoreElements()) - { - TableColumn aColumn = (TableColumn) enumeration.nextElement(); - cellFrame.width = aColumn.getWidth() + columnMargin; - if (index == column) - break; - cellFrame.x += cellFrame.width; - index++; - } - for (int i = 0; i < n[ADefaultCellAttribute.COLUMN] - 1; i++) - { - TableColumn aColumn = (TableColumn) enumeration.nextElement(); - cellFrame.width += aColumn.getWidth() + columnMargin; - } - - if (!includeSpacing) - { - Dimension spacing = getIntercellSpacing(); - cellFrame.setBounds(cellFrame.x + spacing.width / 2, cellFrame.y - + spacing.height / 2, cellFrame.width - spacing.width, - cellFrame.height - spacing.height); - } - return cellFrame; - } - - public void columnSelectionChanged(ListSelectionEvent e) - { - repaint(); - } - - public void valueChanged(ListSelectionEvent e) - { - int firstIndex = e.getFirstIndex(); - int lastIndex = e.getLastIndex(); - if (firstIndex == -1 && lastIndex == -1) - { - repaint(); - } - Rectangle dirtyRegion = getCellRect(firstIndex, 0, false); - int numCoumns = getColumnCount(); - int index = firstIndex; - for (int i = 0; i < numCoumns; i++) - { - dirtyRegion.add(getCellRect(index, i, false)); - } - index = lastIndex; - for (int i = 0; i < numCoumns; i++) - { - dirtyRegion.add(getCellRect(index, i, false)); - } - repaint(dirtyRegion.x, dirtyRegion.y, dirtyRegion.width, - dirtyRegion.height); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/APasswordDialog.java b/graphics/AtlantisJava/src/atlantis/gui/APasswordDialog.java deleted file mode 100755 index eb54cbf2ec8c8ed66aee64094763041579c19d3c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/APasswordDialog.java +++ /dev/null @@ -1,203 +0,0 @@ -package atlantis.gui; - -import java.awt.Frame; -import java.awt.Container; -import java.awt.BorderLayout; -import java.awt.GridLayout; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JPanel; -import javax.swing.JTextField; -import javax.swing.JPasswordField; -import javax.swing.JLabel; -import javax.swing.BoxLayout; - -import java.net.PasswordAuthentication; -import java.net.Authenticator; - -import atlantis.utils.ALogger; - -/** - * Provides a dialogue to prompt the user for a username and password for - * reading events from a password-protected URL. - * - * @author waugh - */ -public class APasswordDialog extends JDialog -{ - private static final long serialVersionUID = 1L; - - private static ALogger logger = ALogger.getLogger(APasswordDialog.class); - // input fields - protected JTextField userField; - protected JPasswordField passwordField; - // authentication object containing username and password - protected PasswordAuthentication pwAuth; - - /** - * Create APasswordDialog belonging to given frame - * @param frame owner of dialogue - */ - protected APasswordDialog(Frame frame, String prompt) { - // There is almost certainly a better way to do the layout... - super(frame,"Password Dialogue",true); - Container contentPane = getContentPane(); - - // Create panels to place in content pane - JPanel mainPanel = new JPanel(); - JPanel labelPanel = new JPanel(); - JPanel inputPanel = new JPanel(); - JPanel buttonPanel = new JPanel(); - - // Create components (labels, inputs) to put in panels - JLabel label = new JLabel(prompt); - JLabel userLabel = new JLabel("User name"); - JLabel passwordLabel = new JLabel("Password"); - userField = new JTextField(15); - passwordField = new JPasswordField(15); - JButton okButton = new JButton("OK"); - JButton cancelButton = new JButton("Cancel"); - - // Associate labels with corresponding input fields - userLabel.setLabelFor(userField); - passwordLabel.setLabelFor(passwordField); - - // Specify layout of dialogue - contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); - mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.X_AXIS)); - labelPanel.setLayout(new BoxLayout(labelPanel,BoxLayout.Y_AXIS)); - inputPanel.setLayout(new BoxLayout(inputPanel,BoxLayout.Y_AXIS)); - buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.X_AXIS)); - - // Put everything together: components in panels... - contentPane.add(label); - contentPane.add(mainPanel); - contentPane.add(buttonPanel); - - mainPanel.add(labelPanel); - mainPanel.add(inputPanel); - - labelPanel.add(userLabel); - labelPanel.add(passwordLabel); - - inputPanel.add(userField); - inputPanel.add(passwordField); - - buttonPanel.add(okButton); - buttonPanel.add(cancelButton); - - // click OK: construct authentication object from given name/password - okButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) { - String userName = userField.getText(); - char[] password = passwordField.getPassword(); - pwAuth = new PasswordAuthentication(userName,password); - dispose(); - } - } - ); - - // click cancel: dispose of dialogue with no authentication object - cancelButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) { - pwAuth = null; - dispose(); - } - } - ); - pack(); - - // set position on screen (otherwise defaults to top left) - int guiWidth = frame.getWidth(); - int guiHeight = frame.getHeight(); - int guiX = frame.getX(); - int dialogWidth = (int) this.getPreferredSize().getWidth(); - int dialogHeight = (int) this.getPreferredSize().getHeight(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit().getScreenSize().getWidth()); - if(guiX+guiWidth+(dialogWidth-guiWidth)/2>screenWidth) - this.setLocation(Math.max(0, screenWidth - dialogWidth), Math.max(0, (guiHeight - dialogHeight) / 3)); - else - this.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), Math.max(0, (guiHeight - dialogHeight) / 3)); - - } - - /** - * Create APasswordDialog belonging to given frame, with default prompt - * @param frame owner of dialogue - */ - protected APasswordDialog(Frame frame) { - this(frame,"Authentication required"); - } - - /** Gets authentication object - * - * @return PasswordAuthentication object required by Authenticator - */ - protected PasswordAuthentication getPasswordAuthentication() { - return pwAuth; - } - - /** - * Displays username/password dialogue and returns authentication object. - * @param frame owner of dialogue, e.g. Atlantis GUI - * @prompt prompt to show user - * @return authentication object constructed from entered username/password, - * or null if dialogue cancelled - */ - public static PasswordAuthentication showDialog(Frame frame, String prompt) { - APasswordDialog d = new APasswordDialog(frame,prompt); - d.setVisible(true); - return d.getPasswordAuthentication(); - } - - /** - * Displays username/password dialogue with default prompt and returns authentication object. - * @param frame owner of dialogue, e.g. Atlantis GUI - * @return authentication object constructed from entered username/password, - * or null if dialogue cancelled - */ - public static PasswordAuthentication showDialog(Frame frame) { - APasswordDialog d = new APasswordDialog(frame); - d.setVisible(true); - return d.getPasswordAuthentication(); - } - - /** - * Constructs and returns Authenticator object as required by - * java.net.Authenticator.setDefault() - * @param f owner of dialogue, e.g. Atlantis GUI - * @return Authenticator that will create APasswordDialog when called - */ - public static Authenticator getAuthenticator(Frame f) { - return new PasswordAuthenticator(f); - } - - /** - * Private nested Authenticator subclass to be instantiated and returned - * by getAuthenticator(). - * @author waugh - */ - private static class PasswordAuthenticator extends Authenticator { - protected Frame f; - public PasswordAuthenticator(Frame frame) {f=frame;} - protected PasswordAuthentication getPasswordAuthentication() { - logger.info("Authentication required: requesting host:"+getRequestingHost()); - logger.info("Authentication required: requesting site:"+getRequestingSite()); - logger.info("Authentication required: requesting protocol:"+getRequestingProtocol()); - logger.info("Authentication required: requesting prompt:"+getRequestingPrompt()); - logger.info("Authentication required: requesting scheme:"+getRequestingScheme()); - // logger.info("Authentication required: requesting URL:"+getRequestingURL()); - String prompt = "Authentication required by host "+getRequestingHost()+ - " with prompt \""+getRequestingPrompt()+"\""; - return APasswordDialog.showDialog(f,prompt); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/APointerPositionWindow.java b/graphics/AtlantisJava/src/atlantis/gui/APointerPositionWindow.java deleted file mode 100755 index dffdc697ca1db5048ed45a270f80af17f885a28c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/APointerPositionWindow.java +++ /dev/null @@ -1,175 +0,0 @@ -package atlantis.gui; - -import java.awt.Color; -import java.awt.Frame; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; - -import javax.swing.JFrame; -import javax.swing.JMenuItem; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTextPane; - -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; - -import java.awt.BorderLayout; -import java.awt.event.MouseListener; -import javax.swing.JLabel; - - -/** - * The pointer postion window apears when selected in the preferences menu or - * by using o+right click. - * - * @author Sebastian Boeser - */ -public class APointerPositionWindow extends JFrame - implements WindowListener, ActionListener, MouseListener - -{ - private static JLabel infoLabel; - private static JPopupMenu popupMenu; - private static JMenuItem menuItemClearTextPane; - private static JTextPane textPane; - private static JScrollPane scrollPane; - private static APointerPositionWindow instance = null; - private static final AGlobals globals = AGlobals.instance(); - - public static APointerPositionWindow getInstance() - { - if (instance == null) - instance = new APointerPositionWindow(); - return instance; - } - - private APointerPositionWindow() - { - this.setTitle("Your Pointer Position"); - AIcon.setIconImage(this); - - //delete window if closed - setDefaultCloseOperation(DISPOSE_ON_CLOSE); - addWindowListener(this); - - //Tell user how to use this - infoLabel = new JLabel(); - infoLabel.setText("To output your pointer position use: O + Right click\n"); - - // popup menu at text pane (info output at bottom half of window) - popupMenu = new JPopupMenu(); - menuItemClearTextPane = new JMenuItem("Erase output"); - menuItemClearTextPane.addActionListener(this); - popupMenu.add(menuItemClearTextPane); - - // Text panel to show coordinates - textPane = new JTextPane(); - textPane.setEditable(false); - textPane.setBackground(Color.white); - textPane.setText("Coordinates will be displayed here\n"); - textPane.addMouseListener(this); - - // Embedd in a scroll frame - scrollPane = new JScrollPane(textPane); - scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); - scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); - - add(infoLabel,BorderLayout.NORTH); - add(scrollPane,BorderLayout.CENTER); - - // set the initial location - Frame gui = globals.getGuiFrame(); - int guiWidth = gui.getWidth(); - int guiHeight = gui.getHeight(); - int guiX = gui.getX(); - int dialogWidth = (int) this.getPreferredSize().getWidth(); - int dialogHeight = (int) this.getPreferredSize().getHeight(); - int screenWidth = Math.round((float) Toolkit.getDefaultToolkit() - .getScreenSize().getWidth()); - if (guiX + guiWidth + (dialogWidth - guiWidth) / 2 > screenWidth) - this.setLocation(Math.max(0, screenWidth - dialogWidth), Math.max( - 0, (guiHeight - dialogHeight) / 3)); - else - this.setLocation(Math.max(0, guiX + (guiWidth - dialogWidth) / 2), - Math.max(0, (guiHeight - dialogHeight) / 3)); - //Layout the window - pack(); - } - - public static void append(String s) - { - String text = textPane.getText(); - int size = text.length(); - //just as a precaution incase too many coordinates output - if(size > 51200) // 50kB - { - textPane.setText(""); // clear all - text = text.substring(size / 2, size - 1) + "\n"; - } - s = text + "\n" + s; - textPane.setText(s); - } - - void clearTextPane(ActionEvent e) - { - textPane.setText("Coordinates will be displayed here\n"); - } - - public void dispose() - { - instance = null; - super.dispose(); - } - - // clear info output if the popup menu item was pressed - public void actionPerformed(ActionEvent e) - { - clearTextPane(e); - } - - - public void windowClosed(WindowEvent e) - { - // when this window is disposed, the menu item is switched off - APreferencesControl.setPosMenuItem(false); - } - - public void mousePressed(MouseEvent evt) - { - showPopupMenu(evt); - } - - public void mouseReleased(MouseEvent evt) - { - showPopupMenu(evt); - } - - private void showPopupMenu(MouseEvent evt) - { - // decides whether right 'trigger' action was performed to show - // the popup menu (on the text pane - info output in GUI) - if (evt.isPopupTrigger()) - { - popupMenu.show(evt.getComponent(), evt.getX(), evt.getY()); - } - } - - // Empty implementations of unused windows events - public void windowOpened(WindowEvent e){} - public void windowClosing(WindowEvent e){} - public void windowIconified(WindowEvent e){} - public void windowDeiconified(WindowEvent e){} - public void windowActivated(WindowEvent e){} - public void windowDeactivated(WindowEvent e){} - - // Empty implementation of unused mouse events - public void mouseClicked(MouseEvent e) {} - public void mouseEntered(MouseEvent e) {} - public void mouseExited(MouseEvent e) {} - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/APopupHelper.java b/graphics/AtlantisJava/src/atlantis/gui/APopupHelper.java deleted file mode 100644 index ef1dd510ce04ca7977fec43311a3cc0fdd4a4cd4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/APopupHelper.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * APopupHelper.java - * - * Created on 24 October 2007, 09:12 - * - * @author Adam Davison - */ - -package atlantis.gui; - -import javax.swing.JPopupMenu; -import javax.swing.JMenuItem; -import java.awt.Point; -import java.awt.Component; - -/** - * - * @author Adam Davison - */ - -public class APopupHelper { - - public static void showPopupMenu(Point p, Component window, JMenuItem[] items) { - JPopupMenu pop = getPopupMenu(items); - - if (pop == null) { - return; - } - - pop.show(window, (int)p.getX(), (int)p.getY()); - } - - public static JPopupMenu getPopupMenu(JMenuItem[] items) { - - if (items == null) { - return null; - } - - JPopupMenu jp = new JPopupMenu(); - - for (int i = 0; i < items.length; i++) { - jp.add(items[i]); - } - - return jp; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/APreferencesControl.java b/graphics/AtlantisJava/src/atlantis/gui/APreferencesControl.java deleted file mode 100755 index f329c437e38348a9f58060eab5629384d2a143f4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/APreferencesControl.java +++ /dev/null @@ -1,429 +0,0 @@ -package atlantis.gui; - -import java.io.File; -import java.awt.Frame; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -import javax.swing.JCheckBoxMenuItem; -import javax.swing.JMenu; -import javax.swing.JOptionPane; -import javax.swing.JSeparator; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.ALegendWindow; -import atlantis.globals.AGlobals; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.APar; -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; - - -/** - * Preferences menu item - * - * @author Gary Taylor, Zdenek Maxa - */ -public class APreferencesControl extends JMenu implements ActionListener, ItemListener -{ - private static ALogger logger = ALogger.getLogger(APreferencesControl.class); - - private static AGlobals globals = AGlobals.instance(); - - protected static APar parameterStore = APar.instance(); - - private static final String LAYOUT = "Change Canvas Layout"; - private static final String SELECT_COLOR_MAP = "Select Color Map"; - private static final String COLOR_MAP_EDITOR = "Color Map Editor"; - private static final String READ_COLOR_MAP = "Read Color Map"; - private static final String WRITE_COLOR_MAP = "Save Current Color Map"; - private static final String WRITE_CONFIG = "Save Current Configuration"; - private static final String POINTER_POSITION = "Show Pointer Position Window"; - private static final String LEGEND = "Show Legend Window"; - private static final String CANVAS_TITLE = "Show Canvas Title"; - private static final String WINDOW_TITLES = "Show Window Titles"; - private static final String FISHEYE_LOGO = "Show Fisheye Indicator"; - private static final String HIDE_SCALES = "Hide Scales"; - private static final String ATLAS_LOGO = "Show ATLAS logo on saved images"; - private static final String ANTI_ALIASING = "Use Anti-Aliasing"; - private static final String OPEN_GL = "Use OpenGL"; - - private static JCheckBoxMenuItem posMenuItem; - private static JCheckBoxMenuItem legMenuItem; - private static JCheckBoxMenuItem canvasTitleMenuItem; - private static JCheckBoxMenuItem windowTitleMenuItem; - private static JCheckBoxMenuItem fisheyeIndicatorMenuItem; - private static JCheckBoxMenuItem hideScalesMenuItem; - private static JCheckBoxMenuItem atlasLogoMenuItem; - private static JCheckBoxMenuItem aliasMenuItem; - private static JCheckBoxMenuItem openglMenuItem; - - // ---------------------------------------------------------------------- - - public APreferencesControl() - { - super("Preferences"); - this.setToolTipText("Preferences"); - - add(SELECT_COLOR_MAP).addActionListener(this); - add(COLOR_MAP_EDITOR).addActionListener(this); - add(READ_COLOR_MAP).addActionListener(this); - add(WRITE_COLOR_MAP).addActionListener(this); - - add(new JSeparator()); - - add(LAYOUT).addActionListener(this); - add(WRITE_CONFIG).addActionListener(this); - - add(new JSeparator()); - - posMenuItem = new JCheckBoxMenuItem(POINTER_POSITION, false); - posMenuItem.addItemListener(this); - add(posMenuItem); - - legMenuItem = new JCheckBoxMenuItem(LEGEND, false); - legMenuItem.addItemListener(this); - add(legMenuItem); - - add(new JSeparator()); - - canvasTitleMenuItem = new JCheckBoxMenuItem(CANVAS_TITLE, parameterStore.get("Prefs", "CanvasTitle").getStatus()); - canvasTitleMenuItem.addItemListener(this); - add(canvasTitleMenuItem); - - windowTitleMenuItem = new JCheckBoxMenuItem(WINDOW_TITLES, parameterStore.get("Prefs", "WindowTitle").getStatus()); - windowTitleMenuItem.addItemListener(this); - add(windowTitleMenuItem); - - fisheyeIndicatorMenuItem = new JCheckBoxMenuItem(FISHEYE_LOGO, parameterStore.get("Prefs", "FisheyeIndicator").getStatus()); - fisheyeIndicatorMenuItem.addItemListener(this); - add(fisheyeIndicatorMenuItem); - - hideScalesMenuItem = new JCheckBoxMenuItem(HIDE_SCALES, parameterStore.get("Prefs", "HideScales").getStatus()); - hideScalesMenuItem.addItemListener(this); - add(hideScalesMenuItem); - - atlasLogoMenuItem = new JCheckBoxMenuItem(ATLAS_LOGO, parameterStore.get("Prefs", "AtlasLogo").getStatus()); - atlasLogoMenuItem.addItemListener(this); - add(atlasLogoMenuItem); - - - add(new JSeparator()); - - aliasMenuItem = new JCheckBoxMenuItem(ANTI_ALIASING, parameterStore.get("Prefs", "AntiAlias").getStatus()); - aliasMenuItem.addItemListener(this); - add(aliasMenuItem); - - openglMenuItem = new JCheckBoxMenuItem(OPEN_GL, parameterStore.get("Prefs", "OpenGL").getStatus()); - openglMenuItem.addItemListener(this); - - if (globals.getUseOpenGL()) { - add(new JSeparator()); - add(new AOpenGLControl()); - } - } // APreferencesControl() ---------------------------------------------- - - - - public void itemStateChanged(ItemEvent e) - { - if(((JCheckBoxMenuItem)e.getSource()).getText().equals(CANVAS_TITLE)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - { - parameterStore.get("Prefs", "CanvasTitle").setStatus(true); - ACanvas.getCanvas().getTitleBar().setVisible(true); - } - else - { - parameterStore.get("Prefs", "CanvasTitle").setStatus(false); - ACanvas.getCanvas().getTitleBar().setVisible(false); - } - ACanvas.getCanvas().validate(); - ACanvas.getCanvas().repaint(); - } - else if(((JCheckBoxMenuItem)e.getSource()).getText().equals(POINTER_POSITION)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - APointerPositionWindow.getInstance().setVisible(true); - else - APointerPositionWindow.getInstance().dispose(); - } - else if(((JCheckBoxMenuItem)e.getSource()).getText().equals(LEGEND)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - { - ALegendWindow legendWindow = ALegendWindow.getInstance(); - // Want to deselect legend menu item if legend window is closed - legendWindow.addWindowListener(new WindowAdapter() { - @Override - public void windowClosed(WindowEvent e) { - setLegMenuItem(false); - } - }); - - legendWindow.setVisible(true); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - } - else - ALegendWindow.getInstance().dispose(); - } - else if(((JCheckBoxMenuItem)e.getSource()).getText().equals(WINDOW_TITLES)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - parameterStore.get("Prefs", "WindowTitle").setStatus(true); - else - parameterStore.get("Prefs", "WindowTitle").setStatus(false); - ACanvas.getCanvas().repaintAllFromScratch(); - } - else if(((JCheckBoxMenuItem)e.getSource()).getText().equals(FISHEYE_LOGO)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - parameterStore.get("Prefs", "FisheyeIndicator").setStatus(true); - else - parameterStore.get("Prefs", "FisheyeIndicator").setStatus(false); - ACanvas.getCanvas().repaintAllFromScratch(); - } - else if(((JCheckBoxMenuItem)e.getSource()).getText().equals(HIDE_SCALES)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - parameterStore.get("Prefs", "HideScales").setStatus(true); - else - parameterStore.get("Prefs", "HideScales").setStatus(false); - - ACanvas.getCanvas().repaintAllFromScratch(); - } - else if(((JCheckBoxMenuItem)e.getSource()).getText().equals(ATLAS_LOGO)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - parameterStore.get("Prefs", "AtlasLogo").setStatus(true); - else - parameterStore.get("Prefs", "AtlasLogo").setStatus(false); - } - else if(((JCheckBoxMenuItem)e.getSource()).getText().equals(ANTI_ALIASING)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - parameterStore.get("Prefs", "AntiAlias").setStatus(true); - else - parameterStore.get("Prefs", "AntiAlias").setStatus(false); - ACanvas.getCanvas().repaintAllFromScratch(); - } - else if(((JCheckBoxMenuItem)e.getSource()).getText().equals(OPEN_GL)) - { - if(e.getStateChange() == ItemEvent.SELECTED) - parameterStore.get("Prefs", "OpenGL").setStatus(true); - else - parameterStore.get("Prefs", "OpenGL").setStatus(false); - System.out.println("No effect at present"); - } - } // itemStateChanged() ------------------------------------------------- - - - - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - - if(LAYOUT.equals(action)) - { - new ALayoutDialog(); - } - else if(SELECT_COLOR_MAP.equals(action)) - { - new AColorMapDialog(); - } - else if(COLOR_MAP_EDITOR.equals(action)) - { - AColorMapEditor.getInstance().setVisible(true); - } - else if(READ_COLOR_MAP.equals(action)) - { - new AReadColorMapChooser().showMyDialog(); - } - else if(WRITE_COLOR_MAP.equals(action)) - { - writeColorMap(); - } - else if(WRITE_CONFIG.equals(action)) - { - writeConfiguration(); - } - - } // actionPerformed() -------------------------------------------------- - - - - private static void writeColorMap() - { - String fileName = ".Atlantis-colormap.xml"; - String title = "Saving current color map"; - Frame gui = globals.getGuiFrame(); - - logger.debug("Going to write customised color map file ..."); - String data = AColorMap.getColorMapXML(); - - // color map data should be ready and valid - store it into file - try - { - AGUIUtilities.chooseFileAndWrite(gui, System.getProperty("user.home"), - fileName, data.getBytes(), title, "xml"); - logger.debug("Current color map written (or cancelled by user)."); - } - catch(AAtlantisException ex) - { - JOptionPane.showMessageDialog(gui, ex.getMessage(), - title, JOptionPane.ERROR_MESSAGE); - logger.debug(ex.getMessage(), ex); - } - - } // writeColorMap() ---------------------------------------------------- - - - - private static void writeConfiguration() - { - String FILE_SEPAR = System.getProperty("file.separator"); - String fileName = globals.getUserConfigFile(); - String title = "Saving current configuration"; - String fileNameFull = System.getProperty("user.home") + FILE_SEPAR + fileName; - String sourceFileNameFull = ""; - Frame gui = globals.getGuiFrame(); - - logger.debug("Writing customised configuration ..."); - - // get currently used configuration file and data from it - File user = new File(fileNameFull); - if(user.canRead()) - { - sourceFileNameFull = fileNameFull; - logger.debug("User has already got " + fileNameFull + - " this will be used as source."); - } - else - { - sourceFileNameFull = globals.getHomeDirectory() + - "configuration" + FILE_SEPAR + - "config.xml"; - logger.debug(sourceFileNameFull + " will be used as source."); - - } - - String data = AConfigWriter.getConfiguration(sourceFileNameFull); - if(data == null) - { - String msg = "Error when reading source configuration from file\n" + - sourceFileNameFull; - logger.error(msg); - JOptionPane.showMessageDialog(gui, msg, title, - JOptionPane.INFORMATION_MESSAGE); - return; - } - - // configuration data should be ready and valid - store it into file - try - { - logger.debug("Current customised configuration made, going to save it ..."); - AGUIUtilities.chooseFileAndWrite(gui, System.getProperty("user.home"), - fileName, data.getBytes(), title, "xml"); - logger.debug("Saving customised configuration successful (or cancelled by user)."); - } - catch(AAtlantisException ex) - { - String m = ex.getMessage(); - JOptionPane.showMessageDialog(gui, m, title, - JOptionPane.ERROR_MESSAGE); - logger.error(m); - logger.debug(m, ex); - } - - } // writeConfiguration() ----------------------------------------------- - - public static void setPosMenuItem(boolean selected) - { - posMenuItem.setSelected(selected); - } - - public static void setLegMenuItem(boolean selected) - { - legMenuItem.setSelected(selected); - } - - public static void setWindowTitleMenuItem(boolean selected) - { - windowTitleMenuItem.setSelected(selected); - parameterStore.get("Prefs", "WindowTitle").setStatus(selected); - } - - public static void setFisheyeIndicatorMenuItem(boolean selected) - { - fisheyeIndicatorMenuItem.setSelected(selected); - parameterStore.get("Prefs", "FisheyeIndicator").setStatus(selected); - } - - public static void setHideScalesMenuItem(boolean selected) - { - hideScalesMenuItem.setSelected(selected); - parameterStore.get("Prefs", "HideScales").setStatus(selected); - } - - public static void setAtlasLogoMenuItem(boolean selected) - { - atlasLogoMenuItem.setSelected(selected); - parameterStore.get("Prefs", "AtlasLogo").setStatus(selected); - } - - public static void setAliasMenuItem(boolean selected) - { - if (!AGlobals.isAtlantisHeadless()) { - aliasMenuItem.setSelected(selected); - } - parameterStore.get("Prefs", "AntiAlias").setStatus(selected); - } - - public static boolean getWindowTitleMenuItem() - { - if(windowTitleMenuItem!=null) - return windowTitleMenuItem.isSelected(); - else - return parameterStore.get("Prefs", "WindowTitle").getStatus(); - } - - public static boolean getFisheyeIndicatorMenuItem() - { - if(fisheyeIndicatorMenuItem!=null) - return fisheyeIndicatorMenuItem.isSelected(); - else - return parameterStore.get("Prefs", "FisheyeIndicator").getStatus(); - } - - public static boolean getHideScalesMenuItem() - { - if(hideScalesMenuItem!=null) - return hideScalesMenuItem.isSelected(); - else - return parameterStore.get("Prefs", "HideScales").getStatus(); - } - - - public static boolean getAtlasLogoMenuItem() - { - if(atlasLogoMenuItem!=null) - return atlasLogoMenuItem.isSelected(); - else - return parameterStore.get("Prefs", "AtlasLogo").getStatus(); - } - - public static boolean getAliasMenuItem() - { - return parameterStore.get("Prefs", "AntiAlias").getStatus(); - /*if(aliasMenuItem!=null) - return aliasMenuItem.isSelected(); - else - return false;*/ - } - -} // class APreferencesControl ============================================== diff --git a/graphics/AtlantisJava/src/atlantis/gui/AReadColorMapChooser.java b/graphics/AtlantisJava/src/atlantis/gui/AReadColorMapChooser.java deleted file mode 100755 index 303935d5c1e855ccb375a59322fae4fae4707248..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AReadColorMapChooser.java +++ /dev/null @@ -1,35 +0,0 @@ -package atlantis.gui; - -import java.io.File; - -import atlantis.canvas.ACanvas; -import atlantis.globals.AGlobals; -import atlantis.graphics.colormap.AColorMap; - -/** - * The dialog which appears when a user asks to read a new colormap - */ -public class AReadColorMapChooser extends AXMLFileChooser -{ - private static final String FILE_SEPAR = System.getProperty("file.separator"); - private static final AGlobals globals = AGlobals.instance(); - - public AReadColorMapChooser() - { - super(System.getProperty("user.dir") + FILE_SEPAR - + "configuration" + FILE_SEPAR + "colormap.xml", globals.getGuiFrame()); - } - - public boolean processSelectedFile(File file) - { - if (file.canRead()) - { - AColorMap.readColorMap(file.getPath()); - AColorMapEditor.getInstance().updateColors(); - AGUI.getGUI().repaintTable(); - ACanvas.getCanvas().repaintAllFromScratch(); - return true; - } - return false; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AReadFileChooser.java b/graphics/AtlantisJava/src/atlantis/gui/AReadFileChooser.java deleted file mode 100755 index 48ff7472657671eac3b2ec9d0cb8573897ebb3b0..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AReadFileChooser.java +++ /dev/null @@ -1,103 +0,0 @@ -package atlantis.gui; - -import java.io.File; - -import javax.swing.JFileChooser; -import javax.swing.filechooser.FileFilter; -import javax.swing.JCheckBox; -import javax.swing.JPanel; - -import java.awt.Component; -import java.awt.BorderLayout; - -import atlantis.config.ADefaultValues; - -/** - * This dialog appears when a user asks to read events from a file - * @author sboeser - */ -public class AReadFileChooser extends JFileChooser { - //Check box indicating to set the new default location - private JCheckBox defaultLoc = null; - - /** - * Constructor with a default path - * @param path the default path - */ - public AReadFileChooser(String path) { - - //Create a file chooser pointing to path - //Use users default dir if null - super(path); - - //Create a new panel with the checkbox - JPanel p = new JPanel(); - defaultLoc = new JCheckBox("default location"); - p.setLayout(new BorderLayout()); - p.add(defaultLoc, BorderLayout.SOUTH); - setAccessory(p); - - - setFileFilter(new XMLFilter()); - } - - /** - * Show the dialog waiting for user input - */ - @Override - public int showOpenDialog(Component parent) { - - //Get the return state - int state = super.showOpenDialog(parent); - - //Store the default location if user pressed ok - if (state == APPROVE_OPTION) { - //Only if checkbox is ticked - if (defaultLoc.isSelected()) { - // save last visited location - ADefaultValues.set("LastEventFilesSourceDir", - getSelectedFile().getParent() + System.getProperty("file.separator")); - } - } - - //return the result state - return state; - } - - /** - * A filter for XML files - */ - private static class XMLFilter extends FileFilter { - - /** - * Acceptance algorithm for xml files and directories - * @param file the file to test - * @return true if accepted - */ - public boolean accept(File file) { - - //accept all directories - if (file.isDirectory()) return true; - - //check the file ending - String name = file.getName().toLowerCase(); - - if (name.endsWith(".xml")) return true; - if (name.endsWith(".zip")) return true; - if (name.endsWith(".gzip")) return true; - if (name.endsWith(".gz")) return true; - - //None of the requested criteria matched - return false; - } - - /** - * Gives a description of the files that are accepted by this filter - * @return string with list of file endings - */ - public String getDescription() { - return ".xml, .zip, .gzip, .gz"; - } - } -} - diff --git a/graphics/AtlantisJava/src/atlantis/gui/AReadGeometryChooser.java b/graphics/AtlantisJava/src/atlantis/gui/AReadGeometryChooser.java deleted file mode 100755 index ae77061aeeafb0b7a38bd7a7fdde90d4ba6f04a9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AReadGeometryChooser.java +++ /dev/null @@ -1,79 +0,0 @@ -package atlantis.gui; - -import atlantis.geometry.AEndcapTRTDetector; - -import java.awt.Frame; -import java.io.File; -import javax.swing.JOptionPane; - -import atlantis.canvas.ACanvas; -import atlantis.data.ACalorimeterData; -import atlantis.geometry.AAtlasDetector; -import atlantis.geometry.ABarrelSiliconDetector; -import atlantis.geometry.ABarrelTRTDetector; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.geometry.AEndcapSiliconDetector; -import atlantis.globals.AGlobals; - - -/** - * The dialog which appears when a user asks to read in geometry XML file - */ -public class AReadGeometryChooser extends AXMLGeometryChooser { - - private static final AGlobals globals = AGlobals.instance(); - - public AReadGeometryChooser() { - super(); - } - - public void fileChosen(int state) { - Frame gui = globals.getGuiFrame(); - do { - if(state==APPROVE_OPTION) { - File file=getSelectedFile(); - - if(file!=null) - if(file.canRead()) { - processSelectedFile(file); - break; - } else { - JOptionPane.showMessageDialog(gui, - "Unable to open " + file, "IO Error", JOptionPane.ERROR_MESSAGE); - } - } else - break; - state=showOpenDialog(gui); - } while(true); - } - - public boolean processSelectedFile(File file) - { - if(file.canRead()) - { - // ACalorimterDetector keeps a list of its instances, clear this list. - ACalorimeterDetector.clear(); - ABarrelSiliconDetector.clear(); - AEndcapSiliconDetector.clear(); - ABarrelTRTDetector.clear(); - AEndcapTRTDetector.clear(); - - String muonname = file.getParent() + System.getProperty("file.separator") + - file.getName().substring(0, 1) + "Muon" + - file.getName().substring(1); - File mufile = new File(muonname); - if(mufile.canRead()) - { - AAtlasDetector.setDetector(new AAtlasDetector(file.getAbsolutePath(), muonname)); - } - else - { - AAtlasDetector.setDetector(new AAtlasDetector(file.getAbsolutePath())); - } - ACalorimeterData.remakeHitToGeometryMapping(); - ACanvas.getCanvas().repaintAllFromScratch(); - return true; - } - return false; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ASaveCanvasDialog.java b/graphics/AtlantisJava/src/atlantis/gui/ASaveCanvasDialog.java deleted file mode 100755 index 2f0d67a3982013b18bf296916d1db4911dfe9cd4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ASaveCanvasDialog.java +++ /dev/null @@ -1,477 +0,0 @@ -package atlantis.gui; - -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.image.RasterFormatException; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.OutputStream; - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.filechooser.FileFilter; - -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.canvas.ACanvas; -import atlantis.utils.AAtlantisException; -import atlantis.utils.AUtilities; -import atlantis.config.ADefaultValues; -import atlantis.globals.AGlobals; -import atlantis.graphics.encoders.AImageEncoder; -import atlantis.utils.ALogger; - - -/** - * Dialog window for saving a picture of the current canvas. This dialog allows - * the user to pick the resolution and file type. - * - * @author Eric Jansen - * @author Sebastian Boeser - */ -public class ASaveCanvasDialog extends JFileChooser - implements PropertyChangeListener { - - private final ALogger logger = ALogger.getLogger(ASaveCanvasDialog.class); - private static AEventManager eventManager = AEventManager.instance(); - private static final AGlobals globals = AGlobals.instance(); - - // GUI component that contains the resolution selection panel. - private AResolutionChooser resolutionChooser; - - // Possible image widths shown to user. Heights are fixed by layout restrictions. - private final int[] IMAGE_WIDTHS = {800, 1024, 2400, 5000};//{512, 800, 1024, 2400}; - - // Default selected image width. Also the (fixed) width of the EPS images. - private final int DEFAULT_IMAGE_WIDTH = 1; - - // String holding the default file name, need to be reset after change of file type. - private String defaultFileName = null; - - // Private image encoder instance - private final AImageEncoder imageEncoder = new AImageEncoder(); - - - /** - * Constructor creating the dialog - */ - public ASaveCanvasDialog() - { - //Initialize the file chooser dialog - super(ADefaultValues.get("LastCanvasPlotSaveDir")); - setDialogTitle("Save Canvas"); - - //Add file filters - addChoosableFileFilter(new AFileFilter("eps", "Encapsulated Postscript (*.eps)")); - addChoosableFileFilter(new AFileFilter("png", "Portable Network Graphics (*.png)")); - addChoosableFileFilter(new AFileFilter("svg", "Scalable Vector Graphics (*.svg)")); - - //Set default values - setAcceptAllFileFilterUsed(false); - // In OpenJDK JRE filter is set to null by setAcceptAllFileFilterUsed, so - // have to set it to something: - setFileFilter(getChoosableFileFilters()[1]); - - //Add the resoluton chooser - resolutionChooser = new AResolutionChooser(); - setAccessory(resolutionChooser); - addPropertyChangeListener(this); - - //Set a default file name and extension - defaultFileName = makeEventFileName() + "-" + AUtilities.getDateTimeString(); - String ext = ((AFileFilter) getFileFilter()).getExtension(); - setSelectedFile(new File(defaultFileName + "." + ext)); - } - - /** - * Pops up the "Save Canvas" dialog. - */ - public void showDialog(){ - //Show dialog with GUI as parent - showSaveDialog(globals.getGuiFrame()); - } - - - /** - * @return the defualt file name - */ - public String getDefaultFileName() - { - return defaultFileName; - } - - /** - * Get the currently selected image width. - * @return selected image width - */ - public int getImageWidth() - { - return resolutionChooser.getImageWidth(); - } - - - - /** - * Gets the image height on this button. - * @return image height - */ - public int getImageHeight() - { - return resolutionChooser.getImageHeight(); - } - - - - /** - * Called when the user has selected a file and pushes the save button. - * This function will only - * approve the selection when the actual saving was successful. - */ - @Override - public void approveSelection() - { - Frame gui = globals.getGuiFrame(); - File file = new File(getSelectedFile().getAbsolutePath()); - - // If the file exists and the user does not want to overwrite it, cancel the save operation. - // The dialog is still on screen and the user can pick another file. - if (file.exists() && JOptionPane.showConfirmDialog(gui, "File exists, overwrite?", - "File exists", JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) - return; - - // All exceptions are handled equally: the user is sent back to the save canvas dialog. - try { - String type = ((AFileFilter)getFileFilter()).getExtension(); - // Since EPS files can be pretty big, they're saved directly - if (type.equals("eps")){ - // Since vector images are scalable, the image size only determines the relative size of - // the data objects. To make the generated EPS independent of the canvas size, we always - // rescale the image to the default size. - int width = IMAGE_WIDTHS[DEFAULT_IMAGE_WIDTH]; - int height = ACanvas.getCanvas().getRespectiveHeight(width); - imageEncoder.saveEPS(width,height,file); - } else if (type.equals("png")) { - // Generate the canvas image in memory - byte[] data; - int width = resolutionChooser.getImageWidth(); - int height = resolutionChooser.getImageHeight(); - data = imageEncoder.getPNGData(width,height); - // And finally write the image to the selected file. - OutputStream stream = new BufferedOutputStream(new FileOutputStream(file.getAbsolutePath())); - stream.write(data); - stream.close(); - } else if (type.equals("svg")){ - // Since vector images are scalable, the image size only determines the relative size of - // the data objects. To make the generated EPS independent of the canvas size, we always - // rescale the image to the default size. - int width = IMAGE_WIDTHS[DEFAULT_IMAGE_WIDTH]; - int height = ACanvas.getCanvas().getRespectiveHeight(width); - imageEncoder.saveSVG(width,height,file); - } else{ - //Throw an exception if none of the above - throw new AAtlantisException("Unknown image type: '" + type + "'"); - } - } - catch(RasterFormatException e) - { - JOptionPane.showMessageDialog(gui, - "The chosen resolution for canvas is too high, try a lower option!", - "Error saving canvas", JOptionPane.INFORMATION_MESSAGE); - AGUI.getGUI().restoreDefaults(); - this.cancelSelection(); - } catch(Exception e) - { - // Show a dialog with the error message. - JOptionPane.showMessageDialog(AGUI.getGUI(), e.getMessage(), - "Error saving canvas", JOptionPane.ERROR_MESSAGE); - - // The selection is not approved, the user has to select another file or type. - return; - } - - // This approves the selection and ends the saving processs. - super.approveSelection(); - ADefaultValues.set("LastCanvasPlotSaveDir", file.getParent() + - System.getProperty("file.separator")); - - } - - - - /** - * Property change listener for the JFileChooser - * @param e property change event sent by JFileChooser - */ - public void propertyChange(PropertyChangeEvent e) - { - if (e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) - { - String oldExt = ((AFileFilter)e.getOldValue()).getExtension(); - String newExt = ((AFileFilter)e.getNewValue()).getExtension(); - - if ((oldExt.equals("eps") || oldExt.equals("svg")) && !(newExt.equals("eps") || newExt.equals("svg"))) - { - for (int i=0; i<resolutionChooser.getComponentCount(); i++) - { - resolutionChooser.getComponent(i).setEnabled(true); - } - } - else if (!(oldExt.equals("eps") || oldExt.equals("svg")) && ((newExt.equals("eps")) || newExt.equals("svg"))) - { - for (int i=0; i<resolutionChooser.getComponentCount(); i++) - resolutionChooser.getComponent(i).setEnabled(false); - } - - // The behaviour of the JFileChooser is somewhat strange. Regardless of what the user has entered, - // the input text field will be emptied when the user selects another file type. It is impossible - // to retrieve the text that was in this field, so we just reset the default file name. - if (getSelectedFile() == null) - { - // Reset our default with the new extension - setSelectedFile(new File(defaultFileName + "." + newExt)); - updateUI(); - rescanCurrentDirectory(); - } - } - } - - - - /** - * Generates a file name based on the current event name and the visible projections. - * @return auto generated image file name - */ - private static String makeEventFileName() - { - String name = "Untitled"; - AEvent ev = eventManager.getCurrentEvent(); - if(ev != null) - { - name = ev.getSourceName(); - if(name.toLowerCase().endsWith(".xml")) - { - // current event comes from XML file, run and event number - // are probably already part of the current filename - name = name.substring(0, name.length() - 4); - } - else - { - // current event was probably retrieved online, add run and - // event numbers into the file name of the canvas plot - if(! ("n/a".equals(ev.getRunNumber()) && - "n/a".equals(ev.getEventNumber()))) - { - name += "_" + ev.getRunNumber() + "_" + ev.getEventNumber(); - } - } - } - - ACanvas canvas = ACanvas.getCanvas(); - String[] windows = canvas.getCurrentLayout().getWindowNames(); - StringBuilder listWindows = new StringBuilder(); - for(int i = 0; i < windows.length; i++) - { - if(canvas.isReallyOnScreen(canvas.getWindow(windows[i]))) - { - listWindows.append("-" + canvas.getWindow(windows[i]).getProjection().getName()); - } - } - name += listWindows.toString(); - - return name; - } - - - - /** - * GUI component for the resolution selection panel. - */ - class AResolutionChooser extends JPanel implements ActionListener - { - /** Currently selected button. */ - private AResolutionButton selectedButton; - - /** - * Constructor. - */ - public AResolutionChooser() - { - super(new GridLayout(IMAGE_WIDTHS.length+1, 1)); - setBorder(BorderFactory.createTitledBorder(" Resolution: ")); - - ButtonGroup group = new ButtonGroup(); - for (int i=0; i<IMAGE_WIDTHS.length; i++) - { - int width = IMAGE_WIDTHS[i]; - int height = ACanvas.getCanvas().getRespectiveHeight(IMAGE_WIDTHS[i]); - - AResolutionButton button = new AResolutionButton(width, height); - button.addActionListener(this); - if(i == DEFAULT_IMAGE_WIDTH) - { - selectedButton = button; - button.setSelected(true); - } - group.add(button); - add(button); - } - } - - /** - * Get the currently selected image width. - * @return selected image width - */ - public int getImageWidth() - { - return selectedButton.getImageWidth(); - } - - /** - * Gets the currently selected image height. - * @return selected image height - */ - public int getImageHeight() - { - return selectedButton.getImageHeight(); - } - - public void updateResolutions() - { - for (int i=0; i<getComponentCount(); i++) - { - if (getComponent(i) instanceof AResolutionButton) - { - AResolutionButton button = (AResolutionButton)getComponent(i); - int height = ACanvas.getCanvas().getRespectiveHeight(button.getImageWidth()); - button.setImageHeight(height); - } - } - } - - - - /** - * Action listener for the resolution panel. - * @param e performed action - */ - public void actionPerformed(ActionEvent e) - { - selectedButton = (AResolutionButton)e.getSource(); - } - - /** - * Radio button for the resolution chooser. - */ - public class AResolutionButton extends JRadioButton - { - /** Image width for this button. */ - int imageWidth; - /** Image height for this button. */ - int imageHeight; - - /** - * Constructor. - * @param targetWidth image width this button corresponds to - * @param targetHeight image height this button corresponds to - */ - public AResolutionButton(int imageWidth, int imageHeight) - { - super(imageWidth + "x" + imageHeight); - this.imageWidth = imageWidth; - this.imageHeight = imageHeight; - } - - /** - * Gets the image width on this button. - * @return image width - */ - public int getImageWidth() - { - return imageWidth; - } - - /** - * Gets the image height on this button. - * @return image height - */ - public int getImageHeight() - { - return imageHeight; - } - - public void setImageHeight(int imageHeight) - { - this.imageHeight = imageHeight; - setText(imageWidth + "x" + imageHeight); - } - } - } - - /** - * Simple filter class that filters files by extension. - */ - private static class AFileFilter extends FileFilter - { - /** File extension. */ - private String extension; - /** Description of the file type this filter shows. */ - private String description; - - /** - * Constructs a file filter. - * @param extension file extension that passes the filter - * @param description description of the file type this filter selects - */ - public AFileFilter(String extension, String description) - { - super(); - this.extension = extension; - this.description = description; - } - - /** - * Decides if the filter allows a file to pass or not - * @param f file under consideration - * @return decision of the filter - */ - public boolean accept(File f) - { - //Accept all directories - if (f.isDirectory()) return true; - - //Accept all files that end with given extension - if (f.getName().toLowerCase().endsWith(extension)) return true; - - //Nothing else - return false; - } - - /** - * Get the extension this filter filters on. - * @return file extension - */ - public String getExtension() - { - return extension; - } - - /** - * Get description of the filter. - * @return description - */ - public String getDescription() - { - return description; - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AStartupWindow.java b/graphics/AtlantisJava/src/atlantis/gui/AStartupWindow.java deleted file mode 100755 index 4743e6d208147af6614642aa450083a835ee2c4d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AStartupWindow.java +++ /dev/null @@ -1,86 +0,0 @@ -package atlantis.gui; - -import atlantis.globals.AGlobals; -import atlantis.graphics.AIcon; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; -import java.awt.*; -import javax.swing.*; - - -/** - * The startup window appears when the program starts up and displays the - * progress of the operation. No need for this to be a singleton at all. - */ -public class AStartupWindow { - - //add a logger - private final ALogger logger = ALogger.getLogger(AStartupWindow.class); - - //the frame showing the startup image and progress - private final JFrame frame = (AGlobals.isAtlantisHeadless()) ? null : new JFrame(); - - //how often we will update the progress bar - private final int progressUpdateDiff; - - //GUI items that will be updated - private JLabel text = null; - private JProgressBar progress = null; - - public AStartupWindow(int numUpdates) { - - //Store how often we will update the progress bar - progressUpdateDiff=(int)100./numUpdates; - - //Don't do anything in headless mode - if (AGlobals.isAtlantisHeadless()) return; - - frame.getContentPane().setLayout(new BorderLayout()); - - String fileName = AGlobals.instance().getHomeDirectory() + "img" + - System.getProperty("file.separator") + "atlas.jpg"; - ImageIcon icon = AUtilities.getFileAsImageIcon(fileName); - - frame.getContentPane().add(new JLabel(icon), BorderLayout.CENTER); - text = new JLabel("Welcome to Atlantis", JLabel.CENTER); - JPanel p = new JPanel(); - - p.setLayout(new GridLayout(2, 1)); - p.add(text); - progress = new JProgressBar(0, 100); - progress.setStringPainted(true); - p.add(progress); - frame.getContentPane().add(p, BorderLayout.SOUTH); - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - frame.setLocation(screenSize.width / 4, screenSize.height / 3); - frame.setUndecorated(true); - AIcon.setIconImage(frame); - frame.setTitle("Atlantis starting up..."); - frame.pack(); - frame.setVisible(true); - } - - /** - * Update the frame and log to the logger - * @param newText the new text for the startup window - */ - public void updateText(String newText) { - //Also send this to the logger - logger.info(newText); - - //Don't do graphics update in headless mode - if (AGlobals.isAtlantisHeadless()) return; - - //Update text and progress bar - text.setText(newText); - progress.setValue(progress.getValue()+progressUpdateDiff); - } - - /** - * When dispsoing this object, also dispose of the frame - */ - public void dispose(){ - if (frame!=null) frame.dispose(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ATabbedPaneUI.java b/graphics/AtlantisJava/src/atlantis/gui/ATabbedPaneUI.java deleted file mode 100755 index ea5cf518a7d6a1f5b438d99b7c5bacbd3cdd8006..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ATabbedPaneUI.java +++ /dev/null @@ -1,35 +0,0 @@ -package atlantis.gui; - -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; - -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.metal.MetalTabbedPaneUI; - -import atlantis.utils.AUtilities; - -/** - * Once installed on a TabbedPane this UI will allow changing the tabs only with - * the left mouse button. By default this is possible with any button. - * In Atlantis the right mouse button provides help - */ - -public class ATabbedPaneUI extends MetalTabbedPaneUI { - - public static ComponentUI createUI(JComponent c) { - return new ATabbedPaneUI(); - } - - protected MouseListener createMouseListener() { - return new myMouseHandler(); - } - - public class myMouseHandler extends MouseHandler { - public void mousePressed(MouseEvent e) { - if(!AUtilities.isRightMouseButton(e)) - super.mousePressed(e); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ATextField.java b/graphics/AtlantisJava/src/atlantis/gui/ATextField.java deleted file mode 100755 index a7aae0b222b4f13e1ad83974aed22b345bc04470..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ATextField.java +++ /dev/null @@ -1,31 +0,0 @@ -package atlantis.gui; - - -import java.awt.event.ActionListener; -import javax.swing.JTextField; - - -/** - * This textfield will not generate an event when the setText() function is called. - */ - -public class ATextField extends JTextField { - ActionListener listener; - - public ATextField() { - super(); - } - - public void addActionListener(ActionListener l) { - if(listener==null) { - super.addActionListener(l); - listener=l; - } - } - - public void setText(String t) { - if(listener!=null) super.removeActionListener(listener); - super.setText(t); - if(listener!=null) super.addActionListener(listener); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ATreeCellRenderer.java b/graphics/AtlantisJava/src/atlantis/gui/ATreeCellRenderer.java deleted file mode 100755 index 3979507b6ff0f324c31afd2302909ede1b0e631c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ATreeCellRenderer.java +++ /dev/null @@ -1,34 +0,0 @@ -package atlantis.gui; - -import java.awt.*; -import javax.swing.*; -import javax.swing.tree.*; -import atlantis.parameters.AStatusParameter; -import hep.wired.util.TristateCheckBox; - -public class ATreeCellRenderer implements TreeCellRenderer { - - public ATreeCellRenderer() { - } - - public Component getTreeCellRendererComponent(JTree tree, Object value, boolean isSelected, - boolean expanded, boolean leaf, int row, boolean hasFocus) { - if(value instanceof ACheckNode){ - ACheckNode cellNode = (ACheckNode)value; - cellNode.updateState(); - if (cellNode.getParameter() instanceof AStatusParameter){ - ACheckBox cellComponent = (ACheckBox)cellNode.getUserObject(); - cellComponent.setBorderPaintedFlat(true); - return cellComponent; - } else{ - TristateCheckBox cellComponent = (TristateCheckBox)cellNode.getUserObject(); - cellComponent.setState(cellNode.getState()); - cellComponent.setBorderPaintedFlat(true); - return cellComponent; - } - } - - return new JLabel("not a checkNode"); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/ATreeExpansionListener.java b/graphics/AtlantisJava/src/atlantis/gui/ATreeExpansionListener.java deleted file mode 100755 index cb7d0b791603006406fa9e34880871577435e509..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/ATreeExpansionListener.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * ATreeExpansionListener.java - * - * Created on 17 March 2005, 15:55 - */ - -package atlantis.gui; - -import javax.swing.event.TreeExpansionListener; -import javax.swing.event.TreeExpansionEvent; -import javax.swing.JTree; - -/** - * - * @author Qiang - */ -public class ATreeExpansionListener implements TreeExpansionListener { - - private JTree tree; - - private AParametersTable table; - - // the row number which the tree locates - private int treeRow; - - /** Creates a new instance of ATreeExpansionListener */ - public ATreeExpansionListener(JTree tree, AParametersTable table, int treeRow) { - this.tree = tree; - this.table = table; - this.treeRow = treeRow; - } - - public void treeExpanded(TreeExpansionEvent event) { - int newHeight = tree.getRowCount() * (int)(tree.getRowBounds(0).getHeight()); - table.setRowHeight(treeRow, newHeight); - } - - public void treeCollapsed(TreeExpansionEvent event) { - int newHeight = tree.getRowCount() * (int)(tree.getRowBounds(0).getHeight()); - table.setRowHeight(treeRow, newHeight); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AWindowControl.java b/graphics/AtlantisJava/src/atlantis/gui/AWindowControl.java deleted file mode 100755 index abac35788b1665510d6e0c12656c7747a5eba034..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AWindowControl.java +++ /dev/null @@ -1,190 +0,0 @@ -package atlantis.gui; - -import atlantis.canvas.ALayoutChangeListener; -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.canvas.ALayout; -import atlantis.graphics.layout.AFlowLayout; -import atlantis.graphics.layout.AGridLayout; -import atlantis.graphics.dnd.ADnDLabel; -import atlantis.graphics.dnd.ADragListener; -import atlantis.parameters.ACommandProcessor; -import atlantis.utils.*; -import java.util.*; -import javax.swing.BorderFactory; -import javax.swing.SwingUtilities; -import javax.swing.JPanel; -import java.awt.Color; -import java.awt.Rectangle; -import java.awt.Dimension; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.event.*; - -/** - * Allows user to select the current window and to - * copy between windows. - */ -public class AWindowControl extends JPanel - implements ALayoutChangeListener, ADragListener { - - private String selectedWindowName; - private Vector pages=new Vector(10); - - public AWindowControl getPanel() { - return this; - } - - public AWindowControl() { - super(); - setLayout(new AFlowLayout(10, 10)); - - addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - if(AUtilities.isRightMouseButton(e)) - AHelpSystem.getInstance().showPage("WindowControl"); - } - }); - - // registering as a listener to of window lock changes - ACanvas.getCanvas().addLockChangeListener(new ChangeListener() { - - public void stateChanged(ChangeEvent e) { - for(int i=0; i<pages.size(); i++) { - Hashtable page=(Hashtable)pages.elementAt(i); - Enumeration labels=page.elements(); - while(labels.hasMoreElements()) { - ADnDLabel label=(ADnDLabel)labels.nextElement(); - if(ACanvas.getCanvas().getWindow(label.getName()).isLocked()) - label.setForeground(Color.red); - else - label.setForeground(Color.black); - } - } - } - }); - - // registering as a listener to APar - ACanvas.getCanvas().addLayoutChangeListener(this); - - ACanvas.getCanvas().addWindowChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - ADnDLabel label; - - if(selectedWindowName!=null) - for(int i=0; i<pages.size(); i++) { - Hashtable page=(Hashtable)pages.elementAt(i); - - label=(ADnDLabel)page.get(selectedWindowName); - if(label!=null) - label.setBackground(new Color(207, 207, 207)); - } - - selectedWindowName=ACanvas.getCanvas().getCurrentWindow().getName(); - for(int i=0; i<pages.size(); i++) { - Hashtable page=(Hashtable)pages.elementAt(i); - - label=(ADnDLabel)page.get(selectedWindowName); - if(label!=null) - label.setBackground(Color.white); - } - } - }); - } - - // function gets called when the current layout is changed in APar - public void layoutChanged(ACanvas c) { - removeAll(); - ALayout layout = c.getCurrentLayout(); - Dimension d=layout.getSize(); - WindowMouseListener windowMouseListener=new WindowMouseListener(); - - // adding new set of pages - pages.clear(); - String[] pageNames=layout.getPageNames(); - Hashtable pageHashtable; - - for(int i=0; i<pageNames.length; i++) { - String[] wNames=layout.getPageContent(pageNames[i]); - - JPanel page=new JPanel(new AGridLayout(d, 15)); - - pageHashtable=new Hashtable(); - for(int k=0; k<wNames.length; k++) { - Rectangle constraint=layout.getWindowConstraints(wNames[k]); - ADnDLabel w=new ADnDLabel(wNames[k], wNames, true); - - w.setBorder(BorderFactory.createLineBorder(new Color(150, 150, 150))); - pageHashtable.put(wNames[k], w); - page.add(w, constraint); - w.addMouseListener(windowMouseListener); - w.addDragListener(this); - } - - pages.addElement(pageHashtable); - add(page); - setToolTipText("Current Layout - "+layout.getName()); - revalidate(); - repaint(); - } - } - - public void dragPerformed(Object from, Object to, int action) { - if((from instanceof ADnDLabel)&&(to instanceof ADnDLabel)) - ACanvas.getCanvas().copyWindowSettings(((ADnDLabel)from).getText(), ((ADnDLabel)to).getText()); - } - - private Hashtable findPage(String[] wNames) - { - for (int i = 0; i < pages.size(); i++) - { - int matches = 0; - Hashtable page = (Hashtable)pages.get(i); - - for (int j = 0; j < wNames.length; j++) - { - if (page.containsKey(wNames[j])) - matches++; - else break; - } - if (matches == wNames.length) - return page; - } - return null; - } - - class WindowMouseListener extends MouseAdapter { - - public void mousePressed(MouseEvent e) { - ADnDLabel label = (ADnDLabel) e.getSource(); - - if (AUtilities.isRightMouseButton(e)) { - if (AEventQueue.getKeyboardState() == KeyEvent.VK_A) { - - String[] pageName = label.returnPageName(); - Hashtable page = findPage(pageName); - if(page==null) - return; - - for (Enumeration labels = page.elements(); labels.hasMoreElements(); ) { - label = (ADnDLabel) labels.nextElement(); - if (label != null) - ACommandProcessor.receive("W" + label.getName()); - } - } - else { - AWindow.getPopupMenu().show(label, e.getX(), e.getY()); - ACommandProcessor.receive("W" + label.getName()); - } - } - } - - public void mouseReleased(MouseEvent e) { - ADnDLabel label=(ADnDLabel)e.getSource(); - - if(SwingUtilities.isLeftMouseButton(e)) { - ACommandProcessor.receive("W"+label.getName()); - } - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AXMLFileChooser.java b/graphics/AtlantisJava/src/atlantis/gui/AXMLFileChooser.java deleted file mode 100755 index b5c2421bfcddbc9540e338dca25f05ec4e8e2aff..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AXMLFileChooser.java +++ /dev/null @@ -1,108 +0,0 @@ -package atlantis.gui; - -import java.awt.Component; -import java.io.File; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.filechooser.FileFilter; - - - -/** - * A GUI component used choose a specific XML file - */ -public abstract class AXMLFileChooser extends JFileChooser -{ - private Component parent = null; - - public abstract boolean processSelectedFile(File file); - - - public AXMLFileChooser(String fileName, Component parent) - { - super(); - this.parent = parent; - - setFileFilter(new XMLFilter()); - if (fileName == null) - { - setCurrentDirectory(new File(System.getProperty("user.dir"))); - } - else - { - File f = new File(fileName); - if (f.isFile()) - { - setCurrentDirectory(new File(f.getAbsolutePath())); - setSelectedFile(f); - } - else - { - setCurrentDirectory(f); - } - } - - } // AXMLFileChooser() -------------------------------------------------- - - - - public void showMyDialog() - { - do - { - int state = showOpenDialog(this.parent); - if(state == APPROVE_OPTION) - { - File file = getSelectedFile(); - if(file != null) - { - if(processSelectedFile(file)) - { - break; - } - else - { - JOptionPane.showMessageDialog(parent, - "Unable to open\n" + file, "IO Error", - JOptionPane.ERROR_MESSAGE); - } - } - } - else - { - break; - } - } - while(true); - - } // showMyDialog() ----------------------------------------------------- - - - - private static class XMLFilter extends FileFilter - { - // Accept all directories and all valid files. - public boolean accept(File f) - { - if(f.isDirectory()) - { - return true; - } - - String s = f.getName(); - - if(s.toLowerCase().endsWith(".xml") || s.toLowerCase().endsWith(".zip") - || s.toLowerCase().endsWith(".gzip") || s.toLowerCase().endsWith(".gz")) - return true; - - return false; - } - - - public String getDescription() - { - return ".xml, .zip, .gzip, .gz"; - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/AXMLGeometryChooser.java b/graphics/AtlantisJava/src/atlantis/gui/AXMLGeometryChooser.java deleted file mode 100755 index c790d8aeee828ca8c8a7d0f2ac2dc8649886d227..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/AXMLGeometryChooser.java +++ /dev/null @@ -1,73 +0,0 @@ -package atlantis.gui; - -import java.awt.Frame; -import java.io.File; -import javax.swing.*; -import javax.swing.filechooser.*; - -import atlantis.globals.AGlobals; - - -/** - * A GUI component used choose a specific XML file - */ -public abstract class AXMLGeometryChooser extends JFileChooser { - - private static final AGlobals globals = AGlobals.instance(); - - public AXMLGeometryChooser(String fileName) { - super(); - String FILE_SEPAR = System.getProperty("file.separator"); - Frame gui = globals.getGuiFrame(); - setFileFilter(new XMLFilter()); - setCurrentDirectory(new File(System.getProperty("user.dir")+FILE_SEPAR+ - "geometry")); - if(fileName!=null) - setSelectedFile(new File(System.getProperty("user.dir")+FILE_SEPAR - +fileName)); - do { - int state=showOpenDialog(gui); - if(state==APPROVE_OPTION) { - File file=getSelectedFile(); - if(file!=null) - if(processSelectedFile(file)) - break; - else { - JOptionPane.showMessageDialog(gui, - "Unable to open " + file, "IO Error", JOptionPane.ERROR_MESSAGE); - } - } else - break; - } while(true); - } - - - public AXMLGeometryChooser() { - this(null); - } - - - public abstract boolean processSelectedFile(File file); - - - private static class XMLFilter extends FileFilter { - // Accept all directories and all XML files. - - public boolean accept(File f) { - if(f.isDirectory()) - return true; - - String s=f.getName(); - if(s.startsWith("AMuon")) return false; - if(s.equals("config.xml")) return false; - if(s.equals("pdg.xml")) return false; - if(s.toLowerCase().lastIndexOf(".xml")==s.length()-".xml".length()) return true; - return false; - } - - public String getDescription() { - return ".xml"; - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/gui/package.html b/graphics/AtlantisJava/src/atlantis/gui/package.html deleted file mode 100644 index 67b415276a29301847d51f4aaaf3b11bf5a743c2..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/gui/package.html +++ /dev/null @@ -1,8 +0,0 @@ -<html> -<head></head> -<body> -<p>Maintenance of GUI components (layouts, tabbed panes, etc). The -contents (not the structure) of the GUI is defined in config.xml. -</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/interactions/A3DBoxGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/A3DBoxGroup.java deleted file mode 100755 index 88cb802db3d04f95034cda849b1501cf5d9ef79b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/A3DBoxGroup.java +++ /dev/null @@ -1,14 +0,0 @@ -package atlantis.interactions; - - -public class A3DBoxGroup extends AInteractionGroup { - - private A3DBoxInteraction transformInteraction; - - public A3DBoxGroup(AInteractionsManager iManager) { - super(AInteractionGroup.WINDOW_GROUP, iManager); - transformInteraction=new A3DBoxInteraction(); - this.addInteraction(transformInteraction); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/A3DBoxInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/A3DBoxInteraction.java deleted file mode 100755 index 7d264df9cc7d7d92d54e01938a56ce5a40666514..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/A3DBoxInteraction.java +++ /dev/null @@ -1,202 +0,0 @@ -package atlantis.interactions; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.event.KeyEvent; -import java.awt.geom.Ellipse2D; -import java.awt.geom.Point2D; - -import javax.swing.JMenuItem; - -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection3DBox; -import atlantis.graphics.ACursorFactory; - -/** - * The Zoom and Rotate interaction. - */ -public class A3DBoxInteraction extends AInteraction implements - ASleepMouseDragListener, AMousePressListener, AEnterExitListener -{ - private static final int ZOOM_MODE = 0; - private static final int HORIZONTAL_ZOOM_MODE = 1; - private static final int VERTICAL_ZOOM_MODE = 2; - private static final int ROTATE_MODE = 3; - - private int d = 10; - private Point2D.Double p0; - private int previousKey = KeyEvent.VK_UNDEFINED; - private int mode; - - public A3DBoxInteraction() - { - super(1, AUTOMATIC_REPAINT, SCREEN_COORDINATES, false); - - // The center of the ellipse is in (0, 0) in User Space - // dummy for now - hr[0] = new Ellipse2D.Double(-d / 2, -d / 2, d, d); - } - - public void connect(AInteractionsManager manager) - { - super.connect(manager); - } - - public int getPressButton() - { - return AInteractionsManager.LEFT; - } - - public int init(Point2D.Double p, int key) - { - keyChange(p, key); - return -1; - } - - public void pressed(Point2D.Double p, int button, int key) - {} - - public int getButton() - { - return AInteractionsManager.LEFT; - } - - public void start(Point2D.Double p, int region, int key) - {} - - private void keyChange(Point2D.Double p, int key) - { - p0 = p; - - switch (key) - { - case KeyEvent.VK_UNDEFINED: - mode = ZOOM_MODE; - break; - - case KeyEvent.VK_H: - mode = HORIZONTAL_ZOOM_MODE; - break; - - case KeyEvent.VK_V: - mode = VERTICAL_ZOOM_MODE; - break; - - case KeyEvent.VK_R: - mode = ROTATE_MODE; - break; - - case KeyEvent.VK_Z: - mode = ZOOM_MODE; - break; - } - } - - public void drag(Point2D.Double p, int region, int key) - { - if (key != previousKey) - { - keyChange(p, key); - previousKey = key; - } - - double zf; - AProjection proj = window.getProjection(); - Point2D.Double center = ((AProjection3DBox) proj).getCenter(window); - - switch (mode) - { - case ZOOM_MODE: - zf = p0.distance(center.getX(), center.getY()) - / p.distance(center.getX(), center.getY()); - ((AProjection3DBox) proj).zoom(zf); - p0 = p; - window.repaintFromScratch(); - break; - case HORIZONTAL_ZOOM_MODE: - zf = Math.abs((p0.getX() - center.getX()) - / (p.getX() - center.getX())); - ((AProjection3DBox) proj).zoomHorizontal(zf); - p0 = p; - window.repaintFromScratch(); - break; - case VERTICAL_ZOOM_MODE: - zf = Math.abs((p0.getY() - center.getY()) - / (p.getY() - center.getY())); - ((AProjection3DBox) proj).zoomVertical(zf); - p0 = p; - window.repaintFromScratch(); - break; - case ROTATE_MODE: - AParameter phiPar = parameterStore.get(proj.getName(), "Phi"); - double height = window.getCurrDisp().getHeight(); - double deltaV = p.getY() - p0.getY(); - phiPar.setD(adjustPhi(phiPar.getD() + 360. * deltaV / height)); - p0 = p; - window.repaintFromScratch(); - break; - } - } - - private double adjustPhi(double phi) - { - while (phi < 0) - phi += 360; - while (phi > 360) - phi -= 360; - return phi; - } - - public void stop() - {} - - public void cancel() - {} - - public void paint(Graphics2D g) - { - Point2D.Double p = ((AProjection3DBox) window.getProjection()).getCenter(window); - g.setColor(Color.red); - g.fillOval((int) (p.x - d / 2), (int) (p.y - d / 2), d, d); - } - - public void entered() - { -// if (region == 0) - window.setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - - public void exited() - { - // if (region == 0) - window.setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - - public int getPopupType() - { - return APopupListener.WINDOW_POPUP; - } - - /*public void showPopup(Point p, int region) - { - popupMenu.show(window, p.x, p.y); - }*/ - - public JMenuItem[] getPopupItems() { - return null; - } - - public AModifier[] getModifiers() - { - return new AModifier[] { - new AModifier(KeyEvent.VK_UNDEFINED, false, "Change the volume of the box"), - new AModifier(KeyEvent.VK_Z, false, "Change the volume of the box"), - new AModifier(KeyEvent.VK_H, false, "Change the length of the box"), - new AModifier(KeyEvent.VK_V, false, "Change the height of the box"), - new AModifier(KeyEvent.VK_R, false, "Rotate around axis of box") - }; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AClockGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/AClockGroup.java deleted file mode 100755 index 8bfd75d8ffe4883184afe6729250db8aad56bd74..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AClockGroup.java +++ /dev/null @@ -1,62 +0,0 @@ -package atlantis.interactions; - -import atlantis.canvas.ACanvas; -import atlantis.parameters.APar; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import javax.swing.JCheckBox; -import javax.swing.JPanel; - -public class AClockGroup extends AInteractionGroup { - - private AClockInteraction clockInteraction; - private JCheckBox checkbox; - // the panel that will contain the additional controls for the interactions - private JPanel additionalControls; - - public AClockGroup(AInteractionsManager iManager) { - super(AInteractionGroup.WINDOW_GROUP, iManager); - - clockInteraction=new AClockInteraction(); - addInteraction(clockInteraction); - - // create the additional controls panel - additionalControls = new JPanel(); - - checkbox=new JCheckBox("on/off", false); - checkbox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - switch(e.getStateChange()) { - case ItemEvent.SELECTED: - parameterStore.get("YX", "Clock").setStatus(true); - break; - - case ItemEvent.DESELECTED: - parameterStore.get("YX", "Clock").setStatus(false); - break; - } - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - } - }); - additionalControls.add(checkbox); - } - - public void connect() { - checkbox.setSelected(parameterStore.get("YX", "Clock").getStatus()); - } - - /** - * this interaction group has additional controls, so return true - */ - - public boolean hasAdditionalControls() { - return true; - } - /** - * returns the additional controls - */ - public JPanel getAdditionalControls() { - return additionalControls; - } - -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AClockInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/AClockInteraction.java deleted file mode 100755 index 13a44dbe9f5e267cf832a741ca8ba830dc3d1c94..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AClockInteraction.java +++ /dev/null @@ -1,103 +0,0 @@ -package atlantis.interactions; - - -import java.awt.*; -import java.awt.geom.*; - -import atlantis.graphics.*; -import atlantis.parameters.*; -import atlantis.projection.*; -import atlantis.utils.*; - - -public class AClockInteraction extends AInteraction - implements ASleepMouseDragListener { - - private ALineSegment line; - private double phi; - - public AClockInteraction() { - super(1, WINDOW_TOTAL_REPAINT, WORLD_COORDINATES, false); - // double phi = APar.get("YX","Phi").getD()*AMath.DEGREES_TO_RADIANS+Math.PI; - double phi=Math.toRadians(parameterStore.get("YX", "Phi").getD()); - - line=new ALineSegment(0, 0, 1500*Math.cos(phi), 1500*Math.sin(phi), 10); - hr[0]=line; - } - - public RectangularShape getScreenHotRegion(int region) { - if(region==0) - return new ALineSegment(window.calculateDisplay(line.p1), window.calculateDisplay(line.p2), 10); - else - return null; - } - - public int init(Point2D.Double p, int key) { - return 1; - } - - public int getButton() { - return AInteractionsManager.LEFT; - } - - public void start(Point2D.Double p, int region, int key) { - // if(parameterStore.get("YX","Clock").getStatus()) - if(region==0) - parameterStore.get("YX", "Clock").setD(0.0000001); - else if(region==1) { - AProjection2D projection=(AProjection2D)window.getProjection(); - Point2D.Double p0=projection.inverseNonLinearTransform(p); - - this.phi=Math.atan2(p0.y, p0.x); - } - } - - public void drag(Point2D.Double p, int region, int key) { - if(region==0) { - double phi=Math.atan2(p.y, p.x); - - // phi+=Math.PI; - if(phi<0) phi+=2*Math.PI; - parameterStore.get("YX", "Phi").setD(Math.toDegrees(phi)); - } else if(region==1&¶meterStore.get("YX", "Clock").getStatus()) { - double phiPrime=Math.atan2(p.y, p.x); - double phi0=Math.toRadians(parameterStore.get("YX", "Phi").getD()); - double deltaPhiPrime=phiPrime-phi0; - - if(deltaPhiPrime<-Math.PI) deltaPhiPrime+=2*Math.PI; - if(deltaPhiPrime>Math.PI) deltaPhiPrime-=2*Math.PI; - double deltaPhi=this.phi-phi0; - - if(deltaPhi<-Math.PI) deltaPhi+=2*Math.PI; - if(deltaPhi>Math.PI) deltaPhi-=2*Math.PI; - - if((deltaPhi>0.&&deltaPhiPrime-deltaPhi>0.)||(deltaPhi<0.&&deltaPhiPrime-deltaPhi<0.)) { - double a=(deltaPhi*Math.PI-deltaPhiPrime*Math.abs(deltaPhi))/(deltaPhiPrime-deltaPhi); - - parameterStore.get("YX", "Clock").setD(Math.min(Math.max(Math.PI/a, 0.000001), 7.)); - } else { - parameterStore.get("YX", "Clock").setD(0.000001); - } - } - } - - public void stop() {} - - public void cancel() {} - - public void paint(Graphics2D g) { - // double phi = parameterStore.get("YX","Phi").getD()*AMath.DEGREES_TO_RADIANS+Math.PI; - double phi=Math.toRadians(parameterStore.get("YX", "Phi").getD()); - - line.p2.setLocation(1500*Math.cos(phi), 1500*Math.sin(phi)); - ALineSegment screenLine=(ALineSegment)getScreenHotRegion(0); - - AGraphics ag=AGraphics.makeAGraphics(g); - - ag.updateDrawParameters(frameDrawParameters); - ag.drawLine(screenLine.p1.x, screenLine.p1.y, screenLine.p2.x, screenLine.p2.y); - ag.updateDrawParameters(drawParameters); - ag.drawLine(screenLine.p1.x, screenLine.p1.y, screenLine.p2.x, screenLine.p2.y); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AEnterExitListener.java b/graphics/AtlantisJava/src/atlantis/interactions/AEnterExitListener.java deleted file mode 100755 index 7bc8fdb6fb4893866fce0775b77614172e52f48d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AEnterExitListener.java +++ /dev/null @@ -1,13 +0,0 @@ -package atlantis.interactions; - - -/** - * The listener is supported by AInteractionsManager, - * it generated events when the mouse is entering or exiting a Hot Region. - */ -public interface AEnterExitListener { - - void entered(); - void exited(); -} - diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeChangeListener.java b/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeChangeListener.java deleted file mode 100644 index 5b6c091c36307da171d545d2cfc1a86829962f12..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeChangeListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package atlantis.interactions; - -/** - * Interface for all FishEyeChangeListener classes. Each time the FishEye - * parameters are changed, all listeners are called with the new paremeters - * @author sboeser - */ -public interface AFishEyeChangeListener { - - /** - * This method gets called each time new fisheye parameters are set - * @param status the new fishEye status - * @param value the new fishEye value - */ - abstract public void fishEyeChange(boolean status, double value); - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeGroup.java deleted file mode 100755 index d2784b7826666ec3d63aed326130b0796947acda..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeGroup.java +++ /dev/null @@ -1,116 +0,0 @@ -package atlantis.interactions; - -import atlantis.canvas.ACanvas; -import java.awt.event.*; -import javax.swing.JCheckBox; -import javax.swing.JFormattedTextField; -import javax.swing.JLabel; -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.text.NumberFormat; - -public class AFishEyeGroup extends AInteractionGroup implements AFishEyeChangeListener { - - private final AFishEyeInteraction fishEyeInteraction; - private final JCheckBox checkbox; - private final JFormattedTextField valueField; - // the panel that will contain the additional controls for the interactions - private JPanel additionalControls; - -//Format, label and label string for value field - private NumberFormat valueFormat; - private JLabel valueLabel; - private static String valueString = "Value: "; - - public AFishEyeGroup(AInteractionsManager iManager) { - super(AInteractionGroup.WINDOW_GROUP, iManager); - - fishEyeInteraction=new AFishEyeInteraction(); - addInteraction(fishEyeInteraction); - - // create the additional controls panel - additionalControls = new JPanel(); - - checkbox=new JCheckBox("on/off", false); - checkbox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - switch(e.getStateChange()) { - case ItemEvent.SELECTED: - fishEyeInteraction.setStatus(true); - //fishEyeInteraction.getParameter("FishEye").setStatus(true); - break; - - case ItemEvent.DESELECTED: - fishEyeInteraction.setStatus(false); - //fishEyeInteraction.getParameter("FishEye").setStatus(false); - break; - } - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - } - }); - -//Create the label - valueLabel = new JLabel(valueString); - valueFormat = NumberFormat.getNumberInstance(); - valueFormat.setMaximumIntegerDigits(2); - valueField=new JFormattedTextField(valueFormat); - valueField.setToolTipText("Enter fish eye value between 0 and 25"); - valueField.setValue(new Double(0)); - valueField.setColumns(3); - valueField.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { - Number value =(Number)valueField.getValue(); - double dvalue = value.doubleValue(); - if(dvalue>0 && dvalue<25) - { - fishEyeInteraction.setValue(dvalue); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - } - else - { - Double val = new Double(fishEyeInteraction.getValue()); - valueField.setValue(val); - } - } - }); - - JPanel nestedPanel = new JPanel(); - nestedPanel.add(valueLabel); - nestedPanel.add(valueField); - - JPanel borderPanel = new JPanel(new BorderLayout()); - borderPanel.add(checkbox, BorderLayout.WEST); - borderPanel.add(nestedPanel, BorderLayout.EAST); - - additionalControls.add(borderPanel); - - } - - public void connect() { - super.connect(); - - //Only after we are connected to a window, add ourselves as update listener - fishEyeInteraction.addFishEyeChangeListener(this); - } - - public void fishEyeChange(boolean status, double value) { - valueField.setValue(value); - checkbox.setSelected(status); - } - - /** - * FishEye has additional controls, so return true - */ - public boolean hasAdditionalControls() { - return true; - } - - /** - * return the additional controls - */ - public JPanel getAdditionalControls() { - return additionalControls; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeInteraction.java deleted file mode 100755 index b1abf8608b4af07a34716e55363799ec7583fc3d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AFishEyeInteraction.java +++ /dev/null @@ -1,389 +0,0 @@ -package atlantis.interactions; - -import atlantis.graphics.ACursorFactory; -import atlantis.parameters.AParameter; -import atlantis.parameters.APar; -import atlantis.projection.*; -import java.awt.Graphics2D; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.awt.event.ActionListener; -import javax.swing.JMenuItem; -import java.awt.geom.*; -import java.util.Vector; - -/** - * The FishEye transformation will expand the central part of the display, - * while keeping the outer borders. This helps in e.g. expanding the inner detector region. - **/ - -public class AFishEyeInteraction extends AInteraction - implements ASleepMouseDragListener, ActionListener, AEnterExitListener { - - //A list of listeners for fishEye changes - private Vector<AFishEyeChangeListener> fishEyeChangeListeners = new Vector<AFishEyeChangeListener>(); - - private final int d=20; - private final int region = 0; - private Point2D.Double firstP; - private JMenuItem[] popupItems; - - private final static String TOGGLE_FISHEYE="Fish Eye On/Off"; - - /** - * Create a new FishEye interaction - */ - public AFishEyeInteraction() { - super(1, WINDOW_TOTAL_REPAINT, WORLD_COORDINATES, false); - - hr[0]=new Ellipse2D.Double(0, 0, d, d); - - popupItems = new JMenuItem[] { - new JMenuItem(TOGGLE_FISHEYE), - }; - - for (int i = 0; i < popupItems.length; i++) { - popupItems[i].addActionListener(this); - } - } - - - /** - * Initialize FishEye transformation using an inital point - */ - public int init(Point2D.Double p, int key) { - - AProjection2D projection=(AProjection2D)window.getProjection(); - - firstP=new Point2D.Double(Math.abs(p.x), Math.abs(p.y)); - firstP=projection.inverseNonLinearTransform(firstP); - - return region; - } - - /** - * Returns the button this interaction uses - **/ - public int getButton() { - return AInteractionsManager.LEFT; - } - - /** - * Get projection parameters using APar - **/ - private AParameter getParameter(String name) { - AProjection projection=window.getProjection(); - - if(projection instanceof AProjectionYX) - return parameterStore.get("YX", name); - else if(projection instanceof AProjectionRZ) - return parameterStore.get("RZ", name); - else if(projection instanceof AProjection3D) - return parameterStore.get("3D", name); - else if(projection instanceof AProjectionYZ||projection instanceof AProjectionXZ) - return parameterStore.get("XZ", name); - else if(projection instanceof AProjectionFR) - return parameterStore.get("FR", name); - else if(projection instanceof AProjectionFZ) - return parameterStore.get("FZ", name); - else - throw new Error("Fish Eye should be used ONLY in YX, RZ, FZ and FR"); - } - - /** - * Get new FishEye parameter if mouse has moved to p in YX projection - **/ - private void updateYX(Point2D.Double p, int key) { - double r1=Math.sqrt(firstP.x*firstP.x+firstP.y*firstP.y); - double r2=Math.sqrt(p.x*p.x+p.y*p.y); - double rTo=getParameter("rTo").getD(); - - if(r1<rTo&&r2>rTo) return; - if(r2<rTo&&r1>rTo) return; - - double newFishEyeValue=1000*(r2-r1)/(r1*rTo-r1*r2); - - if(newFishEyeValue<0||newFishEyeValue>25) return; - - setValue(newFishEyeValue); - fireFishEyeChange(getStatus(),getValue()); - } - - /** - * Get new FishEye parameter if mouse has moved to p in RZ projection - **/ - private void updateRZ(Point2D.Double p, int key) { - double newFishEyeValue=0; - - switch(key) { - case KeyEvent.VK_UNDEFINED: - case KeyEvent.VK_F: - case KeyEvent.VK_H: - double z1=firstP.x; - double z2=Math.abs(p.x); - double zTo=getParameter("zTo").getD(); - - if(z1<zTo&&z2>zTo) return; - if(z2<zTo&&z1>zTo) return; - - newFishEyeValue=1000*(z2-z1)/(z1*zTo-z1*z2); - break; - - case KeyEvent.VK_V: - double r1=Math.abs(firstP.y); - double r2=Math.abs(p.y); - double rTo=getParameter("rTo").getD(); - - if(r1<rTo&&r2>rTo) return; - if(r2<rTo&&r1>rTo) return; - - newFishEyeValue=1000*(r2-r1)/(r1*rTo-r1*r2); - break; - } - - if(newFishEyeValue<0||newFishEyeValue>25) return; - setValue(newFishEyeValue); - fireFishEyeChange(getStatus(),getValue()); - } - - /** - * Get new FishEye parameter if mouse has moved to p in XZ projection - **/ - private void updateXZ(Point2D.Double p, int key) { - double newFishEyeValue=0; - - switch(key) { - case KeyEvent.VK_UNDEFINED: - case KeyEvent.VK_F: - case KeyEvent.VK_H: - double z1=firstP.x; - double z2=Math.abs(p.x); - double zTo=getParameter("zTo").getD(); - - if(z1<zTo&&z2>zTo) return; - if(z2<zTo&&z1>zTo) return; - - newFishEyeValue=1000*(z2-z1)/(z1*zTo-z1*z2); - break; - - case KeyEvent.VK_V: - double r1=Math.abs(firstP.y); - double r2=Math.abs(p.y); - double rTo=getParameter("yTo").getD(); - - if(r1<rTo&&r2>rTo) return; - if(r2<rTo&&r1>rTo) return; - - newFishEyeValue=1000*(r2-r1)/(r1*rTo-r1*r2); - break; - } - - if(newFishEyeValue<0||newFishEyeValue>25) return; - setValue(newFishEyeValue); - fireFishEyeChange(getStatus(),getValue()); - } - - /** - * Get new FishEye parameter if mouse has moved to p in Phi-R projection - **/ - private void updateFR(Point2D.Double p, int key) { - double r1=firstP.x; - double r2=p.x; - double rTo=getParameter("rTo").getD(); - - if(r1<rTo&&r2>rTo) return; - if(r2<rTo&&r1>rTo) return; - - double newFishEyeValue=1000*(r2-r1)/(r1*rTo-r1*r2); - - if(newFishEyeValue<0||newFishEyeValue>25) return; - - setValue(newFishEyeValue); - fireFishEyeChange(getStatus(),getValue()); - } - - /** - * Get new FishEye parameter if mouse has moved to p in Phi-Z projection - **/ - private void updateFZ(Point2D.Double p, int key) { - double z1=Math.abs(firstP.x); - double z2=Math.abs(p.x); - double zTo=getParameter("zTo").getD(); - - if(z1<zTo&&z2>zTo) return; - if(z2<zTo&&z1>zTo) return; - - double newFishEyeValue=1000*(z2-z1)/(z1*zTo-z1*z2); - - if(newFishEyeValue<0||newFishEyeValue>25) return; - - setValue(newFishEyeValue); - fireFishEyeChange(getStatus(),getValue()); - } - - /** - * Change FishEye parameter for corresponding projection - * if mouse is draged - **/ - public void drag(Point2D.Double p, int region, int key) { - if(!getParameter("FishEye").getStatus()) return; - - AProjection proj=window.getProjection(); - - if(proj instanceof AProjectionYX) - updateYX(p, key); - else if(proj instanceof AProjectionRZ||proj instanceof AProjection3D) - updateRZ(p, key); - else if(proj instanceof AProjectionXZ||proj instanceof AProjectionYZ) - updateXZ(p, key); - else if(proj instanceof AProjectionFR) - updateFR(p, key); - else if(proj instanceof AProjectionFZ) - updateFZ(p, key); - } - - // Empty interface implementations - public void stop() {} - public void start(Point2D.Double p, int region, int key) {} - public void cancel() {} - public void paint(Graphics2D g) {} - - public int getPopupType() { - return APopupListener.WINDOW_POPUP; - } - - /*public void showPopup(Point p, int region) { - popupMenu.show(window, p.x, p.y); - }*/ - - public JMenuItem[] getPopupItems() { - return popupItems; - } - - - /** - * Implementaiton of the ActionListener - * @param e - */ - public void actionPerformed(ActionEvent e) { - String action=e.getActionCommand(); - - if(action.equals(TOGGLE_FISHEYE)) { - //toggle the fisheye status - setStatus(!getStatus()); - //Update the window - window.repaintFromScratch(); - //And the GUI - fireFishEyeChange(getStatus(),getValue()); - } - } - - /** - * Public method so it can be called from the AFishEyeGroup to change the - * fish eye amount to a fixed value - * @param value the new value - */ - public void setValue(double value){ - getParameter("FishEye").setD(value); - } - - /** - * Return FishEye value (e.g to update the FishEye panel) - * @return the fishEye value - */ - public double getValue(){ - return getParameter("FishEye").getD(); - } - - /** - * Public method so it can be called externally from the AFishEyeGroup - * @param status true or false - */ - public void setStatus(boolean status) { - getParameter("FishEye").setStatus(status); - } - - /** - * @return the current fishEye status(true or false) - */ - public boolean getStatus() { - return getParameter("FishEye").getStatus(); - } - - /** - * Gets called each time we enter a window in which this interaction is active - */ - public void entered(){ - //Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getFishEyeCursor()); - } - - /** - * Gets called each time we leave a window in which this interaction is active - */ - public void exited(){ - //Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - - /** - * Return modifier keys for this projection - * - F for Fast (only detectors are update) - * - V for react only to Vertical mouse movement (only in RZ and XZ projection) - * - H for react only to Horizontal mouse movement (only in RZ and XZ projection, default) - **/ - public AModifier[] getModifiers(){ - if(window.getProjection() instanceof AProjectionRZ || - window.getProjection() instanceof AProjectionXZ) { - return new AModifier[] { - new AModifier(KeyEvent.VK_F, false, "Fast (data not drawn)"), - new AModifier(KeyEvent.VK_V, false, "Vertically defined FishEye"), - new AModifier(KeyEvent.VK_UNDEFINED, false, "Horizontally defined FishEye"), - new AModifier(KeyEvent.VK_H, false, "Horizontally defined FishEye") - }; - } else { - - return new AModifier[] { - new AModifier(KeyEvent.VK_F, false, "Fast (data not drawn)") - }; - } - } - - /** - * Add a new listener for FishEyeChange incidents - * @param listener to be added to list - */ - public void addFishEyeChangeListener(AFishEyeChangeListener listener) { - //Add this listener - fishEyeChangeListeners.addElement(listener); - //And bring it up to date - listener.fishEyeChange(getStatus(), getValue()); - - } - - /** - * Remove a listener from the liste - * @param listener to be removed from list - */ - public void removeFishEyeChangeListener(AFishEyeChangeListener listener) { - //Remove this listener - fishEyeChangeListeners.removeElement(listener); - } - - /** - * Call fishEyeChange method of all FishEyeChange listeners - * @param status the new fisheye status - * @param value the new fisheye value - */ - private void fireFishEyeChange(boolean status, double value) { - - // Loop over all listeners - for (AFishEyeChangeListener listener : fishEyeChangeListeners) - { - // give them the new status - listener.fishEyeChange(status,value); - } - } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/AInteraction.java deleted file mode 100755 index 446aedc3f93bf836fb861918629370266817b72b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AInteraction.java +++ /dev/null @@ -1,323 +0,0 @@ -package atlantis.interactions; - -import java.awt.Graphics2D; -import java.awt.Rectangle; -import java.awt.geom.Point2D; -import java.awt.geom.RectangularShape; -import java.awt.Point; -import javax.swing.JPopupMenu; -import javax.swing.JMenuItem; - -import atlantis.canvas.AWindow; -import atlantis.graphics.ADrawParameters; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.gui.APopupHelper; -import atlantis.parameters.APar; -import atlantis.utils.APolygon; - -/** - * The abstract supperclass of all the Atlantis interactions. - */ -public abstract class AInteraction -{ - protected static APar parameterStore = APar.instance(); - - /** When the inteaction does'nt need repainting */ - public final static int NO_REPAINT = 0; - - /** - * When the inteaction needs an automatic repainting (acoording to its hot - * regions) - */ - public final static int AUTOMATIC_REPAINT = 1; - - /** When the inteaction needs an repaint of all windows */ - public final static int ALL_WINDOWS_REPAINT = 3; - - /** When the inteaction needs to reapint from scratch its window */ - public final static int WINDOW_TOTAL_REPAINT = 4; - - /** - * The constant used to specify that the interaction wants SCREEN - * COORDINATES - */ - public final static int SCREEN_COORDINATES = 0; - - /** The constant used to specify that the interaction wants WORLD COORDINATES */ - public final static int WORLD_COORDINATES = 1; - - protected final static ADrawParameters frameDrawParameters = new ADrawParameters(true, AColorMap.BK, 4, 1, 1, AGraphics.SYMBOL_FILLED_BOX); - - protected final static ADrawParameters drawParameters = new ADrawParameters(true, AColorMap.WH, 4, 1, 0, AGraphics.SYMBOL_FILLED_BOX); - - protected AWindow window; - protected static final int ctrlPtSize = 1; - protected RectangularShape[] hr; - protected Point2D.Double[] pt; - protected Rectangle oldAffectedRegion; - protected int hotRegionsCount; - protected int repaintMode; - protected int coordinatesType; - protected boolean isPrintable; - - /** - * Creates a new Interaction. - * - * @param hotRegionsCount The number of hot regions used be the interaction - * @param repaintMode The type of repaint wanted. Could be: NO_REPAINT, - * AUTOMATIC_REPAINT, WINDOW_REPAINT, ALL_WINDOWS_REPAINT, - * WINDOW_TOTAL_REPAINT, ALL_WINDOWS_TOTAL_REPAINT. - * @param coordinatesType Could be: SCREEN_COORDINATES, WORLD_COORDINATES. - * @param isPrintable A boolean which indicates whether or not this - * interaction should be printable. - */ - public AInteraction(int hotRegionsCount, int repaintMode, int coordinatesType, boolean isPrintable) - { - - this.hotRegionsCount = hotRegionsCount; - this.repaintMode = repaintMode; - this.coordinatesType = coordinatesType; - this.isPrintable = isPrintable; - - hr = new RectangularShape[hotRegionsCount]; - - /* - * pt = new Point2D.Double[getPointsToIncludeCount()]; for (int i = 0; i < - * pt.length; i++) pt[i] = new Point2D.Double(0, 0); - */ - } - - /** - * Called by the InteractionsManager when the interaction gets connected to - * it. - */ - public void connect(AInteractionsManager manager) - { - this.window = manager.getWindow(); - } - - /** - * Called by the InteractionsManager when the interaction gets disconnected - * from it. - */ - public void disconnect() - { - this.window = null; - } - - /** - * Called by the window on which this interaction works in order to allow - * the interaction to draw on it. - * - * @param g The graphical context on which to draw. - */ - public abstract void paint(Graphics2D g); - - /** - * This method should convert any hot region used by interaction from user - * coordinates to screen coordinates. - * - * @param region The number of the hot region which needs to be converted. - * @return The new RectangularShape object which contains the converted - * region. - */ - public RectangularShape getScreenHotRegion(int region) - { - switch (coordinatesType) - { - case AInteraction.SCREEN_COORDINATES: - return hr[region]; - - case AInteraction.WORLD_COORDINATES: - RectangularShape screenShape = (RectangularShape) hr[region].clone(); - Point2D.Double center = window.calculateDisplay(screenShape.getCenterX(), screenShape.getCenterY()); - double w = screenShape.getWidth(); - double h = screenShape.getHeight(); - - screenShape.setFrame(center.x - w / 2, center.y - w / 2, w, h); - return screenShape; - - default: - return null; - } - } - - /** - * Returns an APolygon made up of the first 4 Hot Regions. - * - * @return The APolygon. - */ - public APolygon getAPolygon() - { - APolygon p = new APolygon(); - - for (int i = 0; i < 4; i++) - p.addPoint(hr[i].getCenterX(), hr[i].getCenterY()); - - return p; - } - - /** - * Sets the x-coordinate of the center of a RectangularShape. - * - * @param shape The shape to set the center to. - * @param x The new x-coordinate of the center. - */ - protected void setCenterX(RectangularShape shape, double x) - { - double w = shape.getWidth(); - double h = shape.getHeight(); - - shape.setFrame(x - w / 2, shape.getY(), w, h); - } - - /** - * Sets the y-coordinate of the center of a RectangularShape. - * - * @param shape The shape to set the center to. - * @param y The new y-coordinate of the center. - */ - protected void setCenterY(RectangularShape shape, double y) - { - double w = shape.getWidth(); - double h = shape.getHeight(); - - shape.setFrame(shape.getX(), y - h / 2, w, h); - } - - /** - * Sets the center of a RectangularShape to (x, y). - * - * @param shape The shape to set the center to. - * @param x The new x-coordinate of the center. - * @param y The new y-coordinate of the center. - */ - protected void setCenter(RectangularShape shape, double x, double y) - { - double w = shape.getWidth(); - double h = shape.getHeight(); - - shape.setFrame(x - w / 2, y - h / 2, w, h); - } - - /** - * Returns the center of an arbitrary hot-region. - * - * @param s The RectangularShape object the center of which is required - * @return The center in double format - */ - public Point2D.Double getCenter(RectangularShape s) - { - return new Point2D.Double(s.getCenterX(), s.getCenterY()); - } - - /** - * Returns the distance between two hot-regions. The result depends on the - * coordinates type. - * - * @param region1 The first region - * @param region2 The second region - * @return The distance - */ - protected double getRadius(int region1, int region2) - { - double dx = hr[region1].getCenterX() - hr[region2].getCenterX(); - double dy = hr[region1].getCenterX() - hr[region2].getCenterY(); - - return Math.sqrt(dx * dx + dy * dy); - } - - /** - * Returns the distance between a point and a hot-regions. The result - * depends on the coordinates type. - * - * @param x The x coordinate of the point - * @param y The y coordinate of the point - * @param region The region index to be used to get the region itself - * @return The distance - */ - protected double getRadius(double x, double y, int region) - { - double dx = x - hr[region].getCenterX(); - double dy = y - hr[region].getCenterY(); - - return Math.sqrt(dx * dx + dy * dy); - } - - /** - * Returns the distance between the center (0, 0) and a hot-regions. The - * result depends on the coordinates type. - * - * @param s The hot-region - * @return The distance - */ - protected double getRadius(RectangularShape s) - { - return s.getCenterX() * s.getCenterX() + s.getCenterY() * s.getCenterY(); - } - - /** - * Retirns the angle made by the line connecting the two hot-regions and the - * horizontal axis. - * - * @param region1 The first region - * @param region2 The second region - * @return the angle in radians. - */ - protected double getAngle(int region1, int region2) - { - double dx = hr[region1].getCenterX() - hr[region2].getCenterX(); - double dy = hr[region1].getCenterY() - hr[region2].getCenterY(); - - if (dx != 0 || dy != 0) - // is this correct - return Math.atan2(dx, dy); - else - return 0.; - } - - protected void drawActivePoint(double x, double y, AGraphics g) - { - g.updateDrawParameters(frameDrawParameters); - g.drawSymbol(x, y); - g.updateDrawParameters(drawParameters); - g.drawSymbol(x, y); - } - - protected void drawActivePoint(int region, AGraphics g) - { - g.updateDrawParameters(frameDrawParameters); - g.drawSymbol(hr[region].getCenterX(), hr[region].getCenterY()); - g.updateDrawParameters(drawParameters); - g.drawSymbol(hr[region].getCenterX(), hr[region].getCenterY()); - } - - protected void drawLine(int region1, int region2, AGraphics g) - { - g.drawLine(hr[region1].getCenterX(), hr[region1].getCenterY(), hr[region2].getCenterX(), hr[region2].getCenterY()); - } - - public boolean isPrintable() - { - return isPrintable; - } - - public AModifier[] getModifiers() - { - return new AModifier[0]; - } - - public void showPopupMenu(Point p, int region) { - APopupHelper.showPopupMenu(p, window, getPopupItems()); - } - - public JPopupMenu getPopupMenu() { - return APopupHelper.getPopupMenu(getPopupItems()); - } - - public JMenuItem[] getPopupItems() { - return null; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AInteractionGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/AInteractionGroup.java deleted file mode 100755 index fece4376137fe0837d3b49cf17e88eebe0224a21..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AInteractionGroup.java +++ /dev/null @@ -1,143 +0,0 @@ -package atlantis.interactions; - -import atlantis.canvas.ACanvas; -import atlantis.parameters.APar; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import java.util.Vector; - - -/** - * The InteractionGroup groups interactions of the same kind under a single - * object. The InteractionToolBar deals with the InteractionGroups instead - * of dealing with the interactions directly. - */ -public abstract class AInteractionGroup { - protected static APar parameterStore = APar.instance(); - - /** A group type which once made current affects only the window in which it works*/ - public static final int WINDOW_GROUP=0; - - /** A group type which once made current affects all the windows of the Canvas*/ - public static final int CANVAS_GROUP=1; - - protected String name; - protected String toolTip; - protected AInteractionsManager iManager; - private int groupType; - private boolean isCurrent=false; - private Vector<AInteraction> interactions; - - /** - * Creates an InteractionGroup of a specific type - * and connected to some InteractionsManager - * @param groupType The type of the interface. Can be: WINDOW_GROUP or CANVAS_GROUP - * @param iManager The InteractionsManager to which this group will be connected. - */ - public AInteractionGroup(int groupType, AInteractionsManager iManager) { - - this.groupType=groupType; - this.iManager=iManager; - - interactions=new Vector<AInteraction>(); - } - - public void setGroupName(String name) { - this.name=name; - } - - public String getGroupName() { - return name; - } - - public void setToolTip(String toolTip) { - this.toolTip=toolTip; - } - - public String getToolTip() { - return toolTip; - } - - public JMenuItem getPopupItem() { - JMenuItem item=new JMenuItem(name); - - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - ACanvas.getCanvas().getCurrentWindow().getInteractionToolBar().setSelectedGroup(name); - } - }); - - return item; - } - - /** - * Called by the InteractionsManager when the group gets connected to it. - */ - public void connect() {} - - /** - * Called by the InteractionsManager when the group gets disconnected from it. - */ - public void disconnect() {} - - public boolean isWindowGroup() { - return(groupType==WINDOW_GROUP); - } - - public boolean isCanvasGroup() { - return(groupType==CANVAS_GROUP); - } - - /** - * Checks if any additional controls are provided by the current interaction group - * @return true if the interaction group has additional controls - */ - public boolean hasAdditionalControls() { return false; } - - /** - * Returns the additional controls for the current interaction group - * @return the panel containing the additional controls - */ - - public JPanel getAdditionalControls() { return new JPanel(); } - - /** - * Registers a new interaction which will be available with this group. - * @param i The Interaction to be registered. - */ - protected void addInteraction(AInteraction i) { - interactions.addElement(i); - if(isCurrent) - iManager.setContext(this); - } - - /** - * Removes a previously registered interaction from the group. - * @param i The Interaction to be removed. - */ - protected void removeInteraction(AInteraction i) { - interactions.remove(i); - } - - /** - * Removes all previously registered interactions from the group. - */ - protected void removeAllInteractions() { - interactions.clear(); - } - - public Vector<AInteraction> getInteractions() { - return interactions; - } - - /** - * Used to help copying of group. The group should set its internal state to be - * the same as the state of the given group. - * @param givenGroup The group to be copied. - */ - public void setGroupState(AInteractionGroup givenGroup) {} - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AInteractionsConfigReader.java b/graphics/AtlantisJava/src/atlantis/interactions/AInteractionsConfigReader.java deleted file mode 100644 index 8b4dcaeb95f3e5a7c2e5c3dc307410a5613792dd..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AInteractionsConfigReader.java +++ /dev/null @@ -1,69 +0,0 @@ -package atlantis.interactions; - -import java.util.Hashtable; -import java.util.Map.Entry; -import java.util.Set; - -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import atlantis.projection.AProjectionsManager; - -/** - * Handles the "Interactions" node in the XML configuration file: - * <ul> - * <li>store the InteractionControl node for each projection</li> - * <li>process the lists of available/default projections in demo mode</li> - * </ul> - * - * @author waugh - */ -public class AInteractionsConfigReader { - - /** The set of XML nodes with projection information (name : node). */ - private final static Hashtable<String,Node> projectionNodes = new Hashtable<String, Node>(); - - /** - * Read and process the Interactions information from the XML configuration file. - * - * @param node The XML Node which contains the <bold>Interactions</bold> node. - */ - public static void readInteractions(Node node) { - initProjectionNodes(node); - setAvailableProjectionsInDemoMode(); - } - - /** - * Get the configuration XML node corresponding to a given projection. - * - * @param projectionName the name of the projection - * @return the corresponding InteractionControl node - */ - public static Node getNode(String projectionName) { - return projectionNodes.get(projectionName); - } - - private static void initProjectionNodes(Node node) { - NodeList childNodes=node.getChildNodes(); - for(int i=0; i<childNodes.getLength(); i++) { - Node child=childNodes.item(i); - - if(child.getNodeType()==Node.ELEMENT_NODE) { - String name=child.getAttributes().getNamedItem("projectionName").getNodeValue(); - projectionNodes.put(name, child); - } - } - } - - private static void setAvailableProjectionsInDemoMode() { - Set<Entry<String, Node>> entries = projectionNodes.entrySet(); - for (Entry<String,Node> entry : entries) { - String name = entry.getKey(); - Node node = entry.getValue(); - boolean availableInDemoMode = node.getAttributes().getNamedItem("availableInDemoMode").getNodeValue().equals("YES"); - boolean defaultInDemoMode = node.getAttributes().getNamedItem("defaultInDemoMode").getNodeValue().equals("YES"); - if (availableInDemoMode) AProjectionsManager.makeProjectionAvailableInDemoMode(name); - if (defaultInDemoMode) AProjectionsManager.makeProjectionDefaultInDemoMode(name); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AInteractionsManager.java b/graphics/AtlantisJava/src/atlantis/interactions/AInteractionsManager.java deleted file mode 100755 index 40b0a2d484fb3688d86ef48bf95311c199a1c892..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AInteractionsManager.java +++ /dev/null @@ -1,535 +0,0 @@ -package atlantis.interactions; - -import java.awt.Rectangle; -import java.awt.event.KeyEvent; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.MouseMotionListener; -import java.awt.event.WindowFocusListener; -import java.awt.event.WindowEvent; -import java.awt.geom.Point2D; -import java.awt.geom.RectangularShape; -import java.util.LinkedList; -import java.util.Vector; - -import javax.swing.JPopupMenu; -import javax.swing.SwingUtilities; -import javax.swing.JMenuItem; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.gui.AEventQueue; -import atlantis.gui.AInteractionToolBar; -import atlantis.gui.APointerPositionWindow; -import atlantis.gui.APreferencesControl; -import atlantis.projection.AProjectionTrackResidual; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.projection.AProjection2D; - -/** - * The InteractionsManager connects to the corresponding window in order to - * provide basic functionality to the interactions. - */ -public class AInteractionsManager -implements MouseListener, MouseMotionListener, WindowFocusListener { - - public final static int LEFT=0; - public final static int MIDDLE=1; - public final static int RIGHT=2; - public final static int ALL=3; - - private final static int safetySize=5; - - private AWindow window; //The window that is monitored by this interaction manager - private LinkedList<AInteraction> interactions; //A list of all the interactions linked to this manager - private AInteraction dragInter; - private int dragInterHotRegion; -// private AInteraction mcInteraction; //This one is set but not used by anything -// private int mcRegion; //This one is set but not used by anything - private RectangularShape[] old_hr; - private AInteractionGroup previousInterface; - private AModifier[] mouseModifiers; - private boolean origAlias=false; - - /** - * Creates an InteractionsManager to work with a specific window. - * @param _window The window with wich the InteractionsManager should work. - */ - public AInteractionsManager(AWindow _window) { - this.window=_window; - - interactions=new LinkedList<AInteraction>(); -// mcInteraction=null; -// mcRegion=-1; - - window.addMouseListener(this); - window.addMouseMotionListener(this); - - mouseModifiers=new AModifier[] { - new AModifier(KeyEvent.VK_O, true, "Output of pointer position"), - new AModifier(KeyEvent.VK_W, true, "Window Menu pops up"), - new AModifier(KeyEvent.VK_I, true, "Interaction Manager pops up"), - new AModifier(KeyEvent.VK_UNDEFINED, true, "Interaction Menu pops up") - }; - } - - public AModifier[] getMouseModifiers() { - return mouseModifiers; - } - - // Implementation of MouseListener - - public void mousePressed(MouseEvent e) { - - if(!ACanvas.getCanvas().getCurrentWindow().equals(window)) - ACanvas.getCanvas().setCurrentWindow(window.getName()); - - if(AInteractionsManager.isIntRightMouseButton(e)) - switch(AEventQueue.getKeyboardState()) { - - case KeyEvent.VK_W: - if(!(window.getProjection() instanceof AProjectionTrackResidual)) - AWindow.getPopupMenu().show(window, e.getX(), e.getY()); - return; - - case KeyEvent.VK_I: - JPopupMenu menu=AInteractionToolBar.getInteractionMenu(window); - - menu.show(window, e.getX(), e.getY()); - return; - - case KeyEvent.VK_O: - Point2D.Double position =window.calculateUser(e.getX(),e.getY()); - //If LegoPlot need to alter phi coord using reverse of the adjustPhi function - if( window.getProjection() instanceof AProjectionLegoPlot) - position.x=-AProjectionLegoPlot.adjustPhi(window,-position.x,position.y); - //Apply inverse non-linear transforms, if in 2D projection - if ( window.getProjection() instanceof AProjection2D) - position = ((AProjection2D)window.getProjection()).inverseNonLinearTransform(position); - //Add labels - String positionX = window.getProjection().getXLabel() + parseUnits(position.x, window.getProjection().getXUnits()); - String positionY = window.getProjection().getYLabel() + parseUnits(position.y, window.getProjection().getYUnits()); - APreferencesControl.setPosMenuItem(true);//shows window if not already visible - APointerPositionWindow.getInstance().toFront();//brings to front - APointerPositionWindow.append(positionX + ", " + positionY + "\n"); - return; - } - - processMousePressed(e); - - if(dragInter!=null) { - dragInter.hr=old_hr; - ((AMouseDragListener)dragInter).cancel(); -// if(dragInter instanceof AEnterExitListener) -// ((AEnterExitListener)dragInter).exited(dragInterHotRegion); - repaintInteraction(dragInter); - dragInter=null; - return; - } - - if(AInteractionsManager.isIntRightMouseButton(e)) - if(processPopupShow(e)) - return; - - if(setupDraggingByHotRegion(e)) return; - if(initializeSleepingInteraction(e)) return; - } - - private boolean processPopupShow(MouseEvent e) { - for(int i=interactions.size()-1; i>=0; i--) { - AInteraction interaction=(AInteraction)interactions.get(i); - - for(int region=0; region<interaction.hr.length; region++) { - if(interaction.getScreenHotRegion(region).contains(e.getPoint())) { - interaction.showPopupMenu(e.getPoint(), region); - return true; - } - } - } - - for(int i=interactions.size()-1; i>=0; i--) { - AInteraction interaction=(AInteraction)interactions.get(i); - - //Turn off right click menu for pick interaction - JMenuItem[] projmenu = (interaction instanceof APickInteraction) ? null : window.getProjection().getPopupItems(); - JMenuItem[] intmenu = (interaction instanceof APickInteraction) ? null : interaction.getPopupItems(); - - JPopupMenu finalmenu = new JPopupMenu(); - - // Combine projection and interaction menus - for (int it = 0; intmenu != null && it < intmenu.length; it++) { - finalmenu.add(intmenu[it]); - } - - if (projmenu != null && projmenu.length > 0 && - intmenu != null && intmenu.length > 0) { - - finalmenu.addSeparator(); - } - - for (int it = 0; projmenu != null && it < projmenu.length; it++) { - finalmenu.add(projmenu[it]); - } - - if (finalmenu.getComponentCount() != 0) { - finalmenu.show(window, (int)e.getPoint().getX(), (int)e.getPoint().getY()); - } - } - - return false; - } - - public void mouseReleased(MouseEvent e) { - if(dragInter!=null) { - ((AMouseDragListener)dragInter).stop(); -// if(dragInter instanceof AEnterExitListener) -// ((AEnterExitListener)dragInter).exited(dragInterHotRegion); - repaintInteraction(dragInter); - dragInter=null; - } - //reset anti-alias - if(origAlias && !(dragInter instanceof ASelection)) - APreferencesControl.setAliasMenuItem(true); - } - - public void mouseClicked(MouseEvent e) {} - - /** - * This function is called each time we enter the window this interaction manager is assigned to - */ - public void mouseEntered(MouseEvent e) { - - //Loop over interaction list from the end - for(int i=interactions.size()-1; i>=0; i--) { - - //get the interaction - AInteraction interaction=(AInteraction)interactions.get(i); - - //Check if this one listens to Enter/Exit events - if (interaction instanceof AEnterExitListener){ - ((AEnterExitListener)interaction).entered(); - } - } - } - - /** - * This function is called each time we exit the window this interaction manager is assigned to - */ - public void mouseExited(MouseEvent e) { - - //Loop over interaction list from the end - for(int i=interactions.size()-1; i>=0; i--) { - - //get the interaction - AInteraction interaction=(AInteraction)interactions.get(i); - - //Check if this one listens to Enter/Exit events - if (interaction instanceof AEnterExitListener) - ((AEnterExitListener)interaction).exited(); - } - } - - private void processMousePressed(MouseEvent e) { - //update if using anti-alias so can switch off during drag - if(!(dragInter instanceof ASelection)) - origAlias = APreferencesControl.getAliasMenuItem(); - for(int i=interactions.size()-1; i>=0; i--) { - AInteraction interaction=(AInteraction)interactions.get(i); - - if(!(interaction instanceof AMousePressListener)) continue; - AMousePressListener clickListener=(AMousePressListener)interaction; - - if(clickListener.getPressButton()!=AInteractionsManager.ALL) - if(clickListener.getPressButton()!=getButton(e)) continue; - Point2D.Double p=null; - - switch(interaction.coordinatesType) { - case AInteraction.SCREEN_COORDINATES: - p=new Point2D.Double(e.getX(), e.getY()); - break; - - case AInteraction.WORLD_COORDINATES: - // p = window.calculateUser(inverseNonLinearTransform(e.getPoint())); - p=window.calculateUser(e.getPoint()); - break; - } - clickListener.pressed(p, getButton(e), AEventQueue.getKeyboardState()); - setTopZOrder(interaction); - repaintInteraction(interaction); - } - } - - // Implementation of MouseMotionListener - - public void mouseDragged(MouseEvent e) { - if(dragInter==null) return; - - //switch off anti-alias - if(origAlias && !(dragInter instanceof ASelection)) - APreferencesControl.setAliasMenuItem(false); - Point2D.Double p=new Point2D.Double(e.getX(), e.getY()); - - if(dragInter.coordinatesType==AInteraction.WORLD_COORDINATES) - // p = dragInter.manager.getWindow().calculateUser(inverseNonLinearTransform(p)); - p=window.calculateUser(p); - - ((AMouseDragListener)dragInter).drag(p, dragInterHotRegion, AEventQueue.getKeyboardState()); - repaintInteraction(dragInter); - } - - //This function is called every time the mouse is moved on the window - public void mouseMoved(MouseEvent e) { - } - - // Implementation of WindowsFocusListener - - /** - * Get called each time the canvas has obtained a focus - */ - public void windowGainedFocus(WindowEvent e) { - //Check if the mouse is over this window (or any of its children) - if (getWindow().getMousePosition(true) != null){ - //raise a mouseEntered event, so the cursor gets updated - this.mouseEntered(null); - } - } - - /** - * Get called each time the canvas has lost a focus - */ - public void windowLostFocus(WindowEvent e) {} - - //Methods belonging to this class - - /** - * Returns all the interactions associated with this InteractionsManager. - * @return The LinkedList containing the interactions. - * DO NOT CHANGE THIS LINKEDLIST, JUST READ IT. - */ - public LinkedList<AInteraction> getInteractions() { - return interactions; - } - - public AWindow getWindow() { - return window; - } - - /** - * This function disconnects the current pannel and all it's - * interactions from the InteractionsManager. - */ - public void forgetContext() { - // Disconnect all the old interactions - if(previousInterface!=null) previousInterface.disconnect(); - for(int i=0; i<interactions.size(); i++) { - AInteraction inter=(AInteraction)interactions.get(i); - - inter.disconnect(); - } - - // Clear the list and repaint the window - interactions.clear(); - window.repaint(); - } - - /** - * Sets the current interaction interface and adds its interactions to the list - * (removing first the old interface and its interactions). - * @param iFace The new interface. - */ - public void setContext(AInteractionGroup iFace) { - forgetContext(); - - if(iFace!=null) - { - // add to the list, connect and repaint the new interactions - Vector<AInteraction> iFaceInter=iFace.getInteractions(); - - for(int i=0; i<iFaceInter.size(); i++) { - AInteraction inter=(AInteraction)iFaceInter.get(i); - interactions.addLast(inter); - inter.connect(this); - repaintInteraction(inter); - } - - iFace.connect(); - } - previousInterface=iFace; - } - - private void repaintInteraction(AInteraction interaction) { - switch(interaction.repaintMode) { - case AInteraction.NO_REPAINT: - return; - - case AInteraction.ALL_WINDOWS_REPAINT: - window.repaint(); - ACanvas.getCanvas().repaintOthers(window); - return; - - case AInteraction.WINDOW_TOTAL_REPAINT: - window.repaintFromScratch(); - return; - - case AInteraction.AUTOMATIC_REPAINT: - Rectangle regionToRedraw=interaction.getScreenHotRegion(0).getBounds(); - - for(int i=1; i<interaction.hr.length; i++) - regionToRedraw.add(interaction.getScreenHotRegion(i).getBounds()); - - if((interaction.pt!=null)&&(interaction.pt.length!=0)) - for(int i=0; i<interaction.pt.length; i++) - regionToRedraw.add(getScreenPointToInclude(interaction, i)); - - regionToRedraw.x-=safetySize; - regionToRedraw.y-=safetySize; - regionToRedraw.width+=2*safetySize; - regionToRedraw.height+=2*safetySize; - - if(interaction.oldAffectedRegion==null) - window.repaint(regionToRedraw); - else - window.repaint(SwingUtilities.computeUnion(interaction.oldAffectedRegion.x, - interaction.oldAffectedRegion.y, interaction.oldAffectedRegion.width, - interaction.oldAffectedRegion.height, new Rectangle(regionToRedraw))); - - interaction.oldAffectedRegion=regionToRedraw; - return; - } - } - - /** - * This method converts the specified "point to include" from user - * coordinates to screen coordinates. - * If the point is already in screen coordinates it just returns it. - */ - private Point2D.Double getScreenPointToInclude(AInteraction interaction, int n) { - switch(interaction.coordinatesType) { - case AInteraction.SCREEN_COORDINATES: - return interaction.pt[n]; - - case AInteraction.WORLD_COORDINATES: - return window.calculateDisplay(interaction.pt[n]); - - default: - return null; - } - } - - private boolean setupDraggingByHotRegion(MouseEvent e) { - for(int i=interactions.size()-1; i>=0; i--) { - AInteraction interaction=(AInteraction)interactions.get(i); - - if(!(interaction instanceof AMouseDragListener)) continue; - AMouseDragListener dInter=(AMouseDragListener)interaction; - - if(dInter.getButton()!=getButton(e)) continue; - - for(int j=0; j<interaction.hr.length; j++) { - if(interaction.getScreenHotRegion(j).contains(e.getPoint())) { - dragInter=interaction; - dragInterHotRegion=j; - - old_hr=new RectangularShape[dragInter.hr.length]; - for(int region=0; region<dragInter.hr.length; region++) - old_hr[region]=(RectangularShape)dragInter.hr[region].clone(); - - Point2D.Double p=new Point2D.Double(e.getX(), e.getY()); - - if(interaction.coordinatesType==AInteraction.WORLD_COORDINATES) - p=window.calculateUser(p); - - // add this statement to guarantee "p0" in AZMRInteraction is initialized - // maybe need more analysis here - if(dragInter instanceof AZMRInteraction) - ((ASleepMouseDragListener)dragInter).init(p, AEventQueue.getKeyboardState()); - - setTopZOrder(dragInter); - ((AMouseDragListener)dragInter).start(p, dragInterHotRegion, AEventQueue.getKeyboardState()); - repaintInteraction(dragInter); - return true; - } - } - } - return false; - } - - private boolean initializeSleepingInteraction(MouseEvent e) { - for(int i=interactions.size()-1; i>=0; i--) { - AInteraction interaction=(AInteraction)interactions.get(i); - - if(interaction instanceof ASleepMouseDragListener) { - ASleepMouseDragListener sdListener=(ASleepMouseDragListener)interaction; - - if(sdListener.getButton()==getButton(e)) { - dragInter=interaction; - - old_hr=new RectangularShape[dragInter.hr.length]; - for(int region=0; region<dragInter.hr.length; region++) - old_hr[region]=(RectangularShape)dragInter.hr[region].clone(); - - Point2D.Double p=new Point2D.Double(e.getX(), e.getY()); - - if(interaction.coordinatesType==AInteraction.WORLD_COORDINATES) - p=window.calculateUser(p); - - dragInterHotRegion=((ASleepMouseDragListener)dragInter).init(p, AEventQueue.getKeyboardState()); - - setTopZOrder(dragInter); - ((AMouseDragListener)dragInter).start(p, dragInterHotRegion, AEventQueue.getKeyboardState()); -// if(dragInter instanceof AEnterExitListener) -// ((AEnterExitListener)dragInter).entered(dragInterHotRegion); - - repaintInteraction(dragInter); - return true; - } - } - } - - return false; - } - - private void setTopZOrder(AInteraction ineraction) { - interactions.remove(ineraction); - interactions.addLast(ineraction); - repaintInteraction((AInteraction)interactions.getLast()); - } - - private int getButton(MouseEvent e) { - if(SwingUtilities.isLeftMouseButton(e)) - return LEFT; - else if(SwingUtilities.isMiddleMouseButton(e)) - return MIDDLE; - else if(AInteractionsManager.isIntRightMouseButton(e)) - return RIGHT; - else - return -1; - } - - private static boolean isIntRightMouseButton(MouseEvent e) - { - return SwingUtilities.isRightMouseButton(e) || - AEventQueue.getIntRightMouseButton(); - } - - private String parseUnits(double d, String units) - { - //covert units and value units shown are cm by default - double abs = Math.abs(d); - if(units.equals("(cm)")) - { - if (abs >= 100.) - return ": " + Math.rint(1000. * d / 100.) / 1000. + " m"; - else if (abs >= 1.) - return ": " + Math.rint(1000. * d / 1.) / 1000. + " cm"; - else if (abs >= 0.1) - return ": " + Math.rint(1000. * d / 0.1) / 1000. + " mm"; - else - return ": " + Math.rint(d / 0.0001) + " um"; - } - else - { - return ": " + Math.rint(1000. * d / 1.) / 1000. + units; - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ALineSegment.java b/graphics/AtlantisJava/src/atlantis/interactions/ALineSegment.java deleted file mode 100755 index 7fe3cfe1acf8737533c23c7c5567b59eaf85c3e0..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ALineSegment.java +++ /dev/null @@ -1,165 +0,0 @@ -package atlantis.interactions; - - -import atlantis.utils.AVector; -import java.awt.geom.*; - - -/** - * A implementation of the java.awt.RectangularShape which - * represents a segment of a line. - */ -public class ALineSegment extends RectangularShape implements PathIterator { - - Point2D.Double p1; - Point2D.Double p2; - double thickness; - - public ALineSegment(Point2D.Double p1, Point2D.Double p2, double thickness) { - this.p1=p1; - this.p2=p2; - this.thickness=thickness; - } - - public ALineSegment(double x1, double y1, double x2, double y2, double thickness) { - this.p1=new Point2D.Double(x1, y1); - this.p2=new Point2D.Double(x2, y2); - this.thickness=thickness; - } - - private Point2D.Double[] calculateNodes() { - AVector v1=new AVector(p1, p2).makeUnitary().scale(thickness/2).rotate(Math.PI/2); - AVector v2=new AVector(p1, p2).makeUnitary().scale(thickness/2).rotate(-Math.PI/2); - - Point2D.Double[] p=new Point2D.Double[4]; - - p[0]=new Point2D.Double(p1.x+v1.dx, p1.y+v1.dy); - p[1]=new Point2D.Double(p2.x+v1.dx, p2.y+v1.dy); - p[2]=new Point2D.Double(p2.x+v2.dx, p2.y+v2.dy); - p[3]=new Point2D.Double(p1.x+v2.dx, p1.y+v2.dy); - - return p; - } - - public Rectangle2D getBounds2D() { - Point2D.Double[] p=calculateNodes(); - - double minX, minY, maxX, maxY; - - minX=maxX=p[0].x; - minY=maxY=p[0].y; - - for(int i=1; i<p.length; i++) { - if(p[i].x<minX) minX=p[i].x; - if(p[i].x>maxX) maxX=p[i].x; - if(p[i].y<minY) minY=p[i].y; - if(p[i].y>maxY) maxY=p[i].y; - } - - return new Rectangle2D.Double(minX, minY, maxX-minX, maxY-minY); - } - - public boolean contains(double x, double y) { - boolean c=false; - Point2D.Double[] p=calculateNodes(); - - for(int i=0, j=p.length-1; i<p.length; j=i++) - if((((p[i].y<=y)&&(y<p[j].y))||((p[j].y<=y)&&(y<p[i].y))) - &&(x<(p[j].x-p[i].x)*(y-p[i].y)/(p[j].y-p[i].y)+p[i].x) - ) c=!c; - - return c; - } - - public boolean intersects(double x, double y, double w, double h) { - return false; - } - - public boolean contains(double x, double y, double w, double h) { - return false; - } - - public PathIterator getPathIterator(AffineTransform at) { - lineNumber=-1; - return this; - } - - public void setFrame(double x, double y, double w, double h) {} - - public boolean isEmpty() { - return false; - } - - public double getWidth() { - return getBounds2D().getWidth(); - } - - public double getHeight() { - return getBounds2D().getHeight(); - } - - public double getX() { - return getBounds2D().getX(); - } - - public double getY() { - return getBounds2D().getY(); - } - - // PathIterator implementation - int lineNumber; - - // Returns the coordinates and type of the current path segment in the iteration. - public int currentSegment(double[] coords) { - Point2D.Double[] p=calculateNodes(); - - if(lineNumber==-1) { - coords[0]=p[0].x; - coords[1]=p[0].y; - return PathIterator.SEG_MOVETO; - } - - if(lineNumber==4) return PathIterator.SEG_CLOSE; - - coords[0]=p[lineNumber].x; - coords[1]=p[lineNumber].y; - return PathIterator.SEG_LINETO; - } - - public int currentSegment(float[] coords) { - Point2D.Double[] p=calculateNodes(); - - if(lineNumber==-1) { - coords[0]=(float)p[0].x; - coords[1]=(float)p[0].y; - return PathIterator.SEG_MOVETO; - } - - if(lineNumber==4) return PathIterator.SEG_CLOSE; - - coords[0]=(float)p[lineNumber].x; - coords[1]=(float)p[lineNumber].y; - return PathIterator.SEG_LINETO; - } - - // Returns the winding rule for determining the interior of the path. - public int getWindingRule() { - return PathIterator.WIND_NON_ZERO; - } - - public boolean isDone() { - if(lineNumber>4) - return true; - else - return false; - } - - public void next() { - lineNumber++; - } - - public String toString() { - return "ALineSegment["+p1.x+", "+p1.y+", "+p2.x+", "+p2.y+"]"; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AModifier.java b/graphics/AtlantisJava/src/atlantis/interactions/AModifier.java deleted file mode 100644 index d1b57d65f839fdd09966c3c09e662390d7dcb671..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AModifier.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * AModifier.java - * - * Created on 16 July 2007, 12:17 by Adam Davison <adamd at hep.ucl.ac.uk> - */ - -package atlantis.interactions; - -import java.awt.event.KeyEvent; - -/** - * A structure for holding details of an interaction modifier key - * - * @author Adam Davison - */ -public class AModifier { - - public static AModifier nothing = new AModifier(KeyEvent.VK_UNDEFINED, false, "Default interaction"); - - private int m_keycode; - private char m_keychar; - - // Won't use mouse button id's from MouseEvent because i have some memory - // of this not being very platform independant, can fiddle this if we need - // middle click or something later. - private boolean m_right; - - private String m_desc; - - public AModifier(int keycode, boolean right, String desc) { - m_keycode = keycode; - m_keychar = (char)keycode; - m_right = right; - m_desc = desc; - } - - public int getKeyCode() { - return m_keycode; - } - - public char getKeyChar() { - return m_keychar; - } - - public boolean getRightClick() { - return m_right; - } - - public String toKeyString() { - String ret = ""; - if (m_keycode != KeyEvent.VK_UNDEFINED) { - ret = String.valueOf(m_keychar); - if (m_right) { - ret = ret.concat(" + "); - } - } - - if (m_right) { - ret = ret.concat("Right"); - } - - return ret; - } - - public String toDescString() { - return m_desc; - } - - // Two interactions are pretty much the same even if they have different - // descriptions, hence I won't override equals here and cause problems - // putting these things in containers or anything. - public boolean sameAs(AModifier acmp) { - if (acmp == null) { return false; } - - if (acmp.getKeyCode() != getKeyCode()) { - return false; - } - - if (acmp.getRightClick() != getRightClick()) { - return false; - } - - return true; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AMouseDragListener.java b/graphics/AtlantisJava/src/atlantis/interactions/AMouseDragListener.java deleted file mode 100755 index 155f9126f2e52dbef1fb4adf802517aaef5739b4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AMouseDragListener.java +++ /dev/null @@ -1,20 +0,0 @@ -package atlantis.interactions; - - -import java.awt.geom.*; - - -/** - * Implemented by the interactions to get drag events - * from the InteractionsManager. - */ -public interface AMouseDragListener { - - // Should return one of the LEFT, MIDDLE or RIGHT constants from AWindow - int getButton(); - - void start(Point2D.Double p, int region, int key); - void drag(Point2D.Double p, int region, int key); - void stop(); - void cancel(); -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AMousePressListener.java b/graphics/AtlantisJava/src/atlantis/interactions/AMousePressListener.java deleted file mode 100755 index a71c7ca21871ee87c93867e3d8628408e4e5f374..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AMousePressListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package atlantis.interactions; - - -import java.awt.geom.*; - - -/** - * Implemented by the interactions to get press events - * from the InteractionsManager. - */ -public interface AMousePressListener { - - int getPressButton(); - void pressed(Point2D.Double p, int button, int key); -} - diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ANZMRGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/ANZMRGroup.java deleted file mode 100644 index 713743861be9a6c210d109912cb4f7dc2f5357b6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ANZMRGroup.java +++ /dev/null @@ -1,16 +0,0 @@ -package atlantis.interactions; - -/** - * - * @author Adam Davison - */ -public class ANZMRGroup extends AInteractionGroup { - - private ANZMRInteraction transformInteraction; - - public ANZMRGroup(AInteractionsManager iManager) { - super(AInteractionGroup.WINDOW_GROUP, iManager); - transformInteraction=new ANZMRInteraction(); - this.addInteraction(transformInteraction); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ANZMRInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/ANZMRInteraction.java deleted file mode 100644 index 99ac11f99f3e8258dda8929c5ee1ada66637d83b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ANZMRInteraction.java +++ /dev/null @@ -1,80 +0,0 @@ -package atlantis.interactions; - -import atlantis.nge.ANManager; -import atlantis.nge.ANPickDrawer; -import atlantis.nge.ANPickResultPrinter; -import atlantis.nge.ANProjection; -import atlantis.nge.ANProjection3D; -import atlantis.nge.ANProjectionPhysics; -import java.awt.Graphics2D; -import java.awt.geom.Point2D.Double; - -/** - * - * @author Adam Davison, Mark Stockton - */ -public class ANZMRInteraction extends AInteraction implements ASleepMouseDragListener, AMousePressListener { - - private Double m_last = null; - - public ANZMRInteraction() { - super(0, WINDOW_TOTAL_REPAINT, SCREEN_COORDINATES, false); - } - - @Override - public void paint(Graphics2D g) { - //throw new UnsupportedOperationException("Not supported yet."); - } - - public void doRotation(double dx, double dy) { - ANProjection np = (ANManager.getManager().getFrameManager(window).getTargetProjection()); - if (np instanceof ANProjection3D) { - ((ANProjection3D) np).dPhi((float) (dx / 4.0)); - ((ANProjection3D) np).dElev((float) (dy / 4.0)); - }else if (np instanceof ANProjectionPhysics) { - ((ANProjectionPhysics) np).dPhi((float) (dx / 4.0)); - ((ANProjectionPhysics) np).dElev((float) (dy / 4.0)); - } - } - - public int getButton() { - return AInteractionsManager.LEFT; - } - - public void start(Double p, int region, int key) { - m_last = p; - } - - public void drag(Double p, int region, int key) { - double dx = (p.getX() - m_last.getX()); - double dy = (p.getY() - m_last.getY()); - - doRotation(dx,dy); - - m_last = p; - } - - public void stop() { - - } - - public void cancel() { - - } - - public int init(Double p, int key) { - return -1; - } - - public int getPressButton() { - return AInteractionsManager.ALL; - } - - public void pressed(Double p, int button, int key) { - System.out.println("ZMR PRESS: " + p.getX() + ":" + p.getY()); - ANPickDrawer pd = new ANPickDrawer(window, window.getWidth(), window.getHeight(), - (int)p.getX(), (int)p.getY(), new ANPickResultPrinter()); - pd.doPick(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AParallelogramSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/AParallelogramSelection.java deleted file mode 100755 index 75e3f512cbc09dd8da1ba6fba01740214b5076cb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AParallelogramSelection.java +++ /dev/null @@ -1,119 +0,0 @@ -package atlantis.interactions; - - -import java.awt.*; -import java.awt.geom.*; - - -public class AParallelogramSelection extends ASelection { - final private static int STARTING_WIDTH=25; - - public AParallelogramSelection() { - super(6); - } - - public int init(Point2D.Double p, int key) { - isValid=false; - - setCenter(hr[0], p.x-STARTING_WIDTH, p.y); - setCenter(hr[1], p.x-STARTING_WIDTH, p.y); - setCenter(hr[2], p.x+STARTING_WIDTH, p.y); - setCenter(hr[3], p.x+STARTING_WIDTH, p.y); - setCenter(hr[4], p.x, p.y); - setCenter(hr[5], p.x, p.y); - - region=5; - return region; - } - - public void drag(Point2D.Double p, int region, int key) { - isValid=true; - - double dx, dy; - - switch(region) { - case 4: - dx=hr[0].getCenterX()-hr[4].getCenterX(); - dy=hr[0].getCenterY()-hr[4].getCenterY(); - - setCenter(hr[region], p.x, p.y); - setCenter(hr[0], p.x+dx, p.y+dy); - setCenter(hr[3], p.x-dx, p.y-dy); - break; - - case 5: - dx=hr[1].getCenterX()-hr[5].getCenterX(); - dy=hr[1].getCenterY()-hr[5].getCenterY(); - - setCenter(hr[region], p.x, p.y); - setCenter(hr[1], p.x+dx, p.y+dy); - setCenter(hr[2], p.x-dx, p.y-dy); - break; - - case 0: - case 3: - setCenter(hr[region], p.x, p.y); - - dx=hr[region].getCenterX()-hr[4].getCenterX(); - dy=hr[region].getCenterY()-hr[4].getCenterY(); - - if(region==3) { - dx=-dx; - dy=-dy; - } - - setCenter(hr[1], hr[5].getCenterX()+dx, hr[5].getCenterY()+dy); - setCenter(hr[2], hr[5].getCenterX()-dx, hr[5].getCenterY()-dy); - setCenter(hr[0], hr[4].getCenterX()+dx, hr[4].getCenterY()+dy); - setCenter(hr[3], hr[4].getCenterX()-dx, hr[4].getCenterY()-dy); - break; - - case 1: - case 2: - setCenter(hr[region], p.x, p.y); - - dx=hr[region].getCenterX()-hr[5].getCenterX(); - dy=hr[region].getCenterY()-hr[5].getCenterY(); - - if(region==2) { - dx=-dx; - dy=-dy; - } - - setCenter(hr[1], hr[5].getCenterX()+dx, hr[5].getCenterY()+dy); - setCenter(hr[2], hr[5].getCenterX()-dx, hr[5].getCenterY()-dy); - setCenter(hr[0], hr[4].getCenterX()+dx, hr[4].getCenterY()+dy); - setCenter(hr[3], hr[4].getCenterX()-dx, hr[4].getCenterY()-dy); - break; - } - } - - public void paint(Graphics2D g) { - paintStandard(g); - } - - /** - * Make the affine transform which corresponds to this - * paralleogram-shaped selection. - */ - public Point2D.Double[] getCorners() { - int first=getUpperLeftRegion(); - - // Calculate the opposite index. - int third=(first+2)%4; - - // Now use the cross-product to determine which of the - // remaining points is the one which keep the path going - // clockwise. - int second=(first+1)%4; - double dx0=hr[third].getCenterX()-hr[first].getCenterX(); - double dy0=hr[third].getCenterY()-hr[first].getCenterY(); - double dx1=hr[second].getCenterX()-hr[first].getCenterX(); - double dy1=hr[second].getCenterY()-hr[first].getCenterY(); - - if(dx0*dy1-dy0*dx1>0) second=(first+3)%4; - - return convert(first, second, third); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/APickGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/APickGroup.java deleted file mode 100755 index e45447479dd5025308c953f1fb99d6c9b13f252a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/APickGroup.java +++ /dev/null @@ -1,102 +0,0 @@ -package atlantis.interactions; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.JComboBox; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.JPanel; - -import atlantis.canvas.ACanvas; -import atlantis.parameters.APar; - -public class APickGroup extends AInteractionGroup -{ - private APickInteraction pickInteraction; - private JComboBox mode; - // the panel that will contain the additional controls for the interactions - private JPanel additionalControls; - - private final static String HITS = "Event Data"; - private final static String DETECTORS = "Detectors"; - - public APickGroup(AInteractionsManager iManager) - { - super(AInteractionGroup.CANVAS_GROUP, iManager); - - // create the additional controls panel - additionalControls = new JPanel(); - - pickInteraction = new APickInteraction(); - addInteraction(pickInteraction); - mode = new JComboBox(); - mode.addItem(HITS); - mode.addItem(DETECTORS); - if (parameterStore.get("Event", "PickingMode").getI() == 0) - mode.setSelectedItem(HITS); - else - mode.setSelectedItem(DETECTORS); - mode.addActionListener(new ModeListener()); - additionalControls.add(mode); - } - - /** - * pick has additional controls, so return true - */ - public boolean hasAdditionalControls() { - return true; - } - - /** - * returns the additional controls - */ - public JPanel getAdditionalControls() { - return additionalControls; - } - - public JMenuItem getPopupItem() - { - // generating the menu - JMenu menu = new JMenu(name); - ActionListener l = new PopUpListener(); - - menu.add(HITS).addActionListener(l); - menu.add(DETECTORS).addActionListener(l); - return menu; - } - - public void connect() - { - super.connect(); - if (parameterStore.get("Event", "PickingMode").getI() == 0) - mode.setSelectedItem(HITS); - else - mode.setSelectedItem(DETECTORS); - } - - class PopUpListener implements ActionListener - { - public void actionPerformed(ActionEvent e) - { - ACanvas.getCanvas().getCurrentWindow().getInteractionToolBar().setSelectedGroup(name); - mode.setSelectedItem(e.getActionCommand()); - if (e.getActionCommand().equals(HITS)) - parameterStore.get("Event", "PickingMode").setI(0); - else if (e.getActionCommand().equals(DETECTORS)) - parameterStore.get("Event", "PickingMode").setI(1); - } - } - - class ModeListener implements ActionListener - { - public void actionPerformed(ActionEvent e) - { - if (mode.getSelectedItem().equals(HITS)) - parameterStore.get("Event", "PickingMode").setI(0); - else if (mode.getSelectedItem().equals(DETECTORS)) - parameterStore.get("Event", "PickingMode").setI(1); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/APickInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/APickInteraction.java deleted file mode 100755 index a12cdce3ee14b539218af119fba8eabc66bc3f0d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/APickInteraction.java +++ /dev/null @@ -1,419 +0,0 @@ -package atlantis.interactions; - -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Robot; -import java.awt.AWTException; -import java.awt.geom.Point2D; -import java.awt.event.KeyEvent; -import javax.swing.SwingUtilities; - -import atlantis.list.AList; -import atlantis.list.AListManager; -import atlantis.nge.ANManager; -import atlantis.nge.ANProjectionPhysics; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.data.ALVL1TriggerTowerData; -import atlantis.data.AMuonHitData; -import atlantis.parameters.APar; -import atlantis.projection.AProjectionNPhysics; -import atlantis.projection.AProjectionTrackResidual; -import atlantis.projection.AProjectionsManager; -import atlantis.event.AData; -import atlantis.data.AJetData; -import atlantis.data.ACalorimeterData; -import atlantis.data.ALArData; -import atlantis.data.ASVxData; -import atlantis.data.ARVxData; -import atlantis.data.ATILEData; -import atlantis.data.ATrackData; -import atlantis.graphics.ACursorFactory; -import atlantis.graphics.APickingGraphics2D; -import atlantis.utils.AMath; - - - -public class APickInteraction extends AInteraction implements AMousePressListener, AEnterExitListener -{ - - public APickInteraction() - { - super(0, NO_REPAINT, SCREEN_COORDINATES, false); - } - - - - public int getPressButton() - { - return AInteractionsManager.ALL; - } - - - - private void showCaloPulseShapePlot(AList picked, boolean withcurve) - { - Integer i = APickingGraphics2D.getPickedHitIndex(); - if(i != null) - { - ACalorimeterData c = (ACalorimeterData) picked.getSource(); - c.plotPulseShapes(i.intValue(), withcurve); - } - } - - - - private void showTriggerPulseShapePlot(AList picked) - { - Integer i = APickingGraphics2D.getPickedHitIndex(); - if(i != null) - { - ALVL1TriggerTowerData t = (ALVL1TriggerTowerData) picked.getSource(); - t.plotPulseShapes(i.intValue()); - } - } - - - - private void ignorePickedItem(AList picked) - { - Integer i = APickingGraphics2D.getPickedHitIndex(); - if(i != null) - { - AData d = (AData) picked.getSource(); - String k = d.getStoreGateKey() != null ? ":" + d.getStoreGateKey() : ""; - String m = "\n\n" + d.getNameScreenName() + k + " ID " + - d.getIdFromIndex(i.intValue()) + " (index " + i.intValue() + - ") will be invisible and ignored " + - "(until removed from the Invisible list)"; - AOutput.alwaysAppend(m, ALogInterface.WARNING); - AListManager.getInstance().addInvisible(picked); - } - - } - - - - private void showMuonSector(AList picked) - { - if(picked.getSource() instanceof AMuonHitData) - { - int sector = ((AMuonHitData) picked.getSource()).getSector(picked.getItems()[0]); - int signRZ = ((AMuonHitData) picked.getSource()).getRZSign(picked.getItems()[0]); - if(signRZ == -1) - { - sector = (sector + 8) % 16; - } - parameterStore.get("YZ", "Phi").setD(sector * 22.5); - window.repaintFromScratch(); - } - } - - - - private void showTrackResidualPlot(AList picked) - { - AData pickedData = picked.getSource(); - if(pickedData instanceof ATrackData) - { - if(((ATrackData)pickedData).getResidualStatus()) - { - APickingGraphics2D.showTrackResiduals(window, - (int) APickingGraphics2D.getPickedH(), (int) APickingGraphics2D.getPickedV()); - } - else - { - AOutput.append("\nNo residual information available for this track\n", - ALogInterface.PICK); - } - } - } - - private void showJetView(AList picked) - { - AData pickedData = picked.getSource(); - if(pickedData instanceof AJetData){ - - // Use window "B" to show jets - String jetWindowName = "B"; - if(!ACanvas.getCanvas().isValidWindowName(jetWindowName)) - { - AOutput.append("\nWindow " + jetWindowName + " is not available in current layout" - + "\n", ALogInterface.WARNING); - } - else if(window.getName().equals(jetWindowName)){ - AOutput.append("\nPlease select jet view from a window other than window " + jetWindowName, ALogInterface.WARNING); - } - else{ - AWindow jetWindow = ACanvas.getCanvas().getWindow(jetWindowName); - - //set as NYX to get transition - AProjectionNPhysics jetProj = - (AProjectionNPhysics) AProjectionsManager.getProjection("NPhysics"); - - //setup the projection - ACanvas.getCanvas().moveToFrontWindow(jetWindowName); - jetWindow.setProjection(jetProj); - - //configure the projection - jetProj.configureFrame(ANManager.getManager().getFrameManager(jetWindow)); - ANProjectionPhysics finalProj = (ANProjectionPhysics) ANManager.getManager().getFrameManager(jetWindow).getTargetProjection(); - - AJetData jd = ((AJetData) pickedData); - int index=picked.getItems()[0]; - finalProj.lookAt(jd, index); - } - } - } - - - /** - * @param picked AList - * Check if picked data is SimVertex or RecVertex (RVx) and use the values - * as Atlantis primary vertex: Projection->eta/phi menu - */ - private void setAtlantisPrimaryVertex(AList picked) - { - Integer i = APickingGraphics2D.getPickedHitIndex(); - AData pickedData = picked.getSource(); - double[] vtx = null; - - if(i != null) - { - if(pickedData instanceof ARVxData) - { - vtx = ((ARVxData) pickedData).getVertex(i.intValue()); - } - if(pickedData instanceof ASVxData) - { - vtx = ((ASVxData) pickedData).getVertex(i.intValue()); - } - - if(vtx != null) - { - parameterStore.get("Event", "XVtx").setD(vtx[0]); - parameterStore.get("Event", "YVtx").setD(vtx[1]); - parameterStore.get("Event", "ZVtx").setD(vtx[2]); - AOutput.append("\n\nPrimary vertex set: Projection->" + - AMath.PHI + AMath.ETA + ":\n" + - " XVtx = " + String.format("%.5f",vtx[0]) + " cm\n" + - " YVtx = " + String.format("%.5f",vtx[1]) + " cm\n" + - " ZVtx = " + String.format("%.5f",vtx[2]) + " cm\n", - ALogInterface.WARNING); - } - } - - } // setAtlantisPrimaryVertex() ----------------------------------------- - - - - public void pressed(Point2D.Double p, int button, int key) - { - Point ps = null; - Point pw = null; - int pickingMode = parameterStore.get("Event", "PickingMode").getI(); - - if(button == AInteractionsManager.LEFT) - { - if(key == KeyEvent.VK_C) - { - AListManager.getInstance().clearHighlightAndMassCalculation(); - } - else - { - Rectangle bounds = window.getBounds(); - bounds.setLocation(0, 0); - window.paintWindowFromScratch(new APickingGraphics2D(bounds, - pickingMode, new Point((int) p.x, (int) p.y))); - - // this call prints pick information (calls datatype's getHitInfo()) - if(!(key == KeyEvent.VK_L)) - { - APickingGraphics2D.printPicked(); - } - AList picked = APickingGraphics2D.getPickedHit(); - - if(picked != null && pickingMode == APickingGraphics2D.PICK_HITS_AND_TRACKS) - { - - // highlight by default (not only when key==KeyEvent.VK_H) - AListManager.getInstance().highlight(picked); - - // try to always show calo pulse shapes plot by default - // if no key modifier is pressed - if(picked.getSource() instanceof ACalorimeterData && - key == KeyEvent.KEY_LOCATION_UNKNOWN) - { - showCaloPulseShapePlot(picked, true); - } - // 2009-01-19 for LAr only, see comment at - // the ALArData.plotADCCounts() method - if(picked.getSource() instanceof ACalorimeterData && - key == KeyEvent.VK_D) - { - showCaloPulseShapePlot(picked, false); - } - if(picked.getSource() instanceof ATILEData && - key == KeyEvent.VK_T) { - - Integer i = APickingGraphics2D.getPickedHitIndex(); - if (i != null) { - ATILEData c = (ATILEData) picked.getSource(); - c.plotPulseShapesWithTiming(i.intValue()); - } - } - if(picked.getSource() instanceof ALVL1TriggerTowerData && - key == KeyEvent.KEY_LOCATION_UNKNOWN) - { - showTriggerPulseShapePlot(picked); - } - - if(picked.getSource() instanceof AJetData) - { - double phi = ((AJetData) picked.getSource()).getPhi(picked.getItems()[0]); - parameterStore.get("XZ", "Phi").setD(Math.toDegrees(phi)); - } - - switch(key) - { - case KeyEvent.VK_A: - AListManager.getInstance().add(picked); - break; - case KeyEvent.VK_S: - showMuonSector(picked); - break; - case KeyEvent.VK_N: - APickingGraphics2D.navigatePicked(); - break; - case KeyEvent.VK_R: - showTrackResidualPlot(picked); - break; - case KeyEvent.VK_V: - setAtlantisPrimaryVertex(picked); - break; - case KeyEvent.VK_I: - ignorePickedItem(picked); - break; - case KeyEvent.VK_J: - if(parameterStore.get("Prefs", "OpenGL").getStatus()){ - showJetView(picked); - } - break; - case KeyEvent.VK_M: - AListManager.getInstance().massCalc(picked); - break; - case KeyEvent.VK_L: // Mass calculation for Neutral Decay scenarios - AListManager.getInstance().massCalcV0(picked); - break; - case KeyEvent.VK_P: // Calculate delta Phi for picked objects - AListManager.getInstance().deltaR(picked); - break; - - - } // switch - - } - else if(pickingMode == APickingGraphics2D.PICK_DETECTORS) - { - AListManager.getInstance().clearHighlight(); - } - } - - } // if(button == AInteractionsManager.LEFT) - - else if(button == AInteractionsManager.RIGHT) - { - Rectangle bounds = window.getBounds(); - bounds.setLocation(0, 0); - window.paintWindowFromScratch(new APickingGraphics2D(bounds, APickingGraphics2D.MOVE, - new Point((int) p.x, (int) p.y))); - } - - if(pickingMode != APickingGraphics2D.PICK_DETECTORS) - { - if(APickingGraphics2D.getPickedData() != null - || APickingGraphics2D.getPickedResidual() != null) - { - /* int numEvents = Atlantis.getEventManager().getNumberOfEvents(); - if(numEvents > 0) - { - AOutput.append("\n(" + ++numEvents + " events currently displayed)\n", ALogPane.PICK); - }*/ - - //TODO fix to avoid problems with nge - if(window==null) - return; - - pw = new Point(APickingGraphics2D.getPickedH(), APickingGraphics2D.getPickedV()); - if(pw.x != 0 && pw.y != 0) - try - { - ps = new Point(pw); - SwingUtilities.convertPointToScreen(ps, window); - new Robot().mouseMove(ps.x, ps.y); - } - catch(AWTException e) - {} - else - { - AOutput.alwaysAppend("\n\nYou must pick before you can move", ALogInterface.BAD_COMMAND); - } - } - else - { - if(!(window.getProjection() instanceof AProjectionTrackResidual)) - AOutput.alwaysAppend("\n\nNothing to pick", ALogInterface.BAD_COMMAND); - } - } - - } // pressed() ------------------------------------------------------------ - - - public void paint(Graphics2D g) - {} - - /** - * Gets called each time we enter a window in which this interaction is active - */ - public void entered() - { - //Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getPickCursor()); - } - - /** - * Gets called each time we leave a window in which this interaction is active - */ - public void exited() - { - //Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - - public AModifier[] getModifiers() - { - AModifier[] mods = new AModifier[] { - new AModifier(KeyEvent.VK_UNDEFINED, false, "Pick"), - new AModifier(KeyEvent.VK_UNDEFINED, true, "Move to last picked"), - new AModifier(KeyEvent.VK_A, false, "Add to the current (active) list"), - new AModifier(KeyEvent.VK_C, false, "Clear highlighted and calculation lists"), - new AModifier(KeyEvent.VK_D, false, "Plot ADC counts (digits) only"), - new AModifier(KeyEvent.VK_T, false, "Plot raw and cell time pulses (TILE only)"), - new AModifier(KeyEvent.VK_I, false, "Ignore (make invisible) picked hits/tracks"), - new AModifier(KeyEvent.VK_L, false, "Add to the V0 mass calculation list"), - new AModifier(KeyEvent.VK_M, false, "Add to the mass calculation list"), - new AModifier(KeyEvent.VK_P, false, "Calculate Delta R for 2 tracks"), - new AModifier(KeyEvent.VK_N, false, "Navigate (show data associations)"), - new AModifier(KeyEvent.VK_R, false, "Plot track residuals if available"), - new AModifier(KeyEvent.VK_S, false, "Select this muon Sector"), - new AModifier(KeyEvent.VK_V, false, "Set prim.vertex from picked rec/sim vertex"), - new AModifier(KeyEvent.VK_J, false, "Jet view (OpenGL only)") - }; - - return mods; - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/APopupListener.java b/graphics/AtlantisJava/src/atlantis/interactions/APopupListener.java deleted file mode 100755 index f7b462043d6c6ac7513ad0d892a4c310339b8763..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/APopupListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package atlantis.interactions; - - -import java.awt.Point; - - -/** - * The interactions implement this listener to get popup trigger events. - */ -public interface APopupListener { - int REGION_POPUP=0; - int WINDOW_POPUP=1; - - int getPopupType(); - void showPopup(Point p, int region); -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ARectangleSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/ARectangleSelection.java deleted file mode 100755 index 818dd6120b24859afc674cc9d3bd241c43d12b8c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ARectangleSelection.java +++ /dev/null @@ -1,95 +0,0 @@ -package atlantis.interactions; - -import java.awt.Graphics2D; -import java.awt.geom.Point2D; - -import atlantis.graphics.ACursorFactory; -import atlantis.graphics.AGraphics; - -public class ARectangleSelection extends ASelection implements AEnterExitListener -{ - public ARectangleSelection() - { - super(4); - } - - public int init(Point2D.Double p, int key) - { - isValid = false; - - for (int i = 0; i < 4; i++) - setCenter(hr[i], p.x, p.y); - - this.region = 2; - return region; - } - - public void drag(Point2D.Double p, int region, int key) - { - isValid = true; - - // Update the active control point. - setCenter(hr[region], p.x, p.y); - - // Get the opposite control point. - int oppCtrlPt = (region + 2) % 4; - double xOpp = hr[oppCtrlPt].getCenterX(); - double yOpp = hr[oppCtrlPt].getCenterY(); - - // Now choose the next control point so that we maintain a - // clockwise order to the points. - int otherCtrlPt = ((p.x < xOpp && p.y > yOpp) || (p.x > xOpp && p.y < yOpp)) ? 1 : 3; - - otherCtrlPt = (region + otherCtrlPt) % 4; - - // Set the other two control points. - setCenter(hr[otherCtrlPt], p.x, yOpp); - otherCtrlPt = (otherCtrlPt + 2) % 4; - setCenter(hr[otherCtrlPt], xOpp, p.y); - } - - public void paint(Graphics2D g) - { - if (!isValid) - return; - - AGraphics ag = AGraphics.makeAGraphics(g); - - ag.updateDrawParameters(frameDrawParameters); - ag.drawPolygon(getAPolygon()); - ag.updateDrawParameters(drawParameters); - ag.drawPolygon(getAPolygon()); - drawActivePoint(region, ag); - } - - public Point2D.Double[] getCorners() - { - int first = getUpperLeftRegion(); - - // Calculate the adjacent partner and the opposite corner. - int second = (first + 1) % 4; - int third = (first + 2) % 4; - - return convert(first, second, third); - } - - /** - * Get called each time we enter a window in which this interaction is - * active - */ - public void entered() - { - // Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getRectSelectCursor()); - } - - /** - * Get called each time we leave a window in which this interaction is active - */ - public void exited() - { - //Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ARectangleVPSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/ARectangleVPSelection.java deleted file mode 100755 index 8d26e25ff33e56df75682fe300bc422a71ae65da..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ARectangleVPSelection.java +++ /dev/null @@ -1,524 +0,0 @@ -package atlantis.interactions; - -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.geom.Point2D; -import javax.swing.JMenuItem; -import java.util.List; -import java.util.ArrayList; - -import atlantis.event.AData; -import atlantis.event.AEventManager; -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.data.ACalorimeterData; -import atlantis.event.AEvent; -import atlantis.graphics.dnd.ADnDLabel; -import atlantis.graphics.dnd.ADragListener; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionXZ; -import atlantis.projection.AProjectionYX; -import atlantis.projection.AProjectionYZ; -import atlantis.utils.AMath; -import atlantis.utils.A3Vector; - -public class ARectangleVPSelection extends ARectangleSelection - implements ActionListener, ADragListener -{ - - public final static String RUBBERBAND_WHOLE_WINDOW = "Rubberband Whole Window"; - public final static String ZOOM_LAR = "Zoom LAr"; - public final static String ZOOM_CALORIMETERS = "Zoom Calorimeters"; - public final static String CUT_ETAPHI = "Cut ( " + AMath.ETA + AMath.PHI + " cut )"; - public final static String PRINT_CONTENTS = "Print Contents"; - public final static String SHOW_IN_3DBOX = "Show in 3DBox"; - public final static String TURN_OFF_ETAPHI_CUT = "Turn off " + CUT_ETAPHI; - - private static AEventManager eventManager = AEventManager.instance(); - - public ARectangleVPSelection() - { - super(); - - addActionButton(ZOOM_LAR, this, this); - addActionButton(ZOOM_CALORIMETERS, this, this); - addActionButton(CUT_ETAPHI, this, this); - addActionButton(RUBBERBAND_WHOLE_WINDOW, this, this); - addActionButton(PRINT_CONTENTS, this, this); - addActionButton(SHOW_IN_3DBOX, this, this); - - } - - - - @Override - public JMenuItem[] getPopupItems() - { - ArrayList al = new ArrayList(); - if (window.getUnzoomPossible()) - { - JMenuItem item = new JMenuItem("Unzoom"); - al.add(item); - item.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.unzoom(); - } - }); - } - if(window.getUnzoomAllPossible(ZOOM_LAR)) - { - JMenuItem item = new JMenuItem("Unzoom LAr"); - al.add(item); - item.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) { - window.unzoom(ARectangleVPSelection.ZOOM_LAR); - } - }); - } - if(window.getUnzoomAllPossible(ZOOM_CALORIMETERS)) - { - JMenuItem item = new JMenuItem("Unzoom Calorimeters"); - al.add(item); - item.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) { - window.unzoom(ZOOM_CALORIMETERS); - } - }); - } - if (window.getUnzoomFullPossible()) - { - JMenuItem item = new JMenuItem("Unzoom Full"); - al.add(item); - item.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.unzoomFull(); - } - }); - } - - JMenuItem rww = new JMenuItem(RUBBERBAND_WHOLE_WINDOW); - rww.addActionListener(this); - - JMenuItem toec = new JMenuItem(TURN_OFF_ETAPHI_CUT); - toec.addActionListener(this); - - al.add(rww); - al.add(toec); - - // Can't cast arrays very easily... - JMenuItem[] ret = new JMenuItem[al.size()]; - for (int i = 0; i < al.size(); i++) { - ret[i] = (JMenuItem)al.get(i); - } - - return ret; - } - - - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - - if(ZOOM_LAR.equals(action)) - { - performZoom(ZOOM_LAR); - } - else if(ZOOM_CALORIMETERS.equals(action)) - { - performZoom(ZOOM_CALORIMETERS); - } - else if(CUT_ETAPHI.equals(action)) - { - applyCutIn(window.getName()); - } - else if(RUBBERBAND_WHOLE_WINDOW.equals(action)) - { - rubberbandWholeWindow(); - } - else if(PRINT_CONTENTS.equals(action)) - { - performOperationWithCuts(PRINT_CONTENTS); - } - else if(SHOW_IN_3DBOX.equals(action)) - { - tracksTo3DBox(); - } - else if(TURN_OFF_ETAPHI_CUT.equals(action)) - { - turnOffEtaPhiCuts(); - } - - } - - - private void turnOffEtaPhiCuts() - { - parameterStore.get("CutsATLAS", "CutPhi").setStatus(false); - parameterStore.get("CutsATLAS", "CutEta").setStatus(false); - String warning = "\n\nCuts -> ATLAS -> Cut " + AMath.ETA + " deactivated" + - "\nCuts -> ATLAS -> Cut " + AMath.PHI + " deactivated\n\n"; - AOutput.append(warning, ALogInterface.WARNING); - ACanvas.getCanvas().repaintAllFromScratch(); - - } - - - - private void tracksTo3DBox() { - Point2D.Double[] corners = getCorners(); - double eta = (corners[2].x + corners[0].x) / 2.; - double phi = Math.toRadians((corners[2].y + corners[0].y) / 2.); - - A3Vector ray = A3Vector.fromEtaPhiR(eta, phi, 1.0); - - // Need to make sure we change existing 3DBoxes - parameterStore.get("3D", "xAxis").changeScope(AParameter.GLOBAL); - parameterStore.get("3D", "yAxis").changeScope(AParameter.GLOBAL); - parameterStore.get("3D", "zAxis").changeScope(AParameter.GLOBAL); - parameterStore.get("3D", "xAxis").setD(ray.x); - parameterStore.get("3D", "yAxis").setD(ray.y); - parameterStore.get("3D", "zAxis").setD(ray.z); - - // 3DBoxes can be anywhere on the screen: - ACanvas.getCanvas().repaintAllFromScratch(); - } - - - public void dragPerformed(Object from, Object to, int action) - { - if (to instanceof ADnDLabel) - { - applyCutIn(((ADnDLabel) to).getText()); - } - else if (to instanceof AWindow) - { - applyCutIn(((AWindow) to).getName()); - } - } - - - - private boolean checkEtaPhiCutValues(double eta, double phi, - double cutPhi, double cutEta) - { - if (!(parameterStore.get("CutsATLAS", "PhiMiddle").validateValue(phi) && - parameterStore.get("CutsATLAS", "EtaMiddle").validateValue(eta) && - parameterStore.get("CutsATLAS", "CutPhi").validateValue(cutPhi) && - parameterStore.get("CutsATLAS", "CutEta").validateValue(cutEta))) - { - String etaphi = AMath.ETA + AMath.PHI; - AOutput.append("\nOperation cancelled: " + etaphi + - " cut values outside allowed range\n", ALogInterface.WARNING); - return false; - - } - else - { - return true; - } - - } - - - - public void applyCutIn(String zoomWindowName) - { - Point2D.Double[] corners = getCorners(); - double eta = (corners[2].x + corners[0].x) / 2.; - double cutEta = Math.abs((corners[2].x - corners[0].x)) / 2.; - double phi = (corners[2].y + corners[0].y) / 2.; - double cutPhi = Math.abs((corners[2].y - corners[0].y)) / 2.; - double rhoVPlot = AProjectionVP.getRhoZoomVPlot(); - double zVPlot = AProjectionVP.getZZoomVPlot(); - double zVtx = parameterStore.get("Event", "ZVtx").getD(); - double zLower = Math.max(Math.min(rhoVPlot * AMath.tanLambda(eta - cutEta) + zVtx, 0.), -zVPlot); - double zUpper = Math.min(Math.max(rhoVPlot * AMath.tanLambda(eta + cutEta) + zVtx, 0.), zVPlot); - - if(! checkEtaPhiCutValues(eta, phi, cutPhi, cutEta)) - { - return; - } - - String currentWindowName = window.getName(); - - parameterStore.selectWindowParameters(zoomWindowName); - parameterStore.get("CutsATLAS", "PhiMiddle").setD(phi); - parameterStore.get("CutsATLAS", "EtaMiddle").setD(eta); - parameterStore.get("CutsATLAS", "CutPhi").setD(cutPhi); - parameterStore.get("CutsATLAS", "CutPhi").setStatus(true); - parameterStore.get("CutsATLAS", "CutEta").setD(cutEta); - parameterStore.get("CutsATLAS", "CutEta").setStatus(true); - - String warning = "\n\nCuts -> ATLAS -> Cut " + AMath.ETA + " now active" + - "\nCuts -> ATLAS -> Cut " + AMath.PHI + " now active\n\n"; - AOutput.append(warning, ALogInterface.WARNING); - - AWindow zoomWindow = ACanvas.getCanvas().getWindow(zoomWindowName); - AProjection zoomProjection = zoomWindow.getProjection(); - - if (zoomProjection instanceof AProjectionFR) - { - zoomWindow.setUserCorners(0., rhoVPlot, phi - cutPhi, phi + cutPhi); - } - else if (zoomProjection instanceof AProjectionFZ) - { - zoomWindow.setUserCorners(zLower, zUpper, phi - cutPhi, phi + cutPhi); - } - else if (zoomProjection instanceof AProjectionVP) - { - if (!zoomWindowName.equals(currentWindowName)) - zoomWindow.setUserCorners(eta - cutEta, eta + cutEta, phi - cutPhi, phi + cutPhi); - } - else if (zoomProjection instanceof AProjectionYX) - { - zoomWindow.setUserCorners(-rhoVPlot, rhoVPlot, -rhoVPlot, rhoVPlot); - } - else if (zoomProjection instanceof AProjectionXZ) - { - double rhoZoom = Math.min(rhoVPlot, 110.); - - zoomWindow.setUserCorners(zLower, zUpper, 0., rhoZoom); - parameterStore.get("XZ", "Phi").setD(AMath.nearestPhiDegrees(phi)); - } - else if (zoomProjection instanceof AProjectionYZ) - { - double rhoZoom = Math.min(rhoVPlot, 110.); - - zoomWindow.setUserCorners(zLower, zUpper, -rhoZoom, rhoZoom); - parameterStore.get("YZ", "Phi").setD(AMath.nearestPhiDegrees(phi)); - } - else if (zoomProjection instanceof AProjectionRZ) - { - zoomWindow.setUserCorners(zLower, zUpper, 0., rhoVPlot); - parameterStore.get("RZ", "Phi").setD(AMath.nearestPhiDegrees(phi)); - } - parameterStore.restoreWindowParameters(); - - // don't repaint just the current window after cut(s) are applied, - // but repaint everything (all windows) - // zoomWindow.repaintFromScratch(); - ACanvas.getCanvas().repaintAllFromScratch(); - - } - - public void performZoom(String typeOfZoom) - { - int numberOfWindows=0; - - if(ZOOM_LAR.equals(typeOfZoom)) - { - numberOfWindows = 4; - } - else if(ZOOM_CALORIMETERS.equals(typeOfZoom)) - { - numberOfWindows = 8; - } - - AWindow currentWindow = window; - String name = currentWindow.getName(); - currentWindow.saveLayout(); - boolean scaleStatus = currentWindow.getScaleStatus(); - Point2D.Double[] zoomedCorners = getCorners(); - layoutChange(typeOfZoom); - int nameIndex=-1; - for (int i = 0; i < numberOfWindows; i++) - { - String wName = Integer.toString(i + 1); - AWindow w = ACanvas.getCanvas().getWindow(wName); - //dont zoom current window as will not save corners correctly - if (w != null && !name.equals(wName)) - { - w.saveParameters(typeOfZoom); - ACanvas.getCanvas().copyWindowSettings(currentWindow.getName(), wName); - w.saveCorners(typeOfZoom); - w.setUserCorners(zoomedCorners); - w.setScaleStatus(scaleStatus); - parameterStore.selectWindowParameters(wName); - parameterStore.get("VP", "Mode").setI(AProjectionVP.MODE_ECAL_LAYER_0 + i); - parameterStore.restoreWindowParameters(); - ACanvas.getCanvas().moveToFrontWindow(w.getName()); - w.repaintFromScratch(); - } - else if(name.equals(wName)) - { - nameIndex=i; - } - } - //now do zoom of current window if needed - if(nameIndex>0) - { - currentWindow.saveParameters(typeOfZoom); - currentWindow.saveCorners(typeOfZoom); - currentWindow.setUserCorners(zoomedCorners); - currentWindow.setScaleStatus(scaleStatus); - parameterStore.selectWindowParameters(name); - parameterStore.get("VP", "Mode").setI(AProjectionVP.MODE_ECAL_LAYER_0 + nameIndex); - parameterStore.restoreWindowParameters(); - ACanvas.getCanvas().moveToFrontWindow(name); - currentWindow.repaintFromScratch(); - } - for (int i = 0; i < numberOfWindows; i++) - if (name.equals(Integer.toString(i + 1))) - invalidate(); - } - - public void layoutChange(String typeOfZoom) - { - // change layout - if(!ACanvas.getCanvas().getCurrentLayout().getName().equals("SQUARE")) - { - ACanvas.getCanvas().setCurrentLayout("SQUARE"); - } - - // print info message - AOutput.append("\nWindows changed to: \n",ALogInterface.TITLE); - AOutput.append("Window 1: ECAL sampling 0\n",ALogInterface.NORMAL); - AOutput.append("Window 2: ECAL sampling 1\n",ALogInterface.NORMAL); - AOutput.append("Window 3: ECAL sampling 2\n",ALogInterface.NORMAL); - AOutput.append("Window 4: ECAL sampling 3\n",ALogInterface.NORMAL); - - if(ZOOM_CALORIMETERS.equals(typeOfZoom)) - { - AOutput.append("Window 5: HCAL sampling 0\n",ALogInterface.NORMAL); - AOutput.append("Window 6: HCAL sampling 1\n",ALogInterface.NORMAL); - AOutput.append("Window 7: HCAL sampling 2\n",ALogInterface.NORMAL); - AOutput.append("Window 8: HCAL sampling 3\n",ALogInterface.NORMAL); - } - } - - - private void printContents() - { - // get all data within selection (eta/phi cut already applied) - AEvent event = eventManager.getCurrentEvent(); - StringBuffer output = new StringBuffer("Data inside Rubberband selection:"); - // hits and tracks first - List hitsAndTracks = event.getHitsAndTracks(window.getProjection()); - for(int i = 0; i < hitsAndTracks.size(); i++) - { - String info = ((AData) hitsAndTracks.get(i)).getVPHitInfo(); - if(! "".equals(info)) - { - output.append("\n" + info); - } - } - - // calorimeters (as they are handled differently) - List cal = event.getCalorimeters(); - for (int i = 0; i < cal.size(); i++) - { - ACalorimeterData calorimeter = (ACalorimeterData) cal.get(i); - calorimeter.makeDrawList(); - String info = calorimeter.getVPHitInfo(); - if(! "".equals(info)) - { - output.append("\n" + info); - } - } - - AOutput.alwaysAppend("\n" + output + "\n", ALogInterface.PICK); - - } - - - - /** - * Apply eta phi cuts based on the selected (rubberband region), then - * perform the desired operation with data in the selection and - * restore previous cuts settings. - */ - private void performOperationWithCuts(String operation) - { - // which corners fall into eta/phi rubberband selection - Point2D.Double[] corners = getCorners(); - double eta = (corners[2].x + corners[0].x) / 2.; - double cutEta = Math.abs((corners[2].x - corners[0].x)) / 2.; - double phi = (corners[2].y + corners[0].y) / 2.; - double cutPhi = Math.abs((corners[2].y - corners[0].y)) / 2.; - - if(! checkEtaPhiCutValues(eta, phi, cutPhi, cutEta)) - { - return; - } - - // need to temporarily apply eta/phi cut, but get the current - // eta/phi cut values first and save them - AParameter phiPar = parameterStore.get("CutsATLAS", "PhiMiddle"); - AParameter cutPhiPar = parameterStore.get("CutsATLAS", "CutPhi"); - AParameter etaPar = parameterStore.get("CutsATLAS", "EtaMiddle"); - AParameter cutEtaPar = parameterStore.get("CutsATLAS", "CutEta"); - double oldEta = etaPar.getD(); - double oldCutEta = cutEtaPar.getD(); - boolean oldCutEtaStatus = cutEtaPar.getStatus(); - double oldPhi = phiPar.getD(); - double oldCutPhi = cutPhiPar.getD(); - boolean oldCutPhiStatus = cutPhiPar.getStatus(); - - // set new (temporary) values of eta/phi cuts according to selection - phiPar.setD(phi); - etaPar.setD(eta); - cutPhiPar.setD(cutPhi); - cutPhiPar.setStatus(true); - cutEtaPar.setD(cutEta); - cutEtaPar.setStatus(true); - - if(PRINT_CONTENTS.equals(operation)) - { - printContents(); - } - - // set back the previous eta/phi cut values - phiPar.setD(oldPhi); - etaPar.setD(oldEta); - cutPhiPar.setD(oldCutPhi); - cutPhiPar.setStatus(oldCutPhiStatus); - cutEtaPar.setD(oldCutEta); - cutEtaPar.setStatus(oldCutEtaStatus); - - } // printContents() ---------------------------------------------------- - - - - public void rubberbandWholeWindow() - { - Rectangle curr = window.getCurrDisp(); - - double x = curr.getX(); - double y = curr.getY(); - double w = curr.getWidth(); - double h = curr.getHeight(); - - setCenter(hr[0], x, y); - setCenter(hr[1], x + w, y); - setCenter(hr[2], x + w, y + h); - setCenter(hr[3], x, y + h); - isValid = true; - region = 1; - stop(); - window.repaint(); - oldAffectedRegion = curr; - int safetySize = 5; - - oldAffectedRegion.x -= safetySize; - oldAffectedRegion.y -= safetySize; - oldAffectedRegion.width += 2 * safetySize; - oldAffectedRegion.height += 2 * safetySize; - - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ARectangleYXSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/ARectangleYXSelection.java deleted file mode 100755 index 0a01c70592c826ec2b7719a06fec81c9736c460f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ARectangleYXSelection.java +++ /dev/null @@ -1,320 +0,0 @@ -package atlantis.interactions; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.geom.Point2D; -import java.util.ArrayList; - -import javax.swing.JMenuItem; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.graphics.dnd.ADragListener; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection; -import atlantis.projection.AProjectionYX; -import atlantis.projection.AProjectionsManager; - -/** - * Contains the function for selecting zoom endcap layers and summed endcaps - * - * @author Mark Stockton - */ -public class ARectangleYXSelection extends ARectangleSelection implements ActionListener, ADragListener -{ - public final static String ZOOM_SUMMED = "summed"; - public final static String ZOOM_LAYERS = "layers"; - - public ARectangleYXSelection() - { - super(); - addActionButton("Zoom Summed Endcaps", new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals("Zoom Summed Endcaps")) - performZoom(ZOOM_SUMMED); - } - }); - addActionButton("Zoom Endcap Layers -", new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals("Zoom Endcap Layers -")) - zoomLayersMinus(); - } - }); - addActionButton("Zoom Endcap Layers +", new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals("Zoom Endcap Layers +")) - zoomLayersPlus(); - } - }); - addActionButton("Zoom Both Endcap Layers", new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals("Zoom Both Endcap Layers")) - zoomLayersCombined(); - } - }); - } - - public void zoomLayersMinus() - { - parameterStore.get("CutsCalo", "FCAL").setI(0); - parameterStore.get("CutsCalo", "LAr").setI(0); - parameterStore.get("CutsCalo", "HEC").setI(-2); - performZoom(ZOOM_LAYERS); - } - - public void zoomLayersPlus() - { - parameterStore.get("CutsCalo", "FCAL").setI(1); - parameterStore.get("CutsCalo", "LAr").setI(1); - parameterStore.get("CutsCalo", "HEC").setI(2); - performZoom(ZOOM_LAYERS); - } - - public void zoomLayersCombined() - { - parameterStore.get("CutsCalo", "FCAL").setI(-1); - parameterStore.get("CutsCalo", "LAr").setI(-1); - parameterStore.get("CutsCalo", "HEC").setI(-1); - performZoom(ZOOM_LAYERS); - } - - public void performZoom(String typeOfZoom) - { - int numberOfWindows=0; - if(typeOfZoom.equals(ZOOM_SUMMED)) - numberOfWindows=4; - else if(typeOfZoom.equals(ZOOM_LAYERS)) - numberOfWindows=8; - - AWindow currentWindow = window; - String name = currentWindow.getName(); - currentWindow.saveLayout(); - boolean scaleStatus = currentWindow.getScaleStatus(); - Point2D.Double[] zoomedCorners = getCorners(); - //change layout and print info message - layoutChange(typeOfZoom); - int nameIndex=-1; - for (int i = numberOfWindows; i >=1; i--) - { - String wName = Integer.toString(i); - AWindow w = ACanvas.getCanvas().getWindow(wName); - //dont zoom current window as will not save corners correctly - if (w != null && !name.equals(wName)) - { - w.saveParameters(typeOfZoom); - ACanvas.getCanvas().copyWindowSettings(currentWindow.getName(), wName); - w.saveCorners(typeOfZoom); - w.setUserCorners(zoomedCorners); - w.setScaleStatus(scaleStatus); - parameterStore.selectWindowParameters(wName); - - if(typeOfZoom.equals(ZOOM_SUMMED)) - zoomSummedOptions(i-1); - else if(typeOfZoom.equals(ZOOM_LAYERS)) - parameterStore.get("YX", "Mode").setI(AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER + i -1); - - parameterStore.restoreWindowParameters(); - ACanvas.getCanvas().moveToFrontWindow(w.getName()); - w.repaintFromScratch(); - } - else if(name.equals(wName)) - { - nameIndex=i; - } - } - //now do zoom of current window if needed - if(nameIndex>0) - { - currentWindow.saveParameters(typeOfZoom); - currentWindow.saveCorners(typeOfZoom); - currentWindow.setUserCorners(zoomedCorners); - currentWindow.setScaleStatus(scaleStatus); - parameterStore.selectWindowParameters(name); - if(typeOfZoom.equals(ZOOM_SUMMED)) - zoomSummedOptions(nameIndex-1); - else if(typeOfZoom.equals(ZOOM_LAYERS)) - parameterStore.get("YX", "Mode").setI(AProjectionYX.MODE_LAR_ENDCAP_PRESAMPLER + nameIndex -1); - parameterStore.restoreWindowParameters(); - ACanvas.getCanvas().moveToFrontWindow(name); - currentWindow.repaintFromScratch(); - } - for (int i = 1; i <= numberOfWindows; i++) - if (name.equals(Integer.toString(i))) - invalidate(); - //if doing layers zoom last window shows rhoZ view - if(typeOfZoom.equals(ZOOM_LAYERS)) - zoomLastWindow(scaleStatus, name); - } - - public void layoutChange(String typeOfZoom) - { - if(typeOfZoom.equals(ZOOM_SUMMED)) - { - //change layout - if(!ACanvas.getCanvas().getCurrentLayout().getName().equals("FOUR SQUARES")) - ACanvas.getCanvas().setCurrentLayout("FOUR SQUARES"); - //print info message - AOutput.append("\nWindows changed to:\n",ALogInterface.TITLE); - AOutput.append("Window 1: LAr Endcap -\n",ALogInterface.NORMAL); - AOutput.append("Window 2: LAr Endcap +\n",ALogInterface.NORMAL); - AOutput.append("Window 3: HEC -\n",ALogInterface.NORMAL); - AOutput.append("Window 4: HEC +\n",ALogInterface.NORMAL); - } - else if(typeOfZoom.equals(ZOOM_LAYERS)) - { - //change layout - if(!ACanvas.getCanvas().getCurrentLayout().getName().equals("SQUARE")) - ACanvas.getCanvas().setCurrentLayout("SQUARE"); - //print info message - AOutput.append("\nWindows changed to:\n",ALogInterface.TITLE); - AOutput.append("Window 1: LAr Endcap Presampler\n",ALogInterface.NORMAL); - AOutput.append("Window 2: LAr Endcap 1\n",ALogInterface.NORMAL); - AOutput.append("Window 3: LAr Endcap 2\n",ALogInterface.NORMAL); - AOutput.append("Window 4: LAr Endcap 3\n",ALogInterface.NORMAL); - AOutput.append("Window 5: HEC 1\n",ALogInterface.NORMAL); - AOutput.append("Window 6: HEC 2\n",ALogInterface.NORMAL); - AOutput.append("Window 7: HEC 3\n",ALogInterface.NORMAL); - AOutput.append("Window 8: HEC 4\n",ALogInterface.NORMAL); - AOutput.append("Window 9: rhoZ view showing both endcaps\n",ALogInterface.NORMAL); - } - } - - public void zoomSummedOptions(int i) - { - parameterStore.get("CutsCalo", "LAr").changeScope(AParameter.LOCAL); - parameterStore.get("CutsCalo", "HEC").changeScope(AParameter.LOCAL); - switch (i) - { - case 0: - parameterStore.get("CutsCalo", "LAr").setI(0); - parameterStore.get("CutsCalo", "HEC").setI(-1); - break; - case 1: - parameterStore.get("CutsCalo", "LAr").setI(1); - parameterStore.get("CutsCalo", "HEC").setI(-1); - break; - case 2: - parameterStore.get("CutsCalo", "LAr").setI(-1); - parameterStore.get("CutsCalo", "HEC").setI(-2); - break; - case 3: - parameterStore.get("CutsCalo", "LAr").setI(-1); - parameterStore.get("CutsCalo", "HEC").setI(2); - break; - } - parameterStore.get("YX", "Mode").setI(AProjectionYX.MODE_LAR_ENDCAP_SUMMED + (int) Math.floor(i/2)); - } - - public void zoomLastWindow(boolean scaleStatus, String name) - { - String wName = Integer.toString(9); - AWindow w = ACanvas.getCanvas().getWindow(wName); - //want last window to be RZ view but won't change its zoom - AProjection p = AProjectionsManager.getProjection("RZ"); - w.setProjection(p); - Point2D.Double[] newCorners = new Point2D.Double[3]; - //FIXME hardcoded geometry of endcaps - //set region to be round the endcaps - newCorners[0]=new Point2D.Double(-650.0, 225); - newCorners[1]=new Point2D.Double(650.0, 225); - newCorners[2]=new Point2D.Double(650.0, -225); - - w.setUserCorners(newCorners); - w.setScaleStatus(scaleStatus); - parameterStore.selectWindowParameters(wName); - parameterStore.restoreWindowParameters(); - ACanvas.getCanvas().moveToFrontWindow(w.getName()); - w.repaintFromScratch(); - if (name.equals(wName)) - invalidate(); - } - - public void dragPerformed(Object from, Object to, int action) - {} - - public JMenuItem[] getPopupItems() { - ArrayList al = new ArrayList(); - if(window.getUnzoomPossible()) - { - JMenuItem it = new JMenuItem("Unzoom"); - it.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.unzoom(); - } - }); - al.add(it); - } - if(window.getUnzoomAllPossible(ZOOM_LAYERS)) - { - JMenuItem it = new JMenuItem("Unzoom layers"); - it.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.unzoom(ZOOM_LAYERS); - } - }); - al.add(it); - } - if(window.getUnzoomAllPossible(ZOOM_SUMMED)) - { - JMenuItem it = new JMenuItem("Unzoom summed"); - it.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.unzoom(ZOOM_SUMMED); - } - }); - al.add(it); - } - if (window.getUnzoomFullPossible()) - { - JMenuItem it = new JMenuItem("Unzoom Full"); - it.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.unzoomFull(); - } - }); - al.add(it); - } - // Can't cast arrays very easily... - JMenuItem[] ret = new JMenuItem[al.size()]; - for(int i = 0; i < al.size(); i++) - { - ret[i] = (JMenuItem) (al.get(i)); - } - return ret; - } - - public void actionPerformed(ActionEvent e) { - String action=e.getActionCommand(); - if(action.equals("Unzoom")) { - window.unzoom(); - } - if(action.equals("Unzoom layers")) { - window.unzoom(ZOOM_LAYERS); - } - if(action.equals("Unzoom summed")) { - window.unzoom(ZOOM_SUMMED); - } - if(action.equals("Unzoom Full")) { - window.unzoomFull(); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ARotatedRectangleSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/ARotatedRectangleSelection.java deleted file mode 100755 index 3cf0fd33bbe0ac326531ca8c3a1d45df779a5836..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ARotatedRectangleSelection.java +++ /dev/null @@ -1,211 +0,0 @@ -package atlantis.interactions; - - -import java.awt.*; -import java.awt.geom.*; - - -public class ARotatedRectangleSelection extends ASelection { - - // The initial starting width of the first and last sides. - private final static int STARTING_WIDTH=25; - - public ARotatedRectangleSelection() { - super(6); - } - - // Initialize the control points given the starting point (x,y). - public int init(Point2D.Double p, int key) { - isValid=false; - - setCenter(hr[0], p.x-STARTING_WIDTH, p.y); - setCenter(hr[1], p.x-STARTING_WIDTH, p.y); - setCenter(hr[2], p.x+STARTING_WIDTH, p.y); - setCenter(hr[3], p.x+STARTING_WIDTH, p.y); - setCenter(hr[4], p.x, p.y); - setCenter(hr[5], p.x, p.y); - - region=5; - return region; - } - - public void drag(Point2D.Double p, int region, int key) { - isValid=true; - double dx, dy, deltax, deltay, angle, radius; - - switch(region) { - case 0: - radius=getRadius(p.x, p.y, 4); - angle=getAngle(); - - deltax=p.x-hr[4].getCenterX(); - deltay=p.y-hr[4].getCenterY(); - - dx=-Math.round(radius*Math.sin(angle)); - dy=Math.round(radius*Math.cos(angle)); - - if(deltax*dx+deltay*dy<0) { - dx=-dx; - dy=-dy; - } - - setCenter(hr[0], hr[4].getCenterX()+dx, hr[4].getCenterY()+dy); - setCenter(hr[3], hr[4].getCenterX()-dx, hr[4].getCenterY()-dy); - setCenter(hr[1], hr[5].getCenterX()+dx, hr[5].getCenterY()+dy); - setCenter(hr[2], hr[5].getCenterX()-dx, hr[5].getCenterY()-dy); - break; - - case 1: - radius=getRadius(p.x, p.y, 5); - angle=getAngle(); - - deltax=p.x-hr[5].getCenterX(); - deltay=p.y-hr[5].getCenterY(); - - dx=-Math.round(radius*Math.sin(angle)); - dy=Math.round(radius*Math.cos(angle)); - - if(deltax*dx+deltay*dy<0) { - dx=-dx; - dy=-dy; - } - - setCenter(hr[0], hr[4].getCenterX()+dx, hr[4].getCenterY()+dy); - setCenter(hr[3], hr[4].getCenterX()-dx, hr[4].getCenterY()-dy); - setCenter(hr[1], hr[5].getCenterX()+dx, hr[5].getCenterY()+dy); - setCenter(hr[2], hr[5].getCenterX()-dx, hr[5].getCenterY()-dy); - break; - - case 2: - radius=getRadius(p.x, p.y, 5); - angle=getAngle(); - - deltax=p.x-hr[5].getCenterX(); - deltay=p.y-hr[5].getCenterX(); - - dx=-Math.round(radius*Math.sin(angle)); - dy=Math.round(radius*Math.cos(angle)); - - if(deltax*dx+deltay*dy<0) { - dx=-dx; - dy=-dy; - } - - setCenter(hr[0], hr[4].getCenterX()-dx, hr[4].getCenterY()-dy); - setCenter(hr[3], hr[4].getCenterX()+dx, hr[4].getCenterY()+dy); - setCenter(hr[1], hr[5].getCenterX()-dx, hr[5].getCenterY()-dy); - setCenter(hr[2], hr[5].getCenterX()+dx, hr[5].getCenterY()+dy); - break; - - case 3: - radius=getRadius(p.x, p.y, 4); - angle=getAngle(); - - deltax=p.x-hr[4].getCenterX(); - deltay=p.y-hr[4].getCenterY(); - - dx=-Math.round(radius*Math.sin(angle)); - dy=Math.round(radius*Math.cos(angle)); - - if(deltax*dx+deltay*dy<0) { - dx=-dx; - dy=-dy; - } - - setCenter(hr[0], hr[4].getCenterX()-dx, hr[4].getCenterY()-dy); - setCenter(hr[3], hr[4].getCenterX()+dx, hr[4].getCenterY()+dy); - setCenter(hr[1], hr[5].getCenterX()-dx, hr[5].getCenterY()-dy); - setCenter(hr[2], hr[5].getCenterX()+dx, hr[5].getCenterY()+dy); - break; - - case 4: - case 5: - radius=getRadius(hr[0].getCenterX(), hr[0].getCenterY(), 4); - - // Update the active control point. - setCenter(hr[region], p.x, p.y); - angle=getAngle(); - - dx=-Math.round(radius*Math.sin(angle)); - dy=Math.round(radius*Math.cos(angle)); - - setCenter(hr[0], hr[4].getCenterX()+dx, hr[4].getCenterY()+dy); - setCenter(hr[3], hr[4].getCenterX()-dx, hr[4].getCenterY()-dy); - setCenter(hr[1], hr[5].getCenterX()+dx, hr[5].getCenterY()+dy); - setCenter(hr[2], hr[5].getCenterX()-dx, hr[5].getCenterY()-dy); - break; - } - } - - private double getAngle() { - double deltax=hr[5].getCenterX()-hr[4].getCenterX(); - double deltay=hr[5].getCenterY()-hr[4].getCenterY(); - - if(deltax!=0||deltay!=0) - return Math.atan2(deltay, deltax); - else - return 0.; - } - - public void paint(Graphics2D g) { - paintStandard(g); - } - - /** - * Make the affine transform which corresponds to this rectangular selection. - */ - public Point2D.Double[] getCorners() { - int first=getUpperLeftRegion(); - - // Calculate the index of the opposite corner. - int third=(first+2)%4; - - // Now use the cross-product to determine which of the - // remaining points is the one which keep the path going - // clockwise. - int second=(first+1)%4; - double dx0=hr[third].getCenterX()-hr[first].getCenterX(); - double dy0=hr[third].getCenterY()-hr[first].getCenterY(); - double dx1=hr[second].getCenterX()-hr[first].getCenterX(); - double dy1=hr[second].getCenterY()-hr[first].getCenterY(); - - if(dx0*dy1-dy0*dx1>0) - second=(first+3)%4; - // Get the appropriate radius. - int centerIndex=(first==0||first==3)?4:5; - double radius=getRadius(hr[first].getCenterX(), hr[first].getCenterY(), centerIndex); - double angle=getAngle(); - // Calculate the delta-x and delta-y for the points. - double dx=Math.abs(radius*Math.sin(angle)); - double dy=Math.abs(radius*Math.cos(angle)); - // Get the sign of the offsets from the control points. - double sdx; - double sdy; - - // The point closest to the origin. - centerIndex=(first==0||first==3)?4:5; - sdx=((hr[first].getCenterX()-hr[centerIndex].getCenterX())>0)?1.:-1.; - sdy=((hr[first].getCenterY()-hr[centerIndex].getCenterY())>0)?1.:-1.; - double x0=hr[centerIndex].getCenterX()+sdx*dx; - double y0=hr[centerIndex].getCenterY()+sdy*dy; - - // The next point clockwise. - centerIndex=(second==0||second==3)?4:5; - sdx=((hr[second].getCenterX()-hr[centerIndex].getCenterX())>0)?1.:-1.; - sdy=((hr[second].getCenterY()-hr[centerIndex].getCenterY())>0)?1.:-1.; - double x1=hr[centerIndex].getCenterX()+sdx*dx; - double y1=hr[centerIndex].getCenterY()+sdy*dy; - - // The next point clockwise. - centerIndex=(third==0||third==3)?4:5; - sdx=((hr[third].getCenterX()-hr[centerIndex].getCenterX())>0)?1.:-1.; - sdy=((hr[third].getCenterY()-hr[centerIndex].getCenterY())>0)?1.:-1.; - double x2=hr[centerIndex].getCenterX()+sdx*dx; - double y2=hr[centerIndex].getCenterY()+sdy*dy; - - // The control points are in the correct order, so we can just - // call the utility function of the parent. - return convert(x0, y0, x1, y1, x2, y2); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ARubberbandGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/ARubberbandGroup.java deleted file mode 100755 index fe8e54b62bde88af517ad5a65fcb96188a2d882f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ARubberbandGroup.java +++ /dev/null @@ -1,109 +0,0 @@ -package atlantis.interactions; - -import atlantis.canvas.ACanvas; -import atlantis.output.AExceptionHandler; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.JMenuItem; -import javax.swing.JMenu; -import javax.swing.JComboBox; -import javax.swing.JPanel; - -import java.lang.reflect.Constructor; -import java.util.HashMap; - -public class ARubberbandGroup extends AInteractionGroup { - - private final static String[] RUBBERBAND_NAMES= {"Rectangle", "RotatedRectangle", "Parallelogram", - "Square", "XSkew", "YSkew", "XSlice", "YSlice"}; - - private HashMap rubberbands; - private JComboBox rbComboBox; - // the panel that will contain the additional controls for the interactions - private JPanel additionalControls; - - public ARubberbandGroup(AInteractionsManager manager) { - super(AInteractionGroup.WINDOW_GROUP, manager); - - // create the additional controls panel - additionalControls = new JPanel(); - - rubberbands=new HashMap(); - rbComboBox=new JComboBox(); - - for(int i=0; i<RUBBERBAND_NAMES.length; i++) { - rbComboBox.addItem(RUBBERBAND_NAMES[i]); - try { - Constructor[] c=Class.forName("atlantis.interactions.A"+RUBBERBAND_NAMES[i]+"Selection").getDeclaredConstructors(); - - rubberbands.put(RUBBERBAND_NAMES[i], c[0].newInstance(new Object[] {})); - } catch(Exception e) { - AExceptionHandler.processException("Cannot make selection "+"A"+RUBBERBAND_NAMES[i] - +"Selection", - e); - } - } - - rbComboBox.addActionListener(new RuberbandListener()); - additionalControls.add(rbComboBox); - - changeRubberband(); - } - - /** - * rubberband has additional controls, so return true - */ - public boolean hasAdditionalControls() { - return true; - } - - /** - * returns the additional controls - */ - public JPanel getAdditionalControls() { - return additionalControls; - } - - private void changeRubberband() { - String item=(String)rbComboBox.getSelectedItem(); - - removeAllInteractions(); - addInteraction((AInteraction)rubberbands.get(item)); - iManager.setContext(this); - } - - // generating the menu - public JMenuItem getPopupItem() { - JMenu menu=new JMenu(name); - ActionListener l=new PopupListener(); - - for(int i=0; i<RUBBERBAND_NAMES.length; i++) - menu.add(RUBBERBAND_NAMES[i]).addActionListener(l); - - return menu; - } - - public void setGroupState(AInteractionGroup givenGroup) { - if(givenGroup instanceof ARubberbandGroup) { - ARubberbandGroup panel=(ARubberbandGroup)givenGroup; - - this.rbComboBox.setSelectedIndex(panel.rbComboBox.getSelectedIndex()); - } - } - - class RuberbandListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - changeRubberband(); - } - } - - - class PopupListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - ACanvas.getCanvas().getCurrentWindow().getInteractionToolBar().setSelectedGroup(name); - rbComboBox.setSelectedItem(e.getActionCommand()); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ARubberbandYXGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/ARubberbandYXGroup.java deleted file mode 100755 index 705da5e8e13760586ee380943ab41205f9e074b6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ARubberbandYXGroup.java +++ /dev/null @@ -1,109 +0,0 @@ -package atlantis.interactions; - -import atlantis.canvas.ACanvas; -import atlantis.output.AExceptionHandler; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.JMenuItem; -import javax.swing.JMenu; -import javax.swing.JComboBox; -import javax.swing.JPanel; - -import java.lang.reflect.Constructor; -import java.util.HashMap; - -public class ARubberbandYXGroup extends AInteractionGroup { - - private final static String[] RUBBERBAND_NAMES= {"RectangleYX", "RotatedRectangle", "Parallelogram", - "Square", "XSkew", "YSkew", "XSlice", "YSlice"}; - - private HashMap rubberbands; - private JComboBox rbComboBox; - // the panel that will contain the additional controls for the interactions - private JPanel additionalControls; - - public ARubberbandYXGroup(AInteractionsManager manager) { - super(AInteractionGroup.WINDOW_GROUP, manager); - - // create the additional controls panel - additionalControls = new JPanel(); - - rubberbands=new HashMap(); - rbComboBox=new JComboBox(); - - for(int i=0; i<RUBBERBAND_NAMES.length; i++) { - rbComboBox.addItem(RUBBERBAND_NAMES[i]); - try { - Constructor[] c=Class.forName("atlantis.interactions.A"+RUBBERBAND_NAMES[i]+"Selection").getDeclaredConstructors(); - - rubberbands.put(RUBBERBAND_NAMES[i], c[0].newInstance(new Object[] {})); - } catch(Exception e) { - AExceptionHandler.processException("Cannot make selection "+"A"+RUBBERBAND_NAMES[i] - +"Selection", - e); - } - } - - rbComboBox.addActionListener(new RuberbandListener()); - additionalControls.add(rbComboBox); - - changeRubberband(); - } - - /** - * rubberband has additional controls, so return true - */ - public boolean hasAdditionalControls() { - return true; - } - - /** - * returns the additional controls - */ - public JPanel getAdditionalControls() { - return additionalControls; - } - - private void changeRubberband() { - String item=(String)rbComboBox.getSelectedItem(); - - removeAllInteractions(); - addInteraction((AInteraction)rubberbands.get(item)); - iManager.setContext(this); - } - - // generating the menu - public JMenuItem getPopupItem() { - JMenu menu=new JMenu(name); - ActionListener l=new PopupListener(); - - for(int i=0; i<RUBBERBAND_NAMES.length; i++) - menu.add(RUBBERBAND_NAMES[i]).addActionListener(l); - - return menu; - } - - public void setGroupState(AInteractionGroup givenGroup) { - if(givenGroup instanceof ARubberbandYXGroup) { - ARubberbandYXGroup panel=(ARubberbandYXGroup)givenGroup; - - this.rbComboBox.setSelectedIndex(panel.rbComboBox.getSelectedIndex()); - } - } - - class RuberbandListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - changeRubberband(); - } - } - - - class PopupListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - ACanvas.getCanvas().getCurrentWindow().getInteractionToolBar().setSelectedGroup(name); - rbComboBox.setSelectedItem(e.getActionCommand()); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AScaleCopyGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/AScaleCopyGroup.java deleted file mode 100755 index 05a6d681437cc4f81ce3f5b448dab89475e1b886..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AScaleCopyGroup.java +++ /dev/null @@ -1,14 +0,0 @@ -package atlantis.interactions; - - -public class AScaleCopyGroup extends AInteractionGroup { - - AScaleCopyInteraction scaleCopyInteraction; - - public AScaleCopyGroup(AInteractionsManager iManager) { - super(AInteractionGroup.CANVAS_GROUP, iManager); - scaleCopyInteraction=new AScaleCopyInteraction(); - this.addInteraction(scaleCopyInteraction); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AScaleCopyInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/AScaleCopyInteraction.java deleted file mode 100755 index 6e4492014d799ac59faa5d2f2b710bad4642a35a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AScaleCopyInteraction.java +++ /dev/null @@ -1,24 +0,0 @@ -package atlantis.interactions; - -import java.awt.*; -import java.awt.geom.*; - -public class AScaleCopyInteraction extends AInteraction { - - public AScaleCopyInteraction() { - super(1, AUTOMATIC_REPAINT, SCREEN_COORDINATES, false); - hr[0]=new Rectangle2D.Double(0, 0, 0, 0); - } - - public void paint(Graphics2D g) {} - - public void connect(AInteractionsManager manager) { - super.connect(manager); - window.setScaleCopyStatus(true); - } - - public void disconnect() { - window.setScaleCopyStatus(false); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ASelection.java b/graphics/AtlantisJava/src/atlantis/interactions/ASelection.java deleted file mode 100755 index 1a7b181aea5cdda8591aa07058275b8995966e05..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ASelection.java +++ /dev/null @@ -1,455 +0,0 @@ -package atlantis.interactions; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; - -import java.awt.GridLayout; -import java.awt.Point; -import java.awt.Graphics2D; -import java.awt.Rectangle; -import java.awt.Dimension; -import java.awt.Polygon; -import java.awt.event.ActionListener; -import java.awt.event.ActionEvent; -import java.awt.geom.Point2D; -import java.awt.geom.Ellipse2D; - -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JMenuItem; -import javax.swing.JButton; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.graphics.ADrawnGraphics2D; -import atlantis.graphics.AGraphics; -import atlantis.graphics.ACoord; -import atlantis.graphics.dnd.ADnDButton; -import atlantis.graphics.dnd.ADnDLabel; -import atlantis.graphics.dnd.ADragListener; -import atlantis.gui.AGUI; -import atlantis.gui.ALogPane; -import atlantis.list.AListManager; -import atlantis.list.AList; -import atlantis.output.AExceptionHandler; -import atlantis.output.AOutput; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; - - - -/** - * The superclass of all the selection (rubberband) interactions. - */ -public abstract class ASelection extends AInteraction - implements ASleepMouseDragListener, ActionListener -{ - - private static ALogger logger = ALogger.getLogger(ASelection.class); - - private JPanel actionsPanel; - private GridLayout actionsPanelLayout; - private int d = 10; - private boolean[][] map; - protected final static int radius = 10; - protected int region; - protected boolean isValid = false; - - - public final static String ZOOM = "Zoom"; - public final static String NEW_LIST = "New List"; - public final static String SUMMARIZE = "Summarize"; - - - - public ASelection(int hotRegionsCount) - { - super(hotRegionsCount, AUTOMATIC_REPAINT, SCREEN_COORDINATES, true); - - for(int i = 0; i < hr.length; i++) - { - hr[i] = new Ellipse2D.Double(0, 0, radius, radius); - } - - actionsPanelLayout = new GridLayout(0, 1); - actionsPanel = new JPanel(actionsPanelLayout); - - - addActionButton(ZOOM, new ADragListener() - { - public void dragPerformed(Object from, Object to, int action) - { - if(to instanceof ADnDLabel) - { - zoomIn(((ADnDLabel) to).getText()); - } - else if(to instanceof AWindow) - { - zoomIn(((AWindow) to).getName()); - } - invalidate(); - } - }, - new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.saveCorners(); - window.setUserCorners(getCorners()); - invalidate(); - } - }); - - - addActionButton(NEW_LIST, new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - if(e.getActionCommand().equals(NEW_LIST)) - { - Point2D.Double[] zoomedCorners = getCorners(); - Point2D.Double[] userCorners = window.getUserCorners(); - window.setUserCornersNoRepaint(zoomedCorners); - Rectangle bounds = window.getBounds(); - bounds.setLocation(0, 0); - window.paintWindowFromScratch(new ADrawnGraphics2D(bounds)); - ADrawnGraphics2D.updateLastDrawn(); - AListManager.getInstance().copyLastDrawn(); - AListManager.getInstance().showLists(); - window.setUserCornersNoRepaint(userCorners); - } - } - }); - - - addActionButton(SUMMARIZE, new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - if(e.getActionCommand().equals(SUMMARIZE)) - { - Point2D.Double[] zoomedCorners = getCorners(); - Point2D.Double[] userCorners = window.getUserCorners(); - window.setUserCornersNoRepaint(zoomedCorners); - Rectangle bounds = window.getBounds(); - bounds.setLocation(0, 0); - window.paintWindowFromScratch(new ADrawnGraphics2D(bounds)); - ADrawnGraphics2D.updateLastDrawn(); - AListManager.getInstance().summarize(); - window.setUserCornersNoRepaint(userCorners); - } - } - }); - - } // ASelection() --------------------------------------------------------- - - - - - public void invalidate() - { - isValid = false; - actionsPanel.setVisible(false); - } - - - public void addActionButton(String buttonName, ADragListener dragList, - ActionListener clickList) - { - ADnDButton b = new ADnDButton(buttonName); - b.setFocusPainted(false); - b.addActionListener(clickList); - b.addDragListener(dragList); - actionsPanelLayout.setRows(actionsPanelLayout.getRows() + 1); - actionsPanel.add(b); - actionsPanel.setSize(actionsPanel.getPreferredSize()); - } - - - public void addActionButton(String buttonName, ActionListener clickListener) - { - JButton b = new JButton(buttonName); - b.setFocusPainted(false); - b.addActionListener(clickListener); - actionsPanelLayout.setRows(actionsPanelLayout.getRows() + 1); - actionsPanel.add(b); - actionsPanel.setSize(actionsPanel.getPreferredSize()); - } - - - public JMenuItem[] getPopupItems() - { - ArrayList<JMenuItem> al = new ArrayList<JMenuItem>(); - if(window.getUnzoomPossible()) - { - JMenuItem it = new JMenuItem("Unzoom"); - it.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.unzoom(); - } - }); - al.add(it); - } - if(window.getUnzoomFullPossible()) - { - JMenuItem it = new JMenuItem("Unzoom Full"); - it.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - window.unzoomFull(); - } - }); - al.add(it); - } - // Can't cast arrays very easily... - JMenuItem[] ret = new JMenuItem[al.size()]; - for(int i = 0; i < al.size(); i++) - { - ret[i] = al.get(i); - } - return ret; - - } - - - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - if(action.equals("Unzoom")) - { - window.unzoom(); - } - } - - - public int getPopupType() - { - return APopupListener.WINDOW_POPUP; - } - - - public void connect(AInteractionsManager manager) - { - super.connect(manager); - window.getView().add(actionsPanel); - if(isValid) - { - actionsPanel.setVisible(true); - } - else - { - actionsPanel.setVisible(false); - } - window.validate(); - } - - - public void disconnect() - { - window.getView().remove(actionsPanel); - } - - - public int getButton() - { - return AInteractionsManager.LEFT; - } - - - public void start(Point2D.Double p, int region, int key) - { - this.region = region; - actionsPanel.setVisible(false); - } - - - public void cancel() {} - - - private boolean canLayout(int i0, int j0) - { - Dimension panelSize = actionsPanel.getSize(); - panelSize.width = (int) Math.ceil((panelSize.width + d) / (double) d); - panelSize.height = (int) Math.ceil((panelSize.height + d) / (double) d); - for(int j = 0; j < panelSize.height; j++) - { - for(int i = 0; i < panelSize.width; i++) - { - if(i0 + i > map[0].length - 1)return false; - if(j0 + j > map.length - 1)return false; - if(map[j0 + j][i0 + i] == false)return false; - } - } - return true; - - } - - - private Point calculateBestPosition() - { - AWindow w = window; - Dimension size = w.getView().getSize(); - int ny = (int) Math.ceil(size.height / (double) d); - int nx = (int) Math.ceil(size.width / (double) d); - map = new boolean[ny][nx]; - Polygon p = new Polygon(); - for(int i = 0; i < 4; i++) - { - p.addPoint((int) hr[i].getCenterX(), (int) hr[i].getCenterY()); - } - - for(int j = 0; j < map.length; j++) - { - for(int i = 0; i < map[0].length; i++) - { - if(p.intersects(i * d, j * d, d, d) || p.contains(i * d, j * d, d, d)) - { - map[j][i] = false; - } - else - { - map[j][i] = true; - } - } - } - - for(int j = 0; j < map.length; j++) - { - for(int i = 0; i < map[0].length; i++) - { - if(canLayout(i, j)) - { - map[j][i] = true; - } - else - { - map[j][i] = false; - } - } - } - - int x0 = (int) hr[region].getMaxX(); - int y0 = (int) hr[region].getMaxY(); - int i_min = 0, j_min = 0; - double dist, dist_min = 1e10; - for(int j = 0; j < map.length; j++) - { - for(int i = 0; i < map[0].length; i++) - { - if(map[j][i] == true) - { - dist = Math.hypot(x0 - i*d, y0 - j*d); - if(dist < dist_min) - { - i_min = i; - j_min = j; - dist_min = dist; - } - } - } - } - - return new Point(i_min * d + d / 2, j_min * d + d / 2); - } - - - public void stop() - { - if(isValid) - { - Point p = calculateBestPosition(); - actionsPanel.setLocation(p.x, p.y); - actionsPanel.setVisible(true); - window.revalidate(); - } - } - - - protected int getUpperLeftRegion() - { - int point = 0; - double savedValue = getRadius(hr[0]); - for(int i = 1; i < 4; i++) - { - double value = getRadius(hr[i]); - if(value < savedValue) - { - savedValue = value; - point = i; - } - } - return point; - } - - - protected Point2D.Double[] convert( - double x0, double y0, double x1, double y1, double x2, double y2) - { - if(!isValid) - { - return window.getUserCorners(); - } - if(Math.abs(getAPolygon().getArea()) == 0) - { - return window.getUserCorners(); - } - - double[][][] hv = new double[2][1][3]; - hv[0][0][0] = x0; - hv[1][0][0] = y0; - hv[0][0][1] = x1; - hv[1][0][1] = y1; - hv[0][0][2] = x2; - hv[1][0][2] = y2; - ACoord d = window.calculateUser(new ACoord(hv)); - Point2D.Double[] corners = new Point2D.Double[3]; - for(int i = 0; i < 3; i++) - { - corners[i] = new Point2D.Double(d.hv[0][0][i], d.hv[1][0][i]); - } - - return corners; - } - - - protected Point2D.Double[] convert(int region1, int region2, int region3) - { - return convert(hr[region1].getCenterX(), hr[region1].getCenterY(), - hr[region2].getCenterX(), - hr[region2].getCenterY(), hr[region3].getCenterX(), - hr[region3].getCenterY()); - } - - - public abstract Point2D.Double[] getCorners(); - - - protected void paintStandard(Graphics2D g) - { - if(isValid) - { - AGraphics ag = AGraphics.makeAGraphics(g); - ag.updateDrawParameters(frameDrawParameters); - ag.drawPolygon(getAPolygon()); - drawLine(4, 5, ag); - ag.updateDrawParameters(drawParameters); - ag.drawPolygon(getAPolygon()); - drawLine(4, 5, ag); - drawActivePoint(region, ag); - } - } - - - public void zoomIn(String zoomWindow) - { - String currentWindow = window.getName(); - ACanvas.getCanvas().copyWindowSettings(currentWindow, zoomWindow); - ACanvas.getCanvas().getWindow(zoomWindow).setUserCorners(getCorners()); - } - -} // class ASelection ======================================================= diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ASkewGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/ASkewGroup.java deleted file mode 100755 index 70057212cca9158e3647cdc34bf25d94726e62b6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ASkewGroup.java +++ /dev/null @@ -1,14 +0,0 @@ -package atlantis.interactions; - - -public class ASkewGroup extends AInteractionGroup { - - ASkewInteraction skewInteraction; - - public ASkewGroup(AInteractionsManager iManager) { - super(AInteractionGroup.WINDOW_GROUP, iManager); - skewInteraction=new ASkewInteraction(); - this.addInteraction(skewInteraction); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ASkewInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/ASkewInteraction.java deleted file mode 100755 index a338f168638e6818e3cde18ac128e80bd5bd6106..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ASkewInteraction.java +++ /dev/null @@ -1,123 +0,0 @@ -package atlantis.interactions; - -import atlantis.canvas.AWindow; -import atlantis.parameters.APar; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjection; -import atlantis.projection.AProjectionRZ; -import java.awt.*; -import java.awt.geom.*; -import java.awt.event.*; -import javax.swing.*; - -/** - * The interaction that performs a skew on the picture. - */ -public class ASkewInteraction extends AInteraction - implements ASleepMouseDragListener, ActionListener { - - private int d=20; - private Point2D.Double p0; - private JMenuItem[] popupItems; - private final static String NO_SKEW="Set No Skew"; - - public ASkewInteraction() { - super(1, WINDOW_TOTAL_REPAINT, WORLD_COORDINATES, false); - - popupItems = new JMenuItem[] { - new JMenuItem(NO_SKEW) - }; - - popupItems[0].addActionListener(this); - - // The center of the ellipse is in (0, 0) in User Space - hr[0]=new Ellipse2D.Double(-d/2, -d/2, d, d); - } - - public int init(Point2D.Double p, int key) { - p0=p; - return 0; - } - - public int getButton() { - return AInteractionsManager.LEFT; - } - - public void start(Point2D.Double p, int region, int key) {} - - public void drag(Point2D.Double p, int region, int key) { - AProjection proj=window.getProjection(); - - if(proj instanceof AProjectionFR) { - performFRSkew(-(p.y-p0.y)/p0.x, window); - } else if(proj instanceof AProjectionFZ) { - performFZSkew(-(p.y-p0.y)/p0.x, window); - } else if(proj instanceof AProjectionRZ) { - if(key==KeyEvent.VK_V) - performFZSkew(-(p.y-p0.y)/p0.x, window); - else - performRZSkew(-(p.x-p0.x)/p0.y, window); - } - } - - public static void performFRSkew(double f, AWindow window) { - Point2D.Double[] corners=window.getUserCorners(); - - for(int i=0; i<corners.length; i++) - corners[i].y+=f*corners[i].x; - - window.setUserCorners(corners); - } - - public static void performFZSkew(double f, AWindow window) { - Point2D.Double[] corners=window.getUserCorners(); - - double zVtx=parameterStore.get("Event", "ZVtx").getD(); - - for(int i=0; i<corners.length; i++) - corners[i].y+=f*(corners[i].x-zVtx); - - window.setUserCorners(corners); - } - - public static void performRZSkew(double f, AWindow window) { - Point2D.Double[] corners=window.getUserCorners(); - - for(int i=0; i<corners.length; i++) - corners[i].x+=f*corners[i].y; - - window.setUserCorners(corners); - } - - public void stop() {} - - public void cancel() {} - - public void paint(Graphics2D g) {} - - public int getPopupType() { - return APopupListener.WINDOW_POPUP; - } - - public JMenuItem[] getPopupItems() { - return popupItems; - } - - public void actionPerformed(ActionEvent e) { - - } - public AModifier[] getModifiers(){ - if(window.getProjection() instanceof AProjectionRZ) { - return new AModifier[] { - new AModifier(KeyEvent.VK_V, false, "Y Skew"), - new AModifier(KeyEvent.VK_H, false, "X Skew"), - new AModifier(KeyEvent.VK_UNDEFINED, false, "X Skew") - }; - } else { - return new AModifier[0]; - } - } - - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ASleepMouseDragListener.java b/graphics/AtlantisJava/src/atlantis/interactions/ASleepMouseDragListener.java deleted file mode 100755 index 60b145d8b1321156e9230b2a2804f1dd5bee9db8..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ASleepMouseDragListener.java +++ /dev/null @@ -1,13 +0,0 @@ -package atlantis.interactions; - - -import java.awt.geom.*; - - -/** - * This listener extends AMouseDragListener in order to make it possible to - * get drag events even without any hot region. - */ -public interface ASleepMouseDragListener extends AMouseDragListener { - int init(Point2D.Double p, int key); -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ASquareSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/ASquareSelection.java deleted file mode 100755 index 0f12dae04d5737448c5fb97497940e04fbb49011..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ASquareSelection.java +++ /dev/null @@ -1,87 +0,0 @@ -package atlantis.interactions; - -import java.awt.Graphics2D; -import java.awt.geom.Point2D; - -import atlantis.graphics.AGraphics; -import atlantis.utils.AMath; - -public class ASquareSelection extends ASelection -{ - public ASquareSelection() - { - super(5); - } - - public int init(Point2D.Double p, int key) - { - isValid = false; - - for (int i = 0; i < 5; i++) - setCenter(hr[i], p.x, p.y); - - this.region = 2; - return region; - } - - public void drag(Point2D.Double p, int region, int key) - { - isValid = true; - - if (region == 4) - { - double dx = p.x - hr[4].getCenterX(); - double dy = p.y - hr[4].getCenterY(); - - for (int i = 0; i < 5; i++) - setCenter(hr[i], hr[i].getCenterX() + dx, hr[i].getCenterY() + dy); - } - else - { - double ratio = ((double) window.getSize().width) / ((double) window.getSize().height); - - double sx1 = AMath.getSign(p.x - hr[4].getCenterX()); - double sy1 = AMath.getSign(p.y - hr[4].getCenterY()); - double sx2 = sy1; - double sy2 = sx1; - double dy = getRadius(p.x, p.y, 4) / Math.sqrt(1 + ratio * ratio); - double dx = dy * ratio; - - setCenter(hr[region], hr[4].getCenterX() + dx * sx1, hr[4].getCenterY() + dy * sy1); - setCenter(hr[(region + 2) % 4], hr[4].getCenterX() - dx * sx1, hr[4].getCenterY() - dy * sy1); - - setCenter(hr[(region + 1) % 4], hr[4].getCenterX() - dx * sx2, hr[4].getCenterY() + dy * sy2); - setCenter(hr[(region + 3) % 4], hr[4].getCenterX() + dx * sx2, hr[4].getCenterY() - dy * sy2); - } - } - - public void paint(Graphics2D g) - { - if (isValid) - { - AGraphics ag = AGraphics.makeAGraphics(g); - - ag.updateDrawParameters(frameDrawParameters); - ag.drawPolygon(getAPolygon()); - drawLine(0, 2, ag); - drawLine(1, 3, ag); - ag.updateDrawParameters(drawParameters); - ag.drawPolygon(getAPolygon()); - drawLine(0, 2, ag); - drawLine(1, 3, ag); - drawActivePoint(region, ag); - } - } - - public Point2D.Double[] getCorners() - { - int first = getUpperLeftRegion(); - - // Calculate the adjacent partner and the opposite corner. - int second = (first + 1) % 4; - int third = (first + 2) % 4; - - return convert(first, second, third); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ASynchroCursorsGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/ASynchroCursorsGroup.java deleted file mode 100755 index 4a74be687a74ee353eb4c36c173e26695b816f9b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ASynchroCursorsGroup.java +++ /dev/null @@ -1,15 +0,0 @@ -package atlantis.interactions; - - -public class ASynchroCursorsGroup extends AInteractionGroup { - - private ASynchroCursorsInteraction mmSelection; - - public ASynchroCursorsGroup(AInteractionsManager iManager) { - super(AInteractionGroup.CANVAS_GROUP, iManager); - - mmSelection=new ASynchroCursorsInteraction(); - addInteraction(mmSelection); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/ASynchroCursorsInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/ASynchroCursorsInteraction.java deleted file mode 100755 index 9f7915a17dc9d8b4f2571e090e745acdd480aec6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/ASynchroCursorsInteraction.java +++ /dev/null @@ -1,483 +0,0 @@ -package atlantis.interactions; - -import java.awt.Graphics2D; -import java.awt.event.KeyEvent; -import java.awt.geom.Ellipse2D; -import java.awt.geom.Point2D; - -import atlantis.canvas.ACanvas; -import atlantis.graphics.ACoord; -import atlantis.graphics.ACursorFactory; -import atlantis.graphics.AGraphics; -import atlantis.parameters.APar; -import atlantis.parameters.AParameterUtilities; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionXZ; -import atlantis.projection.AProjectionYX; -import atlantis.projection.AProjectionYZ; -import atlantis.utils.AMath; - -public class ASynchroCursorsInteraction extends AInteraction - implements ASleepMouseDragListener, AEnterExitListener -{ - /** - * The position of the moving marker in 3D. Phi is in degrees. - * (Must be static) - */ - private static double rho, phi, z, sign_rho; - - private static final double NOT_DEFINED = 9999.0; - private static final double RHO_MAX = 3000.0; - private static final double PHI_MAX = 400.0; - private static final double Z_MAX = 3000.0; - private static final double ETA_MAX = 10.0; - - private static int key = 0; - protected int radius = 10; - - public ASynchroCursorsInteraction() - { - super(1, ALL_WINDOWS_REPAINT, WORLD_COORDINATES, true); - hr[0] = new Ellipse2D.Double(0, 0, radius, radius); - } - - public int getButton() - { - return AInteractionsManager.LEFT; - } - - /** - * Initialize the control points based on the starting point - */ - public int init(Point2D.Double p, int key) - { - this.key = key; - setCenter(hr[0], p.x, p.y); - // ACanvas.getCanvas().repaintOthers(window); - return 0; - } - - public void start(Point2D.Double p, int region, int key) - { - //call drag to update the cursor even if only a button is pressed - drag(p,region,key); - } - - /** - * Move the active control point to the point (x, y). - * - * @param pInput the input point - * @param region the region - * @param key the current key being pressed - */ - public void drag(Point2D.Double pInput, int region, int key) - { - this.key = key; - AProjection2D projection = (AProjection2D) window.getProjection(); - - Point2D.Double p = projection.inverseNonLinearTransform(pInput); - - setCenter(hr[0], p.x, p.y); - - rho = NOT_DEFINED; - z = NOT_DEFINED; - phi = NOT_DEFINED; - sign_rho = 1.; - - if (projection instanceof AProjectionYX) - { - phi = Math.toDegrees(Math.atan2(p.y, p.x)); - if (phi < 0.) - phi += 360.; - rho = AParameterUtilities.getRhoSign(p.x, p.y) * Math.sqrt(p.x * p.x + p.y * p.y); - } - else if (projection instanceof AProjectionFR) - { - phi = p.y; - rho = p.x; - } - else if (projection instanceof AProjectionFZ) - { - phi = p.y; - z = p.x; - } - else if (projection instanceof AProjectionRZ) - { - rho = Math.abs(p.y); - if (p.y < 0.) - sign_rho = -1.; - z = p.x; - } - else if (projection instanceof AProjectionYZ) - { - z = p.x; - } - else if (projection instanceof AProjectionXZ) - { - z = p.x; - } - else if (projection instanceof AProjectionVP) - { - phi = p.y; - rho = parameterStore.get("VP", "RMax").getD(); - double eta = p.x; - - z = parameterStore.get("Event", "ZVtx").getD() + 0.5 * rho * (Math.exp(eta) - 1. / Math.exp(eta)); - } - else if (projection instanceof AProjectionLegoPlot) - { - // added by Mark Stockton - // update parameters - AProjectionLegoPlot.update(); - //reverse the adjustPhi function - p.x=-(AProjectionLegoPlot.adjustPhi(window,-p.x,p.y)); - if(p.x>-1.0 && p.x<361.0 && p.y>-5.01 && p.y<5.01) - { - phi=p.x; - rho = parameterStore.get("VP", "RMax").getD(); - double eta=p.y; - if (AProjectionLegoPlot.reverse) - eta = -eta; - z = parameterStore.get("Event", "ZVtx").getD() + 0.5 * rho * (Math.exp(eta) - 1. / Math.exp(eta)); - } - } - if (key == KeyEvent.VK_P && phi != NOT_DEFINED) - { - double phiRZ = phi + 90.; - - if (phiRZ < 0.) - phiRZ += 360; - if (phiRZ > 360.) - phiRZ -= 360; - parameterStore.get("RZ", "Phi").setD(phiRZ); - parameterStore.get("RZ", "Phi").globalize(ACanvas.getCanvas().getCurrentWindow().getIndex()); - ACanvas.getCanvas().repaintAllFromScratch(); - } - else - ACanvas.getCanvas().repaintOthers(window); - } - - public void cancel() - {} - - public void stop() - {} - - public void paint(Graphics2D g) - { - // must use the window version of the parameters - parameterStore.selectWindowParameters(window.getName()); - AProjection2D projection = (AProjection2D) window.getProjection(); - AGraphics ag = AGraphics.makeAGraphics(g); - - for (int i = 0; i < 2; i++) - { - if (i == 0) - ag.updateDrawParameters(frameDrawParameters); - else - ag.updateDrawParameters(drawParameters); - - if (projection instanceof AProjectionYX) - { - if (phi != NOT_DEFINED) - { - double r = (rho == NOT_DEFINED) ? RHO_MAX : Math.abs(rho); - double cosPhi = Math.cos(Math.toRadians(phi)); - double sinPhi = Math.sin(Math.toRadians(phi)); - - Point2D.Double p = window.calculateDisplay(projection.nonLinearTransform(0, 0)); - Point2D.Double p1 = window.calculateDisplay(projection.nonLinearTransform(r * cosPhi, r * sinPhi)); - Point2D.Double p2 = window.calculateDisplay(projection.nonLinearTransform(RHO_MAX * cosPhi, RHO_MAX * sinPhi)); - Point2D.Double p3 = window.calculateDisplay(projection.nonLinearTransform(-RHO_MAX * cosPhi, -RHO_MAX * sinPhi)); - - if (key == KeyEvent.VK_P) - { - ag.drawLine(p2.x, p2.y, p3.x, p3.y); - } - else - { - ag.drawLine(p.x, p.y, p2.x, p2.y); - if (rho != NOT_DEFINED) - ag.drawSymbol(p1.x, p1.y); - } - - } - else if (rho != NOT_DEFINED) - { - int numPoints = 48; - double[][][] hv = new double[2][1][numPoints]; - - for (int j = 0; j < numPoints; j++) - { - hv[0][0][j] = rho * Math.cos(Math.PI * 2 * j / 48); - hv[1][0][j] = rho * Math.sin(Math.PI * 2 * j / 48); - } - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - ag.drawPolygon(d.hv[0][0], d.hv[1][0], numPoints); - } - } - else if (projection instanceof AProjectionFR) - { - int numPoints = 5; - double[][][] hv = new double[2][1][numPoints]; - - hv[0][0][0] = Math.abs(rho); - hv[1][0][0] = phi; - hv[0][0][1] = Math.abs(rho); - hv[1][0][1] = 0.; - hv[0][0][2] = Math.abs(rho); - hv[1][0][2] = RHO_MAX; - hv[0][0][3] = 0.; - hv[1][0][3] = phi; - hv[0][0][4] = RHO_MAX; - hv[1][0][4] = phi; - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - if (rho != NOT_DEFINED) - ag.drawLine(d.hv[0][0][1], d.hv[1][0][1], d.hv[0][0][2], d.hv[1][0][2]); - if (phi != NOT_DEFINED) - ag.drawLine(d.hv[0][0][3], d.hv[1][0][3], d.hv[0][0][4], d.hv[1][0][4]); - if (rho != NOT_DEFINED && phi != NOT_DEFINED) - ag.drawSymbol(d.hv[0][0][0], d.hv[1][0][0]); - } - else if (projection instanceof AProjectionFZ) - { - int numPoints = 5; - double[][][] hv = new double[2][1][numPoints]; - - hv[0][0][0] = z; - hv[1][0][0] = phi; - hv[0][0][1] = z; - hv[1][0][1] = 0.; - hv[0][0][2] = z; - hv[1][0][2] = PHI_MAX; - hv[0][0][3] = -Z_MAX; - hv[1][0][3] = phi; - hv[0][0][4] = Z_MAX; - hv[1][0][4] = phi; - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - if (z != NOT_DEFINED) - ag.drawLine(d.hv[0][0][1], d.hv[1][0][1], d.hv[0][0][2], d.hv[1][0][2]); - if (phi != NOT_DEFINED) - ag.drawLine(d.hv[0][0][3], d.hv[1][0][3], d.hv[0][0][4], d.hv[1][0][4]); - if (z != NOT_DEFINED && phi != NOT_DEFINED) - ag.drawSymbol(d.hv[0][0][0], d.hv[1][0][0]); - } - else if (projection instanceof AProjectionRZ) - { - if (rho != NOT_DEFINED && phi != NOT_DEFINED && z != NOT_DEFINED && (rho != 0. || z != 0.)) - { - int numPoints = 15; - double[][][] hv = new double[2][1][numPoints]; - - double dr, dz; - if (Math.abs(rho/RHO_MAX) > Math.abs(z/Z_MAX)) { - dr = RHO_MAX / (numPoints-1); - dz = z * (RHO_MAX / ((numPoints-1)*rho)); - } else { - dz = AMath.getSign(z) * Z_MAX / (numPoints-1); - dr = rho * Math.abs(Z_MAX / ((numPoints-1)*z)); - } - - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - - if (phiMid > AMath.TWO_PI) - phiMid -= AMath.TWO_PI; - double phiDiff = Math.abs(Math.toRadians(phi) - phiMid); - - if (phiDiff > Math.PI / 2. && phiDiff < 3 * Math.PI / 2.) - dr *= -1; - - for (int j=0; j<numPoints; j++) { - hv[0][0][j] = j*dz; - hv[1][0][j] = j*dr; - } - - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - ag.drawSmoothPolyline(d.hv[0][0], d.hv[1][0], numPoints); - } - else - { - int numPoints = 5; - double[][][] hv = new double[2][1][numPoints]; - - hv[0][0][0] = z; - hv[1][0][0] = rho * sign_rho; - hv[0][0][1] = z; - hv[1][0][1] = -RHO_MAX; - hv[0][0][2] = z; - hv[1][0][2] = RHO_MAX; - hv[0][0][3] = -Z_MAX; - hv[1][0][3] = rho * sign_rho; - hv[0][0][4] = Z_MAX; - hv[1][0][4] = rho * sign_rho; - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - if (z != NOT_DEFINED) - ag.drawLine(d.hv[0][0][1], d.hv[1][0][1], d.hv[0][0][2], d.hv[1][0][2]); - if (rho != NOT_DEFINED) - ag.drawLine(d.hv[0][0][3], d.hv[1][0][3], d.hv[0][0][4], d.hv[1][0][4]); - if (z != NOT_DEFINED && rho != NOT_DEFINED) - ag.drawSymbol(d.hv[0][0][0], d.hv[1][0][0]); - } - } - else if (projection instanceof AProjectionYZ) - { - if (rho != NOT_DEFINED && phi != NOT_DEFINED && z != NOT_DEFINED) - { - int numPoints = 2; - double[][][] hv = new double[2][1][numPoints]; - - hv[0][0][0] = 0.; - hv[1][0][0] = 0.; - double phiRot = AProjectionXZ.getPhi(); - - hv[0][0][1] = z; - hv[1][0][1] = rho * Math.sin(phiRot); - - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - ag.drawLine(d.hv[0][0][0], d.hv[1][0][0], d.hv[0][0][1], d.hv[1][0][1]); - ag.drawSymbol(d.hv[0][0][1], d.hv[1][0][1]); - } - else if (z != NOT_DEFINED) - { - int numPoints = 2; - double[][][] hv = new double[2][1][numPoints]; - - hv[0][0][0] = z; - hv[1][0][0] = -RHO_MAX; - hv[0][0][1] = z; - hv[1][0][1] = RHO_MAX; - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - ag.drawLine(d.hv[0][0][0], d.hv[1][0][0], d.hv[0][0][1], d.hv[1][0][1]); - } - } - else if (projection instanceof AProjectionXZ) - { - if (rho != NOT_DEFINED && phi != NOT_DEFINED && z != NOT_DEFINED) - { - int numPoints = 2; - double[][][] hv = new double[2][1][numPoints]; - - hv[0][0][0] = 0.; - hv[1][0][0] = 0.; - double phiRot = AProjectionXZ.getPhi(); - - hv[0][0][1] = z; - hv[1][0][1] = rho * Math.cos(phiRot); - - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - ag.drawLine(d.hv[0][0][0], d.hv[1][0][0], d.hv[0][0][1], d.hv[1][0][1]); - ag.drawSymbol(d.hv[0][0][1], d.hv[1][0][1]); - } - else if (z != NOT_DEFINED) - { - int numPoints = 2; - double[][][] hv = new double[2][1][numPoints]; - - hv[0][0][0] = z; - hv[1][0][0] = -RHO_MAX; - hv[0][0][1] = z; - hv[1][0][1] = RHO_MAX; - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - ag.drawLine(d.hv[0][0][0], d.hv[1][0][0], d.hv[0][0][1], d.hv[1][0][1]); - } - } - else if (projection instanceof AProjectionVP) - { - int numPoints = 5; - double[][][] hv = new double[2][1][numPoints]; - double eta = 1.; - - if (z != NOT_DEFINED && rho != NOT_DEFINED) - eta = AParameterUtilities.eta(z, rho); - hv[0][0][0] = eta; - hv[1][0][0] = phi; - hv[0][0][1] = eta; - hv[1][0][1] = 0.; - hv[0][0][2] = eta; - hv[1][0][2] = PHI_MAX; - hv[0][0][3] = -ETA_MAX; - hv[1][0][3] = phi; - hv[0][0][4] = ETA_MAX; - hv[1][0][4] = phi; - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - - if (z != NOT_DEFINED && rho != NOT_DEFINED) - ag.drawLine(d.hv[0][0][1], d.hv[1][0][1], d.hv[0][0][2], d.hv[1][0][2]); - if (phi != NOT_DEFINED) - ag.drawLine(d.hv[0][0][3], d.hv[1][0][3], d.hv[0][0][4], d.hv[1][0][4]); - - if (z != NOT_DEFINED && phi != NOT_DEFINED && rho != NOT_DEFINED) - ag.drawSymbol(d.hv[0][0][0], d.hv[1][0][0]); - } - else if (projection instanceof AProjectionLegoPlot) - { - //added by Mark Stockton - double eta = 1.; - double[][][] hv = new double[2][1][3]; - Point2D.Double[] userCorners = window.getUserCorners(); - Point2D.Double[] displayCorners = window.getDisplayCorners(); - //update parameters - AProjectionLegoPlot.update(); - if (z != NOT_DEFINED && rho != NOT_DEFINED) - eta = AParameterUtilities.eta(z, rho); - if (AProjectionLegoPlot.reverse) - eta = -eta; - hv[0][0][0] = AProjectionLegoPlot.adjustPhi(window,phi,eta); - hv[1][0][0] = eta; - //top of plot coordinate - hv[0][0][1] = AProjectionLegoPlot.adjustPhi(window,phi,userCorners[0].y); - hv[1][0][1] = userCorners[0].y; - //bottom of plot coordinate - hv[0][0][2] = AProjectionLegoPlot.adjustPhi(window,phi,userCorners[2].y); - hv[1][0][2] = userCorners[2].y; - //convert to screen positions - ACoord d = window.calculateDisplay(projection.nonLinearTransform(new ACoord(hv))); - if (z != NOT_DEFINED && rho != NOT_DEFINED) - ag.drawLine(0, d.hv[1][0][0], displayCorners[1].x, d.hv[1][0][0]);//eta line - if (phi != NOT_DEFINED) - ag.drawLine(d.hv[0][0][1], d.hv[1][0][1],d.hv[0][0][2], d.hv[1][0][2]);//phi line - if (z != NOT_DEFINED && phi != NOT_DEFINED && rho != NOT_DEFINED) - ag.drawSymbol(d.hv[0][0][0], d.hv[1][0][0]);//square where axis cross - } - } - parameterStore.restoreWindowParameters(); - } - - /** - * Gets called each time we enter a window in which this interaction is active - */ - public void entered() - { - //Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getSyncCursor()); - } - - /** - * Gets called each time we leave a window in which this interaction is active - */ - public void exited() - { - //Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getSyncCursor()); - } - - public AModifier[] getModifiers() - { - return new AModifier[] { new AModifier(KeyEvent.VK_P, false, "Copy phi to RZ projection" ) }; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AVPSelectionGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/AVPSelectionGroup.java deleted file mode 100755 index c439d48ee4225aba92bad57c00b733881b4de376..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AVPSelectionGroup.java +++ /dev/null @@ -1,15 +0,0 @@ -package atlantis.interactions; - - -public class AVPSelectionGroup extends AInteractionGroup { - - private ARectangleVPSelection rectangleVPSelection; - - public AVPSelectionGroup(AInteractionsManager iManager) { - super(AInteractionGroup.WINDOW_GROUP, iManager); - - rectangleVPSelection=new ARectangleVPSelection(); - addInteraction(rectangleVPSelection); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AWindowInfoInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/AWindowInfoInteraction.java deleted file mode 100755 index 80d439b8e5fabc1e5e4f3d4c96889070e018d0da..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AWindowInfoInteraction.java +++ /dev/null @@ -1,73 +0,0 @@ -package atlantis.interactions; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.geom.Point2D; - -import atlantis.graphics.ACursorFactory; - -public class AWindowInfoInteraction extends AInteraction implements AMouseDragListener, AEnterExitListener -{ - // private int width=64; - private Point pickedPoint; - private Color c; - - public AWindowInfoInteraction() - { - super(1, AUTOMATIC_REPAINT, SCREEN_COORDINATES, true); - - this.c = Color.white; - - // hr[0] = new Rectangle2D.Double(x, y, width, width); - pickedPoint = new Point(0, 0); - } - - public int getButton() - { - return AInteractionsManager.LEFT; - } - - public void paint(Graphics2D g) - { - g.setColor(c); - g.fill(hr[0]); - - /* - * g.fillRect(hr[0].getX(), hr[0].getY(), hr[0].getWidth(), - * hr[0].getHeight()); - */ - } - - public void start(Point2D.Double p, int region, int key) - { - pickedPoint.setLocation(p.x - hr[0].getX(), p.y - hr[0].getY()); - } - - public void drag(Point2D.Double p, int region, int key) - { - hr[0].setFrame(p.x - pickedPoint.x, p.y - pickedPoint.y, hr[0].getWidth(), hr[0].getHeight()); - } - - public void stop() - {} - - public void cancel() - {} - - public void entered() - { - window.setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - - public void exited() - { - window.setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - - public int getPopupType() - { - return APopupListener.REGION_POPUP; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AXSkewSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/AXSkewSelection.java deleted file mode 100755 index 1aac47fd38ed6bf53036d51691ff0826e2d4bb34..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AXSkewSelection.java +++ /dev/null @@ -1,124 +0,0 @@ -package atlantis.interactions; - - -import java.awt.*; -import java.awt.geom.*; - - -/** - * A panel which selects a parallogram-shaped region in which two - * sides are parallel to the y-axis and the other two are skewed with - * respect to the x-axis. - * - * @author Charles Loomis - **/ -public class AXSkewSelection extends ASelection { - - final private static int STARTING_WIDTH=25; - - public AXSkewSelection() { - super(6); - } - - /** - * Initialize the control points based in the starting point - */ - public int init(Point2D.Double p, int key) { - isValid=false; - - setCenter(hr[0], p.x-STARTING_WIDTH, p.y); - setCenter(hr[1], p.x-STARTING_WIDTH, p.y); - setCenter(hr[2], p.x+STARTING_WIDTH, p.y); - setCenter(hr[3], p.x+STARTING_WIDTH, p.y); - setCenter(hr[4], p.x, p.y); - setCenter(hr[5], p.x, p.y); - - region=5; - return region; - } - - /** - * Move the active control point to the point (x,y). - */ - public void drag(Point2D.Double p, int region, int key) { - isValid=true; - - double width; - - // Change what is done depending on which control point is active. - switch(region) { - case 0: - width=p.x-hr[4].getCenterX(); - setCenterX(hr[0], hr[4].getCenterX()+width); - setCenterX(hr[1], hr[5].getCenterX()+width); - setCenterX(hr[2], hr[5].getCenterX()-width); - setCenterX(hr[3], hr[4].getCenterX()-width); - break; - - case 1: - width=p.x-hr[5].getCenterX(); - setCenterX(hr[0], hr[4].getCenterX()+width); - setCenterX(hr[1], hr[5].getCenterX()+width); - setCenterX(hr[2], hr[5].getCenterX()-width); - setCenterX(hr[3], hr[4].getCenterX()-width); - break; - - case 2: - width=p.x-hr[5].getCenterX(); - setCenterX(hr[0], hr[4].getCenterX()-width); - setCenterX(hr[1], hr[5].getCenterX()-width); - setCenterX(hr[2], hr[5].getCenterX()+width); - setCenterX(hr[3], hr[4].getCenterX()+width); - break; - - case 3: - width=p.x-hr[4].getCenterX(); - setCenterX(hr[0], hr[4].getCenterX()-width); - setCenterX(hr[1], hr[5].getCenterX()-width); - setCenterX(hr[2], hr[5].getCenterX()+width); - setCenterX(hr[3], hr[4].getCenterX()+width); - break; - - case 4: - width=hr[4].getCenterX()-hr[0].getCenterX(); - setCenter(hr[region], p.x, p.y); - setCenter(hr[0], p.x-width, p.y); - setCenter(hr[3], p.x+width, p.y); - break; - - case 5: - width=hr[4].getCenterX()-hr[0].getCenterX(); - setCenter(hr[region], p.x, p.y); - setCenter(hr[1], p.x-width, p.y); - setCenter(hr[2], p.x+width, p.y); - break; - } - } - - public void paint(Graphics2D g) { - paintStandard(g); - } - - /** - * Make the affine transform which corresponds to this skewed region. - */ - public Point2D.Double[] getCorners() { - int first=getUpperLeftRegion(); - - // Calculate which is the opposite corner. - int third=(first+2)%4; - - // Now use the cross-product to determine which of the - // remaining points is the one which keep the path going clockwise. - int second=(first+1)%4; - double dx0=hr[third].getCenterX()-hr[first].getCenterX(); - double dy0=hr[third].getCenterY()-hr[first].getCenterY(); - double dx1=hr[second].getCenterX()-hr[first].getCenterX(); - double dy1=hr[second].getCenterY()-hr[first].getCenterY(); - - if(dx0*dy1-dy0*dx1>0) second=(first+3)%4; - - return convert(first, second, third); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AXSliceSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/AXSliceSelection.java deleted file mode 100755 index 596f81aa6e8e35a1c5b48ae2a205599e1f01d13c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AXSliceSelection.java +++ /dev/null @@ -1,79 +0,0 @@ -package atlantis.interactions; - - -import java.awt.*; -import java.awt.geom.*; - - -/** - * A panel which selects a slice of the window in the x-direction. - * That is, it selects a rectangular region with a height equal to the - * full height of the window and with an adjustable width. - * - * @author Charles Loomis - **/ -public class AXSliceSelection extends ASelection { - - public AXSliceSelection() { - super(6); - } - - public int init(Point2D.Double p, int key) { - isValid=false; - - int ymax=window.getSize().height; - int ymid=ymax/2; - - setCenter(hr[0], p.x, 0); - setCenter(hr[1], p.x, 0); - setCenter(hr[2], p.x, ymax); - setCenter(hr[3], p.x, ymax); - setCenter(hr[4], p.x, ymid); - setCenter(hr[5], p.x, ymid); - - region=5; - return region; - } - - public void drag(Point2D.Double p, int region, int key) { - isValid=true; - - switch(region) { - case 0: - case 3: - case 4: - setCenterX(hr[0], p.x); - setCenterX(hr[3], p.x); - setCenterX(hr[4], p.x); - break; - - case 1: - case 2: - case 5: - setCenterX(hr[1], p.x); - setCenterX(hr[2], p.x); - setCenterX(hr[5], p.x); - break; - } - } - - public void paint(Graphics2D g) { - paintStandard(g); - } - - public Point2D.Double[] getCorners() { - // Sort out which are the three control points. - int first=0; - int second=1; - int third=2; - - if(hr[1].getCenterX()<hr[0].getCenterX()) { - first=1; - second=0; - third=3; - } - - return convert(first, second, third); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AYSkewSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/AYSkewSelection.java deleted file mode 100755 index 9e98bde0f40330d8e66fa3ecf28e8f48506a955b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AYSkewSelection.java +++ /dev/null @@ -1,124 +0,0 @@ -package atlantis.interactions; - - -import java.awt.*; -import java.awt.geom.*; - - -/** - * A panel which selects a parallogram-shaped region in which two - * sides are parallel to the y-axis and the other two are skewed with - * respect to the x-axis. - * - * @author Charles Loomis - **/ -public class AYSkewSelection extends ASelection { - - final private static int STARTING_WIDTH=25; - - public AYSkewSelection() { - super(6); - } - - /** - * Initialize the control points based in the starting point - */ - public int init(Point2D.Double p, int key) { - isValid=false; - - setCenter(hr[0], p.x, p.y-STARTING_WIDTH); - setCenter(hr[1], p.x, p.y-STARTING_WIDTH); - setCenter(hr[2], p.x, p.y+STARTING_WIDTH); - setCenter(hr[3], p.x, p.y+STARTING_WIDTH); - setCenter(hr[4], p.x, p.y); - setCenter(hr[5], p.x, p.y); - - region=5; - return region; - } - - /** - * Move the active control point to the point (x,y). - */ - public void drag(Point2D.Double p, int region, int key) { - isValid=true; - - double width; - - // Change what is done depending on which control point is active. - switch(region) { - case 0: - width=p.y-hr[4].getCenterY(); - setCenterY(hr[0], hr[4].getCenterY()+width); - setCenterY(hr[1], hr[5].getCenterY()+width); - setCenterY(hr[2], hr[5].getCenterY()-width); - setCenterY(hr[3], hr[4].getCenterY()-width); - break; - - case 1: - width=p.y-hr[5].getCenterY(); - setCenterY(hr[0], hr[4].getCenterY()+width); - setCenterY(hr[1], hr[5].getCenterY()+width); - setCenterY(hr[2], hr[5].getCenterY()-width); - setCenterY(hr[3], hr[4].getCenterY()-width); - break; - - case 2: - width=p.y-hr[5].getCenterY(); - setCenterY(hr[0], hr[4].getCenterY()-width); - setCenterY(hr[1], hr[5].getCenterY()-width); - setCenterY(hr[2], hr[5].getCenterY()+width); - setCenterY(hr[3], hr[4].getCenterY()+width); - break; - - case 3: - width=p.y-hr[4].getCenterY(); - setCenterY(hr[0], hr[4].getCenterY()-width); - setCenterY(hr[1], hr[5].getCenterY()-width); - setCenterY(hr[2], hr[5].getCenterY()+width); - setCenterY(hr[3], hr[4].getCenterY()+width); - break; - - case 4: - width=hr[4].getCenterY()-hr[0].getCenterY(); - setCenter(hr[region], p.x, p.y); - setCenter(hr[0], p.x, p.y-width); - setCenter(hr[3], p.x, p.y+width); - break; - - case 5: - width=hr[4].getCenterY()-hr[0].getCenterY(); - setCenter(hr[region], p.x, p.y); - setCenter(hr[1], p.x, p.y-width); - setCenter(hr[2], p.x, p.y+width); - break; - } - } - - public void paint(Graphics2D g) { - paintStandard(g); - } - - /** - * Make the affine transform which corresponds to this skewed region. - */ - public Point2D.Double[] getCorners() { - int first=getUpperLeftRegion(); - - // Calculate which is the opposite corner. - int third=(first+2)%4; - - // Now use the cross-product to determine which of the - // remaining points is the one which keep the path going clockwise. - int second=(first+1)%4; - double dx0=hr[third].getCenterX()-hr[first].getCenterX(); - double dy0=hr[third].getCenterY()-hr[first].getCenterY(); - double dx1=hr[second].getCenterX()-hr[first].getCenterX(); - double dy1=hr[second].getCenterY()-hr[first].getCenterY(); - - if(dx0*dy1-dy0*dx1>0) second=(first+3)%4; - - return convert(first, second, third); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AYSliceSelection.java b/graphics/AtlantisJava/src/atlantis/interactions/AYSliceSelection.java deleted file mode 100755 index 41c0a8293cdbfdcdb89e382f0dc2e419f7b5863c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AYSliceSelection.java +++ /dev/null @@ -1,79 +0,0 @@ -package atlantis.interactions; - - -import java.awt.*; -import java.awt.geom.*; - - -/** - * A panel which selects a slice of the window in the x-direction. - * That is, it selects a rectangular region with a height equal to the - * full height of the window and with an adjustable width. - * - * @author Charles Loomis - **/ -public class AYSliceSelection extends ASelection { - - public AYSliceSelection() { - super(6); - } - - public int init(Point2D.Double p, int key) { - isValid=false; - - int xmax=window.getSize().width; - int xmid=xmax/2; - - setCenter(hr[0], 0, p.y); - setCenter(hr[1], 0, p.y); - setCenter(hr[2], xmax, p.y); - setCenter(hr[3], xmax, p.y); - setCenter(hr[4], xmid, p.y); - setCenter(hr[5], xmid, p.y); - - region=5; - return region; - } - - public void drag(Point2D.Double p, int region, int key) { - isValid=true; - - switch(region) { - case 0: - case 3: - case 4: - setCenterY(hr[0], p.y); - setCenterY(hr[3], p.y); - setCenterY(hr[4], p.y); - break; - - case 1: - case 2: - case 5: - setCenterY(hr[1], p.y); - setCenterY(hr[2], p.y); - setCenterY(hr[5], p.y); - break; - } - } - - public void paint(Graphics2D g) { - paintStandard(g); - } - - public Point2D.Double[] getCorners() { - // Sort out which are the three control points. - int first=1; - int second=2; - int third=3; - - if(hr[1].getCenterY()>hr[0].getCenterY()) { - first=0; - second=3; - third=2; - } - - return convert(first, second, third); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AZMRGroup.java b/graphics/AtlantisJava/src/atlantis/interactions/AZMRGroup.java deleted file mode 100755 index 9b6903d9fb4f2aadbbd9edef5e077d3101a1523e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AZMRGroup.java +++ /dev/null @@ -1,14 +0,0 @@ -package atlantis.interactions; - - -public class AZMRGroup extends AInteractionGroup { - - private AZMRInteraction transformInteraction; - - public AZMRGroup(AInteractionsManager iManager) { - super(AInteractionGroup.WINDOW_GROUP, iManager); - transformInteraction=new AZMRInteraction(); - this.addInteraction(transformInteraction); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/AZMRInteraction.java b/graphics/AtlantisJava/src/atlantis/interactions/AZMRInteraction.java deleted file mode 100755 index db82da56f3358ecd5530ae02dfaef4f6afc30482..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/AZMRInteraction.java +++ /dev/null @@ -1,700 +0,0 @@ -package atlantis.interactions; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.geom.Ellipse2D; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; - -import javax.swing.JMenuItem; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.event.AEventManager; -import atlantis.graphics.ACursorFactory; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.projection.AProjection; -import atlantis.projection.AProjection2D; -import atlantis.projection.AProjection3D; -import atlantis.projection.AProjectionFR; -import atlantis.projection.AProjectionFZ; -import atlantis.projection.AProjectionLegoPlot; -import atlantis.projection.AProjectionRZ; -import atlantis.projection.AProjectionVP; -import atlantis.projection.AProjectionXZ; -import atlantis.projection.AProjectionYX; -import atlantis.projection.AProjectionYZ; -import atlantis.utils.AMath; -import atlantis.utils.AVector; - -/** - * The Zoom, Move and Rotate interaction. - */ -public class AZMRInteraction extends AInteraction implements - ASleepMouseDragListener, AMousePressListener, AEnterExitListener, ActionListener -{ - // when these values are reached on any of the coordinates, zooming takes - // no longer any effect - private static final double MINIMAL_ZOOM_LIMIT = 0.001; // [cm] = 10 um - private static final double MAXIMAL_ZOOM_LIMIT = 100000; // [cm] = 1000 m - - private static final int ZOOM_MODE = 0; - private static final int HORIZONTAL_ZOOM_MODE = 1; - private static final int VERTICAL_ZOOM_MODE = 2; - private static final int ROTATE_MODE = 3; - private static final int MOVE_MODE = 5; - - private int centerMarkRadius = 6; - private Point2D.Double p0; - private int previousKey = KeyEvent.VK_UNDEFINED; - private int mode; - private JMenuItem[] popupItems; - private final static String TO_CENTER_OF_DETECTOR = "To Center Of Detector"; - private final static String CENTER_PICTURE = "Center The Picture"; - private final static String ASPECT_RATIO_1 = "Aspect Ratio 1"; - private final static String UNZOOM_FULL = "Unzoom Full"; - - // if false, none of the ZMR interactions will have the red central dot - // painted - private static boolean paintCenterDot = true; - - public AZMRInteraction() - { - super(1, AUTOMATIC_REPAINT, WORLD_COORDINATES, false); - - popupItems = new JMenuItem[] { - new JMenuItem(TO_CENTER_OF_DETECTOR), - new JMenuItem(CENTER_PICTURE), - new JMenuItem(UNZOOM_FULL)}; - - for (int i = 0; i < popupItems.length; i++) { - popupItems[i].addActionListener(this); - } - - // The center of the ellipse is in (0, 0) in User Space - hr[0] = new Ellipse2D.Double(-centerMarkRadius / 2, - -centerMarkRadius / 2, centerMarkRadius, centerMarkRadius); - - //By default we are in zoom mode - mode = ZOOM_MODE; - } - - public static void setPaintCenterDot(boolean state) - { - paintCenterDot = state; - } - - public void connect(AInteractionsManager manager) - { - super.connect(manager); - Point2D.Double c = ((AProjection2D) window.getProjection()).getCenter(); - - setCenter(hr[0], c.x, c.y); - } - - public int getPressButton() - { - return AInteractionsManager.LEFT; - } - - public int init(Point2D.Double p, int key) - { - keyChange(p, key); - return -1; - } - - public void pressed(Point2D.Double p, int button, int key) - { - if (key == KeyEvent.VK_C) - setCenter(hr[0], p.x, p.y); - if (key == KeyEvent.VK_0){ - double[] primaryVertex = AEventManager.instance().getCurrentEvent().getPrimaryVertex(); - if(window.getProjection().getName().equals("YX")) setCenter(hr[0], primaryVertex[0], primaryVertex[1]); - if(window.getProjection().getName().equals("RZ")) { - double phiMid2 = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(Math.atan2(primaryVertex[1], primaryVertex[0]) - phiMid2); - int s=-1; - if (phiDiff < Math.PI / 2. || phiDiff > 3 * Math.PI / 2.) s = 1; - setCenter(hr[0], primaryVertex[2], s*Math.sqrt(primaryVertex[0]*primaryVertex[0]+primaryVertex[1]*primaryVertex[1])); - } - } - } - - public int getButton() - { - return AInteractionsManager.LEFT; - } - - public void start(Point2D.Double p, int region, int key) - {} - - private double getHd0(Point2D.Double p) - { - Point2D.Double[] c = window.getUserCorners(); - AVector v21 = new AVector(c[2].x, c[2].y, c[1].x, c[1].y); - AVector v10 = new AVector(c[1].x, c[1].y, c[0].x, c[0].y); - Point2D.Double center = getCenter(hr[0]); - - return p.distance(AMath.intersectionPoint(center, v21, p, v10)); - } - - private double getVd0(Point2D.Double p) - { - Point2D.Double[] c = window.getUserCorners(); - AVector v01 = new AVector(c[0].x, c[0].y, c[1].x, c[1].y); - AVector v12 = new AVector(c[1].x, c[1].y, c[2].x, c[2].y); - Point2D.Double center = getCenter(hr[0]); - - return p.distance(AMath.intersectionPoint(center, v01, p, v12)); - } - - private void keyChange(Point2D.Double p, int key) - { - p0 = p; - - switch (key) - { - case KeyEvent.VK_UNDEFINED: - mode = ZOOM_MODE; - break; - - case KeyEvent.VK_H: - mode = HORIZONTAL_ZOOM_MODE; - break; - - case KeyEvent.VK_V: - mode = VERTICAL_ZOOM_MODE; - break; - - case KeyEvent.VK_R: - mode = ROTATE_MODE; - break; - - case KeyEvent.VK_M: - mode = MOVE_MODE; - break; - - case KeyEvent.VK_Z: - mode = ZOOM_MODE; - break; - } - - //Update cursor mode when key changes - setCursorMode(); - } - - public void drag(Point2D.Double p, int region, int key) - { - - if (key != previousKey) - { - keyChange(p, key); - previousKey = key; - } - - double zf; - Point2D.Double center = getCenter(hr[0]); - AProjection proj = window.getProjection(); - - switch (mode) - { - case ZOOM_MODE: - zf = p0.distance(center.x, center.y) - / p.distance(center.x, center.y); - performZoom(getCenter(hr[0]), zf, window); - break; - - case HORIZONTAL_ZOOM_MODE: - zf = getHd0(p0) / getHd0(p); - performHorizontalZoom(center, zf, window); - break; - - case VERTICAL_ZOOM_MODE: - zf = getVd0(p0) / getVd0(p); - performVerticalZoom(center, zf, window); - break; - - case ROTATE_MODE: - if ((proj instanceof AProjectionFR) - || (proj instanceof AProjectionFZ) - || (proj instanceof AProjectionVP)) - performPhiRotation(p.y - p0.y, window); - else if (proj instanceof AProjectionLegoPlot) - performLegoRotation(center, p.x - p0.x, p.y - p0.y, window); - else - { - if ((proj instanceof AProjectionRZ) - || (proj instanceof AProjectionXZ) - || (proj instanceof AProjectionYZ) - || (proj instanceof AProjection3D)) - { - AParameter phiPar = parameterStore.get(proj.getName(), "Phi"); - if (proj instanceof AProjection3D) - { - Point2D.Double pDisp = window.calculateDisplay(p); - Point2D.Double p0Disp = window.calculateDisplay(p0); - double height = window.getCurrDisp().getHeight(); - double deltaV = pDisp.getY() - p0Disp.getY(); - phiPar.setD(adjustPhi(phiPar.getD() + 360. * deltaV - / height)); - } - else - phiPar.setD(adjustPhi(phiPar.getD() + (p.y - p0.y))); - p0 = p; - ACanvas.getCanvas().repaintAllFromScratch(); - } - else - { - double alpha = AMath.getAngle(p0, center) - - AMath.getAngle(p, center); - - performRotation(alpha, center, window); - if (proj instanceof AProjectionYX) - { - AParameter phiPar = parameterStore.get(proj.getName(), "Phi"); - - phiPar.setD(adjustPhi(phiPar.getD() + Math.toDegrees(alpha))); - } - } - } - break; - - case MOVE_MODE: - if ((proj instanceof AProjectionFR) - || (proj instanceof AProjectionFZ) - || (proj instanceof AProjectionVP)) - { - performMove(p.x - p0.x, 0, window); - performPhiRotation(p.y - p0.y, window); - } - else - performMove(p.x - p0.x, p.y - p0.y, window); - break; - } - } // drag() - // --------------------------------------------------------------- - - private double adjustPhi(double phi) - { - while (phi < 0) - phi += 360; - while (phi > 360) - phi -= 360; - return phi; - } - - public void stop() - {} - - public void cancel() - {} - - public void paint(Graphics2D g) - { - Point2D.Double p = window.calculateDisplay(getCenter(hr[0])); - - //don't draw red dot if not drawing the lego plot - //(i.e. when just drawing the legend) - boolean paintingJustLegoLegend = false; - if(window.getProjection().getName().equals("LegoPlot")) - { - parameterStore.selectWindowParameters(window.getName()); - if(!parameterStore.get("LegoPlot","DrawPlot").getStatus()) - paintingJustLegoLegend=true; - parameterStore.restoreWindowParameters(); - } - - if (paintCenterDot && !paintingJustLegoLegend) - { - g.setColor(Color.red); - g.fillOval((int) (p.x - centerMarkRadius / 2), - (int) (p.y - centerMarkRadius / 2), centerMarkRadius, - centerMarkRadius); - } - } - - /** - * Check the coordinates of the corners. If any of the limits was already - * reached, zooming / unzooming takes no longer any effect. - * - * @param corners Double - * @return boolean - */ - private static boolean checkCornerLimits(Point2D.Double[] corners) - { - - for (int i = 0; i < corners.length; i++) - { - //Get the difference in x and y off this corner and the next - //There is at most 3 corners - this will give us all of the combinations - double dX=Math.abs(corners[i].x-corners[(i+1)%(corners.length-1)].x); - double dY=Math.abs(corners[i].y-corners[(i+1)%(corners.length-1)].y); - //Coordinates will differ in only x OR y, get the one that does - double dMax = Math.max(dX,dY); - //Check that corner coordinate difference is within limits - if ((dMax < MINIMAL_ZOOM_LIMIT) || (dMax > MAXIMAL_ZOOM_LIMIT)) - { - AOutput.alwaysAppend("zoom / unzoom limit reached\n", - ALogInterface.NORMAL); - return false; - } - } - return true; - } // checkTheCornerLimits() - - - public static void performZoom(Point2D.Double center, double zf, - AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - - for (int i = 0; i < corners.length; i++) - { - corners[i].x = center.x + (corners[i].x - center.x) * zf; - corners[i].y = center.y + (corners[i].y - center.y) * zf; - } - - if (!checkCornerLimits(corners)) - { - return; // zooming has already reached its limit - } - - window.setUserCorners(corners); - } - - public static void performRotation(double angle, Point2D.Double center, - AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - - double cos = Math.cos(angle); - double sin = Math.sin(angle); - - for (int i = 0; i < corners.length; i++) - { - double dx = corners[i].x - center.x; - double dy = corners[i].y - center.y; - - corners[i].x = center.x + dx * cos - dy * sin; - corners[i].y = center.y + dx * sin + dy * cos; - } - - window.setUserCorners(corners); - } - - public static void performMinus90Rotation(AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - - AVector v12 = new AVector(corners[1], corners[2]); - double x3 = corners[0].x + v12.dx; - double y3 = corners[0].y + v12.dy; - - corners[0].setLocation(corners[1]); - corners[1].setLocation(corners[2]); - corners[2].setLocation(x3, y3); - - window.setUserCorners(corners); - } - - public static void performPlus90Rotation(AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - - AVector v12 = new AVector(corners[1], corners[2]); - double x3 = corners[0].x + v12.dx; - double y3 = corners[0].y + v12.dy; - - corners[2].setLocation(corners[1].x, corners[1].y); - corners[1].setLocation(corners[0].x, corners[0].y); - corners[0].setLocation(x3, y3); - - window.setUserCorners(corners); - } - - public static void performPhiRotation(double dPhi, AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - - for (int i = 0; i < corners.length; i++) - corners[i].y -= dPhi; - - window.setUserCorners(corners); - } - - public void performLegoRotation(Point2D.Double center, double dPhi, - double dEta, AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - - if (dPhi != 0.0 || dEta != 0.0) - { - //get original phi coord in 0-360 range - double centerX = -AProjectionLegoPlot.adjustPhi(window, -center.x, center.y); - - corners[0].x -= (dPhi); - // x offset=xz*360 so xz=change/360 - AProjectionLegoPlot.setxz(window.getIndex(), AProjectionLegoPlot - .getxz(window.getIndex()) - + (dPhi) / 360); - - if (AProjectionLegoPlot.getyz(window.getIndex()) < 1.0 - || (dEta) > 0.0) - { - corners[0].y -= (dEta); - corners[1].y -= (dEta); - // y offset=yz*50 so yz=change/50 - AProjectionLegoPlot.setyz(window.getIndex(), - AProjectionLegoPlot.getyz(window.getIndex()) - (dEta) - / 50); - } - - //now have changed xz recalcuate phi coordinte - center.x = AProjectionLegoPlot.adjustPhi(window, centerX, center.y); - setCenter(hr[0], center.x, center.y); - - window.setUserCorners(corners); - } - } - - public static void performHorizontalZoom(Point2D.Double center, double f, - AWindow window) - { - Point2D.Double[] c = window.getUserCorners(); - AVector v21 = new AVector(c[2].x, c[2].y, c[1].x, c[1].y); - Point2D.Double center1 = new Point2D.Double(center.x + v21.dx, center.y - + v21.dy); - Point2D.Double p0 = AMath - .intersectionPoint(c[0], c[1], center, center1); - - AVector v0 = new AVector(p0, c[0]).scale(f); - AVector v1 = new AVector(p0, c[1]).scale(f); - - c[0].x = p0.x + v0.dx; - c[0].y = p0.y + v0.dy; - - c[1].x = p0.x + v1.dx; - c[1].y = p0.y + v1.dy; - - v21.invert(); - p0.setLocation(p0.x + v21.dx, p0.y + v21.dy); - c[2].x = p0.x + v1.dx; - c[2].y = p0.y + v1.dy; - - if (!checkCornerLimits(c)) - { - return; // zooming has already reached its limit - } - - window.setUserCorners(c); - - } - - public static void performVerticalZoom(Point2D.Double center, double f, - AWindow window) - { - Point2D.Double[] c = window.getUserCorners(); - AVector v01 = new AVector(c[0].x, c[0].y, c[1].x, c[1].y); - Point2D.Double center1 = new Point2D.Double(center.x + v01.dx, center.y - + v01.dy); - Point2D.Double p0 = AMath - .intersectionPoint(c[1], c[2], center, center1); - - AVector v1 = new AVector(p0, c[1]).scale(f); - AVector v2 = new AVector(p0, c[2]).scale(f); - - c[1].x = p0.x + v1.dx; - c[1].y = p0.y + v1.dy; - - c[2].x = p0.x + v2.dx; - c[2].y = p0.y + v2.dy; - - v01.invert(); - p0.setLocation(p0.x + v01.dx, p0.y + v01.dy); - c[0].x = p0.x + v1.dx; - c[0].y = p0.y + v1.dy; - - if (!checkCornerLimits(c)) - { - return; // zooming has already reached its limit - } - - window.setUserCorners(c); - - } - - public static void performMove(double dx, double dy, AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - - for (int i = 0; i < corners.length; i++) - { - corners[i].x -= dx; - corners[i].y -= dy; - } - - window.setUserCorners(corners); - } - - public static Line2D.Double getMiddleHorizontalLine(AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - AVector v12 = new AVector(corners[1], corners[2]).scale(0.5); - - return new Line2D.Double(corners[0].x + v12.dx, corners[0].y + v12.dy, - corners[1].x + v12.dx, corners[1].y + v12.dy); - } - - public static Line2D.Double getMiddleVerticalLine(AWindow window) - { - Point2D.Double[] corners = window.getUserCorners(); - AVector v10 = new AVector(corners[1], corners[0]).scale(0.5); - - return new Line2D.Double(corners[1].x + v10.dx, corners[1].y + v10.dy, - corners[2].x + v10.dx, corners[2].y + v10.dy); - } - - public static void performFlip(Line2D.Double line, AWindow window) - { - if (line == null) - return; - - Point2D.Double[] corners = window.getUserCorners(); - double dSquare = Point2D.distanceSq(line.x1, line.y1, line.x2, line.y2); - - for (int i = 0; i < corners.length; i++) - { - double u = (1 / dSquare) - * ((corners[i].x - line.x1) * (line.x2 - line.x1) + (corners[i].y - line.y1) - * (line.y2 - line.y1)); - - double x0 = line.x1 + u * (line.x2 - line.x1); - double y0 = line.y1 + u * (line.y2 - line.y1); - - corners[i].x = 2 * x0 - corners[i].x; - corners[i].y = 2 * y0 - corners[i].y; - } - - window.setUserCorners(corners); - } - - /** - * Set cursor acording to current mode - */ - public void setCursorMode(){ - //check which mode we have - switch (mode) - { - case ZOOM_MODE: - window.setCursor(ACursorFactory.getInstance().getZoomCursor()); - break; - - case HORIZONTAL_ZOOM_MODE: - window.setCursor(ACursorFactory.getInstance().getZoomCursor()); - break; - - case VERTICAL_ZOOM_MODE: - window.setCursor(ACursorFactory.getInstance().getZoomCursor()); - break; - - case ROTATE_MODE: - window.setCursor(ACursorFactory.getInstance().getRotateCursor()); - break; - - case MOVE_MODE: - window.setCursor(ACursorFactory.getInstance().getMoveCursor()); - break; - } - } - - /** - * Gets called each time we enter a window in which this interaction is active - */ - public void entered() - { - //Set mouse cursor according to current mode - setCursorMode(); - } - - /** - * Gets called each time we leave a window in which this interaction is active - */ - public void exited() - { - //Set mouse cursor - window.setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - - public int getPopupType() - { - return APopupListener.WINDOW_POPUP; - } - - public JMenuItem[] getPopupItems() { - return popupItems; - } - - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - - if (action.equals(TO_CENTER_OF_DETECTOR)) - { - Point2D.Double c = ((AProjection2D) window.getProjection()) - .getCenter(); - - setCenter(hr[0], c.x, c.y); - window.repaint(); - } - else if (action.equals(CENTER_PICTURE)) - { - Point2D.Double[] c = window.getUserCorners(); - AVector v02 = new AVector(c[0].x, c[0].y, c[2].x, c[2].y) - .scale(0.5); - double xc = c[0].x + v02.dx; - double yc = c[0].y + v02.dy; - AVector vC0 = new AVector(xc, yc, 0, 0); - AProjection proj = window.getProjection(); - if (proj instanceof AProjectionLegoPlot) - vC0 = new AVector(xc, yc, 180 * (1 - AProjectionLegoPlot - .getxz(window.getIndex())), -5); - // 180*(1-AProjectionLegoPlot.xz), -5 is different center as center - // of plot is not at 0,0 - - for (int i = 0; i < c.length; i++) - { - c[i].x += vC0.dx; - c[i].y += vC0.dy; - } - window.setUserCorners(c); - } else if (action.equals(ASPECT_RATIO_1)) { - ((AProjection2D) window.getProjection()).setAspectRatio1(window); - } - else if (action.equals(UNZOOM_FULL)) - { - window.setUserCorners(((AProjection2D) window.getProjection()). - calculateNoZoomCorners(window.getSize())); - } - } - - public AModifier[] getModifiers() - { - return new AModifier[] { - new AModifier(KeyEvent.VK_UNDEFINED, false, "Zoom"), - new AModifier(KeyEvent.VK_Z, false, "Zoom"), - new AModifier(KeyEvent.VK_H, false, "Horizonatal Zoom"), - new AModifier(KeyEvent.VK_V, false, "Vertical Zoom"), - new AModifier(KeyEvent.VK_R, false, "Rotate"), - new AModifier(KeyEvent.VK_F, false, "Fast Zoom"), - new AModifier(KeyEvent.VK_M, false, "Move (pan)"), - new AModifier(KeyEvent.VK_C, false, "Modify Central Point") - }; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/interactions/package.html b/graphics/AtlantisJava/src/atlantis/interactions/package.html deleted file mode 100644 index 85cfaaddcc871e5bb3a7ccb5192abc402dcb0557..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/interactions/package.html +++ /dev/null @@ -1,11 +0,0 @@ -<html> -<head></head> -<body> -<p>This package contains implementation of various interactions with -the application such as the main ZMR (1Zoom Move Rotation), Fisheye, -etc. Each AWindow has an AInteractionManager which tells the current -interaction, e.g. ZMR, about what is happening with the mouse on that -window. -</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/list/AColorIcon.java b/graphics/AtlantisJava/src/atlantis/list/AColorIcon.java deleted file mode 100755 index a77acc2917d3ae6e10bede13e1ef75c8e335bdcc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/list/AColorIcon.java +++ /dev/null @@ -1,69 +0,0 @@ -package atlantis.list; - - -import javax.swing.Icon; -import java.awt.*; - -import atlantis.graphics.colormap.AColorMap; - - -// icon with size and color - -class AColorIcon implements Icon { - private int w, h; - private int colorIndex; - - public AColorIcon() { - this(AColorMap.WH, 50, 15); - } - - public AColorIcon(Dimension d) { - this.w=d.width; - this.h=d.height; - } - - public AColorIcon(int colorIndex, int w, int h) { - this.colorIndex=colorIndex; - this.w=w; - this.h=h; - } - - public void paintIcon(Component c, Graphics g, int x, int y) { - g.setColor(Color.black); - g.drawRect(x, y, w-1, h-1); - if(colorIndex==AColorMap.INVISIBLE) { - g.setColor(AColorMap.getColors()[AColorMap.WH]); - g.fillRect(x+1, y+1, w-2, h-2); - g.setColor(Color.black); - g.drawLine(x, y, x+w-1, y+h-1); - g.drawLine(x, y+h-1, x+w-1, y); - } else if(colorIndex==AColorMap.NO_COLOR) { - g.setColor(AColorMap.getColors()[AColorMap.WH]); - g.fillRect(x+1, y+1, w-2, h-2); - g.setColor(Color.black); - int xc=x+w/2; - int yc=y+h/2; - g.drawLine(xc, yc-2, xc, yc+2); - g.drawLine(xc-2, yc, xc+2, yc); - } else { - g.setColor(AColorMap.getColors()[colorIndex]); - g.fillRect(x+1, y+1, w-2, h-2); - } - } - - public int getColorIndex() { - return colorIndex; - } - - public void setColorIndex(int colorIndex) { - this.colorIndex=colorIndex; - } - - public int getIconWidth() { - return w; - } - - public int getIconHeight() { - return h; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/list/AList.java b/graphics/AtlantisJava/src/atlantis/list/AList.java deleted file mode 100755 index 7377bef99e9b2843dfeee57b9c4efaf2d7c83fd6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/list/AList.java +++ /dev/null @@ -1,128 +0,0 @@ -package atlantis.list; - -import atlantis.event.AData; - -/** - * Instance of AList as seen in AListManager (Lists) - * source references instance of the datatype in the list - * <ul> - * <li>itemsIndex is a list of indices (Atlantis internal datatitems indices) - * of the particular datape which are in the list</li> - * <li>itemsID is a list of dataitems IDs of the datatype in the list</li> - * </ul> - * - * <p>index and id is identical for Track for instance, but different for - * calo cells. When masking data on cross-event basis, IDs are necessary - * (e.g. masking hot calo cells based on their IDs)</p> - * - * <p>Copyright: Copyright (c) 2002</p> - * - * @author not attributable - * @version 1.0 - */ -public class AList -{ - private AData source; - private int[] itemsIndex; - private int[] itemsID; - - - /** - * - * @param data AData - * @param singleItem int - index of the dataitem to put in the list - */ - public AList(AData data, int singleItem) - { - source = data; - itemsIndex = new int[] { singleItem }; - itemsID = new int[] { source.getIdFromIndex(singleItem) }; - - } // AList() ------------------------------------------------------------ - - - - public AList(AData data, boolean[] drawn) - { - source = data; - int num = 0; - for(int i = 0; i < drawn.length; ++i) - { - if(drawn[i]) - { - num++; - } - } - - itemsIndex = new int[num]; - itemsID = new int[num]; - num = 0; - - for(int i = 0; i < drawn.length; ++i) - { - if(drawn[i]) - { - itemsIndex[num] = i; - itemsID[num] = source.getIdFromIndex(i); - num++; - } - } - - } // AList() ------------------------------------------------------------ - - - - /** - * String representation of the AList instance. Returns the datatype name, - * resp. screen name and if there one item in the only, then the item's - * ID. If there are more items, it says the number of dataitems. - * @return String - */ - public String toString() - { - String key = source.getStoreGateKey(); - String sn = source.getNameScreenName(); - String name = key != null ? sn + ":" + key : sn; - - if(itemsIndex.length == 1) - { - return name + " " + source.getIdFromIndex(itemsIndex[0]); - } - else - { - return name + " (" + itemsIndex.length + " items)"; - } - - } // toString() --------------------------------------------------------- - - - - public AData getSource() - { - return source; - - } // getSource() -------------------------------------------------------- - - - - /** - * Returns indices of the items in the list (internal Atlantis indices - * which are *sometimes* identical with IDs) - * @return int[] - */ - public int[] getItems() - { - return itemsIndex; - - } // getItems() --------------------------------------------------------- - - - - public int[] getItemsID() - { - return itemsID; - - } // getItemsID() ------------------------------------------------------- - - -} // class AList ============================================================ diff --git a/graphics/AtlantisJava/src/atlantis/list/AListManager.java b/graphics/AtlantisJava/src/atlantis/list/AListManager.java deleted file mode 100755 index 815d922e087b1bff90080e92d0522ff7959bf821..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/list/AListManager.java +++ /dev/null @@ -1,1765 +0,0 @@ -package atlantis.list; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.Point; -import java.awt.dnd.DragSource; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.MouseMotionListener; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.Box; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTree; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.DefaultTreeCellRenderer; -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.MutableTreeNode; -import javax.swing.tree.TreeNode; -import javax.swing.tree.TreePath; - -import atlantis.canvas.ACanvas; -import atlantis.data.AHelix; -import atlantis.data.ARVxData; -import atlantis.data.ATrackData; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACursorFactory; -import atlantis.graphics.AIcon; -import atlantis.graphics.APickingGraphics2D; -import atlantis.graphics.colormap.AColorMap; -import atlantis.gui.AGUI; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.APar; -import atlantis.utils.A4Vector; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; -import atlantis.utils.AUtilities; - -public class AListManager extends JTree implements MouseListener, MouseMotionListener -{ - private static ALogger logger = ALogger.getLogger(AListManager.class); - private static AEventManager eventManager = AEventManager.instance(); - - // used to display the tree - static private JFrame dialog; // rather than JDialog - // special nodes - static private final DefaultMutableTreeNode root = new DefaultMutableTreeNode("Lists"); - static private final DefaultMutableTreeNode highlight = new DefaultMutableTreeNode("Highlight"); - static private final DefaultMutableTreeNode lastDrawn = new DefaultMutableTreeNode("Last Drawn"); - static private final DefaultMutableTreeNode others = new DefaultMutableTreeNode("Others"); - static private final DefaultMutableTreeNode invisible = new DefaultMutableTreeNode("Invisible"); - static private final DefaultMutableTreeNode mass = new DefaultMutableTreeNode("Calculation"); - // instance - static private final AListManager listManager = new AListManager(); - static private DefaultTreeModel dtm; - static private int numLists = 0; - // source and status of Drag and Drop - static private DefaultMutableTreeNode source = null; - static private boolean draging = false; - static private HashMapSet nodeColors; - - // counters for V0 mass calc - static private int V0vx=0; - static private int V0tracks=0; - static private int V0charge=0; - - // private static final Cursor DROP_VALID = DragSource.DefaultMoveDrop; - private static final Cursor DROP_VALID_COPY = DragSource.DefaultCopyDrop; - // private static final Cursor DROP_INVALID = DragSource.DefaultMoveNoDrop; - - - - private AListManager() - { - super(root, true); - dtm = (DefaultTreeModel) getModel(); - nodeColors = new HashMapSet(); - reset(); - - addMouseListener(this); - addMouseMotionListener(this); - setSelectionRow(1); - setPreferredSize(new Dimension(200, 300)); - setRootVisible(true); - setScrollsOnExpand(true); - setShowsRootHandles(false); - setCellRenderer(new ColorRenderer()); - - if (!AGlobals.isAtlantisHeadless()) { - // set up the visual representation - dialog = new JFrame("List manager"); - AIcon.setIconImage(dialog); - Box b = Box.createHorizontalBox(); - b.add(new JScrollPane(this)); - b.add(new ColorPanel()); - dialog.getContentPane().add(b); - dialog.pack(); - dialog.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); - } - - } // AListManager() ----------------------------------------------------- - - - - public static AListManager getInstance() - { - return listManager; - - } // getInstance() ------------------------------------------------------ - - - - public void showLists() - { - Component gui = AGlobals.instance().getGuiFrame(); - if (gui != null) - { - dialog.setLocation(gui.getLocation()); - } - dialog.setVisible(true); - - } // showLists() -------------------------------------------------------- - - - - private boolean isAlreadyInTheList(AList list, - DefaultMutableTreeNode destination) - { - boolean already = false; - for(int i = 0; i < destination.getChildCount(); i++) - { - DefaultMutableTreeNode child = - (DefaultMutableTreeNode) destination.getChildAt(i); - if(!child.getAllowsChildren()) - { - AList a = (AList) child.getUserObject(); - if(a.getSource() == list.getSource()) - { - int[] items = a.getItems(); - int newItem = list.getItems()[0]; - for(int j = 0; j < items.length; ++j) - { - if(items[j] == newItem) - { - already = true; - } - } - } - } - } - - return already; - - } // isAlreadyInTheList() ----------------------------------------------- - - - - public void add(AList list) - { - if(!dialog.isVisible()) - { - dialog.setVisible(true); - } - - // default destination - DefaultMutableTreeNode destination = root; - TreePath tp = getSelectionPath(); - if(tp != null) - { - destination = (DefaultMutableTreeNode) tp.getLastPathComponent(); - } - - if(destination != null && destination.getAllowsChildren()) - { - if(destination == others || destination == lastDrawn || - destination == highlight || destination == invisible || - destination == mass) - { - AOutput.alwaysAppend("Can't add to " + destination, ALogInterface.WARNING); - return; - } - - // check if it's already in the list and if so, don't add - boolean already = this.isAlreadyInTheList(list, destination); - if(already) - { - logger.info(list + " is already in this list, not added"); - } - else - { - dtm.insertNodeInto(new DefaultMutableTreeNode(list, false), - destination, destination.getChildCount()); - expandPath(new TreePath(dtm.getPathToRoot(destination))); - ACanvas.getCanvas().repaintAllFromScratch(); - } - } - - } // add() ------------------------------------------------------------- - - - - /** - * Adds the selected item to the mass list and outputs the invariant mass in the output window - * Doesn't make the list visible as really only need to see output window - * @param list - */ - public void massCalc(AList list) - { - // default destination - DefaultMutableTreeNode destination = mass; - TreePath tp = getSelectionPath(); - - if(destination != null && destination.getAllowsChildren()) - { - // check if it's already in the list and if so, don't add - boolean already = this.isAlreadyInTheList(list, destination); - if(already) - { - logger.info(list + " is already in this list, not added"); - } - else - { - dtm.insertNodeInto(new DefaultMutableTreeNode(list, false), - destination, destination.getChildCount()); - expandPath(new TreePath(dtm.getPathToRoot(destination))); - ACanvas.getCanvas().repaintAllFromScratch(); - } - } - - if (tp != null) - { - setSelectionPath(tp); - } - - // added to list, now do summarise - Summarizer summ = new Summarizer(); - AOutput.alwaysAppend(summ.getHeader(), ALogInterface.NORMAL); - - AList[] children = getChildren(mass); - - int chiLength = children.length; - - for(int i = 0; i < chiLength; i++) - { - int num = children[i].getItems().length; - A4Vector v = children[i].getSource().get4Vector(num, - children[i].getItems(),0.14); //assume pion mass - - - if(v != null && num > 0) - { - String info = summ.addAndGetInfo(v, children[i].toString()); - AOutput.alwaysAppend(info, ALogInterface.NORMAL); - } - } - - String msg = summ.getTotalInfo(); - - AOutput.alwaysAppend(msg, ALogInterface.NORMAL_BOLD); // Print default summary (ie, assuming pi mass for all) - - summ = null; - - } // massCalc() ------------------------------------------------------------- - - /** - * Adds the selected item to the mass list and outputs the invariant mass in the output window - * Doesn't make the list visible as really only need to see output window - * This is the massCalc function for V0 decays. Check for up to 2 tracks and display 4 mass scenarios - * @param list - */ - public void massCalcV0(AList list) - { - // default destination - DefaultMutableTreeNode destination = mass; - TreePath tp = getSelectionPath(); - - if(getChildren(mass).length == 0) // if list is empty, make sure counters are reinitialised - { - V0vx=0; - V0tracks=0; - V0charge=0; - } - - if(destination != null && destination.getAllowsChildren()) - { - // check if it's already in the list and if so, don't add - boolean already = this.isAlreadyInTheList(list, destination); - - // check list for tracks and vertices (to a maximum of 2 tracks and 1 vertex) - if(getChildren(mass).length < 3) - { - if(already) - { - logger.info(list + " is already in this list, not added"); - } - else if(!(list.getSource() instanceof ARVxData || list.getSource() instanceof ATrackData)) - { - logger.info("not selected a track or vertex"); - AOutput.alwaysAppend("\n\n Not selected a track or vertex\n\n",ALogInterface.PICK); - return; - } - else if((list.getSource() instanceof ARVxData && V0vx>=1) || (list.getSource() instanceof ATrackData && V0tracks>=2)) - { - logger.info("already a vertex or two tracks selected"); - AOutput.alwaysAppend("\n\n Already a vertex or two tracks selected\n",ALogInterface.PICK); - return; - } - else - { - - // check the charges of the two tracks are opposite - // - if((list.getSource() instanceof ATrackData)) - { - ATrackData track = (ATrackData) list.getSource(); - AHelix h = track.getModifiableHelix(list.getItemsID()[0]); - if((V0charge != 0) && (V0charge * AMath.getSign(h.pT()) > 0)) - { - logger.info("2nd track is same charge as 1st track"); - AOutput.alwaysAppend("\n\nPlease pick an oppositely charged track\n", ALogInterface.PICK); - return; - } - } //end check charge - - // now increment the counters - // all tests passed, now can input into list. - - if(list.getSource() instanceof ATrackData) - { - V0tracks++; - logger.info("Selected a Track"); - } - else if(list.getSource() instanceof ARVxData) - { - V0vx++; - logger.info("Selected a Vertex"); - } - - dtm.insertNodeInto(new DefaultMutableTreeNode(list, false), - destination, destination.getChildCount()); - expandPath(new TreePath(dtm.getPathToRoot(destination))); - ACanvas.getCanvas().repaintAllFromScratch(); - } - - } - else - { - logger.info("list full (max 2 tracks + 1 vertex)"); - AOutput.alwaysAppend("\n\n List full (max 2 tracks + 1 vertex)\n",ALogInterface.PICK); - return; - } - } - if (tp != null) - { - setSelectionPath(tp); - } - - - // added to list, now do summarise - Summarizer summK = new Summarizer(); // K -> pi pi - Summarizer summL = new Summarizer(); // Lambda -> pi p - Summarizer summAL = new Summarizer(); // AntiLambda -> pi pbar - Summarizer summG = new Summarizer(); // gamma -> ee - - double[] secVx = new double[3]; // initialisation of secVx x,y,z array, if no vertex selected, use primary - double[] priVx = new double[3]; // primary vertex container (used to calculate decay length) - APar parameterStore = APar.instance(); - priVx[0]=parameterStore.get("Event", "XVtx").getD(); - priVx[1]=parameterStore.get("Event", "YVtx").getD(); - priVx[2]=parameterStore.get("Event", "ZVtx").getD(); - - secVx=priVx; - - AList[] children = getChildren(mass); - - - int chiLength = children.length; - - if(chiLength == 3) - { - boolean V0title = true; - for(int i = 0; i < chiLength; i++) - { - AData source = children[i].getSource(); - //ordering of the list is important. - //if vertex selected second, then the tracks selected before use primary vertex... - //need to get secVx first, THEN calculate tracks... - if(source instanceof ARVxData) - { - ARVxData rvx = (ARVxData) source; - secVx = rvx.getVertex(children[i].getItemsID()[0]); // gets x,y,z of the picked vertex. - } - } - - for(int i = 0; i < chiLength; i++) - { - - AData source = children[i].getSource(); - - if(source instanceof ATrackData) - { - ATrackData track = (ATrackData) source; - - // get helix of picked track - AHelix h = track.getModifiableHelix(children[i].getItemsID()[0]); - - // get charge for charge check - V0charge = (int) (Math.abs(h.pT())/h.pT()); - - int num = children[i].getItems().length; - - // initialise 4 vectors - A4Vector vK = source.get4Vector(num, - children[i].getItems(),0.0); - A4Vector vL = source.get4Vector(num, - children[i].getItems(),0.0); - A4Vector vAL = source.get4Vector(num, - children[i].getItems(),0.0); - A4Vector vG = source.get4Vector(num, - children[i].getItems(),0.0); - - - // now calculate the 4 vector - if(V0vx > 0) - { - double R = parameterStore.get("Event", "Curvature").getD() * Math.abs(h.pT()); - - // +1/-1 for a clockwise/anti-clockwise helix - double S = (int) (Math.abs(h.pT())/h.pT()); - - // Coordinates of the center point for the helix - double xC = (S * h.d0() - R) * Math.cos(Math.toRadians(h.phi0()) + S * Math.PI / 2.); - double yC = (S * h.d0() - R) * Math.sin(Math.toRadians(h.phi0()) + S * Math.PI / 2.); - - // calculate new phi from centre of curvature and secondary vertex - double phiPrime = Math.atan2(yC-secVx[1], xC-secVx[0]) + S*(Math.PI / 2.0); - - double px = Math.abs(h.pT()) * Math.cos(h.phi0()); - double py = Math.abs(h.pT()) * Math.sin(h.phi0()); - double pz = Math.abs(h.pT()) * Math.sinh(h.eta()); - - // recalculate px/py at secondary vertex - double pxPrime = Math.sqrt((px*px) + (py*py))*Math.cos(phiPrime); - double pyPrime = Math.sqrt((px*px) + (py*py))*Math.sin(phiPrime); - - px = pxPrime; - py = pyPrime; - - if(chiLength == 3 && !parameterStore.get("Minerva", "hideV0massoutput").getStatus()) - { - logger.info("recalculating tracks"); - AOutput.alwaysAppend("\n\nRecalculated track values:\n", ALogInterface.PICK); - AOutput.alwaysAppend(source.getNameScreenName()+" index: " + (children[i].getItemsID()[0]) + "\n" - +"PT="+String.format("%.3f",h.pT()) +" GeV\n" - +AMath.ETA+" = "+String.format("%.3f",h.eta())+"\n" - +AMath.PHI+" = "+String.format("%.3f",Math.toDegrees(phiPrime))+AMath.DEGREES+"\n" - +"Px=" + String.format("%.3f",px) +" GeV\n" - +"Py=" + String.format("%.3f",py) +" GeV\n" - +"Pz=" + String.format("%.3f",pz) +" GeV\n" - +"Charge = " + V0charge//Math.abs(V0charge) - ,ALogInterface.PICK); - } - else if(chiLength == 3) - { - if(V0title) - { - V0title = false; - - double decayLength = Math.sqrt(Math.pow(secVx[0]-priVx[0], 2.0)+Math.pow(secVx[1]-priVx[1], 2.0)+Math.pow(secVx[2]-priVx[2], 2.0)); - - AOutput.alwaysAppend("\n Decay length for selected vertex: "+String.format("%.2f",decayLength)+" cm\n\n", ALogInterface.PICK); - - - AOutput.alwaysAppend("\n Momentum for selected tracks: \n\n", ALogInterface.PICK); - } - if(V0charge>0) - AOutput.alwaysAppend("+ve track (px,py,pz): ("+String.format("%.3f",px)+", "+String.format("%.3f",py)+", "+String.format("%.3f",pz)+")\n", ALogInterface.PICK); - else if(V0charge <0) - AOutput.alwaysAppend("-ve track (px,py,pz): ("+String.format("%.3f",px)+", "+String.format("%.3f",py)+", "+String.format("%.3f",pz)+")\n", ALogInterface.PICK); - - } - - - /* now check charges of particles again and add to corresponding 4vectors - * - * scenarios: - * - * (K) Kaon -> pi+ pi- - * (L) Lambda -> proton pi- - * (AL)AntiLambda -> antiproton pi+ - * (G) Gamma -> e+ e- - * - * - * - */ - - // negative charge - if(V0charge < 0) - { - vK.set(px, py, pz, 0.1396); - vL.set(px, py, pz, 0.1396); - vAL.set(px, py, pz, 0.938); - vG.set(px, py, pz, 0.000511); - } - // positive charge - else if(V0charge > 0) - { - vK.set(px, py, pz, 0.1396); - vL.set(px, py, pz, 0.938); - vAL.set(px, py, pz, 0.1396); - vG.set(px, py, pz, 0.000511); - } - - - - // this is to display each track summary. - // currently off as too much summary crowds the output - if(vK != null && vL != null && vAL != null && vG != null && num > 0 && chiLength == 3) - { - String info = summK.addAndGetInfo(vK, children[i].toString()); - //AOutput.alwaysAppend(info, ALogPane.NORMAL); - info = summL.addAndGetInfo(vL, children[i].toString()); - //AOutput.alwaysAppend(info, ALogPane.NORMAL); - info = summAL.addAndGetInfo(vAL, children[i].toString()); - //AOutput.alwaysAppend(info, ALogPane.NORMAL); - info = summG.addAndGetInfo(vG, children[i].toString()); - //AOutput.alwaysAppend(info, ALogPane.NORMAL); - } - } - - } - } - - if(chiLength ==3 && !parameterStore.get("Minerva", "hideV0massoutput").getStatus()) - { - // Config switch to display either mass or px,py,pz. - String msgK = summK.getTotalInfo(); - String msgL = summL.getTotalInfo(); - String msgAL = summAL.getTotalInfo(); - String msgG = summG.getTotalInfo(); - - AOutput.alwaysAppend("\n V0 Decay Scenarios", ALogInterface.NORMAL_BOLD); - - AOutput.alwaysAppend(summK.getHeader(), ALogInterface.NORMAL); - - // print out the resultant mass calculation for each scenario - AOutput.alwaysAppend("K"+AMath.RARROW+AMath.PION+AMath.SUPPLUS+AMath.PION+AMath.SUPMINUS+"\n", ALogInterface.NORMAL); - AOutput.alwaysAppend(msgK, ALogInterface.NORMAL_BOLD); // Print kaon summary - AOutput.alwaysAppend("\n"+AMath.LAMBDACAP+AMath.RARROW+"p"+AMath.PION+AMath.SUPMINUS+"\n", ALogInterface.NORMAL); - AOutput.alwaysAppend(msgL, ALogInterface.NORMAL_BOLD); // Print lambda summary - AOutput.alwaysAppend("\n"+AMath.LAMBDACAP+AMath.OVERLINE+AMath.RARROW+"p"+AMath.OVERLINE+AMath.PION+AMath.SUPPLUS+"\n", ALogInterface.NORMAL); - AOutput.alwaysAppend(msgAL, ALogInterface.NORMAL_BOLD); // Print antilambda summary - AOutput.alwaysAppend("\n"+AMath.GAMMA+AMath.RARROW+"e"+AMath.SUPPLUS+"e"+AMath.SUPMINUS+"\n", ALogInterface.NORMAL); - AOutput.alwaysAppend(msgG, ALogInterface.NORMAL_BOLD); // Print gamma summary - AOutput.alwaysAppend("\n", ALogInterface.NORMAL); - } - } - summK = null; - summL = null; - summAL = null; - summG = null; - - } // massCalcV0() ------------------------------------------------------------- - - /** - * Takes two vectors from a list (added with the pick interaction and P key modifier) - * and prints the delta R and delta Phi of the vectors - * @param list - */ - public void deltaR(AList list) - { - // default destination - DefaultMutableTreeNode destination = mass; - TreePath tp = getSelectionPath(); - - if(destination != null && destination.getAllowsChildren()) - { - // check if it's already in the list and if so, don't add - boolean already = this.isAlreadyInTheList(list, destination); - - if(already) - { - logger.info(list + " is already in this list, not added"); - } - else - { - if(getChildren(mass).length >= 2){ - logger.info(list + " is full, maximum of 2 objects for delta phi calculation " + - "\n Clearing list"); - //AOutput.alwaysAppend("\n\n List full \n Clearing List \n",ALogPane.PICK); - mass.removeAllChildren(); - } - dtm.insertNodeInto(new DefaultMutableTreeNode(list, false), - destination, destination.getChildCount()); - expandPath(new TreePath(dtm.getPathToRoot(destination))); - ACanvas.getCanvas().repaintAllFromScratch(); - } - } - - if (tp != null) - { - setSelectionPath(tp); - } - - AList[] children = getChildren(mass); - - int chiLength = children.length; - if(chiLength == 2){ - A4Vector v1 = children[0].getSource().get4Vector(children[0].getItems().length, - children[0].getItems(),0.0); - A4Vector v2 = children[1].getSource().get4Vector(children[1].getItems().length, - children[1].getItems(),0.0); - - if(v1 != null && v2 != null) - { - double deltaPhi = Math.abs(v1.getPhi() - v2.getPhi()) > Math.PI ? (2*Math.PI) - Math.abs(v1.getPhi() - v2.getPhi()) : Math.abs(v1.getPhi() - v2.getPhi()); - double deltaEta = Math.abs(v1.getEta() - v2.getEta()); - double deltaR = Math.sqrt(deltaPhi*deltaPhi + deltaEta*deltaEta); - - String info = "\n\n"+AMath.DELTA+AMath.PHI+" = "+String.format("%.1f",Math.toDegrees(deltaPhi))+AMath.DEGREES+" ("+String.format("%.3f",deltaPhi)+")" - + "\n"+AMath.DELTA+"R = "+String.format("%.3f",deltaR)+"\n"; - AOutput.alwaysAppend(info, ALogInterface.NORMAL_BOLD); - } - - } - } - - public void highlight(AList list) - { - highlight.removeAllChildren(); - dtm.insertNodeInto(new DefaultMutableTreeNode(list, false), highlight, 0); - dtm.reload(highlight); - expandPath(new TreePath(dtm.getPathToRoot(highlight))); - ACanvas.getCanvas().repaintAllFromScratch(); - - } // highlight() -------------------------------------------------------- - - - - public void addLastDrawn(AList list) - { - dtm.insertNodeInto(new DefaultMutableTreeNode(list, false), lastDrawn, 0); - dtm.reload(lastDrawn); - - } // addLastDrawn() ----------------------------------------------------- - - - - public void addInvisible(AList list) - { - if(!dialog.isVisible()) - { - dialog.setVisible(true); - } - - // check if it's already in the list and if so, don't add - boolean already = this.isAlreadyInTheList(list, invisible); - if(already) - { - logger.info(list + " is already in the Invisible list, not added"); - } - else - { - dtm.insertNodeInto(new DefaultMutableTreeNode(list, false), - invisible, invisible.getChildCount()); - expandPath(new TreePath(dtm.getPathToRoot(invisible))); - ACanvas.getCanvas().repaintAllFromScratch(); - } - - } // addInvisible() ----------------------------------------------------- - - - /** - * When adding items to the list using rubberband they are grouped by type - * and appear as "InDetTrack (5 items)". This method allows the user to expand - * these items so they can manipulate individual items. - * @param s Collection - * @return Action - */ - private Action expand(final Collection s) - { - // This is called when the user right-clicks, we first determine if this - // item can be expanded or not. - if (s.contains(root) || s.size() != 1) - { - return null; - } - - DefaultMutableTreeNode node = (DefaultMutableTreeNode) s.iterator().next(); - if (node.getUserObject() instanceof AList) - { - AList a = (AList) node.getUserObject(); - if (a.getItems().length < 1) - { - return null; - } - } - else - { - return null; - } - - // It can be expanded, so we add a menu item to the popup with the callback - // function as specified below. - return new AbstractAction("Expand items") - { - public void actionPerformed(ActionEvent e) - { - // We checked these casts before adding the callback - DefaultMutableTreeNode node = (DefaultMutableTreeNode) s.iterator().next(); - AList a = (AList) node.getUserObject(); - DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent(); - int index = parent.getIndex(node); - - // Now go through the list and add the items one by one to the parent. - for (int i=0; i<a.getItems().length; i++) - { - AList list = new AList(a.getSource(), a.getItems()[i]); - dtm.insertNodeInto(new DefaultMutableTreeNode(list, false), parent, index); - } - - // And remove the old list. - dtm.removeNodeFromParent(node); - } - }; - - } // expand() ----------------------------------------------------------- - - - private Action remove(final Collection s) - { - if(s.contains(root)) - { - return null; - } - - return new AbstractAction("Remove") - { - public void actionPerformed(ActionEvent e) - { - for (Iterator i = s.iterator(); i.hasNext();) - { - DefaultMutableTreeNode node = (DefaultMutableTreeNode) i.next(); - if (node.getUserObject() instanceof AList) - { - AList a = (AList) node.getUserObject(); - a.getSource().remove(a.getItems()); - } - dtm.removeNodeFromParent(node); - ACanvas.getCanvas().repaintAllFromScratch(); - } - } - }; - - } // remove() ----------------------------------------------------------- - - - - /** - * This method is called after right-click -> summarize on the list-item in - * the list dialog - * @param s Collection - * @return Action - */ - private Action newSummarize(final Collection s) - { - if(s.contains(root) || s.size() != 1) - { - return null; - } - - return new AbstractAction("Summarize") - { - public void actionPerformed(ActionEvent e) - { - Summarizer summ = new Summarizer(); - AOutput.alwaysAppend(summ.getHeader(), ALogInterface.NORMAL); - - for(Iterator j = s.iterator(); j.hasNext();) - { - DefaultMutableTreeNode node = (DefaultMutableTreeNode) j.next(); - AList[] children = getChildren(node); - - for(int i = 0; i < children.length; i++) - { - int num = children[i].getItems().length; - AList child = children[i]; - AData source = child.getSource(); - A4Vector v = source.get4Vector(num, child.getItems()); - - if(v != null && num > 0) - { - String info = summ.addAndGetInfo(v, children[i].toString()); - AOutput.alwaysAppend(info, ALogInterface.NORMAL); - } - } - } - - String msg = summ.getTotalInfo(); - AOutput.alwaysAppend(msg, ALogInterface.NORMAL_BOLD); - - summ = null; - - } // actionPerformed() - }; - - } // newSummarize() ----------------------------------------------------- - - - - /** - * This summarize method is called from rubberbanding menu - Summarize - * (from ASelection class) - */ - public void summarize() - { - if(lastDrawn == null) - { - return; - } - - Summarizer summ = new Summarizer(); - - AList[] children = getChildren(lastDrawn); - - AOutput.alwaysAppend(summ.getHeader(), ALogInterface.NORMAL); - - for(int i = 0; i < children.length; i++) - { - int num = children[i].getItems().length; - A4Vector v = children[i].getSource().get4Vector(num, children[i].getItems()); - - if(v != null && num > 0) - { - String msg = summ.addAndGetInfo(v, children[i].toString()); - AOutput.alwaysAppend(msg, ALogInterface.NORMAL); - } - } - - String msg = summ.getTotalInfo(); - AOutput.alwaysAppend(msg, ALogInterface.NORMAL_BOLD); - - summ = null; - - } // summarize() -------------------------------------------------------- - - - - private Action reset(final Collection s) - { - if(s.size() == 1 && s.contains(root)) - { - return new AbstractAction("Reset") - { - public void actionPerformed(ActionEvent e) - { - reset(); - ACanvas.getCanvas().repaintAllFromScratch(); - } - }; - } - else - { - return null; - } - - } // reset() ------------------------------------------------------------ - - - - public void clearHighlight() - { - highlight.removeAllChildren(); - dtm.reload(highlight); - ACanvas.getCanvas().repaintAllFromScratch(); - - } // clearHighlight() --------------------------------------------------- - - - - public void clearHighlightAndMassCalculation() - { - highlight.removeAllChildren(); - dtm.reload(highlight); - mass.removeAllChildren(); - dtm.reload(mass); - ACanvas.getCanvas().repaintAllFromScratch(); - - } // clearHighlightAndMassCalculation() --------------------------------------------------- - - - - public void clearLastDrawn() - { - lastDrawn.removeAllChildren(); - dtm.reload(lastDrawn); - - } // clearLastDrawn() --------------------------------------------------- - - - - /** - * Check if list (list of IDs id) of datatimes (toMask datatype) is present - * in the current event and if so, the items are added into the Invisible - * list, thus masked and igrored. - * - * @param toMask AData - * @param id int[] - * @param index int[] - */ - private boolean checkAndAddIntoInvisible(int[] id, int[] indexCheck, String key) - { - boolean result = false; - - // check if the datatype (key) exists in the new event - AEvent e = eventManager.getCurrentEvent(); - AData toMask = e.get(key); - - if(toMask != null) - { - // iterate over all data items in this list - for(int i = 0; i < id.length; i++) - { - // check if this ID is present in the current event - int index = toMask.getIndexFromId(id[i]); - if(index != -1) - { - // AList expects datatype and its index - AList l = new AList(toMask, index); - addInvisible(l); - AOutput.alwaysAppend(" " + l.toString() + "\n", ALogInterface.NORMAL); - result = true; - - // 2007-08-29: debugging check, remove after some time if the - // problem is not observed (then indexCheck param is not needed) - if(index != indexCheck[i]) - { - logger.warn("AListManager: problem, indices not equal!"); - } - // </debug> - } - } - } - - return result; - - } // checkAndAddIntoInvisible() ----------------------------------------- - - - - /** - * restore Invisible list, cross-event invisible - * @param backup AList[] - */ - private void restoreInvisible(AList[] backup) - { - if(backup.length > 0) - { - AOutput.alwaysAppend("\nPrevious Invisible list not empty, masked items:\n", - ALogInterface.WARNING); - - boolean somethingInvisible = false; - - for(int i = 0; i < backup.length; i++) - { - AData d = backup[i].getSource(); - String sg = d.getStoreGateKey(); - String accessKey = d.getName() + (sg != null ? sg : ""); - - if(backup[i].getItems().length > 1) - { - somethingInvisible = checkAndAddIntoInvisible(backup[i].getItemsID(), - backup[i].getItems(), accessKey); - } - else - { - int id = backup[i].getItemsID()[0]; - int index = backup[i].getItems()[0]; - somethingInvisible = checkAndAddIntoInvisible(new int[] { id }, - new int[] { index }, accessKey); - } - - } // for (overall items in the Invisible list) - - if(!somethingInvisible) - { - AOutput.alwaysAppend(" none\n", ALogInterface.NORMAL); - } - - } // if(backup.length > 0) - - } // restoreInvisible() ------------------------------------------------- - - - - public void resetAndPreserveInvisible() - { - AList[] invisibleBackup = getChildren(invisible); - reset(); - restoreInvisible(invisibleBackup); - - } // resetAndPreserveInvisible() ---------------------------------------- - - - - public void reset() - { - root.removeAllChildren(); - highlight.removeAllChildren(); - lastDrawn.removeAllChildren(); - invisible.removeAllChildren(); - mass.removeAllChildren(); - - root.add(highlight); - root.add(lastDrawn); - root.add(others); - root.add(invisible); - root.add(mass); - - numLists = 0; - root.add(new DefaultMutableTreeNode("List " + numLists++)); - - nodeColors.clear(); - nodeColors.put(highlight, new Integer(AColorMap.WH)); - nodeColors.put(invisible, new Integer(AColorMap.INVISIBLE)); - nodeColors.put(mass, new Integer(AColorMap.WH)); - dtm.reload(); - - } // reset() ------------------------------------------------------------ - - - - private Action rename(Collection s) - { - if(s.size() != 1) - { - return null; - } - - final DefaultMutableTreeNode selected = - (DefaultMutableTreeNode) (s.iterator().next()); - - if(!selected.getAllowsChildren() || selected == root || - selected == others || selected == highlight || - selected == lastDrawn || selected == invisible || - selected == mass) - { - return null; - } - - return new AbstractAction("Rename") - { - public void actionPerformed(ActionEvent h) - { - String name = JOptionPane.showInputDialog(listManager, - "Enter new name"); - selected.setUserObject(name); - } - }; - - } // rename() ----------------------------------------------------------- - - - - private Action newParent(final Collection s) - { - if(s.contains(root)) - { - return null; - } - - Set parents = new HashSet(); - - for(Iterator i = s.iterator(); i.hasNext();) - { - parents.add(((TreeNode) (i.next())).getParent()); - } - - if(parents.size() != 1) - { - return null; - } - - final DefaultMutableTreeNode oldParent = - (DefaultMutableTreeNode) (parents.iterator().next()); - - return new AbstractAction("New Parent") - { - public void actionPerformed(ActionEvent e) - { - DefaultMutableTreeNode newParent = - new DefaultMutableTreeNode("List " + numLists++); - int index = 0; - for(Iterator i = s.iterator(); i.hasNext();) - { - index = Math.min(oldParent.getIndex((TreeNode) (i.next())), - index); - } - - for(Iterator i = s.iterator(); i.hasNext();) - { - dtm.removeNodeFromParent((MutableTreeNode) (i.next())); - } - - dtm.insertNodeInto(newParent, oldParent, index); - - for(Iterator i = s.iterator(); i.hasNext();) - { - dtm.insertNodeInto((MutableTreeNode) (i.next()), newParent, 0); - } - - expandPath(new TreePath(dtm.getPathToRoot(newParent))); - } - }; - - } // newParent() -------------------------------------------------------- - - - - private Action newChild(final Collection s) - { - if(s.size() != 1) - { - return null; - } - - final DefaultMutableTreeNode selected = - (DefaultMutableTreeNode) (s.iterator().next()); - - if(!selected.getAllowsChildren()) - { - return null; - } - - return new AbstractAction("New Child") - { - public void actionPerformed(ActionEvent h) - { - dtm.insertNodeInto(new DefaultMutableTreeNode("List " + numLists++), - selected, 0); - expandPath(new TreePath(dtm.getPathToRoot(selected))); - } - }; - - } // newChild() --------------------------------------------------------- - - - - private DefaultMutableTreeNode getNode(Point m) - { - TreePath p = getPathForLocation(m.x, m.y); - if(p != null) - { - TreeNode tn = (TreeNode) p.getLastPathComponent(); - if(tn instanceof DefaultMutableTreeNode) - { - return (DefaultMutableTreeNode) tn; - } - } - return null; - - } // getNode() ---------------------------------------------------------- - - - - private static class HashMapSet extends HashMap - { - public Object put(Object key, Object value) - { - // don't allow duplicates - if(containsKey(key)) - { - this.remove(key); - } - - if(value != null) - { - return super.put(key, value); - } - - else - { - return null; - } - } - } - - - - class ColorRenderer extends DefaultTreeCellRenderer - { - AColorIcon folderIcon; - AColorIcon leafIcon; - - public ColorRenderer() - { - folderIcon = new AColorIcon(AColorMap.WH, 15, 11); - leafIcon = new AColorIcon(AColorMap.WH, 11, 11); - } - - public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) - { - - super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); - - int c = getColor((TreeNode) value); - if (c == AColorMap.NO_COLOR) - setToolTipText("No Color"); - else if (c == AColorMap.INVISIBLE) - setToolTipText("Invisible"); - else - setToolTipText(""); - - if (leaf) - { - leafIcon.setColorIndex(c); - setIcon(leafIcon); - } - else - { - folderIcon.setColorIndex(c); - setIcon(folderIcon); - } - - return this; - } - - } - - private int getColor(TreeNode node) - { - TreeNode[] parents = dtm.getPathToRoot(node); - int color = AColorMap.NO_COLOR; - for (int i = 0; i < parents.length; ++i) - { - Object o = nodeColors.get(parents[i]); - if (o != null) - color = ((Integer) o).intValue(); - } - return color; - } - - private DefaultMutableTreeNode[] getLeafs() - { - java.util.List list = new ArrayList(); - for (int i = 0; i < root.getChildCount(); ++i) - { - DefaultMutableTreeNode node = (DefaultMutableTreeNode) root.getChildAt(i); - if (node != lastDrawn) - { - if (node.getAllowsChildren()) - { - Enumeration descendents = node.breadthFirstEnumeration(); - while (descendents.hasMoreElements()) - { - DefaultMutableTreeNode descendent = (DefaultMutableTreeNode) (descendents.nextElement()); - if (!descendent.getAllowsChildren()) - list.add(descendent); - } - } - else - { - list.add(node); - } - } - } - return (DefaultMutableTreeNode[]) list.toArray(new DefaultMutableTreeNode[list.size()]); - } - - public int[][] getColorMapping(AData data) - { - DefaultMutableTreeNode[] leafs = getLeafs(); - int num = 0; - for (int i = 0; i < leafs.length; ++i) - if (((AList) (leafs[i].getUserObject())).getSource() == data) - num += ((AList) (leafs[i].getUserObject())).getItems().length; - - int[] index = new int[num]; - int[] color = new int[num]; - num = 0; - for (int i = 0; i < leafs.length; ++i) - { - if (((AList) (leafs[i].getUserObject())).getSource() == data) - { - int[] items = ((AList) (leafs[i].getUserObject())).getItems(); - int c = getColor(leafs[i]); - for (int j = 0; j < items.length; ++j) - { - index[num] = items[j]; - color[num] = c; - num++; - } - } - } - int[][] temp = new int[2][]; - temp[0] = index; - temp[1] = color; - return temp; - } - - public int getColorOfOthers() - { - return getColor(others); - } - - public boolean[] getSelection(AData data) - { - boolean[] selected = new boolean[data.getNumData()]; - - TreePath[] paths = getSelectionPaths(); - if (paths != null) - { - for (int i = 0; i < paths.length; ++i) - { - Enumeration nodes = ((DefaultMutableTreeNode) (paths[i].getLastPathComponent())).breadthFirstEnumeration(); - while (nodes.hasMoreElements()) - { - DefaultMutableTreeNode node = (DefaultMutableTreeNode) (nodes.nextElement()); - if (!node.getAllowsChildren()) - { - AList a = (AList) (node.getUserObject()); - if (a.getSource() == data) - { - int[] items = a.getItems(); - for (int j = 0; j < items.length; ++j) - selected[items[j]] = true; - } - } - } - } - } - return selected; - } - - public AList[] getChildren(DefaultMutableTreeNode node) - { - java.util.List children = new ArrayList(); - - Object o = node.getUserObject(); - if (o instanceof AList) - { - children.add(o); - } - else - { - // process the child nodes recursively - for (int i = 0; i < node.getChildCount(); ++i) - { - AList[] grandChildren = getChildren((DefaultMutableTreeNode) node.getChildAt(i)); - for (int j = 0; j < grandChildren.length; ++j) - { - children.add(grandChildren[j]); - } - } - } - return (AList[]) (children.toArray(new AList[children.size()])); - } - - public static Collection uniqueExpansion(Collection s) - { - Collection c = new HashSet(); - for (Iterator i = s.iterator(); i.hasNext();) - { - Enumeration en = ((DefaultMutableTreeNode) (i.next())).depthFirstEnumeration(); - while (en.hasMoreElements()) - { - c.add(en.nextElement()); - } - } - return c; - } - - class ColorPanel extends JPanel - { - ColorPanel() - { - Color[] colorMap = AColorMap.getColors(); - ActionListener a = new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - int colorIndex = ((AColorIcon) (((JButton) (e.getSource())).getIcon())).getColorIndex(); - TreePath[] sel = getSelectionPaths(); - if (sel != null) - { - for (int i = 0; i < sel.length; ++i) - nodeColors.put(sel[i].getLastPathComponent(), new Integer(colorIndex)); - } - listManager.repaint(); - ACanvas.getCanvas().repaintAllFromScratch(); - } - }; - Box b = Box.createVerticalBox(); - for (int i = 0; i < colorMap.length; i++) - { - JButton l = new JButton(new AColorIcon(i, 13, 13)); - l.setMargin(new Insets(0, 0, 0, 0)); - l.setBorder(null); - b.add(l); - b.add(Box.createVerticalStrut(3)); - l.addActionListener(a); - } - b.add(Box.createVerticalStrut(6)); - JButton l = new JButton(new AColorIcon(AColorMap.NO_COLOR, 13, 13)); - l.setMargin(new Insets(0, 0, 0, 0)); - l.setBorder(null); - l.setToolTipText("No specified color"); - b.add(l); - b.add(Box.createVerticalStrut(3)); - l.addActionListener(a); - l = new JButton(new AColorIcon(AColorMap.INVISIBLE, 13, 13)); - l.setMargin(new Insets(0, 0, 0, 0)); - l.setBorder(null); - l.setToolTipText("Invisible"); - b.add(l); - l.addActionListener(a); - super.add(b); - } - } - - - - public ArrayList getLastDrawn() - { - ArrayList result = new ArrayList(); - - Enumeration myenum = lastDrawn.children(); - while(myenum.hasMoreElements()) - { - Object o = ((DefaultMutableTreeNode) (myenum.nextElement())).getUserObject(); - if(o instanceof AList) - { - if(((AList) o).getItems().length > 0) - { - result.add(o); - } - } - } - - return result; - } - - - - public void copyLastDrawn() - { - - DefaultMutableTreeNode copy = new DefaultMutableTreeNode("List " + numLists++); - Enumeration myenum = lastDrawn.children(); - while (myenum.hasMoreElements()) - { - Object o = ((DefaultMutableTreeNode) (myenum.nextElement())).getUserObject(); - if (o instanceof AList) - { - if (((AList) o).getItems().length > 0) - copy.add(new DefaultMutableTreeNode(o, false)); - } - } - dtm.insertNodeInto(copy, root, 0); - setSelectionPath(new TreePath(dtm.getPathToRoot(copy))); - // expandPath(getPathForLocation(e.getX(), e.getY())); - } - - public void mouseExited(MouseEvent e) - { - update(e); - } // DnD - - public void mouseClicked(MouseEvent e) - {} - - public void mouseEntered(MouseEvent e) - { - update(e); - } // DnD - - - public void mousePressed(MouseEvent e) - { - // source of DnD - source = getNode(e.getPoint()); - // set picked object to selection if possible - TreePath tp = getPathForLocation(e.getPoint().x, e.getPoint().y); - if (tp != null) - { - - DefaultMutableTreeNode node = (DefaultMutableTreeNode) (tp.getLastPathComponent()); - if (!node.getAllowsChildren()) - { - AList a = (AList) (node.getUserObject()); - if (a.getItems().length == 1) - APickingGraphics2D.setPicked(a.getSource(), a.getItems()[0]); - } - } - // special for right button - if (!AUtilities.isRightMouseButton(e)) - return; - // make right button act on selection just as left button does - if (tp != null) - { - if (e.isControlDown()) - { - addSelectionPath(tp); - } - else - { - setSelectionPath(tp); - } - } - // pop up menu on right click - TreePath[] sel = getSelectionPaths(); - Collection selection = new ArrayList(sel.length); - for (int i = 0; i < sel.length; ++i) - selection.add(sel[i].getLastPathComponent()); - - JPopupMenu popup = new JPopupMenu(); - Action temp; - temp = expand(selection); - if (temp != null) - popup.add(temp); - temp = remove(selection); - if (temp != null) - popup.add(temp); - temp = reset(selection); - if (temp != null) - popup.add(temp); - temp = rename(selection); - if (temp != null) - popup.add(temp); - temp = newParent(selection); - if (temp != null) - popup.add(temp); - temp = newChild(selection); - if (temp != null) - popup.add(temp); - temp = newSummarize(selection); - if (temp != null) - popup.add(temp); - // gary just remove this for now - - AListProcessor[] listProcessors = eventManager.getCurrentEvent().getData(); - - for (int i = 0; i < listProcessors.length; i++) - { - Action[] actions = listProcessors[i].getActions(selection); - for (int j = 0; j < actions.length; ++j) - { - popup.add(actions[j]); - } - } - - popup.show(e.getComponent(), e.getX(), e.getY()); - - } - - public void mouseMoved(MouseEvent e) - {} - - public void mouseDragged(MouseEvent e) - { - // start of drag - if (!draging) - { - if (source != null && isDragSource(source)) - draging = true; - } - update(e); - } - - public void mouseReleased(MouseEvent e) - { - // DnD event - if (draging && source != null) - { - DefaultMutableTreeNode destination = getNode(e.getPoint()); - if (destination != null && source != destination && destination.getAllowsChildren() && isValidDrag(source, destination)) - { - if (!e.isControlDown() && source != lastDrawn) - { - dtm.removeNodeFromParent(source); - } - if (source == lastDrawn) - { - DefaultMutableTreeNode copy = new DefaultMutableTreeNode("List " + numLists++); - Enumeration myenum = source.children(); - while (myenum.hasMoreElements()) - { - Object o = ((DefaultMutableTreeNode) (myenum.nextElement())).getUserObject(); - copy.add(new DefaultMutableTreeNode(o, false)); - } - dtm.insertNodeInto(copy, destination, 0); - } - else - dtm.insertNodeInto(source, destination, 0); - expandPath(getPathForLocation(e.getX(), e.getY())); - ACanvas.getCanvas().repaintAllFromScratch(); - } - } - draging = false; - source = null; - setCursor(ACursorFactory.getInstance().getDefaultCursor()); - } - - private boolean isDragSource(DefaultMutableTreeNode source) - { - if (source == null || source == root || source == highlight || source == others || source==mass) - return false; - else - return true; - } - - private boolean isValidDrag(DefaultMutableTreeNode source, DefaultMutableTreeNode destination) - { - if (source == null || destination == null) - return false; - if (source == root || source == highlight || source == others || source == mass) - return false; - if (destination == others) - return false; - if (destination == lastDrawn) - return false; - if (destination == highlight) - { - if (source.getAllowsChildren()) - return false; - if (((AList) (source.getUserObject())).getItems().length != 1) - return false; - if (highlight.getChildCount() != 0) - return false; - } - return true; - } - - private void update(MouseEvent e) - { - if (!draging) - return; - Point point = e.getPoint(); - DefaultMutableTreeNode current = getNode(point); - if (current != null && current.getAllowsChildren() && isValidDrag(source, current)) - { - TreePath p = getPathForLocation(point.x, point.y); - setSelectionPath(p); - if (e.isControlDown()) - { - setCursor(DROP_VALID_COPY); - } - else - { - setCursor(ACursorFactory.getInstance().getDragValidCursor()); - } - } - else - { - setCursor(ACursorFactory.getInstance().getDragInvalidCursor()); - } - } - -} - - -class Summarizer -{ - private A4Vector vector = null; - private double etSum = 0; - - - public Summarizer() - { - vector = new A4Vector(); - - } - - - public String getHeader() - { - StringBuffer sb = new StringBuffer(); - sb.append("\nSummary output:\n"); - sb.append(" "); // 18 spaces - sb.append(" PT "); - sb.append(" ET "); - sb.append(" E "); - sb.append(" M "); - sb.append(" MT "); - sb.append("\n"); - - return sb.toString(); - - } - - - public String addAndGetInfo(A4Vector item, String description) - { - vector.add(item); - etSum += item.getEt(); - StringBuffer sb = new StringBuffer(); - sb.append(description); - sb.append("\n"); - sb.append(" "); // 18 spaces - sb.append(String.format("%7.1f",item.getPt())); - sb.append(String.format("%8.1f",item.getEt())); - sb.append(String.format("%7.1f",item.getE())); - sb.append(String.format("%8.3f",item.getMass())); - sb.append(String.format("%8.1f",item.getMt())); - sb.append("\n"); - - return sb.toString(); - } - - public double getTotalEt() - { - return etSum; - } - - public double getTotalPt() - { - return vector.getPt(); - } - - public double getTotalMt() - { - double et = getTotalEt(); - double pt = getTotalPt(); - return Math.sqrt(et*et - pt*pt); - } - - public String getTotalInfo() - { - StringBuffer sb = new StringBuffer(); - sb.append(String.format("%-18s", "Total")); - sb.append(String.format("%7.1f",getTotalPt())); - sb.append(String.format("%8.1f",getTotalEt())); - sb.append(String.format("%7.1f",vector.getE())); - sb.append(String.format("%8.3f",vector.getMass())); - sb.append(String.format("%8.1f",getTotalMt())); - sb.append("\n"); - - return sb.toString(); - - } - -} - diff --git a/graphics/AtlantisJava/src/atlantis/list/AListProcessor.java b/graphics/AtlantisJava/src/atlantis/list/AListProcessor.java deleted file mode 100755 index 6c58995a4a5ba083a087a5dda7241f287a2de0bb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/list/AListProcessor.java +++ /dev/null @@ -1,10 +0,0 @@ -package atlantis.list; - - -import javax.swing.Action; -import java.util.Collection; - - -public interface AListProcessor { - Action[] getActions(Collection nodes); -} diff --git a/graphics/AtlantisJava/src/atlantis/list/package.html b/graphics/AtlantisJava/src/atlantis/list/package.html deleted file mode 100644 index ca84b937bc7735bb468aa8457f9fddcc1c7e8d7a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/list/package.html +++ /dev/null @@ -1,6 +0,0 @@ -<html> -<head></head> -<body> -<p>Implementation of lists which are used to store event datatypes.</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANAnimInterpolate.java b/graphics/AtlantisJava/src/atlantis/nge/ANAnimInterpolate.java deleted file mode 100644 index 90e0284bc683fdcd7d0c2cf2280b8a6416a6702f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANAnimInterpolate.java +++ /dev/null @@ -1,47 +0,0 @@ -package atlantis.nge; - -/** - * - * @author Adam Davison - */ -public class ANAnimInterpolate extends ANAnimSegment { - - private ANAnimVar m_var; - private double m_t1; - private double m_t2; - private double m_v1; - private double m_v2; - private int m_interp; - - public ANAnimInterpolate(ANAnimVar var, double t1, double t2, - double v1, double v2, int interp) { - m_var = var; - m_t1 = t1; - m_t2 = t2; - m_v1 = v1; - m_v2 = v2; - m_interp = interp; - } - - public void evaluate(double now) { - if (now < m_t1) { return; } - switch(m_interp) { - case (ANAnimationManager.INTERP_LINEAR): - //System.out.println("now: " + now + " m_t1: " + m_t1 + " m_t2: " + m_t2); - double t = (now - m_t1) / (m_t2 - m_t1); - //System.out.println("t: " + t); - m_var.setValue((t * (m_v2 - m_v1)) + m_v1); - break; - } - } - - @Override - public double getStart() { - return m_t1; - } - - @Override - public double getEnd() { - return m_t2; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANAnimSegment.java b/graphics/AtlantisJava/src/atlantis/nge/ANAnimSegment.java deleted file mode 100644 index 6678cade19f608e823c8e2ff17d3cd65c5ab76bc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANAnimSegment.java +++ /dev/null @@ -1,13 +0,0 @@ -package atlantis.nge; - -/** - * - * @author Adam Davison - */ -public abstract class ANAnimSegment { - - public abstract double getStart(); - public abstract double getEnd(); - - public abstract void evaluate(double now); -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANAnimSetProjection.java b/graphics/AtlantisJava/src/atlantis/nge/ANAnimSetProjection.java deleted file mode 100644 index 6ca352555ac03741daf3795e631314ccc7d8a2d6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANAnimSetProjection.java +++ /dev/null @@ -1,38 +0,0 @@ -package atlantis.nge; - -/** - * - * @author Adam Davison - */ -public class ANAnimSetProjection extends ANAnimSegment { - private ANFrameManager m_fm; - private ANProjection m_p; - private double m_when; - - public ANAnimSetProjection(ANFrameManager fm, ANProjection p, double when) { - m_fm = fm; - m_p = p; - m_when = when; - } - - @Override - public void evaluate(double now) { - //System.out.println("Evaluate in SetProjection: " + now); - if (now > m_when) { - //System.out.println("CHANGE!"); - m_fm.setCurrentProjection(m_p); - } - } - - @Override - public double getStart() { - return m_when; - } - - @Override - public double getEnd() { - return m_when; - } - - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANAnimThread.java b/graphics/AtlantisJava/src/atlantis/nge/ANAnimThread.java deleted file mode 100644 index 97185bb17cdebd54d2232e983d2b9a1e0d6c5801..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANAnimThread.java +++ /dev/null @@ -1,67 +0,0 @@ -package atlantis.nge; - -import atlantis.canvas.AWindow; -import atlantis.utils.ALogger; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author Adam Davison - */ -public class ANAnimThread implements Runnable { - - private static ALogger logger = ALogger.getLogger(ANAnimThread.class); - private ANAnimationManager m_am; - private Object m_wait = new Object(); - private AWindow m_w; - - public ANAnimThread(ANAnimationManager am, AWindow w) { - m_am = am; - m_w = w; - } - - public void reschedule() { - //System.out.println("Rescheduling"); - synchronized (m_wait) { - m_wait.notifyAll(); - } - //System.out.println("Rescheduled"); - } - - public void run() { - while (true) { - double wait = m_am.timeToWait(); - - //System.out.println("Told to wait: " + wait); - - double mintime = 1.0 / 100.0; - - if (wait == -1.0) { - // wait forever - synchronized (m_wait) { - try { - m_wait.wait(); - } catch (InterruptedException ex) { - logger.error("Interrupted in sleep", ex); - } - } - } else if (wait > mintime) { - // wait until we're supposed to do something - synchronized (m_wait) { - try { - m_wait.wait((long) (wait * 1000)); - } catch (InterruptedException ex) { - logger.error("Interrupted in sleep", ex); - } - } - } else { - // do something now - //System.out.println("Forcing Repaint!"); - m_w.invalidateQuietly(); - //m_w.getView().paintImmediately(0, 0, m_w.getWidth(), m_w.getHeight()); - m_w.repaint(); - } - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANAnimVar.java b/graphics/AtlantisJava/src/atlantis/nge/ANAnimVar.java deleted file mode 100644 index 2dd5c9c9b3820c3c96b06689abc86eefb2f2c8ae..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANAnimVar.java +++ /dev/null @@ -1,27 +0,0 @@ -package atlantis.nge; - -/** - * A variable which is animatable, pretty much a wrapper around a double... - * - * @author Adam Davison - */ -public class ANAnimVar { - - private double m_val; - - public ANAnimVar(double val) { - m_val = val; - } - - public ANAnimVar() { - m_val = 0.0; - } - - public double getValue() { - return m_val; - } - - public void setValue(double val) { - m_val = val; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANAnimationManager.java b/graphics/AtlantisJava/src/atlantis/nge/ANAnimationManager.java deleted file mode 100644 index a4d7e3fe0c88df0545067be165b30d0240725e5c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANAnimationManager.java +++ /dev/null @@ -1,92 +0,0 @@ -package atlantis.nge; - -import atlantis.canvas.AWindow; -import java.util.ArrayList; -import java.util.Iterator; - -/** - * - * @author Adam Davison - */ -public class ANAnimationManager { - - public static final int INTERP_LINEAR = 1; - private ArrayList<ANAnimSegment> m_segs; - private double m_now; - - private ANAnimThread m_at; - - public ANAnimationManager(AWindow w) { - m_segs = new ArrayList<ANAnimSegment>(); - updateNow(); - m_at = new ANAnimThread(this, w); - new Thread(m_at).start(); - } - - public void updateNow() { - m_now = ((double) System.currentTimeMillis()) / 1000.0; - } - - public void scheduleAnimationAbsolute(ANAnimVar v, double t1, double t2, double v1, double v2) { - m_segs.add(new ANAnimInterpolate(v, t1, t2, v1, v2, INTERP_LINEAR)); - m_at.reschedule(); - } - - public void scheduleAnimation(ANAnimVar v, double t1, double t2, double v1, double v2) { - updateNow(); - scheduleAnimationAbsolute(v, t1 + m_now, t2 + m_now, v1, v2); - } - - public void scheduleProjectionChange(ANFrameManager fm, ANProjection p, double t) { - updateNow(); - m_segs.add(new ANAnimSetProjection(fm, p, t + m_now)); - m_at.reschedule(); - } - - public void animate() { - updateNow(); - - //System.out.println("Animating at: " + m_now); - - Iterator<ANAnimSegment> it = m_segs.listIterator(); - while (it.hasNext()) { - ANAnimSegment seg = it.next(); - //System.out.println("Seg: " + seg + " start: " + seg.getStart() + " end: " + seg.getEnd()); - if (seg.getStart() < m_now) { - seg.evaluate(m_now); - } - if (seg.getEnd() < m_now) { - it.remove(); - } - } - } - - public double timeToWait() { - double next = -1.0; - updateNow(); - - //System.out.println("Wait testing at: " + m_now); - - Iterator<ANAnimSegment> it = m_segs.listIterator(); - while (it.hasNext()) { - ANAnimSegment seg = it.next(); - //System.out.println("Seg: " + seg + " start: " + seg.getStart() + " end: " + seg.getEnd()); - if (seg.getStart() <= next && seg.getEnd() >= next) { - //System.out.println("In segment, returning 0.0"); - return 0.0; - } else if (seg.getStart() >= next) { - double wait = seg.getStart() - m_now; - if (wait < next || next == -1.0) { - if (wait < 0.0) { - wait = 0.0; - } - next = wait; - } - } - } - - return next; - } -} - - diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANCacheToken.java b/graphics/AtlantisJava/src/atlantis/nge/ANCacheToken.java deleted file mode 100644 index 3ec2fe065ac584cbaf7e5784666efe74ab684253..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANCacheToken.java +++ /dev/null @@ -1,11 +0,0 @@ -package atlantis.nge; - -/** - * - * @author Adam Davison - */ -public class ANCacheToken<T> { - - - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANColor.java b/graphics/AtlantisJava/src/atlantis/nge/ANColor.java deleted file mode 100644 index 87c01543c86add33f888a09d26dcb0184129d89b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANColor.java +++ /dev/null @@ -1,87 +0,0 @@ -package atlantis.nge; - -import atlantis.graphics.colormap.AColorMap; - -import java.awt.Color; - -/** - * A floating point colour class that enforces very little - * - * @author Adam Davison, Mark Stockton - */ -public class ANColor { - - public float r; - public float g; - public float b; - public float a; - - public ANColor(Color c) { - r = ((float) c.getRed()) / 255.0f; - g = ((float) c.getGreen()) / 255.0f; - b = ((float) c.getBlue()) / 255.0f; - a = ((float) c.getAlpha()) / 255.0f; - } - - public ANColor(float _r, float _g, float _b, float _a) { - r = _r; - g = _g; - b = _b; - a = _a; - } - - public ANColor(float _r, float _g, float _b) { - r = _r; - g = _g; - b = _b; - a = 1.0f; - } - - public static ANColor getBGColor() { - return getMapColor(AColorMap.BG); - } - - public static ANColor getMapColor(int index) { - Color bg = AColorMap.getColors()[index]; - - float r = ((float) bg.getRed()) / 255.0f; - float g = ((float) bg.getGreen()) / 255.0f; - float b = ((float) bg.getBlue()) / 255.0f; - - return new ANColor(r, g, b); - } - - public static ANColor getMapColor(int index, float trans) { - Color bg = AColorMap.getColors()[index]; - - float r = ((float) bg.getRed()) / 255.0f; - float g = ((float) bg.getGreen()) / 255.0f; - float b = ((float) bg.getBlue()) / 255.0f; - - return new ANColor(r, g, b, trans); - } - - public void mult(float c) { - r *= c; - g *= c; - b *= c; - if (r < 0.0f) { r = 0.0f; } - if (r > 1.0f) { r = 1.0f; } - if (g < 0.0f) { g = 0.0f; } - if (g > 1.0f) { g = 1.0f; } - if (b < 0.0f) { b = 0.0f; } - if (b > 1.0f) { b = 1.0f; } - } - - public void lighten(float c) { - r = 1.0f - ((1.0f - r)*c); - g = 1.0f - ((1.0f - g)*c); - b = 1.0f - ((1.0f - b)*c); - if (r < 0.0f) { r = 0.0f; } - if (r > 1.0f) { r = 1.0f; } - if (g < 0.0f) { g = 0.0f; } - if (g > 1.0f) { g = 1.0f; } - if (b < 0.0f) { b = 0.0f; } - if (b > 1.0f) { b = 1.0f; } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANFrameManager.java b/graphics/AtlantisJava/src/atlantis/nge/ANFrameManager.java deleted file mode 100644 index adb6cb778c01fd4c1d27cbc9fc0b38a745e4476a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANFrameManager.java +++ /dev/null @@ -1,190 +0,0 @@ -package atlantis.nge; - -import atlantis.canvas.AWindow; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.IntBuffer; -import javax.media.opengl.DebugGL; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.glu.GLU; - -/** - * Decides which projection should be onscreen and in what state. - * Handles animation, performance and probably all sorts of other things. - * - * @author Adam Davison, Mark Stockton - */ -public class ANFrameManager { - - // Targ is what we're aiming to display but proj is what we're really - // displaying, could be the same but could also be some transition into - // targ - - private ANProjection m_targ; - private ANProjection m_proj; - - private ANAnimationManager m_am; - - public ANFrameManager(AWindow w) { - // Default, if not told anything else construct 3d projection - m_proj = null; - m_am = new ANAnimationManager(w); - - } - - public ANPickResult pick(GLAutoDrawable drawable, int w, int h, int x, int y) { - - if (m_proj == null) { return null; } - - long before = System.nanoTime(); - - GL gl = drawable.getGL(); - gl.glViewport(0, 0, w, h); - - GLU glu = new GLU(); - int maxsize = 100000; - - ByteBuffer bb = ByteBuffer.allocateDirect(4*maxsize); - bb.order(ByteOrder.nativeOrder()); - // FIXME: Reuse this object for performance - IntBuffer ib = bb.asIntBuffer(); - gl.glSelectBuffer(maxsize, ib); - gl.glRenderMode(GL.GL_SELECT); - gl.glMatrixMode(GL.GL_PROJECTION); - int[] viewport = new int[4]; - gl.glLoadIdentity(); - gl.glGetIntegerv(GL.GL_VIEWPORT, viewport, 0); - y = h - y; - glu.gluPickMatrix(x - 1, y - 1, 3, 3, viewport, 0); - - ANRenderHints rh = new ANRenderHints(); - rh.setPick(true); - rh.setPickHelper(new ANPickHelper(gl)); - - //gl.glPushName(0); - m_proj.display(drawable, w, h, rh); - //gl.glPopName(); - - int hits = gl.glRenderMode(GL.GL_RENDER); - - System.out.println("HITS: " + hits); - ANSelectionList sl = new ANSelectionList(ib); - //System.out.println("FRONT: " + sl.getFrontID()); - int[] front = sl.getFrontID(); - - ANPickResult ret = null; - - if (front != null) { - int id = front[0]; - System.out.println(id); - int data = front[1]; - System.out.println(data); - ANPickHandler ph = rh.getPickHelper().getPickHandler(id); - System.out.println(ph); - if (ph != null) { - ret = ph.getHitInfo(data); - } - } - - long after = System.nanoTime(); - System.out.println("Pick took: " + (after - before) / 1000); - - System.out.println(ret); - return ret; - } - - public void display(GLAutoDrawable drawable, int w, int h) { - System.out.println("Asked to display!"); - - if (m_proj == null) { return; } - - long before = System.nanoTime(); - - GL gl = new DebugGL(drawable.getGL()); - gl.glViewport(0, 0, w, h); - - m_am.animate(); - - m_proj.display(drawable, w, h, new ANRenderHints()); - - long after = System.nanoTime(); - System.out.println("Frame took: " + (after - before) / 1000); - } - - public double timeToWait() { - return m_am.timeToWait(); - } - - public ANProjection getTargetProjection() { - return m_targ; - } - - public ANProjection getCurrentProjection() { - return m_proj; - } - - public void setCurrentProjection(ANProjection proj) { - m_proj = proj; - } - - public void scheduleTransition(ANProjection p) { - //(new Exception()).printStackTrace(); - - m_targ = p; - - if (m_proj == null || m_proj == p) { m_proj = p; return; } - - //System.out.println(m_proj); - //System.out.println(p); - - if (m_proj instanceof ANLinearProjection && - p instanceof ANLinearProjection) { - - //System.out.println("HERE!"); - - ANLinearTransition trans = new ANLinearTransition( - (ANLinearProjection) m_proj, - (ANLinearProjection) p); - - setCurrentProjection(trans); - - double length = 1.0; - - m_am.scheduleAnimation(trans.getTransformTimeVar(), 0.0, length, 0.0, 1.0); - m_am.scheduleAnimation(trans.getFadeTimeVar(), 0.0, length, 0.0, 1.0); - m_am.scheduleProjectionChange(this, p, length); - - } else { - m_proj = p; - } - } - - public void checkProjectionYX() { - //System.out.println("checkProjectionYX: m_proj: " + m_proj); - if (!(m_targ instanceof ANProjectionYX)) { - //System.out.println("RECREATING"); - scheduleTransition(new ANProjectionYX()); - } - } - - public void checkProjection3D() { - if (!(m_targ instanceof ANProjection3D)) { - scheduleTransition(new ANProjection3D()); - } - } - - public ANProjectionPhysics checkProjectionPhysics() { - if (!(m_targ instanceof ANProjectionPhysics)) { - ANProjectionPhysics pp = new ANProjectionPhysics(); - scheduleTransition(pp); - return pp; - } else { - return (ANProjectionPhysics)(m_targ); - } - } - - public ANAnimationManager getAnimationManager() { - return m_am; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANGlobalFlags.java b/graphics/AtlantisJava/src/atlantis/nge/ANGlobalFlags.java deleted file mode 100644 index 5a96788eafa1abc75e91b4e080aad18742eae1fc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANGlobalFlags.java +++ /dev/null @@ -1,17 +0,0 @@ -package atlantis.nge; - -/** - * This class contains some static final boolean flags that can be used to - * control behaviour such as debugging and sanity checking. - * - * The java compiler guarantees that code enclosed in an if(var) where var - * is a final and false boolean is entirely excluded from your class file - * - * This is better than just using logger.debug() here because we don't want - * to do the debug level testing inside the fast rendering path - * - * @author Adam Davison - */ -public class ANGlobalFlags { - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANLinearProjection.java b/graphics/AtlantisJava/src/atlantis/nge/ANLinearProjection.java deleted file mode 100644 index c3cda8cb6275aa2f61c456344be92306981730e8..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANLinearProjection.java +++ /dev/null @@ -1,229 +0,0 @@ -package atlantis.nge; - -import atlantis.nge.object.data.ANObjectDataJet; -import atlantis.nge.object.geometry.ANObjectGeomMuon; -import atlantis.nge.object.geometry.ANObjectGeomCalo; -import atlantis.nge.object.data.ANObjectDataCell; -import atlantis.data.ACalorimeterData; -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.data.AJetData; -import atlantis.data.ALArData; -import atlantis.geometry.AAtlasDetector; -import atlantis.geometry.ABarrelCalorimeterDetector; -import atlantis.geometry.ABoxDetector; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.geometry.ADetector; -import atlantis.geometry.ADetectors; -import atlantis.geometry.AEndcapCalorimeterDetector; -import atlantis.geometry.AEndcapCryostatDetector; -import atlantis.utils.AMath; - -import java.util.ArrayList; - -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; - -/** - * This class represents projections which are a linear transformation on - * 3d space. These are easy to handle for a variety of reasons - * - * @author Adam Davison, Mark Stockton - */ -public abstract class ANLinearProjection extends ANProjection { - - // DEPRECATED - public ANObjectGeomMuon m_ogm;//muon - public ANObjectGeomCalo m_ogc;//calo barrel - public ANObjectGeomCalo m_ogetp;//extended tile +z - public ANObjectGeomCalo m_ogtsp;//mbts +z - public ANObjectGeomCalo m_ogecp;//endcap +z - public ANObjectGeomCalo m_ogetm;//extended tile -z - public ANObjectGeomCalo m_ogtsm;//mbts -z - public ANObjectGeomCalo m_ogecm;//endcap -z - - public ANObjectDataJet m_jet;//jets - public ANObjectDataCell m_lar;//lar cells - - private static AEventManager eventManager = AEventManager.instance(); - - /** - * The contract of applyLinearTransform is that you can assume - * the matrix stack is in an identity state and you should always apply - * the transformation in a relative manner, ie glTransform, glRotate - * nothing like glLoadMatrix or glLoadIdentity - * - * @param drawable - */ - public abstract void applyLinearTransform(GLAutoDrawable drawable, int w, int h); - - public abstract void drawScene(GLAutoDrawable drawable, ANRenderHints hint); - - // TODO: A lot of this function should probably be broken up into more - // subclasses to allow this functionality to be selected more - // granularly - @Override - public final void display(GLAutoDrawable drawable, int w, int h, ANRenderHints hint) { - GL gl = drawable.getGL(); - gl.glMatrixMode(GL.GL_MODELVIEW); - gl.glLoadIdentity(); - - gl.glMatrixMode(GL.GL_PROJECTION); - - // This is a bit of a hack maybe... - if (!hint.getPick()) { - gl.glLoadIdentity(); - } - - gl.glEnable(gl.GL_BLEND); - gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA); - gl.glEnable(GL.GL_DEPTH_TEST); - - gl.glPolygonOffset(2.0f, 1.0f); - gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); - - applyLinearTransform(drawable, w, h); - - ANColor bg = ANColor.getBGColor(); - - gl.glClearColor(bg.r, bg.g, bg.b, 1.0f); - gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT); - - drawScene(drawable, hint); - } // Some function that calls applyLinearTransform and extracts the matrix - // is needed for the transitions but that can come later... - - - // DEPRECATED - to be replaced shortly by ANObjectGenerator - public final void createGeometry(){ - ArrayList<ABoxDetector> m_boxes = new ArrayList<ABoxDetector>(); - ArrayList<ACalorimeterDetector> m_calo = new ArrayList<ACalorimeterDetector>(); - ArrayList<ACalorimeterDetector> m_extt = new ArrayList<ACalorimeterDetector>(); - ArrayList<ACalorimeterDetector> m_mbts = new ArrayList<ACalorimeterDetector>(); - ArrayList<ACalorimeterDetector> m_endc = new ArrayList<ACalorimeterDetector>(); - - ADetectors[] ds = AAtlasDetector.getDetector().getDetectors(); - for (int i = 0; i < ds.length; i++) { - ADetector[] d = ds[i].getDetectors(); - for (int j = 0; j < d.length; j++) { - if (d[j] instanceof ABoxDetector) { - ABoxDetector bd = (ABoxDetector) d[j]; - //TODO temporary code to show cut away detector - //if((bd.getPhi()>1.2 && bd.getPhi()<5.1) || !ACanvas.getCanvas().getPaintingWindow().getProjection().getName().equals("N3D")) - m_boxes.add(bd); - }else if (d[j] instanceof ABarrelCalorimeterDetector) { - ACalorimeterDetector cd = (ACalorimeterDetector) d[j]; - //extended tile only has one end in geom file and not relicated like others - if(d[j].getName().equals("Extended TILE")){ - m_extt.add(cd); - }else{ - m_calo.add(cd); - } - - } else if (d[j] instanceof AEndcapCryostatDetector) { - //adds MBTS but only has one end in geom file - AEndcapCryostatDetector ecd = (AEndcapCryostatDetector) d[j]; - m_mbts.add(ecd); - } else if (d[j] instanceof AEndcapCalorimeterDetector) { - //adds LAr endcap + HEC but only has one end in geom file - AEndcapCalorimeterDetector ecd = (AEndcapCalorimeterDetector) d[j]; - m_endc.add(ecd); - - } - - } - } - - m_ogm = new ANObjectGeomMuon(m_boxes); - m_ogc = new ANObjectGeomCalo(m_calo, 4, false); - m_ogetp = new ANObjectGeomCalo(m_extt, 4, false); - m_ogtsp = new ANObjectGeomCalo(m_mbts, 1, false); - m_ogecp = new ANObjectGeomCalo(m_endc, 1, false); - m_ogetm = new ANObjectGeomCalo(m_extt, 4, true); - m_ogtsm = new ANObjectGeomCalo(m_mbts, 1, true); - m_ogecm = new ANObjectGeomCalo(m_endc, 1, true); - - - } - - // DEPRECATED - to be replaced shortly by ANObjectGenerator - public final void createData(){ - - AEvent ev = eventManager.getCurrentEvent(); - AJetData ajd = ev.getJetData(); - ajd.makeDrawList(); - m_jet = new ANObjectDataJet(ajd); - - ALArData ald = ev.getLArData(); - ald.makeDrawList(); - m_lar = new ANObjectDataCell(ald); - - } - - // DEPRECATED - to be replaced shortly by ANObjectGenerator - public final void createGeometry(float phi, float eta, float dr){ - ArrayList<ABoxDetector> m_boxes = new ArrayList<ABoxDetector>(); - ArrayList<ACalorimeterDetector> m_calo = new ArrayList<ACalorimeterDetector>(); - ArrayList<ACalorimeterDetector> m_extt = new ArrayList<ACalorimeterDetector>(); - ArrayList<ACalorimeterDetector> m_mbts = new ArrayList<ACalorimeterDetector>(); - ArrayList<ACalorimeterDetector> m_endc = new ArrayList<ACalorimeterDetector>(); - - - ADetectors[] ds = AAtlasDetector.getDetector().getDetectors(); - for (int i = 0; i < ds.length; i++) { - ADetector[] d = ds[i].getDetectors(); - for (int j = 0; j < d.length; j++) { - if (d[j] instanceof ABoxDetector) { - ABoxDetector bd = (ABoxDetector) d[j]; - //code to show cut away detector - float etabd = (float) AMath.etaAbs(bd.getZMin(), bd.getRMin()); - if(AMath.deltaR(phi,eta,(float)bd.getPhi(),etabd)<dr) - m_boxes.add(bd); - }else if (d[j] instanceof ABarrelCalorimeterDetector) { - ACalorimeterDetector cd = (ACalorimeterDetector) d[j]; - //extended tile only has one end in geom file and not relicated like others - if(d[j].getName().equals("Extended TILE")){ - m_extt.add(cd); - }else{ - m_calo.add(cd); - } - - } else if (d[j] instanceof AEndcapCryostatDetector) { - //adds MBTS but only has one end in geom file - AEndcapCryostatDetector ecd = (AEndcapCryostatDetector) d[j]; - m_mbts.add(ecd); - } else if (d[j] instanceof AEndcapCalorimeterDetector) { - //adds LAr endcap + HEC but only has one end in geom file - AEndcapCalorimeterDetector ecd = (AEndcapCalorimeterDetector) d[j]; - m_endc.add(ecd); - - } - - } - } - - m_ogm = new ANObjectGeomMuon(m_boxes); - m_ogc = new ANObjectGeomCalo(m_calo, 4, false); - m_ogetp = new ANObjectGeomCalo(m_extt, 4, false); - m_ogtsp = new ANObjectGeomCalo(m_mbts, 1, false); - m_ogecp = new ANObjectGeomCalo(m_endc, 1, false); - m_ogetm = new ANObjectGeomCalo(m_extt, 4, true); - m_ogtsm = new ANObjectGeomCalo(m_mbts, 1, true); - m_ogecm = new ANObjectGeomCalo(m_endc, 1, true); - - - } - - public final void createData(float phi, float eta, float dr){ - - AEvent ev = eventManager.getCurrentEvent(); - AJetData ajd = ev.getJetData(); - ajd.makeDrawList(); - m_jet = new ANObjectDataJet(ajd, phi, eta, dr); - - ALArData ald = ev.getLArData(); - ald.makeDrawList(); - m_lar = new ANObjectDataCell((ACalorimeterData)ald, phi, eta, dr); - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANLinearTransition.java b/graphics/AtlantisJava/src/atlantis/nge/ANLinearTransition.java deleted file mode 100644 index 918caf427d84710e316dafab966e56ee40f87a5b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANLinearTransition.java +++ /dev/null @@ -1,140 +0,0 @@ -package atlantis.nge; - -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; - -/** - * - * @author Adam Davison - */ -public class ANLinearTransition extends ANLinearProjection { - - private ANLinearProjection m_a; - private ANLinearProjection m_b; - private ANAnimVar m_vtttime = new ANAnimVar(); - private ANAnimVar m_fadetime = new ANAnimVar(); - - public ANLinearTransition(ANLinearProjection a, ANLinearProjection b) { - m_a = a; - m_b = b; - } - - public ANAnimVar getTransformTimeVar() { return m_vtttime; } - public ANAnimVar getFadeTimeVar() { return m_fadetime; } - - @Override - public void applyLinearTransform(GLAutoDrawable drawable, int w, int h) { - GL gl = drawable.getGL(); - - double vtttime = m_vtttime.getValue(); - - if (vtttime < 0.0) { vtttime = 0.0; } - - if (vtttime <= 0.0f) { - m_a.applyLinearTransform(drawable, w, h); - } else if (vtttime >= 1.0f) { - m_b.applyLinearTransform(drawable, w, h); - } else { - - float[] ma = new float[16]; - float[] mb = new float[16]; - - // TODO: Make this whole thing better - // Maybe this is ok. If getFloatv is problematic we may have trouble - // but generally this allows us to transform between moving projections! - gl.glMatrixMode(GL.GL_PROJECTION); - gl.glPushMatrix(); - gl.glLoadIdentity(); - m_a.applyLinearTransform(drawable, w, h); - gl.glGetFloatv(GL.GL_PROJECTION_MATRIX, ma, 0); - gl.glLoadIdentity(); - m_b.applyLinearTransform(drawable, w, h); - gl.glGetFloatv(GL.GL_PROJECTION_MATRIX, mb, 0); - gl.glPopMatrix(); - - float[] matrix = new float[16]; - - // Scaling the matrix linearly means that x/w moves in a highly - // non-linear way, especially where large scale changes in w are - // involved, try to compensate this by using a highly non-linear - // time coordinate - - // Final solution involves inverting the formula for the transformation - // to calculate what time coordinate should be applied to ensure - // linear motion of a test eye coordinate between it's clip - // coordinates under transformation by ma and mb - // Should document the maths at some point for sanity... - - // Operating on normalised time here, length 1 - double[] zerosums = new double[4]; - double[] gradsums = new double[4]; - - for (int y = 0; y < 4; y++) { - zerosums[y] = 0.0f; - gradsums[y] = 0.0f; - for (int x = 0; x < 4; x++) { - zerosums[y] += ma[(4 * x) + y]; - gradsums[y] += mb[(4 * x) + y] - ma[(4 * x) + y]; - } - } - - double w0 = ma[3] + ma[7] + ma[11] + ma[15]; - double wT = mb[3] + mb[7] + mb[11] + mb[15]; - - double[] timeest = new double[3]; - for (int i = 0; i < 3; i++) { - // Target value of coord/w - double c0w = (ma[0 + i] + ma[4 + i] + ma[8 + i] + ma[12 + i]) / w0; - double cTw = (mb[0 + i] + mb[4 + i] + mb[8 + i] + mb[12 + i]) / wT; - // Beta is the target value for this component, this could be - // a non-linear function for smoother transitions - // i.e. something with 0 first derivative at times 0 and 1 - double beta = (c0w + ((cTw - c0w) * vtttime)); - timeest[i] = (zerosums[i] - zerosums[3] * beta) / (gradsums[3] * beta - gradsums[i]); - } - - // They seem to tend to scale similarly at the moment but this - // may fall apart for some really wierd transformation matrix... - // ... just take the mean for now and look out for problems - double meantime = (timeest[0] + timeest[1] + timeest[2]) / 3.0; - - for (int i = 0; i < 16; i++) { - matrix[i] = (float) (ma[i] + ((mb[i] - ma[i]) * meantime)); - } - - gl.glMultMatrixf(matrix, 0); - } - } - - @Override - public void drawScene(GLAutoDrawable drawable, ANRenderHints hint) { - GL gl = drawable.getGL(); - - - - if (m_fadetime.getValue() > 0.0) { - m_a.drawScene(drawable, hint); - - gl.glMatrixMode(GL.GL_PROJECTION); - gl.glPushMatrix(); - gl.glLoadIdentity(); - gl.glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); - ANColor bgc = ANColor.getBGColor(); - gl.glColor4f(bgc.r, bgc.g, bgc.b, (float)(m_fadetime.getValue())); - gl.glDisable(GL.GL_DEPTH_TEST); - gl.glBegin(GL.GL_QUADS); - gl.glVertex3f(-1.0f, -1.0f, 0.0f); - gl.glVertex3f(1.0f, -1.0f, 0.0f); - gl.glVertex3f(1.0f, 1.0f, 0.0f); - gl.glVertex3f(-1.0f, 1.0f, 0.0f); - gl.glEnd(); - // FIXME: Don't always want this back on here potentially - gl.glEnable(GL.GL_DEPTH_TEST); - gl.glPopMatrix(); - gl.glClear(GL.GL_DEPTH_BUFFER_BIT); - } - - m_b.drawScene(drawable, hint); - - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANManager.java b/graphics/AtlantisJava/src/atlantis/nge/ANManager.java deleted file mode 100644 index 0b7350c29e4ef45e1eb2c44d86b5ac2cf9464c7f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANManager.java +++ /dev/null @@ -1,122 +0,0 @@ -package atlantis.nge; - -import atlantis.canvas.AWindow; -import atlantis.utils.ALogger; -import java.util.Hashtable; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.GLPbuffer; - -/** - * This class keeps handy resources for you... - * - * @author Adam Davison - */ -public class ANManager implements GLEventListener { - - private static ALogger logger = ALogger.getLogger(ANManager.class); - private static ANManager manager = new ANManager(); - - public static ANManager getManager() { - return manager; - } - private Hashtable<AWindow, ANFrameManager> m_fms = null; - private GLPbuffer m_buf = null; - private GLEventListener m_gll; - - public ANManager() { - m_fms = new Hashtable<AWindow, ANFrameManager>(); - } - - public ANFrameManager getFrameManager(AWindow w) { - if (w == null) { - return null; - } - ANFrameManager fm = m_fms.get(w); - if (fm == null) { - fm = new ANFrameManager(w); - m_fms.put(w, fm); - } - return fm; - } - - public static int getNextPower2(int v) { - int p = 1; - for (int i = 0; i < 16; i++) { - p *= 2; - if (p >= v) { - return p; - } - } - - logger.warn("Returning non power of 2 buffer size!"); - return v; - } - - public void requestBufferDraw(int w, int h, GLEventListener gll) { - - if (m_buf != null && m_buf.getWidth() >= w && m_buf.getHeight() >= h) { - //System.out.println("BUFFER OK"); - // Do nothing - } else { - //System.out.println("BUFFER CREATE/REPLACE"); - if (m_buf != null) { - m_buf.destroy(); - } - - GLCapabilities pbcap = new GLCapabilities(); - pbcap.setHardwareAccelerated(true); - pbcap.setSampleBuffers(true); - pbcap.setNumSamples(4); - //pbcap.setPbufferRenderToTexture(true); - //pbcap.setDoubleBuffered(false); - - //logger.info("w: " + m_w + " 2: " + getNextPower2(m_w)); - - m_buf = GLDrawableFactory.getFactory().createGLPbuffer(pbcap, null, - getNextPower2(w), getNextPower2(h), null); - - if (m_buf == null) { - logger.error("Got null when trying to create pbuffer!"); - return; - } - - m_buf.addGLEventListener(this); - - logger.info("Created pbuffer w: " + m_buf.getWidth() + " h: " + m_buf.getHeight()); - - if (m_buf.getChosenGLCapabilities() == null) { - logger.warn("Your implementation returns null for pbuffer capabilities..."); - } else { - logger.info("Pbuffer hardware accelleration: " + m_buf.getChosenGLCapabilities().getHardwareAccelerated()); - } - } - - // Set up events to go back to the projection - m_gll = gll; - - //System.out.println("CALLING DISPLAY"); - m_buf.display(); - } - - public void init(GLAutoDrawable arg0) { - m_gll.init(arg0); - } - - public void display(GLAutoDrawable arg0) { - //System.out.println("HIT DISPLAY CALLBACK"); - m_gll.display(arg0); - } - - public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) { - m_gll.reshape(arg0, arg1, arg2, arg3, arg4); - } - - public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) { - m_gll.displayChanged(arg0, arg1, arg2); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANObjectGenerator.java b/graphics/AtlantisJava/src/atlantis/nge/ANObjectGenerator.java deleted file mode 100644 index 260518afd2209c0cf901b459f159ff692d45b9a1..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANObjectGenerator.java +++ /dev/null @@ -1,151 +0,0 @@ -package atlantis.nge; - -import atlantis.event.AEventManager; -import atlantis.data.ACalorimeterData; -import atlantis.event.AEvent; -import atlantis.data.AJetData; -import atlantis.data.ATrackData; -import atlantis.geometry.ABoxDetector; -import atlantis.nge.object.ANObject; -import atlantis.nge.object.ANObjectList; -import atlantis.nge.object.data.ANObjectPointing; -import atlantis.nge.object.data.ANObjectTracks; -import atlantis.nge.object.geometry.ANObjectGeomMuon; -import atlantis.utils.ALogger; -import atlantis.utils.AMath; -import java.nio.IntBuffer; -import java.util.ArrayList; -import java.util.List; - -/** - * These things get arrays of ANObjects out of the Atlantis data store - * - * The general idea is to separate the selection of objects from the way - * they're represented in the projection. But I suspect that'll break down - * - * For now it's a static object but if we ever want to unstatic it then it's - * only accessible via getGenerator() so it should be easy to refactor - * - * A lot of the functionality should one day be pushed back into the detector - * objects themselves - * - * @author Adam Davison - */ -public class ANObjectGenerator { - - private static ALogger logger = ALogger.getLogger(ANObjectGenerator.class); - private static AEventManager eventManager = AEventManager.instance(); - - private static ANObjectGenerator thegenerator = new ANObjectGenerator(); - - private ANObjectGenerator() { - } - - public static ANObjectGenerator getGenerator() { - return thegenerator; - } - - public ANObject getGeometryMuon() { - return new ANObjectGeomMuon(ANTerribleHacks.getMuonDetectors()); - } - - // Ideally change layout of detector stuff so this can be more generic - // not like one search per type, since basically everything has eta/phi - public ANObject getGeometryMuon(float phi, float eta, float dr) { - ArrayList<ABoxDetector> boxes = ANTerribleHacks.getMuonDetectors(); - ArrayList<ABoxDetector> hits = new ArrayList<ABoxDetector>(); - - for (int i = 0; i < boxes.size(); i++) { - ABoxDetector bd = boxes.get(i); - // TODO - This formula is wrong, it's only checking one corner - float etabd = (float) AMath.etaAbs(bd.getZMin(), bd.getRMin()); - if (AMath.deltaR(phi, eta, (float) bd.getPhi(), etabd) < dr) { - hits.add(bd); - } - } - - return new ANObjectGeomMuon(hits); - } - - public ANObject getDataCaloForJet(int j, String key) { - - ANObjectList ol = new ANObjectList(); - - AEvent ev = eventManager.getCurrentEvent(); - AJetData jd = ev.getJetData(); - String assockey = jd.getFullName(); - int[][] assoc = ev.getAssociationManager().get(assockey, key); - if (assoc == null) { return ol; } - if (assoc[j] == null) { return ol; } - int[] dl = new int[assoc[j].length]; - List calolist = ev.getCalorimeters(); - ACalorimeterData calo = null; - for (int i = 0; i < calolist.size(); i++) { - ACalorimeterData tc = (ACalorimeterData)(calolist.get(i)); - if (tc.getName().equals(key)) { - calo = tc; - } - } - if (calo == null) { - logger.error("Requested unavailable calo key!"); - return ol; - } - - calo.makeDrawList(); - int[] calodl = calo.getDrawList(); - - IntBuffer ib = IntBuffer.allocate(assoc[j].length); - for (int i = 0; i < assoc[j].length; i++) { - int id = assoc[j][i]; - int index = calo.getIndexFromId(id); - boolean found = false; - for (int d = 0; d < calo.getNumDraw(); d++) { - if (calodl[d] == index) { - found = true; - } - } - if (found) { - ib.put(index); - } - } - - ol.addObject(new ANObjectPointing(calo, ib.array(), ib.position(), true)); - ol.addObject(new ANObjectPointing(calo, ib.array(), ib.position(), false)); - - return ol; - } - - public ANObject getInDetTracksForJet(int j) { - AEvent ev = eventManager.getCurrentEvent(); - AJetData jd = ev.getJetData(); - int jetid = jd.getIdFromIndex(j); - ATrackData tracks = ev.getTrackData("InDetTrack"); - int[] trackdl = tracks.getDrawList(); - String jetassockey = jd.getFullName(); - String trackassockey = tracks.getName() + tracks.getStoreGateKey(); - int[][] assoc = ev.getAssociationManager().get(trackassockey, jetassockey); - - IntBuffer ib = IntBuffer.allocate(assoc.length); - for (int i = 0; i < assoc.length; i++) { - for (int s = 0; s < assoc[i].length; s++) { - if (assoc[i][s] == jetid) { - boolean display = false; - for (int d = 0; d < trackdl.length; d++) { - if (trackdl[d] == i) { - display = true; - } - } - if (display) {ib.put(i);} - } - } - } - - return new ANObjectTracks(tracks, ib.array()); - } - - public ANObject getInDetTracks() { - AEvent ev = eventManager.getCurrentEvent(); - ATrackData td = ev.getTrackData("InDetTrack"); - return new ANObjectTracks(td); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANPickDrawer.java b/graphics/AtlantisJava/src/atlantis/nge/ANPickDrawer.java deleted file mode 100644 index 938f0a4f37077a8efbe3654c14d58e06845350dc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANPickDrawer.java +++ /dev/null @@ -1,59 +0,0 @@ -package atlantis.nge; - -import atlantis.canvas.AWindow; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLEventListener; - -/** - * - * @author Adam Davison - */ -public class ANPickDrawer implements GLEventListener { - - private AWindow m_window; - private int m_w; - private int m_h; - private int m_x; - private int m_y; - - private ANPickResult m_pr; - private boolean m_pickdone; - - private ANPickListener m_pl; - - public ANPickDrawer(AWindow window, int w, int h, int x, int y, ANPickListener pl) { - m_window = window; - m_w = w; - m_h = h; - m_x = x; - m_y = y; - m_pickdone = false; - m_pl = pl; - } - - public void doPick() { - ANManager.getManager().requestBufferDraw(m_w, m_h, this); - } - - public void init(GLAutoDrawable arg0) { - //throw new UnsupportedOperationException("Not supported yet."); - } - - public void display(GLAutoDrawable arg0) { - m_pr = ANManager.getManager().getFrameManager(m_window).pick(arg0, m_w, m_h, m_x, m_y); - m_pickdone = true; - - if (m_pl != null) { - m_pl.pickCompleted(m_pr); - } - } - - public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) { - //throw new UnsupportedOperationException("Not supported yet."); - } - - public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) { - //throw new UnsupportedOperationException("Not supported yet."); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANPickHandler.java b/graphics/AtlantisJava/src/atlantis/nge/ANPickHandler.java deleted file mode 100644 index baaeb581efe649b4cc1c128e655cbb1b33e603a7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANPickHandler.java +++ /dev/null @@ -1,11 +0,0 @@ -package atlantis.nge; - -/** - * - * @author Adam Davison - */ -public interface ANPickHandler { - - // Turn your 32 bits of data into a result somehow - public ANPickResult getHitInfo(int data); -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANPickHandlerSimple.java b/graphics/AtlantisJava/src/atlantis/nge/ANPickHandlerSimple.java deleted file mode 100644 index 7b1f713e79eb12f3a187b07eee6b090c5fabaeee..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANPickHandlerSimple.java +++ /dev/null @@ -1,19 +0,0 @@ -package atlantis.nge; - -/** - * - * @author Adam Davison - */ -public class ANPickHandlerSimple implements ANPickHandler { - - private String m_name; - - public ANPickHandlerSimple(String name) { - m_name = name; - } - - public ANPickResult getHitInfo(int data) { - return new ANPickResult(m_name); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANPickHelper.java b/graphics/AtlantisJava/src/atlantis/nge/ANPickHelper.java deleted file mode 100644 index e8912acfdf976c95a418ccd388fcb7062275d7f1..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANPickHelper.java +++ /dev/null @@ -1,51 +0,0 @@ -package atlantis.nge; - -import atlantis.nge.object.ANObject; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import javax.media.opengl.GL; - -/** - * - * @author Adam Davison - */ -public class ANPickHelper { - - private ArrayList<ANObject> m_all = new ArrayList<ANObject>(); - private GL m_gl; - - public ANPickHelper(GL gl) { - m_gl = gl; - } - - public ANPickHandler getPickHandler(int id) { - System.out.println(m_all.get(id)); - return m_all.get(id).getPickHandler(); - } - - public int getIndex(ANObject p) { - int id = m_all.indexOf(p); - - if (id == -1) { - m_all.add(p); - id = m_all.indexOf(p); - } - - return id; - } - - // Worry about it being fast much later... - public void startPick(ANObject p, int data) { - startPick(getIndex(p), data); - } - - public void startPick(int pickid, int data) { - m_gl.glPushName(pickid); - m_gl.glPushName(data); - } - - public void endPick() { - m_gl.glPopName(); - m_gl.glPopName(); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANPickListener.java b/graphics/AtlantisJava/src/atlantis/nge/ANPickListener.java deleted file mode 100644 index f7a118143fafc55735cab685523d58376ee08b95..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANPickListener.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package atlantis.nge; - -/** - * - * @author Adam - */ -public interface ANPickListener { - - public void pickCompleted(ANPickResult pr); -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANPickResult.java b/graphics/AtlantisJava/src/atlantis/nge/ANPickResult.java deleted file mode 100644 index d1d05d7efcfa4d170f6b85c88b504e1f8ca1684c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANPickResult.java +++ /dev/null @@ -1,21 +0,0 @@ -package atlantis.nge; - -/** - * This class encapsulates all the information you might want to get out of a - * pick interaction and back into Atlantis - * - * @author Adam Davison - */ -public class ANPickResult { - - private String m_result; - - public ANPickResult(String result) { - m_result = result; - } - - public String getResult() { - return m_result; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANPickResultPrinter.java b/graphics/AtlantisJava/src/atlantis/nge/ANPickResultPrinter.java deleted file mode 100644 index 1b28bd2a45e85adcff8f291f41c8157472ce6cb6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANPickResultPrinter.java +++ /dev/null @@ -1,17 +0,0 @@ -package atlantis.nge; - -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; - -/** - * - * @author Adam Davison - */ -public class ANPickResultPrinter implements ANPickListener { - - public void pickCompleted(ANPickResult pr) { - if (pr != null) { - AOutput.append("Picked: " + pr.getResult() + "\n\n", ALogInterface.PICK); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANProjection.java b/graphics/AtlantisJava/src/atlantis/nge/ANProjection.java deleted file mode 100644 index f49fb76086beab854e0747df783974b1b7e04c9e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANProjection.java +++ /dev/null @@ -1,20 +0,0 @@ -package atlantis.nge; - -import javax.media.opengl.GLAutoDrawable; - -/** - * So this class represents a projection, which in this model is the class - * that decides what objects to draw and how to draw them - * - * It is controlled by the ANFrameManager which tells it what to do. - * - * It shouldn't touch the Atlantis core at all. It gets ANObjects from an - * ANObjectGenerator which is can then render in any order it chooses into a - * renderer it can configure in any way it likes. - * - * @author Adam Davison - */ -public abstract class ANProjection { - - public abstract void display(GLAutoDrawable drawable, int w, int h, ANRenderHints hint); -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANProjection3D.java b/graphics/AtlantisJava/src/atlantis/nge/ANProjection3D.java deleted file mode 100644 index 954f0ead445747dc1e26d811f04662ef1e1961d3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANProjection3D.java +++ /dev/null @@ -1,90 +0,0 @@ -package atlantis.nge; - -import atlantis.nge.object.ANObjectTestAxes; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; - -import atlantis.parameters.APar; - -/** - * The plain 3d projection, simple for debugging - * - * @author Adam Davison, Mark Stockton - */ -public class ANProjection3D extends ANLinearProjection { - - - private float m_phi; - private float m_elev; - private float m_distance; - private float m_tx, m_ty, m_tz; - - public ANProjection3D() { - - m_phi = -45.0f; - m_elev = 20.0f; - m_distance = 3000.0f; - m_tx = 0.0f; - m_ty = 0.0f; - m_tz = 0.0f; - - // create the object generator here - } - - @Override - public void applyLinearTransform(GLAutoDrawable drawable, int width, int height) { - GL gl = drawable.getGL(); - - float w = 1000.0f; - float h = (w * drawable.getHeight()) / drawable.getWidth(); - - gl.glFrustum(-w, w, -h, h, 1000.0f, 10000.0f); - - // Remember, these are in reverse so essentially: - // 0. GL default, start at 0,0,-1 looking at 0,0,0 - // 1. Spin around y axis to give phi - // 2. Spin around x axis to give elevation - // 3. Pull back to give distance - gl.glTranslatef(0.0f, 0.0f, -m_distance); - gl.glRotatef(m_elev, 1.0f, 0.0f, 0.0f); - gl.glRotatef(m_phi, 0.0f, 1.0f, 0.0f); - gl.glTranslatef(-m_tx, -m_ty, -m_tz); - } - - @Override - public void drawScene(GLAutoDrawable drawable, ANRenderHints hint) { - ANRenderer r = new ANRendererBasic(drawable); - if(APar.instance().get("N3D","Axis").getStatus()){ - ANObjectTestAxes ota = new ANObjectTestAxes(); - ota.render(r, hint); - } - - if (m_ogm == null) { - //m_ogm = new ANObjectGeom(); - createGeometry(); - } - - m_ogm.render(r, hint); - m_ogc.render(r, hint); - m_ogetp.render(r, hint); - m_ogecp.render(r, hint); - m_ogtsp.render(r, hint); - m_ogetm.render(r, hint); - m_ogecm.render(r, hint); - m_ogtsm.render(r, hint); - - createData(); - m_jet.render(r, hint); - - } - - public void dPhi(float phi) { - m_phi += phi; - } - - public void dElev(float elev) { - m_elev += elev; - if (m_elev < -90.0f) { m_elev = -90.0f; } - if (m_elev > 90.0f) { m_elev = 90.0f; } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANProjectionPhysics.java b/graphics/AtlantisJava/src/atlantis/nge/ANProjectionPhysics.java deleted file mode 100644 index 47e95f65d9f9c6bdaba958b3d194879104c0c970..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANProjectionPhysics.java +++ /dev/null @@ -1,181 +0,0 @@ -package atlantis.nge; - -import atlantis.event.AData; -import atlantis.data.AJetData; -import atlantis.nge.object.ANObjectTestAxes; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; - -import atlantis.parameters.APar; -import atlantis.utils.A3Vector; -import atlantis.utils.AMath; -import javax.media.opengl.glu.GLU; - -/** - * The plain 3d projection, simple for debugging - * - * @author Adam Davison, Mark Stockton - */ -public class ANProjectionPhysics extends ANLinearProjection { - - private float m_focus_phi; - private float m_focus_eta; - private ANAnimVar m_phi; - private ANAnimVar m_elev; - private float m_distance; - private float m_tx, m_ty, m_tz; - private AData m_data; - private int m_data_index; - - public ANProjectionPhysics() { - - m_focus_phi = 0; - m_focus_eta = 0; - m_phi = new ANAnimVar(-45.0); - m_elev = new ANAnimVar(20.0); - m_distance = 2000.0f; - m_tx = 0.0f; - m_ty = 0.0f; - m_tz = 0.0f; - - - // create the object generator here - } - - @Override - public void applyLinearTransform(GLAutoDrawable drawable, int w, int h) { - GL gl = drawable.getGL(); - - //float w = 1000.0f; - //float h = (w * drawable.getHeight()) / drawable.getWidth(); - - //gl.glFrustum(-w, w, -h, h, 1000.0f, 10000.0f); - GLU glu = new GLU(); - glu.gluPerspective(7.0f, w / h, 200.0f, 10000.0f); - - /*gl.glTranslatef(0.0f, 0.0f, -2000.0f); - gl.glRotatef(m_elev, 1.0f, 0.0f, 0.0f); - gl.glRotatef(m_phi, 0.0f, 1.0f, 0.0f); - gl.glRotatef(m_focus_phi, 0.0f, 0.0f, 1.0f); - gl.glRotatef(-theta, 0.0f, 1.0f, 0.0f); - gl.glTranslatef(0.0f, 0.0f, 500.0f); - gl.glRotatef(theta, 0.0f, 1.0f, 0.0f); - gl.glRotatef(-m_focus_phi, 0.0f, 0.0f, 1.0f);*/ - // Remember, these are in reverse so essentially: - // 0. GL default, start at 0,0,-1 looking at 0,0,0 - // 1. Spin around y axis to give phi - // 2. Spin around x axis to give elevation - // 3. Pull back to give distance - gl.glTranslatef(0.0f, 0.0f, -m_distance); - gl.glRotatef((float) m_elev.getValue(), 1.0f, 0.0f, 0.0f); - gl.glRotatef((float) m_phi.getValue(), 0.0f, 1.0f, 0.0f); - gl.glTranslatef(-m_tx, -m_ty, -m_tz); - - - } - - @Override - public void drawScene(GLAutoDrawable drawable, ANRenderHints hint) { - ANRenderer r = new ANRendererBasic(drawable); - - GL gl = drawable.getGL(); - gl.glColor3f(1.0f, 0.0f, 0.0f); - gl.glPointSize(2.0f); - gl.glBegin(GL.GL_POINTS); - gl.glVertex3f(m_tx, m_ty, m_tz); - gl.glEnd(); - - if (APar.instance().get("NPhysics", "Axis").getStatus()) { - ANObjectTestAxes ota = new ANObjectTestAxes(); - ota.render(r, hint); - } - - //ANObjectGenerator.getGenerator() - // .getGeometryMuon(m_focus_phi, m_focus_eta, 1.0f).render(r, pick); - //.getGeometryMuon().render(r, pick); - - ANObjectGenerator.getGenerator().getDataCaloForJet(m_data_index, "LAr").render(r, hint); - ANObjectGenerator.getGenerator().getDataCaloForJet(m_data_index, "TILE").render(r, hint); - ANObjectGenerator.getGenerator().getDataCaloForJet(m_data_index, "HEC").render(r, hint); - //ANObjectGenerator.getGenerator().getDataCaloForJet(m_data_index, "FCAL").render(r, pick); - ANObjectGenerator.getGenerator().getInDetTracksForJet(m_data_index).render(r, hint); - - //createGeometry(m_focus_phi, m_focus_eta, 1.0f); - //m_ogm.render(r, pick); - /*m_ogc.render(r); - m_ogetp.render(r); - m_ogecp.render(r); - m_ogtsp.render(r); - m_ogetm.render(r); - m_ogecm.render(r); - m_ogtsm.render(r);*/ - - //createData(m_focus_phi, m_focus_eta, 2.0f); - //m_jet.render(r, pick); - //m_lar.render(r, pick); - - } - - public void dPhi(float phi) { - m_phi.setValue(m_phi.getValue() + phi); - } - - public void dElev(float elev) { - m_elev.setValue(m_elev.getValue() + elev); - if (m_elev.getValue() < -90.0) { - m_elev.setValue(-90.0); - } - if (m_elev.getValue() > 90.0) { - m_elev.setValue(90.0); - } - } - - public void lookAt(AJetData jd, int jet_index) { - - m_data = jd; - m_data_index = jet_index; - - A3Vector centre = ANTerribleHacks.getCellCentreLArForJet(jet_index); - m_tx = (float) centre.x; - m_ty = (float) centre.y; - m_tz = (float) centre.z; - - float phi = jd.getPhi(jet_index); - float eta = jd.getEta(jet_index); - - m_focus_phi = phi; - m_focus_eta = eta; - - // m_elev is Spin around y axis to give phi - // m_phi is Spin around x axis to give elevation - float theta = (float) (2.0f * Math.atan(Math.exp(eta))); - theta = (float) Math.toDegrees(theta); - phi = (float) Math.toDegrees(phi); - - //produce coords to try to look perpendicular to jet - //needs improving - if (eta < 0) { - eta = -1; - } else { - eta = 1; - } - float x = (float) (m_distance * Math.cos(phi) * Math.sin(theta)); - float z = (float) (m_distance * Math.cos(theta)); - - float rot = (float) Math.toDegrees(Math.atan(z / x)); - - if (theta < 90) { - m_elev.setValue(eta * -theta); - m_phi.setValue(rot); - } else { - m_elev.setValue(eta * (180. - theta)); - m_phi.setValue(rot - 45.); - } - //actually dont need to set melev - m_elev.setValue(0); - - } - - public ANAnimVar getElevVar() { return m_elev; } - public ANAnimVar getPhiVar() { return m_phi; } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANProjectionYX.java b/graphics/AtlantisJava/src/atlantis/nge/ANProjectionYX.java deleted file mode 100644 index 6ca68b65f10fcac5352239fa6a5c86e7d9f52aa6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANProjectionYX.java +++ /dev/null @@ -1,46 +0,0 @@ -package atlantis.nge; - -import atlantis.nge.object.ANObjectTestAxes; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; - -import atlantis.parameters.APar; - -/** - * - * @author Adam Davison, Mark Stockton - */ -public class ANProjectionYX extends ANLinearProjection { - - - @Override - public void applyLinearTransform(GLAutoDrawable drawable, int w, int h) { - GL gl = drawable.getGL(); - - gl.glMatrixMode(GL.GL_PROJECTION); - float scale = ((float) drawable.getHeight()) / ((float) drawable.getWidth()); - gl.glOrtho(-1500.0f, 1500.0f, -1500.0f * scale, 1500.0f * scale, -100000.0f, 100000.0f); - } - - @Override - public void drawScene(GLAutoDrawable drawable, ANRenderHints hint) { - ANRenderer r = new ANRendererBasic(drawable); - if(APar.instance().get("NYX","Axis").getStatus()){ - ANObjectTestAxes ota = new ANObjectTestAxes(); - ota.render(r, hint); - } - - if (m_ogm == null) { - //m_ogm = new ANObjectGeomMuon(); - createGeometry(); - } - - m_ogm.render(r, hint); - - m_ogc.render(r, hint); - - createData(); - m_jet.render(r, hint); - m_lar.render(r, hint); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANRenderHints.java b/graphics/AtlantisJava/src/atlantis/nge/ANRenderHints.java deleted file mode 100644 index c370fdf3a98a88858b42afcd82b85a52a19bc2c6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANRenderHints.java +++ /dev/null @@ -1,33 +0,0 @@ -package atlantis.nge; - -/** - * - * @author Adam Davison - */ -public class ANRenderHints { - - private boolean pick; - private ANPickHelper pickHelper; - - public ANRenderHints() { - pick = false; - pickHelper = null; - } - - public ANPickHelper getPickHelper() { - return pickHelper; - } - - public void setPickHelper(ANPickHelper pickHelper) { - this.pickHelper = pickHelper; - } - - public boolean getPick() { - return pick; - } - - public void setPick(boolean pick) { - this.pick = pick; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANRenderer.java b/graphics/AtlantisJava/src/atlantis/nge/ANRenderer.java deleted file mode 100644 index 918179874077e496bb43c699271df72ffc26a87c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANRenderer.java +++ /dev/null @@ -1,22 +0,0 @@ -package atlantis.nge; - -/** - * This class provides an interface for drawing into a context of some kind - * essentially it's a drawing API, much like java.awt.Graphics but rather - * tuned towards drawing 3-d objects via OpenGL - * - * @author Adam Davison - */ -public abstract class ANRenderer { - - public abstract void begin(int type); - public abstract void end(); - - public abstract void vertex3f(float x, float y, float z); - public abstract void color3f(float r, float g, float b); - public abstract void color4f(float r, float g, float b, float a); - public abstract void lineWidth(float w); - - public abstract void drawVertices(float[] vert); - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANRendererBasic.java b/graphics/AtlantisJava/src/atlantis/nge/ANRendererBasic.java deleted file mode 100644 index c0895accf3835409fca4a7124436b7ddce56db21..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANRendererBasic.java +++ /dev/null @@ -1,88 +0,0 @@ -package atlantis.nge; - -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.glu.GLU; - -/** - * - * @author Adam Davison - */ -public class ANRendererBasic extends ANRenderer { - - private GLAutoDrawable m_drawable; - private GL m_gl; - - public ANRendererBasic(GLAutoDrawable drawable) { - m_drawable = drawable; - m_gl = drawable.getGL(); - } - - @Override - public void begin(int type) { - m_gl.glBegin(type); - } - - @Override - public void end() { - m_gl.glEnd(); - } - - @Override - public void drawVertices(float[] vert) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void vertex3f(float x, float y, float z) { - // if (m_btesting) { - // doBoundTest(x, y, z); - // } - - m_gl.glVertex3f(x, y, z); - } - - @Override - public void color3f(float r, float g, float b) { - m_gl.glColor3f(r, g, b); - } - - @Override - public void lineWidth(float w) { - m_gl.glLineWidth(w); - } - - @Override - public void color4f(float r, float g, float b, float a) { - m_gl.glColor4f(r, g, b, a); - } - -/* private float[] m_tmat = new float[16]; - private float m_minx; - private float m_maxx; - private float m_miny; - private float m_maxy; - - private boolean m_btesting = false; - - public void beginBoundsTest() { - // This function assumes no new transformations take place - // So bear that in mind... - - m_gl.glGetFloatv(GL.GL_MODELVIEW_MATRIX, m_tmat, 0); - m_minx = Float.MAX_VALUE; - m_maxx = Float.MIN_VALUE; - m_miny = Float.MAX_VALUE; - m_maxy = Float.MIN_VALUE; - - m_btesting = true; - } - - public void stopBoundsTest() { - m_btesting = false; - } - - private void doBoundTest(float x, float y, float z) { - - }*/ -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANSelectionList.java b/graphics/AtlantisJava/src/atlantis/nge/ANSelectionList.java deleted file mode 100644 index 52e404eda2a19dc6ba5916c20840d28732fc3720..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANSelectionList.java +++ /dev/null @@ -1,81 +0,0 @@ -package atlantis.nge; - -import java.nio.IntBuffer; - -/** - * - * @author Adam Davison - */ -public class ANSelectionList { - - private long[] m_zmax; - private long[] m_zmin; - private int[][] m_names; - private int m_ent; - - public ANSelectionList(IntBuffer ib) { - int s = ib.limit(); - // Shortest possible entry is 4 ints long, could two pass to get - // memory requirements right but better to just spend a few bytes - int maxent = s/4; - m_zmax = new long[maxent]; - m_zmin = new long[maxent]; - m_names = new int[maxent][]; - - /*for (int i = 0; i < 20; i++) { - System.out.print(":" + ib.get(i)); - } - System.out.println();*/ - - m_ent = 0; - int pos = 0; - while((pos = processEntry(ib, pos, m_ent)) != -1) { - m_ent++; - } - //System.out.println("Got " + m_ent + " entries in selection list"); - } - - private int processEntry(IntBuffer ib, int pos, int ent) { - //System.out.println("Processing at " + pos + " entry " + ent); - int nn = ib.get(pos); - //System.out.println("nn: " + nn); - if (nn == 0) { - // At the end - return -1; - } - m_zmin[ent] = getUnsigned(ib.get(pos+1)); - m_zmax[ent] = getUnsigned(ib.get(pos+2)); - m_names[ent] = new int[nn]; - for (int i = 0; i < nn; i++) { - m_names[ent][i] = ib.get(pos+3+i); - //System.out.println("Name " + i + " is " + m_names[ent][i]); - } - pos += 3 + nn; - return pos; - } - - public long getUnsigned(int a) { - long b = a; - if (b < 0) { b -= 2L*(long)Integer.MIN_VALUE; } - return b; - } - - public int[] getFrontID() { - int found = -1; - long max = Long.MIN_VALUE; - for (int i = 0; i < m_ent; i++) { - System.out.println(m_zmax[i] + ":" + max); - if (m_zmax[i] > max) { - max = m_zmax[i]; - found = i; - } - } - - System.out.println(found); - if (found == -1) { - return null; - } else { - return m_names[found]; - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANTerribleHacks.java b/graphics/AtlantisJava/src/atlantis/nge/ANTerribleHacks.java deleted file mode 100644 index 1fd1b1c106abe34e2e48bc2b75994b05af164fd5..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANTerribleHacks.java +++ /dev/null @@ -1,119 +0,0 @@ -package atlantis.nge; - -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.data.AJetData; -import atlantis.data.ALArData; -import atlantis.geometry.AAtlasDetector; -import atlantis.geometry.ABarrelCalorimeterDetector; -import atlantis.geometry.ABoxDetector; -import atlantis.geometry.ACalorimeterDetector; -import atlantis.geometry.ADetector; -import atlantis.geometry.ADetectors; -import atlantis.geometry.AEndcapCalorimeterDetector; -import atlantis.geometry.AEndcapCryostatDetector; -import atlantis.utils.A3Vector; -import java.util.ArrayList; - -/** - * This class encapsulates everything that we shouldn't have to do in one place - * - * Mainly it relates to the fact that there's no way to ask the detector - * store for something like the muon geometry only at the moment - * - * One day if we really use this code then we need to add sensible access - * methods like that to the detector store - * - * This class should definitely be deleted one day - * - * @author Adam Davison - */ -public class ANTerribleHacks { - - private static ArrayList<ABoxDetector> m_boxes = null; - private static ArrayList<ACalorimeterDetector> m_calo = null; - private static ArrayList<ACalorimeterDetector> m_extt = null; - private static ArrayList<ACalorimeterDetector> m_mbts = null; - private static ArrayList<ACalorimeterDetector> m_endc = null; - - public static ArrayList<ABoxDetector> getMuonDetectors() { - if (m_boxes == null) { - fillArrays(); - } - return m_boxes; - } - - private static void fillArrays() { - m_boxes = new ArrayList<ABoxDetector>(); - m_calo = new ArrayList<ACalorimeterDetector>(); - m_extt = new ArrayList<ACalorimeterDetector>(); - m_mbts = new ArrayList<ACalorimeterDetector>(); - m_endc = new ArrayList<ACalorimeterDetector>(); - - ADetectors[] ds = AAtlasDetector.getDetector().getDetectors(); - for (int i = 0; i < ds.length; i++) { - ADetector[] d = ds[i].getDetectors(); - for (int j = 0; j < d.length; j++) { - if (d[j] instanceof ABoxDetector) { - ABoxDetector bd = (ABoxDetector) d[j]; - //TODO temporary code to show cut away detector - //if((bd.getPhi()>1.2 && bd.getPhi()<5.1) || !ACanvas.getCanvas().getPaintingWindow().getProjection().getName().equals("N3D")) - m_boxes.add(bd); - } else if (d[j] instanceof ABarrelCalorimeterDetector) { - ACalorimeterDetector cd = (ACalorimeterDetector) d[j]; - //extended tile only has one end in geom file and not relicated like others - if (d[j].getName().equals("Extended TILE")) { - m_extt.add(cd); - } else { - m_calo.add(cd); - } - - } else if (d[j] instanceof AEndcapCryostatDetector) { - //adds MBTS but only has one end in geom file - AEndcapCryostatDetector ecd = (AEndcapCryostatDetector) d[j]; - m_mbts.add(ecd); - } else if (d[j] instanceof AEndcapCalorimeterDetector) { - //adds LAr endcap + HEC but only has one end in geom file - AEndcapCalorimeterDetector ecd = (AEndcapCalorimeterDetector) d[j]; - m_endc.add(ecd); - - } - - } - } - } - - public static A3Vector getCellCentreLArForJet(int j) { - float xsum = 0.0f; - float ysum = 0.0f; - float zsum = 0.0f; - int count = 0; - AEvent ev = AEventManager.instance().getCurrentEvent(); - AJetData jd = ev.getJetData(); - String assockey = jd.getFullName(); - int[][] assoc = ev.getAssociationManager().get(assockey, "LAr"); - int[] dl = new int[assoc[j].length]; - ALArData calo = ev.getLArData(); - for (int i = 0; i < assoc[j].length; i++) { - int index = calo.getIndexFromId(assoc[j][i]); - float eta = (float) (calo.getEta(index)); - - float theta = (float) (2.0f * Math.atan(Math.exp(-eta))); - - float phi = (float) (calo.getPhi(index)); - - float rmin = (float) calo.getDetector(index).getRMin(); - float rmax = (float) calo.getDetector(index).getRMax(); - float r = 0.5f * (rmin + rmax); - - xsum += (float) (r * Math.cos(phi)); - ysum += (float) (r * Math.sin(phi)); - zsum += (float) (r / Math.tan(theta)); - count++; - } - - - - return new A3Vector(xsum / count, ysum / count, zsum / count); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/ANTestWindow.java b/graphics/AtlantisJava/src/atlantis/nge/ANTestWindow.java deleted file mode 100644 index f4340ca844e6ede6573e1a88f161c11aced3bb63..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/ANTestWindow.java +++ /dev/null @@ -1,119 +0,0 @@ -package atlantis.nge; - -import com.sun.opengl.util.Screenshot; -import java.awt.Graphics; -import java.awt.image.BufferedImage; -import java.util.Random; -import javax.media.opengl.GL; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.GLPbuffer; -import javax.swing.JComponent; -import javax.swing.JFrame; - -/** - * The ubiquitous test window class... - * - * @author Adam Davison - */ -public class ANTestWindow implements GLEventListener { - - private Random m_r = new Random(); - - private int m_h = 400; - private int m_w = 400; - - private JFrame m_f; - private BufferedImage m_img; - - private ANFrameManager m_fm; - - private GLPbuffer m_context; - - public ANTestWindow() { - m_f = new JFrame("Happy Time!"); - m_f.setBounds(100, 100, m_w, m_h); - - TestComponent tc = new TestComponent(this); - - m_f.add(tc); - - GLCapabilities pbcap = new GLCapabilities(); - pbcap.setSampleBuffers(true); - pbcap.setNumSamples(4); - //pbcap.setPbufferRenderToTexture(true); - //pbcap.setDoubleBuffered(false); - m_context = GLDrawableFactory.getFactory().createGLPbuffer(pbcap, null, m_w, m_h, null); - m_context.addGLEventListener(this); - - m_fm = new ANFrameManager(null); - - m_f.setVisible(true); - - //(new Thread(new TimingThread(tc))).start(); - } - - public void causeRepaint(Graphics g) { - m_context.display(); - g.drawImage(m_img, 0, 0, null); - } - - public void init(GLAutoDrawable arg0) { - } - - public void display(GLAutoDrawable arg0) { - //m_fm.display(arg0); - m_img = Screenshot.readToBufferedImage(m_w, m_h); - } - - public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) { - } - - public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) { - throw new UnsupportedOperationException("Not supported yet."); - } - -} - -class TestComponent extends JComponent { - private ANTestWindow m_parent; - - public TestComponent(ANTestWindow parent) { - m_parent = parent; - } - - @Override - protected void paintComponent(Graphics g) { - m_parent.causeRepaint(g); - } - -} - -class TimingThread implements Runnable { - private JComponent m_parent; - - private long m_sum; - private int m_count; - - public TimingThread(JComponent parent) { - m_parent = parent; - } - - public void run() { - m_sum = 0; - m_count = 0; - try { - Thread.sleep(5000); - } catch (Exception e) {} - for (int i = 0; i < 100; i++) { - long before = System.nanoTime(); - m_parent.paintImmediately(0, 0, m_parent.getWidth(), m_parent.getHeight()); - long after = System.nanoTime(); - m_sum += after - before; - m_count++; - } - System.out.println("Mean time: " + m_sum/m_count + "ns"); - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/ANObject.java b/graphics/AtlantisJava/src/atlantis/nge/object/ANObject.java deleted file mode 100644 index 944c3c461b9c0d8d84be558fead68cafb2d2c30f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/ANObject.java +++ /dev/null @@ -1,27 +0,0 @@ -package atlantis.nge.object; - -import atlantis.nge.*; - -/** - * An ANObject is the superclass of anything which knows how to draw itself - * using an ANRenderer - * - * Specifically these will tend to represent some kind of visual onscreen - * element and will contain all the information required to draw the - * representation - * - * @author Adam Davison - */ -public abstract class ANObject { - - public abstract void render(ANRenderer r, ANRenderHints hint); - - private ANPickHandler m_ph = null; - protected void setPickHandler(ANPickHandler ph) { - m_ph = ph; - } - - public ANPickHandler getPickHandler() { - return m_ph; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectList.java b/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectList.java deleted file mode 100644 index 7e79f7f10e5d9f3e83183d710306836b1568c4b6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectList.java +++ /dev/null @@ -1,30 +0,0 @@ -package atlantis.nge.object; - -import atlantis.nge.ANRenderHints; -import atlantis.nge.ANRenderer; -import java.util.ArrayList; - -/** - * A composite object, of course these can be nested to make trees of objects - * - * @author Adam Davison - */ -public class ANObjectList extends ANObject { - - private ArrayList<ANObject> m_list; - - public ANObjectList() { - m_list = new ArrayList<ANObject>(); - } - - public void addObject(ANObject o) { - m_list.add(o); - } - - public void render(ANRenderer r, ANRenderHints hint) { - for (int i = 0; i < m_list.size(); i++) { - m_list.get(i).render(r, hint); - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectTestAxes.java b/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectTestAxes.java deleted file mode 100644 index c32ad4e2fec9157c21b2d241778fdcdbe049508e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectTestAxes.java +++ /dev/null @@ -1,44 +0,0 @@ -package atlantis.nge.object; - -import atlantis.nge.*; -import javax.media.opengl.GL; - -/** - * A simple test object - * - * @author Adam Davison, Mark Stockton - */ -public class ANObjectTestAxes extends ANObject { - - public ANObjectTestAxes() { - - } - - @Override - public void render(ANRenderer r, ANRenderHints hint) { - - r.lineWidth(2.0f); - - // x - r.color3f(1.0f, 0.0f, 0.0f); - r.begin(GL.GL_LINES); - r.vertex3f(0.0f, 0.0f, 0.0f); - r.vertex3f(1500.0f, 0.0f, 0.0f); - r.end(); - - // y - r.color3f(0.0f, 1.0f, 0.0f); - r.begin(GL.GL_LINES); - r.vertex3f(0.0f, 0.0f, 0.0f); - r.vertex3f(0.0f, 1500.0f, 0.0f); - r.end(); - - // z - r.color3f(0.0f, 0.0f, 1.0f); - r.begin(GL.GL_LINES); - r.vertex3f(0.0f, 0.0f, 0.0f); - r.vertex3f(0.0f, 0.0f, 1500.0f); - r.end(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectVL.java b/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectVL.java deleted file mode 100644 index 091ac5ffb58a2a01ffe409c233e8a5d3372cd37b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/ANObjectVL.java +++ /dev/null @@ -1,66 +0,0 @@ -package atlantis.nge.object; - -import atlantis.nge.*; - -/** - * An object which draws from a vertex list - * - * @author Adam Davison - */ -public abstract class ANObjectVL extends ANObject { - - public abstract float[][] getVertices(); - - public abstract int[] getPrimTypes(); - - // What the hell is this? - public final int DRAW_LINE=-9; - - public ANColor getColor(int i) { - return new ANColor(1.0f, 0.0f, 0.0f, 1.0f); - } - - /** - * This function is like the software equivalent of just dumping a block - * of vertex information in GL 3.1... - * @param r - * @param hint - */ - @Override - public void render(ANRenderer r, ANRenderHints hint) { - r.lineWidth(1.5f); - - int pid = -1; - ANPickHelper ph = null; - if (hint.getPick()) { - ph = hint.getPickHelper(); - pid = ph.getIndex(this); - } - - int[] pt = getPrimTypes(); - float[][] v = getVertices(); - - if (pt == null) { - return; - } - - for (int i = 0; i < pt.length; i++) { - if (hint.getPick()) { - ph.startPick(pid, i); - } - - ANColor c = getColor(i); - r.color4f(c.r, c.g, c.b, c.a); - r.begin(pt[i]); - for (int j = 0; j < v[i].length; j+=3) { - r.vertex3f(v[i][j], v[i][j+1], v[i][j+2]); - } - r.end(); - - if (hint.getPick()) { - ph.endPick(); - } - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectDataCell.java b/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectDataCell.java deleted file mode 100644 index 410ea527370b5bddda735d7bd8b97c13cee137fb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectDataCell.java +++ /dev/null @@ -1,170 +0,0 @@ -package atlantis.nge.object.data; - -import atlantis.nge.object.*; -import atlantis.nge.*; -import atlantis.data.ACalorimeterData; -import atlantis.geometry.AEndcapCalorimeterDetector; -import atlantis.utils.AMath; - -import javax.media.opengl.GL; - -/** - * Object that draws cells - * - * @author Adam Davison, Mark Stockton - */ -public class ANObjectDataCell extends ANObjectVL { - - private float[][] m_v; - private int[] m_pt; - private int[] m_color; - - public ANObjectDataCell() { - } - - public ANObjectDataCell(ACalorimeterData ald) { - - m_pt = new int[ald.getNumDraw()]; - m_v = new float[ald.getNumDraw()][]; - m_color = new int[ald.getNumDraw()]; - - for (int j = 0; j < ald.getNumDraw(); j++) { - int i = ald.getDrawIndex(j); - - m_pt[j] = GL.GL_TRIANGLE_STRIP; - m_color[j] = ald.getColor(i); - m_v[j] = getVert(ald, i); - - } - } - - public ANObjectDataCell(ACalorimeterData ald, int dl[]) { - - m_pt = new int[dl.length]; - m_v = new float[dl.length][]; - m_color = new int[dl.length]; - - for (int j = 0; j < dl.length; j++) { - int i = dl[j]; - - m_pt[j] = GL.GL_TRIANGLE_STRIP; - m_color[j] = ald.getColor(i); - m_v[j] = getVert(ald, i); - - } - } - - // This logic should be in ANObjectGenerator - public ANObjectDataCell(ACalorimeterData ald, float phi, float eta, float dr) { - - int num = 0; - for (int j = 0; j < ald.getNumDraw(); j++) { - int i = ald.getDrawIndex(j); - if (AMath.deltaR(phi, eta, (float) ald.getPhi(i), (float) ald.getEta(i)) < dr) { - num++; - } - } - - m_pt = new int[num]; - m_v = new float[num][]; - m_color = new int[num]; - num = 0; - for (int j = 0; j < ald.getNumDraw(); j++) { - int i = ald.getDrawIndex(j); - if (AMath.deltaR(phi, eta, (float) ald.getPhi(i), (float) ald.getEta(i)) > dr) { - continue; - } - m_pt[num] = GL.GL_TRIANGLE_STRIP; - m_color[num] = ald.getColor(i); - m_v[num] = getVert(ald, i); - num++; - - } - } - - private float[] getVert(ACalorimeterData ald, int index) { - - float etamin = (float) (ald.getEta(index) - ald.getdEta(index)); - float etamax = (float) (ald.getEta(index) + ald.getdEta(index)); - - float thetamin = (float) (2.0f * Math.atan(Math.exp(-etamin))); - float thetamax = (float) (2.0f * Math.atan(Math.exp(-etamax))); - - float phimin = (float) (ald.getPhi(index) - ald.getdPhi(index)); - float phimax = (float) (ald.getPhi(index) + ald.getdPhi(index)); - - float rmin = (float) ald.getDetector(index).getRMin(); - float rmax = (float) ald.getDetector(index).getRMax(); - - // TODO: Push this up to the getZ??? functions in this detector - // class. - if (ald.getDetector(index) instanceof AEndcapCalorimeterDetector) { - //correction taken from AEndcapCalorimeterDetector - String name = ald.getDetector(index).getName(); - float zmin = (float) (ald.getDetector(index).getZMin()); - //This shouldn't be 0, but just to be on the safe side. - int side = ald.getSide(index); - if (side != 0) { - side /= Math.abs(side); - } - zmin *= side; - if (name.indexOf("Inner") >= 0 || name.indexOf("Outer") >= 0 || name.indexOf("Presampler") >= 0) { - rmax = (float) (zmin / Math.sinh(etamin)); - } - rmin = (float) (zmin / Math.sinh(etamax)); - } - - float[][] v = new float[8][3]; - - fillVert(v[0], rmin, thetamin, phimin); - fillVert(v[1], rmin, thetamax, phimin); - fillVert(v[2], rmax, thetamax, phimin); - fillVert(v[3], rmax, thetamin, phimin); - fillVert(v[4], rmin, thetamin, phimax); - fillVert(v[5], rmin, thetamax, phimax); - fillVert(v[6], rmax, thetamax, phimax); - fillVert(v[7], rmax, thetamin, phimax); - - float[] vert = new float[3 * 14]; - int[] wind = {6, 5, 7, 4, 0, 5, 1, 2, 0, 3, 7, 2, 6, 5}; - for (int i = 0; i < 14; i++) { - copyVert(v[wind[i]], vert, i); - } - - return vert; - } - - private void copyVert(float[] v, float[] t, int ti) { - t[(ti * 3) + 0] = v[0]; - t[(ti * 3) + 1] = v[1]; - t[(ti * 3) + 2] = v[2]; - - } - - private void fillVert(float[] v, float r, float theta, float phi) { - - v[0] = (float) (r * Math.cos(phi)); - v[1] = (float) (r * Math.sin(phi)); - v[2] = (float) (r / Math.tan(theta)); - } - - @Override - public float[][] getVertices() { - return m_v; - } - - @Override - public int[] getPrimTypes() { - return m_pt; - } - - @Override - public ANColor getColor(int i) { - - if (m_color[i] == DRAW_LINE) { - return new ANColor(0.0f, 0.0f, 0.0f, 1.0f); - } else { - return ANColor.getMapColor(m_color[i]); - } - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectDataJet.java b/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectDataJet.java deleted file mode 100644 index f97774fe95f31a9f9f213af5a90b081a8ee1235f..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectDataJet.java +++ /dev/null @@ -1,146 +0,0 @@ -package atlantis.nge.object.data; - -import atlantis.nge.object.*; -import atlantis.nge.*; -import atlantis.data.AJetData; -import atlantis.utils.AMath; - -import javax.media.opengl.GL; - -/** - * Object that draws geometry of the muon system - * - * @author Adam Davison, Mark Stockton - */ -public class ANObjectDataJet extends ANObjectVL { - - private float[][] m_v; - private int[] m_pt; - private int[] m_color; - - public ANObjectDataJet() { - - } - -public ANObjectDataJet(AJetData ajd) { - - - m_pt = new int[2*ajd.getNumDraw()]; - m_v = new float[2*ajd.getNumDraw()][]; - m_color = new int[2*ajd.getNumDraw()]; - - for (int j = 0; j < ajd.getNumDraw(); j++) { - int i= ajd.getDrawIndex(j); - float theta = (float) (2.0f * Math.atan(Math.exp(-ajd.getEta(i)))); - - m_pt[2*j] = GL.GL_TRIANGLE_FAN; - //m_v[2*j] = getCone(ajd.getET(i), ajd.getPhi(i), theta); - m_v[2*j] = getCone(1300.0f, ajd.getPhi(i), theta); - m_color[2*j]=ajd.getColor(i); - m_pt[2*j+1] = GL.GL_LINES; - //m_v[2*i+1] = getCore(ajd.getET(i), ajd.getPhi(i), theta); - m_v[2*j+1] = getCore(1300.0f, ajd.getPhi(i), theta); - m_color[2*j+1]=DRAW_LINE; - } - } - - public ANObjectDataJet(AJetData ajd, float phi, float eta, float dr) { - - int num=0; - for (int j = 0; j < ajd.getNumDraw(); j++) { - int i= ajd.getDrawIndex(j); - if(AMath.deltaR(phi,eta,(float)ajd.getPhi(i),(float)ajd.getEta(i))<dr){ - num++; - } - } - - m_pt = new int[2*num]; - m_v = new float[2*num][]; - m_color = new int[2*num]; - num=0; - for (int j = 0; j < ajd.getNumDraw(); j++) { - int i= ajd.getDrawIndex(j); - if(AMath.deltaR(phi,eta,(float)ajd.getPhi(i),(float)ajd.getEta(i))>dr) - continue; - float theta = (float) (2.0f * Math.atan(Math.exp(-ajd.getEta(i)))); - - m_pt[2*num] = GL.GL_TRIANGLE_FAN; - //m_v[2*num] = getCone(ajd.getET(i), ajd.getPhi(i), theta); - m_v[2*num] = getCone(1300.0f, ajd.getPhi(i), theta); - m_color[2*num]=ajd.getColor(i); - m_pt[2*num+1] = GL.GL_LINES; - //m_v[2*num+1] = getCore(ajd.getET(i), ajd.getPhi(i), theta); - m_v[2*num+1] = getCore(1300.0f, ajd.getPhi(i), theta); - m_color[2*num+1]=DRAW_LINE; - num++; - } - } - - - - private float[] getCore(float len, float phi, float theta){ - - // Jets are in detector eta so primary vertex set to 0 is sensible for now - float[] core = {0.0f, 0.0f, 0.0f, - (float) (len * Math.cos(phi) * Math.sin(theta)), - (float) (len * Math.sin(phi) * Math.sin(theta)), - (float) (len * Math.cos(theta)) - }; - return core; - } - - private float[] getCone(float len, float phi, float theta){ - int segs = 8; - - float[] cone = new float[3 * (2 + segs)]; - cone[0] = 0.0f; - cone[1] = 0.0f; - cone[2] = 0.0f; - - //temporary jet radius - float jetr = 100.0f; - - for (int i = 0; i < segs; i++) { - float lphi = (float) (i * 2.0f * Math.PI / segs); - float ax = (float) (jetr * Math.cos(lphi)); - float ay = (float) (jetr * Math.sin(lphi)); - float az = len; - - float bx = (float) (ax * Math.cos(phi) * Math.cos(theta) + - az * Math.sin(theta) * Math.cos(phi) - ay * Math.sin(phi)); - float by = (float) (ax * Math.cos(theta) * Math.sin(phi) + - az * Math.sin(theta) * Math.sin(phi) + ay * Math.cos(phi)); - float bz = (float) (-ax * Math.sin(theta) + az * Math.cos(theta)); - - cone[i*3+3] = bx; - cone[i*3+4] = by; - cone[i*3+5] = bz; - } - - cone[(3*(2+segs)) - 3] = cone[3]; - cone[(3*(2+segs)) - 2] = cone[4]; - cone[(3*(2+segs)) - 1] = cone[5]; - - return cone; - } - - @Override - public float[][] getVertices() { - return m_v; - } - - @Override - public int[] getPrimTypes() { - return m_pt; - } - - @Override - public ANColor getColor(int i) { - - if(m_color[i]==DRAW_LINE) - return new ANColor(0.0f, 0.0f, 0.0f, 1.0f); - else - return ANColor.getMapColor(m_color[i], 0.5f); - - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectPointing.java b/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectPointing.java deleted file mode 100644 index 2fddcee1d37211b7c5e1591a23dfb5698514f42d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectPointing.java +++ /dev/null @@ -1,147 +0,0 @@ -package atlantis.nge.object.data; - -import atlantis.data.ACalorimeterData; -import atlantis.data.ATILEData; -import atlantis.geometry.AEndcapCalorimeterDetector; -import atlantis.nge.ANColor; -import atlantis.nge.object.ANObjectVL; -import atlantis.utils.AMath; -import javax.media.opengl.GL; - -/** - * - * @author Adam Davison - */ -public class ANObjectPointing extends ANObjectVL { - - private float[][] m_v; - private int[] m_pt; - private ANColor[] m_c; - - public ANObjectPointing(ACalorimeterData ald, int dl[], int dllen, boolean outline) { - m_pt = new int[dllen]; - m_v = new float[dllen][]; - m_c = new ANColor[dllen]; - - double[] area = new double[dl.length]; - for (int i = 0; i < dllen; i++) { - area[i] = 1.0; - } - - ald.calibrateLocalDensity(dl, area); - double[] scale = ald.getScaleFactors(dl, area); - - if (outline) { - for (int j = 0; j < dllen; j++) { - int i = dl[j]; - m_pt[j] = GL.GL_LINES; - m_c[j] = ANColor.getMapColor(ald.getColor(i)); - m_c[j].mult(0.5f); - m_v[j] = getVert(ald, i, (float)scale[j], true); - //m_v[j] = getVert(ald, i, 1.0f, true); - } - } else { - - for (int j = 0; j < dllen; j++) { - int i = dl[j]; - m_pt[j] = GL.GL_TRIANGLE_STRIP; - m_c[j] = ANColor.getMapColor(ald.getColor(i)); - m_v[j] = getVert(ald, i, (float)scale[j], false); - } - } - - } - - @Override - public float[][] getVertices() { - return m_v; - } - - @Override - public int[] getPrimTypes() { - return m_pt; - } - - @Override - public ANColor getColor(int i) { - return m_c[i]; - } - - private float[] getVert(ACalorimeterData ald, int index, float scale, boolean outline) { - - // Possibly should apply scale to theta not eta? - float etamin = (float) (ald.getEta(index) - 0.5f*scale*ald.getdEta(index)); - float etamax = (float) (ald.getEta(index) + 0.5f*scale*ald.getdEta(index)); - - float thetamin = (float) (2.0f * Math.atan(Math.exp(-etamin))); - float thetamax = (float) (2.0f * Math.atan(Math.exp(-etamax))); - - float phimin = (float) (ald.getPhi(index) - 0.5f*scale*ald.getdPhi(index)); - float phimax = (float) (ald.getPhi(index) + 0.5f*scale*ald.getdPhi(index)); - - float rmin = (float) ald.getDetector(index).getRMin(); - float rmax = (float) ald.getDetector(index).getRMax(); - float dr = 0.5f*(rmax - rmin); - rmin += (1.0f - scale)*dr; - rmax -= (1.0f - scale)*dr; - - // TODO: Push this up to the getZ??? functions in this detector - // class. - if (ald.getDetector(index) instanceof AEndcapCalorimeterDetector) { - //correction taken from AEndcapCalorimeterDetector - String name = ald.getDetector(index).getName(); - float zmin = (float) (ald.getDetector(index).getZMin()); - //This shouldn't be 0, but just to be on the safe side. - int side = ald.getSide(index); - if (side != 0) { - side /= Math.abs(side); - } - zmin *= side; - if (name.indexOf("Inner") >= 0 || name.indexOf("Outer") >= 0 || name.indexOf("Presampler") >= 0) { - rmax = (float) (zmin / Math.sinh(etamin)); - } - rmin = (float) (zmin / Math.sinh(etamax)); - } - - float[][] v = new float[8][3]; - - fillVert(v[0], rmin, thetamin, phimin); - fillVert(v[1], rmin, thetamax, phimin); - fillVert(v[2], rmax, thetamax, phimin); - fillVert(v[3], rmax, thetamin, phimin); - fillVert(v[4], rmin, thetamin, phimax); - fillVert(v[5], rmin, thetamax, phimax); - fillVert(v[6], rmax, thetamax, phimax); - fillVert(v[7], rmax, thetamin, phimax); - - int[] wind = null; - if (!outline) { - int[] inwind = {6, 5, 7, 4, 0, 5, 1, 2, 0, 3, 7, 2, 6, 5}; - wind = inwind; - } else { - int[] outwind = {0, 3, 0, 1, 0, 4, 2, 1, 2, 3, 2, 6, - 7, 4, 7, 6, 7, 3, 5, 6, 5, 4, 5, 1}; - wind = outwind; - } - float[] vert = new float[3 * wind.length]; - for (int i = 0; i < wind.length; i++) { - copyVert(v[wind[i]], vert, i); - } - - return vert; - } - - private void copyVert(float[] v, float[] t, int ti) { - t[(ti * 3) + 0] = v[0]; - t[(ti * 3) + 1] = v[1]; - t[(ti * 3) + 2] = v[2]; - - } - - private void fillVert(float[] v, float r, float theta, float phi) { - - v[0] = (float) (r * Math.cos(phi)); - v[1] = (float) (r * Math.sin(phi)); - v[2] = (float) (r / Math.tan(theta)); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectTracks.java b/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectTracks.java deleted file mode 100644 index f8599c1f12a6d862a10a62e1700e405bdaf8e299..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/data/ANObjectTracks.java +++ /dev/null @@ -1,82 +0,0 @@ -package atlantis.nge.object.data; - -import atlantis.data.ALArData; -import atlantis.data.ATrackData; -import atlantis.nge.ANColor; -import atlantis.nge.object.ANObjectVL; -import javax.media.opengl.GL; - -/** - * - * @author Adam Davison - */ -public class ANObjectTracks extends ANObjectVL { - - private float[][] m_v; - private int[] m_pt; - private int[] m_color; - - public ANObjectTracks(ATrackData td) { - float[][] x = td.getX(); - float[][] y = td.getY(); - float[][] z = td.getZ(); - - m_pt = new int[x.length]; - m_v = new float[x.length][]; - m_color = new int[x.length]; - - for (int i = 0; i < x.length; i++) { - m_pt[i] = GL.GL_LINE_STRIP; - m_v[i] = new float[x[i].length * 3]; - m_color[i] = td.getColor(i); - for (int p = 0; p < x[i].length; p++) { - m_v[i][p * 3] = x[i][p]; - m_v[i][p * 3 + 1] = y[i][p]; - m_v[i][p * 3 + 2] = z[i][p]; - } - } - } - - public ANObjectTracks(ATrackData td, int[] dl) { - float[][] x = td.getX(); - if (x == null) { - System.out.println("ARGH!!"); - m_pt = null; - m_v = null; - m_color = null; - return; - } - float[][] y = td.getY(); - float[][] z = td.getZ(); - - m_pt = new int[dl.length]; - m_v = new float[dl.length][]; - m_color = new int[dl.length]; - - for (int i = 0; i < dl.length; i++) { - m_pt[i] = GL.GL_LINE_STRIP; - int index = td.getIndexFromId(dl[i]); - m_v[i] = new float[x[index].length * 3]; - m_color[i] = td.getColor(index); - for (int p = 0; p < x[index].length; p++) { - m_v[i][p * 3] = x[index][p]; - m_v[i][p * 3 + 1] = y[index][p]; - m_v[i][p * 3 + 2] = z[index][p]; - } - } - } - - @Override - public float[][] getVertices() { - return m_v; - } - - @Override - public int[] getPrimTypes() { - return m_pt; - } - - public ANColor getColor(int i) { - return ANColor.getMapColor(m_color[i]); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectBeamLine.java b/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectBeamLine.java deleted file mode 100644 index ad9d7da77b47279edac2cb61b6885fd0508af8cb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectBeamLine.java +++ /dev/null @@ -1,21 +0,0 @@ -package atlantis.nge.object.geometry; - -import atlantis.nge.object.ANObjectVL; - -/** - * - * @author Adam Davison - */ -public class ANObjectBeamLine extends ANObjectVL { - - @Override - public float[][] getVertices() { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int[] getPrimTypes() { - throw new UnsupportedOperationException("Not supported yet."); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectGeomCalo.java b/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectGeomCalo.java deleted file mode 100644 index 5705182ecc6d12bb27c315ee37ee4da033f09275..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectGeomCalo.java +++ /dev/null @@ -1,159 +0,0 @@ -package atlantis.nge.object.geometry; - -import atlantis.nge.object.*; -import atlantis.nge.*; -import atlantis.geometry.ACalorimeterDetector; - -import java.util.ArrayList; -import javax.media.opengl.GL; - -/** - * Object that draws geometry of the muon system - * - * @author Adam Davison, Mark Stockton - */ -public class ANObjectGeomCalo extends ANObjectVL { - - private float[][] m_v; - private int[] m_pt; - - private int[] m_color; - - public ANObjectGeomCalo(ArrayList<ACalorimeterDetector> m_calo, int nv_scale, boolean duplicate) { - - m_pt = new int[7*m_calo.size()]; - m_v = new float[7*m_calo.size()][]; - m_color = new int[7*m_calo.size()]; - - //all endcaps and extended tile only has one end in geom file and not relicated like others - for (int j = 0; j < m_calo.size(); j++) { - int i=7*j; - ACalorimeterDetector cd = m_calo.get(j); - m_pt[i]=GL.GL_TRIANGLE_STRIP; - m_pt[i+1]=GL.GL_TRIANGLE_STRIP; - m_pt[i+2]=GL.GL_TRIANGLE_STRIP; - m_pt[i+3]=GL.GL_LINE_LOOP; - m_pt[i+4]=GL.GL_LINE_LOOP; - m_pt[i+5]=GL.GL_LINE_LOOP; - m_pt[i+6]=GL.GL_LINE_LOOP; - m_color[i]=cd.getFillColor(); - m_color[i+1]=cd.getFillColor(); - m_color[i+2]=cd.getFillColor(); - m_color[i+3]=DRAW_LINE; - m_color[i+4]=DRAW_LINE; - m_color[i+5]=DRAW_LINE; - m_color[i+6]=DRAW_LINE; - - float zMin=(float) cd.getZMin(); - float zMax=(float) cd.getZMax(); - if(duplicate){ - zMin*=-1.; - zMax*=-1.; - } - m_v[i] = getEndTris(zMin, (float) cd.getRMin(), (float) cd.getRMax(), cd.getNumPhi() / nv_scale); - m_v[i+1] = getEndTris(zMax, (float) cd.getRMin(), (float) cd.getRMax(), cd.getNumPhi() / nv_scale); - m_v[i+2] = getBarrelTris(zMin, zMax, (float) cd.getRMin(), (float) cd.getRMax(), cd.getNumPhi() / nv_scale); - m_v[i+3] = getEdges(zMin, (float) cd.getRMin(), cd.getNumPhi() / nv_scale, true); - m_v[i+4] = getEdges(zMax, (float) cd.getRMin(), cd.getNumPhi() / nv_scale, true); - m_v[i+5] = getEdges(zMin, (float) cd.getRMax(), cd.getNumPhi() / nv_scale, false); - m_v[i+6] = getEdges(zMax, (float) cd.getRMax(), cd.getNumPhi() / nv_scale, false); - } - } - - - private float[] getEdges(float z, float r, int nv, boolean inner) { - float[] v = new float[3 * nv]; - - float dphi = (2 * (float) Math.PI) / nv; - float hdphi = 0.5f * dphi; - //if (inner) { hdphi = 0.0f; } - - for (int i = 0; i < nv; i++) { - int ie = i * 3; - v[ie] = r * (float) Math.cos(i * dphi + hdphi); - v[ie + 1] = r * (float) Math.sin(i * dphi + hdphi); - v[ie + 2] = (float) z; - } - - return v; - } - - private float[] getBarrelTris(float zmin, float zmax, float rmin, float rmax, int nv) { - float[] v = new float[3 * (nv * 2 + 2)]; - - float dphi = (2 * (float) Math.PI) / nv; - float hdphi = 0.5f * dphi; - - float r = (float) rmax; - - for (int i = 0; i < nv; i++) { - int ie = i * 2 * 3; - int oe = (i * 2 + 1) * 3; - v[ie] = r * (float) Math.cos(i * dphi + hdphi); - v[ie + 1] = r * (float) Math.sin(i * dphi + hdphi); - v[ie + 2] = (float) zmin; - v[oe] = r * (float) Math.cos(i * dphi + hdphi); - v[oe + 1] = r * (float) Math.sin(i * dphi + hdphi); - v[oe + 2] = (float) zmax; - } - - // Close the strip - for (int i = 0; i < 6; i++) { - v[i + v.length - 6] = v[i]; - } - - return v; - } - - private float[] getEndTris(float z, float rmin, float rmax, int nv) { - float[] v = new float[3 * (nv * 2 + 2)]; - - float dphi = (2 * (float) Math.PI) / nv; - float hdphi = 0.5f * dphi; - - for (int i = 0; i < nv; i++) { - int ie = i * 2 * 3; - int oe = (i * 2 + 1) * 3; - v[ie] = (float) rmin * (float) Math.cos(i * dphi); - v[ie + 1] = (float) rmin * (float) Math.sin(i * dphi); - v[ie + 2] = z; - v[oe] = (float) rmax * (float) Math.cos(i * dphi + hdphi); - v[oe + 1] = (float) rmax * (float) Math.sin(i * dphi + hdphi); - v[oe + 2] = z; - } - - // Close the strip - for (int i = 0; i < 6; i++) { - v[i + v.length - 6] = v[i]; - } - - return v; - } - - - - public ANObjectGeomCalo() { - - } - - @Override - public int[] getPrimTypes() - { - return m_pt; - } - - @Override - public float[][] getVertices() - { - return m_v; - } - - @Override - public ANColor getColor(int i) { - - if(m_color[i]==DRAW_LINE) - return new ANColor(0.0f, 0.0f, 0.0f, 1.0f); - else - return ANColor.getMapColor(m_color[i], 1.0f); - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectGeomMuon.java b/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectGeomMuon.java deleted file mode 100644 index dd115cb360ace63e144c2f75b2f8999b2bbfe203..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/nge/object/geometry/ANObjectGeomMuon.java +++ /dev/null @@ -1,229 +0,0 @@ -package atlantis.nge.object.geometry; - -import atlantis.nge.object.*; -import atlantis.nge.*; -import atlantis.geometry.ABoxDetector; -import java.util.ArrayList; -import javax.media.opengl.GL; - -/** - * Object that draws geometry of the muon system - * - * @author Adam Davison, Mark Stockton - */ -public class ANObjectGeomMuon extends ANObjectVL { - - private float[][] m_v; - private int[] m_pt; - private int[] m_color; - - public ANObjectGeomMuon() { - setPickHandler(new ANPickHandlerSimple("Muon Spectrometer")); - } - - public ANObjectGeomMuon(ArrayList<ABoxDetector> m_boxes) { - setPickHandler(new ANPickHandlerSimple("Muon Spectrometer")); - - m_pt = new int[2*m_boxes.size()]; - m_v = new float[2*m_boxes.size()][]; - m_color = new int[2*m_boxes.size()]; - - for (int i = 0; i < m_boxes.size(); i++) { - ABoxDetector b = m_boxes.get(i); - m_pt[2*i] = GL.GL_TRIANGLE_STRIP; - m_v[2*i] = getBoxFaces((float)b.getZMin(), (float)b.getZMax(), - (float)b.getRMin(), (float)b.getRMax(), (float)b.getPhi(), - (float)b.getSize()); - m_color[2*i]=b.getFillColor(); - m_pt[2*i+1] = GL.GL_LINES; - m_v[2*i+1] = getBoxEdges((float)b.getZMin(), (float)b.getZMax(), - (float)b.getRMin(), (float)b.getRMax(), (float)b.getPhi(), - (float)b.getSize()); - m_color[2*i+1]=DRAW_LINE; - } - } - - // This code answers the question, how do you wrap a strip of 14 triangles - // to form a cube? - private float[] getBoxFaces(float zmin, float zmax, float rmin, float rmax, float phi, float w) { - float[] v = new float[3*14]; - - float sinPhi = (float)Math.sin(phi); - float cosPhi = (float)Math.cos(phi); - - float xmi = rmin*cosPhi; - float ymi = rmin*sinPhi; - float xmo = rmax*cosPhi; - float ymo = rmax*sinPhi; - float dx = -sinPhi*w/2.0f; - float dy = cosPhi*w/2.0f; - - v[0] = xmi + dx; - v[1] = ymi + dy; - v[2] = zmax; - - v[3] = xmi - dx; - v[4] = ymi - dy; - v[5] = zmax; - - v[6] = xmo + dx; - v[7] = ymo + dy; - v[8] = zmax; - - v[9] = xmo - dx; - v[10] = ymo - dy; - v[11] = zmax; - - v[12] = v[9]; - v[13] = v[10]; - v[14] = zmin; - - v[15] = v[3]; - v[16] = v[4]; - v[17] = v[5]; - - v[18] = v[3]; - v[19] = v[4]; - v[20] = zmin; - - v[21] = v[0]; - v[22] = v[1]; - v[23] = zmin; - - v[24] = v[12]; - v[25] = v[13]; - v[26] = v[14]; - - v[27] = v[6]; - v[28] = v[7]; - v[29] = zmin; - - v[30] = v[6]; - v[31] = v[7]; - v[32] = v[8]; - - v[33] = v[21]; - v[34] = v[22]; - v[35] = v[23]; - - v[36] = v[0]; - v[37] = v[1]; - v[38] = v[2]; - - v[39] = v[3]; - v[40] = v[4]; - v[41] = v[5]; - - return v; - } - - private float[] getBoxEdges(float zmin, float zmax, float rmin, float rmax, float phi, float w) { - float[] v = new float[3*12*2]; // 3d*12edges*2ends - - float sinPhi = (float)Math.sin(phi); - float cosPhi = (float)Math.cos(phi); - - float xmi = rmin*cosPhi; - float ymi = rmin*sinPhi; - float xmo = rmax*cosPhi; - float ymo = rmax*sinPhi; - float dx = -sinPhi*w/2.0f; - float dy = cosPhi*w/2.0f; - - v[0] = xmi + dx; - v[1] = ymi + dy; - v[2] = zmin; - - v[3] = xmi - dx; - v[4] = ymi - dy; - v[5] = zmin; - - v[6] = v[3]; - v[7] = v[4]; - v[8] = v[5]; - - v[9] = xmo - dx; - v[10] = ymo - dy; - v[11] = zmin; - - v[12] = v[9]; - v[13] = v[10]; - v[14] = v[11]; - - v[15] = xmo + dx; - v[16] = ymo + dy; - v[17] = zmin; - - v[18] = v[15]; - v[19] = v[16]; - v[20] = v[17]; - - v[21] = v[0]; - v[22] = v[1]; - v[23] = v[2]; - - for (int i = 24; i < 48; i++) { - if (i % 3 == 2) { - v[i] = zmax; - } else { - v[i] = v[i - 24]; - } - - } - - v[48] = v[0]; - v[49] = v[1]; - v[50] = v[2]; - - v[51] = v[0]; - v[52] = v[1]; - v[53] = zmax; - - v[54] = v[3]; - v[55] = v[4]; - v[56] = v[5]; - - v[57] = v[3]; - v[58] = v[4]; - v[59] = zmax; - - v[60] = v[9]; - v[61] = v[10]; - v[62] = v[11]; - - v[63] = v[9]; - v[64] = v[10]; - v[65] = zmax; - - v[66] = v[15]; - v[67] = v[16]; - v[68] = v[17]; - - v[69] = v[15]; - v[70] = v[16]; - v[71] = zmax; - - return v; - } - - @Override - public float[][] getVertices() { - return m_v; - } - - @Override - public int[] getPrimTypes() { - return m_pt; - } - - @Override - public ANColor getColor(int i) { - - if(m_color[i]==DRAW_LINE) - return new ANColor(0.0f, 0.0f, 0.0f, 1.0f); - else - return ANColor.getMapColor(m_color[i], 1.0f); - - } - -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/output/AExceptionHandler.java b/graphics/AtlantisJava/src/atlantis/output/AExceptionHandler.java deleted file mode 100755 index 7be2501d9e747ea20e0d2a705efbf1eaded0dec4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/output/AExceptionHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -package atlantis.output; - -import javax.swing.JOptionPane; - -import atlantis.globals.AGlobals; - -/** - * Handles an exception thrown in the AWT event-dispatch thread. If the system - * property "sun.awt.exception.handler" is defined then when an exception occurs - * in the AWT event-dispatch thread, the thread wii do the following: 1) Load - * the class named by the value of that property, using the current thread's - * context class loader, 2) Instantiate that class using its zero-argument - * constructor, 3) Find the resulting handler object's "public void handle" - * method, which should take a single argument of type "Throwable", and 4) - * Invoke the handler's "handle" method, passing it the exception as an - * argument. - * - * Note: The magic "sun.awt.exception.handler" property will be - * removed in a future release. - * - * Comment: No wonder - centrally handling all exceptions is not a good idea - * in the first place (S.B.) - */ - -public class AExceptionHandler { - private static final AGlobals globals = AGlobals.instance(); - - public void handle(Throwable exception) - { - processException("AWT Event Dispatch Thread Exception:", exception); - } - - public static void processException(String message, Throwable exception) - { - exception.printStackTrace(); - showMessageDialog(message); - } - - public static void processException(String type, String message) - { - - if (type.equals("fatal")){ - showMessageDialog(type + ": " + message + "\n"); - System.exit(1); - } - AOutput.append(type + ": " + message + "\n", ALogInterface.BAD_COMMAND); - } - - private static void showMessageDialog(String message) - { - //Do not show messages in headless mode - if(AGlobals.isAtlantisHeadless()) return; - - //Do not show messages in demo mode - if (AGlobals.instance().isDemoMode()) return; - - //Else show a message box with the exception - JOptionPane.showMessageDialog(globals.getGuiFrame(), message, "Atlantis", JOptionPane.ERROR_MESSAGE); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/output/ALogInterface.java b/graphics/AtlantisJava/src/atlantis/output/ALogInterface.java deleted file mode 100644 index 3a3f416a71f541ab4234687d3e52b1f7e0c93267..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/output/ALogInterface.java +++ /dev/null @@ -1,25 +0,0 @@ -package atlantis.output; - -/** - * Non-GUI-dependent interface for ALogPane. - * - * @author waugh - * - */ -public interface ALogInterface { - - public static final String TITLE = "TITLE"; - public static final String NORMAL = "NORMAL"; - public static final String NORMAL_BOLD = "NORMAL_BOLD"; - public static final String COMMAND = "COMMAND"; - public static final String BAD_COMMAND = "BAD_COMMAND"; - public static final String PICK = "PICK"; - public static final String WARNING = "WARNING"; - - void append(String s); - - void append(String s, String style); - - void clear(); - -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/output/AOutput.java b/graphics/AtlantisJava/src/atlantis/output/AOutput.java deleted file mode 100755 index 4f5285cb5a5578c586939ff2bd4ccd2f27ed1c89..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/output/AOutput.java +++ /dev/null @@ -1,54 +0,0 @@ -package atlantis.output; - -import atlantis.globals.AGlobals; -import atlantis.utils.ALogger; - -/** - * AOutput provides access to the specific static instance of AMainLogPane which - * is used for displaying general information within Atlantis - * @author Adam Davison - */ -public class AOutput -{ - //Handle to the main log pane - private static ALogInterface outputPane; - - /** Logger for when not outputting to the GUI (Minerva). */ - private final static ALogger logger = ALogger.getLogger(AOutput.class); - - /** Append text to output pane/logger depending on output level. */ - public static void append(String s, String style) { - if (outputPane==null) return; // in case not set yet, or no GUI - if(AGlobals.instance().getSimpleOutput()>0){ - if (style.equals(ALogInterface.BAD_COMMAND) || style.equals(ALogInterface.WARNING)) { - logger.warn(s); - }else{ - logger.info(s); - } - }else{ - outputPane.append(s, style); - } - } - - /** Append text to output pane - only for pick info (and select event/debug info). */ - public static void alwaysAppend(String s, String style) { - if (outputPane==null) return; // in case not set yet, or no GUI - outputPane.append(s, style); - } - - /** - * Provide interface to the log pane in the GUI. - * @param outputDisplay the log pane - */ - public static void setOutput(ALogInterface outputDisplay) { - AOutput.outputPane = outputDisplay; - } - - /** - * Get interface to the log pane in the GUI, if any. - * @param outputDisplay the log pane - */ - public static ALogInterface getOutput() { - return outputPane; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/package.html b/graphics/AtlantisJava/src/atlantis/package.html deleted file mode 100644 index 9d160b36ad3a4a82ea0968a85583832d39deafd1..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/package.html +++ /dev/null @@ -1,8 +0,0 @@ -<html> -<head></head> -<body> - Root package of the Atlantis application. - Contains main class Atlantis, whose purpose is to parse the command line, - initialise the application's main components and provide access to them. -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AAbstractParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/AAbstractParameter.java deleted file mode 100755 index 74401090c6e014c3f7feb3d99d752026f09dcb21..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AAbstractParameter.java +++ /dev/null @@ -1,913 +0,0 @@ -package atlantis.parameters; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPopupMenu; -import javax.swing.LookAndFeel; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.gui.ACheckBox; -import atlantis.gui.AParametersTable; -import atlantis.output.AExceptionHandler; -import atlantis.utils.AUtilities; - -/** - * The class is used as a default implementation of the AParameter interface. - * All parameters extend this class except ALinkParameter which implements - * AParameter directly. - */ -abstract class AAbstractParameter implements AParameter -{ - // range constants - protected final static int MIN = 0; - protected final static int MAX = 1; - protected final static int SVAL = 2; - - // unitsOf constants - protected final static int NOTHING = 0; - protected final static int LENGTH = 1; - protected final static int ENERGY = 2; - protected final static int ENERGYMEV = 3; - - /** - * List of listeners/observers to be informed of changes to parameters. - * Currently this is just the GUI, which repaints its tables when a parameter - * changes. - */ - private List<AParameterChangeListener> parameterChangeListeners = new ArrayList<AParameterChangeListener>(); - - /** The internal name of the parameter. */ - protected String name; - /** The name which is displayed in the user interface. */ - protected String screenName; - /** Tool tip, i.e. text that appears when mouse hovers over control. */ - protected String toolTip; - - protected boolean hasStatus; - protected int valueType; - protected int scope; - protected int defaultScope; - protected boolean isModulus; - protected int userLevel; - protected int unitsOf; - protected String[] operators; - /** Allowed values for this parameter: - * range[MIN][i] and range[MAX][i] are the limits of the i'th range; - * range[SVAL][j] is the j'th allowed single value. */ - protected double[][] range; - - private ACheckBox nameLabel; - private JLabel label; - private boolean isInitialized = false; - - /** The number of windows in the canvas. */ - protected int wCount = 0; // initialised later in constructor - - /** Contains the values for each window. */ - protected AParameterData data; - - @Override - public void addParameterChangeListener(AParameterChangeListener listener) { - parameterChangeListeners.add(listener); - } - - public AAbstractParameter(String name, String screenName, String toolTip, - int valueType, double value, String op, String dop, - boolean haseStatus, boolean status, boolean isMod, int userLevel, - int scope, int unitsOf) - { - // initialising wCount - // for running without Canvas (e.g. calling geometry methods from GraXML), - // this may run without Canvas initialised - // check if Canvas actually exists - // dependency of AAbstractParameter on ACanvas should be revised, this - // current solution is not very elegant - ACanvas canvas = ACanvas.getCanvas(); - this.wCount = canvas == null ? 0 : canvas.getWindowsCount(); - - this.isModulus = isMod; - this.unitsOf = unitsOf; - - if (!screenName.trim().equals("")) - this.screenName = screenName; - else - this.screenName = name; - - if (isMod) - this.screenName = "|" + this.screenName + "|"; - - // removing spaces from the parameter name - StringBuffer strBuffer = new StringBuffer(name); - int i = 0; - - while (i < strBuffer.length()) - { - if (Character.isWhitespace(strBuffer.charAt(i))) - strBuffer.deleteCharAt(i); - else - i++; - } - this.name = strBuffer.toString(); - - if ((toolTip == null) || (toolTip.trim().length() == 0)) - this.toolTip = this.screenName; - else - this.toolTip = toolTip; - - this.hasStatus = haseStatus; - this.valueType = valueType; - - // set up the local window copies - this.data = new AParameterData(wCount); - - for (i = 0; i < wCount; i++) - { - this.data.setValue(i, value); - this.data.setStatus(i, status); - } - - // decompose supportedOperators - if ((op == null) || (op.trim().equals(""))) - { - this.operators = new String[1]; - operators[0] = "="; - } - else - { - String[] tempOperators = new String[10]; - - int operatorsCount = 0; - StringTokenizer st = new StringTokenizer(op, ","); - - while (st.hasMoreTokens()) - { - String oper = st.nextToken().trim(); - - if (isKnownOperator(oper)) - { - tempOperators[operatorsCount] = oper; - operatorsCount++; - } - else - throw new Error("Unknown operator: " + oper); - } - - this.operators = new String[operatorsCount]; - for (i = 0; i < operatorsCount; i++) - this.operators[i] = tempOperators[i]; - } - - if ((dop == null) || (dop.trim().equals(""))) - for (i = 0; i < wCount; i++) - this.data.setOperator(i, operators[0]); - else - for (i = 0; i < wCount; i++) - this.data.setOperator(i, dop); - - this.userLevel = userLevel; - setScope(scope); - saveDefaults(); - } - - public void saveDefaults() - { - this.data.saveDefaults(); - this.defaultScope = this.scope; - } - - public void restoreDefaults() - { - this.data.restoreDefaults(); - changeScope(this.defaultScope); - } - - /** - * This method is called to apply the change in the value of the parameter - */ - public void apply() - { - if (getScope() == LOCAL) - ACommandProcessor.receive("DO"); - else - ACanvas.getCanvas().repaintAllFromScratch(); - } - - /** - * Called by the User Interface in order to initialize the graphics of the - * parameter (if it will be displayed in the UI). - */ - public void initialize() - { - if (hasStatus) - { - nameLabel = new ACheckBox(screenName); - nameLabel.setSelected(getStatus()); - nameLabel.setBackground(new Color(204, 204, 204)); - if (getScope() == LOCAL) - setForeground(Color.black); - else - setForeground(Color.blue); - - nameLabel.setToolTipText(toolTip); - nameLabel.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - ACommandProcessor.receive(name); - apply(); - } - }); - - // after the first left click at the table in the parameter tabbed - // pane, all the followingmouse mouse event will be catched by the - // mouselisteners of those components inside the table cells, not - // the table itself, so in order for the local/global - // switch (right click to change) to always work, have to add mouse - // listeners to these components as well. - nameLabel.addMouseListener(new MouseAdapter() - { - public void mousePressed(MouseEvent e) - { - if (AUtilities.isRightMouseButton(e)) - { - JPopupMenu popupMenu = new JPopupMenu(); - if (getScope() == AParameter.LOCAL) - { - popupMenu.add(AParametersTable.SET_GLOBAL).addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - changeScope(AParameter.GLOBAL); - refresh(); - } - }); - } - else - { - popupMenu.add(AParametersTable.SET_LOCAL).addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - changeScope(AParameter.LOCAL); - refresh(); - } - }); - } - popupMenu.show(nameLabel, e.getX(), e.getY()); - } - } - }); - } - else - { - label = new JLabel(screenName); - if (getScope() == LOCAL) - setForeground(Color.black); - else - setForeground(Color.blue); - - // after the first left click at the table in the parameter tabbed - // pane, all the followingmouse mouse event will be catched by the - // mouselisteners of those components inside the table cells, not - // the table itself, so in order for the local/global - // switch (right click to change) to always work, have to add mouse - // listeners to these components as well. - label.addMouseListener(new MouseAdapter() - { - public void mousePressed(MouseEvent e) - { - if (AUtilities.isRightMouseButton(e)) - { - JPopupMenu popupMenu = new JPopupMenu(); - if (getScope() == AParameter.LOCAL) - { - popupMenu.add(AParametersTable.SET_GLOBAL).addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - changeScope(AParameter.GLOBAL); - refresh(); - } - }); - } - else - { - popupMenu.add(AParametersTable.SET_LOCAL).addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - changeScope(AParameter.LOCAL); - refresh(); - } - }); - } - popupMenu.show(label, e.getX(), e.getY()); - } - } - }); - label.setOpaque(true); - label.setToolTipText(toolTip); - LookAndFeel.installColorsAndFont(label, "CheckBox.background", "CheckBox.foreground", "CheckBox.font"); - } - - isInitialized = true; - } - - public boolean isInitialized() - { - return this.isInitialized; - } - - /** - * Copies from one window to another the value of the parameter - */ - public void copy(int from, int to) - { - data.copy(from,to); - } - - /** - * This function is called for GLOBAL parameters to apply the value in all - * windows. - */ - public void globalize(int window) - { - data.globalize(window); - } - - public void setScope(int scope) - { - this.scope = scope; - if (scope == LOCAL) - setForeground(Color.black); - else - setForeground(Color.blue); - } - - public void changeScope(int scope) - { - if (scope != this.scope) - { - this.scope = scope; - if (scope == LOCAL) - setForeground(Color.black); - else - { - setForeground(Color.blue); - data.globalize(); - ACanvas.getCanvas().repaintAllFromScratch(); - } - } - } - - public int getScope() - { - return scope; - } - - public String getName() - { - return name; - } - - public String getScreenName() - { - return screenName; - } - - public String getToolTip() - { - return toolTip; - } - - // public String getOperator() { return operator; } - public boolean isModulus() - { - return isModulus; - } - - public int getValueType() - { - return valueType; - } - - public String getOperator() - { - return data.getOperator(); - } - - protected void _setOperator(String oper) - { - // if (!validateValue(v)) - // throw new Error("Value " + v + " for parameter " + screenName + " is - // out of range "); - data.setOperator(oper); - if (scope == GLOBAL) data.globalize(); - } - - protected void _setOperator(String windowName, String oper) - { - if (scope == GLOBAL || windowName.equals("*")) { - data.setOperator(oper); - data.globalize(); - } else { - data.setOperator(ACanvas.getCanvas().getWindow(windowName).getIndex(), oper); - } - } - - protected void _setValue(String windowName, double val) - { - if (scope == GLOBAL || windowName.equals("*")) { - data.setValue(val); - data.globalize(); - } else { - data.setValue(ACanvas.getCanvas().getWindow(windowName).getIndex(), val); - } - } - - protected void _setStatus(String windowName, boolean stat) - { - if (scope == GLOBAL || windowName.equals("*")) { - data.setStatus(stat); - data.globalize(); - } else { - data.setStatus(ACanvas.getCanvas().getWindow(windowName).getIndex(), stat); - } - } - - /** - * _setD and _setI are used by subclasses when changing the values of - * parameters. - */ - protected void _setD(double v) - { - if (!validateValue(v)) - throw new Error("Value " + v + " for parameter " + screenName + " is out of range "); - data.setValue(v); - if (scope == GLOBAL) data.globalize(); - } - - protected void _setI(int v) - { - if (!validateValue(v)) - throw new Error("Value " + v + " for parameter " + screenName + " is out of range "); - data.setValue(v); - if (scope == GLOBAL) data.globalize(); - } - - public double getD() - { - if (valueType != FLOAT) - throw new Error("getD acces on not FLOAT parameter"); - return data.getValue(); - } - - public int getI() - { - if (valueType != INT) - throw new Error("getI acces on not INT parameter"); - return (int) data.getValue(); - } - - public String getValue() - { - if (valueType == FLOAT) - return Double.toString(data.getValue()); - else - return Integer.toString((int) data.getValue()); - } - - public void setStatus(boolean st) - { - if (!hasStatus) - throw new Error("Parameter has no status"); - data.setStatus(st); - if (scope == GLOBAL) data.globalize(); - - refresh(); - fireParameterChanged(); - } - - public boolean getStatus() - { - if (!hasStatus) - throw new Error("Parameter hase no status"); - - return data.getStatus(); - } - - public JComponent getNameComponent() - { - if (hasStatus) - return nameLabel; - else - return label; - } - - public JComponent getValueComponent() - { - return new JLabel("error"); - } - - protected void _refresh() - { - if (hasStatus) - if (nameLabel != null) - nameLabel.setSelected(getStatus()); - } - - /** - * Parses the PossibleValues string and returns the double[][] containing - * the range of this parameter. - */ - protected static double[][] resolvePossibleValues(String possibleValues, int type) - { - double[][] range = new double[3][100]; - int valCount = 0; - int rangeCount = 0; - StringTokenizer st = new StringTokenizer(possibleValues, ","); - String sval; - double val = 0; - - while (st.hasMoreTokens()) - { - String token = st.nextToken().trim(); - StringTokenizer st1 = new StringTokenizer(token, ":"); - - switch (st1.countTokens()) - { - case 1: - sval = st1.nextToken().trim(); - try - { - if (type == FLOAT) - val = Double.parseDouble(sval); - else if (type == INT) - val = Integer.parseInt(sval); - range[SVAL][valCount] = val; - valCount++; - } - catch (NumberFormatException nfe) - { - AExceptionHandler.processException("Corrupt Possible Value: " + sval, nfe); - } - break; - - case 2: - for (int i = 0; i < 2; i++) - { - sval = st1.nextToken().trim(); - try - { - if (type == FLOAT) - val = Double.parseDouble(sval); - else if (type == INT) - val = Integer.parseInt(sval); - } - catch (NumberFormatException nfe) - { - if (sval.equals("inf")) - val = Double.POSITIVE_INFINITY; - else if (sval.equals("-inf")) - val = Double.NEGATIVE_INFINITY; - else - AExceptionHandler.processException("Corrupt Possible Range: (" + token + ")", nfe); - } - range[i][rangeCount] = val; - } - rangeCount++; - break; - - default: - AExceptionHandler.processException("fatal", "Corrupt \"pv\" definition: \"" + possibleValues + "\""); - break; - } - } - - double[] min = new double[rangeCount]; - double[] max = new double[rangeCount]; - - for (int i = 0; i < rangeCount; i++) - if (range[MIN][i] <= range[MAX][i]) - { - min[i] = range[MIN][i]; - max[i] = range[MAX][i]; - } - else - throw new Error("Bad range definiton: (" + range[0][i] + ":" + range[1][i] + ")"); - - double[] v = new double[valCount]; - - for (int i = 0; i < valCount; i++) - v[i] = range[SVAL][i]; - - range[MIN] = min; - range[MAX] = max; - range[SVAL] = v; - return range; - } - - protected static int[] getValues(String possibleValues) - { - int[] pVal = new int[100]; - int[] range = new int[2]; - int i, valCount = 0; - String token; - StringTokenizer st, st1; - - st = new StringTokenizer(possibleValues, ","); - while (st.hasMoreTokens()) - { - token = st.nextToken().trim(); - st1 = new StringTokenizer(token, ":"); - switch (st1.countTokens()) - { - case 1: - try - { - pVal[valCount++] = Integer.parseInt(st1.nextToken().trim()); - } - catch (NumberFormatException nfe) - { - AExceptionHandler.processException("Corrupt Possible Value", nfe); - } - break; - - case 2: - for (i = 0; i < 2; i++) - try - { - range[i] = Integer.parseInt(st1.nextToken().trim()); - } - catch (NumberFormatException nfe) - { - AExceptionHandler.processException("fatal", "error in range definition"); - } - - if (range[0] <= range[1]) - for (i = range[0]; i <= range[1]; i++) - pVal[valCount++] = i; - break; - - default: - AExceptionHandler.processException("fatal", "Corrupt range definition: \"" + possibleValues + "\""); - } - } - - int[] pValFinal = new int[valCount]; - - for (i = 0; i < valCount; i++) - pValFinal[i] = pVal[i]; - - return pValFinal; - } - - public boolean processCommand(String oper, double v) - { - // first I validate the operator and the value - if (!validateOperator(oper)) - return false; - if (!validateValue(v)) - return false; - - if (valueType == FLOAT) - _setD(v); - else - _setI((int) v); - - _setOperator(oper); - - refresh(); - fireParameterChanged(); - - return true; - } - - public boolean validateValue(double v) - { - if (range[SVAL] != null) - for (int i = 0; i < range[SVAL].length; i++) - if (v == range[SVAL][i]) - return true; - - if (range[MIN] != null) - for (int i = 0; i < range[MIN].length; i++) - if ((v >= range[MIN][i]) && (v <= range[MAX][i])) - return true; - - return false; - } - - public boolean validateOperator(String oper) - { - for (int i = 0; i < operators.length; i++) - if (oper.equals(operators[i])) - return true; - - return false; - } - - public int getUserLevel() - { - return userLevel; - } - - - public String toString() - { - StringBuilder s = new StringBuilder(screenName + ": "); - - if (scope == GLOBAL) - s.append("GLOBAL"); - else if (scope == LOCAL) - s.append("LOCAL"); - - s.append("["); - - // for running without Canvas (e.g. calling geometry methods from GraXML), - // this may run without Canvas initialised - // check if Canvas actually exists - // dependency of AAbstractParameter on ACanvas should be revised, this - // current solution is not very elegant - ACanvas canvas = ACanvas.getCanvas(); - String[] wName = canvas == null ? new String[0] : canvas.getKnownWindowNames(); - - for (int i = 0; i < wName.length; i++) - { - AWindow w = ACanvas.getCanvas().getWindow(wName[i]); - - s.append(wName[i] + ": " + data.getValue(w.getIndex()) + ": "); - } - - return s.toString() + "]" + " :" + toolTip + ":"; - } - - - private final void setForeground(Color color) - { - if (getNameComponent() != null) - getNameComponent().setForeground(color); - } - - public String getDifferences(String groupName) - { - StringBuffer b = new StringBuffer(); - String[] windowNames = ACanvas.getCanvas().getKnownWindowNames(); - int[] inverse = new int[windowNames.length]; - for (int i = 0; i < windowNames.length; i++) - inverse[ACanvas.getCanvas().getWindow(windowNames[i]).getIndex()] = i; - - for (int i = 0; i < wCount; ++i) - { - if (data.getStatus() != data.getStatus(i) || !data.getOperator().equals(data.getOperator(i)) || data.getValue() != data.getValue(i)) - { - - b.append("\t\t<DIFFERENCE group=\"" + groupName + "\" name=\"" + getName() + "\" windowName=\"" + windowNames[inverse[i]] + "\""); - - if (data.getValue() != data.getValue(i)) - b.append(" va=\"" + data.getValue(i) + "\""); - if (data.getStatus() != data.getStatus(i)) - { - if (data.getStatus(i)) - b.append(" st=\"ON\""); - else - b.append(" st=\"OFF\""); - } - if (!data.getOperator().equals(data.getOperator(i))) - b.append(" op=\"" + data.getOperator(i) + "\""); - b.append("/>\n"); - } - } - return b.toString(); - } - - protected double parseUnitsDouble(String text) - { - // units shown are cm - if (unitsOf == LENGTH) - { - if (text.endsWith("MM") || text.endsWith("mm")) - return 0.1 * Double.parseDouble(text.substring(0, text.length() - 2)); - if (text.endsWith("CM") || text.endsWith("cm")) - return Double.parseDouble(text.substring(0, text.length() - 2)); - if (text.endsWith("UM") || text.endsWith("um")) - return 0.0001 * Double.parseDouble(text.substring(0, text.length() - 2)); - else if (text.endsWith("M") || text.endsWith("m")) - return 100. * Double.parseDouble(text.substring(0, text.length() - 1)); - else - return Double.parseDouble(text.substring(0, text.length())); - } - else if (unitsOf == ENERGY) - { - if (text.endsWith("GeV") || text.endsWith("gev") || text.endsWith("GEV")) - return Double.parseDouble(text.substring(0, text.length() - 3)); - else if (text.endsWith("MeV") || text.endsWith("mev") || text.endsWith("MEV")) - return .001 * Double.parseDouble(text.substring(0, text.length() - 3)); - else - return Double.parseDouble(text); - } - else if (unitsOf == ENERGYMEV) - { - if (text.endsWith("MeV") || text.endsWith("mev") || text.endsWith("MEV")) - return Double.parseDouble(text.substring(0, text.length() - 3)); - else if (text.endsWith("KeV") || text.endsWith("kev") || text.endsWith("KEV")) - return .001 * Double.parseDouble(text.substring(0, text.length() - 3)); - else if (text.endsWith(" eV") || text.endsWith(" ev") || text.endsWith(" EV")) - return .000001 * Double.parseDouble(text.substring(0, text.length() - 3)); - else - return Double.parseDouble(text); - } - else - { - return Double.parseDouble(text); - } - } - - protected String parseUnits(double d) - { - // units shown are cm - double abs = Math.abs(d); - if (unitsOf == LENGTH) - { - if (abs >= 100.) - return "" + trim(d, 100.) + " m"; - else if (abs >= 1.) - return "" + trim(d, 1.) + " cm"; - else if (abs >= 0.1) - return "" + trim(d, 0.1) + " mm"; - else - return "" + trim(d, 0.0001) + " um"; - } - else if (unitsOf == ENERGY) - { - if (abs >= 1.) - return "" + trim(d, 1.) + " GeV"; - else - return "" + trim(d, 0.001) + " MeV"; - } - else if (unitsOf == ENERGYMEV) - { - if (abs >= 1.) - return "" + trim(d, 1.) + " MeV"; - else if(abs >=0.001) - return "" + trim(d, 0.001) + " KeV"; - else - return "" + trim(d, 0.000001) + " eV"; - } - else - { - return "" + trim(d, 1.); - } - } - - private String trim(double d, double factor) - { - // only display with 3 significant digits - if (unitsOf == LENGTH && Math.abs(d) < .1) - return "" + Math.rint(d / factor); - else if (unitsOf == ENERGY && Math.abs(d) < 1.) - return "" + Math.rint(d / factor); - else if (unitsOf == ENERGYMEV && Math.abs(d) < 1.) - return "" + Math.rint(d / factor); - else - return "" + Math.rint(1000. * d / factor) / 1000.; - } - - public ACheckBox getCheckBox() - { - return this.nameLabel; - } - - /** - * Check if a given operator is one of the allowed supportedOperators. - * @param oper the operator to check - * @return true if this is a known operator - */ - protected static boolean isKnownOperator(String oper) - { - for(int i=0; i<AParameter.supportedOperators.length; i++) - if(oper.equals(AParameter.supportedOperators[i])) - return true; - - return false; - } - - /** - * Tell the listeners that a parameter has changed. - */ - protected void fireParameterChanged() { - for (AParameterChangeListener listener : parameterChangeListeners) { - listener.parameterChanged(this); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AColorParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/AColorParameter.java deleted file mode 100755 index 34972e6e189101ad75145cf5cc8e2564ca6eef01..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AColorParameter.java +++ /dev/null @@ -1,92 +0,0 @@ -package atlantis.parameters; - -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import javax.swing.JComponent; - -import atlantis.gui.AColorComboBoxRenderer; -import atlantis.gui.AComboBox; - -/** - * A parameter representing a selectable colour. - */ -public class AColorParameter extends AAbstractParameter { - private AComboBox colorComboBox; - - public AColorParameter( - String name, String screenName, String toolTip, String pv, double value, - boolean haseStatus, boolean status, int userLevel, int scope) { - - super(name, screenName, toolTip, INT, value, null, null, haseStatus, status, false, userLevel, - scope, NOTHING); - - range=resolvePossibleValues(pv, INT); - if((range[SVAL]==null)&&(range[MIN]==null)) { - range[MIN]=new double[] {0}; - range[MAX]=new double[] {29}; - } - - } - - public void setD(double v) { - throw new IllegalArgumentException("is not allowed to use setD on ColorParameter"); - } - - public void setI(int v) { - if(colorComboBox!=null) - colorComboBox.setGUISelectedItem(new Integer(v)); - - _setI(v); - refresh(); - fireParameterChanged(); - } - - public void initialize() { - super.initialize(); - colorComboBox=new AComboBox(); - colorComboBox.setRenderer(new AColorComboBoxRenderer()); - colorComboBox.setToolTipText(toolTip); - - int i, j; - - for(i=0; i<range[SVAL].length; i++) { - int color=(int)range[SVAL][i]; - - if((color>=0)&&(color<=29)) - colorComboBox.addItem(new Integer(color)); - } - - for(i=0; i<range[MIN].length; i++) { - int color1=(int)range[MIN][i]; - int color2=(int)range[MAX][i]; - - if((color1>=0)&&(color1<=29)&&(color2>=0)&&(color2<=29)) - for(j=color1; j<=color2; j++) - colorComboBox.addItem(new Integer(j)); - } - - colorComboBox.setGUIItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - if(e.getStateChange()==ItemEvent.SELECTED) { - int color=((Integer)colorComboBox.getSelectedItem()).intValue(); - - ACommandProcessor.receive(name+"="+color); - apply(); - } - } - }); - - colorComboBox.setGUISelectedItem(new Integer(getI())); - } - - public JComponent getValueComponent() { - return colorComboBox; - } - - public void refresh() { - _refresh(); - if(colorComboBox!=null) - colorComboBox.setGUISelectedItem(new Integer(getI())); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/ACommand.java b/graphics/AtlantisJava/src/atlantis/parameters/ACommand.java deleted file mode 100755 index 1ae57ad8ffcfe7fcd3e91990694100eb3dd864c5..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/ACommand.java +++ /dev/null @@ -1,31 +0,0 @@ -package atlantis.parameters; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.JButton; - -/** - * This class is a GUI representation of a command button. - * It just generates the corresponding command when pressed. - */ -public class ACommand extends JButton { - private String command; - - ACommand(String name, String _command, String toolTip) { - super(name); - - this.command=_command; - - setToolTipText(toolTip); - addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - ACommandProcessor.receive(command); - } - }); - } - - public String getName() { - return getText(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/ACommandProcessor.java b/graphics/AtlantisJava/src/atlantis/parameters/ACommandProcessor.java deleted file mode 100755 index 9c023708c66c24986c67e125a370b67aa093b254..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/ACommandProcessor.java +++ /dev/null @@ -1,451 +0,0 @@ -package atlantis.parameters; - -import java.util.Vector; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.event.AEventManager; -import atlantis.event.AFilter; -import atlantis.data.AS3DData; -import atlantis.data.ATrackData; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.projection.AProjection; -import atlantis.utils.ALogger; - -/** - * (almost?) All actions on the GUI generate a command (which is basically a - * text string) which is passed to the command processor which performs the - * actions associated with that command. This should allow a simple - * implementation of scripting and logging - * - * NOTE: This design has been dramatically neglected in the past and should - * probably be revised (Sebastian Boeser, 06.10.09) - */ - -public class ACommandProcessor -{ - private static ALogger logger = ALogger.getLogger(ACommandProcessor.class); - private static AEventManager eventManager = AEventManager.instance(); - - private static String legoLayoutName =""; - private static String[] legoWindowNames = {"current", "W", "1", "2", "3", "4"}; - private final static String[] legoStatusParameterNames = {"DrawPlot", "MainLegend", "L1EtLegend", "L1Items", "L2Items", "EFItems"}; - private final static String[] legoIntParameterNames = {"Mode", "nphicells", "netacells"}; - private final static String[] legoCaloParameterNames = {"LAr", "TILE", "FCAL", "MBTS"}; - private static boolean[][] legoStatusParameter = new boolean[6][6]; - private static int[][] legoIntParameter = new int[6][3]; - private static boolean[][] legoCaloParameter = new boolean[2][4]; - - private static APar parameterStore = APar.instance(); - - /** - * While this is called receive, it is actually just a small wrapper to - * processes a command and at the same time log it - * @param command the command to process - */ - public synchronized static void receive(String command) - { - //In debug mode show the command - logger.debug("ACommandProcessor.receive(): " + command); - //In trace mode show also who called this - logger.trace("Calling hierarchy",new Exception()); - - //Now process the command - boolean status = process(command); - - //And log the result - logger.debug( ((status)?" success: ":" bad command:") + command); - - } - - - - private synchronized static boolean process(String c) - { - - if (processGlobal(c)) - { - return true; - } - - AProjection p = ACanvas.getCanvas().getCurrentWindow().getProjection(); - // projection dependent command could be processed here - if (p.processLocalCommand(c)) - { - return true; - } - - if (parameterStore.processParameterChangeCommand(c)) - { - return true; - } - - return false; - } - - // used for checking all command are implemented - private synchronized static boolean found(int mode, String name, String command) - { - if (mode != 0) - { - logger.warn("Command not found: " + command); - return false; - } - if (name.equals(command)) - return true; - return false; - } - - private synchronized static boolean foundWindow(int mode, String name, String command) - { - if (mode != 0) - { - String[] windowNames = ACanvas.getCanvas().getKnownWindowNames(); - - for (int i = 0; i < windowNames.length; ++i) - logger.debug(command + windowNames[i]); - return false; - } - - if (name.substring(0, name.length() - 1).equals(command)) - if (ACanvas.getCanvas().isValidWindowName(name.substring(name.length() - 1))) - if (ACanvas.getCanvas().getWindow(name.substring(name.length() - 1)) != null) - return true; - return false; - } - - private synchronized static boolean processGlobal(String c) - { - return processGlobal(c, 0); - } - - private static void getGlobalCommands() - { - processGlobal("GARY", 1); - } - - private static boolean processZoomTrack(String name, int mode) - { - ATrackData tr = null; - - // check if STr (Simulated Track) Zoom Next Track was pressed - if(found(mode, name, "ZOOMNEXTSTR")) - { - tr = eventManager.getCurrentEvent().getSTrData(); - } - // check if Track (InDetTrack) Zoom Next Track was pressed - else if(found(mode, name, "ZOOMNEXTTRACK")) - { - AEnumeratorParameter listBox = null; - listBox = (AEnumeratorParameter) parameterStore.get("InDetTrack", "InDetTrackCollections"); - String col = listBox.getCurrentText(); - if("All".equals(col)) - { - String msg = "Choose a particular Track collection, " + - "can't zoom next track when 'All' is selected.\n"; - AOutput.alwaysAppend(msg, ALogInterface.WARNING); - return false; - } - else - { - tr = eventManager.getCurrentEvent().getTrackData("InDetTrack", col); - } - } - - if(tr == null) - { - // STr or Track of requested collection doesn't exits in this event - return false; - } - - // check if the datatype where Zoom Next Track was pressed is actually - // turned on and thus visible - if(! parameterStore.get("Data", tr.getName()).getStatus()) - { - AOutput.alwaysAppend("Can't zoom next track, " + tr.getNameScreenName() + - " is turned off.\n", ALogInterface.WARNING); - return false; - } - - AParameter nextTrPar = parameterStore.get(tr.getName(), "NextTrack"); - nextTrPar.setStatus(true); - nextTrPar.setI(nextTrPar.getI() + 1); - tr.zoomAroundTracks(); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - - AOutput.alwaysAppend(tr.getNameScreenName() + " -> Next Track cut active now.\n", - ALogInterface.WARNING); - - return true; - - } // processZoomTrack() - // --------------------------------------------------- - - private synchronized static boolean processGlobal(String name, int mode) - { - // is this a group in the parameter file ? - Vector<String> groups = parameterStore.getUIGroupNames(); - for (int i = 0; i < groups.size(); ++i) - { - String groupName = groups.elementAt(i); - if (found(mode, name, groupName + ".")) - { - ACanvas.getCanvas().getCurrentWindow().setGroup(groupName); - return true; - } - } - - if(found(mode, name, "SETORIGINALPRIMARYVERTEX")) - { - eventManager.getCurrentEvent().setPrimaryVertex(); - ACanvas.getCanvas().repaintAllFromScratch(); - } - - - if (found(mode, name, "LEGOTRIGGER")) - { - processLegoTrigger(); - return true; - } - - if (found(mode, name, "RETURNLEGOTRIGGER")) - { - if(legoLayoutName.equals("")) - { - AOutput.append("No trigger debugging to return from\n", ALogInterface.NORMAL); - return true; - } - - returnLegoTrigger(); - return true; - } - - if (found(mode, name, "PREVSECTOR")) - { - AParameter phi = parameterStore.get("YZ", "Phi"); - phi.setD(((Math.round(phi.getD()/22.5) + 15) % 16) * 22.5); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - return true; - } - - if (found(mode, name, "NEXTSECTOR")) - { - AParameter phi = parameterStore.get("YZ", "Phi"); - phi.setD(((Math.round(phi.getD()/22.5) + 1) % 16) * 22.5); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - return true; - } - - if (found(mode, name, "ZOOMNEXTSTR") || found(mode, name, "ZOOMNEXTTRACK")) - { - return processZoomTrack(name, mode); - } - - if (found(mode, name, "PC")) - { - getGlobalCommands(); - return true; - } - if (found(mode, name, "DO")) - { - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - return true; - } - - // turning all datatypes on/off command: - see code which was - // commented out in AtlantisJava-09-05-71 and before - - // Toggle: PT,D0,Z0,NU off:NG,NB,NS,NR,SH - if (found(mode, name, "CC")) - { - if (parameterStore.get("CutsInDet", "z0-zVtx").getStatus()) - { - parameterStore.get("CutsInDet", "z0-zVtx").setStatus(false); - parameterStore.get("CutsInDet", "d0").setStatus(false); - parameterStore.get("CutsInDet", "Pt").setStatus(false); - parameterStore.get("CutsInDet", "NumS3D").setStatus(false); - } - else - { - parameterStore.get("CutsInDet", "z0-zVtx").setStatus(true); - parameterStore.get("CutsInDet", "d0").setStatus(true); - parameterStore.get("CutsInDet", "Pt").setStatus(true); - parameterStore.get("CutsInDet", "NumS3D").setStatus(true); - } - parameterStore.get("CutsInDet", "RTrIndex").setStatus(false); - parameterStore.get("CutsInDet", "STr").setStatus(false); - parameterStore.get("CutsInDet", "Group").setStatus(false); - parameterStore.get("CutsATLAS", "Index").setStatus(false); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - return true; - } - if (found(mode, name, "FH")) - { - //Try to get SpacePoints - AS3DData spacePoints = (AS3DData) eventManager.getCurrentEvent().get("S3D"); - //Apply Hans Drevermanns hit filter - if (spacePoints != null){ - AFilter.filter(spacePoints); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - } - return true; - } - if (foundWindow(mode, name, "W")) - { - ACanvas.getCanvas().setCurrentWindow(name.substring(1, 2)); - return true; - } - if (foundWindow(mode, name, "C")) - { - return true; - } - if (foundWindow(mode, name, "Z")) - { - return true; - } - return false; - } // processGlobal() ------------------------------------------------------ - - private synchronized static void processLegoTrigger() - { - String currentWindowName = ACanvas.getCanvas().getCurrentWindowName(); - String currentLayoutName = ACanvas.getCanvas().getCurrentLayout().getName(); - - //save status of windows on first time button pressed - if(legoLayoutName.equals("")) - { - //output message to the user - AOutput.append("\nWindows changed to:\n",ALogInterface.TITLE); - AOutput.append("Window 1: LegoPlot with Calo View\n", ALogInterface.NORMAL); - AOutput.append("Window 2: LegoPlot with Trigger Tower View\n", ALogInterface.NORMAL); - AOutput.append("Window 3: LegoPlot with Jet Element View\n", ALogInterface.NORMAL); - AOutput.append("Window 4: LegoPlot Legend (may not be displayed if window too small)\n", ALogInterface.NORMAL); - //save current window name and layout to then parameters to restore later - legoWindowNames[0]=currentWindowName; - legoLayoutName=currentLayoutName; - for(int i=0; i<legoWindowNames.length; i++) - { - parameterStore.selectWindowParameters(legoWindowNames[i]); - if (ACanvas.getCanvas().getWindow(legoWindowNames[i]) != null) - { - //save lego status parameters - for(int j=0; j<legoStatusParameterNames.length; j++){ - legoStatusParameter[i][j]=parameterStore.get("LegoPlot", legoStatusParameterNames[j]).getStatus(); - } - //save lego int parameters - for(int j=0; j<legoIntParameterNames.length; j++){ - legoIntParameter[i][j]=parameterStore.get("LegoPlot", legoIntParameterNames[j]).getI(); - } - //save data parameters for windows 1 and 4 - if(legoWindowNames[i].equals("1")){ - for(int j=0; j<legoCaloParameterNames.length; j++){ - legoCaloParameter[0][j]=parameterStore.get("Data", legoCaloParameterNames[j]).getStatus(); - } - }else if(legoWindowNames[i].equals("4")){ - for(int j=0; j<legoCaloParameterNames.length; j++){ - legoCaloParameter[1][j]=parameterStore.get("Data", legoCaloParameterNames[j]).getStatus(); - } - } - } - parameterStore.restoreWindowParameters(); - } - } - //copy to W to make sure can switch layout to 4 squares - ACanvas.getCanvas().copyWindowSettings(currentWindowName, "W"); - if(!currentLayoutName.equals("FOUR SQUARES")) - ACanvas.getCanvas().setCurrentLayout("FOUR SQUARES"); - //for cell sizing take defaults values and then roughly scaled for different views - int nphicells = 128; - int netacells = 200; - //now copy to each window and set the display correctly - for (int i = 0; i < 4; i++) - { - String wName = Integer.toString(i + 1); - AWindow w = ACanvas.getCanvas().getWindow(wName); - parameterStore.selectWindowParameters(wName); - if (w != null) - { - ACanvas.getCanvas().copyWindowSettings("W", wName); - //first 3 windows show data items (calo, trigger towers, jet elements) - if(i<3) - { - parameterStore.get("LegoPlot", "Mode").setI(i); - parameterStore.get("LegoPlot", "DrawPlot").setStatus(true); - parameterStore.get("LegoPlot", "MainLegend").setStatus(false); - parameterStore.get("LegoPlot", "L1EtLegend").setStatus(false); - parameterStore.get("LegoPlot", "L1Items").setStatus(false); - parameterStore.get("LegoPlot", "L2Items").setStatus(false); - parameterStore.get("LegoPlot", "EFItems").setStatus(false); - parameterStore.get("LegoPlot", "nphicells").setI(nphicells/((int) Math.pow(2.0, i))); - parameterStore.get("LegoPlot", "netacells").setI(netacells/((int) Math.pow(2.0, i))); - } - else - { - //last window shows legend - parameterStore.get("LegoPlot", "DrawPlot").setStatus(false); - parameterStore.get("LegoPlot", "MainLegend").setStatus(true); - parameterStore.get("LegoPlot", "L1EtLegend").setStatus(true); - parameterStore.get("LegoPlot", "L1Items").setStatus(true); - parameterStore.get("LegoPlot", "L2Items").setStatus(true); - parameterStore.get("LegoPlot", "EFItems").setStatus(true); - } - //if first or last window it needs the data items turned on - if(i==0 || i==3) - { - for(int j=0; j<legoCaloParameterNames.length; j++){ - parameterStore.get("Data", legoCaloParameterNames[j]).setStatus(true); - } - } - } - parameterStore.restoreWindowParameters(); - ACanvas.getCanvas().moveToFrontWindow(w.getName()); - w.repaintFromScratch(); - - } - } - - private synchronized static void returnLegoTrigger() - { - //now will reset the parameters explictly set by trigger debug mode - //others may be changed as on doing trigger debug others might get changed - //when the current window is copied to W but these have been changed by the - //user so not so important to reset - - //loop backwards so can reset each window before reverting to previous layout - for(int i=legoWindowNames.length-1; i>=0; i--) - { - //reset the lego status parameters - parameterStore.selectWindowParameters(legoWindowNames[i]); - for(int j=0; j<legoStatusParameterNames.length; j++){ - parameterStore.get("LegoPlot", legoStatusParameterNames[j]).setStatus(legoStatusParameter[i][j]); - } - //reset the lego int parameters - for(int j=0; j<legoIntParameterNames.length; j++){ - parameterStore.get("LegoPlot", legoIntParameterNames[j]).setI(legoIntParameter[i][j]); - } - //reset the data ites for windows 1 and 4 - if(legoWindowNames[i].equals("1")){ - for(int j=0; j<legoCaloParameterNames.length; j++){ - parameterStore.get("Data", legoCaloParameterNames[j]).setStatus(legoCaloParameter[0][j]); - } - }else if(legoWindowNames[i].equals("4")){ - for(int j=0; j<legoCaloParameterNames.length; j++){ - parameterStore.get("Data", legoCaloParameterNames[j]).setStatus(legoCaloParameter[1][j]); - } - } - parameterStore.restoreWindowParameters(); - //finished altering window so repaint - ACanvas.getCanvas().getWindow(legoWindowNames[i]).repaintFromScratch(); - //have just finished W window so now can reset the layout - if(i==1){ - ACanvas.getCanvas().setCurrentLayout(legoLayoutName); - legoLayoutName=""; - } - } - //everything reset now make the original window where trigger debug - //was started the current window - ACanvas.getCanvas().setCurrentWindow(legoWindowNames[0]); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/ACutParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/ACutParameter.java deleted file mode 100755 index 490114e3e659c74948a81454c61da549a6ee3f98..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/ACutParameter.java +++ /dev/null @@ -1,171 +0,0 @@ -package atlantis.parameters; - -import java.awt.Color; -import java.awt.event.*; -import javax.swing.*; - -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.utils.AUtilities; -import atlantis.gui.AMutableCheckBox; -import atlantis.gui.AParametersTable; -import atlantis.gui.ATextField; - -/** - * A parameter representing a cut on a variable. - */ -public class ACutParameter extends AAbstractParameter { - // name component - private AMutableCheckBox checkBox; - - // value component - private ATextField textField; - - private ActionListener statusActionListener, valueActionListener; - - public ACutParameter( - String name, String screenName, String toolTip, String pv, int valueType, double value, - String operators, String defOperator, boolean haseStatus, boolean status, boolean isMod, - int userLevel, int scope, int unitsOf) { - - super(name, screenName, toolTip, valueType, value, operators, defOperator, haseStatus, status, - isMod, userLevel, scope, unitsOf); - - range=resolvePossibleValues(pv, valueType); - } - - public void setD(double v) { - if(valueType!=FLOAT) throw new IllegalArgumentException("setD acces on not FLOAT parameter"); - - if(textField!=null) textField.setText(""+v); - _setD(v); - - refresh(); - } - - public void setI(int v) { - if(valueType!=INT) throw new IllegalArgumentException("setI acces on not INT parameter"); - - if(textField!=null) textField.setText(""+v); - _setI(v); - - refresh(); - } - - public void initialize() { - checkBox=new AMutableCheckBox(screenName); - checkBox.setToolTipText(toolTip); - if(getScope()==LOCAL) - checkBox.setForeground(Color.black); - else - checkBox.setForeground(Color.blue); - - for(int i=0; i<operators.length; i++) - checkBox.addItem(operators[i]); - - checkBox.finalizeConstruction(); - checkBox.setSelectedText(getOperator()); - - statusActionListener=new ActionListener() { - public void actionPerformed(ActionEvent e) { - ACommandProcessor.receive(name); - apply(); - } - }; - - valueActionListener=new ActionListener() { - public void actionPerformed(ActionEvent e) { - applyInput(); - } - }; - - checkBox.addStatusActionListener(statusActionListener); - checkBox.addTextActionListener(valueActionListener); - - // after the first left click at the table in the parameter tabbed pane, - // all the followingmouse mouse event will be catched by the mouselisteners of those - // components inside the table cells, not the table itself, so in order for the local/global - // switch (right click to change) to always work, have to add mouse listeners to these components - // as well. - checkBox.getCheckBox().addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - if(AUtilities.isRightMouseButton(e)) { - JPopupMenu popupMenu=new JPopupMenu(); - if(getScope()==AParameter.LOCAL) { - popupMenu.add(AParametersTable.SET_GLOBAL).addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - changeScope(AParameter.GLOBAL); - refresh(); - } - }); - } else { - popupMenu.add(AParametersTable.SET_LOCAL).addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - changeScope(AParameter.LOCAL); - refresh(); - } - }); - } - popupMenu.show(checkBox.getCheckBox(), e.getX(), e.getY()); - } - } - }); - - textField=new ATextField(); - textField.setToolTipText(toolTip); - - if(valueType==FLOAT) - textField.setText(""+getD()); - else - textField.setText(""+getI()); - - textField.addActionListener(valueActionListener); - - /* - textField.addFocusListener(new FocusAdapter() { - public void focusLost(FocusEvent e) { - applyInput(); - } - }); - */ - } - - private void applyInput() { - try { - if(valueType==FLOAT) { - double v=parseUnitsDouble(textField.getText()); - - ACommandProcessor.receive(name+checkBox.getSelectedText()+v); - apply(); - } else { - int v=Integer.parseInt(textField.getText()); - - ACommandProcessor.receive(name+checkBox.getSelectedText()+v); - apply(); - } - } catch(NumberFormatException nfe) { - AOutput.append("value: "+textField.getText()+", is not correct!", ALogInterface.BAD_COMMAND); - } - } - - public JComponent getValueComponent() { - return textField; - } - - public JComponent getNameComponent() { - return checkBox; - } - - public void refresh() { - if(textField!=null) { - if(valueType==FLOAT) - textField.setText(parseUnits(getD())); - else - textField.setText(""+getI()); - } - if(checkBox!=null) checkBox.setStatus(getStatus()); - if(checkBox!=null) checkBox.setSelectedText(getOperator()); - fireParameterChanged(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AEnumeratorParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/AEnumeratorParameter.java deleted file mode 100755 index 92cdc8019c756e2d385ecb6fe3a0328b8822280b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AEnumeratorParameter.java +++ /dev/null @@ -1,278 +0,0 @@ -package atlantis.parameters; - -import java.util.StringTokenizer; -import java.util.Hashtable; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import javax.swing.JComponent; - -import atlantis.output.AExceptionHandler; -import atlantis.gui.AComboBox; - - -/** - * A parameter that displays a finite list of possible values. - * Used to contain items in pTexts String[], reimplemented to contain items - * in Hash in order to be able to change the contents from event to event - * (because of the multiple collections cuts). - */ -public class AEnumeratorParameter extends AAbstractParameter -{ - private AComboBox comboBox; - private Hashtable<Integer, String> pTexts; - - - - public AEnumeratorParameter(String name, String screenName, String toolTip, - String possibleValues, double value, - boolean haseStatus, boolean status, - int userLevel, int scope) - { - super(name, screenName, toolTip, INT, value, null, null, haseStatus, - status, false, userLevel, scope, NOTHING); - - StringTokenizer st, tokenSt; - st = new StringTokenizer(possibleValues, ","); - int num = st.countTokens(); - if(num <= 0) - { - throw new Error("Empty \"pv\" attribute for ENUM: " + name); - } - pTexts = new Hashtable<Integer, String>(); - comboBox = new AComboBox(); - comboBox.setName(screenName); - - range = new double[3][]; - range[MIN] = null; - range[MAX] = null; - range[SVAL] = new double[num]; - - for(int i = 0; i < num; i++) - { - tokenSt = new StringTokenizer(st.nextToken(), "="); - if(tokenSt.countTokens() != 2) - { - throw new Error("Incomplete \"text = value\" declaration " + - "for ENUM: " + name); - } - pTexts.put(new Integer(i), tokenSt.nextToken().trim()); - - try - { - if(valueType == FLOAT) - { - range[SVAL][i] = - Double.parseDouble(tokenSt.nextToken().trim()); - } - else if(valueType == INT) - { - range[SVAL][i] = - Integer.parseInt(tokenSt.nextToken().trim()); - } - } - catch(NumberFormatException nfe) - { - String msg = "Number error for ENUM: " + name + possibleValues; - AExceptionHandler.processException(msg, nfe); - } - } - - } // AEnumeratorParameter() --------------------------------------------- - - - - public void setD(double v) - { - if(valueType != FLOAT) - { - throw new Error("setD access on not FLOAT parameter"); - } - if(comboBox != null) - { - comboBox.setGUISelectedItem(getText(v)); - } - _setD(v); - refresh(); - - } // setD() ------------------------------------------------------------- - - - - public void setI(int v) - { - if(valueType != INT) - { - throw new Error("setI access on not INT parameter"); - } - if(comboBox != null) - { - comboBox.setGUISelectedItem(getText(v)); - } - _setI(v); - refresh(); - - } // setI() ------------------------------------------------------------- - - - - public String getCurrentText() - { - return getText(getI()); - - } // getCurrentText() --------------------------------------------------- - - - - public void clear() - { - pTexts.clear(); - - } // clear() ------------------------------------------------------------ - - - - public Hashtable<Integer, String> getValuesHashtable() - { - return pTexts; - - } // getValuesHashtable() ----------------------------------------------- - - - - public int size() - { - return pTexts.size(); - - } // size() ------------------------------------------------------------- - - - - public String getText(double v) - { - for(int i = 0; i < pTexts.size(); i++) - { - if(range[SVAL][i] == v) - { - return pTexts.get(new Integer(i)); - } - } - return null; - - } // getText() ---------------------------------------------------------- - - - - public double getValue(String text) - { - for(int i = 0; i < pTexts.size(); i++) - { - if(text.equals(pTexts.get(new Integer(i)))) - { - return range[SVAL][i]; - } - } - return 0; - - } // getValue() --------------------------------------------------------- - - - - public void addItem(int key, String item) - { - pTexts.put(new Integer(key), item); - range[SVAL] = new double[pTexts.size()]; - for(int i = 0; i < pTexts.size(); i++) - { - range[SVAL][i] = i; - } - - } // addItem() ---------------------------------------------------------- - - - public void removeItem(String itemToRemove) - { - Hashtable<Integer, String> pTextsNew = new Hashtable<Integer, String>(); - for(int i = 0; i < pTexts.size(); i++) - { - String item = pTexts.get(new Integer(i)); - if(itemToRemove.equals(item)) - { - continue; - } - else - { - pTextsNew.put(new Integer(pTextsNew.size()), item); - } - } - pTexts = pTextsNew; - - range[SVAL] = new double[pTexts.size()]; - for(int i = 0; i < pTexts.size(); i++) - { - range[SVAL][i] = i; - } - - } // removeItem() ------------------------------------------------------- - - - - /** - * Initialize the contained AComboBox with the list of items stored in this AEnumeratorParameter. - * Also sets a listener to send the appropriate command when an item is selected. - */ - public void initialize() - { - super.initialize(); - // remove all existing items from, in the constructor created, comboBox - // rather than create a new instance here, because after the first - // call of this initialize() method is not possible to update items - // in the comboBox - comboBox.removeAllItems(); - comboBox.setToolTipText(toolTip); - for(int i = 0; i < pTexts.size(); i++) - { - String item = pTexts.get(new Integer(i)); - comboBox.addItem(item); - } - comboBox.setGUISelectedItem(getText(getI())); - if (!comboBox.hasGUIItemListener()) { - comboBox.setGUIItemListener(new ItemListener() - { - public void itemStateChanged(ItemEvent e) - { - if(e.getStateChange() == ItemEvent.SELECTED) - { - int index = comboBox.getSelectedIndex(); - String command = name + "=" + range[SVAL][index]; - ACommandProcessor.receive(command); - apply(); - } - } - }); - } - refresh(); - } // initialize() ------------------------------------------------------- - - - - public JComponent getValueComponent() - { - return comboBox; - - } // getValueComponent() ------------------------------------------------ - - - - public void refresh() - { - _refresh(); - if(comboBox != null) - { - comboBox.setGUISelectedItem(getText(getI())); - } - fireParameterChanged(); - } // refresh() ---------------------------------------------------------- - - - -} // class AEnumeratorParameter ============================================= diff --git a/graphics/AtlantisJava/src/atlantis/parameters/ALinkParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/ALinkParameter.java deleted file mode 100755 index c1c732e42e6737a87e04a5765374ec3a0e8db682..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/ALinkParameter.java +++ /dev/null @@ -1,151 +0,0 @@ -package atlantis.parameters; - - -import java.util.StringTokenizer; -import javax.swing.JComponent; - - -/** - * A parameter which represents a link to another parameter. - */ -public class ALinkParameter implements AParameter { - private String groupName, parameterName; - private AParameter parameter=null; - - public ALinkParameter(String linkTo) { - StringTokenizer st=new StringTokenizer(linkTo.trim(), "."); - - groupName=st.nextToken().trim(); - parameterName=st.nextToken().trim(); - } - - public void solveLink() { - parameter=APar.instance().get(groupName, parameterName); - } - - public void initialize() { - parameter.initialize(); - } - - public boolean isInitialized() { - return parameter.isInitialized(); - } - - public void copy(int from, int to) { - parameter.copy(from, to); - } - - public void globalize(int window) { - parameter.globalize(window); - } - - public boolean isModulus() { - return parameter.isModulus(); - } - - public int getValueType() { - return parameter.getValueType(); - } - - public void setScope(int scope) {} - - public void changeScope(int scope) { - parameter.changeScope(scope); - } - - public int getScope() { - return parameter.getScope(); - } - - public String getName() { - return parameter.getName(); - } - - public String getScreenName() { - return parameter.getScreenName(); - } - - public String getToolTip() { - return parameter.getToolTip(); - } - - public boolean validateOperator(String oper) { - return parameter.validateOperator(oper); - } - - public boolean validateValue(double v) { - return parameter.validateValue(v); - } - - public void setD(double v) { - parameter.setD(v); - } - - public void setI(int v) { - parameter.setI(v); - } - - public double getD() { - return parameter.getD(); - } - - public int getI() { - return parameter.getI(); - } - - public String getValue() { - return parameter.getValue(); - } - - public String getCurrentText(){ - if(parameter instanceof AEnumeratorParameter) - return ((AEnumeratorParameter) parameter).getCurrentText(); - else - return null; - } - - public void setStatus(boolean status) { - parameter.setStatus(status); - } - - public boolean getStatus() { - return parameter.getStatus(); - } - - public String toString() { - return parameter.toString(); - } - - public String getOperator() { - return parameter.getOperator(); - } - - public boolean processCommand(String oper, double value) { - return parameter.processCommand(oper, value); - } - - public JComponent getValueComponent() { - return parameter.getValueComponent(); - } - - public JComponent getNameComponent() { - return parameter.getNameComponent(); - } - - public void refresh() { - parameter.refresh(); - } - - public int getUserLevel() { - return parameter.getUserLevel(); - } - - public String getDifferences(String groupName) { - return ""; - } - - @Override - public void addParameterChangeListener(AParameterChangeListener listener) { - if (parameter!=null) parameter.addParameterChangeListener(listener); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AListIntegerParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/AListIntegerParameter.java deleted file mode 100755 index 0f26c15881369f799e60ed40ca2b94ecedeb51f3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AListIntegerParameter.java +++ /dev/null @@ -1,98 +0,0 @@ -package atlantis.parameters; - -import atlantis.utils.*; -import atlantis.gui.AComboBox; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import javax.swing.JComponent; - -/** - * A parameter which shows a list of possible integer values. - */ -public class AListIntegerParameter extends AAbstractParameter { - - private static ALogger logger = ALogger.getLogger(AListIntegerParameter.class); - - private AComboBox comboBox; - int[] displayableValues; - - public AListIntegerParameter( - String name, String screenName, String toolTip, String pv, int value, - boolean haseStatus, boolean status, int userLevel, int scope) { - - super(name, screenName, toolTip, INT, value, null, null, haseStatus, status, false, userLevel, - scope, NOTHING); - - range=resolvePossibleValues(pv, INT); - displayableValues=getValues(pv); - } - - public void setD(double v) { - throw new IllegalArgumentException("is not allowed to use setD on AListIntegerParameter"); - } - - public void setI(int v) { - if(comboBox!=null) comboBox.setGUISelectedItem(""+v); - _setI(v); - refresh(); - } - - public void initialize() { - super.initialize(); - comboBox=new AComboBox(); - comboBox.setEditable(true); - comboBox.setToolTipText(toolTip); - - for(int i=0; i<displayableValues.length; i++) - if(validateValue(displayableValues[i])) - comboBox.addItem(""+displayableValues[i]); - else throw new Error("Displayable Value: "+displayableValues[i]+" cannot be validated" - +toString()); - - comboBox.setGUISelectedItem(""+getI()); - - comboBox.setGUIItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - if(e.getStateChange()==ItemEvent.SELECTED) - applyInput(); - } - }); - - /* - comboBox.addFocusListener(new FocusAdapter() { - public void focusLost(FocusEvent e) { - applyInput(); - } - }); - */ - } - - private void applyInput() { - boolean error=false; - - try { - int val=Integer.parseInt((String)comboBox.getSelectedItem()); - - if(validateValue(val)) { - ACommandProcessor.receive(name+"="+val); - apply(); - } else - error=true; - } catch(NumberFormatException nfe) { - error=true; - } - if(error) - logger.error("value: "+comboBox.getSelectedItem()+", is not correct!"); - } - - public JComponent getValueComponent() { - return comboBox; - } - - public void refresh() { - _refresh(); - if(comboBox!=null) comboBox.setGUISelectedItem(""+getI()); - fireParameterChanged(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/ANumberParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/ANumberParameter.java deleted file mode 100755 index 403285e8648c19242cac5dd603729afa441fc380..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/ANumberParameter.java +++ /dev/null @@ -1,104 +0,0 @@ -package atlantis.parameters; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.JComponent; - -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.gui.ATextField; - -public class ANumberParameter extends AAbstractParameter { - private ATextField textField; - - public ANumberParameter( - String name, String screenName, String toolTip, String pv, int valueType, double value, - boolean haseStatus, boolean status, boolean isMod, int userLevel, int scope, int unitsOf) { - - super(name, screenName, toolTip, valueType, value, null, null, haseStatus, status, isMod, - userLevel, scope, unitsOf); - range=resolvePossibleValues(pv, valueType); - } - - public void setD(double v) { - if(valueType!=FLOAT) - throw new IllegalArgumentException("setD acces on not FLOAT parameter"); - - _setD(v); - refresh(); - } - - public void setI(int v) { - if(valueType!=INT) - throw new IllegalArgumentException("setI acces on not INT parameter"); - - if(textField!=null) textField.setText(""+v); - _setI(v); - } - - public void initialize() { - super.initialize(); - - textField=new ATextField(); - textField.setEditable(true); - textField.setToolTipText(toolTip); - - if(valueType==FLOAT) - textField.setText(""+getD()); - else - textField.setText(""+getI()); - - textField.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - applyInput(); - } - }); - - /* - textField.addFocusListener(new FocusAdapter() { - public void focusLost(FocusEvent e) { - applyInput(); - } - }); - */ - } - - private void applyInput() { - boolean error=false; - - try { - double val=parseUnitsDouble(textField.getText()); - - if(validateValue(val)) { - if(valueType==FLOAT) { - ACommandProcessor.receive(name+getOperator()+val); - apply(); - } else { - ACommandProcessor.receive(name+getOperator()+(int)val); - apply(); - } - } else - error=true; - } catch(NumberFormatException nfe) { - error=true; - } - if(error) - AOutput.append("value: "+textField.getText()+", is not correct!", ALogInterface.BAD_COMMAND); - } - - public JComponent getValueComponent() { - return textField; - } - - public void refresh() { - _refresh(); - if(textField!=null) { - if(valueType==FLOAT) - textField.setText(parseUnits(getD())); - else - textField.setText(""+getI()); - } - fireParameterChanged(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/APar.java b/graphics/AtlantisJava/src/atlantis/parameters/APar.java deleted file mode 100644 index 1aefa78f03b75d652d3bf1e2b04bfad5f4e5b201..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/APar.java +++ /dev/null @@ -1,657 +0,0 @@ -package atlantis.parameters; - -import java.util.ArrayList; - -import java.util.HashSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Set; -import java.util.Vector; - -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.data.AJetData; -import atlantis.event.AEvent; -import atlantis.event.AEventManager; -import atlantis.event.ANewEventListener; -import atlantis.utils.ALogger; -import atlantis.utils.xml.AXMLUtils; - -/** - * The Atlantis parameters store. Contains a list of AParametersGroup - * groups of parameters. - * - * The class keeps a reference to a singleton instance, but this must initially be created using - * the method {@link #construct(Node)}. Attempting to access the instance before initialization will - * cause an Error to be thrown. - * - * Ideally the APar instance would be passed to the classes that need it when the application is - * initalized, but currently the instance is fetched where it is needed, in many different parts of - * the code. - */ -public final class APar implements ANewEventListener, AParameterChangeListener -{ - private static ALogger logger = ALogger.getLogger(APar.class); - - private final List<AParameterSuperGroup> superGroups = new ArrayList<AParameterSuperGroup>(); - - /** Index of the currently selected window */ - private int currentWindowIndex; - /** Index of the previously selected window. - * Used for obtaining temporary access to parameters of some window! - */ - private int previousIndex; - - /** Parameter change listeners: just the GUI for now. */ - private List<AParameterChangeListener> parameterChangeListeners = new ArrayList<AParameterChangeListener>(); - - /** The user level of the program */ - private int userLevel; - - /** The singleton instance */ - private static APar instance; - - /** - * Create and return the singleton instance. - * @param parameters - */ - public synchronized static APar construct(Node parameters) { - instance = new APar(); - instance.initialize(parameters); - return instance; - } - - /** - * Get the singleton instance. - * @return - */ - public synchronized static APar instance() { - if (instance==null) throw new Error("Attempted to access APar instance before initialization."); - return instance; - } - - /** - * For testing only: create instance without initializing. - * @return - */ - public static synchronized APar constructDummyForTesting() { - instance = new APar(); - return instance; - } - - /** - * Constructs dummy singleton instance for testing. - */ - private APar() {} - - /** - * Constructs the singleton instance by reading the config file. - */ - private void initialize(Node parameters) - { - String ul=parameters.getAttributes().getNamedItem("userLevel").getNodeValue(); - userLevel=Integer.parseInt(ul); - - NodeList superGroupNodes=parameters.getChildNodes(); - for(int s=0; s<superGroupNodes.getLength(); s++) - { - Node superGroupNode = superGroupNodes.item(s); - if (superGroupNode.getNodeType() == Node.ELEMENT_NODE) - { - // here we have a <SuperGroup> element - AParameterSuperGroup superGroup = AParameterSuperGroup.readSuperGroup(superGroupNode,userLevel); - superGroup.addParameterChangeListener(this); - - this.superGroups.add(superGroup); - } - } - // Can't resolve link parameters until all parameters configured. - for (AParameterSuperGroup superGroup : superGroups) { - superGroup.resolveLinkParameters(); - } - - previousIndex=-1; - } - - /** Used to take into account differences in local parameters. */ - public void update(Node differences) - { - if(differences==null) return; - NodeList children=differences.getChildNodes(); - int childrenCount=children.getLength(); - for(int i=0; i<childrenCount; i++) - { - Node diff=children.item(i); - if(diff.getNodeType()==Node.ELEMENT_NODE) - { - NamedNodeMap attributes=diff.getAttributes(); - String group=AXMLUtils.tryAttribut(attributes, "group"); - String name=AXMLUtils.tryAttribut(attributes, "name"); - String windowName=AXMLUtils.tryAttribut(attributes, "windowName"); - String va=AXMLUtils.tryAttribut(attributes, "va"); - String st=AXMLUtils.tryAttribut(attributes, "st"); - String op=AXMLUtils.tryAttribut(attributes, "op"); - AParameter p=get(group, name); - if(p instanceof AAbstractParameter) - { - // When setting a global variable for just one window, make it local first - if (((AAbstractParameter)p).getScope() == AAbstractParameter.GLOBAL && !windowName.equals("*")) { - System.out.println("Setting scope to local for "+p.getName()); - ((AAbstractParameter)p).setScope(AAbstractParameter.LOCAL); - } - if(va!=null&&!va.equals("")) - { - ((AAbstractParameter)p)._setValue(windowName, Double.parseDouble(va)); - } - if(st!=null&&!st.equals("")) - { - if(st.equals("ON")) - ((AAbstractParameter)p)._setStatus(windowName, true); - else if(st.equals("OFF")) - ((AAbstractParameter)p)._setStatus(windowName, false); - } - if(op!=null&&!op.equals("")) - { - ((AAbstractParameter)p)._setOperator(windowName, op); - } - ((AAbstractParameter)p).saveDefaults(); - } - } - } - } - - /** Restore default settings of all parameters. */ - public void restoreDefaults() - { - for (AParameterSuperGroup superGroup : superGroups) { - superGroup.restoreDefaults(); - } - } - - /** - * Get parameter supergroups corresponding to current user level. - * i.e. Those with a user level less than or equal to the current level. - * @return supergroups corresponding to current user level - */ - public List<AParameterSuperGroup> getUISuperGroups() { - List<AParameterSuperGroup> uiSuperGroups = new ArrayList<AParameterSuperGroup>(); - for (AParameterSuperGroup superGroup : superGroups) { - if (superGroup.getUserLevel()<=this.userLevel) uiSuperGroups.add(superGroup); - } - return uiSuperGroups; - } - - /** - * Get all the parameter groups used by the GUI, according to the user level. - * @return the parameter groups - */ - public AParametersGroup[][] getUIGroups() - { - List<AParametersGroup[]> uiSuperGroups = new ArrayList<AParametersGroup[]>(); - for (AParameterSuperGroup superGroup : superGroups) { - List<AParametersGroup> uiGroups = superGroup.getUIGroups(); - AParametersGroup[] uiGroupsArray = uiGroups.toArray(new AParametersGroup[uiGroups.size()]); - uiSuperGroups.add(uiGroupsArray); - } - AParametersGroup[][] groups = - uiSuperGroups.toArray(new AParametersGroup[uiSuperGroups.size()][]); - return groups; - } - - /** - * Get names of groups of given usage type to display in GUI. - * @param uiUsage UI usage type to select - * @return the group names - */ - public Vector<String> getUIGroupNames(int uiUsage) {return getUIGroupNames(false,uiUsage);} - - /** - * Get names of groups to display in GUI. - * @return the group names - */ - public Vector<String> getUIGroupNames() {return getUIGroupNames(true,0);} - - /** - * Get names of groups to display in GUI. - * @param selectAll true to select all regardless of UI usage - * @param uiUsage ignored if selectAll is true - * @return the group names - */ - private Vector<String> getUIGroupNames(boolean selectAll, int uiUsage) { - Vector<String> v=new Vector<String>(); - AParametersGroup[][] g=getUIGroups(); - for(int i=0;i<g.length;++i) - for(int j=0;j<g[i].length;++j) - if(selectAll || (g[i][j].getUIUsage()==uiUsage)) - v.addElement(g[i][j].getGroupName()); - return v; - } - - /** - * Find parameter group with given name. - * @param groupName name to look for - * @return the group, or null if not found - */ - public AParametersGroup getGroup(String groupName) - { - for (AParameterSuperGroup superGroup : superGroups) { - AParametersGroup group = superGroup.getGroup(groupName); - if (group!=null) return group; - } - return null; - } - - public int getUserLevel() - { - return userLevel; - } - - public AParameter get(String group, String name) - { - AParametersGroup g = getGroup(group); - if(g == null) - { - logger.debug("No group named \"" + group + "\""); - return null; - } - - AParameter p = g.getParameter(name); - if(p == null) - { - logger.debug("No parameter named \"" + group + ":" + name + "\""); - } - - return p; - } - - public AParameter getUnknown(String group, String name) - { - AParametersGroup grp = getGroup(group); - if(grp==null) - return null; - else - return grp.getParameter(name); - } - - /** - * Returns the values of an array of parameters - * (can be ANY order: C1, C2, C3 ...) - */ - public int[] getArray(String groupName, String name, int numEntries) - { - int[] array=new int[numEntries]; - - String baseName=name.substring(0, name.length()-1); - int baseNumber=Integer.parseInt(name.substring(name.length()-1, name.length())); - - for(int i=0; i<numEntries; i++) - array[i]=this.get(groupName, baseName+(baseNumber+i)).getI(); - - return array; - } - - boolean processParameterChangeCommand(String parameterChangeCommand) - { - String parameterName, sValue; - double value; - AParameter parameter=null; - String groupName = ACanvas.getCanvas().getCurrentWindow().getGroupName(); - - for(int i=0; i<AParameter.supportedOperators.length; i++) - { - int index=parameterChangeCommand.indexOf(AParameter.supportedOperators[i]); - - if(index!=-1) - { - parameterName=parameterChangeCommand.substring(0, index).trim(); - AParametersGroup pg = getGroup(groupName); - - parameter=pg.getParameter(parameterName); - - /* AEvent calls listbox initialize in order to change its values from - event to event basis - AEnumeratorParameter.initialize() -> - ACommandProcessor.receive() -> .process() -> - APar.processParameterChangeCommand() - - In case of ETMis - warning 'ETMisCollections=0.0 bad command' when - ATLAS->ETMis group wasn't the active one for a current window. - Following statement however continues if the group tab (ETMis) is - active, so it's not a bad command. - This will have to be dealt with when implementing the keyboard - commands mode of driving Atlantis, it would have to be possible to - change values, etc of group tabs which are not active. It should be - easy as local commands (like ETMisCollections) would say name of - parameter group they belong to. Proper groupName would the only problem. - */ - if(parameter==null) - { - logger.debug("APar: warning: parameter " + parameterName + - " doesn't exist " + "in active group tab " + groupName); - return true; // prevent printing warning 'bad command ...' - - // return false; - used to, hence raising 'bad command ... ' in - // ACommandProcessor.receive(). the same effect. - } - - sValue=parameterChangeCommand.substring(index+AParameter.supportedOperators[i].length(), parameterChangeCommand.length()).trim(); - - if(sValue.equals("")) break; - - try - { - value=Double.parseDouble(sValue); - } - catch(NumberFormatException e) - { - return false; - } - - return parameter.processCommand(AParameter.supportedOperators[i], value); - } - } - - AParametersGroup pg = getGroup(groupName); - - parameterName=parameterChangeCommand.trim(); - parameter=pg.getParameter(parameterName); - if(parameter!=null) - { - if(parameter.getStatus()==true) - parameter.setStatus(false); - else - parameter.setStatus(true); - return true; - } - else - return false; - } - - /** - * Copy parameters from one window to another. - * @param sourceName name of source window - * @param destName name of destination window - */ - public void copyParameters(String sourceName, String destName) - { - for (AParameterSuperGroup superGroup : superGroups) { - superGroup.copyParameters(sourceName, destName); - } - } - - public void copyCurrentGroupLocalsTo(String destinationWindow) - { - if(ACanvas.getCanvas().isValidWindowName(destinationWindow)) - { - AWindow w=ACanvas.getCanvas().getCurrentWindow(); - Vector<AParameter> params=(getGroup(w.getGroupName())).getParameters(userLevel); - - int from=w.getIndex(); - int to=ACanvas.getCanvas().getWindow(destinationWindow).getIndex(); - - for(int i=0; i<params.size(); i++) - { - AParameter p=(AParameter)params.elementAt(i); - - if(p.getScope()==AParameter.LOCAL) - p.copy(from, to); - } - } - else - throw new Error("copyCurrentGroupLocalsTo, unknown: "+destinationWindow); - } - - /** - * selectWindowParameters/restoreWindowParameters methods are used for - * obtaining temporary access to parameters of some window - */ - public void selectWindowParameters(String newWindow) - { - //ACH - this was getting thrown sometimes, and I don't know why... - //if(previousIndex!=-1) - //throw new Error("selectWindowParameters, Try to select twice !?"); - - if(ACanvas.getCanvas().isValidWindowName(newWindow)) - { - previousIndex=getCurrentWindowIndex(); - setCurrentWindowIndex(ACanvas.getCanvas().getWindow(newWindow).getIndex()); - } - else - throw new Error("selectWindowParameters, window: "+newWindow+" , doesn't exist !?"); - } - - /** - * selectWindowParameters/restoreWindowParameters methods are used for - * obtaining temporary access to parameters of some window - */ - public void restoreWindowParameters() - { - if(previousIndex!=-1) - { - setCurrentWindowIndex(previousIndex); - previousIndex=-1; - } - else - throw new Error("restoreWindowParameters: you have nothing to restore !?"); - } - - /** - * @param currentWindowIndex the currentWindowIndex to set - */ - public void setCurrentWindowIndex(int currentWindowIndex) { - this.currentWindowIndex = currentWindowIndex; - } - - /** - * @return the currentWindowIndex - */ - public int getCurrentWindowIndex() { - return currentWindowIndex; - } - - /** - * Add a listener to be informed of parameter changes. - * - * @param listener - */ - public void addParameterChangeListener(AParameterChangeListener listener) { - parameterChangeListeners.add(listener); - } - - /** - * Tell the listeners that a parameter has changed. - */ - @Override - public void parameterChanged(AParameter parameter) { - if(parameter.getName().equals("JetBTagger")){ - this.setDefaultBTaggerValue(parameter); - } - for (AParameterChangeListener listener : parameterChangeListeners) { - listener.parameterChanged(parameter); - } - } - - @Override - public void newEvent(AEvent event) { - // update collection cut listboxes for collection-aware datatypes - updateCollectionsListBoxes(event); - updateBTaggerListBox(event); - } - - /** - * Update collection cut listboxes for collection-aware datatypes. - */ - private void updateCollectionsListBoxes(AEvent event) - { - Hashtable<String,Vector<String>> collections = event.getCollections(); - String listBoxName = null; - Hashtable<Integer, String> listBoxPreviousContents = null; - Vector<String> keys = null; - String[] keysArray = null; - boolean contentsChanged = false; // contents of listbox change watchdog - Set<AEnumeratorParameter> updatedEnumeratorParameters = new HashSet<AEnumeratorParameter>(); - - // note - listBox.initialize() - // if tab containing this particular listbox was active, it didn't - // take effect to set different value by .setI() as default value - // was in this case always the first one added - .initialize() called - // automatically when tabpane is active - // if tabpane wasn't active it worked fine - for (String dataTypeName : collections.keySet()) - { - contentsChanged = false; - listBoxName = dataTypeName + "Collections"; - keys = collections.get(dataTypeName); - AEnumeratorParameter listBox = (AEnumeratorParameter) this.get(dataTypeName, listBoxName); - keysArray = keys.toArray(new String[keys.size()]); - - listBoxPreviousContents = listBox.getValuesHashtable(); - - for(int i = 0; i < listBoxPreviousContents.size(); i++) - { - String item = (String) listBoxPreviousContents.get(new Integer(i)); - if(keys.contains(item) || "All".equals(item)) - { - continue; - } - else - { - contentsChanged = true; - listBox.removeItem(item); - } - } - - for(int i = 0; i < keysArray.length; i++) - { - if(listBoxPreviousContents.containsValue(keysArray[i])) - { - continue; - } - else - { - contentsChanged = true; - listBox.addItem(listBox.size(), keysArray[i]); - } - } - - // if the previous event had completely different collections than - // the current one, 'all' item will be the only one which remained - // after removal (the first loop). then the current (new) collections - // were added in the secold loop and 'all' item was in this case the - // fist, hence the default one - not desired - // solution: if any changes were performed in these two loops - // (contentsChanged variable set to true), the listbox will - // get re-initialised anyway. by removing 'all' and subsequent - // adding it the first collection from the event will be the default - // one and 'all' would be the last item - as desired - if(contentsChanged && !dataTypeName.endsWith("Segment")) - { - listBox.removeItem("All"); - listBox.addItem(listBox.size(), "All"); - listBox.initialize(); - } - updatedEnumeratorParameters.add(listBox); - } // while - // Get the enumerator parameters so we can tell them about the new event. - List<AEnumeratorParameter> collectionParameters = new ArrayList<AEnumeratorParameter>(); - for (AParameterSuperGroup superGroup : superGroups) { - collectionParameters.addAll(superGroup.getCollectionParameters()); - } - for (AEnumeratorParameter listBox : collectionParameters) { - if (!updatedEnumeratorParameters.contains(listBox)) { - listBox.clear(); - listBox.addItem(0, "None"); - listBox.initialize(); - } - } - } // updateCollectionsCutListBoxes() ------------------------------------ - - /** - * Update btagging cut listboxes for available btaggers. - * - * @param event The current event - * - * TODO: Make this independent of context (ie. pass it the name of the listBox to update, plus the values it should use) ? - Tom - */ - private void updateBTaggerListBox(AEvent event) - { - AJetData currentjets = event.getJetData(); - if (currentjets==null) return; - List<String> taggers = currentjets.getBTaggers(); - Set<AEnumeratorParameter> updatedEnumeratorParameters = new HashSet<AEnumeratorParameter>(); - AEnumeratorParameter listBox = (AEnumeratorParameter) this.get("CutsObjects", "JetBTagger"); - - if(taggers.size() == 0) { - listBox.clear(); - listBox.addItem(0, "None"); - } - - for(int i=0; i<taggers.size(); i++) { - listBox.addItem(i, taggers.get(i)); - } - - listBox.initialize(); - updatedEnumeratorParameters.add(listBox); - - } // updateBTaggerListBox() ------------------------------------ - - /** - * Keep a list of popular 'default' values for various b-taggers - * If we don't know about the b-tagger, use a fallback default of 1.0 - * - * @param parameter The current BTagger parameter - */ - public void setDefaultBTaggerValue(AParameter parameter) { - AEventManager eventManager = AEventManager.instance(); - - //Necessary code to stop B-tagging listener when having no-jet-info xml file - AJetData Jetss = eventManager.getCurrentEvent().getJetData(); - if(Jetss == null) - return; - - // Grab the b-taggers from the current Jet Collection - List<String> taggers = eventManager.getCurrentEvent().getJetData().getBTaggers(); - if(taggers.size() == 0) - return; - - // Get the BTagName corresponding to the current selection (ordering!) - // String newTagger = taggers.get(parameter.getI()); - String newTagger = taggers.get(parameter.getI()); - - - if(newTagger.equals(new String("SV0"))){ - get("CutsObjects", "JetBTagweight").setD(5.25); - } - else if(newTagger.equals(new String("SV1"))){ - get("CutsObjects", "JetBTagweight").setD(1.00); - } - else if(newTagger.equals(new String("JetFitterCOMBNN"))){ - get("CutsObjects", "JetBTagweight").setD(2.4); - } - else if(newTagger.equals(new String("IP3D+SV1")) || newTagger.equals(new String("IP3DSV1"))){ - get("CutsObjects", "JetBTagweight").setD(1.55); - } - else if(newTagger.equals(new String("JetFitterTagNN"))){ - get("CutsObjects", "JetBTagweight").setD(1.55); - } - else if(newTagger.equals(new String("IP2D"))){ - get("CutsObjects", "JetBTagweight").setD(1.00); - } - else if(newTagger.equals(new String("IP3D"))){ - get("CutsObjects", "JetBTagweight").setD(1.00); - } - else if(newTagger.equals(new String("SV2"))){ - get("CutsObjects", "JetBTagweight").setD(1.00); - } - else if(newTagger.equals(new String("MV1"))){ - get("CutsObjects", "JetBTagweight").setD(0.601713); - } - else { - get("CutsObjects", "JetBTagweight").setD(1.00); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/AParameter.java deleted file mode 100755 index 31b3ce329c6cb649a673ea88354cb98c836f2f1a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AParameter.java +++ /dev/null @@ -1,107 +0,0 @@ -package atlantis.parameters; - - -import javax.swing.JComponent; - - -/** - * This interface defines all the methods a parameter should have. - */ -public interface AParameter { - // scope constants - int LOCAL=1; - int GLOBAL=2; - - // value type constants - int NO_VALUE=0; - int INT=1; - int FLOAT=2; - - /** All supported supportedOperators */ - static final String[] supportedOperators= {"!=", ">=", ">", "<=", "<", "="}; - - /** Initializes graphics for this parameter. */ - void initialize(); - - /** Checks if the parameters graphics is initialized. */ - boolean isInitialized(); - - /** Copies the value and status from one window to the other. */ - void copy(int from, int to); - - /** Copies the value and status from "window" in all the others. */ - void globalize(int window); - - /** Returns true if parameter is modulus, i.e. sign is irrelevant. */ - boolean isModulus(); - - /** Return NO_VALUE, INT or FLOAT. */ - int getValueType(); - - /** sets the scope to LOCAL or GLOBAL. */ - void setScope(int scope); - - /** Returns the scope of the parameter. */ - int getScope(); - - /** Changes scope after it has originally been set. */ - void changeScope(int scope); - - /** Returns the name of the parameter. */ - String getName(); - - /** returns the screen name of the parameter. */ - String getScreenName(); - - /** Returns the tooltip text. */ - String getToolTip(); - - /** Returns the current operator assigned to parameter. */ - String getOperator(); - - /** Sets the double value for parameter. */ - void setD(double v); - void setI(int v); - - /** Returns the value of the parameter. */ - double getD(); - /** Returns the value of the parameter. */ - int getI(); - /** Returns the value of the parameter. */ - String getValue(); - - /** Sets the parameter's status. */ - void setStatus(boolean status); - - /** Returns the current status. */ - boolean getStatus(); - - /** Returns the graphical component used to display the Name and Status of this parameter. */ - JComponent getNameComponent(); - - /** Returns the graphical component used to display the value of this parameter. */ - JComponent getValueComponent(); - - /** Make synchronisation between the value and status and graphical components. */ - void refresh(); - - /** Returns true if "oper" represents an valid operator for this parameter. */ - boolean validateOperator(String oper); - - /** Returns true if "v" represents a valid value for this parameter. */ - boolean validateValue(double v); - - String getDifferences(String groupName); - - /** Validates and updates the current operator and value. */ - boolean processCommand(String oper, double v); - - /** Returns the user level associated with the parameter. */ - int getUserLevel(); - - /** Returns a String representation of the parameter. */ - String toString(); - - /** Add a parameter change listener. */ - void addParameterChangeListener(AParameterChangeListener listener); -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AParameterChangeListener.java b/graphics/AtlantisJava/src/atlantis/parameters/AParameterChangeListener.java deleted file mode 100644 index b65e530b826dacd4ac24a1eb140de82a7afdfd68..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AParameterChangeListener.java +++ /dev/null @@ -1,11 +0,0 @@ -package atlantis.parameters; - -/** - * Used by GUI to listen for changed parameters. - * - * @author waugh - * - */ -public interface AParameterChangeListener { - void parameterChanged(AParameter parameter); -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AParameterConfigReader.java b/graphics/AtlantisJava/src/atlantis/parameters/AParameterConfigReader.java deleted file mode 100644 index 8a2a88e9eae76728ba9e57900863d5b8783ec634..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AParameterConfigReader.java +++ /dev/null @@ -1,114 +0,0 @@ -package atlantis.parameters; - -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -import atlantis.utils.xml.AXMLUtils; - -/** - * Construct AParameter objects from the XML configuration file. - * - * @author waugh - * - */ -public class AParameterConfigReader { - /** - * This function reads any type of parameters. - * @param parameter The Node containing the definition of the parameter. - * @return An AParameter object. - */ - static AParameter readParameter(Node parameter, int groupScope) - { - AParameter par=null; - - // the node name of the parameter decides its type - String type=parameter.getNodeName(); - - // read all the parameter atributes - NamedNodeMap attributes=parameter.getAttributes(); - String fn=AXMLUtils.tryAttribut(attributes, "fn"); - String sn=AXMLUtils.tryAttribut(attributes, "sn"); - String sst=AXMLUtils.tryAttribut(attributes, "st"); - String sisMod=AXMLUtils.tryAttribut(attributes, "isMod"); - String sva=AXMLUtils.tryAttribut(attributes, "va"); - String op=AXMLUtils.tryAttribut(attributes, "op"); - String dop=AXMLUtils.tryAttribut(attributes, "dop"); - String to=AXMLUtils.tryAttribut(attributes, "to"); - String pv=AXMLUtils.tryAttribut(attributes, "pv"); - String tip=AXMLUtils.tryAttribut(attributes, "tip"); - String scopeAtt=AXMLUtils.tryAttribut(attributes, "scope"); - String unitsOfAtt=AXMLUtils.tryAttribut(attributes, "u"); - - // set scope value for this parameter - int scope=groupScope; - if(scopeAtt!=null) - { - if(scopeAtt.equals("LOCAL")) - scope=AParameter.LOCAL; - else if(scopeAtt.equals("GLOBAL")) - scope=AParameter.GLOBAL; - } - - // set user level for this parameter - int ul=-1; - if(!type.equals("LINK")) - ul=Integer.parseInt(AXMLUtils.tryAttribut(attributes, "ul")); - - double va=0; - if(sva!=null) va=Double.parseDouble(sva); - - // set initial status of this parameter - boolean st=false; - if(sst!=null) - if(sst.equals("ON")) - st=true; - - boolean isMod=false; - if(sisMod!=null) - if(sisMod.equals("YES")) - isMod=true; - - int unitsOf=0; - if(unitsOfAtt!=null) - unitsOf=Integer.parseInt(unitsOfAtt); - - // create an AParameter object based on its type - if(type.equals("LINK")) - par=new ALinkParameter(to); - else if(type.equals("COLOR")) - par=new AColorParameter(fn, sn, tip, pv, va, false, st, ul, scope); - else if(type.equals("SCOLOR")) - par=new AColorParameter(fn, sn, tip, pv, va, true, st, ul, scope); - else if(type.equals("ENUM")) - par=new AEnumeratorParameter(fn, sn, tip, pv, va, false, st, ul, scope); - else if(type.equals("SENUM")) - par=new AEnumeratorParameter(fn, sn, tip, pv, va, true, st, ul, scope); - else if(type.equals("ICUT")) - par=new ACutParameter(fn, sn, tip, pv, AParameter.INT, va, op, dop, false, st, isMod, ul, scope, unitsOf); - else if(type.equals("SICUT")) - par=new ACutParameter(fn, sn, tip, pv, AParameter.INT, va, op, dop, true, st, isMod, ul, scope, unitsOf); - else if(type.equals("FCUT")) - par=new ACutParameter(fn, sn, tip, pv, AParameter.FLOAT, va, op, dop, false, st, isMod, ul, scope, unitsOf); - else if(type.equals("SFCUT")) - par=new ACutParameter(fn, sn, tip, pv, AParameter.FLOAT, va, op, dop, true, st, isMod, ul, scope, unitsOf); - else if(type.equals("FLOAT")) - par=new ANumberParameter(fn, sn, tip, pv, AParameter.FLOAT, va, false, st, isMod, ul, scope, unitsOf); - else if(type.equals("SFLOAT")) - par=new ANumberParameter(fn, sn, tip, pv, AParameter.FLOAT, va, true, st, isMod, ul, scope, unitsOf); - else if(type.equals("INT")) - par=new ANumberParameter(fn, sn, tip, pv, AParameter.INT, (int)va, false, st, isMod, ul, scope, unitsOf); - else if(type.equals("SINT")) - par=new ANumberParameter(fn, sn, tip, pv, AParameter.INT, (int)va, true, st, isMod, ul, scope, unitsOf); - else if(type.equals("LINT")) - par=new AListIntegerParameter(fn, sn, tip, pv, (int)va, false, st, ul, scope); - else if(type.equals("SLINT")) - par=new AListIntegerParameter(fn, sn, tip, pv, (int)va, true, st, ul, scope); - else if(type.equals("STATUS")) - par=new AStatusParameter(fn, sn, tip, st, ul, scope); - else if(type.equals("StatusRoot")) - par = new AStatusRootParameter(parameter, fn, sn, tip, ul, scope); - else if(type.equals("StatusGroup")) - par = new AStatusGroupParameter(parameter, fn, sn, tip, ul, scope); - return par; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AParameterData.java b/graphics/AtlantisJava/src/atlantis/parameters/AParameterData.java deleted file mode 100644 index 0abcdf85799512bef215bad5a00fe9f4a743a124..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AParameterData.java +++ /dev/null @@ -1,202 +0,0 @@ -package atlantis.parameters; - -/** - * Encapsulates the per-window data belonging to a parameter. - * - * @author waugh - * - */ -public class AParameterData { - private AParameterState[] state; - private AParameterState[] defaultState; - - protected final APar parameterStore = APar.instance(); - - /** - * Create AParameterData for given number of windows. - * @param numWindows number of windows in the canvas - */ - AParameterData(int numWindows) { - state = new AParameterState[numWindows]; - defaultState = new AParameterState[numWindows]; - initializeParameterState(state); - initializeParameterState(defaultState); - } - - /** - * Initialize arrays of AParameterState objects. - * @param state - */ - private static void initializeParameterState(AParameterState[] state) { - for (int i=0; i<state.length; ++i) { - state[i] = new AParameterState(); - } - } - - /** - * Return the state of this parameter for a given window. - * @param windowIndex index of window - * @return the state - */ - AParameterState getState(int windowIndex) { - return state[windowIndex]; - } - - /** - * Get value of parameter for current window. - * @return value - */ - public double getValue() { - int currentWindowIndex = parameterStore.getCurrentWindowIndex(); - return getValue(currentWindowIndex); - } - - /** - * Get value of parameter for given window. - * @param windowIndex index of window - * @return value - */ - public double getValue(int windowIndex) { - return state[windowIndex].value; - } - - /** - * Set value of parameter for current window. - * @param value - */ - public void setValue(double value) { - int currentWindowIndex = parameterStore.getCurrentWindowIndex(); - setValue(currentWindowIndex,value); - } - - /** - * Set value of parameter for given window. - * @param windowIndex index of window - * @param value - */ - public void setValue(int windowIndex, double value) { - this.state[windowIndex].value = value; - } - - /** - * Get status (whether parameter is enabled) for current window. - * @return true if enabled - */ - public boolean getStatus() { - int currentWindowIndex = parameterStore.getCurrentWindowIndex(); - return getStatus(currentWindowIndex); - } - - /** - * Get status (whether parameter is enabled) for given window. - * @param windowIndex index of window - * @return true if enabled - */ - public boolean getStatus(int windowIndex) { - return state[windowIndex].status; - } - - /** - * Set status (whether parameter is enabled) for current window. - * @param status true to enable - */ - public void setStatus(boolean status) { - int currentWindowIndex = parameterStore.getCurrentWindowIndex(); - setStatus(currentWindowIndex,status); - } - - /** - * Set status (whether parameter is enabled) for given window). - * @param windowIndex index of window - * @param status true to enable - */ - public void setStatus(int windowIndex, boolean status) { - this.state[windowIndex].status = status; - } - - /** - * Get operator for current window. - * @return operator - */ - public String getOperator() { - int currentWindowIndex = parameterStore.getCurrentWindowIndex(); - return getOperator(currentWindowIndex); - } - - /** - * Get operator for given window. - * @param windowIndex index of window - * @return operator - */ - public String getOperator(int windowIndex) { - return state[windowIndex].operator; - } - - /** - * Set operator for current window. - * @param operator - */ - public void setOperator(String operator) { - int currentWindowIndex = parameterStore.getCurrentWindowIndex(); - setOperator(currentWindowIndex,operator); - } - - /** - * Set operator for given window. - * @param windowIndex index of window - * @param operator - */ - public void setOperator(int windowIndex, String operator) { - this.state[windowIndex].operator = operator; - } - - /** - * Copy values from one window to another. - * @param from index of source window - * @param to index of destination window - */ - public void copy(int from, int to) { - if (to!=from) state[to] = state[from].copy(); - } - - /** - * Save current values for each window to be restored later. - */ - public void saveDefaults() { - int numWindows = state.length; - for (int iWindow = 0; iWindow<numWindows; ++iWindow) { - defaultState[iWindow] = state[iWindow].copy(); - } - } - - /** - * Restore values for each window from saved values. - */ - public void restoreDefaults() { - int numWindows = state.length; - for (int iWindow = 0; iWindow<numWindows; ++iWindow) { - state[iWindow] = defaultState[iWindow].copy(); - } - } - - /** - * This function is called for GLOBAL parameters to apply the value in all - * windows. - */ - public void globalize() - { - int currentWindowIndex = parameterStore.getCurrentWindowIndex(); - globalize(currentWindowIndex); - } - - /** - * This function is called for GLOBAL parameters to apply the value in all - * windows. - */ - public void globalize(int window) - { - int numWindows = state.length; - for (int i = 0; i < numWindows; i++) - copy(window, i); - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AParameterState.java b/graphics/AtlantisJava/src/atlantis/parameters/AParameterState.java deleted file mode 100644 index 0c93ee31a72b9198bd821c77945a56e6443feacf..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AParameterState.java +++ /dev/null @@ -1,38 +0,0 @@ -package atlantis.parameters; - -/** - * Encapsulate the state (value, status, operator) of a given parameter for a - * single window. - * - * @author waugh - * - */ -public class AParameterState implements Cloneable { - double value; - boolean status; - String operator = ""; - - /** - * Make a new AParameterState with default values. - */ - AParameterState() {} - - /** - * Make a new AParameterState that is a copy of another. - * Other classes should use the public copy() method. - * @param from the object to copy - */ - private AParameterState(AParameterState from) { - this.value = from.value; - this.status = from.status; - this.operator = from.operator; - } - - /** - * Make a new AParameterState that is a copy of this one. - * @return copy - */ - public AParameterState copy() { - return new AParameterState(this); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AParameterSuperGroup.java b/graphics/AtlantisJava/src/atlantis/parameters/AParameterSuperGroup.java deleted file mode 100644 index fe01d3b3d7bfdad69bf1965407e133515f1e2cda..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AParameterSuperGroup.java +++ /dev/null @@ -1,241 +0,0 @@ -package atlantis.parameters; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * A supergroup of parameters, i.e. a group of groups, corresponding to one of the - * top-level tabs in the GUI, e.g. "Projections" or "Data". - * - * @author waugh - * - */ -public class AParameterSuperGroup implements AParameterChangeListener { - private String name; - private String toolTip; - private int userLevel; - - private Map<String,AParametersGroup> parameterGroups = new HashMap<String,AParametersGroup>(); - private List<AParametersGroup> uiGroups = new ArrayList<AParametersGroup>(); - /** Keep track of enumerator parameters so we can tell them about new events. */ - private final List<AEnumeratorParameter> collectionParameters = new ArrayList<AEnumeratorParameter>(); - - private List<AParameterChangeListener> parameterChangeListeners = new ArrayList<AParameterChangeListener>(); - - private AParameterSuperGroup() {} - - static AParameterSuperGroup readSuperGroup(Node node, int applicationUserLevel) { - AParameterSuperGroup superGroup = new AParameterSuperGroup(); - superGroup.name = node.getAttributes().getNamedItem("name").getNodeValue(); - superGroup.toolTip = node.getAttributes().getNamedItem("toolTip").getNodeValue(); - String sUserLevel = node.getAttributes().getNamedItem("userLevel").getNodeValue(); - superGroup.userLevel = Integer.parseInt(sUserLevel); - superGroup.readGroups(node,applicationUserLevel); - return superGroup; - } - - /** - * Populate the lists of parameter groups and UI groups. - * @param superGroupNode - */ - private void readGroups(Node superGroupNode, int applicationUserLevel) { - NodeList groups = superGroupNode.getChildNodes(); - for (int i = 0; i < groups.getLength(); i++) - { - Node group = groups.item(i); - if (group.getNodeType() == Node.ELEMENT_NODE) - { - // here we have a <Group> element and create an AParametersGroup object from it - AParametersGroup g = readGroup(group); - - String gName = g.getGroupName(); - if (parameterGroups.containsKey(gName)) - throw new Error("Duplicate definition of group " + gName); - parameterGroups.put(gName, g); - int guiUsage = g.getUIUsage(); - - if ( ( (guiUsage == AParametersGroup.TABLE) || - (guiUsage == AParametersGroup.PROJECTION) - || (guiUsage == AParametersGroup.BRAIN_TEST) - ) && (g.getUserLevel() <= userLevel)) - uiGroups.add(g); - } - } - - } - - private AParametersGroup readGroup(Node group) - { - // first we read all the attributes - NamedNodeMap attributes=group.getAttributes(); - String groupName=attributes.getNamedItem("name").getNodeValue(); - String screenName=attributes.getNamedItem("sname").getNodeValue(); - String guiUsageAttribut=attributes.getNamedItem("guiUsage").getNodeValue(); - String scopeAttribut=attributes.getNamedItem("scope").getNodeValue(); - int ul=Integer.parseInt(attributes.getNamedItem("userLevel").getNodeValue()); - String groupToolTip=attributes.getNamedItem("toolTip").getNodeValue(); - - // set guiUsage value for this group - int guiUsage; - if(guiUsageAttribut.equals("TABLE")) - guiUsage=AParametersGroup.TABLE; - else if(guiUsageAttribut.equals("PROJECTION")) - guiUsage=AParametersGroup.PROJECTION; - else if(guiUsageAttribut.equals("BRAIN_TEST")) - guiUsage=AParametersGroup.BRAIN_TEST; - else - guiUsage=AParametersGroup.NO_USE; - - // set scope value for this group - int scope; - if(scopeAttribut.equals("LOCAL")) - scope=AParameter.LOCAL; - else if(scopeAttribut.equals("GLOBAL")) - scope=AParameter.GLOBAL; - else - scope=AParameter.GLOBAL; - - // create an AParametersGroup object based on the attributes - AParametersGroup thisGroup=new AParametersGroup(groupName, screenName, guiUsage, scope, ul, groupToolTip); - - // report error if no parameters in this group - NodeList childrens=group.getChildNodes(); - if(childrens==null) throw new Error("this group contains no parameters"); - int childrensCount=childrens.getLength(); - if(childrensCount==0) throw new Error("this group contains no parameters"); - - // read all the parameters of this group recursively - for(int i=0; i<childrensCount; i++) - { - Node child=childrens.item(i); - if(child.getNodeType()==Node.ELEMENT_NODE) - { - // for each parameter, create an object (either ACommnad or AParameter) - // and add it into the to be returned AParametersGroup object - String childName=child.getNodeName(); - if(childName.equals("Command")) { - ACommand c=readCommand(child); - if(c!=null) thisGroup.add(c); - } - else { - AParameter parameter = AParameterConfigReader.readParameter(child, scope); - parameter.addParameterChangeListener(this); - thisGroup.add(parameter); - if (parameter instanceof AEnumeratorParameter && - parameter.getScreenName().endsWith("Collections")) { - collectionParameters.add((AEnumeratorParameter)parameter); - } - } - } - } - - return thisGroup; - } - - - - private ACommand readCommand(Node commandNode) - { - NamedNodeMap attributes=commandNode.getAttributes(); - - String name=attributes.getNamedItem("name").getNodeValue(); - String command=attributes.getNamedItem("command").getNodeValue(); - String toolTip=attributes.getNamedItem("toolTip").getNodeValue(); - String userLevel=attributes.getNamedItem("ul").getNodeValue(); - if(Integer.parseInt(userLevel)<=this.userLevel) - return new ACommand(name, command, toolTip); - else - return null; - } - - /** - * Get the name of the supergroup. - * @return the name - */ - public String getName() {return name;} - - /** - * Get the tool tip for this supergroup. - * @return the tool tip - */ - public String getToolTip() {return toolTip;} - - /** - * Get the user level of this supergroup. - * @return the user level - */ - public int getUserLevel() {return userLevel;} - - /** - * Get parameter group with given name. - * @param name name of group - * @return parameter group - */ - public AParametersGroup getGroup(String name) {return parameterGroups.get(name);} - - /** - * Get the parameter groups that are displayed in the UI in the current user level. - * @return list of parameter groups - */ - public List<AParametersGroup> getUIGroups() {return uiGroups;} - - /** - * Tell the listeners that a parameter has changed. - */ - @Override - public void parameterChanged(AParameter parameter) { - for (AParameterChangeListener listener : parameterChangeListeners) { - listener.parameterChanged(parameter); - } - } - - public Map<? extends String, ? extends AParametersGroup> getParameterGroups() { - return parameterGroups; - } - - public Collection<? extends AEnumeratorParameter> getCollectionParameters() { - return collectionParameters; - } - - /** - * Add a listener to be informed of parameter changes. - * - * @param listener - */ - public void addParameterChangeListener(AParameterChangeListener listener) { - this.parameterChangeListeners.add(listener); - } - - /** - * Restore all groups in supergroup to defaults. - */ - public void restoreDefaults() { - for (AParametersGroup group : parameterGroups.values()) { - group.restoreDefaults(); - } - } - - /** - * Copy parameters from one window to another. - * @param sourceName name of source window - * @param destName name of destination window - */ - public void copyParameters(String sourceName, String destName) { - for (AParametersGroup group : parameterGroups.values()) { - group.copyParameters(sourceName, destName); - } - } - - public void resolveLinkParameters() { - for (AParametersGroup group : parameterGroups.values()) { - group.resolveLinkParameters(); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AParameterUtilities.java b/graphics/AtlantisJava/src/atlantis/parameters/AParameterUtilities.java deleted file mode 100644 index 7dada86fe6932efadd81dbec812ffde54ba67baf..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AParameterUtilities.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * - */ -package atlantis.parameters; - -import atlantis.utils.AMath; - -/** - * Mathematical utility methods that act on Parameters. - * Moved from atlantis.utils.AMath to reduce dependencies of utils on other packages. - * - * @author waugh - * - */ -public class AParameterUtilities { - - private final static APar parameterStore = APar.instance(); - private final static AParameter xVertexPar = parameterStore.get("Event", "XVtx"); - private final static AParameter yVertexPar = parameterStore.get("Event", "YVtx"); - private final static AParameter zVertexPar = parameterStore.get("Event", "ZVtx"); - - /** - * Get coordinates of event vertex. - * - * @return (x,y,z) of vertex - */ - public static double[] getPrimaryVertex() - { - double[] primaryVertex = new double[3]; - primaryVertex[0] = parameterStore.get("Event", "XVtx").getD(); - primaryVertex[1] = parameterStore.get("Event", "YVtx").getD(); - primaryVertex[2] = parameterStore.get("Event", "ZVtx").getD(); - return primaryVertex; - } - - /** - * Returns phi with respect to the primary vertex. - * @param x double x coordinate - * @param y double y coordinate - * @return double phi - */ - public static double phi(double x, double y) { - double phi = Math.atan2(y-yVertexPar.getD(), x-xVertexPar.getD()); - if (phi < 0) phi += 2.*Math.PI; - return Math.toDegrees(phi); - } - - /** - * Returns eta with respect to the primary vertex. - * @param z double z coordinate - * @param rho double rho coordinate - * @return double eta - */ - public static double eta(double z, double rho) - { - return AMath.etaAbs(z - zVertexPar.getD(), rho); - } - - public static double getPhiStereo(double rho, double phi, double z) - { - AParameter stereoAnglePar = parameterStore.get("SiCluster", "Stereo"); - if(!stereoAnglePar.getStatus()) - { - return phi; - } - double stereoAngle = stereoAnglePar.getI() * 0.04; - return phi + stereoAngle * (z-parameterStore.get("Event", "ZVtx").getD()) / rho; - } - - /** - * Get the sign of the rho coordinate based on the x and y coordinates and - * the phi value set by the user. - * @param x double x coordinate - * @param y double y coordinate - * @return int sign of rho (-1 or +1) - */ - public static int getRhoSign(double x, double y) { - return getRhoSign(Math.atan2(y, x)); - } - - /** - * Get the sign of the rho coordinate based on the phi coordinate and - * the phi value set by the user. - * @param phi double phi coordinate - * @return int sign of rho (-1 or +1) - */ - private static int getRhoSign(double phi) { - int sign; - if (phi < 0.) phi += 2.*Math.PI; - - double phiMid = Math.toRadians(parameterStore.get("RZ", "Phi").getD()); - double phiDiff = Math.abs(phi-phiMid); - - if(phiDiff <= Math.PI/2.|| phiDiff > 3*Math.PI/2.) { - sign = 1; - } else { - sign = -1; - } - return sign; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AParametersGroup.java b/graphics/AtlantisJava/src/atlantis/parameters/AParametersGroup.java deleted file mode 100755 index eeadb9d318393cdcf3e28f19b8b4c7ef2cd30ad6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AParametersGroup.java +++ /dev/null @@ -1,157 +0,0 @@ -package atlantis.parameters; - -import atlantis.canvas.ACanvas; -import java.util.*; - -/** - * This class is used to store a set of parameters. Provides functions for - * fast searching of a parameter by its name. - */ -public class AParametersGroup { - public static final int NO_USE=0; - public static final int TABLE=1; - public static final int PROJECTION=2; - public static final int BRAIN_TEST=3; - - private String name; - private String screenName; - private String toolTip; - private int scope; - private int guiUsage; - private int userLevel; - - private Vector<AParameter> parametersVector = new Vector<AParameter>(); - private HashMap<String, AParameter> parametersMap = new HashMap<String, AParameter>(); - private Vector<ACommand> commandsVector = new Vector<ACommand>(); - - public AParametersGroup(String name, String screenName, int guiUsage, - int scope, int userLevel, String toolTip) { - - this.name=name; - - if(!screenName.trim().equals("")) - this.screenName=screenName; - else - this.screenName=name; - - this.guiUsage=guiUsage; - this.scope=scope; - this.userLevel=userLevel; - this.toolTip=toolTip; - } - - public void restoreDefaults() { - Enumeration<AParameter> parameters = parametersVector.elements(); - while(parameters.hasMoreElements()) { - AParameter p = parameters.nextElement(); - if(p instanceof AAbstractParameter) - ((AAbstractParameter)p).restoreDefaults(); - } - } - - - private void addToMap(AParameter p) { - if(parametersMap.containsKey(p.getName())) - throw new Error("Duplicate definition of parameter full name "+p.getName()); - - parametersMap.put(p.getName(), p); - } - - public void add(AParameter p) { - parametersVector.addElement(p); - if(!(p instanceof ALinkParameter)) - addToMap(p); - } - - public void add(ACommand c) { - for(int i=0; i<commandsVector.size(); i++) { - ACommand command = commandsVector.elementAt(i); - if(command.getName().equals(c.getName())) - throw new Error("Duplicate definition of command "+c.getName()); - } - commandsVector.addElement(c); - } - - public int getScope() { - return scope; - } - - public String getGroupName() { - return name; - } - - public String getScreenName() { - return screenName; - } - - public String getToolTip() { - return toolTip; - } - - public int getUIUsage() { - return guiUsage; - } - - public int getUserLevel() { - return userLevel; - } - - public ACommand[] getCommands() { - ACommand[] commands=new ACommand[commandsVector.size()]; - - for(int i=0; i<commands.length; i++) - commands[i]=commandsVector.elementAt(i); - - return commands; - } - - public Vector<AParameter> getParameters(int userLevel) { - Vector<AParameter> v=new Vector<AParameter>(parametersVector.size()); - - for(int i=0; i<parametersVector.size(); i++) { - AParameter p = parametersVector.elementAt(i); - if(p.getUserLevel()<=userLevel) - v.addElement(p); - } - - return v; - } - - public AParameter getParameter(String name) { - if(parametersMap.get(name)!=null) - return parametersMap.get(name); - // if under group "Data", should find the parameter in the whole tree - else if(parametersMap.get("Status")!=null){ - return ((AStatusRootParameter)parametersMap.get("Status")).getParameter(name); - } - else - return null; - } - - /** - * Copy parameters from one window to another. - * @param sourceName name of source window - * @param destName name of destination window - */ - public void copyParameters(String sourceName, String destName) { - int source=ACanvas.getCanvas().getWindow(sourceName).getIndex(); - int dest=ACanvas.getCanvas().getWindow(destName).getIndex(); - - for(int i=0; i<parametersVector.size(); i++) { - AParameter p = parametersVector.elementAt(i); - if(p.getScope()==AParameter.LOCAL) - p.copy(source, dest); - } - } - - public void resolveLinkParameters() { - for(int i=0; i<parametersVector.size(); i++) { - AParameter p = parametersVector.elementAt(i); - if(p instanceof ALinkParameter) { - ((ALinkParameter)p).solveLink(); - addToMap(p); - } - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AStatusGroupParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/AStatusGroupParameter.java deleted file mode 100755 index 59bc40f1fc221ed20ff7ef584c10bfbd204372cc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AStatusGroupParameter.java +++ /dev/null @@ -1,213 +0,0 @@ -package atlantis.parameters; - -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import javax.swing.JComponent; -import java.util.ArrayList; -import java.awt.Color; -import hep.wired.util.TristateCheckBox; - -import atlantis.gui.ACheckNode; -import atlantis.gui.ACheckBox; - -/** - * Created on 16 March 2005, 16:15 - * - * @author Qiang Lu - */ -public class AStatusGroupParameter extends AAbstractParameter -{ - private ArrayList<AParameter> parameterNodeList; - - private ACheckNode statusGroupNode; - - /** Creates a new instance of AStatusGroupParameter */ - AStatusGroupParameter(Node statusGroup, String name, String screenName, String toolTip, int userLevel, int scope) - { - super(name, screenName, toolTip, AParameter.NO_VALUE, 0, null, null, false, false, - false, userLevel, scope, AAbstractParameter.NOTHING); - - // get child element of statusGroup - NodeList childrens = statusGroup.getChildNodes(); - // report error if no parameters - if (childrens == null) - throw new Error("StatusGroup element contains no parameters"); - int childrensCount = childrens.getLength(); - if (childrensCount == 0) - throw new Error("StatusGroup element contains no parameters"); - - // create an AParameter object for each node under statusGroup - // and add them into parameterNodeList - parameterNodeList = new ArrayList<AParameter>(); - for (int i = 0; i < childrensCount; i++) - { - Node child = childrens.item(i); - - if (child.getNodeType() == Node.ELEMENT_NODE) - { - // here we have a <StatusGroup> or <Status> element - parameterNodeList.add(AParameterConfigReader.readParameter(child, scope)); - } - } - } - - public void initialize() - { - super.initialize(); - - // create the tree node using the <StatusGroup> element - TristateCheckBox groupCheckBox = new TristateCheckBox(screenName); - groupCheckBox.setBackground(new Color(204, 204, 204)); - if (getScope() == LOCAL) - groupCheckBox.setForeground(Color.black); - else - groupCheckBox.setForeground(Color.blue); - - groupCheckBox.setToolTipText(toolTip); - statusGroupNode = new ACheckNode(groupCheckBox, false, ACheckNode.MULTI_SELECTION, this); - - for (AParameter aNodeParameter : parameterNodeList) - { - aNodeParameter.initialize(); - if (aNodeParameter instanceof AStatusParameter) - { - if (aNodeParameter.getUserLevel() <= APar.instance().getUserLevel()) - { - ACheckBox statusCheckBox = ((AStatusParameter) aNodeParameter).getCheckBox(); - ACheckNode aNode = new ACheckNode(statusCheckBox, statusCheckBox.isSelected(), ACheckNode.SINGLE_SELECTION, aNodeParameter); - statusGroupNode.add(aNode); - } - } - else if (aNodeParameter instanceof AStatusGroupParameter) - { - statusGroupNode.add(((AStatusGroupParameter) aNodeParameter).getCheckNode()); - } - } - } - - public JComponent getValueComponent() - { - return null; - } - - public ACheckNode getCheckNode() - { - return statusGroupNode; - } - - ArrayList<AParameter> getParameterList() - { - return parameterNodeList; - } - - public AParameter getParameter(String name) - { - for (AParameter aNodeParameter : parameterNodeList) - { - if (aNodeParameter instanceof AStatusParameter) - { - if (aNodeParameter.getName().equals(name)) - return aNodeParameter; - } - else if (((AStatusGroupParameter) aNodeParameter).getParameter(name) != null) - { - return ((AStatusGroupParameter) aNodeParameter).getParameter(name); - } - } - return null; - } - - public AParameter getGroupParameter(String name) - { - if(getName().equals(name)) - return this; - for (AParameter aNodeParameter : parameterNodeList) - { - if (aNodeParameter instanceof AStatusGroupParameter) - { - if (((AStatusGroupParameter) aNodeParameter).getGroupParameter(name) != null) - { - return ((AStatusGroupParameter) aNodeParameter).getGroupParameter(name); - } - } - } - return null; - } - - public boolean getStatus() - { - return statusGroupNode.isSelected(); - } - - public void setStatus(boolean status) - { - for (AParameter aNodeParameter : parameterNodeList) - { - aNodeParameter.setStatus(status); - } - } - - public void refresh() - { - _refresh(); - fireParameterChanged(); - } - - public void setD(double v) - { - throw new IllegalArgumentException("StatusGroupParameter hase no value"); - } - - public void setI(int v) - { - throw new IllegalArgumentException("StatusGroupParameter hase no value"); - } - - public void saveChildrenDefaults() - { - for (AParameter aNodeParameter : parameterNodeList) - { - AAbstractParameter aNodeAbstractParameter = (AAbstractParameter) aNodeParameter; - if(aNodeAbstractParameter instanceof AStatusGroupParameter) - ((AStatusGroupParameter)aNodeAbstractParameter).saveChildrenDefaults(); - else - ((AStatusParameter)aNodeAbstractParameter).saveDefaults(); - } - } - - public void restoreDefaults() - { - super.restoreDefaults(); - for (AParameter aNodeParameter : parameterNodeList) - { - AAbstractParameter aNodeAbstractParameter = (AAbstractParameter) aNodeParameter; - aNodeAbstractParameter.restoreDefaults(); - } - } - - public void copy(int from, int to) - { - for (AParameter aNodeParameter : parameterNodeList) - { - AAbstractParameter aNodeAbstractParameter = (AAbstractParameter) aNodeParameter; - aNodeAbstractParameter.copy(from, to); - } - } - - public String getDifferences(String groupName) - { - StringBuffer ret = new StringBuffer(); - - for (AParameter aNodeParameter : parameterNodeList) - { - AAbstractParameter aNodeAbstractParameter = (AAbstractParameter) aNodeParameter; - if(aNodeAbstractParameter instanceof AStatusGroupParameter) - ret.append(((AStatusGroupParameter)aNodeAbstractParameter).getDifferences(groupName)); - else - ret.append(aNodeAbstractParameter.getDifferences(groupName)); - } - - return ret.toString(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AStatusParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/AStatusParameter.java deleted file mode 100755 index ad42a168db9f20ea473b75a354750810583b4451..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AStatusParameter.java +++ /dev/null @@ -1,58 +0,0 @@ -package atlantis.parameters; - -import javax.swing.JLabel; -import javax.swing.LookAndFeel; -import javax.swing.JComponent; - -/** - * A parameter representing an on/off value. Corresponds to an ACheckBox in the GUI. - */ -public class AStatusParameter extends AAbstractParameter -{ - private JLabel valueLabel; - - public AStatusParameter(String name, String screenName, String toolTip, - boolean status, int userLevel, int scope) - { - super(name, screenName, toolTip, NO_VALUE, 0, null, null, true, - status, false, userLevel, scope, NOTHING); - } - - - public void setD(double v) - { - throw new IllegalArgumentException("StatusParameter has no value"); - } - - - public void setI(int v) - { - throw new IllegalArgumentException("StatusParameter has no value"); - } - - - public void initialize() - { - super.initialize(); - valueLabel = new JLabel(); - valueLabel.setOpaque(true); - valueLabel.setToolTipText(toolTip); - LookAndFeel.installColorsAndFont(valueLabel, "CheckBox.background", - "CheckBox.foreground", - "CheckBox.font"); - } - - - public JComponent getValueComponent() - { - return valueLabel; - } - - - public void refresh() - { - _refresh(); - fireParameterChanged(); - } - -} // class AStatusParameter ================================================= diff --git a/graphics/AtlantisJava/src/atlantis/parameters/AStatusRootParameter.java b/graphics/AtlantisJava/src/atlantis/parameters/AStatusRootParameter.java deleted file mode 100755 index fbbf4f40448e7c97f148c3d20cf39f56c2179eee..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/AStatusRootParameter.java +++ /dev/null @@ -1,435 +0,0 @@ -package atlantis.parameters; - -import hep.wired.util.TristateCheckBox; - -import java.awt.Color; -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.Iterator; - -import javax.swing.JComponent; -import javax.swing.JPopupMenu; -import javax.swing.JTree; -import javax.swing.ToolTipManager; -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.TreePath; - -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import atlantis.utils.AUtilities; -import atlantis.gui.ACheckBox; -import atlantis.gui.ACheckNode; -import atlantis.gui.AParametersTable; -import atlantis.gui.ATreeCellRenderer; - -/** - * AStatusRootParameter.java - * - * Created on 14 March 2005, 17:49 - * - * @author Qiang Lu - */ -public class AStatusRootParameter extends AAbstractParameter -{ - private ArrayList<AParameter> parameterNodeList; - - private JTree statusTree; - - private ACheckNode statusRootNode; - - /** Creates a new instance of AStatusGroupParameter */ - AStatusRootParameter(Node statusRoot, String name, String screenName, String toolTip, int userLevel, int scope) - { - super(name, screenName, toolTip, AParameter.NO_VALUE, 0, null, null, false, false, - false, userLevel, scope, AAbstractParameter.NOTHING); - // get child element of statusRoot - NodeList childrens = statusRoot.getChildNodes(); - // report error if no parameters - if (childrens == null) - throw new Error("this group contains no parameters"); - int childrensCount = childrens.getLength(); - if (childrensCount == 0) - throw new Error("this group contains no parameters"); - - // create an AParameter object for each node under statusRoot - // and add them into parameterNodeList - parameterNodeList = new ArrayList<AParameter>(); - for (int i = 0; i < childrensCount; i++) - { - Node child = childrens.item(i); - - if (child.getNodeType() == Node.ELEMENT_NODE) - { - // here we have a <StatusGroup> or <Status> element - parameterNodeList.add(AParameterConfigReader.readParameter(child, scope)); - } - } - } - - public void initialize() - { - super.initialize(); - - // create the root node of the tree using the <StatusRoot> element - TristateCheckBox rootCheckBox = new TristateCheckBox(screenName); - rootCheckBox.setBackground(new Color(204, 204, 204)); - if (getScope() == LOCAL) - rootCheckBox.setForeground(Color.black); - else - rootCheckBox.setForeground(Color.blue); - - rootCheckBox.setToolTipText(toolTip); - statusRootNode = new ACheckNode(rootCheckBox, false, ACheckNode.MULTI_SELECTION, this); - for (AParameter aNodeParameter : parameterNodeList) - { - aNodeParameter.initialize(); - if (aNodeParameter instanceof AStatusParameter) - { - if (aNodeParameter.getUserLevel() <= APar.instance().getUserLevel()) - { - ACheckBox statusCheckBox = ((AStatusParameter) aNodeParameter).getCheckBox(); - ACheckNode aNode = new ACheckNode(statusCheckBox, statusCheckBox.isSelected(), ACheckNode.SINGLE_SELECTION, aNodeParameter); - statusRootNode.add(aNode); - } - } - else if (aNodeParameter instanceof AStatusGroupParameter) - { - statusRootNode.add(((AStatusGroupParameter) aNodeParameter).getCheckNode()); - } - } - - statusTree = new JTree(statusRootNode); - statusTree.setBackground(new Color(204, 204, 204)); - statusTree.setCellRenderer(new ATreeCellRenderer()); - statusTree.addMouseListener(new NodeSelectionListener(statusTree)); - ToolTipManager.sharedInstance().registerComponent(statusTree); - } - - public JComponent getValueComponent() - { - return null; - } - - public JComponent getNameComponent() - { - return statusTree; - } - - ArrayList<AParameter> getParameterList() - { - return parameterNodeList; - } - - public AParameter getParameter(String name) - { - for (AParameter aNodeParameter : parameterNodeList) - { - if (aNodeParameter instanceof AStatusParameter) - { - if (aNodeParameter.getName().equals(name)) - return aNodeParameter; - } - else if (((AStatusGroupParameter) aNodeParameter).getParameter(name) != null) - { - return ((AStatusGroupParameter) aNodeParameter).getParameter(name); - } - } - return null; - } - - public AParameter getGroupParameter(String name) - { - if(!isInitialized()) - initialize(); - - if(getName().equals(name)) - return this; - for (AParameter aNodeParameter : parameterNodeList) - { - if (aNodeParameter instanceof AStatusGroupParameter) - { - if (((AStatusGroupParameter) aNodeParameter).getGroupParameter(name) != null) - { - return ((AStatusGroupParameter) aNodeParameter).getGroupParameter(name); - } - } - } - return null; - } - - public boolean getStatus() - { - return statusRootNode.isSelected(); - } - - public void setStatus(boolean status) - { - for (AParameter aNodeParameter : parameterNodeList) - { - aNodeParameter.setStatus(status); - } - } - - public void refresh() - { - _refresh(); - fireParameterChanged(); - } - - public void setD(double v) - { - throw new IllegalArgumentException("StatusRootParameter hase no value"); - } - - public void setI(int v) - { - throw new IllegalArgumentException("StatusRootParameter hase no value"); - } - - public void saveChildrenDefaults() - { - for (AParameter aNodeParameter : parameterNodeList) - { - AAbstractParameter aNodeAbstractParameter = (AAbstractParameter) aNodeParameter; - if(aNodeAbstractParameter instanceof AStatusGroupParameter) - ((AStatusGroupParameter)aNodeAbstractParameter).saveChildrenDefaults(); - else - ((AStatusParameter)aNodeAbstractParameter).saveDefaults(); - } - } - - public void restoreDefaults() - { - for (AParameter aNodeParameter : parameterNodeList) - { - AAbstractParameter aNodeAbstractParameter = (AAbstractParameter) aNodeParameter; - aNodeAbstractParameter.restoreDefaults(); - } - if(statusTree != null) - { - for (int i = 1; i < statusTree.getRowCount(); i++) - statusTree.collapseRow(i); - } - } - - public void copy(int from, int to) - { - for (AParameter aNodeParameter : parameterNodeList) - { - AAbstractParameter aNodeAbstractParameter = (AAbstractParameter) aNodeParameter; - aNodeAbstractParameter.copy(from, to); - } - } - - public String getDifferences(String groupName) - { - StringBuffer ret = new StringBuffer(); - - for (AParameter aNodeParameter : parameterNodeList) - { - AAbstractParameter aNodeAbstractParameter = (AAbstractParameter) aNodeParameter; - if(aNodeAbstractParameter instanceof AStatusGroupParameter) - ret.append(((AStatusGroupParameter)aNodeAbstractParameter).getDifferences(groupName)); - else - ret.append(((AStatusParameter)aNodeAbstractParameter).getDifferences(groupName)); - } - - return ret.toString(); - } - - public class NodeSelectionListener extends MouseAdapter - { - private JTree tree; - - private int offsetX; - private int offsetY; - - NodeSelectionListener(JTree tree) - { - this.tree = tree; - offsetX = 0; - offsetY = 0; - } - - public void setOffset(int x, int y) - { - offsetX = x; - offsetY = y; - } - - public int getOffsetX() - { - return offsetX; - } - - public int getOffsetY() - { - return offsetY; - } - - public void mousePressed(MouseEvent e) - { - if (AUtilities.isRightMouseButton(e)) - { - AParameter clickedPar = null; - int x = e.getX(); - int y = e.getY(); - int row = tree.getRowForLocation(x, y); - TreePath path = tree.getPathForRow(row); - if (path != null) - { - Object clickedNode = path.getLastPathComponent(); - if (clickedNode instanceof ACheckNode) - { - ACheckNode node = (ACheckNode) clickedNode; - clickedPar = node.getParameter(); - } - - final AParameter effectPar = clickedPar; - if(effectPar instanceof AStatusParameter) - { - JPopupMenu popupMenu = new JPopupMenu(); - if (effectPar.getScope() == AParameter.LOCAL) - { - popupMenu.add(AParametersTable.SET_GLOBAL).addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - effectPar.changeScope(AParameter.GLOBAL); - refresh(); - } - }); - } - else - { - popupMenu.add(AParametersTable.SET_LOCAL).addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - effectPar.changeScope(AParameter.LOCAL); - refresh(); - } - }); - } - if (tree.isShowing()) - popupMenu.show(tree, e.getX(), e.getY()); - else - // when e.getSource() is the table - popupMenu.show((Component) e.getSource(), e.getX() + getOffsetX(), e.getY() + getOffsetY()); - } - else - { - popupGroupScopeMenu(effectPar, e); - } - } - } - } - - // groupPar is either AStatusRootParameter or AStatusGroupParameter - private final void changeGroupScopes(AParameter groupPar, int scope) - { - Iterator<AParameter> it; - if(groupPar instanceof AStatusRootParameter) - it = ((AStatusRootParameter) groupPar).getParameterList().iterator(); - else - it = ((AStatusGroupParameter) groupPar).getParameterList().iterator(); - while (it.hasNext()) - { - AParameter aPar = it.next(); - // aPar is either AStatusGroupParameter or AStatusParameter - if(aPar instanceof AStatusGroupParameter) - changeGroupScopes(aPar, scope); - else - aPar.changeScope(scope); - } - } - - // groupPar is either AStatusRootParameter or AStatusGroupParameter - private void popupGroupScopeMenu(AParameter groupPar, MouseEvent e) - { - final AParameter tmpPar = groupPar; - JPopupMenu popupMenu = new JPopupMenu(); - popupMenu.add(AParametersTable.SET_ALL_LOCAL).addActionListener( - new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - changeGroupScopes(tmpPar, AParameter.LOCAL); - refresh(); - } - }); - popupMenu.add(AParametersTable.SET_ALL_GLOBAL).addActionListener( - new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - changeGroupScopes(tmpPar, AParameter.GLOBAL); - refresh(); - } - }); - if (tree.isShowing()) - popupMenu.show(tree, e.getX(), e.getY()); - else - // when e.getSource() is the table - popupMenu.show((Component) e.getSource(), e.getX() + getOffsetX(), e.getY() + getOffsetY()); - } - - public void mouseClicked(MouseEvent e) - { - if (AUtilities.isRightMouseButton(e)) - { - return; - } - int x = e.getX(); - int y = e.getY(); - int row = tree.getRowForLocation(x, y); - TreePath path = tree.getPathForRow(row); - if (path != null) - { - Object clickedNode = path.getLastPathComponent(); - if (clickedNode instanceof ACheckNode) - { - ACheckNode node = (ACheckNode) clickedNode; - boolean newSelectionFlag; - if (node.getParameter() instanceof AStatusParameter) - newSelectionFlag = !node.isSelected(); - else - { - TristateCheckBox.State currentState = ((TristateCheckBox) node.getUserObject()).getState(); - if (currentState == TristateCheckBox.NOT_SELECTED) - newSelectionFlag = true; - else - newSelectionFlag = false; - } - node.getClicked(newSelectionFlag, true); - - if ((node.getSelectionMode() == ACheckNode.MULTI_SELECTION)) - { - if (node.isSelected()) - { - tree.expandPath(path); - } - else - { - if (row != 0) - tree.collapsePath(path); - } - } - ((DefaultTreeModel) tree.getModel()).nodeChanged(node); - // I need revalidate if node is root. but why? - if (row == 0) - { - tree.revalidate(); - tree.repaint(); - } - } - } - } - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/parameters/package.html b/graphics/AtlantisJava/src/atlantis/parameters/package.html deleted file mode 100644 index 8572821c5f1e9ac638b2e195abf07bc063a47498..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/parameters/package.html +++ /dev/null @@ -1,7 +0,0 @@ -<html> -<head></head> -<body> -<p>Application parameter store where APar and AParameter are the main - classes.</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjection.java b/graphics/AtlantisJava/src/atlantis/projection/AProjection.java deleted file mode 100755 index 2cd72969cf86adc9ec1bd9f4b1d4cca8fddbf832..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjection.java +++ /dev/null @@ -1,32 +0,0 @@ -package atlantis.projection; - - -import java.awt.event.ActionListener; -import atlantis.canvas.AWindow; -import atlantis.event.AEventManager; -import atlantis.parameters.APar; - -import javax.swing.*; -import java.awt.*; - - -public abstract class AProjection implements ActionListener { - - protected static APar parameterStore = APar.instance(); - protected static AEventManager eventManager = AEventManager.instance(); - - public abstract String getName(); - public abstract String getScreenName(); - public abstract void paint(AWindow window, Graphics g); - - public abstract JMenuItem[] getPopupItems(); - - // next 4/5 needed for normal 2d projections, not for others e.g. Braintests - // should be changed at some point..... - public abstract String getXLabel(); - public abstract String getYLabel(); - public abstract String getXUnits(); - public abstract String getYUnits(); - public abstract void setScales(); - public abstract boolean processLocalCommand(String name); -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjection2D.java b/graphics/AtlantisJava/src/atlantis/projection/AProjection2D.java deleted file mode 100755 index d7a12dd4ead1dc0cf0c7ba93415f0ca78950c490..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjection2D.java +++ /dev/null @@ -1,348 +0,0 @@ -package atlantis.projection; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.geom.Point2D; -import java.util.List; -import java.util.ArrayList; - -import javax.swing.JMenuItem; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.data.ACalorimeterData; -import atlantis.data.ADHelix; -import atlantis.event.AData; -import atlantis.event.AEvent; -import atlantis.geometry.AAtlasDetector; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.parameters.AParameter; -import atlantis.utils.APolygon; -import atlantis.utils.AVector; - -/** - * Base class of Standard 2D projections handles the painting of a projection - * Handles non-linear transforms (linear transforms in AWindow) - */ -public abstract class AProjection2D extends AProjection -{ - private boolean debug = false; - protected ArrayList<JMenuItem> popupItems; - protected final static String ASPECT_RATIO_1 = "Aspect Ratio 1"; - - public AProjection2D() - { - popupItems = new ArrayList<JMenuItem>(); - } - - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - - if (action.equals(ASPECT_RATIO_1)) - setAspectRatio1(ACanvas.getCanvas().getCurrentWindow()); - } - - public void setAspectRatio1(AWindow window) - { - //Get the extend of the shown projection (i.e. the corners in user coordinates) - Point2D.Double[] corners = window.getUserCorners(); - AVector v01 = new AVector(corners[0], corners[1]); - AVector v12 = new AVector(corners[1], corners[2]); - //Get the actual size of this window on the screen - Rectangle wSize = window.getBounds(); - - //Calculate new corner positions - //This seems a bit longish to me... CLEANUP - S.B. - - //Calculate stretch factor f such that we keep the larger one of the two extends in user coordinates - //"modulus" just means length of vector! - double f = Math.min(wSize.width / v01.modulus(), wSize.height / v12.modulus()); - - //Rescale new width and height - double w = wSize.width / f; - double h = wSize.height / f; - - //All this just to calculate the center and the new scale - //Maybe easier to split with an if-statement rather than using "Math.min" above - AVector down = v12.getUnitary().scale(h / 2); - AVector up = v12.getUnitary().invert().scale(h / 2); - - AVector v0 = v01.getUnitary().invert().scale(w / 2).add(up); - AVector v1 = v01.getUnitary().scale(w / 2).add(up); - AVector v2 = v01.getUnitary().scale(w / 2).add(down); - - AVector v02 = new AVector(corners[0], corners[2]).scale(0.5); - Point2D.Double center = new Point2D.Double(corners[0].x + v02.dx, corners[0].y + v02.dy); - - //Set the new corner positions - corners[0].setLocation(center.x + v0.dx, center.y + v0.dy); - corners[1].setLocation(center.x + v1.dx, center.y + v1.dy); - corners[2].setLocation(center.x + v2.dx, center.y + v2.dy); - - //Apply new user coordinates - window.setUserCorners(corners); - } - - public boolean processLocalCommand(String name) - { - return false; - } - - public abstract String getName(); - - public String getScreenName() - { - return getName(); - } - - protected Color getBackgroundFillColor(Color[] colorMap) - { - return colorMap[parameterStore.get("Color", "BkgFill").getI()]; - } - - // min rho for tracks - public double getMinRho() - { - return 0.; - } - - public void paint(AWindow window, Graphics g) - { - - AEvent event = null; - List hitsAndTracks = null; - AGraphics ag = AGraphics.makeAGraphics(g); - long time = 0; - - if (debug) - { - time = System.currentTimeMillis(); - } - fillBackground(window, ag); - if (debug) - { - System.out.println("fill " + (System.currentTimeMillis() - time)); - time = System.currentTimeMillis(); - } - - // draw detector geometry - AAtlasDetector.getDetector().draw(window, ag, this); - if (debug) - { - System.out.println("det " + (System.currentTimeMillis() - time)); - time = System.currentTimeMillis(); - } - - // is true when F key is pressed during ZMR operations (detector is - // zoomed for instance, but data are not drawn during the operation) - boolean fastZooming = parameterStore.get("Projection", "SkipData").getStatus(); - if (fastZooming) - { - return; - } - - // draw the current event - event = eventManager.getCurrentEvent(); - - //If there is no current event do nothing - if (event == null) return; - - ACalorimeterData.drawCalorimeters(window, ag, this, event); - - hitsAndTracks = event.getHitsAndTracks(this); - if (debug) - { - System.out.println("calo " + (System.currentTimeMillis() - time)); - time = System.currentTimeMillis(); - } - for (int h = 0; h < hitsAndTracks.size(); h++) - { - ((AData) hitsAndTracks.get(h)).draw(window, ag, this); - if (debug) - { - long delta = (System.currentTimeMillis() - time); - if (delta > 0) - { - System.out.println(((AData) hitsAndTracks.get(h)).getName() + " " + delta); - } - time = System.currentTimeMillis(); - } - } // for - - } // paint() - - protected void fillBackground(AWindow window, AGraphics ag) - { - ag.setColor(getBackgroundFillColor(AColorMap.getColors())); - ag.fillRect(0, 0, window.getWidth(), window.getHeight()); - } - - // this is here to make drawing of tracks fast enough - public abstract ACoord getUserPoint(ADHelix dH, double s); - - public ACoord nonLinearTransform(ACoord user) - { - return user; - } - - public ACoord[] nonLinearTransform(ACoord[] user) - { - if (user != null) - for (int i = 0; i < user.length; i++) - user[i] = nonLinearTransform(user[i]); - return user; - } - - public Point2D.Double nonLinearTransform(double x, double y) - { - ACoord c = nonLinearTransform(new ACoord(x, y)); - return new Point2D.Double(c.hv[0][0][0], c.hv[1][0][0]); - } - - public Point2D.Double nonLinearTransform(Point2D.Double user) - { - return nonLinearTransform(user.x, user.y); - } - - public ACoord inverseNonLinearTransform(ACoord user) - { - return user; - } - - public Point2D.Double inverseNonLinearTransform(double x, double y) - { - ACoord c = inverseNonLinearTransform(new ACoord(x, y)); - - return new Point2D.Double(c.hv[0][0][0], c.hv[1][0][0]); - } - - public Point2D.Double inverseNonLinearTransform(Point2D.Double user) - { - return inverseNonLinearTransform(user.x, user.y); - } - - protected static ACoord nonLinearTransform2D(ACoord user, String projectionName) - { - AParameter fishEyePar = parameterStore.get(projectionName, "FishEye"); - - if (fishEyePar.getStatus()) - { - double[] z, r; - double fishEye = 0.001 * fishEyePar.getD(); - double rTo = parameterStore.get(projectionName, "rTo").getD(); - double zTo = parameterStore.get(projectionName, "zTo").getD(); - - for (int j = 0; j < user.hv[0].length; ++j) - { - z = user.hv[0][j]; - r = user.hv[1][j]; - for (int i = 0; i < z.length; ++i) - { - z[i] *= (1 + fishEye * zTo) / (1 + fishEye * Math.abs(z[i])); - r[i] *= (1 + fishEye * rTo) / (1 + fishEye * Math.abs(r[i])); - } - } - } - return user; - } - - protected static ACoord inverseNonLinearTransform2D(ACoord user, String projectionName) - { - AParameter fishEyePar = parameterStore.get(projectionName, "FishEye"); - - if (fishEyePar.getStatus()) - { - double[] z, r; - double fishEye = 0.001 * fishEyePar.getD(); - double rTo = parameterStore.get(projectionName, "rTo").getD(); - double zTo = parameterStore.get(projectionName, "zTo").getD(); - - for (int j = 0; j < user.hv[0].length; ++j) - { - z = user.hv[0][j]; - r = user.hv[1][j]; - for (int i = 0; i < z.length; ++i) - { - z[i] *= 1 / (1 + fishEye * (zTo - Math.abs(z[i]))); - r[i] *= 1 / (1 + fishEye * (rTo - Math.abs(r[i]))); - } - } - } - return user; - } - - protected static Point2D.Double[] aspectRatioLayout(double width, double height, Dimension wSize) - { - double f = Math.min(wSize.width / width, wSize.height / height); - - width = wSize.width / f; - height = wSize.height / f; - - Point2D.Double[] corners = new Point2D.Double[3]; - - corners[0] = new Point2D.Double(-width, +height); - corners[1] = new Point2D.Double(+width, +height); - corners[2] = new Point2D.Double(+width, -height); - return corners; - } - - public void setScales() - {} - - public abstract Point2D.Double[] calculateNoZoomCorners(Dimension wSize); - - public abstract Point2D.Double getCenter(); - - public Point2D.Double[] validateCorners(Point2D.Double[] corners) - { - APolygon p = new APolygon(); - - for (int i = 0; i < corners.length; i++) - p.addPoint(corners[i].x, corners[i].y); - - if (p.getArea() == 0) - return null; - else - return corners; - } - - /** - * This function is called when the ACanvas configuration was written on - * a screen with one aspect ratio but the current screen has a different - * aspect ratio. Subclasses may re-implement this to behave however they - * like. At present (when this was written) only YX does anything. - * - * -- Adam Davison - * - * @param w AWindow object containing this - * @param oldaspect Aspect ratio of screen where current window corners were chosen - * @param newaspect Aspect ratio of screen now - */ - - public void aspectRatioChange(AWindow w, double oldaspect, double newaspect) { - // Do nothing by default - } - - public JMenuItem[] getPopupItems() - { - // Can't cast arrays very easily... - JMenuItem[] ret = new JMenuItem[popupItems.size()]; - for (int i = 0; i < popupItems.size(); i++) { - ret[i] = (JMenuItem)popupItems.get(i); - } - return ret; - } - - protected void addPopupItem(String str) { - JMenuItem it = new JMenuItem(str); - popupItems.add(it); - it.addActionListener(this); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjection3D.java b/graphics/AtlantisJava/src/atlantis/projection/AProjection3D.java deleted file mode 100755 index 28bf192814cf5ba269084ff48041bc0aefb39afd..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjection3D.java +++ /dev/null @@ -1,167 +0,0 @@ -package atlantis.projection; - -import atlantis.data.ADHelix; -import atlantis.graphics.*; -import atlantis.parameters.APar; -import atlantis.utils.AMath; -import atlantis.event.*; -import java.awt.*; -import java.awt.geom.*; -import javax.swing.JMenuItem; - -public class AProjection3D extends AProjection2D { - - // axis about which the rotations take place - static private double phi; - static private double sinPhi, cosPhi; - // center of rotation in xyz frame - static private double rx, ry, rz; - // three axis abc in the xyz frame - static private double ax, ay, az; - static private double bx, by, bz; - static private double cx, cy, cz; - - static private double[][] abc=new double[3][3]; - - public AProjection3D() { - JMenuItem asp = new JMenuItem(ASPECT_RATIO_1); - asp.addActionListener(this); - popupItems.add(asp); - } - - public String getName() { - return "3D"; - } - - public String getXLabel() { - return "V"; - } - - public String getYLabel() { - return "H"; - } - - public String getXUnits() { - return "(cm)"; - } - - public String getYUnits() { - return "(cm)"; - } - - public Point2D.Double getCenter() { - return new Point2D.Double(0, 0); - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) { - double radius=parameterStore.get("Projection", "TrackingRadius").getD(); - double length=parameterStore.get("Projection", "TrackingLength").getD(); - return aspectRatioLayout(length, radius, wSize); - } - - public static double getPhi() { - return parameterStore.get("3D", "Phi").getD(); - } - - public static void updateParameters() { - phi=Math.toRadians(getPhi()); - sinPhi=Math.sin(phi); - cosPhi=Math.cos(phi); - ax=parameterStore.get("3D", "xAxis").getD(); - ay=parameterStore.get("3D", "yAxis").getD(); - az=parameterStore.get("3D", "zAxis").getD(); - rx=parameterStore.get("Event", "XVtx").getD(); - ry=parameterStore.get("Event", "YVtx").getD(); - rz=parameterStore.get("Event", "ZVtx").getD(); - double dx; - double dy; - double dz; - - if(ax==0.&&ay==0) { - // d is the y-axis - dx=0.; - dy=-1.; - dz=0.; - } else { - // d is the z-axis - dx=0.; - dy=0.; - dz=1.; - } - - bx=+ay*dz-az*dy; - by=-ax*dz+az*dx; - bz=+ax*dy-ay*dx; - - cx=+ay*bz-az*by; - cy=-ax*bz+az*bx; - cz=+ax*by-ay*bx; - } - - public static double[][] getRotationMatrix() { - updateParameters(); - abc[0][0]=ax; - abc[0][1]=ay; - abc[0][2]=az; - abc[1][0]=bx; - abc[1][1]=by; - abc[1][2]=bz; - abc[2][0]=cx; - abc[2][1]=cy; - abc[2][2]=cz; - return abc; - } - - public static double[] getRotated(double[] p) { - updateParameters(); - double x=p[0]-rx; - double y=p[1]-ry; - double z=p[2]-rz; - - double u=x*ax+y*ay+z*az; - double v=x*bx+y*by+z*bz; - double w=x*cx+y*cy+z*cz; - - p[0]=u; - p[1]=v*cosPhi-w*sinPhi; - p[2]=v*sinPhi+w*cosPhi; - return p; - } - - public static double[][] getRotated(int numDraw, int[] listdl, float[] x, float[] y, float[] z) { - updateParameters(); - - double[][] uvw=new double[3][numDraw]; - - for(int i=0; i<numDraw; i++) { - int list=listdl[i]; - double xx=x[list]-rx; - double yy=y[list]-ry; - double zz=z[list]-rz; - double u=xx*ax+yy*ay+zz*az; - double v=xx*bx+yy*by+zz*bz; - double w=xx*cx+yy*cy+zz*cz; - uvw[0][i]=u; - uvw[1][i]=v*cosPhi-w*sinPhi; - uvw[2][i]=v*sinPhi+w*cosPhi; - } - return uvw; - } - - public static int[] getAxisMapping() { - return new int[] {0, 1, 2}; - } - - public ACoord getUserPoint(ADHelix dH, double s) { - return nonLinearTransform(dH.get3DPoint(s)); - } - - public ACoord nonLinearTransform(ACoord user) { - return nonLinearTransform2D(user, getName()); - } - - public ACoord inverseNonLinearTransform(ACoord user) { - return inverseNonLinearTransform2D(user, getName()); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjection3DBox.java b/graphics/AtlantisJava/src/atlantis/projection/AProjection3DBox.java deleted file mode 100755 index 62ae22b6913cd7ae2cec7df20fd5bddb31525027..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjection3DBox.java +++ /dev/null @@ -1,569 +0,0 @@ -package atlantis.projection; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.geom.Point2D; -import java.util.LinkedList; - -import javax.swing.JMenuItem; - -import Jama.Matrix; -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.data.A3DPointData; -import atlantis.data.ADHelix; -import atlantis.event.AEvent; -import atlantis.data.ATrackData; -import atlantis.graphics.ACoord; -import atlantis.graphics.ADrawParameters; -import atlantis.graphics.ADrawable; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; - -public class AProjection3DBox extends AProjection -{ - // angle of the rotation about the axis - static private double phi; - static private double sinPhi; - static private double cosPhi; - - static private double scale; - static private double zP; - static private double xz; - static private double yz; - - static private AVec3D centerDisplay; - static private AVec3D sizeDisplay; - - static private AVec3D sizeUser = new AVec3D(1.1, .5, .5); - - static final String RESTORE_DEFAULTS = "Default Box Volume"; - - static private LinkedList<AVec3D[]> planes = new LinkedList<AVec3D[]>(); - - static private JMenuItem[] popupItems; - - public AProjection3DBox() - { - popupItems = new JMenuItem[1]; - popupItems[0] = new JMenuItem(RESTORE_DEFAULTS); - popupItems[0].addActionListener(this); - } - - public String getName() - { - return "3DBox"; - } - - public String getScreenName() - { - return "3DBox"; - } - - public String getXLabel() - { - return "V"; - } - - public String getYLabel() - { - return "H"; - } - - public String getXUnits() - { - return "(cm)"; - } - - public String getYUnits() - { - return "(cm)"; - } - - public void setScales() - {} - - public boolean processLocalCommand(String name) - { - return false; - } - - public Point2D.Double getCenter(AWindow window) - { - updateParameters(window); - return new Point2D.Double(centerDisplay.x, centerDisplay.y); - } - - public void zoom(double factor) - { - if (factor != 0.) - { - sizeUser = sizeUser.scale(factor); - updateScale(); - } - } - - public static void setSizeUser(double size) - { - if (size != 0.) - { - sizeUser.x = size; - // updateScale(); - // ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - } - } - - public void zoomHorizontal(double factor) - { - if (factor != 0.) - { - sizeUser.x *= factor; - updateScale(); - } - } - - public void zoomVertical(double factor) - { - if (factor != 0. && !Double.isInfinite(factor)) - { - sizeUser.y *= factor; - sizeUser.z *= factor; - updateScale(); - } - } - - public static void updateScale() - { - scale = parameterStore.get("3DBox", "Scale").getD(); - ACanvas.getCanvas().getCurrentWindow().setUserCorners(0, 2. * sizeUser.x / scale, -sizeUser.y / scale, sizeUser.y / scale); - } - - public static void updateScale(AWindow window) - { - scale = parameterStore.get("3DBox", "Scale").getD(); - window.setUserCorners(0, 2. * sizeUser.x / scale, -sizeUser.y / scale, sizeUser.y / scale); - } - - public static double getPhi() - { - return parameterStore.get("3DBox", "Phi").getD(); - } - - public static void updateParameters(AWindow window) - { - phi = Math.toRadians(getPhi()); - sinPhi = Math.sin(phi); - cosPhi = Math.cos(phi); - scale = parameterStore.get("3DBox", "Scale").getD(); - zP = parameterStore.get("3DBox", "ZP").getD(); - xz = parameterStore.get("3DBox", "xz").getD(); - yz = parameterStore.get("3DBox", "yz").getD(); - - Rectangle bounds = window.getCurrDisp(); - centerDisplay = new AVec3D(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2, 0.); - sizeDisplay = new AVec3D(0.5 * bounds.width * scale, 0.5 * bounds.height * scale, 0.5 * bounds.height * scale); - centerDisplay.x -= sizeDisplay.x; - updateScale(window); - } - - protected void drawBox(AGraphics ag) - { - double x = sizeDisplay.x; - double y = sizeDisplay.y; - double z = sizeDisplay.z; - - AVec3D[] firstPlane = new AVec3D[] { new AVec3D(0, y, z), new AVec3D(0, y, -z), new AVec3D(0, -y, -z), new AVec3D(0, -y, z) }; - AVec3D[] middlePlane = new AVec3D[] { new AVec3D(x, y, z), new AVec3D(x, y, -z), new AVec3D(x, -y, -z), new AVec3D(x, -y, z) }; - AVec3D[] lastPlane = new AVec3D[] { new AVec3D(2 * x, y, z), new AVec3D(2 * x, y, -z), new AVec3D(2 * x, -y, -z), new AVec3D(2 * x, -y, z) }; - - planes = new LinkedList<AVec3D[]>(); - - planes.add(firstPlane); - planes.add(middlePlane); - planes.add(lastPlane); - - for (int i = 0; i < planes.size(); i++) - { - AVec3D[] plane = (AVec3D[]) (planes.get(i)); - for (int j = 0; j < plane.length; ++j) - plane[j] = applyViewPoint(plane[j]); - } - - double[] h = new double[4]; - double[] v = new double[4]; - - // back - AVec3D[] back = new AVec3D[] { firstPlane[3], firstPlane[1], lastPlane[1], lastPlane[3] }; - for (int j = 0; j < back.length; ++j) - { - h[j] = back[j].x; - v[j] = back[j].y; - } - - ag.updateDrawParameters(new ADrawParameters(true, 0, 0, 1, 0, 0)); - ag.setColor(Color.gray); - ag.fillPolygon(h, v, 4); - ag.setColor(Color.white); - ag.drawPolygon(h, v, 4); - // base - AVec3D[] base = new AVec3D[] { firstPlane[0], firstPlane[1], lastPlane[1], lastPlane[0] }; - for (int j = 0; j < base.length; ++j) - { - h[j] = base[j].x; - v[j] = base[j].y; - } - ag.setColor(Color.black); - ag.fillPolygon(h, v, 4); - ag.setColor(Color.white); - ag.drawPolygon(h, v, 4); - - for (int i = 0; i < planes.size(); i++) - { - AVec3D[] plane = (AVec3D[]) (planes.get(i)); - for (int j = 0; j < plane.length; ++j) - { - h[j] = plane[j].x; - v[j] = plane[j].y; - } - ag.setColor(Color.black); - ag.fillPolygon(h, v, 4); - ag.setColor(Color.white); - ag.drawPolygon(h, v, 4); - } - - // top - AVec3D[] top = new AVec3D[] { firstPlane[3], firstPlane[2], lastPlane[2], lastPlane[3] }; - for (int j = 0; j < top.length; ++j) - { - h[j] = top[j].x; - v[j] = top[j].y; - } - ag.setColor(Color.white); - ag.drawPolygon(h, v, 4); - } - - protected void touchupBox(AGraphics ag) - { - ag.updateDrawParameters(new ADrawParameters(true, 0, 0, 1, 0, 0)); - ag.setColor(Color.white); - for (int i = 0; i < planes.size(); i++) - { - AVec3D[] plane = (AVec3D[]) (planes.get(i)); - ag.drawLine(plane[1].x, plane[1].y, plane[2].x, plane[2].y); - } - } - - AVec3D scale(AVec3D v) - { - return v.mult(sizeDisplay).divide(sizeUser); - } - - AVec3D rotate(AVec3D v) - { - return new AVec3D(v.x, v.y * cosPhi - v.z * sinPhi, v.y * sinPhi + v.z * cosPhi); - } - - static AVec3D applyViewPoint(AVec3D v) - { - return new AVec3D((v.x + xz * v.z) * (1 - v.z * zP) + centerDisplay.x, (v.y + yz * v.z) * (1 - v.z * zP) + centerDisplay.y, v.z); - } - - public void paint(AWindow window, Graphics g) - { - updateParameters(window); - AGraphics ag = AGraphics.makeAGraphics(g); - fillBackground(window, ag); - drawBox(ag); - AEvent event = eventManager.getCurrentEvent(); - if (event == null) - return; - - java.util.List hitsAndTracks = event.getHitsAndTracks(this); - - for (int h = 0; h < hitsAndTracks.size(); h++) - { - Object o = hitsAndTracks.get(h); - if (o instanceof ATrackData) - drawTracks((ATrackData) o, window, ag); - else if (o instanceof A3DPointData) - drawPoints((A3DPointData) o, window, ag); - } - touchupBox(ag); - } - - protected void drawPoints(A3DPointData pointData, AWindow window, AGraphics ag) - { - double[][] points = pointData.get3DPoints(); - int[] index = pointData.get3DPointsIndex(); - - double[][][] hv = new double[2][1][index.length]; - - for (int i = 0; i < points.length; ++i) - { - AVec3D point = rotate(new AVec3D(AProjection3D.getRotated(points[i]))); - - if (point.x > 0 && point.x < 2 * sizeUser.x && point.y > -sizeUser.y && point.y < sizeUser.y && point.z > -sizeUser.z && point.z < sizeUser.z) - { - point = applyViewPoint(scale(point)); - hv[0][0][i] = point.x; - hv[1][0][i] = point.y; - } - else - { - // aaargh allow this to be clipped from picture for now - hv[0][0][i] = -1000.; - hv[1][0][i] = -1000.; - } - } - - ag.draw(new ACoord(hv, index, pointData, ACoord.SYMBOLS)); - } - - protected void drawTracks(ATrackData tracks, AWindow window, AGraphics ag) - { - ADHelix[] dhelix = tracks.getHelices(); - - int numPlanes = planes.size(); - int numSegments = numPlanes + 4; - AVec3D[][] intersection = new AVec3D[dhelix.length][numPlanes]; - - double[][][] hv = new double[2][dhelix.length * numSegments][0]; - int[] index = new int[dhelix.length * numSegments]; - int[] indexTemp = tracks.getDrawList(); - for (int i = 0; i < indexTemp.length; ++i) - for (int j = 0; j < numSegments; ++j) - index[i * numSegments + j] = indexTemp[i]; - - int numPointsOnEllipse = 24; - AVec3D[] ellipse = new AVec3D[numPointsOnEllipse + 1]; - double radius = 0.005; - for (int i = 0; i < ellipse.length; i++) - { - double phi = 2. * Math.PI * i / numPointsOnEllipse; - ellipse[i] = new AVec3D(0., radius * Math.sin(phi), radius * Math.cos(phi)); - } - - for (int j = 0; j < dhelix.length; ++j) - if (dhelix[j] != null) - { - // s always 0? I don't know why that is... - double s = 0.; - AVec3D start = new AVec3D(dhelix[j].get3DPointAsArray(s)); - AVec3D end = new AVec3D(dhelix[j].get3DPointAsArray(s + 0.01)); - - boolean backwards = false; - - // calculate intersections - for (int p = 0; p < planes.size(); ++p) - { - // position of plane - double xInt = p * sizeUser.x; - double m = (xInt - start.x) / (end.x - start.x); - - // While we're in here, can check if we're pointing in the right direction - if (p == 1 && m < 0.0) { backwards = true; } - - double yInt = start.y + m * (end.y - start.y); - double zInt = start.z + m * (end.z - start.z); - intersection[j][p] = new AVec3D(xInt, yInt, zInt); - } - - // Throw out anything that isn't pointing in the right direction... - if (backwards) { continue; } - - AVec3D first = rotate(intersection[j][0]); - AVec3D middle = rotate(intersection[j][1]); - AVec3D last = rotate(intersection[j][numPlanes - 1]); - - if (first.y > -sizeUser.y && first.y < sizeUser.y && first.z > -sizeUser.z && first.z < sizeUser.z && last.y > -sizeUser.y && last.y < sizeUser.y && last.z > -sizeUser.z && last.z < sizeUser.z) - { - - double[][] cov = dhelix[j].helix.getCovariance(); - if (cov != null) - { - double[][] c = new double[2][2]; - c[0][0] = cov[0][0]; - c[0][1] = cov[0][1]; - c[1][0] = cov[1][0]; - c[1][1] = cov[1][1]; - Matrix covM = new Matrix(c); - Matrix errM = covM.inverse(); - - double b1 = errM.get(0, 0); - double b2 = errM.get(1, 1); - - double b3 = 2. * errM.get(0, 1); - if (parameterStore.get("3DBox", "ellipses").getStatus()) - { - ellipse = new AVec3D[180]; - - for (int i = 0; i < 360; i += 2) - { - double thetat = Math.toRadians(i); - double tt = Math.tan(thetat); - double xx = Math.sqrt(1. / (b1 + b2 * tt * tt + b3 * tt)); - if (i > 90 && i <= 270) - xx *= -1.; - ellipse[i / 2] = new AVec3D(0., xx, xx * tt); - } - } - // add intersections to draw list - for (int p = 0; p < planes.size(); ++p) - { - double[] h = new double[ellipse.length]; - double[] v = new double[ellipse.length]; - - for (int i = 0; i < ellipse.length; i++) - { - AVec3D point = applyViewPoint(scale(rotate(intersection[j][p].add(ellipse[i])))); - h[i] = point.x; - v[i] = point.y; - } - - hv[0][numSegments * j + p] = h; - hv[1][numSegments * j + p] = v; - } - } - first = applyViewPoint(scale(first)); - middle = applyViewPoint(scale(middle)); - last = applyViewPoint(scale(last)); - - double[][] edge = new double[planes.size()][2]; - for (int i = 0; i < planes.size(); i++) - { - AVec3D[] plane = (AVec3D[]) (planes.get(i)); - double xInt = plane[1].x; - double m = (xInt - first.x) / (last.x - first.x); - double yInt = first.y + m * (last.y - first.y); - edge[i] = new double[] { xInt, yInt }; - } - - hv[0][numSegments * j + 3] = new double[] { first.x, edge[1][0] }; - hv[1][numSegments * j + 3] = new double[] { first.y, edge[1][1] }; - hv[0][numSegments * j + 4] = new double[] { middle.x, edge[2][0] }; - hv[1][numSegments * j + 4] = new double[] { middle.y, edge[2][1] }; - - drawDashed(ag, tracks, indexTemp[j], edge[1][0], edge[1][1], middle.x, middle.y); - drawDashed(ag, tracks, indexTemp[j], edge[2][0], edge[2][1], last.x, last.y); - } - } - ag.draw(new ACoord(hv, index, tracks, ACoord.POLYLINES)); - } - - protected void drawDashed(AGraphics ag, ADrawable source, int ind, double h0, double v0, double h1, double v1) - { - double dH = h1 - h0; - double dV = v1 - v0; - double dist = Math.sqrt(dH * dH + dV * dV); - double dashSize = 4; - int num = (int) (dist / dashSize); - int[] index = new int[num / 2 + 1]; - double[][][] hv = new double[2][num / 2 + 1][2]; - - for (int i = 0; i < num; ++i) - { - if (i % 2 == 1) - { - int n = i / 2; - index[n] = ind; - hv[0][n][0] = h0 + dH * i / num; - hv[0][n][1] = h0 + dH * (i + 1) / num; - hv[1][n][0] = v0 + dV * i / num; - hv[1][n][1] = v0 + dV * (i + 1) / num; - if (i >= num - 2) - { - hv[0][n][1] = h1; - hv[1][n][1] = v1; - } - } - } - ag.draw(new ACoord(hv, index, source, ACoord.POLYLINES)); - } - -protected void fillBackground(AWindow window, AGraphics ag) - { - Color[] colorMap = AColorMap.getColors(); - ag.setColor(colorMap[getBackgroundFillColor()]); - ag.fillRect(0, 0, window.getWidth(), window.getHeight()); - } - - protected int getBackgroundFillColor() - { - return parameterStore.get("Color", "BkgFill").getI(); - } - - public JMenuItem[] getPopupItems() - { - return popupItems; - } - - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - if (action.equals(RESTORE_DEFAULTS)) - { - sizeUser.x = 2.; - sizeUser.y = .1; - sizeUser.z = .1; - updateScale(); - ACanvas.getCanvas().getCurrentWindow().repaintFromScratch(); - } - } - -} - -class AVec3D -{ - double x, y, z; - - AVec3D(double x, double y, double z) - { - this.x = x; - this.y = y; - this.z = z; - } - - AVec3D(double[] v) - { - this.x = v[0]; - this.y = v[1]; - this.z = v[2]; - } - - AVec3D cross(AVec3D d) - { - return new AVec3D(+this.y * d.z - this.z * d.y, -this.x * d.z + this.z * d.x, +this.x * d.y - this.y * d.x); - } - - AVec3D add(AVec3D d) - { - return new AVec3D(x + d.x, y + d.y, z + d.z); - } - - AVec3D mult(AVec3D d) - { - return new AVec3D(x * d.x, y * d.y, z * d.z); - } - - AVec3D divide(AVec3D d) - { - return new AVec3D(x / d.x, y / d.y, z / d.z); - } - - AVec3D scale(double s) - { - return new AVec3D(s * x, s * y, s * z); - } - - public String toString() - { - return x + " " + y + " " + z; - } - - public double mag2() { - return x*x + y*y + z*z; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionEventInfo.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionEventInfo.java deleted file mode 100644 index 1735ec2a666bc8d2c8313d49382783321309e7ba..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionEventInfo.java +++ /dev/null @@ -1,197 +0,0 @@ -package atlantis.projection; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.event.ActionEvent; -import java.awt.geom.Point2D; -import javax.swing.ImageIcon; -import javax.swing.JMenuItem; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.data.ADHelix; -import atlantis.event.AEvent; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.utils.AUtilities; - -/** Class used to display the ATLAS Experiment logo, along with - * Event Number, Run Number, and Date/Time - * - * @author Tom McLaughlan - */ -public class AProjectionEventInfo extends AProjectionInfo { - - private static long EventNumber; - private static long RunNumber; - private static String DateTime; - private static String Source; - private static Color textColor = Color.white, - backgroundColor = Color.black; - - public String getName() { - return "EventInfo"; - } - - public void paint(AWindow window, Graphics g) { - - AEvent event = eventManager.getCurrentEvent(); - - if (event != null) { - RunNumber = event.getRunNumber(); - EventNumber = event.getEventNumber(); - DateTime = event.getDateTime(); - Source = event.getSourceName(); - } - - // Begin drawing - AGraphics ag = AGraphics.makeAGraphics(g); - // Fill the background - ag.setColor(backgroundColor); - ag.fillRect(0, 0, window.getWidth(), window.getHeight()); - - String iconPath = AGlobals.instance().getHomeDirectory() + "img" + System.getProperty("file.separator"); - - ImageIcon i = AUtilities.getFileAsImageIcon(iconPath + "atlas_logo_shadow.png"); - - - // Determine height and width of current window, and width of ATLAS logo - // These are then used to determine a scaling factor which is used in the - // scale function. - // - int height = window.getSize().height; - int width = window.getSize().width; - int iwidth = i.getIconWidth(); - double factor = (double) width / (double) iwidth; - - // Call scale function to scale image to window size - ImageIcon iscale = AUtilities.scale(i.getImage(), factor, parameterStore.get("Prefs", "AntiAlias").getStatus()); - // x, y calculated to position image exactly centred - int x = (width / 2) - (iscale.getIconWidth() / 2); - int y = (height / 2) - ((3 * iscale.getIconHeight()) / 4); - - // get screen dpi for resolution independent scaling - // commented out 27/3 -- EJ - // without a screen you obviously do not have a screen resolution - int dpi = 72; //Toolkit.getDefaultToolkit().getScreenResolution(); - - // Set a scaling font size with window width - int fontSize = (int) Math.round(3.0 * width / (double) dpi); - - Font f = new Font("SansSerif", Font.PLAIN, fontSize); - - ag.drawImage(iscale.getImage(), x, y); - - ag.setColor(textColor); // Set colour for text - ag.updateColor(); // Update current colour for drawing - - String DateString = "", RunEventString = ""; - String DisclaimerString1 = "", DisclaimerString2 = ""; - if (event != null) { - DateString = "Date: " + DateTime; - RunEventString = "Run Number: " + RunNumber + ", Event Number: " + EventNumber; - DisclaimerString1 = "Snapshot of a proton collision"; - DisclaimerString2 = "directly from the ATLAS experiment"; - } else { - RunEventString = "No event data available"; - } - - FontMetrics fm = g.getFontMetrics(f); - int DateWidth = fm.stringWidth(DateString); - int RunEventWidth = fm.stringWidth(RunEventString); - int Disclaimer1Width = fm.stringWidth(DisclaimerString1); - int Disclaimer2Width = fm.stringWidth(DisclaimerString2); - - // This may need changing to be a bit more elegant - // -- currently under investigation by Tom - - // Check if font is wider than the window and scale down til it fits. - while ((RunEventWidth > width - 20) || (DateWidth > width - 20)) - { - - fontSize = fontSize - 1; - f = new Font("SansSerif", Font.PLAIN, fontSize); - fm = g.getFontMetrics(f); - RunEventWidth = fm.stringWidth(RunEventString); - DateWidth = fm.stringWidth(DateString); - Disclaimer1Width = fm.stringWidth(DisclaimerString1); - Disclaimer2Width = fm.stringWidth(DisclaimerString2); - } - - ag.setFont(f); // set font as defined above - - // For the streams at P1, we include a disclaimer - // Anything without .xml is considered a stream for now - if (Source != null && !Source.endsWith(".xml")) { - ag.drawString(DisclaimerString1, - (width / 2) - Disclaimer1Width / 2, 0.89 * height); - ag.drawString(DisclaimerString2, - (width / 2) - Disclaimer2Width / 2, 0.95 * height); - } - - if (event != null && !DateTime.equals("") && !DateTime.equals("n/a")) { - // If event contains Date/Time data, draw Run Number, Event Number and Date/Time - // and position text in centre of window - ag.drawString(RunEventString, - (width / 2) - RunEventWidth / 2, y + (1.1 * iscale.getIconHeight())); - - ag.drawString(DateString, - (width / 2) - DateWidth / 2, y + (1.3 * iscale.getIconHeight())); - } else { - // Draw text (No Date/Time, for MC events, etc) - ag.drawString(RunEventString, - (width / 2) - RunEventWidth / 2, y + (1.1 * iscale.getIconHeight())); - - } - - } - - public JMenuItem[] getPopupItems() { - return null; - } - - public String getXLabel() { - return ""; - } - - public String getXUnits() { - return ""; - } - - public String getYLabel() { - return ""; - } - - public String getYUnits() { - return ""; - } - - @Override - public void actionPerformed(ActionEvent e) { - assert false : "Did not expect AProjectionEventInfo to be used as ActionListener"; - } - - public void setScales() { - } - - public Point2D.Double getCenter() { - return new Point2D.Double(0.0, 0.0); - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) { - Point2D.Double[] corners = new Point2D.Double[3]; - - corners[0] = new Point2D.Double(0., 2.); - corners[1] = new Point2D.Double(100., 2.); - corners[2] = new Point2D.Double(100., -2.); - return corners; - } - - public ACoord getUserPoint(ADHelix dH, double s) { - return ACoord.NO_DATA; - } -}//end of EventInfoProjection class diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionFR.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionFR.java deleted file mode 100755 index ddc52bdb54cf8e32b45e7e620d8fc2645240b9ac..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionFR.java +++ /dev/null @@ -1,127 +0,0 @@ -package atlantis.projection; - -import java.awt.Dimension; -import java.awt.geom.Point2D; - -import atlantis.canvas.ACanvas; -import atlantis.data.ADHelix; -import atlantis.graphics.ACoord; -import atlantis.interactions.AZMRInteraction; -import atlantis.parameters.APar; -import atlantis.parameters.AParameter; -import atlantis.utils.AMath; - -public class AProjectionFR extends AProjectionPhi -{ - public String getName() - { - return "FR"; - } - - public String getXLabel() - { - return AMath.RHO; - } - - public String getXUnits() - { - return "(cm)"; - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) - { - Point2D.Double[] corners = new Point2D.Double[3]; - int phiWrap = parameterStore.get(getName(), "PhiWrap").getI(); - - double radius = parameterStore.get("Projection", "Radius").getD(); - corners[0] = new Point2D.Double(0, 360 + phiWrap); - corners[1] = new Point2D.Double(radius, 360 + phiWrap); - corners[2] = new Point2D.Double(radius, 0); - return corners; - } - - public ACoord getUserPoint(ADHelix dH, double s) - { - return nonLinearTransform(dH.getFRPoint(s)); - } - - public ACoord nonLinearTransform(ACoord user) - { - AParameter fishEyePar = parameterStore.get(getName(), "FishEye"); - - // Fisheye of projection FR should not change phi - if (fishEyePar.getStatus()) - { - double[] r; - //double[] phi; - double fishEye = 0.001 * fishEyePar.getD(); - double rTo = parameterStore.get(getName(), "rTo").getD(); - //Point2D.Double[] corners = ACanvas.getCanvas().getCurrentWindow().getUserCorners(); - //double phiMid = (corners[0].getY() + corners[2].getY()) / 2.; - - for (int j = 0; j < user.hv[0].length; ++j) - { - r = user.hv[0][j]; - //phi = user.hv[1][j]; - for (int i = 0; i < r.length; ++i) - { - double fact = (1 + fishEye * rTo) / (1 + fishEye * r[i]); - - //phi[i] = phiMid + (phi[i] - phiMid) * fact; - r[i] *= fact; - } - } - } - - // Horizontal Zoom is applied in ZMR interaction - - // don't know what this has to do here? - // CLEANUP - S.B. - /* AParameter horZoomPar = APar.get(getName(), "HorizontalZoom"); - - if (horZoomPar.getStatus()) - { - // performe initial horizontal zoom - double hzf = APar.get("FR", "HorizontalZoom").getD(); - Point2D.Double[] corners = ACanvas.getCanvas().getCurrentWindow().getUserCorners(); - double centerRho = corners[0].getX(); - double centerPhi = (corners[0].getY() + corners[2].getY()) / 2.; - Point2D.Double center = new Point2D.Double(centerRho, centerPhi); - AZMRInteraction.performHorizontalZoom(center, hzf, ACanvas.getCanvas().getPaintingWindow()); - - horZoomPar.setStatus(false); - } - */ - return user; - } - - public ACoord inverseNonLinearTransform(ACoord user) - { - AParameter fishEyePar = parameterStore.get(getName(), "FishEye"); - - if (fishEyePar.getStatus()) - { - double[] r; - //double[] phi; - double fishEye = 0.001 * fishEyePar.getD(); - double rTo = parameterStore.get(getName(), "rTo").getD(); - //Point2D.Double[] corners = ACanvas.getCanvas().getCurrentWindow().getUserCorners(); - //double phiMid = (corners[0].getY() + corners[2].getY()) / 2.; - - for (int j = 0; j < user.hv[0].length; ++j) - { - r = user.hv[0][j]; - //phi = user.hv[1][j]; - for (int i = 0; i < r.length; ++i) - { - double fact = 1 / (1 + fishEye * (rTo - r[i])); - - //phi[i] = phiMid + (phi[i] - phiMid) * fact; - r[i] *= fact; - } - } - } - - return user; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionFZ.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionFZ.java deleted file mode 100755 index 32c092064bd5bfdf68af406f15167149713a991a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionFZ.java +++ /dev/null @@ -1,76 +0,0 @@ -package atlantis.projection; - - -import atlantis.parameters.AParameter; -import atlantis.parameters.APar; -import java.awt.geom.*; -import java.awt.*; -import atlantis.graphics.ACoord; -import atlantis.data.ADHelix; - - -public class AProjectionFZ extends AProjectionPhi { - - public String getName() { - return "FZ"; - } - - public String getXLabel() { - return "Z"; - } - - public String getXUnits() { - return "(cm)"; - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) { - Point2D.Double[] corners=new Point2D.Double[3]; - int phiWrap=parameterStore.get(getName(), "PhiWrap").getI(); - - double length=parameterStore.get("Projection", "Length").getD(); - - corners[0]=new Point2D.Double(-length, 360+phiWrap); - corners[1]=new Point2D.Double(length, 360+phiWrap); - corners[2]=new Point2D.Double(length, 0); - return corners; - } - - public ACoord getUserPoint(ADHelix dH, double s) { - return nonLinearTransform(dH.getFZPoint(s)); - } - - public ACoord nonLinearTransform(ACoord user) { - AParameter fishEyePar=parameterStore.get(getName(), "FishEye"); - - if(fishEyePar.getStatus()) { - double[] z; - double fishEye=0.001*fishEyePar.getD(); - double zTo=parameterStore.get(getName(), "zTo").getD(); - - for(int j=0; j<user.hv[0].length; ++j) { - z=user.hv[0][j]; - for(int i=0; i<z.length; ++i) - z[i]*=(1+fishEye*zTo)/(1+fishEye*Math.abs(z[i])); - } - } - return user; - } - - public ACoord inverseNonLinearTransform(ACoord user) { - AParameter fishEyePar=parameterStore.get(getName(), "FishEye"); - - if(fishEyePar.getStatus()) { - double[] z; - double fishEye=0.001*fishEyePar.getD(); - double zTo=parameterStore.get(getName(), "zTo").getD(); - - for(int j=0; j<user.hv[0].length; ++j) { - z=user.hv[0][j]; - for(int i=0; i<z.length; ++i) - z[i]*=1/(1+fishEye*(zTo-Math.abs(z[i]))); - } - } - return user; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionInfo.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionInfo.java deleted file mode 100644 index b7428f177514565b48e9a357c9f3b63ba9a51c4a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionInfo.java +++ /dev/null @@ -1,102 +0,0 @@ -package atlantis.projection; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.RenderingHints; -import java.awt.geom.Point2D; -import java.awt.image.BufferedImage; - -import javax.swing.ImageIcon; - -import atlantis.canvas.AWindow; -import atlantis.event.AEvent; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; - -/** - * Stripped down clone of the 2D Projection class - * Used simply to display event data (as text) in a window - * with the ATLAS experiment logo, for publications and presentation purposes - * - * Also contains rudimentary image scaling code used to scale the ATLAS logo depending - * on window size - * - * @author Tom McLaughlan - */ -public abstract class AProjectionInfo extends AProjection -{ - private boolean debug = false; - - protected final static String ASPECT_RATIO_1 = "Aspect Ratio 1"; - - public AProjectionInfo() - {} - - public boolean processLocalCommand(String name) - { - return false; - } - - public abstract String getName(); - - public String getScreenName() - { - return getName(); - } - - protected Color getBackgroundFillColor(Color[] colorMap) - { - return colorMap[parameterStore.get("Color", "BkgFill").getI()]; - } - - public void paint(AWindow window, Graphics g) - { - - AEvent event = null; - AGraphics ag = AGraphics.makeAGraphics(g); - long time = 0; - - if (debug) - { - time = System.currentTimeMillis(); - } - fillBackground(window, ag); - if (debug) - { - System.out.println("fill " + (System.currentTimeMillis() - time)); - time = System.currentTimeMillis(); - } - - - // draw the current event - event = eventManager.getCurrentEvent(); - - //If there is no current event do nothing - if (event == null) return; - - } // paint() - - protected void fillBackground(AWindow window, AGraphics ag) - { - ag.setColor(getBackgroundFillColor(AColorMap.getColors())); - ag.fillRect(0, 0, window.getWidth(), window.getHeight()); - } - - protected static Point2D.Double[] aspectRatioLayout(double width, double height, Dimension wSize) - { - double f = Math.min(wSize.width / width, wSize.height / height); - - width = wSize.width / f; - height = wSize.height / f; - - Point2D.Double[] corners = new Point2D.Double[3]; - - corners[0] = new Point2D.Double(-width, +height); - corners[1] = new Point2D.Double(+width, +height); - corners[2] = new Point2D.Double(+width, -height); - return corners; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionLegoPlot.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionLegoPlot.java deleted file mode 100755 index 2179a2d7f2e26d46f10f64ba8f9f3c52f381418e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionLegoPlot.java +++ /dev/null @@ -1,402 +0,0 @@ -package atlantis.projection; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.event.ActionEvent; -import java.awt.geom.Point2D; -import java.util.HashSet; -import java.util.Set; - -import atlantis.canvas.ACanvas; -import atlantis.canvas.AWindow; -import atlantis.data.ACalorimeterData; -import atlantis.data.ADHelix; -import atlantis.event.AEvent; -import atlantis.data.ALegoData; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.graphics.ALegoDraw; -import atlantis.graphics.colormap.AColorMap; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.utils.AMath; - -public class AProjectionLegoPlot extends AProjection2D -{ - public static byte nLayers = 29;//also used in ALegoData - //xz and yz are used to define the angle of the eta axis (altered in rotate interaction) - private static double[] xz; - private static double[] yz; - //Variables needed by ALegoDraw and ALegoData that are updated here from changes to the gui value - public static int defaultScale = parameterStore.get("LegoPlot", "Scale").getI();//set the axis scale (standard, log or sqrt) - public static int nPhiCells = parameterStore.get("LegoPlot", "nphicells").getI(); - public static int nEtaCells = parameterStore.get("LegoPlot", "netacells").getI(); - public static Color[] defaultColorMap = AColorMap.getColors(); - public static Color[] caloColorMap = AColorMap.getColors();//to allow colouring by energy - public static boolean reverse = false;//also used by ASynchroCursorsInteraction - public static int mode = parameterStore.get("LegoPlot", "Mode").getI(); - public static int colorEM, colorHad; - public static Set colorset = new HashSet();//not updated here - public static final int minimumofLogScale=(int) Math.round(Math.log10(0.01));// we set 10MeV to lego height 0 on log scale - protected final static String VIEW_DEFAULT = "View normal"; - protected final static String VIEW_FROM_ABOVE = "View from above"; - protected final static String VIEW_ET_ETA = "View Et v " + AMath.ETA; - protected final static String VIEW_ET_PHI = "View Et v " + AMath.PHI; - - //to select th right drawing options for AOD object towers - public final static int DRAW_MET = -21; - public final static int DRAW_MUON = -2; - public final static int DRAW_ELECTRON = -3; - public final static int DRAW_PHOTON = -4; - public final static int DRAW_CLUSTER = -5; - public final static int DRAW_COMPOSITEPARTICLE = -6; - public final static int DRAW_BJET = -7; - public final static int DRAW_TAUJET = -8; - public final static int DRAW_JET = -9; - - public AProjectionLegoPlot() { - addPopupItem(VIEW_DEFAULT); - addPopupItem(VIEW_FROM_ABOVE); - addPopupItem(VIEW_ET_ETA); - addPopupItem(VIEW_ET_PHI); - } - - @Override - public void actionPerformed(ActionEvent e) - { - String action = e.getActionCommand(); - int index=0; - AWindow currentWindow = ACanvas.getCanvas().getCurrentWindow(); - index=currentWindow.getIndex(); - Point2D.Double[] corners = currentWindow.getUserCorners(); - double dPhi=0,dEta=0,currentxz=xz[index],currentyz=yz[index]; - - if (action.equals(VIEW_DEFAULT)) - { - xz[index]=0.6; - yz[index]=0.5; - } - else if (action.equals(VIEW_FROM_ABOVE)) - { - xz[index]=0.8; - yz[index]=0.9; - } - else if (action.equals(VIEW_ET_PHI)) - { - xz[index]=0.0; - yz[index]=-50; - } - else if (action.equals(VIEW_ET_ETA)) - { - xz[index]=360.0; - yz[index]=-75; - } - dPhi=360*(xz[index]-currentxz); - dEta=50*(currentyz-yz[index]); - corners[0].x -= (dPhi); - corners[0].y -= (dEta); - corners[1].y -= (dEta); - currentWindow.setUserCorners(corners); - //reset the center of detector dot on ZMR - // TODO: Check if this really is superfluous. I can't find any situation where it - // sets the interaction group to anything other than its old value. - Ben Waugh 2011-11-09 -// currentWindow.getInteractionManager().setContext(currentWindow.getInteractionToolBar().getSelectedGroup()); - } - - @Override - public void setAspectRatio1(AWindow window) - { - AOutput.append("\nNot implemented for this projection\n", ALogInterface.WARNING); - } - - public String getName() - { - return "LegoPlot"; - } - - public String getXLabel() - { - return AMath.PHI; - } - - public String getYLabel() - { - return AMath.ETA; - } - - public String getXUnits() - { - return AMath.DEGREES; - } - - public String getYUnits() - { - return ""; - } - - public Point2D.Double getCenter() - { - /*in the lego plot the center changes if there is rotation - however the getCenter is also needed in initialization - which is before windows are indexed*/ - int index=0; - double temp=0; - //check to see if the windows are indexed - try - { - index=ACanvas.getCanvas().getCurrentWindow().getIndex(); - } - catch(Throwable t) - { - temp=0.6;//hasn't indexed windows yet - } - if(temp==0) - temp=xz[index]; - return new Point2D.Double(-360.0*temp,-5.0); - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) - { - if(xz==null) - { - xz=new double[ACanvas.getCanvas().getWindowsCount()]; - for(int i=0; i<ACanvas.getCanvas().getWindowsCount(); i++) - { - xz[i]=0.6; - } - } - if(yz==null) - { - yz=new double[ACanvas.getCanvas().getWindowsCount()]; - for(int i=0; i<ACanvas.getCanvas().getWindowsCount(); i++) - { - yz[i]=0.5; - } - } - if(ACanvas.getCanvas().getCurrentWindow()!=null) - { - int currentIndex =ACanvas.getCanvas().getCurrentWindow().getIndex(); - xz[currentIndex]=0.6; - yz[currentIndex]=0.5; - } - //called before have windows so xz=0.6 and yz=0.5 - Point2D.Double[] corners = new Point2D.Double[3]; - corners[0]=new Point2D.Double(-360.0*0.6,-5-0.5*50); - corners[1]=new Point2D.Double(360.0, -5-0.5*50); - corners[2]=new Point2D.Double(360.0, 5); - //add on an offset - corners[0].x-=25.0; - corners[1].x+=25.0; - corners[2].x+=25.0; - corners[2].y+=3.0; - return corners; - } - - public ACoord getUserPoint(ADHelix dH, double s) - { - return nonLinearTransform(dH.getLEGOPoint(s)); - } - - @Override - public void paint(AWindow window, Graphics g) - { - // update parameters - update(); - // Load the event - AEvent event = eventManager.getCurrentEvent(); - if (event == null) - return; - // Create and fill histograms - double[][][] lego = new double[nPhiCells][nEtaCells][nLayers]; - ALegoData.fillHistograms(event, lego); - // Find the maximum energy - double maxEt = 0.0, AODmaxEt = 0.0, LEGOmaxEt = 0.0; - // loop over histogram data to scale towers and find maxEt - LEGOmaxEt = ALegoData.findMaxEt(lego); - maxEt=LEGOmaxEt; - // loop over AOD data - AODmaxEt = ALegoData.findAODMaxEt(event); - //check if user wants to scale to AOD objects rather than cells - //but only if the AOD max is greater than 0 - if(AODmaxEt==0) - { - if(!parameterStore.get("LegoPlot", "ScaleToAOD").isInitialized()) - parameterStore.get("LegoPlot", "ScaleToAOD").initialize(); - parameterStore.get("LegoPlot", "ScaleToAOD").getNameComponent().setEnabled(false); - } - else - { - if(!parameterStore.get("LegoPlot", "ScaleToAOD").isInitialized()) - parameterStore.get("LegoPlot", "ScaleToAOD").initialize(); - parameterStore.get("LegoPlot", "ScaleToAOD").getNameComponent().setEnabled(true); - } - if(AODmaxEt>0 && parameterStore.get("LegoPlot", "ScaleToAOD").getStatus()) - { - maxEt=AODmaxEt; - //user can no longer set the scale manually - if(!parameterStore.get("LegoPlot", "ETAxisHeight").isInitialized()) - parameterStore.get("LegoPlot", "ETAxisHeight").initialize(); - parameterStore.get("LegoPlot", "ETAxisHeight").getNameComponent().setEnabled(false); - parameterStore.get("LegoPlot", "ETAxisHeight").getValueComponent().setEnabled(false); - } - else - { - //user can now set the scale maually - if(!parameterStore.get("LegoPlot", "ETAxisHeight").isInitialized()) - parameterStore.get("LegoPlot", "ETAxisHeight").initialize(); - parameterStore.get("LegoPlot", "ETAxisHeight").getNameComponent().setEnabled(true); - parameterStore.get("LegoPlot", "ETAxisHeight").getValueComponent().setEnabled(true); - //check if user has defined a scale - if (parameterStore.get("LegoPlot", "ETAxisHeight").getD() > 0.0) - { - // use the user defined scale - maxEt = parameterStore.get("LegoPlot", "ETAxisHeight").getD(); - } - } - // Find the missing ET - double met = ALegoData.findMissingEt(window,lego,event); - // Begin drawing - AGraphics ag = AGraphics.makeAGraphics(g); - // Fill the background - ALegoDraw.fillBackground(window, ag); - // Draw the legend - boolean drawLegend=false; - if(!drawLegend && parameterStore.get("LegoPlot", "MainLegend").getStatus())drawLegend=true; - if(!drawLegend && parameterStore.get("LegoPlot", "L1EtLegend").getStatus())drawLegend=true; - if(!drawLegend && parameterStore.get("LegoPlot", "L1Items").getStatus())drawLegend=true; - if(!drawLegend && parameterStore.get("LegoPlot", "L2Items").getStatus())drawLegend=true; - if(!drawLegend && parameterStore.get("LegoPlot", "EFItems").getStatus())drawLegend=true; - if(drawLegend)ALegoDraw.drawLegend(window,ag,event,met,maxEt,AODmaxEt); - - // Scale the values for the axis type - maxEt=scaleMaxET(maxEt,AODmaxEt); - AODmaxEt=ALegoData.scaleValue(AODmaxEt); - met=ALegoData.scaleValue(met); - if(parameterStore.get("LegoPlot","DrawPlot").getStatus()) - { - // Draw the grid - //System.out.println("maxEt = "+maxEt+" and LEGOmaxEt = "+LEGOmaxEt); - ALegoDraw.drawGrid(window, ag, maxEt); - // Draw the histograms - ALegoData.drawHistograms(window, ag, event, lego, maxEt, met, AODmaxEt); - } - } // paintLego() - - /** - * MaxEt is rounded to get the axis height as well as being scaled - */ - private static double scaleMaxET(double maxEt, double AODmaxEt) - { - //for drawing if maxEt is 0 use AODmaxEt for scaling - if (maxEt == 0) - maxEt = AODmaxEt; - maxEt=ALegoData.scaleValue(maxEt); - //now round to get axis height - if (defaultScale ==1 ) - { - maxEt = Math.ceil(maxEt); - } - else if (maxEt > 10.0) - { - //set maximum to nearest 5 above maxEt - maxEt = 5 * (Math.ceil(maxEt / 5.0)); - } - else if (maxEt < 10.0) - { - maxEt = Math.ceil(maxEt); - } - return maxEt; - } - - /** Shifts the real value of phi to the screen coord to account for the slope of the eta axis. - * For reverse of operation use -adjustPhi(window,-phi,eta) - */ - public static double adjustPhi(AWindow window, double phi, double eta) - { - int index=window.getIndex(); - eta+=5;//scale to between 0 and 10 - eta/=10.0;//scale to between 0 and 1 - eta-=1;//scale to between -1 and 0 - eta*=(xz[index]*360.0);//fraction of full offset to take off - phi+=eta;//take off the fraction - return phi;//now adjusted from slant of eta axis - } - - public static double getxz(int index) - { - return xz[index]; - } - - public static double getyz(int index) - { - return yz[index]; - } - - public static void setxz(int index, double xznew) - { - xz[index]=xznew; - } - - public static void setyz(int index, double yznew) - { - yz[index]=yznew; - } - - /**check if colouring by EM/HAD - * - * @return boolean drawEMHAD - */ - public static boolean getDrawEMHAD() - { - boolean drawEMHAD=false; - if (mode == 0 && parameterStore.get("LAr", "ColorFunction").getI()==6) - { - //Calorimeter Lego - drawEMHAD=true; - } - else if (mode == 1 && parameterStore.get("LVL1TriggerTower", "ColorFunction").getI()==1) - { - //Trigger Tower Lego - drawEMHAD=true; - } - return drawEMHAD; - } - - public static void update() - { - defaultScale = parameterStore.get("LegoPlot", "Scale").getI(); - nPhiCells = parameterStore.get("LegoPlot", "nphicells").getI(); - nEtaCells = parameterStore.get("LegoPlot", "netacells").getI(); - defaultColorMap = AColorMap.getColors(); - caloColorMap = AColorMap.getColors(); - if (parameterStore.get("LAr", "ColorFunction").getI() == ACalorimeterData.COLOR_FUNC_ENERGY) - { - switch (AColorMap.getColorMap()) - { - case AColorMap.COLOR_MAP_DEFAULT1: - case AColorMap.COLOR_MAP_DEFAULT2: - case AColorMap.COLOR_MAP_M4M5: - case AColorMap.COLOR_MAP_GRAYDET: - case AColorMap.COLOR_MAP_ORIGINAL: - // Use colors. - caloColorMap = AColorMap.getColors(AColorMap.COLOR_MAP_HITCOL); - break; - case AColorMap.COLOR_MAP_GRAY: - case AColorMap.COLOR_MAP_BW: - // Use grayscale. - caloColorMap = AColorMap.getColors(AColorMap.COLOR_MAP_GRAY_HITCOL); - break; - } - } - else if (parameterStore.get("LAr", "ColorFunction").getI() == ACalorimeterData.COLOR_FUNC_TIME) - { - caloColorMap = AColorMap.getShades(nLayers+1); - } - reverse = parameterStore.get("LegoPlot", "Reverse").getStatus(); - mode = parameterStore.get("LegoPlot", "Mode").getI(); - //Use detector color but add on 12 to get different shade of same color - colorEM = parameterStore.get("Det", "ECAL" + "Fill").getI() + 12; - colorHad = parameterStore.get("Det", "HCAL" + "Fill").getI() + 12; - } -}//end of LegoProjection class diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionN3D.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionN3D.java deleted file mode 100644 index 1c57d9e8a71984baf2a58f9825f567636aeb2c0c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionN3D.java +++ /dev/null @@ -1,66 +0,0 @@ -package atlantis.projection; - -import atlantis.nge.ANFrameManager; -import java.awt.event.ActionEvent; -import javax.swing.JMenuItem; - -/** - * - * @author Adam Davison - */ -public class AProjectionN3D extends AProjectionNGE { - - @Override - public void configureFrame(ANFrameManager fm) { - fm.checkProjection3D(); - } - - @Override - public String getName() { - return "N3D"; - } - - @Override - public String getScreenName() { - return "N3D"; - } - - @Override - public JMenuItem[] getPopupItems() { - return null; - } - - @Override - public String getXLabel() { - return "X"; - } - - @Override - public String getYLabel() { - return "Y"; - } - - @Override - public String getXUnits() { - return "m"; - } - - @Override - public String getYUnits() { - return "m"; - } - - @Override - public void setScales() { - - } - - @Override - public boolean processLocalCommand(String name) { - return false; - } - - public void actionPerformed(ActionEvent e) { - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionNGE.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionNGE.java deleted file mode 100644 index 3f9294ff858f9de37b12c60c7d0d8baa4622224c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionNGE.java +++ /dev/null @@ -1,143 +0,0 @@ -package atlantis.projection; - -import atlantis.canvas.AWindow; -import atlantis.nge.ANFrameManager; -import atlantis.nge.ANManager; -import atlantis.utils.ALogger; -import com.sun.opengl.util.Screenshot; -import java.awt.Graphics; -import java.awt.image.BufferedImage; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLEventListener; - -/** - * This projection bridges between the traditional canvas and the new graphics - * engine code. Essentially it looks like an old style projection but when - * asked to paint it calls the new code and returns an image - * - * @author Adam Davison - */ -public abstract class AProjectionNGE extends AProjection implements GLEventListener { - - private static ALogger logger = ALogger.getLogger(AProjectionNGE.class); - - //private GLPbuffer m_buf = null; - private BufferedImage m_img = null; - private int m_h = 0; - private int m_w = 0; - - private AWindow m_currentWindow; - - public AProjectionNGE() { - - } - -/* @Override - public String getName() { - return "NGE"; - } - - @Override - public String getScreenName() { - return "NGE"; - }*/ - - public abstract void configureFrame(ANFrameManager fm); - - @Override - public void paint(AWindow window, Graphics g) { - - m_currentWindow = window; - - long before = System.nanoTime(); - - m_w = window.getWidth(); - m_h = window.getHeight(); - - //logger.info("Window w: " + m_w + " h: " + m_h); - - //System.out.println("TAG A"); - - configureFrame(ANManager.getManager().getFrameManager(window)); - - //System.out.println("TAG B"); - - ANManager.getManager().requestBufferDraw(m_w, m_h, this); - - //System.out.println("TAG C"); - - // TODO: Check m_img isn't null - //g.drawImage(m_img, 0, 0, m_w, m_h, null); - g.drawImage(m_img, 0, 0, m_w, m_h, 0, m_img.getHeight()-m_h, m_w, m_img.getHeight(), null); - - //System.out.println("TAG D copyback done"); - - long after = System.nanoTime(); - //System.out.println("Draw took: " + (after - before)/1000); - - //ANManager.getManager().requestReschedule(window); - } - -/* @Override - public JMenuItem[] getPopupItems() { - return null; - //throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public String getXLabel() { - return "XLABEL"; - } - - @Override - public String getYLabel() { - return "YLABEL"; - } - - @Override - public String getXUnits() { - return ""; - //throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public String getYUnits() { - return ""; - //throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setScales() { - //throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean processLocalCommand(String name) { - return false; - //throw new UnsupportedOperationException("Not supported yet."); - } - - public void actionPerformed(ActionEvent e) { - System.out.println(e.toString()); - //throw new UnsupportedOperationException("Not supported yet."); - }*/ - - public void init(GLAutoDrawable arg0) { - } - - public void display(GLAutoDrawable arg0) { - - //System.out.println("DISPLAY IN NGE"); - ANManager.getManager().getFrameManager(m_currentWindow).display(arg0, m_w, m_h); - //System.out.println("PAINT DONE"); - m_img = Screenshot.readToBufferedImage(ANManager.getNextPower2(m_w), - ANManager.getNextPower2(m_h)); - //System.out.println("COPIED BACK"); - } - - public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) { - } - - public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) { - } -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionNPhysics.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionNPhysics.java deleted file mode 100644 index e608bd9e51ccc58eec4ba163a1186c3da3770061..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionNPhysics.java +++ /dev/null @@ -1,95 +0,0 @@ -package atlantis.projection; - -import atlantis.nge.ANAnimVar; -import atlantis.nge.ANFrameManager; -import atlantis.nge.ANProjectionPhysics; -import atlantis.utils.AMath; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.JMenuItem; - -/** - * - * @author Adam Davison, Mark Stockton - */ -public class AProjectionNPhysics extends AProjectionNGE { - - private ANProjectionPhysics m_p = null; - private ANFrameManager m_fm = null; - - @Override - public void configureFrame(ANFrameManager fm) { - m_fm = fm; - m_p = fm.checkProjectionPhysics(); - } - - @Override - public String getName() { - return "NPhysics"; - } - - @Override - public String getScreenName() { - return "NPhysics"; - } - - @Override - public JMenuItem[] getPopupItems() { - - JMenuItem phi = new JMenuItem(AMath.ETA + " view"); - phi.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - phiView(); - } - }); - - JMenuItem[] i = { - phi - }; - return i; - } - - @Override - public String getXLabel() { - return "X"; - } - - @Override - public String getYLabel() { - return "Y"; - } - - @Override - public String getXUnits() { - return "m"; - } - - @Override - public String getYUnits() { - return "m"; - } - - @Override - public void setScales() { - - } - - @Override - public boolean processLocalCommand(String name) { - return false; - } - - public void actionPerformed(ActionEvent e) { - } - - public void phiView() { - - ANAnimVar pelev = m_p.getElevVar(); - ANAnimVar pphi = m_p.getPhiVar(); - - m_fm.getAnimationManager().scheduleAnimation(pelev, 0.0, 1.0, pelev.getValue(), -90.0); - m_fm.getAnimationManager().scheduleAnimation(pphi, 0.0, 1.0, pphi.getValue(), 0.0); - - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionNYX.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionNYX.java deleted file mode 100644 index fb95d8ff95aa901b663419404bf792b69528b259..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionNYX.java +++ /dev/null @@ -1,71 +0,0 @@ -package atlantis.projection; - -import atlantis.nge.ANFrameManager; -import java.awt.event.ActionEvent; -import javax.swing.JMenuItem; - -/** - * - * @author Adam Davison - */ -public class AProjectionNYX extends AProjectionNGE { - - public AProjectionNYX() { - - } - - @Override - public void configureFrame(ANFrameManager fm) { - fm.checkProjectionYX(); - } - - @Override - public String getName() { - return "NYX"; - } - - @Override - public String getScreenName() { - return "NYX"; - } - - @Override - public JMenuItem[] getPopupItems() { - return null; - } - - @Override - public String getXLabel() { - return "X"; - } - - @Override - public String getYLabel() { - return "Y"; - } - - @Override - public String getXUnits() { - return "m"; - } - - @Override - public String getYUnits() { - return "m"; - } - - @Override - public void setScales() { - - } - - @Override - public boolean processLocalCommand(String name) { - return false; - } - - public void actionPerformed(ActionEvent e) { - // - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionPhi.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionPhi.java deleted file mode 100755 index 92785454bb58927b6ce24f2b3d0df532321d1f70..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionPhi.java +++ /dev/null @@ -1,73 +0,0 @@ -package atlantis.projection; - -import atlantis.parameters.AParameter; -import atlantis.parameters.APar; -import atlantis.utils.AMath; -import atlantis.utils.AVector; -import java.awt.geom.*; - -/** - * Base class of all phi projections - */ - -public abstract class AProjectionPhi extends AProjection2D { - - public String getScreenName() - { - return AMath.PHI+ getXLabel(); - } - - public String getYLabel() { - return AMath.PHI; - } - - public String getYUnits() { - return AMath.DEGREES; - } - - public double getMinRho() { - return 2.; - } - - public Point2D.Double getCenter() { - int phiWrap=parameterStore.get(getName(), "PhiWrap").getI(); - - return new Point2D.Double(0, (360+phiWrap)/2); - } - - public Point2D.Double[] validateCorners(Point2D.Double[] corners) { - if(super.validateCorners(corners)==null) - return null; - int phiWrap=parameterStore.get(getName(), "PhiWrap").getI(); - AParameter initialFramePar=parameterStore.get(getName(), "InitialFrame"); - - if(Math.abs(getMaxPhi(corners)-getMinPhi(corners))>(360+phiWrap)) - return null; - if(getMaxPhi(corners)>(initialFramePar.getI()*360+2*360-90)) - initialFramePar.setI(initialFramePar.getI()+1); - if(getMinPhi(corners)<(initialFramePar.getI()*360+90)) - initialFramePar.setI(initialFramePar.getI()-1); - return corners; - } - - private static double getMinPhi(Point2D.Double[] corners) { - double phiMin=corners[0].y; - - for(int i=0; i<corners.length; i++) - if(corners[i].y<phiMin) phiMin=corners[i].y; - AVector v12=new AVector(corners[1], corners[2]); - - return Math.min(phiMin, corners[0].y+v12.dy); - } - - private static double getMaxPhi(Point2D.Double[] corners) { - double phiMax=corners[0].y; - - for(int i=0; i<corners.length; i++) - if(corners[i].y>phiMax) phiMax=corners[i].y; - AVector v12=new AVector(corners[1], corners[2]); - - return Math.max(phiMax, corners[0].y+v12.dy); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionRZ.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionRZ.java deleted file mode 100755 index a47d1e0f05ff71d4fbb0e53e5318f761a5aebd15..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionRZ.java +++ /dev/null @@ -1,68 +0,0 @@ -package atlantis.projection; - -import atlantis.data.ADHelix; -import atlantis.graphics.ACoord; -import atlantis.utils.AMath; -import java.awt.*; -import java.awt.geom.*; -import atlantis.event.*; -import atlantis.parameters.*; - -public class AProjectionRZ extends AProjection2D { - - public AProjectionRZ() { - addPopupItem(ASPECT_RATIO_1); - } - - public String getName() { - return "RZ"; - } - - public String getScreenName() - { - return AMath.RHO + "Z"; - } - - public String getXLabel() { - return "Z"; - } - - public String getYLabel() { - return AMath.RHO; - } - - public String getXUnits() { - return "(cm)"; - } - - public String getYUnits() { - return "(cm)"; - } - - public Point2D.Double getCenter() { - return new Point2D.Double(0, 0); - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) { - double radius=parameterStore.get("Projection", "Radius").getD(); - double length=parameterStore.get("Projection", "Length").getD(); - return aspectRatioLayout(length, radius, wSize); - } - - public ACoord getUserPoint(ADHelix dH, double s) { - return nonLinearTransform(dH.getRZPoint(s)); - } - - public ACoord nonLinearTransform(ACoord user) { - return nonLinearTransform2D(user, getName()); - } - - public ACoord inverseNonLinearTransform(ACoord user) { - return inverseNonLinearTransform2D(user, getName()); - } - - public static int[] getAxisMapping() { - return new int[] {2, 1, 0}; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionTrackResidual.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionTrackResidual.java deleted file mode 100644 index fc07eddcbea4fee7b2f80c47b2d369fe65660f7b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionTrackResidual.java +++ /dev/null @@ -1,167 +0,0 @@ -package atlantis.projection; - -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.geom.Point2D; - -import atlantis.canvas.AWindow; -import atlantis.data.ADHelix; -import atlantis.data.ATrackResidualData; -import atlantis.graphics.ACoord; -import atlantis.graphics.AGraphics; -import atlantis.parameters.APar; -import atlantis.utils.AMath; - -public class AProjectionTrackResidual extends AProjection2D -{ - private ATrackResidualData residual; - private String residualType; - private double xLength; - private double yLength = 1.0; - - /** - * @param residual The residual to set. - */ - public void setResidual(ATrackResidualData residual) - { - this.residual = residual; - } - - public ATrackResidualData getResidual() - { - return residual; - } - - public void setResidualType(String type) - { - residualType = type; - } - - public String getResidualType() - { - return residualType; - } - - public String getName() - { - return "TrackResidual"; - } - - public String getXLabel() - { - return "Index"; - } - - public String getYLabel() - { - return "Res"; - } - - public String getXUnits() - { - return ""; - } - - public String getYUnits() - { - return "(mm)"; - } - - public double getXLength() - { - return xLength; - } - - public double getYLength() - { - return yLength; - } - - public Point2D.Double getCenter() - { - return new Point2D.Double(0.0, 0.0); - } - - // not useful for this projection, only put here to be compatible with - // other code - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) - { - Point2D.Double[] corners=new Point2D.Double[3]; - - corners[0]=new Point2D.Double(0., 2.); - corners[1]=new Point2D.Double(100., 2.); - corners[2]=new Point2D.Double(100., -2.); - return corners; - } - - public Point2D.Double[] calculateNoZoomCorners() - { - float[] dataArray; - if(residualType.equals(ATrackResidualData.RESIDUAL_X)) - dataArray = residual.getResLoc1(); - else - dataArray = residual.getPullLoc1(); - - xLength = dataArray.length; - if(parameterStore.get(getName(), "Scale").getI() == 0) // linear - { - yLength = (AMath.maxAbsInArray(dataArray) + 0.1) * 2; - } - else // logarithmic - { - float[] dataArrayCopy = new float[dataArray.length]; - for(int i=0; i<dataArrayCopy.length; ++i) - { - if(dataArray[i] == -99.0f) - dataArrayCopy[i] = 0.0f; - else - dataArrayCopy[i] = dataArray[i]; - } - double minValue = (double) AMath.minAbsInArray(dataArrayCopy); - double maxValue = (double) AMath.maxAbsInArray(dataArrayCopy); - double magnitude; - - // all data is either invalid or 0 - if(maxValue == 0.0 && minValue == 0.0) - { - magnitude = 1; - residual.setLogMagnitudeMin(-1.0); - } - else if (minValue == 0.0) - { - double minNonZeroValue = (double) AMath.minNonZeroAbsInArray(dataArrayCopy); - magnitude = Math.floor(Math.log10(maxValue)) - - Math.floor(Math.log10(minNonZeroValue))+ 1.0; - residual.setLogMagnitudeMin(Math.floor(Math.log10(minNonZeroValue))); - } - else - { - magnitude = Math.floor(Math.log10(maxValue)) - - Math.floor(Math.log10(minValue))+ 1.0; - residual.setLogMagnitudeMin(Math.floor(Math.log10(minValue))); - } - yLength = magnitude * 2; - } - Point2D.Double[] corners = new Point2D.Double[3]; - - corners[0] = new Point2D.Double(0., yLength/2); - corners[1] = new Point2D.Double(xLength, yLength/2); - corners[2] = new Point2D.Double(xLength, -yLength/2); - return corners; - } - - public ACoord getUserPoint(ADHelix dH, double s) - { - return ACoord.NO_DATA; - } - - public void paint(AWindow window, Graphics g) - { - AGraphics ag = AGraphics.makeAGraphics(g); - - fillBackground(window, ag); - if(residual != null) - residual.draw(window, ag, this); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionVP.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionVP.java deleted file mode 100755 index 210d848d44727230b148dfeda300d0834a01a2fc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionVP.java +++ /dev/null @@ -1,169 +0,0 @@ -package atlantis.projection; - -import atlantis.graphics.ACoord; -import atlantis.graphics.colormap.AColorMap; -import atlantis.output.ALogInterface; -import atlantis.output.AOutput; -import atlantis.parameters.AParameter; -import atlantis.parameters.APar; -import atlantis.utils.AMath; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.geom.Point2D; - -import atlantis.canvas.AWindow; -import atlantis.data.ADHelix; - -public class AProjectionVP extends AProjectionPhi { - - // this should be moved ugly - // sign is which arm of the v is being drawn at this point in time - public static int sign; - - private static double qcp=0.00035936; - - // Display modes as defined in the configuration file. - public static final int MODE_STANDARD = 0; - public static final int MODE_SPACEPOINT = 1; - public static final int MODE_TRT_DRIFT_CIRCLE = 2; - public static final int MODE_ECAL_LAYER_0 = 3; - public static final int MODE_ECAL_LAYER_1 = 4; - public static final int MODE_ECAL_LAYER_2 = 5; - public static final int MODE_ECAL_LAYER_3 = 6; - public static final int MODE_HCAL_LAYER_0 = 7; - public static final int MODE_HCAL_LAYER_1 = 8; - public static final int MODE_HCAL_LAYER_2 = 9; - public static final int MODE_HCAL_LAYER_3 = 10; - - public static final double MAX_ETA = 5.; - - private static boolean first=true; - // draw V apex at this rho or Z - private static double[] rhoMode=new double[] - { 55., 55., 108., 138., 154., 173., 193., 244., 306., 368., 368.}; - private static double[] zMode=new double[] - {277., 277., 338., 360., 374., 394., 414., 441., 482., 561., 561.}; - // zoom in another projection to this rho and Z - private static double[] rhoZoomMode=new double[] - { 56., 56., 110., 200., 200., 200., 200., 400., 400., 400., 400.}; - private static double[] zZoomMode=new double[] - {280., 280., 340., 440., 440., 440., 440., 374., 374., 374., 374.}; - - private static AParameter modePar; - private static AParameter rMaxPar; - private static AParameter zMaxPar; - private static AParameter gradientPar; - private static AParameter zVtxPar; - - public AProjectionVP() {} - - public String getName() { - return "VP"; - } - - public String getXLabel() { - return AMath.ETA; - } - - public String getXUnits() { - return ""; - } - - public void setAspectRatio1(AWindow window) - { - AOutput.append("\nNot implemented for this projection\n", ALogInterface.WARNING); - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) { - Point2D.Double[] corners=new Point2D.Double[3]; - - corners[0]=new Point2D.Double(-5.0, 360); - corners[1]=new Point2D.Double(5.0, 360); - corners[2]=new Point2D.Double(5.0, 0); - return corners; - } - - protected Color getBackgroundFillColor(Color[] colorMap) { - int mode=parameterStore.get("VP", "Mode").getI(); - - switch(mode) { - case MODE_SPACEPOINT: - return colorMap[parameterStore.get("Det", "SIL"+"Fill").getI()]; - case MODE_TRT_DRIFT_CIRCLE: - return colorMap[parameterStore.get("Det", "TRT"+"Fill").getI()]; - case MODE_ECAL_LAYER_0: - case MODE_ECAL_LAYER_1: - case MODE_ECAL_LAYER_2: - case MODE_ECAL_LAYER_3: - return colorMap[parameterStore.get("Det", "ECAL"+"Fill").getI()]; - case MODE_HCAL_LAYER_0: - case MODE_HCAL_LAYER_1: - case MODE_HCAL_LAYER_2: - case MODE_HCAL_LAYER_3: - return colorMap[parameterStore.get("Det", "HCAL"+"Fill").getI()]; - default: - return colorMap[parameterStore.get("Color", "Bkg"+"Fill").getI()]; - } - } - - public ACoord getUserPoint(ADHelix dH, double s) { - return dH.getVPPoint(s, this.sign); - } - - public static double getDeltaEta(double rho, double z) { - if(first) { - modePar=parameterStore.get("VP", "Mode"); - rMaxPar=parameterStore.get("VP", "RMax"); - zMaxPar=parameterStore.get("VP", "ZMax"); - gradientPar=parameterStore.get("VP", "Gradient"); - zVtxPar=parameterStore.get("VP", "ZVtx"); - first=false; - } - double fact=qcp*gradientPar.getD(); - int mode=modePar.getI(); - double zLayer=zMode[mode]; - - if(zMaxPar.getStatus()) - zLayer=Math.min(zLayer, zMaxPar.getD()); - double rhoLayer=rhoMode[mode]; - - if(rMaxPar.getStatus()) - rhoLayer=Math.min(rhoLayer, rMaxPar.getD()); - double zVtx=zVtxPar.getD(); - double zsign=1.; - - if(z<0.) zsign=-1.; - if(Math.abs((z-zVtx)/rho)<(zLayer-zVtx)/rhoLayer) - return fact*(rhoLayer-rho); - else - return fact*rho*(zsign*zLayer-z)/(z-zVtx); - } - - public static double getRhoVPlot() { - double rhoLayer=rhoMode[parameterStore.get("VP", "Mode").getI()]; - AParameter rMaxPar=parameterStore.get("VP", "RMax"); - - if(rMaxPar.getStatus()) - rhoLayer=Math.min(rhoLayer, rMaxPar.getD()); - return rhoLayer; - } - - public static double getZVPlot() { - double zLayer=zMode[parameterStore.get("VP", "Mode").getI()]; - AParameter zMaxPar=parameterStore.get("VP", "ZMax"); - - if(zMaxPar.getStatus()) - zLayer=Math.min(zLayer, zMaxPar.getD()); - return zLayer; - } - - public static double getRhoZoomVPlot() { - return rhoZoomMode[parameterStore.get("VP", "Mode").getI()]; - } - - public static double getZZoomVPlot() { - return zZoomMode[parameterStore.get("VP", "Mode").getI()]; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionXZ.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionXZ.java deleted file mode 100755 index 24f2d9b17cc2debb9fa04f8d2d5c6ddbcc08ef06..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionXZ.java +++ /dev/null @@ -1,81 +0,0 @@ -package atlantis.projection; - -import atlantis.data.ADHelix; -import atlantis.graphics.ACoord; -import atlantis.parameters.APar; -import atlantis.utils.AMath; -import atlantis.event.*; -import java.awt.*; -import java.awt.geom.*; - -public class AProjectionXZ extends AProjection2D { - - public AProjectionXZ() { - addPopupItem(ASPECT_RATIO_1); - } - - public String getName() { - return "XZ"; - } - - public String getXLabel() { - return "Z"; - } - - public String getYLabel() { - return "X"+AMath.PRIME; - } - - public String getXUnits() { - return "(cm)"; - } - - public String getYUnits() { - return "(cm)"; - } - - public Point2D.Double getCenter() { - return new Point2D.Double(0, 0); - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) { - double radius=parameterStore.get("Projection", "TrackingRadius").getD(); - double length=parameterStore.get("Projection", "TrackingLength").getD(); - return aspectRatioLayout(length, radius, wSize); - } - - public static double getPhi() { - return parameterStore.get("XZ", "Phi").getD(); - } - - public static double[][] getRotationMatrix() { - double phi=Math.toRadians(getPhi()); - double cos=Math.cos(phi); - double sin=Math.sin(phi); - double[][] r=new double[3][3]; - - r[0][0]=cos; - r[1][1]=cos; - r[2][2]=1.; - r[0][1]=sin; - r[1][0]=-sin; - return r; - } - - public static int[] getAxisMapping() { - return new int[] {2, 0, 1}; - } - - public ACoord getUserPoint(ADHelix dH, double s) { - return nonLinearTransform(dH.getXZPoint(s)); - } - - public ACoord nonLinearTransform(ACoord user) { - return nonLinearTransform2D(user, getName()); - } - - public ACoord inverseNonLinearTransform(ACoord user) { - return inverseNonLinearTransform2D(user, getName()); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionYX.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionYX.java deleted file mode 100755 index ef2a7d28db6e7d1cc70648324d25335b63c7281b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionYX.java +++ /dev/null @@ -1,307 +0,0 @@ -package atlantis.projection; - -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.geom.Point2D; - -import javax.swing.ImageIcon; - -import atlantis.canvas.AWindow; -import atlantis.data.ADHelix; -import atlantis.globals.AGlobals; -import atlantis.graphics.ACoord; -import atlantis.graphics.ADrawParameters; -import atlantis.graphics.AGraphics; -import atlantis.graphics.colormap.AColorMap; -import atlantis.interactions.AZMRInteraction; -import atlantis.parameters.AParameter; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; - -public class AProjectionYX extends AProjection2D -{ - private static ALogger logger = ALogger.getLogger(AProjectionYX.class); - - // Different display modes, as defined in the configuration file. - public static final int MODE_STANDARD = 0; - public static final int MODE_TGC_INNER = 1; - public static final int MODE_TGC_MIDDLE_1 = 2; - public static final int MODE_TGC_MIDDLE_2 = 3; - public static final int MODE_TGC_MIDDLE_3 = 4; - public static final int MODE_MDT_INNER = 5; - public static final int MODE_MDT_EXTENSION = 6; - public static final int MODE_MDT_MIDDLE = 7; - public static final int MODE_MDT_OUTER = 8; - public static final int MODE_FCAL_EM = 9; - public static final int MODE_FCAL_HAD_1 = 10; - public static final int MODE_FCAL_HAD_2 = 11; - public static final int MODE_LAR_ENDCAP_PRESAMPLER = 12; - public static final int MODE_LAR_ENDCAP_1 = 13; - public static final int MODE_LAR_ENDCAP_2 = 14; - public static final int MODE_LAR_ENDCAP_3 = 15; - public static final int MODE_HEC_1 = 16; - public static final int MODE_HEC_2 = 17; - public static final int MODE_HEC_3 = 18; - public static final int MODE_HEC_4 = 19; - public static final int MODE_LAR_ENDCAP_SUMMED = 20; - public static final int MODE_HEC_SUMMED = 21; - public static final int MODE_MBTS = 22; - - public AProjectionYX() - { - addPopupItem(ASPECT_RATIO_1); - } - - public String getName() - { - return "YX"; - } - - public String getXLabel() - { - return "X"; - } - - public String getYLabel() - { - return "Y"; - } - - public String getXUnits() - { - return "(cm)"; - } - - public String getYUnits() - { - return "(cm)"; - } - - public Point2D.Double getCenter() - { - return new Point2D.Double(0, 0); - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) - { - // should not be here - parameterStore.get(getName(), "Phi").setD(0.); - double radius = parameterStore.get("Projection", "Radius").getD(); - return aspectRatioLayout(radius, radius, wSize); - } - - public static double[][] getRotationMatrix() - { - double[][] r = new double[3][3]; - - r[0][0] = 1.; - r[1][1] = 1.; - r[2][2] = 1.; - return r; - } - - public static int[] getAxisMapping() - { - return new int[] { 0, 1, 2 }; - } - - public ACoord getUserPoint(ADHelix dH, double s) - { - return nonLinearTransform(dH.getYXPoint(s)); - } - - public ACoord nonLinearTransform(ACoord user) - { - AParameter fishEyePar = parameterStore.get(getName(), "FishEye"); - - if (fishEyePar.getStatus()) - { - double[] x, y; - double r, fact; - double fishEye = 0.001 * fishEyePar.getD(); - double rTo = parameterStore.get(getName(), "rTo").getD(); - - for (int j = 0; j < user.hv[0].length; ++j) - { - x = user.hv[0][j]; - y = user.hv[1][j]; - for (int i = 0; i < x.length; ++i) - { - r = Math.sqrt(x[i] * x[i] + y[i] * y[i]); - fact = (1 + fishEye * rTo) / (1 + fishEye * r); - x[i] *= fact; - y[i] *= fact; - } - } - } - AParameter clockPar = parameterStore.get(getName(), "Clock"); - - if (clockPar.getStatus()) - { - double clock = Math.PI / clockPar.getD(); - double phiClock = Math.toRadians(parameterStore.get(getName(), "Phi").getD()); - - for (int j = 0; j < user.hv[0].length; ++j) - { - double[] x = user.hv[0][j]; - double[] y = user.hv[1][j]; - - for (int i = 0; i < x.length; ++i) - { - double phi = Math.atan2(y[i], x[i]); - - if (phi < 0.) - phi += 2 * Math.PI; - double rho = Math.sqrt(x[i] * x[i] + y[i] * y[i]); - double dPhi = phi - phiClock; - - if (dPhi > Math.PI) - dPhi -= 2 * Math.PI; - else if (dPhi <= -Math.PI) - dPhi += 2 * Math.PI; - double fact = (clock + Math.PI) / (clock + Math.abs(dPhi)); - - phi = phiClock + fact * dPhi; - x[i] = rho * Math.cos(phi); - y[i] = rho * Math.sin(phi); - } - } - } - - return user; - } - - public ACoord inverseNonLinearTransform(ACoord user) - { - AParameter fishEyePar = parameterStore.get(getName(), "FishEye"); - - if (fishEyePar.getStatus()) - { - double[] x, y; - double r, fact; - double fishEye = 0.001 * fishEyePar.getD(); - double rTo = parameterStore.get(getName(), "rTo").getD(); - - for (int j = 0; j < user.hv[0].length; ++j) - { - x = user.hv[0][j]; - y = user.hv[1][j]; - for (int i = 0; i < x.length; ++i) - { - r = Math.sqrt(x[i] * x[i] + y[i] * y[i]); - fact = 1 / (1 + fishEye * (rTo - r)); - x[i] *= fact; - y[i] *= fact; - } - } - } - AParameter clockPar = parameterStore.get(getName(), "Clock"); - - if (clockPar.getStatus()) - { - double clock = Math.PI / clockPar.getD(); - double phiClock = Math.toRadians(parameterStore.get(getName(), "Phi").getD()); - - for (int j = 0; j < user.hv[0].length; ++j) - { - double[] x = user.hv[0][j]; - double[] y = user.hv[1][j]; - - for (int i = 0; i < x.length; ++i) - { - double phi = Math.atan2(y[i], x[i]); - - if (phi < 0.) - phi += 2 * Math.PI; - double dPhi = phi - phiClock; - - if (dPhi > Math.PI) - dPhi -= 2 * Math.PI; - else if (dPhi <= -Math.PI) - dPhi += 2 * Math.PI; - - double dPhiPrime = (clock * dPhi) / (clock + Math.PI - Math.abs(dPhi)); - - phi = phiClock + dPhiPrime; - - double rho = Math.sqrt(x[i] * x[i] + y[i] * y[i]); - - x[i] = rho * Math.cos(phi); - y[i] = rho * Math.sin(phi); - } - } - } - return user; - } - - public void paint(AWindow window, Graphics g) - { - super.paint(window, g); - - // draw RZ cutting plane - if (parameterStore.get("YX", "RZCuttingPlane").getStatus()) - { - AGraphics ag = AGraphics.makeAGraphics(g); - final ADrawParameters drawParameters = - new ADrawParameters(true, AColorMap.WH, 4, 1, 0, AGraphics.SYMBOL_FILLED_BOX); - ag.updateDrawParameters(drawParameters); - final double RHO_MAX = 3000.0; - - double phi = Math.toRadians(parameterStore.get("RZ", "Phi").getD()) - Math.PI / 2; - double cosPhi = Math.cos(phi); - double sinPhi = Math.sin(phi); - String iconPath = AGlobals.instance().getHomeDirectory() + "img" + System.getProperty("file.separator"); - - // draw the cutting plane - Point2D.Double p1 = window.calculateDisplay(nonLinearTransform(RHO_MAX * cosPhi, RHO_MAX * sinPhi)); - Point2D.Double p2 = window.calculateDisplay(nonLinearTransform(-RHO_MAX * cosPhi, -RHO_MAX * sinPhi)); - - ag.drawLine(p1.x, p1.y, p2.x, p2.y); - - // draw the arrows - Point2D.Double p3 = window.calculateDisplay(nonLinearTransform(1500 * Math.cos(phi+.07), 1500 * Math.sin(phi+.07))); - Point2D.Double p4 = window.calculateDisplay(nonLinearTransform(1500 * Math.cos(phi+3.21), 1500 * Math.sin(phi+3.21))); - - ImageIcon upArrow = AUtilities.getFileAsImageIcon(iconPath+"uparrow.png"); - ImageIcon downArrow = AUtilities.getFileAsImageIcon(iconPath+"downarrow.png"); - - Graphics2D g2d = (Graphics2D) g; - - g2d.drawImage(upArrow.getImage(),(int) p3.x,(int) p3.y,null); - g2d.drawImage(downArrow.getImage(),(int) p4.x,(int) p4.y,null); - - } - } - - /** This function ensures that when the aspect ratio of the display changes - * the aspect ratio of the contents of a YX projection remain at the same - * aspect ratio. - * - * It uses the (thankfully) static methods of AZMRInteraction to do the - * actual zooming, which can involve some non-trivial mathematics... - * -- Adam Davison - */ - @Override - public void aspectRatioChange(AWindow w, double oldaspect, double newaspect) { - logger.debug("ProjectionYX informed of aspect ratio change from " + oldaspect + " to " + newaspect); - - Point2D.Double[] corners = w.getUserCorners(); - - // Get center - Point2D.Double center = new Point2D.Double( - 0.5*(corners[0].x+corners[2].x), - 0.5*(corners[0].y+corners[2].y)); - - // If > 1, the new view is taller if < 1 it's wider - double fracchange = newaspect/oldaspect; - - if (fracchange > 1) { - // Need to vzoom "away" to restore aspect ratio - AZMRInteraction.performVerticalZoom(center, fracchange, w); - } else { - // Need to hzoom - AZMRInteraction.performHorizontalZoom(center, 1.0/fracchange, w); - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionYZ.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionYZ.java deleted file mode 100755 index 490afb72dfd8deab89a3338803696e4f1cbe267a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionYZ.java +++ /dev/null @@ -1,72 +0,0 @@ -package atlantis.projection; - - -import atlantis.graphics.ACoord; -import atlantis.utils.AMath; -import java.awt.*; -import java.awt.geom.*; -import atlantis.data.ADHelix; -import atlantis.parameters.*; - - -public class AProjectionYZ extends AProjection2D { - - public AProjectionYZ() { - addPopupItem(ASPECT_RATIO_1); - } - - public String getName() { - return "YZ"; - } - - public String getXLabel() { - return "Z"; - } - - public String getYLabel() { - return "Y"+AMath.PRIME; - } - - public String getXUnits() { - return "(cm)"; - } - - public String getYUnits() { - return "(cm)"; - } - - public Point2D.Double getCenter() { - return new Point2D.Double(0, 0); - } - - public Point2D.Double[] calculateNoZoomCorners(Dimension wSize) { - double radius=parameterStore.get("Projection", "TrackingRadius").getD(); - double length=parameterStore.get("Projection", "TrackingLength").getD(); - return aspectRatioLayout(length, radius, wSize); - } - - public static double getPhi() { - return AProjectionXZ.getPhi(); - } - - public static double[][] getRotationMatrix() { - return AProjectionXZ.getRotationMatrix(); - } - - public static int[] getAxisMapping() { - return new int[] {2, 1, 0}; - } - - public ACoord getUserPoint(ADHelix dH, double s) { - return nonLinearTransform(dH.getYZPoint(s)); - } - - public ACoord nonLinearTransform(ACoord user) { - return nonLinearTransform2D(user, getName()); - } - - public ACoord inverseNonLinearTransform(ACoord user) { - return inverseNonLinearTransform2D(user, getName()); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/AProjectionsManager.java b/graphics/AtlantisJava/src/atlantis/projection/AProjectionsManager.java deleted file mode 100755 index e9886ac1fefbbb9421de00bf744949edbe926ac3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/AProjectionsManager.java +++ /dev/null @@ -1,110 +0,0 @@ -package atlantis.projection; - -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Set; -import java.util.Vector; - -import atlantis.output.AExceptionHandler; -import atlantis.parameters.APar; -import atlantis.parameters.AParametersGroup; - -/** - * This manager keeps references to all projections. - * - * The code keeping track of the list and states of interactions associated with each - * projection in each window, and creating the corresponding pop-up menus, has been - * moved to atlantis.gui.AInteractionToolBar and atlantis.interactions.AInteractionsByProjection. - */ -public class AProjectionsManager { - - // the set of projections (name : AProjection) - private static Hashtable<String,AProjection> projections = new Hashtable<String, AProjection>(); - private static Set<String> projectionsAvailableInDemoMode = new HashSet<String>(); - private static Set<String> defaultProjectionsInDemoMode = new HashSet<String>(); - - /** - * Creates projections using information from APar. - */ - public static void initialise() { - Vector<String> projVector=APar.instance().getUIGroupNames(AParametersGroup.PROJECTION); - - for (String projName : projVector) { - createProjection(projName); - } - } - - /** - * Used to request the projection with the given name - * @param projectionName The name of the projection - * @return The AProjection corespoinding to the projection name. - */ - public static AProjection getProjection(String projectionName) { - return projections.get(projectionName); - } - - /** - * Checks whether the given name is a valid projection name. - * @param name The name to be checked - * @return True/False - */ - public static boolean isValidProjection(String name) { - return projections.containsKey(name); - } - - /** - * Returns an array containing the names of all known projections - * @return The name array - */ - public static String[] getKnownProjectionNames() { - String[] names=new String[projections.size()]; - - Enumeration<String> myenum=projections.keys(); - - for(int i=0; i<projections.size(); i++) - names[i]=myenum.nextElement(); - - return names; - } - - /** - * Check whether the projection should be used in the demo dialog - * @return false if the projection should not be used or does not exist - */ - public static boolean useProjectionInDemoMode(String name){ - return projectionsAvailableInDemoMode.contains(name); - } - - /** - * @return true if the projection should be selected by default in the demo dialog - */ - public static boolean defaultProjectionInDemoMode(String name){ - return defaultProjectionsInDemoMode.contains(name); - } - - /** - * Creates an instance of a given projection and pushes it into the - * <code>projections</code> Hashtable. The name shold be for example: YX if you - * want to create a instance of AProjectionYX.java class. - * @param name The name of the projection. - */ - private static void createProjection(String name) { - try { - - AProjection p=(AProjection)Class.forName("atlantis.projection.AProjection"+name).newInstance(); - - projections.put(name, p); - } catch(Exception e) { - AExceptionHandler.processException("Cannot create AProjection"+name, e); - } - } - - public static void makeProjectionAvailableInDemoMode(String projection) { - projectionsAvailableInDemoMode.add(projection); - } - - public static void makeProjectionDefaultInDemoMode(String name) { - defaultProjectionsInDemoMode.add(name); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/projection/package.html b/graphics/AtlantisJava/src/atlantis/projection/package.html deleted file mode 100644 index 471774c48caadc517d522ec098161f1887cc588e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/projection/package.html +++ /dev/null @@ -1,9 +0,0 @@ -<html> -<head></head> -<body> -<p>Implementation of projections (XY, Rho Z, V plot, etc). Class - AProjectionManager changes the current projection and informs the - AEvent class instance of how to draw itself, e.g. in the XY - projection.</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/utils/A3Vector.java b/graphics/AtlantisJava/src/atlantis/utils/A3Vector.java deleted file mode 100755 index 649a18dd317fff92dba69393622c0f315dd47b35..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/A3Vector.java +++ /dev/null @@ -1,98 +0,0 @@ -package atlantis.utils; - - -/** - * Provides basic 3D vector operations. - */ - -public class A3Vector { - - public double x, y, z; - - /** - * Construct zero 3-vector. - */ - public A3Vector() {} - - /** - * Construct 3-vector from Cartesian coordinates. - * @param dx - * @param dy - * @param dz - */ - public A3Vector(double x, double y, double z) { - this.x=x; - this.y=y; - this.z=z; - } - - /** - * Create 3-vector from eta, phi and magnitude. - * @param eta pseudorapidity along z direction - * @param phi azimuthal angle [radians] - * @param r magnitude of vector - * @return new A3Vector - */ - public static A3Vector fromEtaPhiR(double eta, double phi, double r) { - double theta = 2.0 * Math.atan(Math.exp(-eta)); - return new A3Vector(r * Math.sin(theta) * Math.cos(phi), - r * Math.sin(theta) * Math.sin(phi), - r * Math.cos(theta)); - } - - /** - * Create 3-vector from cylindrical coordinates rho, phi, z. - * @param rho component perpendicular to z axis - * @param phi azimuthal angle [radians] - * @param z - * @return - */ - public static A3Vector fromRhoPhiZ(double rho, double phi, double z) { - double x=rho*Math.cos(phi); - double y=rho*Math.sin(phi); - return new A3Vector(x,y,z); - } - - public A3Vector getNormalized() { - double r=Math.sqrt(x*x+y*y+z*z); - return new A3Vector(x/r, y/r, z/r); - } - - public A3Vector normalize() { - double r=magnitude(); - x/=r; - y/=r; - z/=r; - return this; - } - - public double magnitude() { - return Math.sqrt(x*x+y*y+z*z); - } - - public A3Vector scale(double a) { - x*=a; - y*=a; - z*=a; - return this; - } - - public A3Vector add(A3Vector v) { - x+=v.x; - y+=v.y; - z+=v.z; - return this; - } - - public A3Vector subtract(A3Vector v) { - x-=v.x; - y-=v.y; - z-=v.z; - return this; - } - - public String toString() { - return "A3Vector[x="+x+", y="+y+", z="+z+"]"; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/A4Vector.java b/graphics/AtlantisJava/src/atlantis/utils/A4Vector.java deleted file mode 100755 index 5032250f170cb8c4515767a1ecf1e938d77fe287..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/A4Vector.java +++ /dev/null @@ -1,127 +0,0 @@ -package atlantis.utils; - -/** - * Provides basic 4D vector operations. - */ -public class A4Vector -{ - public double px, py, pz, e; - - public A4Vector() - {} - - public A4Vector(double dx, double dy, double dz, double m) - { - set(dx, dy, dz, m); - } - - public A4Vector(A3Vector v, double m) - { - set(v.x, v.y, v.z, m); - } - - public void set(double dx, double dy, double dz, double m) - { - px = dx; - py = dy; - pz = dz; - e = Math.sqrt(px * px + py * py + pz * pz + m * m); - } - - public void setPtEtaPhiM(double pT, double eta, double phi, double mass) - { - double ptAbs = Math.abs(pT); - px = ptAbs*Math.cos(phi); - py = ptAbs*Math.sin(phi); - pz = ptAbs*Math.sinh(eta); - e = Math.sqrt(px * px + py * py + pz * pz + mass * mass); - } - - public double getP() - { - return Math.sqrt(px * px + py * py + pz * pz); - } - - public double getPt() - { - return Math.sqrt(px * px + py * py); - } - - public double getE() - { - return e; - } - - /** - * getEt() returns the transverse energy. - * The formula used to calculate it is: - * Et^2 = E^2 * Pt^2 / P^2. - */ - public double getEt() - { - double pt2 = px * px + py * py; - double p2 = pt2 + pz * pz; - return Math.sqrt(e * e * pt2/p2); - } - - public double getMass() - { - return Math.sqrt(e * e - px * px - py * py - pz * pz); - } - - /** - * getMt() returns the transverse mass. - * The formula used to calculate it is: - * Mt^2 = Et^2 - Pt^2. - * - * This is from the Particle Data Group (http://pdg.lbl.gov/) - * - * Note this is different to another definition in the PDG: - * Mt^2 = E^2 - Pz^2 = m^2 + Pt^2 - * - * [J. Beringer et al. (Particle Data Group), Phys. Rev. D86, 010001 (2012). - * (Kinematics, 43.6.1 and 43.5.2)] - */ - public double getMt() - { - double pt2 = px * px + py * py; - double Et = getEt(); - return Math.sqrt(Et * Et - pt2); - } - - public double getPhi() - { - return px == 0.0 && py == 0.0 ? 0.0 : Math.atan2(py,px); - } - - public double getEta() - { - double ptot = getP(); - double cosTheta = ptot == 0.0 ? 1.0 : pz/ptot; - if (cosTheta*cosTheta < 1) return -0.5* Math.log( (1.0-cosTheta)/(1.0+cosTheta) ); - if (pz > 0) return 10e10; - else return -10e10; - } - - public void add(double dx, double dy, double dz, double m) - { - px += dx; - py += dy; - pz += dz; - e += Math.sqrt(dx * dx + dy * dy + dz * dz + m * m); - } - - public void add(A4Vector v) - { - px += v.px; - py += v.py; - pz += v.pz; - e += v.e; - } - - public String toString() - { - return "A4Vector[px=" + px + ", py=" + py + ", pz=" + pz + ", E=" + e + ", m=" + getMass() + "]"; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/AAtlantisException.java b/graphics/AtlantisJava/src/atlantis/utils/AAtlantisException.java deleted file mode 100755 index d8a4edc6d38f28ea393e7115e3733741578912c0..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AAtlantisException.java +++ /dev/null @@ -1,41 +0,0 @@ -package atlantis.utils; - -/** - * - * @author Zdenek Maxa - */ -public class AAtlantisException extends Exception -{ - private boolean isFatal = true; - - // private static ALogger logger = ALogger.getLogger(AAtlantisException.class); - - - public AAtlantisException(String msg) - { - super(msg); - // logger.debug(msg, this); - this.isFatal = true; - - } // AAtlantisException() ----------------------------------------------- - - - - public AAtlantisException(String msg, boolean isFatal) - { - super(msg); - // logger.debug(msg, this); - this.isFatal = isFatal; - - } // AAtlantisException() ----------------------------------------------- - - - - public boolean isFatal() - { - return this.isFatal; - - } // isFatal() ---------------------------------------------------------- - - -} // class AAtlantisException =============================================== diff --git a/graphics/AtlantisJava/src/atlantis/utils/AClipPolygon.java b/graphics/AtlantisJava/src/atlantis/utils/AClipPolygon.java deleted file mode 100755 index ad73aac1bfd1427f173a85a3b9b3b12c9328567e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AClipPolygon.java +++ /dev/null @@ -1,98 +0,0 @@ -package atlantis.utils; - -/** - * This class is used when clipping polygons. - */ -public class AClipPolygon extends APolygon { - - public AClipPolygon(double[] x, double[] y) { - super(x, y); - calc_hesse(); - } - - private double[][] normalized; - private double[] distances; - - public double[] get_normalized(int index) { - if(index>=0&&index<normalized.length&&normalized[index].length==3) - return normalized[index]; - else - return null; - } - - public double get_distance(int index) { - if(index>=0&&index<distances.length) - return distances[index]; - else - return Double.NaN; - } - - public void calc_hesse() { - int degree=nodes.size(); - - // Check if fields are already allocated - if(distances==null||distances.length!=degree) - distances=new double[nodes.size()]; // Generate array for distances - - if(normalized==null||normalized.length!=degree) - normalized=new double[nodes.size()][]; // array for normal vectors - - // Loop over all components and determine the normal vectors - for(int i=0; i<degree; i++) { - APoint r, next=null, current=null; - - if(nodes.elementAt(i) instanceof APoint) - current=(APoint)nodes.elementAt(i); - if(nodes.elementAt((i+1)%degree) instanceof APoint) - next=(APoint)nodes.elementAt((i+1)%degree); - - // If both APoints exist, calculate the normalized vector - if(next!=null&¤t!=null) { - - normalized[i]=new double[3]; - r=next.minus(current); - - // Check values and determine normalized vector. - if(r.x==0) - if(r.y>0) { - normalized[i][0]=1.0; - normalized[i][1]=0.0; - normalized[i][2]=1.0; - } else if(r.y<0) { // on the negative y-Axis - normalized[i][0]=-1.0; - normalized[i][1]=0.0; - normalized[i][2]=1.0; - } - - if(r.y==0) - if(r.x>0) { // on the positive x-Axis - normalized[i][0]=0.0; - normalized[i][1]=-1.0; - normalized[i][2]=1.0; - } else if(r.x<0) { // on the negative x-Axis - normalized[i][0]=0.0; - normalized[i][1]=1.0; - normalized[i][2]=1.0; - } - - if(r.y!=0) - if(r.x>0) { // right of the y-Axis - double x_val=r.y/r.x; - double length=Math.sqrt(x_val*x_val+1); - - normalized[i][0]=x_val/length; - normalized[i][1]=-1.0/length; - normalized[i][2]=1.0; - } else if(r.x<0) { // left of the y-Axis - double x_val=-r.y/r.x; - double length=Math.sqrt(x_val*x_val+1); - - normalized[i][0]=x_val/length; - normalized[i][1]=1.0/length; - normalized[i][2]=1.0; - } - distances[i]=-current.dot_product(normalized[i]); - } - } - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/ACommandHistory.java b/graphics/AtlantisJava/src/atlantis/utils/ACommandHistory.java deleted file mode 100755 index b226d78b0fac6ce0e14ef4a65b418eeea97a68dc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/ACommandHistory.java +++ /dev/null @@ -1,213 +0,0 @@ -package atlantis.utils; - -import java.util.Vector; -import javax.swing.text.JTextComponent; - - -/** - * Implementation of simple command history (up and down - * arrows) and tab completion based upon the already typed commands. - * No cross-sessions commands history so far. - * - * @author Zdenek Maxa - */ -public class ACommandHistory extends Vector -{ - // the component upon which the history operates - private JTextComponent comp = null; - // item on the size() position of the history (content of the text field) - private String tempItem = ""; - private int pointer = 0; - private int tabPointer = 0; // help pointer when doing tab completion - private String tabItem = null; - - - // ---------------------------------------------------------------------- - public ACommandHistory(JTextComponent compoment) - { - super(); - this.comp = compoment; - this.pointer = 0; - this.tabPointer = 0; - this.tempItem = ""; - this.nullTabItem(); - - } // ACommandHistory() -------------------------------------------------- - - - /** - * add the item into the history container, if it's already there it's - * removed first and then added (placed to the end) - * @param item String - */ - public void add(String item) - { - if(super.contains(item)) - { - super.remove(item); - } - super.add(item); - pointer = super.size(); - nullTabItem(); - - } // add() -------------------------------------------------------------- - - - /** - * erase the content of the tabItem string upon which the tab-completion - * searching is performed - */ - public void nullTabItem() - { - this.tabItem = null; - - } // nullTabItem() ------------------------------------------------------ - - - private String getItem() - { - if(pointer < super.size()) - { - return super.get(pointer).toString(); - } - else - { - return tempItem; - } - - } // getItem() ---------------------------------------------------------- - - - - private void desc() - { - if(pointer > 0) - { - pointer--; - } - - } // desc() ------------------------------------------------------------- - - - - private void inc() - { - if(pointer < super.size()) - { - pointer++; - } - - } // inc() -------------------------------------------------------------- - - - - /** - * compares the actual content of the text field with the history item - * on the matching position. if they differ (user changed the item in the - * text field) the item in the history (or the tempItem attribute - the - * last item, not yet added to the container) gets updated - */ - private void compareAndUpdate() - { - String currItem = comp.getText(); - if(pointer < super.size()) - { - String histItem = super.get(pointer).toString(); - if(! histItem.equals(currItem)) - { - super.remove(pointer); - super.add(pointer, currItem); - } - } - else - { - if(! tempItem.equals(currItem)) - { - tempItem = currItem; - } - } - - } // compareAndUpdate() ------------------------------------------------- - - - - /** - * up-arrow handler - it will decrease the pointer and return former - * command - */ - public void upArrow() - { - if(! super.isEmpty()) - { - compareAndUpdate(); - desc(); - comp.setText(getItem()); - } - nullTabItem(); - - } // upArrow() ---------------------------------------------------------- - - - - /** - * down-arrow handler - it will increase the pointer toward the more - * recent commands - */ - public void downArrow() - { - if(! super.isEmpty()) - { - compareAndUpdate(); - inc(); - comp.setText(getItem()); - } - nullTabItem(); - - } // downArrow() -------------------------------------------------------- - - - - /** - * tabulator handler, tab-completion - */ - public void tabulator() - { - // check tabItem - first or subsequent tab-key hit? - if(tabItem == null) - { - tabItem = comp.getText().trim(); - if("".equals(tabItem) || tabItem == null) - { - nullTabItem(); - return; - } - } - - if(! super.isEmpty()) - { - compareAndUpdate(); - - if(tabPointer >= super.size()) - { - tabPointer = 0; // rotate again from the beginning - } - - for( ; tabPointer < super.size(); tabPointer++) - { - String item = super.get(tabPointer).toString(); - if(item.startsWith(tabItem)) - { - pointer = tabPointer; - comp.setText(item); - tabPointer++; // for next iteration (next tab hit) - break; - } - } - - } // if(! super.isEmpty()) [container empty] - - } // tabulator() -------------------------------------------------------- - - - -} // class ACommandHistory ================================================== diff --git a/graphics/AtlantisJava/src/atlantis/utils/AHashMap.java b/graphics/AtlantisJava/src/atlantis/utils/AHashMap.java deleted file mode 100755 index 6e4f5f1c9d4a5b56da5359bd402ce326b9d439d9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AHashMap.java +++ /dev/null @@ -1,201 +0,0 @@ -package atlantis.utils; - -import java.util.HashMap; -import atlantis.Atlantis; - -/** - * Based on a standard Hashmap with an modified interface - */ - -public class AHashMap extends HashMap -{ - - private static ALogger logger = ALogger.getLogger(AHashMap.class); - - private void printWarningMessage(String msg) - { - logger.warn("AHashMap: " + msg); - } - - - public AHashMap(int num) - { - super(num); - } - - public AHashMap put(String name, int i) - { - put(name, new Integer(i)); - return this; - } - - public float[] getFloatArray(String name) - { - Object temp = get(name); - if(temp == null) - { - printWarningMessage("getFloatArray(): can't find float array named " + - name); - return null; - } - else - { - return (float[]) temp; - } - } // getFloatArray() ------------------------------------------------------- - - public float[][][] getFloatArray3D(String name) - { - Object temp = get(name); - - if(temp == null) - { - printWarningMessage("getFloatArray3D(): can't find 3D float array named " - + name); - } - return (float[][][]) temp; - } - - public String[] getStringArray(String name) - { - Object temp = get(name); - - if(temp == null) - { - printWarningMessage("getStringArray(): can't find String array named " - + name); - } - return (String[]) temp; - } - - public String[][] getStringArray2D(String name) - { - Object temp = get(name); - - if(temp == null) - { - printWarningMessage("getStringArray2D(): can't find String array named " - + name); - } - return (String[][]) temp; - } - - - public int[] getIntArray(String name) - { - Object temp = get(name); - - if(temp == null && !name.equals("sub")) - { - printWarningMessage("getIntArray(): can't find int array named " + - name); - } - return (int[]) temp; - } - - - public int[][] getIntArray2D(String name) - { - Object temp = get(name); - - if(temp == null) - { - printWarningMessage("getIntArray2D(): can't find 2D int array named " + - name); - } - return (int[][]) temp; - } - - - public int getInt(String name) - { - Object temp = get(name); - - if(temp == null) - { - printWarningMessage("getInt(): can't find int named " + name); - } - return ((Integer) temp).intValue(); - } - - public long getLong(String name) - { - Object temp = get(name); - - if(temp == null) - { - printWarningMessage("getLong(): can't find int named " + name); - return -1; - } - return ((Long) temp).longValue(); - } - - public float getFloat(String name) - { - Object temp = get(name); - - if(temp == null) - { - printWarningMessage("getFloat(): can't find int named " + name); - return -1; - } - return ((Float) temp).floatValue(); - } - - - public float[] getUnknownFloatArray(String name) - { - Object temp = get(name); - - if(temp == null) - return new float[getInt("numData")]; - return (float[]) temp; - } - - public long[] getUnknownLongArray(String name) - { - Object temp = get(name); - - if(temp == null) - return new long[getInt("numData")]; - return (long[]) temp; - } - - - public int[] getUnknownIntArray(String name) - { - Object temp = get(name); - - if(temp == null) - return new int[getInt("numData")]; - return (int[]) temp; - } - - - public float[] getUnsureFloatArray(String name) - { - Object temp = get(name); - - if(temp == null) - return null; - return (float[]) temp; - } - - public int[] getUnsureIntArray(String name) - { - Object temp = get(name); - - if(temp == null) - return null; - return (int[]) temp; - } - - public String[] getUnsureStringArray(String name) - { - Object temp = get(name); - - if(temp == null) - return null; - return (String[]) temp; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/AIdDictionary.java b/graphics/AtlantisJava/src/atlantis/utils/AIdDictionary.java deleted file mode 100644 index 9d04ec7239c5a26139a5a757acafea4a30ae89da..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AIdDictionary.java +++ /dev/null @@ -1,152 +0,0 @@ -package atlantis.utils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Class representing an identifier dictionary, used for decoding of compact IDs. - * - * @author Eric Jansen - */ -class AIdDictionary extends AIdField { - - private HashMap<String, Node> subregions = null; - private HashMap<String, Node> labels = null; - private HashMap<String, List<AIdRange>> ranges = new HashMap<String, List<AIdRange>>(); - - /** - * Empty constructor, used to create a placeholder dictionary that - * can be initialized later. - */ - AIdDictionary() {} - - /** - * Construct and initialize dictionary from an <IdDictionary> XML node. - * @param dict dictionary XML node - * @throws AAtlantisException - */ - AIdDictionary(Node dict) throws AAtlantisException { - initialize(dict); - } - - /** - * Initializes a dictionary from an <IdDictionary> XML node. - * @param dict dictionary XML node - * @throws AAtlantisException - */ - final void initialize(Node dict) throws AAtlantisException { - - this.dictionary = this; - - NodeList nodes = dict.getChildNodes(); - - for (int i=0; i<nodes.getLength(); i++) { - Node node = nodes.item(i); - - if (node.getNodeType() == Node.ELEMENT_NODE) { - - if ("field".equals(node.getNodeName())) { - String fieldName = node.getAttributes().getNamedItem("name").getNodeValue(); - if (labels == null) { - labels = new HashMap<String, Node>(); - } - labels.put(fieldName, node); - - } else if ("subregion".equals(node.getNodeName())) { - String subregionName = node.getAttributes().getNamedItem("name").getNodeValue(); - if (subregions == null) { - subregions = new HashMap<String, Node>(); - } - subregions.put(subregionName, node); - - } else if ("region".equals(node.getNodeName())) { - parseRegion(node, null, 0); - - } else if ("alternate_regions".equals(node.getNodeName())) { - NodeList altnodes = node.getChildNodes(); - - for (int j=0; j<altnodes.getLength(); j++) { - Node altnode = altnodes.item(j); - if (altnode.getNodeType() == Node.ELEMENT_NODE - && "region".equals(altnode.getNodeName())) { - parseRegion(altnode, null, 0); - } - } - } - } - } - - // Clean up the HashMaps, they are only needed during initialization. - ranges = null; - labels = null; - subregions = null; - } - - /** - * Returns true if the dictionary contains labels for the named field. - * @param fieldName name of the field - * @return true if labels are present - */ - boolean hasLabels(String fieldName) { - return labels.containsKey(fieldName); - } - - /** - * Returns the <field> node containing the labels for the named field. - * @param fieldName name of the field - * @return <field> XML node - * @throws AAtlantisException - */ - Node getLabels(String fieldName) throws AAtlantisException { - if (labels.containsKey(fieldName)) { - return labels.get(fieldName); - } else { - throw new AAtlantisException("Labels for field '"+fieldName+"' not found"); - } - } - - /** - * Returns the <subregion> node containing the named subregion. - * @param subRegionName name of the subregion - * @return <subregion> XML node - * @throws AAtlantisException - */ - Node getSubRegion(String subRegionName) throws AAtlantisException { - if (subregions.containsKey(subRegionName)) { - return subregions.get(subRegionName); - } else { - throw new AAtlantisException("Subregion '"+subRegionName+"' not found"); - } - } - - /** - * One AIdRange object for every unique field range is kept inside the dictionary. - * It serves to collect all possible values for the named field. Due to the tree - * structure of the identifiers multiple AIdFields with the same name might be - * created, but they will always have the same range. The first AIdField with a - * certain name will be the parent of the range, but it is only used for decoding - * of labelled fields. The field name has to be set before creating the range in the - * dictionary. - * @param field named identifier field - * @return global range corresponding to the named field - */ - AIdRange getRange(String group, int level) throws AAtlantisException { - - List<AIdRange> range; - if (ranges.containsKey(group)) { - range = ranges.get(group); - } else { - range = new ArrayList<AIdRange>(); - ranges.put(group, range); - } - - while (range.size() <= level) { - range.add(new AIdRange()); - } - - return range.get(level); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/AIdField.java b/graphics/AtlantisJava/src/atlantis/utils/AIdField.java deleted file mode 100644 index a1f9c7d8d8d7a2c268b1fdb695542b89500e4112..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AIdField.java +++ /dev/null @@ -1,537 +0,0 @@ -package atlantis.utils; - -import java.util.HashMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Class representing a single field in an identifier. Each field has a parent, - * a range of allowed values and child fields that may depend on the value of the - * current field. The possible values of a field will determine the number of bits - * needed to store it in the compact identifier. The AIdField tree is capable of - * encoding and decoding these compact identifiers. - * - * @author Eric Jsnsen - */ -class AIdField { - - /** - * Dictionary that this field belongs to. The dictionary is used to keep track - * of the possible values of a field, - */ - protected AIdDictionary dictionary = null; - - /** Parent field in the identifier tree. */ - private AIdField parent = null; - - /** Level of nesting this field is at. */ - private int level = 0; - - /** Field name. */ - private String name = null; - - /** All known values found for this field in the dictionary. */ - private AIdRange fieldRange = null; - - /** Map of value ranges to child AIdField objects, inverse of parent. */ - private HashMap<AIdRange, AIdField> children = new HashMap<AIdRange, AIdField>(); - - /** Map of string labels in case of an enumerated field. */ - private HashMap<Integer, String> labels = null; - - /** Reference to idHelper for retrieving dictionaries. */ - protected static ANewIdHelper idHelper = ANewIdHelper.instance(); - - /** - * Empty constructor. - */ - protected AIdField() {} - - /** - * Constructor, setting dictionary and parent field. - * @param dict dictionary the field belongs to - * @param parentField parent field - */ - protected AIdField(AIdDictionary dict, AIdField parentField) { - - dictionary = dict; - if (parentField != null) { - parent = parentField; - level = parent.getLevel()+1; - } - } - - /** - * Get the name of the field. - * @return field name - */ - String getName() { - return name; - } - - /** - * Get the nesting level of the field. - * @return nesting level - */ - int getLevel() { - return level; - } - - /** - * Obtain the value of the named field from a compact identifier. - * @param fieldName field name - * @param id compact identifier - * @return value of the given field in the identifier - * @throws AAtlantisException - */ - public int get(String fieldName, long id) throws AAtlantisException { - if (id > Integer.MAX_VALUE) { - return get(fieldName, id, 64); - } else { - return get(fieldName, id, 32); - } - } - - /** - * Obtain the string value of the named field from a compact identifier. - * @param fieldName field name - * @param id compact identifier - * @return value of the given field in the identifier - * @throws AAtlantisException - */ - public String getString(String fieldName, long id) throws AAtlantisException { - if (id > Integer.MAX_VALUE) { - return getString(fieldName, id, 64); - } else { - return getString(fieldName, id, 32); - } - } - - /** - * Internal version of get(String, long), propagating the bit offset in - * the compact identifier. - * @param fieldName field name - * @param id compact identifier - * @param offset bit offset accumulated from parent fields - * @return value of the given field in the identifier - * @throws AAtlantisException - */ - private int get(String fieldName, long id, int offset) throws AAtlantisException { - - if (fieldRange == null) { - throw new AAtlantisException("No range known for identifier field" - + " '" + name + "' while decoding '" + fieldName + "'"); - } - - // The following code is duplicated a few times in this class. This is - // necessary to extract the value but also update offset at the same time. - int bits = fieldRange.bits(); - offset -= bits; - int mask = (int)(Math.pow(2, bits)) - 1; - - int value; - try { - value = fieldRange.get((int)(id >> offset & mask)); - } catch (AAtlantisException e) { - throw new AAtlantisException("Unable to decode identifier field" - + " '" + name + "': " + e); - } - - if (fieldName.equals(name)) { - // This is me, return value - return value; - } else { - // Find the correct child to delegate this ID to - for(AIdRange range : children.keySet()) { - if (range.contains(value)) { - return children.get(range).get(fieldName, id, offset); - } - } - } - - throw new AAtlantisException("Invalid identifier '" + id + "'"); - } - - /** - * Internal version of get(String, long), propagating the bit offset in - * the compact identifier. - * @param fieldName field name - * @param id compact identifier - * @param offset bit offset accumulated from parent fields - * @return value of the given field in the identifier - * @throws AAtlantisException - */ - private String getString(String fieldName, long id, int offset) throws AAtlantisException { - - if (fieldRange == null) { - throw new AAtlantisException("No range known for identifier field" - + " '" + name + "' while decoding '" + fieldName + "'"); - } - - // The following code is duplicated a few times in this class. This is - // necessary to extract the value but also update offset at the same time. - int bits = fieldRange.bits(); - offset -= bits; - int mask = (int)(Math.pow(2, bits)) - 1; - - int value; - try { - value = fieldRange.get((int)(id >> offset & mask)); - } catch (AAtlantisException e) { - throw new AAtlantisException("Unable to decode identifier field" - + " '" + name + "': " + e); - } - - if (fieldName.equals(name)) { - // This is me, return value - return getLabel(value); - } else { - // Find the correct child to delegate this ID to - for(AIdRange range : children.keySet()) { - if (range.contains(value)) { - return children.get(range).getString(fieldName, id, offset); - } - } - } - - throw new AAtlantisException("Invalid identifier '" + id + "'"); - } - - /** - * Convert a compact identifier into a "/" delimited expanded identifier. - * @param id compact identifier - * @return expanded identifier, fields delimited by "/" - */ - public String getFullIdentifier(long id) throws AAtlantisException { - - StringBuilder s = new StringBuilder(); - if (id > Integer.MAX_VALUE) { - getFullIdentifier(id, 64, s); - } else { - getFullIdentifier(id, 32, s); - } - return s.toString(); - } - - /** - * Internal version of getFullIdentifier(long), passing the bit offset a - * StringBuilder object. The output is appended to the StringBuilder object. - * @param id compact identifier - */ - private void getFullIdentifier(long id, int offset, StringBuilder s) throws AAtlantisException { - - // The following code is duplicated a few times in this class. This is - // necessary to extract the value but also update offset at the same time. - int bits = fieldRange.bits(); - offset -= bits; - int mask = (int)(Math.pow(2, bits)) - 1; - - int value; - try { - value = fieldRange.get((int)(id >> offset & mask)); - } catch (AAtlantisException e) { - throw new AAtlantisException("Unable to decode identifier field" - + " '" + name + "': " + e.getMessage()); - } - - if (hasLabels()) { - s.append(getLabel(value));//.append("=").append(value); - } else { - s.append(value); - } - - if (children != null) { - for (AIdRange range : children.keySet()) { - if (range.contains(value)) { - AIdField child = children.get(range); - if (child != null && !child.isEmpty()) { - s.append("/"); - child.getFullIdentifier(id, offset, s); - } - return; - } - } - - throw new AAtlantisException("Invalid identifier '" + id + "', " - + "field '" + name +"' does not allow value " + value + " " - + "(partially decoded: '" + s.toString() + "')"); - } - } - - /** - * Parses a <region> element in the XML file. This method should be - * called on an AIdField instance that represents the first field in the - * region. Children will be added by recursively calling this method. - * @param region XML element to parse - * @param start Starting child element - * @return Last child parsed - * @throws AAtlantisException - */ - AIdField parseRegion(Node region, String group, int start) throws AAtlantisException { - NodeList nodes = region.getChildNodes(); - - if (start == 0) { - // In a new region, first set the group all parsed elements belong to (if any). - Node groupNode = region.getAttributes().getNamedItem("group"); - if (groupNode != null) { - group = groupNode.getNodeValue(); - } - } - - for (int i=start; i<nodes.getLength(); i++) { - Node node = nodes.item(i); - - /* Select only elements, not the text in between. */ - if (node.getNodeType() == Node.ELEMENT_NODE) { - - if ("range".equals(node.getNodeName())) { - - // The first <range> encountered is for the current AIdFied. For the - // given values of this field, the next will be a child. For example, - // when called with: - // - // <range field="subdet" value="2" /> - // <range field="part" value=1" /> - // ... - // - // This field will become "subdet". In case the value of this field - // in the identifier is "2", the next field in the chain is "part". - // More values of "part" will probably be added later, plus other - // values of "subdet" for which the next field is not "part" but - // something different. - if (name == null) { - name = node.getAttributes().getNamedItem("field").getNodeValue(); - if (dictionary.hasLabels(name)) { - parseLabels(dictionary.getLabels(name)); - } - - fieldRange = dictionary.getRange(group, level); - } - - AIdRange range = new AIdRange(this, group, node); - - // Fields are sometimes repeated without specifying any allowed values, - // in that case we allow all existing values (so we copy fieldRange). - if (range.isEmpty() && !fieldRange.isEmpty()) { - range.add(fieldRange); - } - - // If this particular range is already present, give the next - // node (i+1) to the correct child and tell it to parse it. - if (children.containsKey(range) && children.get(range) != null) { - - return children.get(range).parseRegion(region, group, i+1); - } - - // If there is another range that fully contains this range, we add the - // current node there. This is a reasonable shortcut, since we are not - // interested in fully validating IDs (i.e. raise an exception when an - // RPC identifier is presented for a muon station that should not contain - // RPCs), this is a reasonable shortcut. - for (AIdRange childRange : children.keySet()) { - if (childRange.contains(range)) { - return children.get(childRange).parseRegion(region, group, i+1); - } - } - - if (group != null && !group.equals("")) { - - // Two ranges within the same group means that they should be - // considered to lead to the same child. In that case expand - // the range using AIdRange.add(). - for (AIdRange childRange : children.keySet()) { - if (group.equals(childRange.group())) { - AIdField child = children.get(childRange); - - if (child != null) { - fieldRange.add(range); - children.remove(childRange); - childRange.add(range); - children.put(childRange, child); - return child.parseRegion(region, group, i+1); - } - } - } - } - - fieldRange.add(range); - - AIdField child = new AIdField(dictionary, this); - AIdField retfield = child.parseRegion(region, group, i+1); - if (retfield instanceof AIdDictionary) { - children.put(range, retfield); - } else { - children.put(range, child); - } - - return retfield; - - } else if ("dictionary".equals(node.getNodeName())) { - - // A dictionary is a reference to another file. The AIdDictionary class - // inherits from AIdField and can will act as the first field in the - // dictionary. Dictionaries are initialized one by one, so when a dictionary - // does not exist yet, it is created empty so that it can be initialized later. - String dictName = node.getAttributes().getNamedItem("name").getNodeValue(); - if (idHelper.hasDictionary(dictName)) { - return idHelper.getDictionary(dictName); - } else { - AIdDictionary dict = new AIdDictionary(); - idHelper.addDictionary(dictName, dict); - return dict; - } - - } else if ("reference".equals(node.getNodeName())) { - - // A reference is a link to a <subregion> element. The elements within the - // subregion are parsed as if they were present instead of the reference. - String reference = node.getAttributes().getNamedItem("subregion").getNodeValue(); - AIdField child = parseRegion(dictionary.getSubRegion(reference), group, 0); - - // After parsing the subregion, we need to continue with the current region. - AIdField retfield = child.parseRegion(region, group, i+1); - return retfield; - } - } - } - - // Reached the end of a region or subregion, - // return the last object parsed (which is us). - return this; - } - - /** - * Parse a <field> object in the XML file. - * @param field XML element to parse - * @throws AAtlantisException - */ - private void parseLabels(Node field) throws AAtlantisException { - - labels = new HashMap<Integer, String>(); - int lastValue = 0; - - NodeList nodes = field.getChildNodes(); - for (int i=0; i<nodes.getLength(); i++) { - Node node = nodes.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - - if (node.getNodeName().equals("label")) { - String label = node.getAttributes().getNamedItem("name").getNodeValue(); - Integer value; - - Node valueNode = node.getAttributes().getNamedItem("value"); - if (valueNode == null) { - value = lastValue+1; - } else { - value = Integer.parseInt(valueNode.getNodeValue().replaceAll("\\+", "")); - } - - labels.put(value, label); - lastValue = value.intValue(); - } - } - } - } - - /** - * Check if this field has string labels. - * @return true if string labels are present - */ - boolean hasLabels() { - return labels != null && labels.size() > 0; - } - - /** - * Check if this field is empty/uninitialized. Fields at the end of the tree - * will remain in this state, during construction all newly initialized fields - * will be in this state. - * @return - */ - boolean isEmpty() { - return name == null; - } - - /** - * Return label corresponding to an integer value. - * @param value field value - * @return label - */ - String getLabel(Integer value) { - if (labels.containsKey(value)) { - return labels.get(value); - } else { - return "?"; - } - } - - /** - * Convert a field value as it appears in the XML file into a true integer. - * For example "+2" is converted into 2 and labelled fields are converted - * into their integer equivalents. - * @param fieldName field name (for label lookup) - * @param value "raw" field value in the XML - * @return integer value - * @throws AAtlantisException - */ - protected int valueToInt(String fieldName, String value) throws AAtlantisException { - - try { - return Integer.parseInt(value.replaceAll("\\+", "")); - } catch (NumberFormatException e) { - return labelToInt(fieldName, value); - } - } - - /** - * Convert a field label into an integer value. - * @param fieldName field name - * @param label value of the labelled field - * @return integer label - * @throws AAtlantisException - */ - protected int labelToInt(String fieldName, String label) throws AAtlantisException { - if (labels != null) { - if (labels.containsValue(label)) { - for (Integer value : labels.keySet()) { - if (label.equals(labels.get(value))) { - return value; - } - } - } - } - - throw new AAtlantisException("Field/label not found in" - +" dictionary: " + fieldName + "/" + label); - } - - /** - * Convert the field structure into a printable form, starting from this node. - * @return string representation of the identifier tree - */ - @Override - public String toString() { - return toString(""); - } - - /** - * Private version of toString(), used recursively and passing an indentation - * string to print the entire tree structure. - * @param indent identation string, appended to all lines - * @return string representation of the identifier tree - */ - private String toString(String indent) { - StringBuilder s = new StringBuilder(); - - s.append(indent).append(name).append(" ").append(fieldRange).append("\n"); - - for (AIdRange range : children.keySet()) { - s.append(indent).append(range).append("\n"); - AIdField child = children.get(range); - if (child != null) { - s.append(child.toString(indent + " ")); - } - } - - return s.toString(); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/AIdHelper.java b/graphics/AtlantisJava/src/atlantis/utils/AIdHelper.java deleted file mode 100755 index 48561f8232ea9d550c3fd78da160107bd2d4b81c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AIdHelper.java +++ /dev/null @@ -1,599 +0,0 @@ -package atlantis.utils; - -import java.util.ArrayList; - -/** - * This class contains methods for extracting various properties from the 32 bit - * identifiers used for hits. It works very similarly to the IdHelpers in Athena, - * hence its name. - * - * @author Eric Jansen - */ -public class AIdHelper { - - private static ANewIdHelper idHelper = null; - - /** - * Returns the decoded athena identifier (id) as a string, resp. an - * array of strings: first item is the full id expanded (decoded) and - * particular subparts are separated by "/" in one sting, further - * interesting subparts of the decoded id are provided in the following - * items of the array with an explanation given. - * So far (2009-01-20), this is implemented only for LAr and Tile, for - * other subsystems only first array item is returned with the expanded - * id. - * @param id int compact identifier - * @return String decoded identifier - */ - public static String[] getFullIdentifier(long id) - { - // more than 10 items should not be necessary - ArrayList<String> r = new ArrayList<String>(10); - String s = null; - - try - { - switch (subDetector(id)) - { - case 2: - switch (indetPart(id)) - { - case 1: - // Pixel identifiers are complicated and we don't use them anyway. - throw new AAtlantisException("Pixel identifiers not implemented: " + id); - case 2: - s = "2/2/" + sctBarrelEndcap(id) + "/" + - sctLayerDisk(id) + "/" + sctPhiModule(id) + "/" + - sctEtaModule(id) + "/" + sctPhiIndex(id) + "/" + - sctEtaIndex(id); - r.add(s); - return r.toArray(new String[r.size()]); - case 3: - - int part = 3; - int barrelEndcap = trtBarrelEndcap(id); - int layerWheel = trtLayerWheel(id); - int phiModule = trtPhiModule(id); - int strawLayer = trtStrawLayer(id); - int straw = trtStraw(id); - - s = "2" + "/" + part + "/" + barrelEndcap + "/" + - layerWheel + "/" + phiModule + "/" + strawLayer + - "/" + straw; - r.add(s); - r.add("barrel-endcap: " + barrelEndcap); - r.add("layer wheel: " + layerWheel); - r.add("phi module: " + phiModule); - r.add("straw layer: " + strawLayer); - r.add("straw: " + straw); - return r.toArray(new String[r.size()]); - - default: - throw new AAtlantisException("Invalid identifier: " + id); - } - case 4: - int part = larPart(id); - int sampling = part < 3 ? 0 : larSampling(id); - int eta = larEta(id); - int phi = larPhi(id); - - if(part == 1) // LAr barrel, LAr endcap - { - int barrelEndcap = larBarrelEndcap(id); - int region = larRegion(id); - s = "4/" + part + "/" + barrelEndcap + "/" + - sampling + "/" + region + "/" + eta + "/" + phi; - r.add(s); - if(barrelEndcap == 1) - { - //r.add("barrel A"); - r.add("EMBA"); - } - else if(barrelEndcap == -1) - { - //r.add("barrel C"); - r.add("EMBC"); - } - else if(barrelEndcap == 2 || barrelEndcap == 3) - { - //r.add("endcap A"); - r.add("EMECA"); - } - else if(barrelEndcap == -2 || barrelEndcap == -3) - { - //r.add("endcap C"); - r.add("EMECC"); - } - } - else if(part == 2) // HEC - { - int posNeg = larBarrelEndcap(id); - int region = larRegion(id); - s = "4/" + part + "/" + posNeg + "/" + sampling + "/" + - region + "/" + eta + "/" + phi; - r.add(s); - if(posNeg == 2) - { - //r.add("A"); - r.add("HECA"); - } - else if(posNeg == -2) - { - //r.add("C"); - r.add("HECC"); - } - } - else if(part == 3) // FCAL - { - int posNeg = larBarrelEndcap(id); - s = "4/" + part + "/" + posNeg + "/" + sampling + "/" + - eta + "/" + phi; - r.add(s); - if(posNeg == 2) - { - //r.add("A"); - r.add("FCALA"); - } - else if(posNeg == -2) - { - //r.add("C"); - r.add("FCALC"); - } - } - else - { - throw new AAtlantisException("Invalid identifier: " + id); - } - - r.add("sampling: " + sampling); // sampling remains - - return r.toArray(new String[r.size()]); - - case 5: - // tile calorimeter (first number of full id is 5) - int section = tileSection(id); - int side = tileSide(id); - int module = tileModule(id); - int tower = tileTower(id); - sampling = tileSampling(id); - int pmt = tilePmt(id); - int adc = tileAdc(id); - - s = "5/" + section + "/" + side + "/" + module + "/" + - tower + "/" + sampling + "/" + pmt + "/" + adc; - r.add(s); - - r.add("section: " + section); - r.add("side: " + side); - r.add("module: " + module); - r.add("tower: " + tower); - r.add("sampling: " + sampling); - r.add("PMT: " + pmt); - r.add("ADC: " + adc); - - return r.toArray(new String[r.size()]); - - case 7: - String technology = technology(id); - if (technology.equals("MDT")) - { - s = "7/" + stationName(id) + "/" + stationEta(id) + - "/" + stationPhi(id) + "/" + "MDT/" + - mdtMultiLayer(id) + "/" + mdtTubeLayer(id) + "/" + - mdtTube(id); - r.add(s); - return r.toArray(new String[r.size()]); - } - else if (technology.equals("RPC")) - { - s = "7/" + stationName(id) + "/" + stationEta(id) + "/" + - stationPhi(id) + "/" + "RPC/" + rpcDoubletR(id) + "/" + - rpcDoubletZ(id) + "/" + rpcDoubletPhi(id) + "/" + - rpcGasGap(id) + "/" + rpcMeasuresPhi(id) + "/" + - rpcStrip(id); - r.add(s); - return r.toArray(new String[r.size()]); - } - else if (technology == "TGC") - { - s = "7/" + stationName(id) + "/" + stationEta(id) + - "/" + stationPhi(id) + "/" + "TGC/" + tgcGasGap(id) + - "/" + tgcIsStrip(id) + "/" + tgcChannel(id); - r.add(s); - return r.toArray(new String[r.size()]); - } - else if (technology == "CSC") - { - s = "7/" + stationName(id) + "/" + stationEta(id) + "/" + - stationPhi(id) + "/" + "CSC/" + cscChamberLayer(id) + - "/" + cscWireLayer(id) + "/" + cscMeasuresPhi(id) + - "/" + cscStrip(id); - r.add(s); - return r.toArray(new String[r.size()]); - } - else - { - throw new AAtlantisException("Invalid identifier: " + id); - } - default: - throw new AAtlantisException("Not yet implemented for identifier: " + id); - } - } - catch (AAtlantisException e) - { - s = id + " (unable to decode: " + e.getMessage() + ")"; - r.add(s); - return r.toArray(new String[r.size()]); - } - - } // getFullIdentifier() ------------------------------------------------ - - - - /** @deprecated */ - public static int subDetector(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("subdet", id); - } - - /** @deprecated */ - public static int indetPart(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("part", id); - } - - /** @deprecated */ - public static int trtBarrelEndcap(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("barrel_endcap", id); - } - - - /** @deprecated */ - public static int trtLayerWheel(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("layer_or_wheel", id); - } - - /** @deprecated */ - public static int trtPhiModule(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("phi_sector", id); - } - - /** @deprecated */ - public static int trtStrawLayer(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("straw_layer", id); - } - - /** @deprecated */ - public static int trtStraw(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("straw", id); - } - - /** @deprecated */ - public static final int sctBarrelEndcap(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("barrel_endcap", id); - } - - /** @deprecated */ - public static int sctLayerDisk(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("layer", id); - } - - /** @deprecated */ - public static int sctPhiModule(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("phi_module", id); - } - - /** @deprecated */ - public static int sctEtaModule(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("eta_module", id); - } - - /** @deprecated */ - public static int sctPhiIndex(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("side", id); // This seems odd, phi_index <-> side? - } - - /** @deprecated */ - public static int sctEtaIndex(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("strip", id); - } - - /** @deprecated */ - public static int larPart(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("part", id); - } - - /** @deprecated */ - public static int larBarrelEndcap(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("barrel-endcap", id); - } - - /** @deprecated */ - public static int larPosNeg(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("pos_neg", id); - } - - /** @deprecated */ - public static int larSampling(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("sampling", id); - } - - /** @deprecated */ - public static int larRegion(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("region", id); - } - - /** @deprecated */ - public static int larEta(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - if (larPart(id) < 3) { - return idHelper.get("eta", id); - } else { - return idHelper.get("eta-fcal", id); - } - } - - /** @deprecated */ - public static int larPhi(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - if (larPart(id) < 3) { - return idHelper.get("phi", id); - } else { - return idHelper.get("phi-fcal", id); - } - } - - /** @deprecated */ - public static int larModule(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("module", id); - } - - - /** @deprecated */ - public static boolean larIsBarrel(long id) throws AAtlantisException - { - switch(Math.abs(larBarrelEndcap(id))) - { - case 1: - return true; // yes, it's barrel - case 2: - return false; // is endcap - case 3: - return false; // is endcap - default: - throw new AAtlantisException("Not a LAr identifier: " + id); - } - } - - /** @deprecated */ - public static int tileSection(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("section", id); - } - - /** @deprecated */ - public static int tileSide(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("side", id); - } - - /** @deprecated */ - public static int tileModule(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("module", id); - } - - /** @deprecated */ - public static int tileTower(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("tower", id); - } - - /** @deprecated */ - public static int tileSampling(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("sampling", id); - } - - /** @deprecated */ - public static int tilePmt(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("pmt", id); - } - - /** @deprecated */ - public static int tileAdc(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("adc", id); - } - - - /** - * Decodes Athena 32-bit ID to following form (5 is Tile): - * 5/section/side/module/tower/sampling/pmt/adc - official identifier - * - * Identifier used by TileCal collaboration, conversion is clear from the - * code and is explained in Sasha Solodkov's email on 2006-09-18 - * - * @param id int - * @return String - */ - public static String getDecodedTileIndentifier(long id) - { - try - { - int sec = tileSection(id); - int side = tileSide(id); - int mod = tileModule(id); - int tow = tileTower(id); - int samp = tileSampling(id); - - // section/side/module into decoded form - String secSideMod = "\n[could not work out section/side]"; - mod++; - if(sec == 1 && side == 1) secSideMod = "LBA" + mod; - if(sec == 1 && side == -1) secSideMod = "LBC" + mod; - if(sec == 2 && side == 1) secSideMod = "EBA" + mod; - if(sec == 3 && side == 1) secSideMod = "EBA" + mod; - if(sec == 2 && side == -1) secSideMod = "EBC" + mod; - if(sec == 3 && side == -1) secSideMod = "EBC" + mod; - - // sampling/tower into decoded form - String sampTow = "\n[could not work out sampling/tower]"; - if(samp == 0) sampTow = "A" + (int)(tow + 1); - if(samp == 1) sampTow = "B" + (int)(tow + 1); - if(samp == 2) sampTow = "D" + (int)(tow/2); - if(samp == 3) - { - if(tow == 10) sampTow = "E1"; - if(tow == 11) sampTow = "E2"; - if(tow == 13) sampTow = "E3"; - if(tow == 15) sampTow = "E4"; - } - - return secSideMod + " " + sampTow; - } - catch (AAtlantisException e) - { - return id + " (unable to decode: " + e.getMessage() + ")"; - } - } - - - /** @deprecated */ - public static String stationName(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.getString("stationName", id); - } - - /** @deprecated */ - public static String technology(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.getString("technology", id); - } - - /** @deprecated */ - public static int stationEta(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("stationEta", id); - } - - /** @deprecated */ - public static int stationPhi(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("stationPhi", id); - } - - /** @deprecated */ - public static int mdtMultiLayer(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("multiLayer", id); - } - - /** @deprecated */ - public static int mdtTubeLayer(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("tubeLayer", id); - } - - /** @deprecated */ - public static int mdtTube(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("tube", id); - } - - /** @deprecated */ - public static int rpcDoubletR(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("doubletR", id); - } - - /** @deprecated */ - public static int rpcDoubletZ(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("doubletZ", id); - } - - /** @deprecated */ - public static int rpcDoubletPhi(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("doubletPhi", id); - } - - /** @deprecated */ - public static int rpcGasGap(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("rpcGasGap", id); - } - - /** @deprecated */ - public static int rpcMeasuresPhi(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("rpcMeasuresPhi", id); - } - - /** @deprecated */ - public static int rpcStrip(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("rpcStrip", id); - } - - /** @deprecated */ - public static int tgcGasGap(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("tgcGasGap", id); - } - - /** @deprecated */ - public static int tgcIsStrip(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("isStrip", id); - } - - /** @deprecated */ - public static int tgcChannel(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("channel", id); - } - - /** @deprecated */ - public static int cscChamberLayer(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("chamberLayer", id); - } - - /** @deprecated */ - public static int cscWireLayer(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("wireLayer", id); - } - - /** @deprecated */ - public static int cscMeasuresPhi(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("cscMeasuresPhi", id); - } - - /** @deprecated */ - public static int cscStrip(long id) throws AAtlantisException { - if (idHelper == null) idHelper = ANewIdHelper.instance(); - return idHelper.get("cscStrip", id); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/AIdRange.java b/graphics/AtlantisJava/src/atlantis/utils/AIdRange.java deleted file mode 100644 index b38d5523882f5bdb002c7011e87975d284e60b8c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AIdRange.java +++ /dev/null @@ -1,392 +0,0 @@ -package atlantis.utils; - -import java.util.Arrays; -import org.w3c.dom.Node; - - -/** - * Class representing a range of possible values for an identifier field. - * - * @author Eric Jansen - */ -class AIdRange { - - /** Group the field belongs to, ranges of the same group should be merged. */ - private String group = null; - - /** Parent field, needed only for printing of labelled fields. */ - AIdField parent = null; - - /** A discrete range with values specified in this array. */ - private int[] values = null; - - /** A continuous range from min to max (if values == null). */ - private int minValue, maxValue; - - /** - * Empty constructor, creates an empty range. - */ - AIdRange() { - this.values = new int[0]; - } - - /** - * Continuous range constructor, contains all values >= minValue <= maxValue. - * @param minValue first value in the range - * @param maxValue last value in the range - * @throws AAtlantisException - */ - AIdRange(int minValue, int maxValue) throws AAtlantisException { - - if (minValue > maxValue) { - throw new AAtlantisException("Invalid range: " + minValue + " -> " + maxValue); - } - - this.minValue = minValue; - this.maxValue = maxValue; - } - - /** - * Discrete range constructor, contains the values given in values[]. - * @param values ordered array of values - */ - AIdRange(int[] values) { - this.values = values; - } - - /** - * XML constructor, initialize the range from a <range> element. - * @param parent id field the values belong to - * @param group group this field belongs to - * @param node <range> XML element - * @throws AAtlantisException - */ - AIdRange(AIdField parent, String group, Node node) throws AAtlantisException { - - String fieldName = node.getAttributes().getNamedItem("field").getNodeValue(); - this.parent = parent; - this.group = group; - - Node minValueAttr = node.getAttributes().getNamedItem("minvalue"); - Node maxValueAttr = node.getAttributes().getNamedItem("maxvalue"); - - if (minValueAttr != null && maxValueAttr != null) { - - minValue = parent.valueToInt(fieldName, minValueAttr.getNodeValue()); - maxValue = parent.valueToInt(fieldName, maxValueAttr.getNodeValue()); - - if (minValue > maxValue) { - throw new AAtlantisException("Invalid range: " + minValue + " -> " + maxValue); - } - - } else { - Node valueAttr = node.getAttributes().getNamedItem("value"); - Node valuesAttr = node.getAttributes().getNamedItem("values"); - - if (valueAttr != null) { - values = new int[1]; - values[0] = parent.valueToInt(fieldName, valueAttr.getNodeValue()); - } else if (valuesAttr != null) { - String[] list = valuesAttr.getNodeValue().split(" "); - values = new int[list.length]; - for (int i=0; i<list.length; i++) { - values[i] = parent.valueToInt(fieldName, list[i]); - } - } else { - values = new int[0]; - } - } - } - - /** - * Get group name for this range. - * @return group name - */ - String group() { - return group; - } - - /** - * Check if the range contains value. - * @param value value to check - * @return true if value is part of this range - */ - boolean contains(int value) { - if (values == null) { - if (value >= minValue && value <= maxValue) { - return true; - } else { - return false; - } - } else { - for (int val : values) { - if (val == value) { - return true; - } - } - return false; - } - } - - /** - * Check if the range fully contains another range. - * @param range range to check - * @return true if all values in the argument are in this range - */ - boolean contains(AIdRange range) { - if (range.values == null) { - for (int value=range.minValue; value<=range.maxValue; value++) { - if (!this.contains(value)) return false; - } - } else { - for (int value : range.values) { - if (!this.contains(value)) return false; - } - } - - return true; - } - - /** - * Check if this range equals another. - * @param obj other range - * @return true if obj is an AIdRange object and its values match - */ - @Override - public boolean equals(Object obj) { - - if (!(obj instanceof AIdRange)) { - return false; - } - - AIdRange other = (AIdRange)obj; - - if (values == null && other.values == null) { - - // Continuous range, check boundaries - if (minValue == other.minValue && maxValue == other.maxValue) { - return true; - } else { - return false; - } - - } else if (values == null) { - - // Continuous and discrete range - if (other.values.length == maxValue - minValue + 1 - && other.values[other.values.length-1] == maxValue - && other.values[0] == minValue) { - return true; - } else { - return false; - } - - } else if (other.values == null) { - - // Discrete and continuous range - if (values.length == other.maxValue - other.minValue + 1 - && values[values.length-1] == other.maxValue - && values[0] == other.minValue) { - return true; - } else { - return false; - } - - } else { - - // Discrete range, check length and individual entries - if (values.length != other.values.length) { - return false; - } else { - for (int i=0; i<values.length; i++) { - if (values[i] != other.values[i]) { - return false; - } - } - - return true; - } - } - } - - /** - * Check if the range specifies any values or not. - * @return true if the range is empty, false if not - */ - public boolean isEmpty() { - return values != null && values.length == 0; - } - - /** - * Hash code to facilitate lookups. - * @return hash - */ - @Override - public int hashCode() { - int hash = 7; - hash = 89 * hash + Arrays.hashCode(this.values); - hash = 89 * hash + this.minValue; - hash = 89 * hash + this.maxValue; - return hash; - } - - /** - * Merge the given range with the current one. - * @param other range to be added to the current range - * @return current range after new range has been added - * @throws AAtlantisException - */ - AIdRange add(AIdRange other) throws AAtlantisException { - - if (values == null && other.values == null) { - - // Both are continuous ranges, find min and max values. - minValue = Math.min(minValue, other.minValue); - maxValue = Math.max(maxValue, other.maxValue); - - } else if (values == null || other.values == null) { - - // One is continous, the other is discrete. - if (values == null) { - - if (other.values.length > 0) { - // If the discrete range is not empty, find min and max values. - minValue = Math.min(minValue, other.values[0]); - maxValue = Math.max(maxValue, other.values[other.values.length-1]); - } - - // If we add an empty range, there is nothing to be done. - - } else { - - if (values.length > 0) { - // If the discrete range is not empty, find min and max values. - minValue = Math.min(values[0], other.minValue); - maxValue = Math.max(values[values.length-1], other.maxValue); - values = null; - } else { - // if this is an empty range, copy min and max from the other. - minValue = other.minValue; - maxValue = other.maxValue; - values = null; - } - } - - } else { - - // Both ranges are discrete, count how many unique elements. - int numValues = values.length; - for (int value : other.values) { - if (!this.contains(value)) { - numValues++; - } - } - - // Merge two arrays, skipping duplicates and keeping order. - int[] newValues = new int[numValues]; - for (int i=0, j=0, k=0; i<numValues; i++) { - if (j == values.length) { - - newValues[i] = other.values[k++]; - - } else if (k == other.values.length) { - - newValues[i] = values[j++]; - - } else { - - if (this.values[j] == other.values[k]) { - newValues[i] = values[j++]; - k++; - } else if (values[j] < other.values[k]) { - newValues[i] = values[j++]; - } else { - newValues[i] = other.values[k++]; - } - } - } - - values = newValues; - } - - return this; - } - - /** - * Check the allowed values and return the number of bits needed to encode them. - * @return number of bits - */ - int bits() { - - // Cound how many values this field can have. - int numValues; - if (values != null) { - numValues = values.length; - } else { - numValues = maxValue - minValue + 1; - } - - if (numValues <= 2) { - // A field takes at least 1 bit, so return 1. - return 1; - } else { - // The number of bits required to store numValues different values. - return (int)(Math.ceil(Math.log(numValues) / Math.log(2))); - } - } - - /** - * Get the field value corresponding to the given range index. For example - * for a field that has range [ -2, 0, +2 ], get(0) will return -2. - * @param index, decoded from compact identifier - * @return field value - * @throws AAtlantisException - */ - int get(int index) throws AAtlantisException { - if (values != null) { - if (index < values.length) { - return values[index]; - } else { - throw new AAtlantisException("Invalid field index: " + index); - } - } else { - if (minValue + index <= maxValue) { - return minValue + index; - } else { - throw new AAtlantisException("Invalid field value: " + index); - } - } - } - - /** - * Convert the range into a convenient form for printing. - * @return formatted string representing range - */ - @Override - public String toString() { - StringBuilder s = new StringBuilder(); - s.append("[ "); - - if (values == null) { - if (parent != null && parent.hasLabels()) { - String minLabel = parent.getLabel(minValue); - String maxLabel = parent.getLabel(maxValue); - s.append(minLabel).append("=").append(minValue); - s.append(" -> ").append(maxLabel).append("=").append(maxValue); - } else { - s.append(minValue).append(" -> ").append(maxValue).append(" "); - } - } else { - for (int value : values) { - if (parent != null && parent.hasLabels()) { - String label = parent.getLabel(value); - s.append(label).append("=").append(value).append(" "); - } else { - s.append(value).append(" "); - } - } - } - s.append("]"); - return s.toString(); - } -} \ No newline at end of file diff --git a/graphics/AtlantisJava/src/atlantis/utils/AIntHashtable.java b/graphics/AtlantisJava/src/atlantis/utils/AIntHashtable.java deleted file mode 100755 index 04b0adbcd5f1b24adbb8c1699df10e47f7fe4ad6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AIntHashtable.java +++ /dev/null @@ -1,79 +0,0 @@ -package atlantis.utils; - - -// does not copy input arrays for efficiency -// these arrays must not be modified ! - -public class AIntHashtable { - - int size; - int shift; - int[] key; - int[] value; - int[] next; - int[] first; - - /* - public AIntHashtable(int size) { - this.size=size; - shift=0; - count = 0; - key = new int[size]; - value = new int[size]; - next = new int[size]; - first = new int[size]; - for (int i = 0; i < size; ++i) - first[i] = -1; - } - */ - - public AIntHashtable(int[] key, int[] value) { - this.size=key.length; - this.key=key; - this.value=value; - // - int mask=0; - for(int i=0; i<size; ++i) { - mask=mask|key[i]; - if((mask&1)==1) break; - } - shift=0; - for(int i=0; i<size; ++i) { - if((mask>>i&1)==1) break; - shift++; - } - // - next=new int[size]; - first=new int[size]; - for(int i=0; i<size; ++i) - first[i]=-1; - for(int i=0; i<size; ++i) { - int index=(key[i]>>shift)%size; - if(index<0) index=-index; - this.next[i]=first[index]; - first[index]=i; - } - } - - public AIntHashtable(int[] key) { - this(key, makeIndexArray(key.length)); - } - - private static int[] makeIndexArray(int length) { - int[] temp=new int[length]; - for(int i=0; i<length; ++i) - temp[i]=i; - return temp; - } - - public int get(int key) { - if(size<=0) return -1; - int index=(key>>shift)%size; - if(index<0) index=-index; - for(int e=first[index]; e!=-1; e=next[e]) - if(this.key[e]==key) - return value[e]; - return -1; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/ALogger.java b/graphics/AtlantisJava/src/atlantis/utils/ALogger.java deleted file mode 100644 index 3079c193173929d83fb0fc2fcc2c6643dd227892..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/ALogger.java +++ /dev/null @@ -1,213 +0,0 @@ -package atlantis.utils; - -import java.io.IOException; -import java.io.File; -import java.util.Properties; - -import org.apache.log4j.Logger; -import org.apache.log4j.Level; -import org.apache.log4j.PatternLayout; -import org.apache.log4j.PropertyConfigurator; -import org.apache.log4j.FileAppender; -import org.apache.log4j.ConsoleAppender; -import org.apache.log4j.Layout; - - - -/** - * The class is a common wrapper for logging facility, uses - * apache-logging library log4j (more complex and powerful than Java - * native java.util.logging (e.g. flushing is automated, allows customised - * message logs layout, different levels for different sources, etc). - * Because it is subclassing from Logger, it needs LoggerFactory mechanism - * to be in place. Reference to it is given via Properties, if more - * complex properties are to be defined, it will be put in a file (such - * properties file must be accessed generically so that it is load in - * correctly no matter whether Atlantis is run locally (and have distribution - * directories available) or from a .jar file (webstart execution). - * - * @author Zdenek Maxa - */ -public final class ALogger extends Logger -{ - // the class is a singleton, reference to itself - private static Logger root = null; - - // it's enough to instantiate a factory once and for all - private static ALoggerFactory loggerFactory = new ALoggerFactory(); - - // logging layouts definition (format characters explained at PatternLayout class) - private static final String CONSOLE_LOGGING_LAYOUT = - "%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %m%n"; - // %c - cathegory (must be specified at .getLogger(Class.class)) - private static final String FILE_LOGGING_LAYOUT = - "%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %m%n (%c thread:%t)%n"; - // contains some format characters which are slow - *only* for debugging - private static final String FILE_LOGGING_LAYOUT_FULL = - "%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %m%n (%c.%M() [line %L], thread:%t)%n"; - - - - // logging levels as defined in org.apache.log4j.Level - // this variable is used via a getter method to print out command - // line options help - private static String stringLevels = - Level.TRACE.toString() + ", " + // int value: 10000 - Level.DEBUG.toString() + ", " + // int value: 10000 - Level.INFO.toString() + ", " + // int value: 20000 - Level.WARN.toString() + ", " + // int value: 30000 - Level.ERROR.toString() + ", " + // int value: 30000 - Level.FATAL.toString(); // int value: 50000 - - // default logging level (if it wasn't specified or was incorrect) - private static Level defaultLevel = Level.INFO; - - - /** - * The constructor must be protected so that it is visible - * from ALoggerFactory. Should not be instantiated directly, but via - * .getInstance() - * @param name - */ - protected ALogger(String name) - { - super(name); - - } // ALogger() ---------------------------------------------------------- - - - - /** - * initialize(String[] options) - * Initializes the logger - * @param level severity level as read from the command line option - * @param destination destination to write logs to, as read from the command line - */ - public static void initialize(String level, String destination) - { - - // set logging level, if level contains nonsense, set default - Level currentLevel = Level.toLevel(level, defaultLevel); - - - // set properties - LogggerFactory - // log4j.loggerFactory=atlantis.utils.ALoggerFactory - // this may also be done via properties file (if necessary for - // more complex logging configuration without necessity to - // recompile). properties file is contains pairs key=value - // caution: must be accessed generically (so that it also - // works when atlantis is packed in a .jar file) - // without setting LoggerFactory - ClassCastException when getting - // Logger via ALogger.getLogger("Atlantis"); - Properties up = new Properties(); - up.setProperty("log4j.loggerFactory", - "atlantis.utils.ALoggerFactory"); - PropertyConfigurator.configure(up); - - // if instantiated this way - // logger = new ALogger(); - // -> NullPointerException when adding appender - - // all loggers created afterwards will have properties of this root logger - root = Logger.getRootLogger(); - - root.setLevel(currentLevel); - - - // logging will always be done to console (System.out - stdout) - - Layout consoleLayout = new PatternLayout(CONSOLE_LOGGING_LAYOUT); - ConsoleAppender ca = new ConsoleAppender(consoleLayout, - ConsoleAppender.SYSTEM_OUT); - ca.setImmediateFlush(true); - root.addAppender(ca); - - root.info("Logging to console (System.out) initialised"); - - // if a file was specified as logging destination, then logs - // will be duplicated to that file as well - if(destination != null) - { - // check if the file already exists - File f = new File(destination); - boolean fileExists = false; - if(f.exists()) - { - fileExists = true; - } - try - { - // some file was specified on the command line - Layout fileLayout = new PatternLayout(FILE_LOGGING_LAYOUT); - // if the file exists, it will be appended to - FileAppender fa = new FileAppender(fileLayout, destination); - fa.setImmediateFlush(true); - root.addAppender(fa); - if(fileExists) - { - String msg = "================================== " + - "Log file " + destination + " exists, " + - "opening it for appending"; - root.warn(msg); - } - root.warn("Logging to " + destination + " initialised"); - } - catch(IOException ex) - { - root.warn("Can't write log messages to: "+ destination); - } - } - - } // initialize() ------------------------------------------------------- - - - - public static ALogger getLogger(String name) - { - if(root != null) - { - return (ALogger) Logger.getLogger(name, loggerFactory); - } - else - { - // logger hasn't been initialised yet, initialise with - // default values (i.e. logging only to console with INFO level) - try - { - initialize(defaultLevel.toString(),null); - } - catch(Exception ex) - { - // this exception should never occur - ex.printStackTrace(); - } - return (ALogger) Logger.getLogger(name, loggerFactory); - } - - } // getLogger() -------------------------------------------------------- - - - - public static ALogger getLogger(Class clazz) - { - return ALogger.getLogger(clazz.getName()); - - } // getLogger() -------------------------------------------------------- - - - - public void forcedLog(String fqcn, Object msg, Throwable t) - { - super.forcedLog(fqcn, Level.ALL, msg, t); - - } // forcedLog() -------------------------------------------------------- - - - - public static String getStringLevels() - { - return stringLevels; - - } // getStringLevels() -------------------------------------------------- - -} // class ALogger ========================================================== diff --git a/graphics/AtlantisJava/src/atlantis/utils/ALoggerFactory.java b/graphics/AtlantisJava/src/atlantis/utils/ALoggerFactory.java deleted file mode 100644 index f4b5a772b9fa063361468cd4b63a47fe8edbde30..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/ALoggerFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -package atlantis.utils; - -import org.apache.log4j.Logger; -import org.apache.log4j.spi.LoggerFactory; - -/** - * LoggerFactory as used by ALogger - necessary when subclassing Logger - * @author Zdenek Maxa - */ -public class ALoggerFactory implements LoggerFactory -{ - - /** - * The constructor should be public as it will be called by - * configurators in different packages. - */ - public ALoggerFactory() { } - - - public Logger makeNewLoggerInstance(String name) - { - return new ALogger(name); - } - -} // class ALoggerFactory =================================================== diff --git a/graphics/AtlantisJava/src/atlantis/utils/AMath.java b/graphics/AtlantisJava/src/atlantis/utils/AMath.java deleted file mode 100755 index f52b826ab6537010e3ff6ad94328fe7d3cd78b32..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AMath.java +++ /dev/null @@ -1,328 +0,0 @@ -package atlantis.utils; - -import java.awt.geom.Point2D; - - -/** - * Contains generally useful constants and mathematical functions - * and functions for formatting - */ -public class AMath -{ - final public static double TWO_PI = 2. * Math.PI; - final public static double PI_BY_8 = Math.PI / 8.; - - // Constant giving the unicode value of a small Greek eta. - final static public String ETA = "\u03B7"; - // Constant giving the unicode value of a small Greek lambda. - final static public String LAMBDA = "\u03BB"; - // Unicode capital Lambda - final static public String LAMBDACAP = "\u039B"; - // Unicode lowercase gamma - final static public String GAMMA = "\u03B3"; - // Constant giving the unicode value of a small Greek rho. - final static public String RHO = "\u03C1"; - // Constant giving the unicode value of a small Greek phi. - // final static public String PHI = "\u03C6"; // small - final static public String PHI = "\u03A6"; // capital - // Constant giving the unicode value of degrees symbol. - final static public String DEGREES = "\u00B0"; - // Constant giving the unicode value of a capital Greek delta. - final static public String DELTA = "\u0394"; - // final static public String PRIME = "\u00b4"; - final static public String PRIME = "'"; - final static public String MICRO = "\u00b5"; - final static public String TIMES = "\u00d7"; - final static public String ASYMP = "\u2248"; - final static public String PROP = "\u221D"; - final static public String RADIC = "\u221A"; - - final static public String PLUSMINUS = "\u00b1"; - final static public String NOTEQUAL = "\u2260"; - final static public String LESSEQUAL = "\u2264"; - final static public String GREATEREQUAL = "\u2265"; - final static public String PION = "\u03C0"; - final static public String SIGMA = "\u03A3"; - final static public String TAU = "\u03C4"; - final static public String XI = "\u039E"; - final static public String OMEGA = "\u03A9"; - final static public String MU = "\u03BC"; - - final static public String RARROW = "\u279D"; // right arrow - final static public String DOT = "\u00b7"; // middle dot - - - /** - * Use the unicode overline diacritical mark to place an overline over the preceeding character - * - */ - final static public String OVERLINE = "\u0305"; - // superscript plus and minus - final static public String SUPPLUS = "\u207A"; - final static public String SUPMINUS = "\u207B"; - - - /** - * Returns eta with respect to z = 0. - * @param z double z coordinate - * @param rho double eta coordinate - * @return double eta - */ - public static double etaAbs(double z, double rho) { - double zrho = z / rho; - return Math.log(zrho + Math.sqrt(zrho * zrho + 1.)); - } - - public static double tanLambda(double eta) - { - double e = Math.exp(eta); - return 0.5 * (e-1./e); - } - - public static double lambda(double eta) - { - double e = Math.exp(eta); - return Math.atan(0.5 * (e-1./e)); - } - - public static double getPFromPttL(double pT, double tL) - { - return Math.abs(pT / Math.cos(Math.atan(tL))); - } - - public static double getPtFromPtL(double p, double tL) - { - return Math.abs(p * Math.cos(Math.atan(tL))); - } - - /** - * Force phi into range [0,360) degrees. - * @param phi angle in degrees - * @return equivalent angle in range [0,360) degrees - */ - public static double nearestPhiDegrees(double phi) - { - while(phi >= 360.) - { - phi -= 360; - } - while(phi < 0.) - { - phi += 360; - } - return phi; - } - - /** - * Force phi into range [0,2 pi) radians. - * @param phi angle in radians - * @return equivalent angle in range [0,2 pi) radians - */ - public static double nearestPhiRadians(double phi) - { - while(phi >= TWO_PI) - { - phi -= TWO_PI; - } - while(phi<0.) - { - phi += TWO_PI; - } - return phi; - } - - /** - * Force phi into range [phiMid-180,phiMid+360) degrees. - * @param phi angle in degrees - * @param phiMid mid-point of required phi range - * @return equivalent angle in range [phiMid-180,phiMid+360) degrees - */ - public static double nearestPhiDegrees(double phi, double phiMid) - { - while(phi-phiMid >= 180.) - { - phi -= 360; - } - while(phi-phiMid < -180.) - { - phi += 360; - } - return phi; - } - - /** - * Force phi into range [phiMid-pi,phiMid+pi) radians. - * @param phi angle in degrees - * @param phiMid phiMid mid-point of required phi range - * @return equivalent angle in range [phiMid-pi,phiMid+pi) radians - */ - public static double nearestPhiRadians(double phi, double phiMid) - { - while(phi - phiMid >= Math.PI) - { - phi -= TWO_PI; - } - while(phi - phiMid < -Math.PI) - { - phi += TWO_PI; - } - return phi; - } - - public static double[] splitLineIntoPieces(double[] input, int numPieces) - { - if(input.length != 2) - { - return input; - } - double[] output = new double[numPieces + 1]; - for(int p = 0; p < numPieces + 1; p++) - { - output[p] = input[0] + - (input[1] - input[0]) * (double) p / (double) numPieces; - } - return output; - } - -/** - * "Stretches" the values in the input array over a longer array. - * A number numPieces[i] of equally spaced values between input[i] and input[i+1] - * are put into the output array. So the numPieces array must have the same length - * as the input array, and the length of the output array is the sum of the - * elements of numPieces. For example: - * input = {0.0, 1.0, 5.0} numPieces = {2, 4, 1} - * output = {0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0} - * The output array must already exist and have the correct number of entries, - * otherwise this method will do nothin. - * Only used by ATGCData.getYXUser(). - * @param input array to stretch - * @param output stretched array - * @param numPieces number of output elements corresponding to each input element - */ - public static void splitArrayIntoPieces(double[] input, double[] output, int[] numPieces) - { - // Previously had "output = (double[]) input.clone();" but this is not - // passed back to the calling code so no point. - if(input.length != numPieces.length) return; - - int totalNumPieces = 0; - for (int num : numPieces) totalNumPieces += num; - if(totalNumPieces != output.length) return; - - int index = 0; - for(int i = 0; i < input.length; i++) { - int nextI = (i + 1) % input.length; // "loop back" to start of input - double start = input[i]; - double end = input[nextI]; - for(int p = 0; p < numPieces[i]; p++) - { - output[index++] = start + - (end - start) * (double) p / (double) numPieces[i]; - } - } - } - - /** - * Calculate angle between two 3-vectors represented by Point2D.Double - * objects. - * @param p1 - * @param p2 - * @return angle [radians] - */ - public static double getAngle(Point2D.Double p1, Point2D.Double p2) - { - double dx = p2.x - p1.x; - double dy = p2.y - p1.y; - return Math.atan2(dy, dx); - } - - public static Point2D.Double intersectionPoint( - Point2D.Double p1, Point2D.Double p2, Point2D.Double p3, Point2D.Double p4) - { - - double u = ((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x)) / - ((p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y)); - return new Point2D.Double(p1.x+u*(p2.x-p1.x), p1.y+u*(p2.y-p1.y)); - } - - public static Point2D.Double intersectionPoint( - Point2D.Double p1, AVector v1, Point2D.Double p3, AVector v3) - { - Point2D.Double p2 = new Point2D.Double(p1.x+v1.dx, p1.y+v1.dy); - Point2D.Double p4 = new Point2D.Double(p3.x+v3.dx, p3.y+v3.dy); - - return intersectionPoint(p1, p2, p3, p4); - } - - - public static double[] xBox(double x,double dx) - { - return new double[] {x-dx,x-dx,x+dx,x+dx}; - } - - public static double[] yBox(double y,double dy) - { - return new double[] {y-dy,y+dy,y+dy,y-dy}; - } - - /** - * Returns the sign of a double value. - * Unlike Math.signum() it never returns zero. - */ - public static double getSign(double value) { - return (value > 0) ? 1.0 : -1.0; - } - - /** - * Returns the sign of a int value. - * Unlike Math.signum() it never returns zero. - * - */ - public static int getSign(int value) { - return (value > 0) ? 1 : -1; - } - - public static float maxAbsInArray(float[] floatArray) - { - float maxAbs = Math.abs(floatArray[0]); - for(int i=1; i<floatArray.length; ++i) - { - maxAbs = Math.max(Math.abs(floatArray[i]), maxAbs); - } - return maxAbs; - } - - public static float minAbsInArray(float[] floatArray) - { - float minAbs = Math.abs(floatArray[0]); - for(int i=1; i<floatArray.length; ++i) - { - minAbs = Math.min(Math.abs(floatArray[i]), minAbs); - } - return minAbs; - } - - public static float minNonZeroAbsInArray(float[] floatArray) - { - float minAbs = Math.abs(floatArray[0]); - for(int i=1; i<floatArray.length; ++i) - { - if(minAbs == 0.0f && floatArray[i] != 0.0f) - minAbs = floatArray[i]; - else - minAbs = Math.min(Math.abs(floatArray[i]), minAbs); - } - return minAbs; - } - - public static float deltaR(float phi1, float eta1, float phi2, float eta2){ - - float deta=Math.abs(eta1-eta2); - float dphi=Math.abs(phi1-phi2); - if(dphi>Math.PI) - dphi=(float)(Math.PI*2.0f)-dphi; - float dr=(float)Math.sqrt(deta*deta+dphi*dphi); - return dr; - } - -} // class AMath ------------------------------------------------------------- diff --git a/graphics/AtlantisJava/src/atlantis/utils/ANewIdHelper.java b/graphics/AtlantisJava/src/atlantis/utils/ANewIdHelper.java deleted file mode 100644 index 5de597b66846b9fb444bfb6c421b6560e9317e6e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/ANewIdHelper.java +++ /dev/null @@ -1,157 +0,0 @@ -package atlantis.utils; - -import java.util.HashMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Helper tool for decoding compact readout channel identifiers. - * - * @author Eric Jansen - */ -public final class ANewIdHelper { - - /** Singleton instance. */ - private static ANewIdHelper instance = null; - - /** Link to ATLAS dictionary. */ - private AIdDictionary atlas = null; - - /** Collection of named (sub-)dictionaries. */ - private HashMap<String, AIdDictionary> dictionaries = null; - - /** Logging facility. */ - public static ALogger logger = ALogger.getLogger(ANewIdHelper.class); - - /** - * Static construct method, initializes ANewIdHelper from XML dictionaries. - * @param rootNode XML root node of type IdDict. - */ - public synchronized static void construct(Node rootNode) throws AAtlantisException { - if (instance == null) instance = new ANewIdHelper(); - try { - instance.initialize(rootNode); - } catch (AAtlantisException e) { - throw new AAtlantisException("Error initializing ANewIdHelper: " + e.getMessage()); - - } - } - - /** - * Obtain instance of ANewIdHelper. - * @return ANewIdHelper instance. - */ - public synchronized static ANewIdHelper instance() { - if (instance == null) { - throw new Error("Attempted to access ANewIdHelper instance before initialization."); - } - return instance; - } - - /** - * Private constructor. - */ - private ANewIdHelper() {}; - - /** - * Non-static, private initialization method. - * @param rootNode XML root node of type IdDict. - */ - private void initialize(Node rootNode) throws AAtlantisException { - NodeList nodes = rootNode.getChildNodes(); - for (int i=0; i<nodes.getLength(); i++) { - Node node = nodes.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - if ("IdDictionary".equals(node.getNodeName())) { - String name = node.getAttributes().getNamedItem("name").getNodeValue(); - try { - if (dictionaries != null && dictionaries.containsKey(name)) { - AIdDictionary dictionary = dictionaries.get(name); - dictionary.initialize(node); - } else { - if (dictionaries == null) { - dictionaries = new HashMap<String,AIdDictionary>(); - } - dictionaries.put(name, new AIdDictionary(node)); - } - } catch (AAtlantisException e) { - logger.error("Exception occurred while initializing IdHelper:" + e.getMessage()); - } - } - } - } - - if (dictionaries.containsKey("ATLAS")) { - atlas = dictionaries.get("ATLAS"); - } else { - throw new AAtlantisException("No 'ATLAS' dictionary found"); - } - } - - /** - * Check for presence of a named dictionary. - * @param dictName dictionary name. - * @return true if dictionary is present, false is not. - */ - boolean hasDictionary(String dictName) { - return dictionaries.containsKey(dictName); - } - - /** - * Return pointer to an existing named dictionary. - * @param dictName dictionary name - * @return dictionary object - */ - AIdDictionary getDictionary(String dictName) throws AAtlantisException { - if (dictionaries != null && dictionaries.containsKey(dictName)) { - return dictionaries.get(dictName); - } else { - throw new AAtlantisException("Dictionary " + dictName + " could not be found"); - } - } - - /** - * Add a named dictionary to the idHelper. - * @param dictName dictionary name - * @param dict dictionary - */ - void addDictionary(String dictName, AIdDictionary dict) { - if (dictionaries == null){ - dictionaries = new HashMap<String,AIdDictionary>(); - } - dictionaries.put(dictName, dict); - } - - /** - * Convert a compact identifier into a "/" delimited expanded identifier. - * @param id compact identifier - * @return expanded identifier, fields delimited by "/" - */ - public String getFullIdentifier(long id) throws AAtlantisException { - return atlas.getFullIdentifier(id); - } - - /** - * Extract named field from a compact identifier. - * @param field identifier field name - * @param id compact identifier - * @return value of named field - */ - public int get(String field, long id) throws AAtlantisException { - return atlas.get(field, id); - } - - /** - * Extract string value of a named field from a compact identifier. For - * example: - * get("stationName", id) = 49 - * getString("stationName", id) = "EIS" - * - * @param field identifier field name - * @param id compact identifier - * @return string value of named field - */ - public String getString(String field, long id) throws AAtlantisException { - return atlas.getString(field, id); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/APoint.java b/graphics/AtlantisJava/src/atlantis/utils/APoint.java deleted file mode 100755 index 38c9d1fd4adbcbf6251f68013aab47f5d577d2c6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/APoint.java +++ /dev/null @@ -1,72 +0,0 @@ -package atlantis.utils; - - -/** - * Used by APolygon and AClipPolygon in order to perform clipping. - */ -public class APoint { - - public double x, y; - - public APoint(APoint p) { - this.x=p.x; - this.y=p.y; - } - - public APoint(double x, double y) { - this.x=x; - this.y=y; - } - - public double dot_product(double[] normPoint) { - if(normPoint==null||normPoint.length!=3) - return 0.0; - else - return x*normPoint[0]+y*normPoint[1]; - } - - public APoint minus(APoint cgp) { - if(cgp==null) - return new APoint(this); - else - return new APoint(x-cgp.x, y-cgp.y); - } - - public APoint plus(APoint cgp) { - if(cgp==null) - return new APoint(this); - else - return new APoint(x+cgp.x, y+cgp.y); - } - - public void scalar_multiply(double d) { - x*=d; - y*=d; - } - - public boolean inside(double[] normalizedVector, double distance) { - if(normalizedVector==null||normalizedVector.length!=3) return false; - double k=dot_product(normalizedVector)+distance; - - return(k<=0); - } - - public double calculate_tls(APoint secondPoint, APoint clipNode, double[] normalized) { - APoint dv1, dv2; - - dv1=minus(clipNode); - dv2=secondPoint.minus(this); - return -(dv1.dot_product(normalized)/dv2.dot_product(normalized)); - } - - public APoint point_of_intersection(APoint second, double tls) { - if(second!=null) { - APoint v=second.minus(this); - - if(v!=null) v.scalar_multiply(tls); - return plus(v); - } else - return null; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/APolygon.java b/graphics/AtlantisJava/src/atlantis/utils/APolygon.java deleted file mode 100755 index 9a0c4e33bc3fa4487eb1be2bbd46978d1f2ee70d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/APolygon.java +++ /dev/null @@ -1,238 +0,0 @@ -package atlantis.utils; - - -import java.util.Vector; -import java.awt.geom.*; - - -/** - * Used in the process of clipping. - */ - -public class APolygon { - protected Vector nodes=new Vector(5, 10); - - public APolygon() {} - - public APolygon(double[] x, double[] y) { - for(int i=0; i<x.length; i++) - nodes.addElement(new APoint(x[i], y[i])); - - if(getSignedArea()<0) { - Vector newNodes=new Vector(5, 10); - - for(int i=nodes.size()-1; i>=0; i--) - newNodes.addElement(nodes.elementAt(i)); - nodes=newNodes; - } - } - - public void addPoint(double x, double y) { - nodes.addElement(new APoint(x, y)); - } - - public double getSignedArea() { - APoint p; - double[] x=new double[nodes.size()]; - double[] y=new double[nodes.size()]; - - for(int i=0; i<nodes.size(); i++) { - p=(APoint)nodes.elementAt(i); - x[i]=p.x; - y[i]=p.y; - } - - return getSignedArea(x, y); - } - - // this function returns the ABSOLUT VALUE of the area - public double getArea() { - return Math.abs(getSignedArea()); - } - - public static double getSignedArea(double[] x, double[] y) { - if(x.length!=y.length) - throw new Error("x.length != y.length"); - if(x.length==0) return 0; - - double s=0; - - for(int i=0; i<x.length-1; i++) - s+=x[i]*y[i+1]-x[i+1]*y[i]; - - s+=x[x.length-1]*y[0]-x[0]*y[x.length-1]; - return s/2; - } - - public static double getArea(double[] x, double[] y) { - return Math.abs(getSignedArea(x, y)); - } - - public static Point2D.Double getCenter(double[] x, double[] y, Point2D.Double p) { - if(x.length==0 || y.length==0) return null; - if(p==null) p=new Point2D.Double(0, 0); - - double s=0, v; - - for(int i=0; i<x.length-1; i++) { - v=x[i]*y[i+1]-x[i+1]*y[i]; - s+=v; - p.x+=(x[i]+x[i+1])*v; - p.y+=(y[i]+y[i+1])*v; - } - - v=x[x.length-1]*y[0]-x[0]*y[x.length-1]; - s+=v; - p.x+=(x[x.length-1]+x[0])*v; - p.y+=(y[x.length-1]+y[0])*v; - - double f=1/(6*s/2); - - p.setLocation(p.x*f, p.y*f); - return p; - } - - public static void scale(double[] x, double[] y, double factor) { - Point2D.Double center=APolygon.getCenter(x, y, null); - - for(int i=0; i<x.length; i++) { - x[i]=(x[i]-center.x)*factor+center.x; - y[i]=(y[i]-center.y)*factor+center.y; - } - } - - /* - public boolean isClockwise() { - if (getArea() < 0) - return true; - else - return false; - } - */ - - public APoint getNode(int index) { - if(index>=0&&index<nodes.size()) - return(APoint)(nodes.elementAt(index)); - else - return null; - } - - public int nrNodes() { - return nodes.size(); - } - - public boolean clip(AClipPolygon clipPolygon) { - int i=0; - int limit=clipPolygon.nrNodes(); - - APoint node=null; - double[] normalized=new double[3]; - double distance=0.0; - - for(i=0; i<limit; i++) { - normalized=clipPolygon.get_normalized(i); - node=clipPolygon.getNode(i); - distance=clipPolygon.get_distance(i); - if(normalized!=null&&node!=null&& !Double.isNaN(distance)) - s_h_clip_poly(normalized, node, distance); - } - - return(nodes.size()>0); - } - - public void s_h_clip_poly(double[] normalized, APoint node, double distance) { - int degree=nodes.size(); - APoint s=null, p=null, q=null; - boolean s_inside, p_inside; - double tls=0.0; - Vector keptNodes=new Vector(); - - if(degree>0&&nodes.elementAt(degree-1) instanceof APoint) - s=(APoint)nodes.elementAt(degree-1); - - for(int i=0; i<nodes.size(); i++) { - if(nodes.elementAt(i) instanceof APoint) { - p=(APoint)nodes.elementAt(i); - s_inside=s.inside(normalized, distance); - p_inside=p.inside(normalized, distance); - if(s_inside) - if(!p_inside) { - tls=s.calculate_tls(p, node, normalized); - q=s.point_of_intersection(p, tls); - keptNodes.addElement(q); - } else - keptNodes.addElement(p); - else if(p_inside) { - tls=s.calculate_tls(p, node, normalized); - q=s.point_of_intersection(p, tls); - keptNodes.addElement(q); - keptNodes.addElement(p); - } - } - s=p; - } - nodes=keptNodes; - } - - public double[][] getPolygon() { - int nrPoints=nodes.size(); - double[][] coord=new double[nrPoints][nrPoints]; - - if(nrPoints>0) - for(int i=0; i<nrPoints; i++) { - APoint aPoint=getNode(i); - - if(aPoint!=null) { - coord[0][i]=aPoint.x; - coord[1][i]=aPoint.y; - } - } - return coord; - } - - public double[] getX() { - int nrPoints=nodes.size(); - double[] coord=new double[nrPoints]; - - if(nrPoints>0) - for(int i=0; i<nrPoints; i++) { - APoint aPoint=getNode(i); - - if(aPoint!=null) - coord[i]=aPoint.x; - } - return coord; - } - - public double[] getY() { - int nrPoints=nodes.size(); - double[] coord=new double[nrPoints]; - - if(nrPoints>0) - for(int i=0; i<nrPoints; i++) { - APoint aPoint=getNode(i); - - if(aPoint!=null) - coord[i]=aPoint.y; - } - return coord; - } - - public String toString() { - StringBuilder s = new StringBuilder(); - int limit=nodes.size(); - - s.append("x:{ "); - for(int i=0; i<limit; i++) { - s.append(((APoint)nodes.elementAt(i)).x); - s.append(" :: "); - } - s.append(" }\ny:{ "); - for(int i=0; i<limit; i++) { - s.append(((APoint)nodes.elementAt(i)).y); - s.append(" :: "); - } - return s.toString(); - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/AUtilities.java b/graphics/AtlantisJava/src/atlantis/utils/AUtilities.java deleted file mode 100755 index 0c01e84f09947c8ef63649bb76ccc736e642d140..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AUtilities.java +++ /dev/null @@ -1,243 +0,0 @@ -package atlantis.utils; - -import java.io.FileNotFoundException; -import java.io.FileInputStream; -import java.io.InputStream; -import java.io.File; -import java.util.Date; -import java.text.SimpleDateFormat; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.RenderingHints; -import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; -import javax.swing.SwingUtilities; -import javax.swing.ImageIcon; - - -/** - * - * @author Gary Taylor, Zdenek Maxa - */ -public class AUtilities -{ - public static ALogger logger = ALogger.getLogger(AUtilities.class); - - private static final String dateFormat = "yyyy-MM-dd-HH-mm-ss"; - - - private AUtilities() - { - } // AUtilities() ------------------------------------------------------- - - - /** - * Allow Ctrl+click as alternative to right-click so can use single-button - * mouse on the Mac computer - */ - public static boolean isRightMouseButton(MouseEvent e) - { - return SwingUtilities.isRightMouseButton(e) || - e.isControlDown(); - - } // isRightMouseButton() ----------------------------------------------- - - /** - * Returns string with current data and time formatted according to - * dateFomat attribute (currently: yyyy-MM-dd-HH-mm-ss) - * @return String - */ - public static String getDateTimeString() - { - String r = null; - Date d = new Date(System.currentTimeMillis()); - SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); - r = sdf.format(d); - return r; - - } // getDateTimeString() ------------------------------------------------ - - - /** - * Returns last directory and file name from fullPath which is assumed to be - * some path to a file. This method assumes it is used when a file is retrieved - * from a .jar file. - * @param fullPath - */ - private static String getLastDirectoryAndFileName(String fullPath) - { - // if running on Windows, Atlantis.fileSep is '\', but accessing a .jar - // file uses '/' as file separator - so replace all '\' occurrences - // '/' (troubles when running via webstart (from jar file (/ as file - // separator) on windows (uses \ as file separator)) - logger.debug("Trying to extract last directory and filename, input: " + fullPath); - char[] charArray = fullPath.replaceAll("\\\\", "/").toCharArray(); - int sepOccurence = 0; // file separator (e.g. '/') occurrence counter - int i; - for(i = fullPath.length() - 1; i > 0; i--) - { - // compare only to '/', even on Windows '\' was already replaced - // by '/' - if(charArray[i] == '/') - { - sepOccurence++; - } - if(sepOccurence == 2) - { - // i variable now holds second file separator occurrence from end - break; - } - } - - String relPath = null; - - if(sepOccurence == 0) - { - logger.warn("No file separator found in the file path: " + fullPath); - relPath = fullPath; - } - else if(i == 0) - { - logger.warn("The path looks like relative path already, using: " + - fullPath); - relPath = fullPath; - } - else - { - relPath = new String(charArray).substring(i + 1); - logger.debug("Last directory and filename result: " + relPath); - } - - return relPath; - - } // getLastDirectoryAndFileName() -------------------------------------- - - - - /** - * Reads either locally (full path in fileName) or from atlantis.jar. Using - * this method for reading files makes Atlantis running either with runtime - * distribution directories (e.g. img, geometry, etc) or from .jar file - * (everything including runtime directories packed in a jar file) - * transparent. Having everything in .jar files is a requirement for - * running as Java WebStart. - * This method is used for files (text, xml) as InputStream. - * @param fileName - full path - */ - public static InputStream getFileAsStream(String fileName) throws AAtlantisException - { - InputStream is = null; - - if(fileName == null || "".equals(fileName)) - { - String m = "Input parameter fileName is null or empty"; - logger.debug(m); - throw new AAtlantisException(m); - } - - try - { - logger.debug("Trying to access file: " + fileName + " ..."); - is = new FileInputStream(fileName); - logger.debug("Reading " + fileName + " successful."); - } - catch(FileNotFoundException fnfe) - { - logger.warn(fileName + " not found, trying atlantis.jar ... "); - - // need to get file name and the last directory from the full path - String relPath = getLastDirectoryAndFileName(fileName); - - ClassLoader cl = AUtilities.class.getClassLoader(); - is = cl.getResourceAsStream(relPath); - if(is == null) - { - String m = fileName + " doesn't exist, reading " + relPath + - " from atlantis.jar failed."; - logger.error(m); - throw new AAtlantisException(m); - } - logger.debug(fileName + " reading from atlantis.jar successful."); - } - - return is; - - } // getFileAsStream() -------------------------------------------------- - - - - /** - * Reads either locally (full path in fileName) or from atlantis.jar. Using - * this method for reading files makes Atlantis running either with runtime - * distribution directories (e.g. img, geometry, etc) or from .jar file - * (everything including runtime directories packed in a jar file) - * transparent. Having everything in .jar files is a requirement for - * running as Java WebStart. - * This method is used for reading images. - * @param fileName - full path - */ - public static ImageIcon getFileAsImageIcon(String fileName) - { - - ImageIcon ii = null; - - if(fileName == null || "".equals(fileName)) - { - String m = "Input parameter fileName is null or empty, can't get ImageIcon"; - logger.debug(m); - return null; - } - - File test = new File(fileName); - if(test.exists() && test.canRead()) - { - ii = new ImageIcon(fileName); - logger.debug("Reading " + fileName + " successful."); - } - else - { - logger.debug(fileName + " not found, trying atlantis.jar ... "); - - // need to get file name and the last directory from the full path - String relPath = getLastDirectoryAndFileName(fileName); - - ClassLoader cl = AUtilities.class.getClassLoader(); - try { - ii = new ImageIcon(cl.getResource(relPath)); - logger.debug(fileName + " reading from atlantis.jar successful."); - } - catch (Throwable e) { - String m = "Failed to read "+ fileName + " from " + relPath + - " in atlantis.jar"; - logger.debug(m); - } - } - - return ii; - - } // getFileAsImageIcon() ----------------------------------------------- - - // Function used to rescale an Image and return an ImageIcon - // - public static ImageIcon scale(Image src, double scale, boolean antiAlias) { - int w = (int)(scale*src.getWidth(null)); - int h = (int)(scale*src.getHeight(null)); - int type = BufferedImage.TYPE_INT_ARGB; - BufferedImage dst = new BufferedImage(w, h, type); - Graphics2D g2 = dst.createGraphics(); - if(antiAlias) // Render png High Quality when AntiAliasing selected - { - g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); - g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); - } - else // else render it for speed. - { - g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); - g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); - } - g2.drawImage(src, 0, 0, w, h, null); - g2.dispose(); - return new ImageIcon(dst); - } // ------- scale() - -} // class AUtilities ======================================================= diff --git a/graphics/AtlantisJava/src/atlantis/utils/AVector.java b/graphics/AtlantisJava/src/atlantis/utils/AVector.java deleted file mode 100755 index 2d3f7b8c9769e893ab1bba47861089e2d22553c0..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/AVector.java +++ /dev/null @@ -1,84 +0,0 @@ -package atlantis.utils; - - -import java.awt.geom.Point2D; - - -/** - * Provides basic 2D vector operations. - */ - -public class AVector { - - public double dx, dy; - - public AVector(double dx, double dy) { - set(dx, dy); - } - - public AVector(double x1, double y1, double x2, double y2) { - set(x2-x1, y2-y1); - } - - public AVector(Point2D p1, Point2D p2) { - this(p1.getX(), p1.getY(), p2.getX(), p2.getY()); - } - - public AVector set(double dx, double dy) { - this.dx=dx; - this.dy=dy; - return this; - } - - public AVector getUnitary() { - double r=Math.sqrt(dx*dx+dy*dy); - - return new AVector(dx/r, dy/r); - } - - public AVector makeUnitary() { - double r=Math.sqrt(dx*dx+dy*dy); - - dx/=r; - dy/=r; - return this; - } - - public AVector rotate(double alpha) { - double sin=Math.sin(alpha); - double cos=Math.cos(alpha); - double dx_prime=dx*cos-dy*sin; - double dy_prime=dx*sin+dy*cos; - - dx=dx_prime; - dy=dy_prime; - return this; - } - - public AVector scale(double factor) { - dx*=factor; - dy*=factor; - return this; - } - - public AVector invert() { - dx*=-1; - dy*=-1; - return this; - } - - public double modulus() { - return Math.sqrt(dx*dx+dy*dy); - } - - public AVector add(AVector v) { - dx+=v.dx; - dy+=v.dy; - return this; - } - - public String toString() { - return "AVector[dx="+dx+", dy="+dy+"]"; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/package.html b/graphics/AtlantisJava/src/atlantis/utils/package.html deleted file mode 100644 index ba4e3fa430d35a5121c429c1ceed438865a495bd..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/package.html +++ /dev/null @@ -1,6 +0,0 @@ -<html> -<head></head> -<body> -<p>Helper classes.</p> -</body> -</html> diff --git a/graphics/AtlantisJava/src/atlantis/utils/xml/AArrayParser.java b/graphics/AtlantisJava/src/atlantis/utils/xml/AArrayParser.java deleted file mode 100755 index 027bd7e0f74d8dadf1db873e01997fab0a8d311b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/xml/AArrayParser.java +++ /dev/null @@ -1,36 +0,0 @@ -package atlantis.utils.xml; - -/** - * The superclass of Integer and Float array parsers used e.g. in parseing - * arrays stored in xml files - */ - -public abstract class AArrayParser -{ - protected int count; - protected int state; - protected int sign; - protected boolean finished; - - protected static final char space = ' '; - protected static final char cariage = '\n'; - protected static final char zero = '0'; - protected static final char nine = '9'; - protected static final char minus = '-'; - protected static final char plus = '+'; - protected static final char dot = '.'; - protected static final char smallExp = 'e'; - protected static final char bigExp = 'E'; - - public abstract void parse(char[] ch, int start, int end); - - public abstract Object getArray(); - - /** - * @return Returns the count. - */ - public int getCount() - { - return count; - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/xml/AFloatArrayParser.java b/graphics/AtlantisJava/src/atlantis/utils/xml/AFloatArrayParser.java deleted file mode 100755 index 413eb6ccc877fcbf9a8d14dee4a67956906ab2d3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/xml/AFloatArrayParser.java +++ /dev/null @@ -1,255 +0,0 @@ -package atlantis.utils.xml; - -/** - * The parser used to generate arrays of float values. - */ - -public class AFloatArrayParser extends AArrayParser -{ - private final static int SKIPPING_BLANKS = 0; - private final static int CHECKING_MINUS = 1; - private final static int CHECKING_INF1 = 2; - private final static int CHECKING_INF2 = 3; - private final static int CHECKING_INF3 = 4; - private final static int READING_INT = 5; - private final static int CHECKING_DOT = 6; - private final static int READING_FLOAT = 7; - private final static int CHECKING_EXP = 8; - private final static int CHECKING_EXP_SIGN = 9; - private final static int READING_EXP = 10; - private final static int FINISHING = 11; - private final static int IGNORE = 12; - - private static double[] powers = new double[200 * 2]; - private float[] array; - private float number = 0; - private int floatDigits = 0; - private int exp = 0; - private int expSign = 1; - private boolean isInf = false; - - static - { - for(int i = 0; i < 2 * 200; i++) - powers[i] = Math.pow(10, i - 200); - } - - public AFloatArrayParser(int size) - { - array = new float[size]; - count = 0; - if(size == 0) - state = IGNORE; - else - state = SKIPPING_BLANKS; - sign = 1; - } - - public void parse(char[] ch, int start, int length) - { - if(state == IGNORE) - { - finished = true; - return; - } - - int end = start + length; - nextChar: for(int i = start; i < end; i++) - { - char c = ch[i]; - thisChar: while(true) - { - - switch(state) - { - - case SKIPPING_BLANKS: - if(c == space || c == cariage) - continue nextChar; - else - { - finished = false; - state++; - continue thisChar; - } - - case CHECKING_MINUS: - if(c == minus) - { - sign = -1; - state++; - continue nextChar; - } - else - { - state++; - continue thisChar; - } - - case CHECKING_INF1: - if(c == 'i' || c == 'I') - { - state++; - continue nextChar; - } - else - { - state = READING_INT; - continue thisChar; - } - - case CHECKING_INF2: - if(c == 'n' || c == 'N') - { - state++; - continue nextChar; - } - else - { - state = FINISHING; - continue thisChar; - } - - case CHECKING_INF3: - if(c == 'f' || c == 'F') - { - state = FINISHING; - isInf = true; - continue nextChar; - } - else - { - state = FINISHING; - continue thisChar; - } - - case READING_INT: - if(c >= zero && c <= nine) - { - number = number * 10 + c - zero; - continue nextChar; - } - else - { - state++; - continue thisChar; - } - - case CHECKING_DOT: - if(c == dot) - { - state++; - continue nextChar; - } - else - { - state++; - continue thisChar; - } - - case READING_FLOAT: - if(c >= zero && c <= nine) - { - number = number * 10 + c - zero; - floatDigits++; - continue nextChar; - } - else - { - state++; - continue thisChar; - } - - case CHECKING_EXP: - if(c == smallExp || c == bigExp) - { - state++; - continue nextChar; - } - else - { - state = FINISHING; - continue thisChar; - } - - case CHECKING_EXP_SIGN: - if(c == minus) - { - expSign = -1; - state++; - continue nextChar; - } - if(c == plus) - { - expSign = +1; - state++; - continue nextChar; - } - else - { - state++; - continue thisChar; - } - - case READING_EXP: - if(c >= zero && c <= nine) - { - exp = exp * 10 + c - zero; - continue nextChar; - } - else - { - state++; - continue thisChar; - } - - case FINISHING: - if(c == space || c == cariage) - { - try - { - if(isInf) - { - if(sign == 1) - array[count] = Float.POSITIVE_INFINITY; - else - array[count] = Float.NEGATIVE_INFINITY; - isInf = false; - } - else - array[count] = (float) (number * sign * powers[expSign * exp - floatDigits + 200]); - } - catch(IndexOutOfBoundsException e) - { - // the real number of data is more than the - // expected number of data - throw new IndexOutOfBoundsException("more"); - } - state = SKIPPING_BLANKS; - sign = 1; - exp = 0; - expSign = 1; - floatDigits = 0; - number = 0; - count++; - finished = true; - continue nextChar; - } - else - { - throw new NumberFormatException("" + c); - } - } - } // while true - } // for - } - - public Object getArray() - { - if(!finished) - array[count] = (float) (number * sign * powers[expSign * exp - - floatDigits + 200]); - return array; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/xml/AIntArrayParser.java b/graphics/AtlantisJava/src/atlantis/utils/xml/AIntArrayParser.java deleted file mode 100755 index 74ed17a767f36405b617f38471af72746c84739b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/xml/AIntArrayParser.java +++ /dev/null @@ -1,126 +0,0 @@ -package atlantis.utils.xml; - -/** - * The parser used to generate arrays of integer values. - */ - -public class AIntArrayParser extends AArrayParser -{ - private final static int SKIPPING_BLANKS = 0; - private final static int CHECKING_MINUS = 1; - private final static int READING_INT = 2; - private final static int FINISHING = 3; - private final static int IGNORE = 4; - - private int[] array; - private long number = 0; - - public AIntArrayParser(int size) - { - array = new int[size]; - count = 0; - if(size == 0) - state = IGNORE; - else - state = SKIPPING_BLANKS; - sign = 1; - } - - public void parse(char[] ch, int start, int length) - { - if(state == IGNORE) - { - finished = true; - return; - } - - int end = start + length; - nextChar: for(int i = start; i < end; i++) - { - char c = ch[i]; - thisChar: while(true) - { - switch(state) - { - case READING_INT: - if(c >= zero && c <= nine) - { - number = number * 10 + c - zero; - continue nextChar; - } - else - { - state++; - continue thisChar; - } - case SKIPPING_BLANKS: - if(c == space || c == cariage) - continue nextChar; - else - { - finished = false; - state++; - continue thisChar; - } - case CHECKING_MINUS: - if(c == minus) - { - sign = -1; - state++; - continue nextChar; - } - else - { - state++; - continue thisChar; - } - case FINISHING: - if(c == space || c == cariage) - { - try - { - // This is a hack to make 64-bit identifiers work without - // using long internally. It works because for most - // identifiers only the most significant 32 bits are - // actually used. Proper support for 64-bit integer - // identifiers needs to be implemented asap (#618). - // -- EJ 09/2012 - if (number > Integer.MAX_VALUE && number >> 32 != 0) { - number = number >> 32; - } - array[count] = (int)number * sign; - } - catch(IndexOutOfBoundsException e) - { - // the real number of data is more than the - // expected number of data - throw new IndexOutOfBoundsException("more"); - } - number = 0; - count++; - sign = 1; - state = SKIPPING_BLANKS; - finished = true; - continue nextChar; - } - else - { - throw new NumberFormatException("" + c); - } - } - } // while true - } // for - } - - public Object getArray() - { - if(!finished) { - if (number > Integer.MAX_VALUE) { - number = number >> 32; - } - array[count] = (int)number * sign; - } - return array; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/xml/AStringArrayParser.java b/graphics/AtlantisJava/src/atlantis/utils/xml/AStringArrayParser.java deleted file mode 100755 index 1029bbb4a6c6147c85b2c7418a0ca20657ea158a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/xml/AStringArrayParser.java +++ /dev/null @@ -1,103 +0,0 @@ -package atlantis.utils.xml; - -/** - * The parser used to generate arrays of integer values. - */ - -public class AStringArrayParser extends AArrayParser -{ - private final static int SKIPPING_BLANKS = 0; - private final static int READING_STRING = 1; - private final static int FINISHING = 2; - private final static int IGNORE = 3; - - StringBuffer buffer; - private String[] array; - - public AStringArrayParser(int size) - { - array = new String[size]; - buffer = new StringBuffer(20); - count = 0; - if(size == 0) - state = IGNORE; - else - state = SKIPPING_BLANKS; - } - - public void parse(char[] ch, int start, int length) - { - if(state == IGNORE) - { - finished = true; - return; - } - - int end = start + length; - nextChar: for(int i = start; i < end; i++) - { - char c = ch[i]; - thisChar: while(true) - { - - switch(state) - { - - case READING_STRING: - if(!(c == space || c == cariage)) - { - buffer.append(c); - continue nextChar; - } - else - { - state++; - continue thisChar; - } - - case SKIPPING_BLANKS: - if(c == space || c == cariage) - continue nextChar; - else - { - finished = false; - state++; - continue thisChar; - } - - case FINISHING: - if(c == space || c == cariage) - { - try - { - array[count++] = new String(buffer); - } - catch(IndexOutOfBoundsException e) - { - // the real number of data is more than the - // expected number of data - throw new IndexOutOfBoundsException("more"); - } - - buffer.setLength(0); - state = SKIPPING_BLANKS; - finished = true; - continue nextChar; - } - else - { - throw new NumberFormatException("" + c); - } - } - } // while true - } // for - } - - public Object getArray() - { - if(!finished && array.length > 0) - array[count] = new String(buffer); - return array; - } - -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLEntityResolver.java b/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLEntityResolver.java deleted file mode 100644 index 0b7a7274a483f375f985ecd9b596902abf59f18c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLEntityResolver.java +++ /dev/null @@ -1,40 +0,0 @@ -package atlantis.utils.xml; - -import atlantis.utils.AAtlantisException; -import atlantis.utils.ALogger; -import atlantis.utils.AUtilities; -import java.io.IOException; -import java.io.InputStream; -import org.xml.sax.EntityResolver; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Entity resolver, used for relaying XML file includes to AUtilities. - * AUtilities.getFileAsStream() handles including files that are located in - * the webstart jar file. - * - * @author Eric Jansen - */ -public class AXMLEntityResolver implements EntityResolver { - - public static ALogger logger = ALogger.getLogger(AXMLEntityResolver.class); - - @Override - public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { - - InputStream input = null; - try { - if (systemId.startsWith("file://")) { - systemId = systemId.substring(7); - } - input = AUtilities.getFileAsStream(systemId); - } catch (AAtlantisException e) { - - logger.error("Could not resolve external entity" - +" '"+systemId+"': " + e.getMessage()); - } - - return new InputSource(input); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLErrorHandler.java b/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLErrorHandler.java deleted file mode 100755 index fddab8ec5dbd496f824e8a913ebb095f237f81b8..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLErrorHandler.java +++ /dev/null @@ -1,127 +0,0 @@ -package atlantis.utils.xml; - -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXParseException; - -import atlantis.utils.ALogger; - -/** - * Used in the XML processing code to catch and store the possible exceptions and errors. - */ -public class AXMLErrorHandler implements ErrorHandler { - - //the logger - private final ALogger logger = ALogger.getLogger(AXMLErrorHandler.class); - /** - * Thee different error states encountered in XML parsing - */ - public enum ErrorState { - - NO_ERROR, // no error - IGNORED_DATA, // the given data will be ignored - UNKNOWN_TAG, // unknown tag - INVALID_DATA, // the given data is not valid (e.g. string instead of int) - OTHER_ERROR, // some other error - FATAL_ERROR // some fatal error - event has to be aborted - } - - //Store the current error state - private ErrorState errorState = ErrorState.NO_ERROR; - //Store the exception causing the error - private Throwable cause = null; - - /** - * @return the current error state of the parser - */ - public ErrorState getErrorState() { - return errorState; - } - - /** - * @return the cause of the last error - */ - public Throwable getErrorCause(){ - return cause; - } - - /** - * Set the error state of the parser - * @param errorState The errorState to set. - * @param cause the cause of the error - */ - public void setError(ErrorState errorState, Throwable cause) { - - //check that the user had actually given a cause for all errors - if (cause == null && (errorState != ErrorState.NO_ERROR )) - throw new IllegalArgumentException("Cause can not be NULL"); - - this.errorState = errorState; - - //force cause null for NO_ERROR - if (errorState == ErrorState.NO_ERROR) - this.cause = null; - else - this.cause = cause; - } - - /** - * Handles all errors occurding during parsing - * @param exception the SAXParseException causing the error - */ - public void error(SAXParseException exception) { - - //Only keep the first error, ignore subsequents - if ( getErrorState() != ErrorState.NO_ERROR ) return; - - //Decode error from exception message (is there no better way?! - String errorMessage = exception.getMessage(); - - //Check for undeclared elements - if ( errorMessage.startsWith("Element type") && - errorMessage.indexOf("must be declared") >= 0) { - // an undeclared element is found in event file - // errorMessage - Element type "elementName" must be declared. - setError(ErrorState.UNKNOWN_TAG,exception); - return; - - } else if (errorMessage.startsWith("The content of element type") && - errorMessage.indexOf("must match") >= 0) { - /* errorMessage - The content of element type "elementName" must - match ... - - this error will occur if any undeclared element is found. - */ - setError(ErrorState.INVALID_DATA,exception); - return; - } else { - // an untreated error (e.g. undeclared attributes, etc.) - // supposed to be corrected by modifying event.dtd or retrievers - logger.error("Parsing XML in line " + exception.getLineNumber() + ": " + errorMessage); - setError(ErrorState.OTHER_ERROR,exception); - return; - } - - } - - /** - * Handle warning exceptions - * @param exception the SAX exception - */ - public void warning(SAXParseException exception) { - //Write a warning output, otherwise ignore - logger.warn("Parsing XML at position " + exception.getLineNumber() + ", " + exception.getColumnNumber() + " :: " + exception.getMessage()); - } - - /** - * Handle fatal exceptions - * @param exception the SAX exception - */ - public void fatalError(SAXParseException exception) { - //Only fatal exceptions are handled by global exception handler - String m = "Fatal error while parsing XML, line: " + - exception.getLineNumber() + " column: " + - exception.getColumnNumber() + " reason: " + - exception.getMessage(); - logger.fatal(m); - System.exit(1); - } -} diff --git a/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLUtils.java b/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLUtils.java deleted file mode 100755 index c745a47669039e56d335d06e82695cfaef47c387..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/atlantis/utils/xml/AXMLUtils.java +++ /dev/null @@ -1,38 +0,0 @@ -package atlantis.utils.xml; - - -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - - -/** - * Provides some basic XML utilities which are not present in the XML library. - */ -public class AXMLUtils -{ - public static Node getChild(Node node, String name) - { - NodeList childs = node.getChildNodes(); - - for (int i = 0; i < childs.getLength(); i++) - { - Node child = childs.item(i); - - if (child.getNodeType() == Node.ELEMENT_NODE) - { - if (child.getNodeName().equals(name)) - return child; - } - } - return null; - } - - public static String tryAttribut(NamedNodeMap attributes, String attName) - { - Node node = attributes.getNamedItem(attName); - - return (node != null) ? node.getNodeValue() : null; - } - -} diff --git a/graphics/AtlantisJava/src/overview.html b/graphics/AtlantisJava/src/overview.html deleted file mode 100644 index ebe0e3f52e9bb547b1fdd85cabdc8663010d33aa..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/src/overview.html +++ /dev/null @@ -1,25 +0,0 @@ -<html> -<head></head> -<body> - -<p>Atlantis is an event display for the ATLAS experiment at -CERN's Large Hadron Collider.</p> - -<p>The primary goals of the program are the visual investigation and - the understanding of the physics of complete events. Secondary goals - are to help develop reconstruction and analysis algorithms, to - facilitate debugging during commisioning and to provided a tool for - creating pictures and animations for publications, presentations and - exhibitions.</p> - -<p>Atlantis is based on the ALEPH event display DALI.</p> - -<p>Atlantis is written entirely in Java. JiveXML (event converter) is - a C++ interface between Atlantis and the Athena ATLAS offline SW - framework.</p> - -<p>Atlantis event visualisation is a fast, interactive and intuitive - application allowing study of complete ATLAS events.</p> - -</body> -</html> diff --git a/graphics/AtlantisJava/test/events/emptyEvent.xml b/graphics/AtlantisJava/test/events/emptyEvent.xml deleted file mode 100644 index 575abcaba0bfe509b29b99d1966c8035afaca86b..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/events/emptyEvent.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/xsl" href="JiveXML_event.xsl"?> -<?ATLAS Release: "dummy"?> -<!DOCTYPE Event SYSTEM "event.dtd"> -<Event version="dummy" runNumber="1" eventNumber="1" lumiBlock="1" dateTime="" eventProperty=""> -</Event> diff --git a/graphics/AtlantisJava/test/events/muonCollections.xml b/graphics/AtlantisJava/test/events/muonCollections.xml deleted file mode 100644 index c9281c94d4df32fc6336a930040cb08710046b04..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/events/muonCollections.xml +++ /dev/null @@ -1,240 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/xsl" href="JiveXML_event.xsl"?> -<?ATLAS Release: "dummy"?> -<!DOCTYPE Event SYSTEM "event.dtd"> -<Event version="dummy" runNumber="1" eventNumber="1" lumiBlock="1" dateTime="" eventProperty=""> - -<!-- Test event with two muon track collections, ConvertedMBoyMuonSpectroOnlyTracks and ConvertedMBoyTracks, - each containing two tracks. Edited down from JiveXML_105200_190249.xml. --> - -<Track count="2" storeGateKey="ConvertedMBoyMuonSpectroOnlyTracks"> - -<barcode> -0 0 -</barcode> -<chi2> -11.516 97.6254 -</chi2> -<cotTheta> --0.769442 1.26983 -</cotTheta> -<covMatrix multiple="15"> -19219.9 -213.586 22.2079 -47.5008 0.526573 0.135968 0.532181 -0.384001 -0.00148101 0.00808431 --0.0402467 0.104992 0.000158801 -0.00114179 0.00470875 54908.6 11775 4453.41 -220.818 -39.2807 -1.26332 -73.45 -46.6243 0.226787 0.609096 -77.0102 42.0205 0.986568 -0.892189 6.4339 - -</covMatrix> -<d0> -0 0 -</d0> -<driftSign multiple="36"> -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 -</driftSign> -<hits multiple="36"> -2100232864 2100236992 2100241088 2100245216 2100249472 2100249504 2100253568 2100253600 2100257728 2100261824 -1730609632 1730613760 1730617856 1730621984 1730626336 1730626368 1730630432 1730630464 1730634592 1730638688 -1647284976 1647284336 1647286000 1647285364 1646731264 1646731296 1646739744 1646743840 1646747968 1646748000 -1646772976 1646772272 1646774000 1646773300 1680278368 1680282464 1680286592 1680295072 1680299168 1680303296 -1680315180 1680314384 1618215712 1618219840 1618219872 1618223968 1618228096 1618228128 2035453088 2035451984 -1802240896 1802245024 1802245056 1802249152 1802253280 1802257568 1802261664 1802261696 1802265824 1802269952 -1651803772 1651803200 1651769920 1651774016 1651778144 1651786592 1651790688 1651794816 1651823224 1651822616 -1651823644 1684836392 -</hits> -<id> -0 1 -</id> -<isOutlier multiple="36"> -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 1 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 1 1 1 0 1 1 0 0 -0 0 -</isOutlier> -<nPixHits> -0 0 -</nPixHits> -<nSCTHits> -0 0 -</nSCTHits> -<nTRTHits> -0 0 -</nTRTHits> -<numDoF> -32 19 -</numDoF> -<numHits> -42 30 -</numHits> -<numPolyline> -42 30 -</numPolyline> -<phi0> --0.799777 2.98857 -</phi0> -<polylineX multiple="36"> -362.371 364.017 365.663 367.309 381.139 382.149 382.786 383.796 385.443 387.09 -415.16 416.809 418.457 420.106 433.955 434.965 435.605 436.614 438.264 439.914 -471.844 471.844 473.398 473.398 485.111 486.12 509.514 511.168 512.822 513.83 -519.096 519.096 520.65 520.65 646.788 648.447 650.105 674.583 676.242 677.902 -682.726 682.726 -477.38 -479.179 -480.655 -482.454 -484.254 -485.73 -578.526 -578.526 --594.877 -597.01 -598.693 -600.825 -602.958 -620.809 -622.98 -624.767 -626.938 -630.896 --683.109 -683.109 -690.955 -693.412 -695.868 -731.028 -733.561 -736.094 -744.69 -744.69 --746.92 -979.54 -</polylineX> -<polylineY multiple="36"> --372.719 -374.414 -376.108 -377.802 -392.037 -393.077 -393.732 -394.773 -396.468 -398.163 --427.056 -428.753 -430.451 -432.148 -446.404 -447.443 -448.102 -449.141 -450.839 -452.538 --485.408 -485.408 -487.007 -487.007 -499.066 -500.104 -524.189 -525.892 -527.594 -528.632 --534.054 -534.054 -535.654 -535.654 -665.539 -667.248 -668.956 -694.165 -695.875 -697.584 --702.553 -702.553 85.6237 85.754 85.8609 85.9913 86.1216 86.2285 88.9471 88.9471 -89.0356 89.0428 89.0486 89.0558 89.063 89.101 89.1036 89.1058 89.1083 89.1131 -89.1739 89.1739 89.1895 89.1953 89.2011 89.329 89.3419 89.3547 89.4028 89.4028 -89.4162 92.8672 -</polylineY> -<polylineZ multiple="36"> --392.694 -394.508 -396.321 -398.134 -413.36 -414.472 -415.172 -416.284 -418.096 -419.908 --450.754 -452.563 -454.373 -456.182 -471.371 -472.478 -473.179 -474.285 -476.093 -477.901 --512.838 -512.838 -514.536 -514.536 -527.329 -528.43 -553.946 -555.748 -557.549 -558.648 --564.384 -564.384 -566.076 -566.076 -702.92 -704.714 -706.508 -732.968 -734.761 -736.554 --741.766 -741.766 624.853 627.02 628.798 630.966 633.133 634.911 734.06 734.06 -749.096 750.985 752.476 754.365 756.254 771.538 773.328 774.802 776.592 779.856 -819.572 819.572 825.126 826.836 828.545 851.948 853.557 855.167 860.549 860.549 -861.929 979.729 -</polylineZ> -<pt> -55.8412 -1.03551 -</pt> -<trackAuthor> -9 9 -</trackAuthor> -<z0> --319.781 549.784 -</z0> -</Track> - -<Track count="2" storeGateKey="ConvertedMBoyTracks"> - -<barcode> -0 0 -</barcode> -<chi2> -11.516 97.6254 -</chi2> -<cotTheta> --0.770806 1.3117 -</cotTheta> -<covMatrix multiple="15"> -82352.8 -562.768 12126.3 -112.852 1.11282 0.199247 2.26463 -40.4407 -0.00427538 0.146613 --0.0227186 0.948083 0.00233271 -0.00250997 0.00411825 1.41767e+07 175813 5.07167e+07 -38589 17704.2 -133.741 5445.87 -130132 -66.2113 351.292 -4460.38 20560 25.2706 -57.2321 21.1558 - -</covMatrix> -<d0> -0.493352 11.5304 -</d0> -<driftSign multiple="36"> -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 -</driftSign> -<hits multiple="36"> -2100232864 2100236992 2100241088 2100245216 2100249472 2100249504 2100253568 2100253600 2100257728 2100261824 -1730609632 1730613760 1730617856 1730621984 1730626336 1730626368 1730630432 1730630464 1730634592 1730638688 -1647284976 1647284336 1647286000 1647285364 1646731264 1646731296 1646739744 1646743840 1646747968 1646748000 -1646772976 1646772272 1646774000 1646773300 1680278368 1680282464 1680286592 1680295072 1680299168 1680303296 -1680315180 1680314384 1618215712 1618219840 1618219872 1618223968 1618228096 1618228128 2035453088 2035451984 -1802240896 1802245024 1802245056 1802249152 1802253280 1802257568 1802261664 1802261696 1802265824 1802269952 -1651803772 1651803200 1651769920 1651774016 1651778144 1651786592 1651790688 1651794816 1651823224 1651822616 -1651823644 1684836392 -</hits> -<id> -0 1 -</id> -<isOutlier multiple="36"> -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 1 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 1 1 1 0 1 1 0 0 -0 0 -</isOutlier> -<nPixHits> -0 0 -</nPixHits> -<nSCTHits> -0 0 -</nSCTHits> -<nTRTHits> -0 0 -</nTRTHits> -<numDoF> -32 19 -</numDoF> -<numHits> -42 30 -</numHits> -<numPolyline> -42 30 -</numPolyline> -<phi0> --0.790721 2.76041 -</phi0> -<polylineX multiple="36"> -362.371 364.017 365.663 367.309 381.139 382.149 382.786 383.796 385.443 387.09 -415.16 416.809 418.457 420.106 433.955 434.965 435.605 436.614 438.264 439.914 -471.844 471.844 473.398 473.398 485.111 486.12 509.514 511.168 512.822 513.83 -519.096 519.096 520.65 520.65 646.788 648.447 650.105 674.583 676.242 677.902 -682.726 682.726 -477.38 -479.179 -480.655 -482.454 -484.254 -485.73 -578.526 -578.526 --594.877 -597.01 -598.693 -600.825 -602.958 -620.809 -622.98 -624.767 -626.938 -630.896 --683.109 -683.109 -690.955 -693.412 -695.868 -731.028 -733.561 -736.094 -744.69 -744.69 --746.92 -979.54 -</polylineX> -<polylineY multiple="36"> --372.719 -374.414 -376.108 -377.802 -392.037 -393.077 -393.732 -394.773 -396.468 -398.163 --427.056 -428.753 -430.451 -432.148 -446.404 -447.443 -448.102 -449.141 -450.839 -452.538 --485.408 -485.408 -487.007 -487.007 -499.066 -500.104 -524.189 -525.892 -527.594 -528.632 --534.054 -534.054 -535.654 -535.654 -665.539 -667.248 -668.956 -694.165 -695.875 -697.584 --702.553 -702.553 85.6237 85.754 85.8609 85.9913 86.1216 86.2285 88.9471 88.9471 -89.0356 89.0428 89.0486 89.0558 89.063 89.101 89.1036 89.1058 89.1083 89.1131 -89.1739 89.1739 89.1895 89.1953 89.2011 89.329 89.3419 89.3547 89.4028 89.4028 -89.4162 92.8672 -</polylineY> -<polylineZ multiple="36"> --392.694 -394.508 -396.321 -398.134 -413.36 -414.472 -415.172 -416.284 -418.096 -419.908 --450.754 -452.563 -454.373 -456.182 -471.371 -472.478 -473.179 -474.285 -476.093 -477.901 --512.838 -512.838 -514.536 -514.536 -527.329 -528.43 -553.946 -555.748 -557.549 -558.648 --564.384 -564.384 -566.076 -566.076 -702.92 -704.714 -706.508 -732.968 -734.761 -736.554 --741.766 -741.766 624.853 627.02 628.798 630.966 633.133 634.911 734.06 734.06 -749.096 750.985 752.476 754.365 756.254 771.538 773.328 774.802 776.592 779.856 -819.572 819.572 825.126 826.836 828.545 851.948 853.557 855.167 860.549 860.549 -861.929 979.729 -</polylineZ> -<pt> -58.6356 -3.08337 -</pt> -<trackAuthor> -9 9 -</trackAuthor> -<z0> -7.67828 -4.26881 -</z0> -</Track> -</Event> - diff --git a/graphics/AtlantisJava/test/events/muonCollections2.xml b/graphics/AtlantisJava/test/events/muonCollections2.xml deleted file mode 100644 index 36c046de320dc209bebd3467675719cf8758ae93..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/events/muonCollections2.xml +++ /dev/null @@ -1,291 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/xsl" href="JiveXML_event.xsl"?> -<?ATLAS Release: "dummy"?> -<!DOCTYPE Event SYSTEM "event.dtd"> - -<Event version="dummy" runNumber="2" eventNumber="2" lumiBlock="2" dateTime="" eventProperty=""> - -<!-- Test event with two muon track collections, ConvertedMBoyTracks and - ConvertedMuIdCBTracks, each containing 2 tracks. - Edited down from JiveXML_105200_190249.xml. ---> - -<Track count="2" storeGateKey="ConvertedMBoyTracks"> -<barcode> -0 0 -</barcode> -<chi2> -11.516 97.6254 -</chi2> -<cotTheta> --0.770806 1.3117 -</cotTheta> -<covMatrix multiple="15"> -82352.8 -562.768 12126.3 -112.852 1.11282 0.199247 2.26463 -40.4407 -0.00427538 0.146613 --0.0227186 0.948083 0.00233271 -0.00250997 0.00411825 1.41767e+07 175813 5.07167e+07 -38589 17704.2 -133.741 5445.87 -130132 -66.2113 351.292 -4460.38 20560 25.2706 -57.2321 21.1558 - -</covMatrix> -<d0> -0.493352 11.5304 -</d0> -<driftSign multiple="36"> -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 -</driftSign> -<hits multiple="36"> -2100232864 2100236992 2100241088 2100245216 2100249472 2100249504 2100253568 2100253600 2100257728 2100261824 -1730609632 1730613760 1730617856 1730621984 1730626336 1730626368 1730630432 1730630464 1730634592 1730638688 -1647284976 1647284336 1647286000 1647285364 1646731264 1646731296 1646739744 1646743840 1646747968 1646748000 -1646772976 1646772272 1646774000 1646773300 1680278368 1680282464 1680286592 1680295072 1680299168 1680303296 -1680315180 1680314384 1618215712 1618219840 1618219872 1618223968 1618228096 1618228128 2035453088 2035451984 -1802240896 1802245024 1802245056 1802249152 1802253280 1802257568 1802261664 1802261696 1802265824 1802269952 -1651803772 1651803200 1651769920 1651774016 1651778144 1651786592 1651790688 1651794816 1651823224 1651822616 -1651823644 1684836392 -</hits> -<id> -0 1 -</id> -<isOutlier multiple="36"> -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 1 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 1 1 1 0 1 1 0 0 -0 0 -</isOutlier> -<nPixHits> -0 0 -</nPixHits> -<nSCTHits> -0 0 -</nSCTHits> -<nTRTHits> -0 0 -</nTRTHits> -<numDoF> -32 19 -</numDoF> -<numHits> -42 30 -</numHits> -<numPolyline> -42 30 -</numPolyline> -<phi0> --0.790721 2.76041 -</phi0> -<polylineX multiple="36"> -362.371 364.017 365.663 367.309 381.139 382.149 382.786 383.796 385.443 387.09 -415.16 416.809 418.457 420.106 433.955 434.965 435.605 436.614 438.264 439.914 -471.844 471.844 473.398 473.398 485.111 486.12 509.514 511.168 512.822 513.83 -519.096 519.096 520.65 520.65 646.788 648.447 650.105 674.583 676.242 677.902 -682.726 682.726 -477.38 -479.179 -480.655 -482.454 -484.254 -485.73 -578.526 -578.526 --594.877 -597.01 -598.693 -600.825 -602.958 -620.809 -622.98 -624.767 -626.938 -630.896 --683.109 -683.109 -690.955 -693.412 -695.868 -731.028 -733.561 -736.094 -744.69 -744.69 --746.92 -979.54 -</polylineX> -<polylineY multiple="36"> --372.719 -374.414 -376.108 -377.802 -392.037 -393.077 -393.732 -394.773 -396.468 -398.163 --427.056 -428.753 -430.451 -432.148 -446.404 -447.443 -448.102 -449.141 -450.839 -452.538 --485.408 -485.408 -487.007 -487.007 -499.066 -500.104 -524.189 -525.892 -527.594 -528.632 --534.054 -534.054 -535.654 -535.654 -665.539 -667.248 -668.956 -694.165 -695.875 -697.584 --702.553 -702.553 85.6237 85.754 85.8609 85.9913 86.1216 86.2285 88.9471 88.9471 -89.0356 89.0428 89.0486 89.0558 89.063 89.101 89.1036 89.1058 89.1083 89.1131 -89.1739 89.1739 89.1895 89.1953 89.2011 89.329 89.3419 89.3547 89.4028 89.4028 -89.4162 92.8672 -</polylineY> -<polylineZ multiple="36"> --392.694 -394.508 -396.321 -398.134 -413.36 -414.472 -415.172 -416.284 -418.096 -419.908 --450.754 -452.563 -454.373 -456.182 -471.371 -472.478 -473.179 -474.285 -476.093 -477.901 --512.838 -512.838 -514.536 -514.536 -527.329 -528.43 -553.946 -555.748 -557.549 -558.648 --564.384 -564.384 -566.076 -566.076 -702.92 -704.714 -706.508 -732.968 -734.761 -736.554 --741.766 -741.766 624.853 627.02 628.798 630.966 633.133 634.911 734.06 734.06 -749.096 750.985 752.476 754.365 756.254 771.538 773.328 774.802 776.592 779.856 -819.572 819.572 825.126 826.836 828.545 851.948 853.557 855.167 860.549 860.549 -861.929 979.729 -</polylineZ> -<pt> -58.6356 -3.08337 -</pt> -<trackAuthor> -9 9 -</trackAuthor> -<z0> -7.67828 -4.26881 -</z0> -</Track> - - -<Track count="2" storeGateKey="ConvertedMuIdCBTracks"> - -<barcode> -0 0 -</barcode> -<chi2> -42.814 49.7505 -</chi2> -<cotTheta> --0.771556 1.27815 -</cotTheta> -<covMatrix multiple="15"> -0.00826928 0.00161205 0.524101 -0.000787796 -0.000158775 9.16577e-05 -9.49e-05 -0.0391607 1.23985e-05 0.00336271 --0.00155346 -0.000959667 0.000188491 8.20954e-05 0.00144041 0.169634 -0.0124204 0.789371 -0.0337235 0.00136704 -0.00730118 0.0015583 -0.128944 -0.000194753 0.02396 -0.0501037 0.0144917 0.0149698 -0.00297823 0.352475 - -</covMatrix> -<d0> -0.089879 -0.11419 -</d0> -<driftSign multiple="75.5"> -0 0 0 0 0 0 0 0 0 0 -0 1 1 -1 1 -1 -1 -1 -1 -1 --1 1 -1 -1 1 1 -1 1 -1 -1 --1 -1 1 1 -1 1 -1 1 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 -1 -1 -1 -1 --1 -1 -1 1 1 1 -1 -1 -1 1 --1 1 -1 -1 -1 -1 -1 1 1 1 --1 -1 -1 1 -1 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 -</driftSign> -<hits multiple="75.5"> -2725184265 2888627033 3047989021 168699032 168697991 171025537 171024522 173350018 173348972 175676530 -175675510 331359616 331360672 331361728 331362752 331364832 331384384 331386400 331388416 331390464 -331392480 331395520 331396544 331398560 331399584 331401600 331405664 331416928 331419008 331422144 -331424224 331427360 331428384 331430464 331432576 331433600 331435680 331436736 2100232864 2100236992 -2100241088 2100245216 2100249472 2100249504 2100253568 2100253600 2100257728 2100261824 1730609632 1730613760 -1730617856 1730621984 1730626336 1730630432 1730630464 1730634592 1730638688 1647286000 1647285364 1646731264 -1646731296 1646739744 1646743840 1646747968 1646748000 1646773300 1646774000 1680278368 1680282464 1680286592 -1680295072 1680299168 1680303296 1680314384 1680315180 2706406253 2855456339 3002378023 168253015 168251976 -170483061 170482036 172713122 172712111 174909133 174908084 383784512 383786592 383788640 383789664 -383790720 383791680 383792736 383793760 383812192 383814272 383816288 383818368 383820416 383821440 -383822496 383823520 383825536 383827616 383846048 383848128 383850144 383851168 383853216 383855296 -383857312 383859392 383877824 383882944 383885024 1618215712 1618219840 1618219872 1618223968 1618228096 -1618228128 2035453096 2035451984 1802240896 1802245024 1802245056 1802249152 1802253280 1802257568 1802261664 -1802261696 1802265824 1802269952 1651803772 1651803200 1651769920 1651774016 1651778144 1651786592 1651790688 -1651794816 1651823224 1651823644 1684800672 1684804768 1684808896 1684817248 1684821312 1684825440 1684838064 -1684837408 -</hits> -<id> -0 1 -</id> -<isOutlier multiple="75.5"> -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 1 1 1 1 1 -1 0 0 0 0 0 0 0 0 0 -0 0 1 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 -</isOutlier> -<nPixHits> -3 3 -</nPixHits> -<nSCTHits> -8 8 -</nSCTHits> -<nTRTHits> -27 29 -</nTRTHits> -<numDoF> -73 67 -</numDoF> -<numHits> -75 76 -</numHits> -<numPolyline> -75 76 -</numPolyline> -<phi0> --0.792403 2.83724 -</phi0> -<polylineX multiple="75.5"> -3.76812 6.33631 8.61433 21.2214 21.2854 26.2311 26.295 31.4707 31.5345 36.4392 -36.5029 44.1987 44.685 45.1907 45.675 46.6756 49.9041 50.7914 51.6869 52.5953 -53.5071 54.8868 55.3573 56.2911 56.7603 57.7053 59.6133 61.3182 62.2339 63.6216 -64.5559 65.9688 66.4364 67.3895 68.3545 68.8261 69.7947 70.2729 361.985 363.632 -365.28 366.928 380.774 381.786 382.423 383.434 385.083 386.732 414.834 416.484 -418.135 419.786 433.65 435.302 436.313 437.964 439.616 471.581 472.359 484.864 -485.874 509.294 510.949 512.605 513.614 519.664 519.664 646.717 648.378 650.038 -674.541 676.203 677.864 682.699 682.699 -4.69928 -8.49491 -11.7275 -28.6103 -28.6966 --35.5786 -35.6658 -43.2266 -43.3145 -49.3888 -49.4759 -62.7019 -63.94 -65.41 -66.0181 --66.6494 -67.4119 -68.0438 -68.6522 -70.5337 -71.7754 -73.1723 -74.4154 -75.8909 -76.4981 --77.1352 -77.7425 -79.1421 -80.3877 -82.3188 -83.5658 -84.9682 -85.5738 -87.0543 -88.3031 --89.7074 -90.9573 -92.824 -96.0854 -97.3375 -477.031 -478.837 -480.315 -482.129 -483.948 --485.428 -578.457 -578.457 -594.879 -597.008 -598.688 -600.823 -602.96 -620.821 -622.986 --624.768 -626.94 -630.918 -683.109 -683.109 -691.068 -693.535 -696.015 -731.403 -733.952 --736.508 -744.69 -745.805 -927.496 -930.236 -932.976 -967.838 -969.536 -972.29 -979.54 --980.655 -</polylineX> -<polylineY multiple="75.5"> --3.69527 -6.30342 -8.61847 -21.4575 -21.5229 -26.5724 -26.6377 -31.9298 -31.995 -37.0174 --37.0826 -44.9778 -45.4772 -45.9968 -46.4943 -47.5225 -50.8422 -51.7552 -52.6767 -53.6118 --54.5506 -55.9717 -56.4564 -57.4187 -57.9022 -58.8765 -60.8442 -62.6033 -63.5486 -64.9814 --65.9465 -67.4063 -67.8896 -68.8748 -69.8726 -70.3604 -71.3623 -71.8571 -373.106 -374.798 --376.49 -378.183 -392.402 -393.442 -394.096 -395.135 -396.828 -398.522 -427.384 -429.079 --430.774 -432.47 -446.71 -448.406 -449.444 -451.141 -452.837 -485.67 -486.469 -499.314 --500.351 -524.41 -526.11 -527.811 -528.848 -535.063 -535.063 -665.602 -667.309 -669.015 --694.196 -695.903 -697.61 -702.579 -702.579 1.57025 2.70537 3.64723 8.20767 8.22939 -9.91078 9.93148 11.6655 11.6851 12.9935 13.0117 15.5953 15.8191 16.081 16.1881 -16.2985 16.4308 16.5395 16.6435 16.9605 17.1658 17.3931 17.5922 17.8246 17.9191 -18.0174 18.1104 18.3221 18.5071 18.7879 18.9655 19.1617 19.2453 19.4468 19.6134 -19.7969 19.9571 20.1911 20.5846 20.7305 72.212 72.4473 72.6375 72.8677 73.0952 -73.2777 81.2266 81.2266 82.1853 82.3048 82.3986 82.5175 82.6355 83.5933 83.7065 -83.7992 83.9127 84.1196 86.7554 86.7554 87.1596 87.2851 87.4124 89.2493 89.3834 -89.5192 89.9559 90.0156 100.839 101.018 101.197 103.504 103.618 103.802 104.29 -104.366 -</polylineY> -<polylineZ multiple="75.5"> -3.50153 0.677387 -1.82855 -15.7119 -15.7825 -21.2359 -21.3064 -27.0176 -27.088 -32.5043 --32.5746 -41.0812 -41.619 -42.1784 -42.7141 -43.821 -47.3938 -48.3761 -49.3675 -50.3733 --51.383 -52.9113 -53.4324 -54.4669 -54.9867 -56.034 -58.1486 -60.0387 -61.0541 -62.5931 --63.6294 -65.1968 -65.7157 -66.7733 -67.8442 -68.3677 -69.4429 -69.9738 -392.695 -394.508 --396.321 -398.134 -413.359 -414.471 -415.172 -416.284 -418.095 -419.907 -450.752 -452.562 --454.371 -456.181 -471.369 -473.178 -474.284 -476.092 -477.9 -512.837 -513.686 -527.328 --528.429 -553.945 -555.747 -557.549 -558.648 -565.23 -565.23 -702.927 -704.721 -706.516 --732.978 -734.772 -736.565 -741.784 -741.784 13.9188 18.9826 23.283 45.5935 45.7069 -54.7381 54.8523 64.7366 64.8514 72.7677 72.881 90.0479 91.6506 93.5526 94.3391 -95.1555 96.1413 96.9581 97.7443 100.175 101.778 103.581 105.185 107.087 107.87 -108.691 109.474 111.277 112.881 115.367 116.972 118.776 119.555 121.458 123.063 -124.868 126.473 128.87 133.055 134.661 625.142 627.308 629.076 631.238 633.399 -635.154 734.06 734.06 749.091 750.989 752.48 754.369 756.247 771.525 773.326 -774.801 776.589 779.835 819.417 819.417 824.967 826.666 828.354 851.354 852.938 -854.512 859.492 860.163 951.515 952.693 953.866 968.469 969.167 970.296 973.262 -973.717 -</polylineZ> -<pt> -59.5287 -3.02081 -</pt> -<trackAuthor> -1 1 -</trackAuthor> -<z0> -7.57297 7.58689 -</z0> -</Track> - -</Event> diff --git a/graphics/AtlantisJava/test/events/rvxEvent.xml b/graphics/AtlantisJava/test/events/rvxEvent.xml deleted file mode 100644 index 21c7b7ca07e5a960a0d514b4ca836ffe747a5e3a..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/events/rvxEvent.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/xsl" href="JiveXML_event.xsl"?> -<?ATLAS Release: "dummy"?> -<!DOCTYPE Event SYSTEM "event.dtd"> -<Event version="dummy" runNumber="1" eventNumber="1" lumiBlock="1" dateTime="" eventProperty=""> - -<RVx count="4" storeGateKey=""> - -<chi2> -13.3549 13.3549 0.979663 0.979663 -</chi2> -<covMatrix multiple="6"> -3145 1516.27 739.31 230.495 111.531 34.7901 3145 1516.27 739.31 230.495 -111.531 34.7901 0.0057955 0.00580698 0.0161258 0.00385126 0.0066793 0.172986 0.0057955 0.00580698 -0.0161258 0.00385126 0.0066793 0.172986 -</covMatrix> -<numTracks> -2 2 29 0 -</numTracks> -<primVxCand> -2 2 1 0 -</primVxCand> -<sgkey> -TrackParticleCandidate TrackParticleCandidate TrackParticleCandidate TrackParticleCandidate -</sgkey> -<tracks multiple="8.25"> -41 33 41 33 0 1 2 3 4 5 -6 7 8 9 10 11 12 13 14 15 -16 17 18 19 20 21 22 23 24 25 -26 27 28 -</tracks> -<x> -35.1249 35.1249 -0.0114638 -0.0114638 -</x> -<y> -18.3795 18.3795 0.0945006 0.0945006 -</y> -<z> -7.44812 7.44812 5.03257 5.03257 -</z> -</RVx> - - -</Event> diff --git a/graphics/AtlantisJava/test/events/rvxInconsistentEvent.xml b/graphics/AtlantisJava/test/events/rvxInconsistentEvent.xml deleted file mode 100644 index 3c745253f7cef70d7250f664801ccc25ed554beb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/events/rvxInconsistentEvent.xml +++ /dev/null @@ -1,258 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/xsl" href="JiveXML_event.xsl"?> -<?ATLAS Release: "dummy"?> -<!DOCTYPE Event SYSTEM "event.dtd"> -<Event version="dummy" runNumber="1" eventNumber="1" lumiBlock="1" dateTime="" eventProperty=""> - -<RVx count="4" storeGateKey=""> - -<chi2> -13.3549 13.3549 0.979663 0.979663 -</chi2> -<covMatrix multiple="6"> -3145 1516.27 739.31 230.495 111.531 34.7901 3145 1516.27 739.31 230.495 -111.531 34.7901 0.0057955 0.00580698 0.0161258 0.00385126 0.0066793 0.172986 0.0057955 0.00580698 -0.0161258 0.00385126 0.0066793 0.172986 -</covMatrix> -<numTracks> -2 2 29 0 -</numTracks> -<primVxCand> -2 2 1 0 -</primVxCand> -<sgkey> -TrackParticleCandidate TrackParticleCandidate TrackParticleCandidate TrackParticleCandidate -</sgkey> -<tracks multiple="544.5"> --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 41 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 33 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 41 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 33 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 0 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 2 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 3 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 4 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 5 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 6 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 7 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -8 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 9 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 10 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 11 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 12 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 13 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 14 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 15 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 16 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 17 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -18 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 19 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 20 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 21 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 22 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 23 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 24 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 25 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 26 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 27 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -28 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -1 -1 --1 -1 -1 -1 -1 -1 -1 -1 -</tracks> -<x> -35.1249 35.1249 -0.0114638 -0.0114638 -</x> -<y> -18.3795 18.3795 0.0945006 0.0945006 -</y> -<z> -7.44812 7.44812 5.03257 5.03257 -</z> -</RVx> - - -</Event> diff --git a/graphics/AtlantisJava/test/src/atlantis/AtlantisHeadlessTestCase.java b/graphics/AtlantisJava/test/src/atlantis/AtlantisHeadlessTestCase.java deleted file mode 100644 index 25f0a50137d3b0ad4fd220b57dded3ee7e34090d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/AtlantisHeadlessTestCase.java +++ /dev/null @@ -1,38 +0,0 @@ -package atlantis; - - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; - -import testutils.TeeOutputStream; -import testutils.TestUtils; - -public class AtlantisHeadlessTestCase { - ByteArrayOutputStream stdOutCopy = new ByteArrayOutputStream(); - protected String eventFileName = null; // Event file to give on the command line - - /** Start Atlantis in headless mode. - */ - protected void startHeadlessMode() { - // Redirect standard output to ByteArrayOutputStream as well as normal System.out - TeeOutputStream teeOut = new TeeOutputStream(System.out,stdOutCopy); - System.setOut(new PrintStream(teeOut)); - - String atlantisHomeDir = Atlantis.getHomeDirectory(); - String testEventsDir = atlantisHomeDir+"/test/events"; - TestUtils.setPropertyIfNotSet("atlantis.test.events",testEventsDir); - - System.setProperty("java.awt.headless", "true"); - String[] args = {"--debug","DEBUG"}; - if (eventFileName!=null) { - String[] newArgs = new String[args.length+1]; - for (int i=0; i<args.length; ++i) { - newArgs[i] = args[i]; - } - String eventsDirectory = System.getProperty("atlantis.test.events"); - newArgs[args.length] = eventsDirectory+"/"+eventFileName; - args = newArgs; - } - Atlantis.main(args); - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/HeadlessTest.java b/graphics/AtlantisJava/test/src/atlantis/HeadlessTest.java deleted file mode 100644 index 759ea917c954392ab86df6b1b622cb6fcef64b1e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/HeadlessTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package atlantis; - -import org.fest.swing.timing.Condition; -import org.junit.Test; -import static org.fest.swing.timing.Pause.pause; -import static org.fest.swing.timing.Timeout.timeout; - -public class HeadlessTest extends AtlantisHeadlessTestCase { - - @Test - /** Start Atlantis in headless mode and make sure it doesn't crash part-way through. - * Atlantis.initAtlantis catches all Exceptions so we check for "Atlantis Ready" in - * the output console. - */ - public void testHeadlessMode() { - startHeadlessMode(); - pause(new Condition("output to contain \"Atlantis Ready\"") { - public boolean test() {return stdOutCopy.toString().contains("Atlantis Ready");} - },timeout(10000)); - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/InconsistentEventTest.java b/graphics/AtlantisJava/test/src/atlantis/InconsistentEventTest.java deleted file mode 100644 index 5dbfffcd532b105fdd8b830fc6eb4e068b87cc43..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/InconsistentEventTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package atlantis; - -import static org.fest.swing.timing.Pause.pause; -import static org.fest.swing.timing.Timeout.timeout; -import static org.junit.Assert.*; - -import org.fest.swing.timing.Condition; -import org.junit.Before; -import org.junit.Test; - -/** - * Test for bug#556, where a JiveXML file from Atlas release 17 causes an error - * on startup when the file is given on the command line, though not when it is - * opened after Atlantis has started. - * - * @author waugh - * - */ -public class InconsistentEventTest extends AtlantisHeadlessTestCase { - @Before - public void setUp() { - eventFileName = "rel17vtxEvent.xml"; - System.setProperty("java.awt.headless", "true"); - startHeadlessMode(); - } - - @Test - public void loadEvent() { - pause(new Condition("output to contain \"Atlantis Ready\"") { - public boolean test() {return stdOutCopy.toString().contains("Atlantis Ready");} - },timeout(10000)); - String output = stdOutCopy.toString(); - assertTrue("Could not find or parse event ",output.contains("Parsing event")); - assertFalse("Error reading event",output.contains("Can not read events")); - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/NoTracksElementTest.java b/graphics/AtlantisJava/test/src/atlantis/NoTracksElementTest.java deleted file mode 100644 index e761ec038c140857108c301a80e6fbe51672e9ac..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/NoTracksElementTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package atlantis; - -import static org.fest.swing.timing.Pause.pause; -import static org.fest.swing.timing.Timeout.timeout; -import static org.junit.Assert.*; - -import org.fest.swing.timing.Condition; -import org.junit.Before; -import org.junit.Test; - -/** - * Test for bug#552, where a JiveXML file contains a "numTracks" element but - * not a corresponding "tracks" element in the "RVx" section, as in some - * of the events from the Hypatia masterclass. - * - * @author waugh - * - */ -public class NoTracksElementTest extends AtlantisHeadlessTestCase { - @Before - public void setUp() { - eventFileName = "masterclassMuonEvents.zip"; - System.setProperty("java.awt.headless", "true"); - startHeadlessMode(); - } - - @Test - public void loadEvent() { - pause(new Condition("output to contain \"Atlantis Ready\"") { - public boolean test() {return stdOutCopy.toString().contains("Atlantis Ready");} - },timeout(10000)); - String output = stdOutCopy.toString(); - assertTrue("Could not find or parse event ",output.contains("Parsing event")); - assertFalse("Error when constructing RVx",output.contains("Error when constructing RVx")); - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/canvas/AScaleBorderTest.java b/graphics/AtlantisJava/test/src/atlantis/canvas/AScaleBorderTest.java deleted file mode 100644 index 9ec8b4504a83a45724361c84b4b46d3a7b3c2ef7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/canvas/AScaleBorderTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package atlantis.canvas; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class AScaleBorderTest { - - @Test - public void testGetNumDecimalPlaces() { - assertEquals("Wrong number of decimal places",0,AScaleBorder.getNumDecimalPlaces(1.0)); - assertEquals("Wrong number of decimal places",0,AScaleBorder.getNumDecimalPlaces(10.0)); - assertEquals("Wrong number of decimal places",1,AScaleBorder.getNumDecimalPlaces(0.5)); - assertEquals("Wrong number of decimal places",2,AScaleBorder.getNumDecimalPlaces(0.02)); - assertEquals("Wrong number of decimal places",0,AScaleBorder.getNumDecimalPlaces(-2.0)); - assertEquals("Wrong number of decimal places",1,AScaleBorder.getNumDecimalPlaces(-0.5)); - } - -} diff --git a/graphics/AtlantisJava/test/src/atlantis/canvas/AScaleTest.java b/graphics/AtlantisJava/test/src/atlantis/canvas/AScaleTest.java deleted file mode 100644 index 75b0e7c588279bb6712c25a659610a9f2b67d6ad..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/canvas/AScaleTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package atlantis.canvas; - -import static org.junit.Assert.*; - -import java.awt.geom.GeneralPath; -import java.awt.geom.PathIterator; - -import org.junit.Assert; -import org.junit.Test; - -public class AScaleTest { - - private static final double TOLERANCE = 0.00001; - - @Test - public void testCalculateScale() { - AScale scale = AScale.calculateScale(0, 10, 100, 3, 7, 0, 0, null); - for (double label : scale.labelValues) { - System.out.println("label = "+label); - } - for (double pos : scale.labelPositions) { - System.out.println("position: "+pos); - } - System.out.println("Primary tick marks = " + scale.primaryTicks); - GeneralPath primaryTicks = scale.primaryTicks; - PathIterator iterPTicks = primaryTicks.getPathIterator(null); - double[] coords = new double[2]; - int i = 0; - while (!iterPTicks.isDone()) { - int type = iterPTicks.currentSegment(coords); - System.out.format("point %d has type %d%n",i,type); - System.out.print("Coords: "); - for (int j=0; j<2; ++j) { - System.out.format(" %f", coords[j]); - } - System.out.println(); - i++; - iterPTicks.next(); - } - } - - @Test - public void testRoundNumbers() { - assertEquals("Wrong rounding", 5.0, AScale.getRoundNumber(9.0), TOLERANCE); - assertEquals("Wrong rounding", -5.0, AScale.getRoundNumber(-9.0), TOLERANCE); - assertEquals("Wrong rounding", 1.0, AScale.getRoundNumber(1.01), TOLERANCE); - assertEquals("Wrong rounding", 500.0, AScale.getRoundNumber(999.0), TOLERANCE); - } - - @Test - public void testGetScaleIntervals() { - double[] intervals, expectedValues; - intervals = AScale.getScaleIntervals(-11.0,11.0); - expectedValues = new double[] {10.0, 5.0, 1.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(-110.0,110.0); - expectedValues = new double[] {100.0, 50.0, 10.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(-51.0,51.0); - expectedValues = new double[] {50.0, 10.0, 5.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(-50.0,50.0); - expectedValues = new double[] {50.0, 10.0, 5.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(-49.0,49.0); - expectedValues = new double[] {40.0, 20.0, 5.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(1.0,49.0); - expectedValues = new double[] {20.0, 10.0, 2.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(1.0,101.0); - expectedValues = new double[] {50.0, 10.0, 5.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(-101.0,-1.0); - expectedValues = new double[] {50.0, 10.0, 5.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(-9.5,9.5); - expectedValues = new double[] {5.0, 1.0, 0.5}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(19.0,61.0); - expectedValues = new double[] {20.0, 10.0, 2.0}; - assertArrayEquals("Wrong intervals", expectedValues, intervals, TOLERANCE); - intervals = AScale.getScaleIntervals(0.0,0.0); - assertNull("Intervals should be null for invalid input",intervals); - } - - @Test - public void testGetScaleValues() { - double[] values; - double[] expectedValues; - values = AScale.getScaleValues(0.0, 1.0, 1.0); - expectedValues = new double[] {0.0, 1.0}; - assertArrayEquals("Wrong scale values", expectedValues, values, TOLERANCE); - values = AScale.getScaleValues(-0.1, 1.1, 1.0); - expectedValues = new double[] {0.0, 1.0}; - assertArrayEquals("Wrong scale values", expectedValues, values, TOLERANCE); - } - - @Test - public void testInterpolate() { - float result = AScale.interpolate(0.5, 10.0, 0.0, 1.0); - assertEquals("Wrong interpolated value",5.0,result,TOLERANCE); - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/canvas/AWindowTest.java b/graphics/AtlantisJava/test/src/atlantis/canvas/AWindowTest.java deleted file mode 100644 index 076249c99931fdd80539d0457cb14f3e9fa9b391..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/canvas/AWindowTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package atlantis.canvas; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class AWindowTest { - - @Test - public void test() { - AWindow window = new AWindow("dummyName","dummyProjection","dummyGroup",1); - } - -} diff --git a/graphics/AtlantisJava/test/src/atlantis/data/AHelixTest.java b/graphics/AtlantisJava/test/src/atlantis/data/AHelixTest.java deleted file mode 100644 index b55aecf4db0d00ccbff97794223383c66c76aaff..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/data/AHelixTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -package atlantis.data; - -import atlantis.parameters.APar; -import atlantis.utils.AMath; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Before; -import org.junit.Test; -import static org.junit.Assert.*; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - -/** - * - * @author ejansen - */ - -@RunWith(Parameterized.class) -public class AHelixTest { - - private static final double TOLERANCE = 0.001; - private static final double CURVATURE = 100/0.6; - - private float d0, z0, phi0, cotanTheta, pt; - private AHelix helix; - - public AHelixTest(float d0, float z0, float phi0, float cotanTheta, float pt) { - this.d0 = d0; - this.z0 = z0; - this.phi0 = phi0; - this.cotanTheta = cotanTheta; - this.pt = pt; - } - - @Parameters - public static Collection helices() { - Collection data = new ArrayList<Object[]>(); - - for (int charge=-1; charge<=1; charge+=2) { - for (float d0=-1.f; d0<=1.f; d0+=1.f) { - for (float phi0=-(float)Math.PI; phi0<Math.PI; phi0+=Math.PI/4) { - float pt = 20.f; - - data.add(new Object[] {d0, 0.0f, phi0, 0.5f, charge*pt}); - } - } - } - - return data; - } - - @Before - public void setUp() { - APar.constructDummyForTesting(); - helix = new AHelix(d0, z0, (float)Math.toDegrees(phi0), cotanTheta, pt); - } - - @Test - public void testBackwardsCompatibility() { - AOldHelix oldHelix = new AOldHelix(d0, z0, (float)Math.toDegrees(phi0), cotanTheta, pt); - - assertArrayEquals(oldHelix.getPar(), helix.getPar(), TOLERANCE); - assertEquals(oldHelix.eta, helix.eta(), TOLERANCE); - assertEquals(oldHelix.startPhi, helix.getAlphaMin(), TOLERANCE); - assertEquals(oldHelix.rhoVertex, helix.getRhoVtx(), TOLERANCE); - } - - @Test - public void testD0() { - // The alpha=0 point should be at distance d0 - double rho = helix.getRho(0); - assertEquals(Math.abs(d0), rho, TOLERANCE); - } - - @Test - public void testCenterCoordinates() { - // Check the center of the circle against a separate calculation - double charge = Math.signum(pt); - double rC = CURVATURE * Math.abs(pt); - double xC = (rC - charge * d0) * Math.cos(phi0 - charge * Math.PI / 2); - double yC = (rC - charge * d0) * Math.sin(phi0 - charge * Math.PI / 2); - assertEquals(xC, helix.getXc(), TOLERANCE); - assertEquals(yC, helix.getYc(), TOLERANCE); - } - - @Test - public void testEndPoint() { - // End the helix at 1m from the beam pipe and check that the last point is at 1m - double alphaMax = helix.getAlphaCylinder(100., 250.); - assertEquals(100., helix.getRho(alphaMax), TOLERANCE); - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/data/AOldHelixTest.java b/graphics/AtlantisJava/test/src/atlantis/data/AOldHelixTest.java deleted file mode 100644 index 39b5077be3386e218b4a85bf7950cbb73280a550..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/data/AOldHelixTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package atlantis.data; - -import static org.junit.Assert.*; - -import org.junit.Before; -import org.junit.Test; - -import atlantis.parameters.APar; - -import static java.lang.Math.PI; - -public class AOldHelixTest { - /** Arbitrary tolerance for floating-point comparisons */ - private static final double TOLERANCE = 0.00001; - - @Before - public void setUp() throws Exception { - APar.constructDummyForTesting(); - } - - @Test - public void helixFromNominalVertex() { - // Input: rhoVtx,phiVtx,zVtx,pt,phi,eta,charge - // Start at (0,0,0), pt=2, eta=0 so perp to z axis - // phi = 0 (arbitrary), positive charge (+1) - // Expect all params 0 except ptInverse = 0.5 - AOldHelix helix = new AOldHelix(0,0,0,2,0,0,1); - assertHelixParametersEqual("Wrong helix parameters.",0,0,0,0,0.5,helix.getPar()); - // charge = -1 so ptInverse changes sign - helix = new AOldHelix(0,0,0,2,0,0,-1); - assertHelixParametersEqual("Wrong helix parameters.",0,0,0,0,-0.5,helix.getPar()); - } - - @Test - public void helixStartingAtPCA() { - /* Input: rhoVtx,phiVtx,zVtx,pt,phi,eta,charge - * Circular track (pz=0) starting at point closest to beam, at non-zero z. - * Perpendicular to line from beam to starting vertex: phi = phiVtx + PI/2 - * Start in upwards direction, from point to the right of the beam axis, */ - AOldHelix helix = new AOldHelix(0.1f,0,0.25f,1,(float)(PI/2),0,1); - double[] actualParameters = helix.getPar(); - /* Closest approach is where we started so phi at PCA is same as phi at start. - * Note that d0 is negative. */ - assertHelixParametersEqual("",-0.1,0.25,PI/2,0,1,actualParameters); - /* Same starting position and direction, but negative particle. - * No change to d0, which is still negative. */ - helix = new AOldHelix(0.1f,0,0.25f,1,(float)(PI/2),0,-1); - actualParameters = helix.getPar(); - assertHelixParametersEqual("",-0.1,0.25,PI/2,0,-1,actualParameters); - /* - * Positive and negative particles, now starting in same direction (upwards) - * but from a starting position to the left of the beam. - * This time d0 is positive. - */ - helix = new AOldHelix(0.1f,(float)PI,0.25f,1,(float)(PI/2),0,1); - actualParameters = helix.getPar(); - assertHelixParametersEqual("",0.1,0.25,PI/2,0,1,actualParameters); - helix = new AOldHelix(0.1f,(float)PI,0.25f,1,(float)(PI/2),0,-1); - actualParameters = helix.getPar(); - assertHelixParametersEqual("",0.1,0.25,PI/2,0,-1,actualParameters); - } - - protected void assertHelixParametersEqual(String message, double d0, double z0, - double phi0, double tL, double ptInverse, double[] actualParameters) { - assertD0Equals(message,d0,actualParameters); - assertZ0Equals(message,z0,actualParameters); - assertPhi0Equals(message,phi0,actualParameters); - assertTLEquals(message,tL,actualParameters); - assertPtInverseEquals(message,ptInverse,actualParameters); - } - - protected void assertD0Equals(String message, double expected, double[] actualParameters) { - assertEquals(message+" Wrong d0.",expected,actualParameters[0],TOLERANCE); - } - - protected void assertZ0Equals(String message, double expected, double[] actualParameters) { - assertEquals(message+" Wrong z0.",expected,actualParameters[1],TOLERANCE); - } - - protected void assertPhi0Equals(String message, double expected, double[] actualParameters) { - assertEquals(message+" Wrong phi0.",expected,actualParameters[2],TOLERANCE); - } - - protected void assertTLEquals(String message, double expected, double[] actualParameters) { - assertEquals(message+" Wrong tL.",expected,actualParameters[3],TOLERANCE); - } - - protected void assertPtInverseEquals(String message, double expected, double[] actualParameters) { - assertEquals(message+" Wrong ptInverse.",expected,actualParameters[4],TOLERANCE); - } - -} diff --git a/graphics/AtlantisJava/test/src/atlantis/event/AEventInfoTest.java b/graphics/AtlantisJava/test/src/atlantis/event/AEventInfoTest.java deleted file mode 100644 index 8c541eecb5e7e68dd7e86f96c181583193d78bd7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/event/AEventInfoTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package atlantis.event; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class AEventInfoTest { - private static final long eventNumber=12345; - private static final long runNumber=123; - - @Test - public void testAEventInfoCreation() { - AEventInfo e = new AEventInfo(eventNumber,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - assertAEventInfo(e,eventNumber,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - } - - /** - * Create AEventInfo object with null or other special values for parameters. - */ - @Test - public void testAEventInfoCreationChecks() { - AEventInfo e1 = new AEventInfo(eventNumber,runNumber,null,null,null,null); - assertAEventInfo(e1,eventNumber,runNumber,"n/a","n/a","default","default"); - AEventInfo e2 = new AEventInfo(eventNumber,runNumber,null,null,"blah-1","blah-1"); - assertAEventInfo(e2,eventNumber,runNumber,"n/a","n/a","default","default"); - } - - @Test - public void testAEventCopyConstructor() { - AEventInfo e0 = new AEventInfo(eventNumber,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - AEventInfo e = new AEventInfo(e0); - assertAEventInfo(e,eventNumber,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - } - - @Test - public void testHashCode() { - // Check different run/event numbers give different hash codes - AEventInfo e1 = new AEventInfo(eventNumber,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - AEventInfo e2 = new AEventInfo(eventNumber+1,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - AEventInfo e3 = new AEventInfo(eventNumber,runNumber+1,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - int h1 = e1.hashCode(); - int h2 = e2.hashCode(); - int h3 = e3.hashCode(); - assertTrue("hash codes should be different for e1,e2",h2!=h1); - assertTrue("hash codes should be different for e1,e3",h1!=h3); - assertTrue("hash codes should be different for e2,e3",h2!=h3); - } - - @Test - public void testEqualsAEventInfo() { - AEventInfo e1a = new AEventInfo(eventNumber,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - AEventInfo e1b = new AEventInfo(eventNumber,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - AEventInfo e2 = new AEventInfo(eventNumber+1,runNumber,"TIME","SOURCE","LUMIBLOCK","EVENTPROPERTIES"); - assertTrue("equals should return true for e1a,e1b",e1a.equals(e1b)); - assertFalse("equals should return false for e1a,e2",e1a.equals(e2)); - } - - /** Check values in AEventInfo object */ - private void assertAEventInfo(AEventInfo eventInfo, long event, long run, String time, String source, String lumiBlock, String eventProperties) { - assertEquals("event number not set correctly",event,eventInfo.getEventNumber()); - assertEquals("run number not set correctly",run,eventInfo.getRunNumber()); - assertEquals("time not set correctly",time,eventInfo.getDateTime()); - assertEquals("source not set correctly",source,eventInfo.getSourceName()); - assertEquals("source not set correctly",lumiBlock,eventInfo.getLumiBlock()); - assertEquals("event properties not set correctly",eventProperties,eventInfo.getEventProperties()); - } - -} diff --git a/graphics/AtlantisJava/test/src/atlantis/graphics/ACoordTest.java b/graphics/AtlantisJava/test/src/atlantis/graphics/ACoordTest.java deleted file mode 100644 index 24f5de94ef373256ef2719c055c2a0f677bd85b3..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/graphics/ACoordTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package atlantis.graphics; - -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.List; - -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -import atlantis.parameters.APar; -import static org.junit.Assert.*; - -public class ACoordTest { - private static final double TOLERANCE = 0.001; - - @BeforeClass - public static void setUpOnce() throws Exception { - APar.constructDummyForTesting(); - } - - @Test - public void constructACoordWithOnePoint() { - ACoord coord = new ACoord(0.0, 0.0, 0); - Point2D.Double point = new Point2D.Double(0.0,0.0); - assertContainsPoints(coord,point); - } - - @Test - public void constructACoordWithOneArrayOfPoints() { - double[] h = {0.0, 1.0, -1.0, 2.5}; - double[] v = {0.0, 0.0, 1.0, -2.5}; - ACoord coord = new ACoord(h,v); - Point2D.Double[] expectedPoints = createPointsArray(h,v); - assertContainsPoints(coord,expectedPoints); - } - - /** - * Currently just checks first set of points, i.e. x = hv[0][0][i], y = [1][0][i] - * @param coord - * @param points - */ - protected static void assertContainsPoints(ACoord coord, Point2D.Double... points) { - double[] x = coord.hv[0][0]; - double[] y = coord.hv[1][0]; - int xLen = x.length; - int yLen = y.length; - assertTrue(String.format( - "Numbers of x and y coordinates are not equal: %d, %d",xLen,yLen), - xLen==yLen); - assertTrue(String.format( - "Wrong number of points: expected %d, found %d",points.length,xLen), - points.length==xLen); - int i=0; - for (Point2D.Double point : points) { - Point2D.Double hvPoint = new Point2D.Double(x[i],y[i]); - double distance = hvPoint.distance(point); - if (distance>TOLERANCE) { - fail(String.format("Didn't find expected points. First difference is point %d: expected (%f,%f), found (%f,%f)", - i,point.x,point.y,hvPoint.x,hvPoint.y)); - } - i++; - } - } - - private Point2D.Double[] createPointsArray(double[] x, double[] y) { - Point2D.Double[] points = new Point2D.Double[x.length]; - for (int i=0; i<x.length; i++) { - points[i] = new Point2D.Double(x[i], y[i]); - } - return points; - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/list/AListManagerTest.java b/graphics/AtlantisJava/test/src/atlantis/list/AListManagerTest.java deleted file mode 100644 index 3b2e70bd5bff73a5d14fc4b20177eab5a6343fcc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/list/AListManagerTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package atlantis.list; - -import static org.junit.Assert.*; - -import org.junit.Test; - -import atlantis.utils.A4Vector; - -public class AListManagerTest { - private static final double TOLERANCE = 0.00001; - - @Test - public void testTotalEt() { - Summarizer summ = new Summarizer(); - A4Vector pos = new A4Vector(3.0,0,0,4.0); - String posDescription = "A positive 4vector"; - A4Vector neg = new A4Vector(-3.0,0,0,4.0); - String negDescription = "A negative 4vector"; - summ.addAndGetInfo(pos, posDescription); - summ.addAndGetInfo(neg, negDescription); - double totalEt = summ.getTotalEt(); - assertEquals(totalEt,10.0,TOLERANCE); - } - - @Test - public void testTotalPt() { - Summarizer summ = new Summarizer(); - A4Vector pos = new A4Vector(3.0,0,0,4.0); - String posDescription = "A positive 4vector"; - A4Vector neg = new A4Vector(-3.0,0,0,4.0); - String negDescription = "A negative 4vector"; - summ.addAndGetInfo(pos, posDescription); - summ.addAndGetInfo(neg, negDescription); - double totalPt = summ.getTotalPt(); - assertEquals(totalPt,0.0,TOLERANCE); - } - - @Test - public void testTotalMt() { - Summarizer summ = new Summarizer(); - A4Vector pos = new A4Vector(3.0,0,0,4.0); - String posDescription = "A positive 4vector"; - A4Vector neg = new A4Vector(-3.0,0,0,4.0); - String negDescription = "A negative 4vector"; - summ.addAndGetInfo(pos, posDescription); - summ.addAndGetInfo(neg, negDescription); - double totalMt = summ.getTotalMt(); - assertEquals(totalMt,10.0,TOLERANCE); - } - -} diff --git a/graphics/AtlantisJava/test/src/atlantis/parameters/AAbstractParameterTest.java b/graphics/AtlantisJava/test/src/atlantis/parameters/AAbstractParameterTest.java deleted file mode 100644 index c2df08a2a5549eb7745e91038f7022db0a4991cc..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/parameters/AAbstractParameterTest.java +++ /dev/null @@ -1,120 +0,0 @@ -package atlantis.parameters; - -import static org.junit.Assert.*; - -import org.junit.Before; -import org.junit.Test; - -import testutils.AtlantisInit; - -import atlantis.canvas.ACanvas; - -/** - * Tests for AAbstractParameter. - * @author waugh - * - */ -public class AAbstractParameterTest { - /** Arbitrary tolerance for floating-point comparisons */ - private static final double TOLERANCE = 0.00001; - - private AAbstractParameter parameter; - - @Before - public void setUp() throws Exception { - AtlantisInit.init(); - APar.constructDummyForTesting(); - ACanvas.constructDummyForTesting(); - parameter = new AAbstractParameter("name", "screen name", null, 0, 0, null, null, false, false, false, 0, 0, 0) { - {wCount = 1; data = new AParameterData(wCount);} - public void setD(double v) {} - public void setI(int v) {} - public void refresh() {} - }; - } - - @Test - public void testAAbstractParameter() { - assertNotNull(parameter); - } - - @Test - public void testSaveAndRestoreDefaults() { - // Access member variables directly since set and other methods rely on - // information about existing windows. Rely on uninitialized - // APar.currentIndex being zero. - - // Set value, status etc. - parameter.valueType = AAbstractParameter.FLOAT; - parameter.data.setValue(1.0); - parameter.data.setStatus(false); - parameter.data.setOperator(""); - parameter.range = AAbstractParameter.resolvePossibleValues("0:10", AAbstractParameter.FLOAT); - parameter._setD(1.0); - parameter.hasStatus = true; - parameter.setStatus(true); - parameter._setOperator("A"); // no restriction on value of operator? - parameter.setScope(AAbstractParameter.LOCAL); - // Save current settings as defaults then change them - parameter.saveDefaults(); - parameter._setD(2.0); - parameter.setStatus(false); - parameter._setOperator("B"); - parameter.setScope(AAbstractParameter.GLOBAL); - // Make sure the current settings have changed - double value = parameter.getD(); - boolean status = parameter.getStatus(); - String operator = parameter.getOperator(); - int scope = parameter.getScope(); - assertEquals("parameter value not changed from default",2.0,value,TOLERANCE); - assertEquals("parameter status not changed from default",false,status); - assertEquals("parameter operator not changed from default","B",operator); - assertEquals("parameter scope not changed from default",AAbstractParameter.GLOBAL,scope); - // Then restore defaults and verify the original settings are back - parameter.restoreDefaults(); - double restoredValue = parameter.getD(); - boolean restoredStatus = parameter.getStatus(); - String restoredOperator = parameter.getOperator(); - int restoredScope = parameter.getScope(); - assertEquals("parameter value not set to default",1.0,restoredValue,TOLERANCE); - assertEquals("parameter status not set to default",true,restoredStatus); - assertEquals("parameter operator not set to default","A",restoredOperator); - assertEquals("parameter scope not set to default",AAbstractParameter.LOCAL,restoredScope); - } - - @Test - public void testPossibleValuesFloat() { - parameter.valueType = AAbstractParameter.FLOAT; - String possibleValues = "1.0:2.0,3.0:4.5"; - parameter.range = AAbstractParameter.resolvePossibleValues(possibleValues, AAbstractParameter.FLOAT); - assertValidValue(parameter,possibleValues,1.2); - assertValidValue(parameter,possibleValues,4.4); - assertInvalidValue(parameter,possibleValues,0.9); - assertInvalidValue(parameter,possibleValues,2.1); - assertInvalidValue(parameter,possibleValues,9.9); - assertInvalidValue(parameter,possibleValues,-1.2); - } - - @Test - public void testPossibleValuesInt() { - parameter.valueType = AAbstractParameter.INT; - String possibleValues = "1,2,4"; - parameter.range = AAbstractParameter.resolvePossibleValues(possibleValues, AAbstractParameter.FLOAT); - assertValidValue(parameter,possibleValues,1); - assertValidValue(parameter,possibleValues,2); - assertValidValue(parameter,possibleValues,4); - assertInvalidValue(parameter,possibleValues,3); - assertInvalidValue(parameter,possibleValues,-1); - } - - private static void assertValidValue(AAbstractParameter parameter, String possibleValues, double value) { - boolean validated = parameter.validateValue(value); - assertTrue(String.format("Value %f incorrectly fails validation with possible values %s",value,possibleValues),validated); - } - - private static void assertInvalidValue(AAbstractParameter parameter, String possibleValues, double value) { - boolean validated = parameter.validateValue(value); - assertFalse(String.format("Value %f incorrectly passes validation with possible values %s",value,possibleValues),validated); - } - -} diff --git a/graphics/AtlantisJava/test/src/atlantis/parameters/AParameterDataTest.java b/graphics/AtlantisJava/test/src/atlantis/parameters/AParameterDataTest.java deleted file mode 100644 index afab7d5293af259ec665421c4f7f4f5e3c3994eb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/parameters/AParameterDataTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package atlantis.parameters; - -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * We don't test the methods that call APar to find out the current window, - * which is not defined in unit tests. - * - * @author waugh - * - */ -public class AParameterDataTest { - private static final int numWindows = 3; - private static final double TOLERANCE = 0.001; - - private AParameterData paramData; - - @Before - public void setUp() { - APar.constructDummyForTesting(); - paramData = new AParameterData(numWindows); - } - - @Test - /** - * Check default values for all windows. - */ - public void constructDefault() { - for (int iWindow=0; iWindow<numWindows; ++iWindow) { - AParameterState state = paramData.getState(iWindow); - assertValuesEqual("Default state is wrong.",0.0,false,"",state); - } - } - - @Test - /** - * Copy values from window 1 to window 2. - */ - public void copyValues() { - paramData.setValue(1, 1.0); - paramData.setStatus(1, true); - paramData.setOperator(1, "+"); - paramData.copy(1, 2); - AParameterState state = paramData.getState(2); - assertValuesEqual("Copied state is wrong.",1.0,true,"+",state); - } - - @Test - public void saveAndRestoreValues() { - paramData.setValue(1, 1.0); - paramData.setStatus(1, true); - paramData.setOperator(1, "+"); - paramData.saveDefaults(); - paramData.setValue(1, 2.0); - paramData.setStatus(1, false); - paramData.setOperator(1, "-"); - AParameterState state = paramData.getState(1); - assertValuesEqual("Set state is wrong.",2.0,false,"-",state); - paramData.restoreDefaults(); - state = paramData.getState(1); - assertValuesEqual("Restored state is wrong.",1.0,true,"+",state); - } - - @Test - public void testGlobalize() { - paramData.setValue(1, 1.0); - paramData.setStatus(1, true); - paramData.setOperator(1, "+"); - paramData.globalize(1); - for (int iWindow=0; iWindow<numWindows; ++iWindow) { - AParameterState state = paramData.getState(iWindow); - assertValuesEqual("State wrong after globalization.",1.0,true,"+",state); - } - } - - private static void assertValuesEqual(String message, double value, boolean status, String operator, AParameterState actual) { - assertEquals(message+" Wrong value.",value,actual.value,TOLERANCE); - assertEquals(message+" Wrong status.",status,actual.status); - assertEquals(message+" Wrong operator.",operator,actual.operator); - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/utils/A3VectorTest.java b/graphics/AtlantisJava/test/src/atlantis/utils/A3VectorTest.java deleted file mode 100644 index 0b88546b31d61ad6cd035517ede778867ae2f963..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/utils/A3VectorTest.java +++ /dev/null @@ -1,101 +0,0 @@ -package atlantis.utils; - -import static org.junit.Assert.*; - -import org.junit.Test; - -/** - * Tests for A3Vector class. Initial rather clumsy implementation just to get started. - * @author waugh - * - */ -public class A3VectorTest { - /** Arbitrary tolerance for floating-point comparisons */ - private static final double TOLERANCE = 0.00001; - - @Test - public void testA3Vector() { - A3Vector v = new A3Vector(); - assertA3VectorEquals("three-vector",0.0,0.0,0.0,v,TOLERANCE); - } - - @Test - public void testA3VectorDoubleDoubleDouble() { - A3Vector v = new A3Vector(1.0,-2.5,3.3); - assertA3VectorEquals("three-vector",1.0,-2.5,3.3,v,TOLERANCE); - } - - @Test - public void testFromEtaPhiR() { - A3Vector v = A3Vector.fromEtaPhiR(0.0, Math.PI, 2.0); - assertA3VectorEquals("three-vector",-2.0,0.0,0.0,v,TOLERANCE); - } - - @Test - public void testFromRhoPhiZ() { - A3Vector v = A3Vector.fromRhoPhiZ(1.0, Math.PI, 1.0); - assertA3VectorEquals("three-vector",-1.0,0.0,1.0,v,TOLERANCE); - } - - @Test - public void testGetNormalized() { - A3Vector v0 = new A3Vector(1.0,1.0,1.0); - double a = 1 / Math.sqrt(3); - A3Vector v = v0.getNormalized(); - assertA3VectorEquals("three-vector",a,a,a,v,TOLERANCE); - } - - @Test - public void testNormalize() { - A3Vector v = new A3Vector(1.0,1.0,1.0); - v.normalize(); - double a = 1 / Math.sqrt(3); - assertA3VectorEquals("three-vector",a,a,a,v,TOLERANCE); - } - - @Test - public void testMagnitude() { - A3Vector v = new A3Vector(1.0,1.0,1.0); - double r = v.magnitude(); - double rExpected = Math.sqrt(3); - assertEquals("magnitude calculation",rExpected,r,TOLERANCE); - } - - @Test - public void testScale() { - A3Vector v = new A3Vector(1.0,1.0,1.0); - v.scale(0.5); - assertA3VectorEquals("three-vector",0.5,0.5,0.5,v,TOLERANCE); - } - - @Test - public void testAdd() { - A3Vector v = new A3Vector(1.0,2.0,3.0); - A3Vector v0 = new A3Vector(0.0,1.0,-0.5); - v.add(v0); - assertA3VectorEquals("three-vector",1.0,3.0,2.5,v,TOLERANCE); - } - - @Test - public void testSubtract() { - A3Vector v = new A3Vector(1.0,2.0,3.0); - A3Vector v0 = new A3Vector(0.0,1.0,-0.5); - v.subtract(v0); - assertA3VectorEquals("three-vector",1.0,1.0,3.5,v,TOLERANCE); - } - - /** - * Check given A3Vector has expected components - */ - private static void assertA3VectorEquals(String message, double x, double y, double z, - A3Vector v, double delta) { - if (Math.abs(v.x-x)>delta || Math.abs(v.y-y)>delta || - Math.abs(v.z-z)>delta) { - String vExpected = String.format("<%f,%f,%f>", x,y,z); - String vActual = String.format("<%f,%f,%f>", v.x,v.y,v.z); - String summary = message+" "+ - "expected:"+vExpected+" but was:"+vActual; - fail(summary); - } - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/utils/A4VectorTest.java b/graphics/AtlantisJava/test/src/atlantis/utils/A4VectorTest.java deleted file mode 100644 index 03fb94f20012f9fbb90643847f552b44980a181e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/utils/A4VectorTest.java +++ /dev/null @@ -1,128 +0,0 @@ -package atlantis.utils; - - -import static org.junit.Assert.*; - -import org.junit.Test; - -/** - * Tests for A4Vector class. - */ -public class A4VectorTest { - /** Arbitrary tolerance for floating-point comparisons */ - private static final double TOLERANCE = 0.00001; - - @Test - public void testA4Vector() { - A4Vector v = new A4Vector(); - assertA4VectorEquals("construct zero 4-vector",0.0,0.0,0.0,0.0,v,TOLERANCE); - } - - @Test - public void testA4VectorDoubleDoubleDoubleDouble() { - // fourth argument is mass, not energy - // use 3-4-5 numbers for simple arithmetic - A4Vector v = new A4Vector(2.0,2.0,-1.0,4.0); - assertA4VectorEquals("construct 4-vector",2.0,2.0,-1.0,5.0,v,TOLERANCE); - } - - @Test - public void testA4VectorA3VectorDouble() { - A3Vector v3 = new A3Vector(2.0,2.0,-1.0); - A4Vector v = new A4Vector(v3,4.0); - assertA4VectorEquals("construct 4-vector",2.0,2.0,-1.0,5.0,v,TOLERANCE); - } - - @Test - public void testSet() { - A4Vector v = new A4Vector(); - v.set(2.0,2.0,-1.0,4.0); - assertA4VectorEquals("set 4-vector",2.0,2.0,-1.0,5.0,v,TOLERANCE); - } - - @Test - public void testSetPtEtaPhiM() { - A4Vector v1 = new A4Vector(); - v1.setPtEtaPhiM(1.0, 0.0, 0.0, 0.0); - assertA4VectorEquals("set 4-vector",1.0,0.0,0.0,1.0,v1,TOLERANCE); - // test with negative pT - A4Vector v2 = new A4Vector(); - v2.setPtEtaPhiM(-1.0, 0.0, 0.0, 0.0); - assertA4VectorEquals("set 4-vector",1.0,0.0,0.0,1.0,v2,TOLERANCE); - } - - @Test - public void testGetP() { - A4Vector v = new A4Vector(2.0,2.0,-1.0,4.0); - double p = v.getP(); - assertEquals(3.0,p,TOLERANCE); - } - - @Test - public void testGetPt() { - A4Vector v = new A4Vector(0.3,0.4,-1.0,4.0); - double pt = v.getPt(); - assertEquals(0.5,pt,TOLERANCE); - } - - @Test - public void testGetE() { - A4Vector v = new A4Vector(2.0,2.0,-1.0,4.0); - double e = v.getE(); - assertEquals(5.0,e,TOLERANCE); - } - - @Test - public void testgetEt() { - A4Vector v = new A4Vector(1.0,1.0,2.0,3.0); - double et = v.getEt(); - double x = Math.sqrt(5.0); - assertEquals(x,et,TOLERANCE); - } - - @Test - public void testGetMass() { - A4Vector v = new A4Vector(2.0,2.0,-1.0,4.0); - double m = v.getMass(); - assertEquals(4.0,m,TOLERANCE); - } - - @Test - public void testGetMt() { - A4Vector v = new A4Vector(1.0,1.0,2.0,3.0); - double mt = v.getMt(); - double x = Math.sqrt(3.0); - assertEquals(x,mt,TOLERANCE); - } - - @Test - public void testAddDoubleDoubleDoubleDouble() { - A4Vector v = new A4Vector(2.0,2.0,-1.0,4.0); - v.add(2.2,2.2,-1.1,4.4); - assertA4VectorEquals("add 4-vectors",4.2,4.2,-2.1,10.5,v,TOLERANCE); - } - - @Test - public void testAddA4Vector() { - A4Vector v = new A4Vector(2.0,2.0,-1.0,4.0); - A4Vector v2 = new A4Vector(2.2,2.2,-1.1,4.4); - v.add(v2); - assertA4VectorEquals("add 4-vectors",4.2,4.2,-2.1,10.5,v,TOLERANCE); - } - - /** - * Check given A4Vector has expected components - */ - private static void assertA4VectorEquals(String message, double px, double py, double pz, double e, - A4Vector v, double delta) { - if (Math.abs(v.px-px)>delta || Math.abs(v.py-py)>delta || - Math.abs(v.pz-pz)>delta || Math.abs(v.e-e)>delta) { - String vExpected = String.format("<%f,%f,%f,%f>", px,py,pz,e); - String vActual = String.format("<%f,%f,%f,%f>", v.px,v.py,v.pz,v.e); - String summary = message+" "+ - "expected:"+vExpected+" but was:"+vActual; - fail(summary); - } - } - -} diff --git a/graphics/AtlantisJava/test/src/atlantis/utils/AIdRangeTest.java b/graphics/AtlantisJava/test/src/atlantis/utils/AIdRangeTest.java deleted file mode 100644 index cae60427953a6e7adbe00ca1a892a05251a32eca..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/utils/AIdRangeTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package atlantis.utils; - -import static org.junit.Assert.assertEquals; -import org.junit.Test; - -/** - * Test for the IdHelper range class used to represent - * possible values of an identifier field. - * - * @author Eric Jansen - */ -public class AIdRangeTest { - - public AIdRangeTest() {} - - @Test - public void testEmptyRange() throws Exception { - AIdRange a = new AIdRange(); - AIdRange b = new AIdRange(new int[] {1, 2}); - - a.add(b); - assertEquals(a, b); - - b.add(a); - assertEquals(a, b); - } - - @Test - public void testContainsRange() throws Exception { - AIdRange a = new AIdRange(1, 3); - AIdRange b = new AIdRange(new int[] {1, 2, 4}); - AIdRange c = new AIdRange(1, 2); - - assert(a.contains(c)); - assert(b.contains(c)); - assert(!a.contains(b)); - assert(!b.contains(a)); - } - - @Test - public void testContainsValue() throws Exception { - AIdRange a = new AIdRange(-5, 5); - AIdRange b = new AIdRange(new int[] {-1, 3, 9}); - - assert(!a.contains(-6)); - assert(a.contains(-5)); - assert(a.contains(2)); - assert(a.contains(5)); - assert(!a.contains(6)); - - assert(b.contains(-1)); - assert(!b.contains(2)); - assert(b.contains(3)); - assert(b.contains(9)); - } - - @Test - public void testAddRange() throws Exception { - AIdRange a = new AIdRange(new int[] {-1, 0, 1, 2, 5, 6}); - AIdRange b = new AIdRange(new int[] {-1, 1, 2, 6}); - AIdRange c = new AIdRange(new int[] {0, 1, 2, 5}); - - b.add(c); - assert(a.equals(b)); - - AIdRange d = new AIdRange(-5, 5); - AIdRange e = new AIdRange(new int[] {-5, -4}); - AIdRange f = new AIdRange(-3, 5); - - e.add(f); - assert(d.equals(e)); - - AIdRange g = new AIdRange(0, 2); - AIdRange h = new AIdRange(new int[] {0, 1}); - AIdRange i = new AIdRange(new int[] {1, 2}); - - h.add(i); - assert(g.equals(h)); // comparing [ 0 -> 2 ] to [ 0 1 2 ] - } - - @Test - public void testToString() throws Exception { - AIdRange a = new AIdRange(-2, 15); - AIdRange b = new AIdRange(new int[] {2, 3, 5}); - AIdRange c = new AIdRange(); - assertEquals("[ -2 -> 15 ]", a.toString()); - assertEquals("[ 2 3 5 ]", b.toString()); - assertEquals("[ ]", c.toString()); - } -} diff --git a/graphics/AtlantisJava/test/src/atlantis/utils/AMathTest.java b/graphics/AtlantisJava/test/src/atlantis/utils/AMathTest.java deleted file mode 100644 index 8bb888866ac95b98c92122faadfeaafbe8d95fdb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/utils/AMathTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * - */ -package atlantis.utils; - -import static org.junit.Assert.*; -import org.junit.Test; - -import static java.lang.Math.PI; - -/** - * @author waugh - * - */ -public class AMathTest { - /** Arbitrary tolerance for floating-point comparisons */ - private static final double TOLERANCE = 0.00001; - - /** - * Test method for {@link atlantis.utils.AMath#nearestPhiDegrees(double)}. - */ - @Test - public void testNearestPhiDegreesDouble() { - assertEquals("Wrong value for phi",0.,AMath.nearestPhiDegrees(0.),TOLERANCE); - assertEquals("Wrong value for phi",0.,AMath.nearestPhiDegrees(360.),TOLERANCE); - assertEquals("Wrong value for phi",180.,AMath.nearestPhiDegrees(180.),TOLERANCE); - assertEquals("Wrong value for phi",1.,AMath.nearestPhiDegrees(1.),TOLERANCE); - assertEquals("Wrong value for phi",359.,AMath.nearestPhiDegrees(-1.),TOLERANCE); - } - - /** - * Test method for {@link atlantis.utils.AMath#nearestPhiRadians(double)}. - */ - @Test - public void testNearestPhiRadiansDouble() { - assertEquals("Wrong value for phi",0.,AMath.nearestPhiRadians(0.),TOLERANCE); - assertEquals("Wrong value for phi",0.,AMath.nearestPhiRadians(2*PI),TOLERANCE); - assertEquals("Wrong value for phi",PI,AMath.nearestPhiRadians(PI),TOLERANCE); - assertEquals("Wrong value for phi",0.1,AMath.nearestPhiRadians(0.1),TOLERANCE); - assertEquals("Wrong value for phi",2*PI-0.1,AMath.nearestPhiRadians(-0.1),TOLERANCE); - } - - /** - * Test method for {@link atlantis.utils.AMath#nearestPhiDegrees(double, double)}. - */ - @Test - public void testNearestPhiDegreesDoubleDouble() { - double phiMid = 360; // range [180,540) - assertEquals("Wrong value for phi",180.,AMath.nearestPhiDegrees(180.0,phiMid),TOLERANCE); - assertEquals("Wrong value for phi",180.,AMath.nearestPhiDegrees(540.0,phiMid),TOLERANCE); - assertEquals("Wrong value for phi",360.,AMath.nearestPhiDegrees(360.0,phiMid),TOLERANCE); - assertEquals("Wrong value for phi",361.,AMath.nearestPhiDegrees(1.0,phiMid),TOLERANCE); - assertEquals("Wrong value for phi",539.,AMath.nearestPhiDegrees(179.0,phiMid),TOLERANCE); - } - - /** - * Test method for {@link atlantis.utils.AMath#nearestPhiRadians(double, double)}. - */ - @Test - public void testNearestPhiRadiansDoubleDouble() { - double phiMid = 2*PI; // range [180,540) - assertEquals("Wrong value for phi",PI,AMath.nearestPhiRadians(PI,phiMid),TOLERANCE); - assertEquals("Wrong value for phi",PI,AMath.nearestPhiRadians(PI,phiMid),TOLERANCE); - assertEquals("Wrong value for phi",2*PI,AMath.nearestPhiRadians(2*PI,phiMid),TOLERANCE); - assertEquals("Wrong value for phi",2*PI+0.1,AMath.nearestPhiRadians(0.1,phiMid),TOLERANCE); - assertEquals("Wrong value for phi",3*PI-0.1,AMath.nearestPhiRadians(PI-0.1,phiMid),TOLERANCE); - } - -} diff --git a/graphics/AtlantisJava/test/src/atlantis/utils/ANewIdHelperTest.java b/graphics/AtlantisJava/test/src/atlantis/utils/ANewIdHelperTest.java deleted file mode 100644 index bad4515a8e3ea379c5ab544684da422c2492ccf7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/atlantis/utils/ANewIdHelperTest.java +++ /dev/null @@ -1,130 +0,0 @@ -package atlantis.utils; - -import atlantis.globals.AGlobals; -import atlantis.utils.xml.AXMLErrorHandler; -import java.io.InputStream; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; -import org.junit.BeforeClass; -import org.junit.Test; -import org.w3c.dom.Document; -import testutils.AtlantisInit; - -/** - * Tests for the ANewIdHelper class. Tests are performed by fully - * decoding compact identifiers of several subsystems. - * - * @author Eric Jansen - */ -public class ANewIdHelperTest { - - public ANewIdHelperTest() {} - - @BeforeClass - public static void setUpClass() throws Exception { - AtlantisInit.init(); - String geometryBase = AGlobals.instance().getHomeDirectory() + "geometry/"; - InputStream isIdDict = AUtilities.getFileAsStream(geometryBase + "ATLAS_IDS.xml"); - - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setValidating(true); - DocumentBuilder parser = factory.newDocumentBuilder(); - parser.setErrorHandler(new AXMLErrorHandler()); - - Document xmlDictDoc = parser.parse(isIdDict, geometryBase); - ANewIdHelper.construct(xmlDictDoc.getDocumentElement()); - - System.out.println("The loaded identifier structure is:\n" - + ANewIdHelper.instance().getDictionary("ATLAS")); - } - - @Test - public void testPixel() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("InnerDetector/Pixel/negative_endcap/0/15/0/86/76", idHelper.getFullIdentifier(8661285809946624l)); - } - - @Test - public void testSCT() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("InnerDetector/SCT/negative_endcap/1/23/2/0/683", idHelper.getFullIdentifier(137085611)); - assertEquals("InnerDetector/SCT/positive_endcap/8/50/0/1/609", idHelper.getFullIdentifier(219756129)); - } - - @Test - public void testTRT() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("InnerDetector/TRT/negative_endcap/2/2/6/7", idHelper.getFullIdentifier(270604512)); - assertEquals("InnerDetector/TRT/negative_endcap/11/1/7/9", idHelper.getFullIdentifier(280010016)); - assertEquals("InnerDetector/TRT/negative_barrel/9/0/18/7", idHelper.getFullIdentifier(311445728)); - assertEquals("InnerDetector/TRT/positive_barrel/5/2/22/10", idHelper.getFullIdentifier(340875584)); - assertEquals("InnerDetector/TRT/positive_endcap/7/10/1/13", idHelper.getFullIdentifier(376767904)); - assertEquals("InnerDetector/TRT/positive_endcap/31/13/7/18", idHelper.getFullIdentifier(402038336)); - } - - @Test - public void testLAr() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("LArCalorimeter/LArEM/negative-endcap-outer-wheel/2/1/37/72", idHelper.getFullIdentifier(3225785215439863808l)); - assertEquals("LArCalorimeter/LArEM/positive-barrel/1/0/167/15", idHelper.getFullIdentifier(765546014)); - assertEquals("LArCalorimeter/LArEM/negative-barrel/2/0/4/113", idHelper.getFullIdentifier(759171298)); - } - - @Test - public void testTILE() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("TileCalorimeter/Barrel/positive/28/0/1/0/0", idHelper.getFullIdentifier(1149698064)); - assertEquals("TileCalorimeter/Extended-barrel/negative/0/14/0/0/0", idHelper.getFullIdentifier(1207963136)); - } - - @Test - public void testHEC() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("LArCalorimeter/LArHEC/negative-endcap-outer-wheel/1/0/5/22", idHelper.getFullIdentifier(815095808)); - assertEquals("LArCalorimeter/LArHEC/negative-endcap-outer-wheel/2/0/6/22", idHelper.getFullIdentifier(823746560)); - assertEquals("LArCalorimeter/LArHEC/positive-endcap-outer-wheel/2/1/2/20", idHelper.getFullIdentifier(860438528)); - assertEquals("LArCalorimeter/LArHEC/positive-endcap-outer-wheel/3/0/8/0", idHelper.getFullIdentifier(866123776)); - assertEquals("LArCalorimeter/LArHEC/positive-endcap-outer-wheel/3/1/3/29", idHelper.getFullIdentifier(869126144)); - } - - @Test - public void testFCAL() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("LArCalorimeter/LArFCAL/negative-endcap-outer-wheel/1/4/13", idHelper.getFullIdentifier(873046016)); - assertEquals("LArCalorimeter/LArFCAL/negative-endcap-outer-wheel/1/45/0", idHelper.getFullIdentifier(878313472)); - assertEquals("LArCalorimeter/LArFCAL/positive-endcap-outer-wheel/1/3/0", idHelper.getFullIdentifier(906362880)); - assertEquals("LArCalorimeter/LArFCAL/positive-endcap-outer-wheel/2/23/14", idHelper.getFullIdentifier(917487616)); - assertEquals("LArCalorimeter/LArFCAL/positive-endcap-outer-wheel/3/15/15", idHelper.getFullIdentifier(924835840)); - } - - @Test - public void testMDT() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("MuonSpectrometer/BIL/-6/1/MDT/1/3/1", idHelper.getFullIdentifier(6922067811640541184l)); - assertEquals("MuonSpectrometer/BIL/-6/2/MDT/2/2/34", idHelper.getFullIdentifier(1611748384)); - assertEquals("MuonSpectrometer/BIL/1/5/MDT/1/2/3", idHelper.getFullIdentifier(1615597632)); - assertEquals("MuonSpectrometer/BOL/1/5/MDT/1/2/7", idHelper.getFullIdentifier(1682706624)); - assertEquals("MuonSpectrometer/EOL/2/3/MDT/2/1/6", idHelper.getFullIdentifier(1884438688)); - assertEquals("MuonSpectrometer/EIS/-1/6/MDT/2/3/36", idHelper.getFullIdentifier(2050843744)); - } - - @Test - public void testRPC() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("MuonSpectrometer/BML/-6/6/RPC/1/2/2/2/0/4", idHelper.getFullIdentifier(1645583372)); - } - - @Test - public void testCSC() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("MuonSpectrometer/CSS/-1/1/CSC/2/4/0/6", idHelper.getFullIdentifier(2064056960)); - } - - @Test - public void testTGC() throws Exception { - ANewIdHelper idHelper = ANewIdHelper.instance(); - assertEquals("MuonSpectrometer/T4E/1/10/TGC/2/1/15", idHelper.getFullIdentifier(2035436656)); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/AAssert.java b/graphics/AtlantisJava/test/src/guitest/AAssert.java deleted file mode 100644 index 0010a9594878a0770ef25b8f095132acbe20e9a6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/AAssert.java +++ /dev/null @@ -1,28 +0,0 @@ -package guitest; - -import static org.junit.Assert.*; - -import java.util.Arrays; - -/** - * Useful assertion methods for tests. - * @author waugh - * - */ -public class AAssert { - public static void assertArrayEqualsIgnoreOrder(String message, - Object[] expecteds, Object[] actuals) { - int lengthExp = expecteds.length; - int lengthAct = actuals.length; - if (lengthAct!=lengthExp) fail(message+ - ": array lengths differed, "+ - String.format("expected.length=%d,actual.length=%d",lengthExp,lengthAct)); - Object[] copyExpecteds = new Object[lengthExp]; - System.arraycopy(expecteds,0,copyExpecteds,0,lengthExp); - Object[] copyActuals = new Object[lengthAct]; - System.arraycopy(actuals,0,copyActuals,0,lengthAct); - Arrays.sort(copyExpecteds); - Arrays.sort(copyActuals); - assertArrayEquals(message,copyExpecteds,copyActuals); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/AtlantisGUIFixture.java b/graphics/AtlantisJava/test/src/guitest/AtlantisGUIFixture.java deleted file mode 100644 index 5d49d4fae4e9e43d47d1d0a80999eb71c1661305..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/AtlantisGUIFixture.java +++ /dev/null @@ -1,141 +0,0 @@ -package guitest; - -import java.awt.Dialog; -import java.io.File; - -import org.fest.swing.core.BasicComponentFinder; -import org.fest.swing.core.ComponentFinder; -import org.fest.swing.core.ComponentFoundCondition; -import org.fest.swing.core.Robot; -import org.fest.swing.core.matcher.DialogMatcher; -import org.fest.swing.core.matcher.FrameMatcher; -import org.fest.swing.core.matcher.JButtonMatcher; -import org.fest.swing.data.TableCell; -import org.fest.swing.data.TableCellByColumnId; -import org.fest.swing.exception.ComponentLookupException; -import org.fest.swing.fixture.DialogFixture; -import org.fest.swing.fixture.FrameFixture; -import org.fest.swing.fixture.JButtonFixture; -import org.fest.swing.fixture.JFileChooserFixture; -import org.fest.swing.fixture.JTabbedPaneFixture; -import org.fest.swing.fixture.JTableCellFixture; -import org.fest.swing.fixture.JTableFixture; -import org.fest.swing.fixture.JToolBarFixture; -import org.fest.swing.timing.Pause; - -import static org.junit.Assert.*; - -import atlantis.gui.AGUI; - -/** - * Fixture for testing the Atlantis GUI (class AGUI). - * @author waugh - * - */ -public class AtlantisGUIFixture extends FrameFixture { - private Robot robot; - private ComponentFinder finder; - private FrameFixture guiFixture; - - /** - * Construct and return AtlantisGUIFixture using specified robot. - * @param robot the robot to use - * @return fixture for the Atlantis GUI - */ - public static AtlantisGUIFixture getFixture(Robot robot) { - ComponentFinder finder = BasicComponentFinder.finderWithCurrentAwtHierarchy(); - FrameMatcher matcherGuiTitle = FrameMatcher.withTitle("Atlantis GUI"); - ComponentFoundCondition guiFound = new ComponentFoundCondition("Atlantis GUI found", - finder, matcherGuiTitle); - Pause.pause(guiFound,30000); - AGUI gui = (AGUI) guiFound.found(); - return new AtlantisGUIFixture(robot,gui); - } - - /** - * Construct AtlantisGUIFixture. - * @param robot - */ - public AtlantisGUIFixture(Robot robot, AGUI gui) { - super(robot,gui); - this.robot = robot; - this.finder = BasicComponentFinder.finderWithCurrentAwtHierarchy(); - this.guiFixture = new FrameFixture(robot,gui); - } - - /** Find AParametersTable for given supergroup and group */ - protected JTableFixture findParametersTable(String superGroup, String group) { - JTabbedPaneFixture tabs = guiFixture.tabbedPane("parameterGroups"); - tabs.selectTab(superGroup); - JTabbedPaneFixture subTabs = guiFixture.tabbedPane(superGroup); - subTabs.selectTab(group); - JTableFixture parametersTable = guiFixture.table(group); - return parametersTable; - } - - /** - * Find table cell containing given parameter. - * @param superGroup - * @param group - * @param parameter - * @return - */ - protected JTableCellFixture findParameterCell(String superGroup, String group, String parameter) { - JTableFixture table = findParametersTable(superGroup,group); - TableCell cellName = table.cell(parameter); - int row = cellName.row; // Row containing cell with specified name - JTableCellFixture cellValue = table.cell(TableCellByColumnId.row(row).columnId("Value")); - return cellValue; - } - - /** Find button in GUI with given text */ - protected JButtonFixture findGuiButton(String text) { - JButtonMatcher matcher = JButtonMatcher.withText(text); - return guiFixture.button(matcher); - } - - /** - * Open file using GUI - * @param file event file - */ - protected void openEventFile(File file) { - guiFixture.menuItemWithPath("File", "Read Event Locally").click(); - // Sometimes we have more than one "Open" dialog, but should be only one showing - Dialog dialogOpen = finder.find(DialogMatcher.withTitle("Open").andShowing()); - DialogFixture fixtureDialogOpen = new DialogFixture(robot,dialogOpen); - JFileChooserFixture fileChooser = fixtureDialogOpen.fileChooser(); - fileChooser.selectFile(file); - fileChooser.approve(); - } - - /** - * Open file using GUI and fail if there is a problem - * @param file event file - */ - protected void openEventFileAndCheck(File file) { - openEventFile(file); - try { - Dialog dialogInvalid = finder.find(DialogMatcher.withTitle("Invalid source")); - fail("Failed to open event: found invalid source dialog"); - } - catch (ComponentLookupException e) { - // OK: no warning dialog! - } - } - - /** - * Get a fixture for the event source tool bar. - * @return - */ - public JToolBarFixture findEventSourceToolBar() { - return new JToolBarFixture(robot,"Atlantis event source toolbar"); - } - - /** - * Get a fixture for the interactions tool bar. - * @return - */ - public JToolBarFixture findInteractionToolBar() { - return new JToolBarFixture(robot,"Atlantis interaction toolbar"); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/AtlantisGuiTestCase.java b/graphics/AtlantisJava/test/src/guitest/AtlantisGuiTestCase.java deleted file mode 100644 index 6c69d170207a95d152c6437a18f8ef084d398d69..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/AtlantisGuiTestCase.java +++ /dev/null @@ -1,100 +0,0 @@ -package guitest; - -import java.awt.Frame; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; - -import org.fest.swing.core.BasicComponentFinder; -import org.fest.swing.core.BasicRobot; -import org.fest.swing.core.ComponentFinder; -import org.fest.swing.core.Robot; -import org.fest.swing.core.matcher.FrameMatcher; -import org.fest.swing.edt.FailOnThreadViolationRepaintManager; -import org.fest.swing.fixture.FrameFixture; -import org.fest.swing.security.NoExitSecurityManagerInstaller; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; - -import testutils.AtlantisInit; -import testutils.TeeOutputStream; -import testutils.TestUtils; - -import atlantis.Atlantis; -import atlantis.globals.AGlobals; - -public class AtlantisGuiTestCase { - protected Robot robot; - protected ComponentFinder finder; - protected FrameFixture canvasFixture; - protected AtlantisGUIFixture guiFixture; - ByteArrayOutputStream stdOutCopy = new ByteArrayOutputStream(); - private static NoExitSecurityManagerInstaller noExitSecurityManagerInstaller; - - /** Time [ms] to pause at end of test for easier viewing */ - protected long pauseLength = 0; - - /** - * Install NoExitSecurityManager because JUnit gets upset if the forked JVM exits - */ - @BeforeClass - public static void setUpOnce() { - noExitSecurityManagerInstaller = NoExitSecurityManagerInstaller.installNoExitSecurityManager(); - } - - @AfterClass - public static void tearDownOnce() { - noExitSecurityManagerInstaller.uninstall(); - } - - @Before - public void setUp() { - startAtlantis(); - } - - protected void startAtlantis() { - AtlantisInit.init(); - String atlantisHomeDir=AGlobals.instance().getHomeDirectory(); - String testEventsDir = atlantisHomeDir+"/test/events"; - TestUtils.setPropertyIfNotSet("atlantis.test.events",testEventsDir); - - // Omit this for now since Atlantis main does not do set-up on EDT - // FailOnThreadViolationRepaintManager.install(); - - finder = BasicComponentFinder.finderWithCurrentAwtHierarchy(); - robot = BasicRobot.robotWithCurrentAwtHierarchy(); - - // Redirect standard output to ByteArrayOutputStream as well as normal System.out - TeeOutputStream teeOut = new TeeOutputStream(System.out,stdOutCopy); - System.setOut(new PrintStream(teeOut)); - - // Launch Atlantis application - String[] args = {"--debug","DEBUG"}; - Atlantis.main(args); - // Don't use ACrashReporter to handle uncaught exceptions - Thread.setDefaultUncaughtExceptionHandler(null); - - // Get fixtures for the GUI and Canvas - guiFixture = AtlantisGUIFixture.getFixture(robot); - FrameMatcher matcherCanvasTitle = FrameMatcher.withTitle("Atlantis Canvas"); - // Cannot cast to ACanvas because the ACanvas is actually a JPanel that creates its own - // parent JFrame. - Frame canvas = finder.find(matcherCanvasTitle); - canvasFixture = new FrameFixture(robot,canvas); - } - - @After - public void tearDown() { - pause(pauseLength); - } - - /** Pause for a second so can see end result on screen */ - protected static void pause(long duration) { - try { - Thread.sleep(duration); - } catch (InterruptedException e) { - // allow to return if interrupted - } - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/EnumeratorParameterTest.java b/graphics/AtlantisJava/test/src/guitest/EnumeratorParameterTest.java deleted file mode 100644 index 5b9c2fb1c6492c19c0b9b4eb0cf0c78a5cda6bf9..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/EnumeratorParameterTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package guitest; - -import org.junit.Test; -import org.fest.swing.fixture.JComboBoxFixture; -import org.fest.swing.fixture.JTableCellFixture; - -public class EnumeratorParameterTest extends AtlantisGuiTestCase { - - @Test - public void test() { - JTableCellFixture cell = guiFixture.findParameterCell("MuonDet","Track","Track Collections"); - cell.click(); - JComboBoxFixture comboBox = guiFixture.comboBox("Track Collections"); - String[] contents = comboBox.contents(); - comboBox.selectItem("All"); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/EventSourceToolBarTest.java b/graphics/AtlantisJava/test/src/guitest/EventSourceToolBarTest.java deleted file mode 100644 index 15bb2f5481a34ea14371480734443c19615cfbef..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/EventSourceToolBarTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package guitest; - -import org.fest.swing.fixture.JToolBarFixture; -import org.junit.Test; - -public class EventSourceToolBarTest extends AtlantisGuiTestCase { - @Test - public void testEventSourceToolBar() { - JToolBarFixture toolBarFixture = guiFixture.findEventSourceToolBar(); - toolBarFixture.radioButton("Sequential mode").click(); - toolBarFixture.radioButton("Loop mode").click(); - toolBarFixture.radioButton("Random mode").click(); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/InteractionToolBarTest.java b/graphics/AtlantisJava/test/src/guitest/InteractionToolBarTest.java deleted file mode 100644 index ffe8a982a4094894171bcb65961b28c2efad4b19..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/InteractionToolBarTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package guitest; - -import java.awt.event.KeyEvent; - -import org.fest.swing.fixture.JComboBoxFixture; -import org.fest.swing.fixture.JTextComponentFixture; -import org.fest.swing.fixture.JToolBarFixture; -import org.junit.Test; - -import static guitest.AAssert.*; - -public class InteractionToolBarTest extends AtlantisGuiTestCase { - @Test - public void testInteractionToolBar() { - JToolBarFixture toolBarFixture = guiFixture.findInteractionToolBar(); - - toolBarFixture.toggleButton("ZMR").click(); - - toolBarFixture.toggleButton("RubberBand").click(); - JComboBoxFixture rubberBandComboBox = toolBarFixture.comboBox(); - String[] listRubberBand = rubberBandComboBox.contents(); - String[] expectedRubberBand = {"RectangleYX","RotatedRectangle","Parallelogram", - "Square","XSkew","YSkew","XSlice","YSlice"}; - assertArrayEqualsIgnoreOrder("Didn't find expected rubberband list",expectedRubberBand,listRubberBand); - - toolBarFixture.toggleButton("Pick").click(); - JComboBoxFixture pickComboBox = toolBarFixture.comboBox(); - String[] listPick = pickComboBox.contents(); - String[] expectedPick = {"Event Data","Detectors"}; - assertArrayEqualsIgnoreOrder("Didn't find expected pick list",expectedPick,listPick); - - toolBarFixture.toggleButton("SyncCursors").click(); - - toolBarFixture.toggleButton("FishEye").click(); - JTextComponentFixture textBox = toolBarFixture.textBox(); - textBox.setText(""); // deleteText() does not work - textBox.enterText("5.0"); // this does not press "enter", so... - textBox.pressAndReleaseKeys(KeyEvent.VK_ENTER); // we do it here - toolBarFixture.checkBox().click(); // turn off fish-eye - toolBarFixture.checkBox().click(); // turn it on again - - toolBarFixture.toggleButton("Clock").click(); - toolBarFixture.checkBox().click(); // turn on clock transformation - toolBarFixture.checkBox().click(); // turn it on again - - toolBarFixture.toggleButton("Scale").click(); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/LoadEventFailureTest.java b/graphics/AtlantisJava/test/src/guitest/LoadEventFailureTest.java deleted file mode 100644 index 48e2cabb35b83f12fac39e7d088de0998b3fbaa4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/LoadEventFailureTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package guitest; - -import java.awt.Dialog; -import java.io.File; -import org.junit.Test; -import static org.junit.Assert.*; -import org.fest.swing.core.matcher.DialogMatcher; -import org.fest.swing.exception.ComponentLookupException; - -public class LoadEventFailureTest extends AtlantisGuiTestCase { - @Test - public void loadEvent() { - guiFixture.openEventFile(new File("/nosuchfile")); - try { - Dialog dialogInvalid = finder.find(DialogMatcher.withTitle("Invalid source")); - // OK, correctly failed to open file - } - catch (ComponentLookupException e) { - fail("Did not find invalid source dialog when opening non-existent event file"); - } - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/LoadEventTest.java b/graphics/AtlantisJava/test/src/guitest/LoadEventTest.java deleted file mode 100644 index 7bfcaef27e665d8746fc24eefa61d72f396ca41c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/LoadEventTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package guitest; - -import static org.junit.Assert.*; - -import java.awt.Dialog; -import java.io.File; - -import org.fest.swing.core.matcher.DialogMatcher; -import org.fest.swing.exception.ComponentLookupException; -import org.junit.Test; - -public class LoadEventTest extends AtlantisGuiTestCase { - @Test - public void loadEvent() { - String eventsDirectory = System.getProperty("atlantis.test.events"); - guiFixture.openEventFile(new File(eventsDirectory,"muonCollections.xml")); - try { - Dialog dialogInvalid = finder.find(DialogMatcher.withTitle("Invalid source")); - fail("Failed to open event: found invalid source dialog"); - } - catch (ComponentLookupException e) { - // OK - } - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/LoadEventWithInvalidRecVertexDataTest.java b/graphics/AtlantisJava/test/src/guitest/LoadEventWithInvalidRecVertexDataTest.java deleted file mode 100644 index 7cb70d7e2c553744b9612312f1aa28e12e98d0b7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/LoadEventWithInvalidRecVertexDataTest.java +++ /dev/null @@ -1,29 +0,0 @@ -package guitest; - -import static org.junit.Assert.*; - -import java.awt.Dialog; -import java.io.File; - -import org.fest.swing.core.matcher.DialogMatcher; -import org.fest.swing.exception.ComponentLookupException; -import org.junit.Test; - -public class LoadEventWithInvalidRecVertexDataTest extends AtlantisGuiTestCase { - @Test - public void loadEvent() { - String output = stdOutCopy.toString(); - assertTrue("Output does not contain \"Atlantis Ready\"",output.contains("Atlantis Ready")); - String eventsDirectory = System.getProperty("atlantis.test.events"); - guiFixture.openEventFile(new File(eventsDirectory,"rvxInconsistentEvent.xml")); - try { - Dialog dialogInvalid = finder.find(DialogMatcher.withTitle("Invalid source")); - fail("Failed to open event: found invalid source dialog"); - } - catch (ComponentLookupException e) { - // OK - } - output = stdOutCopy.toString(); - assertTrue("Failed to detect inconsistent track numbers",output.contains("RVx: numbers of tracks are inconsistent.")); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/LoadEventWithValidRecVertexDataTest.java b/graphics/AtlantisJava/test/src/guitest/LoadEventWithValidRecVertexDataTest.java deleted file mode 100644 index 846af19bf93d9b8e27b4d6d8de92d65672c4dbf4..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/LoadEventWithValidRecVertexDataTest.java +++ /dev/null @@ -1,29 +0,0 @@ -package guitest; - -import static org.junit.Assert.*; - -import java.awt.Dialog; -import java.io.File; - -import org.fest.swing.core.matcher.DialogMatcher; -import org.fest.swing.exception.ComponentLookupException; -import org.junit.Test; - -public class LoadEventWithValidRecVertexDataTest extends AtlantisGuiTestCase { - @Test - public void loadEvent() { - String output = stdOutCopy.toString(); - assertTrue("Output does not contain \"Atlantis Ready\"",output.contains("Atlantis Ready")); - String eventsDirectory = System.getProperty("atlantis.test.events"); - guiFixture.openEventFile(new File(eventsDirectory,"rvxEvent.xml")); - try { - Dialog dialogInvalid = finder.find(DialogMatcher.withTitle("Invalid source")); - fail("Failed to open event: found invalid source dialog"); - } - catch (ComponentLookupException e) { - // OK - } - output = stdOutCopy.toString(); - assertFalse("Inconsistent data incorrectly detected",output.contains("RVx: numbers of tracks are inconsistent.")); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/LoadEventsManyTimesTest.java b/graphics/AtlantisJava/test/src/guitest/LoadEventsManyTimesTest.java deleted file mode 100644 index d395260b2f4a45fd5c673352a71bfb5b066e09bb..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/LoadEventsManyTimesTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package guitest; - -import java.io.File; -import org.junit.Test; -import org.fest.swing.fixture.JButtonFixture; -import org.fest.swing.fixture.JToolBarFixture; - -public class LoadEventsManyTimesTest extends AtlantisGuiTestCase { - - private static final int numEvents = 9; - private static final int numRepeats = 3; - - @Test(timeout=45000) - public void readEvents() { - String eventsDirectory = System.getProperty("atlantis.test.events"); - guiFixture.openEventFileAndCheck(new File(eventsDirectory,"masterclassMuonEvents.zip")); - JToolBarFixture toolBarFixture = guiFixture.findEventSourceToolBar(); - JButtonFixture nextButton = toolBarFixture.button("nextButton"); - JButtonFixture previousButton = toolBarFixture.button("previousButton"); - for (int i=0; i<numRepeats; i++) { - for (int iEvent=0; iEvent<(numEvents-1); iEvent++) { - System.out.println("Click number "+iEvent); - nextButton.click(); - } - for (int iEvent=0; iEvent<(numEvents-1); iEvent++) { - System.out.println("Click number "+iEvent); - previousButton.click(); - } - } - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/MuonTrackCollectionsEmptyTest.java b/graphics/AtlantisJava/test/src/guitest/MuonTrackCollectionsEmptyTest.java deleted file mode 100644 index dddeb873b61f792b27b43724d6af9dd8a207643c..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/MuonTrackCollectionsEmptyTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package guitest; - -import java.io.File; -import org.junit.Test; -import org.fest.swing.fixture.JComboBoxFixture; -import org.fest.swing.fixture.JTableCellFixture; -import static guitest.AAssert.*; - -/** - * Check list of muon track collections for Trac bug #507 - * Should be empty in empty event! - * @author waugh - * - */ -public class MuonTrackCollectionsEmptyTest extends AtlantisGuiTestCase { - @Test - public void loadEvents() { - String eventsDirectory = System.getProperty("atlantis.test.events"); - guiFixture.openEventFileAndCheck(new File(eventsDirectory,"muonCollections.xml")); - checkMuonTrackCollections("ConvertedMBoyTracks", - "ConvertedMBoyMuonSpectroOnlyTracks", - "All"); - guiFixture.openEventFileAndCheck(new File(eventsDirectory,"emptyEvent.xml")); - checkMuonTrackCollections("None"); - } - - private void checkMuonTrackCollections(String... expected) { - String[] contents = getMuonTrackCollections(); - assertArrayEqualsIgnoreOrder("Didn't find expected collections",expected,contents); - } - - private String[] getMuonTrackCollections() { - JTableCellFixture cell = guiFixture.findParameterCell("MuonDet","Track","Track Collections"); - cell.click(); - JComboBoxFixture comboBox = guiFixture.comboBox("Track Collections"); - String[] contents = comboBox.contents(); - return contents; - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/MuonTrackCollectionsTest.java b/graphics/AtlantisJava/test/src/guitest/MuonTrackCollectionsTest.java deleted file mode 100644 index 8ee5814913a44daa52b195255c26bff78204dc7d..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/MuonTrackCollectionsTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package guitest; - -import java.io.File; -import org.junit.Test; -import org.fest.swing.fixture.JComboBoxFixture; -import org.fest.swing.fixture.JTableCellFixture; -import static guitest.AAssert.*; - -/** - * Check list of muon track collections for Trac bug #507 - * @author waugh - * - */ -public class MuonTrackCollectionsTest extends AtlantisGuiTestCase { - @Test - public void loadEvents() { - String eventsDirectory = System.getProperty("atlantis.test.events"); - guiFixture.openEventFileAndCheck(new File(eventsDirectory,"muonCollections.xml")); - checkMuonTrackCollections("ConvertedMBoyTracks", - "ConvertedMBoyMuonSpectroOnlyTracks", - "All"); - guiFixture.openEventFileAndCheck(new File(eventsDirectory,"muonCollections2.xml")); - checkMuonTrackCollections("ConvertedMBoyTracks", - "ConvertedMuIdCBTracks", - "All"); - } - - private void checkMuonTrackCollections(String... expected) { - String[] contents = getMuonTrackCollections(); - assertArrayEqualsIgnoreOrder("Didn't find expected collections",expected,contents); - } - - private String[] getMuonTrackCollections() { - JTableCellFixture cell = guiFixture.findParameterCell("MuonDet","Track","Track Collections"); - cell.click(); - JComboBoxFixture comboBox = guiFixture.comboBox("Track Collections"); - String[] contents = comboBox.contents(); - return contents; - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/OverlayTest.java b/graphics/AtlantisJava/test/src/guitest/OverlayTest.java deleted file mode 100644 index d35ca958746d7f01c2f12a0de9f6536e87c449e6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/OverlayTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package guitest; - -import org.junit.Test; -import org.fest.swing.data.TableCellByColumnId; -import org.fest.swing.fixture.JTableCellFixture; -import org.fest.swing.fixture.JTableFixture; - -public class OverlayTest extends AtlantisGuiTestCase { - - @Test - public void testOverlay() { - JTableFixture table = guiFixture.findParametersTable("Appearance","Logo"); - int row = 0; - JTableCellFixture check = table.cell(TableCellByColumnId.row(row).columnId("Name")); - //check the box to show logo - check.click(); - //change the x position - JTableCellFixture logox = guiFixture.findParameterCell("Appearance","Logo", "Logo X"); - logox.enterValue("0.5\n"); - //resize - JTableCellFixture size = guiFixture.findParameterCell("Appearance","Logo", "Logo Size"); - size.enterValue("0.7\n"); - size.click(); - //now uncheck the box - check.click(); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/ProjectionsTest.java b/graphics/AtlantisJava/test/src/guitest/ProjectionsTest.java deleted file mode 100644 index 3b32476ab894e4c3a28e83e0235ebce3e8ca397e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/ProjectionsTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package guitest; - -import org.fest.swing.fixture.JPanelFixture; -import org.junit.Test; - -import static atlantis.utils.AMath.*; // for Greek letters - -public class ProjectionsTest extends AtlantisGuiTestCase { - @Test - public void testWindowControls() { - JPanelFixture windowControls = guiFixture.panel("windowControl"); - windowControls.label("W").click(); - guiFixture.findParametersTable("Projection","YX").click(); - guiFixture.findParametersTable("Projection",PHI+ETA).click(); - guiFixture.findParametersTable("Projection",RHO+"Z").click(); - guiFixture.findParametersTable("Projection",PHI+RHO).click(); - guiFixture.findParametersTable("Projection",PHI+"Z").click(); - guiFixture.findParametersTable("Projection","X'Z").click(); - guiFixture.findParametersTable("Projection","Y'Z").click(); - guiFixture.findParametersTable("Projection","3DBox").click(); - guiFixture.findParametersTable("Projection","LegoPlot").click(); - guiFixture.findParametersTable("Projection","Event Info").click(); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/ReadNextAndPreviousEventTest.java b/graphics/AtlantisJava/test/src/guitest/ReadNextAndPreviousEventTest.java deleted file mode 100644 index 4849224a4a4953c661f2b31032a1db38f1c2b527..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/ReadNextAndPreviousEventTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package guitest; - -import java.awt.Dialog; - -import org.fest.swing.core.matcher.DialogMatcher; -import org.fest.swing.core.matcher.JButtonMatcher; -import org.fest.swing.fixture.DialogFixture; -import org.fest.swing.fixture.JButtonFixture; -import org.fest.swing.fixture.JToolBarFixture; -import org.junit.Test; - -public class ReadNextAndPreviousEventTest extends AtlantisGuiTestCase { - - @Test - public void readNextThenPreviousEvent() { - JToolBarFixture toolBarFixture = guiFixture.findEventSourceToolBar(); - JButtonFixture nextButton = toolBarFixture.button("nextButton"); - JButtonFixture previousButton = toolBarFixture.button("previousButton"); - nextButton.click(); - previousButton.click(); - guiFixture.menuItemWithPath("File", "Exit").click(); - DialogMatcher matcherConfirmExit = DialogMatcher.withTitle("Exit Atlantis"); - Dialog dialogConfirmExit = finder.find(matcherConfirmExit); - DialogFixture fixtureDialogConfirmExit = new DialogFixture(robot,dialogConfirmExit); - // fixtureDialogConfirmExit.button(JButtonMatcher.withText("Yes")).click(); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/StartAndExitTest.java b/graphics/AtlantisJava/test/src/guitest/StartAndExitTest.java deleted file mode 100644 index ec93dce67c4369a1a415fe3c2f54716baffc2b83..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/StartAndExitTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package guitest; - -import java.awt.Dialog; -import org.junit.Test; -import org.fest.swing.core.matcher.DialogMatcher; -import org.fest.swing.core.matcher.JButtonMatcher; -import org.fest.swing.fixture.DialogFixture; - -public class StartAndExitTest extends AtlantisGuiTestCase { - - @Test - public void atlantisStarts() { - guiFixture.menuItemWithPath("File", "Exit").click(); - DialogMatcher matcherConfirmExit = DialogMatcher.withTitle("Exit Atlantis"); - Dialog dialogConfirmExit = finder.find(matcherConfirmExit); - DialogFixture fixtureDialogConfirmExit = new DialogFixture(robot,dialogConfirmExit); - fixtureDialogConfirmExit.button(JButtonMatcher.withText("Yes")).click(); - } -} diff --git a/graphics/AtlantisJava/test/src/guitest/TabsTest.java b/graphics/AtlantisJava/test/src/guitest/TabsTest.java deleted file mode 100644 index 11ba9148e3b546a544edee70f38e6cc72725c3f7..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/guitest/TabsTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package guitest; - -import org.junit.Test; -import org.fest.swing.fixture.JTableFixture; - -public class TabsTest extends AtlantisGuiTestCase { - - @Test - public void testTabs() { - JTableFixture table = guiFixture.findParametersTable("MuonDet","Segment"); - // Click on cell: does nothing but checks we have found required cell - table.cell(table.cell("Segment Collections")).click(); - guiFixture.findParametersTable("Projection","YX"); - guiFixture.findParametersTable("Data","Data"); - guiFixture.findParametersTable("Cuts","Calo"); - guiFixture.findParametersTable("InDet","SpacePoint"); - guiFixture.findParametersTable("Calo","HEC"); - guiFixture.findParametersTable("MuonDet","MDT"); - guiFixture.findParametersTable("Objects","Muon"); - guiFixture.findParametersTable("Detector","Geo"); - guiFixture.findParametersTable("Appearance","Logo"); - } -} diff --git a/graphics/AtlantisJava/test/src/testutils/AtlantisInit.java b/graphics/AtlantisJava/test/src/testutils/AtlantisInit.java deleted file mode 100644 index d1732aec9f84e5a421d933295881e8f4346209c6..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/testutils/AtlantisInit.java +++ /dev/null @@ -1,20 +0,0 @@ -package testutils; - -import atlantis.Atlantis; -import atlantis.globals.AGlobals; - -/** - * Do Atlantis initialization for tests: things that would be set up by main() in the - * full application, and require access to protected Atlantis members. - * - * @author waugh - * - */ -public class AtlantisInit extends Atlantis { - - public static void init() { - String homeDirectory = Atlantis.getHomeDirectory(); - AGlobals.instance().setHomeDirectory(homeDirectory); - } - -} diff --git a/graphics/AtlantisJava/test/src/testutils/TeeOutputStream.java b/graphics/AtlantisJava/test/src/testutils/TeeOutputStream.java deleted file mode 100644 index e490cc19821d8c932e41d3825b94444677efb76e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/testutils/TeeOutputStream.java +++ /dev/null @@ -1,34 +0,0 @@ -package testutils; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * Wraps any number of OutputStreams and directs input to all of them. - * @author waugh - * - */ -public class TeeOutputStream extends OutputStream { - private List<OutputStream> streams; - - /** - * Create a TeeOutputStream that writes to the given OutputStreams. - * @param outputStreams the OutputStreams to be wrapped - */ - public TeeOutputStream(OutputStream... outputStreams) { - streams = new ArrayList<OutputStream>(); - for (OutputStream stream : outputStreams) { - streams.add(stream); - } - } - - @Override - public void write(int b) throws IOException { - for (OutputStream stream : streams) { - stream.write(b); - } - } - -} diff --git a/graphics/AtlantisJava/test/src/testutils/TestUtils.java b/graphics/AtlantisJava/test/src/testutils/TestUtils.java deleted file mode 100644 index d9b580329146e7be599335b06292d2c086e12c4e..0000000000000000000000000000000000000000 --- a/graphics/AtlantisJava/test/src/testutils/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package testutils; - -public class TestUtils { - - /** - * Set system property if it doesn't already have a value. - * Useful in providing sensible defaults for properties set in build file when - * using Ant. - * @param key - * @param value - */ - public static void setPropertyIfNotSet(String key, String value) { - String old = System.getProperty(key); - if (old==null) System.setProperty(key,value); - } - -}