// Do NOT change. Changes will be lost next time file is generated

#define R__DICTIONARY_FILENAME dIhomedIyuhwdIwcdIwiremIcelldIbuilddI2dtoydIWCP2dToyDict
#define R__NO_DEPRECATION

/*******************************************************************/
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define G__DICTIONARY
#include "RConfig.h"
#include "TClass.h"
#include "TDictAttributeMap.h"
#include "TInterpreter.h"
#include "TROOT.h"
#include "TBuffer.h"
#include "TMemberInspector.h"
#include "TInterpreter.h"
#include "TVirtualMutex.h"
#include "TError.h"

#ifndef G__ROOT
#define G__ROOT
#endif

#include "RtypesImp.h"
#include "TIsAProxy.h"
#include "TFileMergeInfo.h"
#include <algorithm>
#include "TCollectionProxyInfo.h"
/*******************************************************************/

#include "TDataMember.h"

// The generated code does not explicitly qualifies STL entities
namespace std {} using namespace std;

// Header files passed as explicit arguments
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/BadTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/BlobMetric.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/BlobToyTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/CalcPoints.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/CaveToyTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ChargeSolving.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ClusterDisplay.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/DataSignalGaus.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/DataSignalGaus_2D.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/DataSignalGaus_ROI.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/DataSignalWien.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/DataSignalWien_2D.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/DataSignalWien_ROI.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ExamineBundles.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ExecMon.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/FrameDataSource.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ImprovePR3DCluster.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/LowmemTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/MatrixSolver.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/MemUsage.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/MergeToyTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/SimpleBlobToyTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/TimeKeeper.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/TotalTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyClustering.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyCosmic.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyCrawler.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyDataQuality.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyDepositor.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyEventDisplay.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyFiducial.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyHypothesis.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyLibPe.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyLightReco.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMatching.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMatrix.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMatrixExclusive.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMatrixIterate.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMatrixIterate_Only.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMatrixIterate_SingleWire.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMatrixKalman.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMatrixMarkov.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyMetric.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToySignalGaus.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToySignalPre.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToySignalSimu.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToySignalSimuDead.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToySignalSimuTrue.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToySignalWien.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyTracking.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/ToyWalking.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/TruthToyTiling.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/WCCosmic.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/WCPHolder.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/pd_Data_FDS.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/uBooNE_Data_2D_Deconvolution.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/uBooNE_Data_After_ROI.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/uBooNE_Data_After_ROI_gaus.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/uBooNE_Data_Error.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/uBooNE_Data_ROI.h"
#include "/home/yuhw/wc/wire-cell/2dtoy/inc/WCP2dToy/uBooNE_L1SP.h"

// Header files passed via #pragma extra_include

namespace WCP2dToy {
   namespace ROOT {
      inline ::ROOT::TGenericClassInfo *GenerateInitInstance();
      static TClass *WCP2dToy_Dictionary();

      // Function generating the singleton type initializer
      inline ::ROOT::TGenericClassInfo *GenerateInitInstance()
      {
         static ::ROOT::TGenericClassInfo 
            instance("WCP2dToy", 0 /*version*/, "", 12,
                     ::ROOT::Internal::DefineBehavior((void*)0,(void*)0),
                     &WCP2dToy_Dictionary, 0);
         return &instance;
      }
      // Insure that the inline function is _not_ optimized away by the compiler
      ::ROOT::TGenericClassInfo *(*_R__UNIQUE_DICT_(InitFunctionKeeper))() = &GenerateInitInstance;  
      // Static variable to force the class initialization
      static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstance(); R__UseDummy(_R__UNIQUE_DICT_(Init));

      // Dictionary for non-ClassDef classes
      static TClass *WCP2dToy_Dictionary() {
         return GenerateInitInstance()->GetClass();
      }

   }
}

namespace ROOT {
   static void *new_WCP2dToycLcLToyTiling(void *p = 0);
   static void *newArray_WCP2dToycLcLToyTiling(Long_t size, void *p);
   static void delete_WCP2dToycLcLToyTiling(void *p);
   static void deleteArray_WCP2dToycLcLToyTiling(void *p);
   static void destruct_WCP2dToycLcLToyTiling(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::ToyTiling*)
   {
      ::WCP2dToy::ToyTiling *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::WCP2dToy::ToyTiling >(0);
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::ToyTiling", ::WCP2dToy::ToyTiling::Class_Version(), "WCP2dToy/ToyTiling.h", 16,
                  typeid(::WCP2dToy::ToyTiling), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &::WCP2dToy::ToyTiling::Dictionary, isa_proxy, 4,
                  sizeof(::WCP2dToy::ToyTiling) );
      instance.SetNew(&new_WCP2dToycLcLToyTiling);
      instance.SetNewArray(&newArray_WCP2dToycLcLToyTiling);
      instance.SetDelete(&delete_WCP2dToycLcLToyTiling);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLToyTiling);
      instance.SetDestructor(&destruct_WCP2dToycLcLToyTiling);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::ToyTiling*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::ToyTiling*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::ToyTiling*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));
} // end of namespace ROOT

namespace ROOT {
   static void *new_WCP2dToycLcLMergeToyTiling(void *p = 0);
   static void *newArray_WCP2dToycLcLMergeToyTiling(Long_t size, void *p);
   static void delete_WCP2dToycLcLMergeToyTiling(void *p);
   static void deleteArray_WCP2dToycLcLMergeToyTiling(void *p);
   static void destruct_WCP2dToycLcLMergeToyTiling(void *p);
   static void streamer_WCP2dToycLcLMergeToyTiling(TBuffer &buf, void *obj);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::MergeToyTiling*)
   {
      ::WCP2dToy::MergeToyTiling *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::WCP2dToy::MergeToyTiling >(0);
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::MergeToyTiling", ::WCP2dToy::MergeToyTiling::Class_Version(), "WCP2dToy/MergeToyTiling.h", 7,
                  typeid(::WCP2dToy::MergeToyTiling), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &::WCP2dToy::MergeToyTiling::Dictionary, isa_proxy, 16,
                  sizeof(::WCP2dToy::MergeToyTiling) );
      instance.SetNew(&new_WCP2dToycLcLMergeToyTiling);
      instance.SetNewArray(&newArray_WCP2dToycLcLMergeToyTiling);
      instance.SetDelete(&delete_WCP2dToycLcLMergeToyTiling);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLMergeToyTiling);
      instance.SetDestructor(&destruct_WCP2dToycLcLMergeToyTiling);
      instance.SetStreamerFunc(&streamer_WCP2dToycLcLMergeToyTiling);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::MergeToyTiling*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::MergeToyTiling*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::MergeToyTiling*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));
} // end of namespace ROOT

namespace ROOT {
   static TClass *WCP2dToycLcLToyMatrix_Dictionary();
   static void WCP2dToycLcLToyMatrix_TClassManip(TClass*);
   static void *new_WCP2dToycLcLToyMatrix(void *p = 0);
   static void *newArray_WCP2dToycLcLToyMatrix(Long_t size, void *p);
   static void delete_WCP2dToycLcLToyMatrix(void *p);
   static void deleteArray_WCP2dToycLcLToyMatrix(void *p);
   static void destruct_WCP2dToycLcLToyMatrix(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::ToyMatrix*)
   {
      ::WCP2dToy::ToyMatrix *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP2dToy::ToyMatrix));
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::ToyMatrix", "WCP2dToy/ToyMatrix.h", 13,
                  typeid(::WCP2dToy::ToyMatrix), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCP2dToycLcLToyMatrix_Dictionary, isa_proxy, 0,
                  sizeof(::WCP2dToy::ToyMatrix) );
      instance.SetNew(&new_WCP2dToycLcLToyMatrix);
      instance.SetNewArray(&newArray_WCP2dToycLcLToyMatrix);
      instance.SetDelete(&delete_WCP2dToycLcLToyMatrix);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLToyMatrix);
      instance.SetDestructor(&destruct_WCP2dToycLcLToyMatrix);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::ToyMatrix*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::ToyMatrix*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::ToyMatrix*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCP2dToycLcLToyMatrix_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::ToyMatrix*)0x0)->GetClass();
      WCP2dToycLcLToyMatrix_TClassManip(theClass);
   return theClass;
   }

   static void WCP2dToycLcLToyMatrix_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static void delete_WCP2dToycLcLSimpleBlobToyTiling(void *p);
   static void deleteArray_WCP2dToycLcLSimpleBlobToyTiling(void *p);
   static void destruct_WCP2dToycLcLSimpleBlobToyTiling(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::SimpleBlobToyTiling*)
   {
      ::WCP2dToy::SimpleBlobToyTiling *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::WCP2dToy::SimpleBlobToyTiling >(0);
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::SimpleBlobToyTiling", ::WCP2dToy::SimpleBlobToyTiling::Class_Version(), "WCP2dToy/SimpleBlobToyTiling.h", 15,
                  typeid(::WCP2dToy::SimpleBlobToyTiling), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &::WCP2dToy::SimpleBlobToyTiling::Dictionary, isa_proxy, 4,
                  sizeof(::WCP2dToy::SimpleBlobToyTiling) );
      instance.SetDelete(&delete_WCP2dToycLcLSimpleBlobToyTiling);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLSimpleBlobToyTiling);
      instance.SetDestructor(&destruct_WCP2dToycLcLSimpleBlobToyTiling);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::SimpleBlobToyTiling*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::SimpleBlobToyTiling*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::SimpleBlobToyTiling*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));
} // end of namespace ROOT

namespace ROOT {
   static void delete_WCP2dToycLcLBlobToyTiling(void *p);
   static void deleteArray_WCP2dToycLcLBlobToyTiling(void *p);
   static void destruct_WCP2dToycLcLBlobToyTiling(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::BlobToyTiling*)
   {
      ::WCP2dToy::BlobToyTiling *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::WCP2dToy::BlobToyTiling >(0);
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::BlobToyTiling", ::WCP2dToy::BlobToyTiling::Class_Version(), "", 80,
                  typeid(::WCP2dToy::BlobToyTiling), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &::WCP2dToy::BlobToyTiling::Dictionary, isa_proxy, 4,
                  sizeof(::WCP2dToy::BlobToyTiling) );
      instance.SetDelete(&delete_WCP2dToycLcLBlobToyTiling);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLBlobToyTiling);
      instance.SetDestructor(&destruct_WCP2dToycLcLBlobToyTiling);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::BlobToyTiling*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::BlobToyTiling*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::BlobToyTiling*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));
} // end of namespace ROOT

namespace ROOT {
   static void delete_WCP2dToycLcLCaveToyTiling(void *p);
   static void deleteArray_WCP2dToycLcLCaveToyTiling(void *p);
   static void destruct_WCP2dToycLcLCaveToyTiling(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::CaveToyTiling*)
   {
      ::WCP2dToy::CaveToyTiling *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::WCP2dToy::CaveToyTiling >(0);
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::CaveToyTiling", ::WCP2dToy::CaveToyTiling::Class_Version(), "", 138,
                  typeid(::WCP2dToy::CaveToyTiling), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &::WCP2dToy::CaveToyTiling::Dictionary, isa_proxy, 4,
                  sizeof(::WCP2dToy::CaveToyTiling) );
      instance.SetDelete(&delete_WCP2dToycLcLCaveToyTiling);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLCaveToyTiling);
      instance.SetDestructor(&destruct_WCP2dToycLcLCaveToyTiling);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::CaveToyTiling*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::CaveToyTiling*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::CaveToyTiling*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));
} // end of namespace ROOT

namespace ROOT {
   static TClass *WCP2dToycLcLToyMatrixIterate_Dictionary();
   static void WCP2dToycLcLToyMatrixIterate_TClassManip(TClass*);
   static void delete_WCP2dToycLcLToyMatrixIterate(void *p);
   static void deleteArray_WCP2dToycLcLToyMatrixIterate(void *p);
   static void destruct_WCP2dToycLcLToyMatrixIterate(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::ToyMatrixIterate*)
   {
      ::WCP2dToy::ToyMatrixIterate *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP2dToy::ToyMatrixIterate));
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::ToyMatrixIterate", "", 2291,
                  typeid(::WCP2dToy::ToyMatrixIterate), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCP2dToycLcLToyMatrixIterate_Dictionary, isa_proxy, 0,
                  sizeof(::WCP2dToy::ToyMatrixIterate) );
      instance.SetDelete(&delete_WCP2dToycLcLToyMatrixIterate);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLToyMatrixIterate);
      instance.SetDestructor(&destruct_WCP2dToycLcLToyMatrixIterate);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::ToyMatrixIterate*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::ToyMatrixIterate*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::ToyMatrixIterate*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCP2dToycLcLToyMatrixIterate_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::ToyMatrixIterate*)0x0)->GetClass();
      WCP2dToycLcLToyMatrixIterate_TClassManip(theClass);
   return theClass;
   }

   static void WCP2dToycLcLToyMatrixIterate_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static TClass *WCP2dToycLcLToyMatrixMarkov_Dictionary();
   static void WCP2dToycLcLToyMatrixMarkov_TClassManip(TClass*);
   static void delete_WCP2dToycLcLToyMatrixMarkov(void *p);
   static void deleteArray_WCP2dToycLcLToyMatrixMarkov(void *p);
   static void destruct_WCP2dToycLcLToyMatrixMarkov(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::ToyMatrixMarkov*)
   {
      ::WCP2dToy::ToyMatrixMarkov *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP2dToy::ToyMatrixMarkov));
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::ToyMatrixMarkov", "", 2467,
                  typeid(::WCP2dToy::ToyMatrixMarkov), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCP2dToycLcLToyMatrixMarkov_Dictionary, isa_proxy, 0,
                  sizeof(::WCP2dToy::ToyMatrixMarkov) );
      instance.SetDelete(&delete_WCP2dToycLcLToyMatrixMarkov);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLToyMatrixMarkov);
      instance.SetDestructor(&destruct_WCP2dToycLcLToyMatrixMarkov);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::ToyMatrixMarkov*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::ToyMatrixMarkov*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::ToyMatrixMarkov*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCP2dToycLcLToyMatrixMarkov_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::ToyMatrixMarkov*)0x0)->GetClass();
      WCP2dToycLcLToyMatrixMarkov_TClassManip(theClass);
   return theClass;
   }

   static void WCP2dToycLcLToyMatrixMarkov_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static void *new_WCP2dToycLcLTruthToyTiling(void *p = 0);
   static void *newArray_WCP2dToycLcLTruthToyTiling(Long_t size, void *p);
   static void delete_WCP2dToycLcLTruthToyTiling(void *p);
   static void deleteArray_WCP2dToycLcLTruthToyTiling(void *p);
   static void destruct_WCP2dToycLcLTruthToyTiling(void *p);
   static void streamer_WCP2dToycLcLTruthToyTiling(TBuffer &buf, void *obj);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP2dToy::TruthToyTiling*)
   {
      ::WCP2dToy::TruthToyTiling *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::WCP2dToy::TruthToyTiling >(0);
      static ::ROOT::TGenericClassInfo 
         instance("WCP2dToy::TruthToyTiling", ::WCP2dToy::TruthToyTiling::Class_Version(), "", 3235,
                  typeid(::WCP2dToy::TruthToyTiling), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &::WCP2dToy::TruthToyTiling::Dictionary, isa_proxy, 16,
                  sizeof(::WCP2dToy::TruthToyTiling) );
      instance.SetNew(&new_WCP2dToycLcLTruthToyTiling);
      instance.SetNewArray(&newArray_WCP2dToycLcLTruthToyTiling);
      instance.SetDelete(&delete_WCP2dToycLcLTruthToyTiling);
      instance.SetDeleteArray(&deleteArray_WCP2dToycLcLTruthToyTiling);
      instance.SetDestructor(&destruct_WCP2dToycLcLTruthToyTiling);
      instance.SetStreamerFunc(&streamer_WCP2dToycLcLTruthToyTiling);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP2dToy::TruthToyTiling*)
   {
      return GenerateInitInstanceLocal((::WCP2dToy::TruthToyTiling*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP2dToy::TruthToyTiling*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));
} // end of namespace ROOT

namespace WCP2dToy {
//______________________________________________________________________________
atomic_TClass_ptr ToyTiling::fgIsA(0);  // static to hold class pointer

//______________________________________________________________________________
const char *ToyTiling::Class_Name()
{
   return "WCP2dToy::ToyTiling";
}

//______________________________________________________________________________
const char *ToyTiling::ImplFileName()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::ToyTiling*)0x0)->GetImplFileName();
}

//______________________________________________________________________________
int ToyTiling::ImplFileLine()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::ToyTiling*)0x0)->GetImplFileLine();
}

//______________________________________________________________________________
TClass *ToyTiling::Dictionary()
{
   fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::ToyTiling*)0x0)->GetClass();
   return fgIsA;
}

//______________________________________________________________________________
TClass *ToyTiling::Class()
{
   if (!fgIsA.load()) { R__LOCKGUARD(gInterpreterMutex); fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::ToyTiling*)0x0)->GetClass(); }
   return fgIsA;
}

} // namespace WCP2dToy
namespace WCP2dToy {
//______________________________________________________________________________
atomic_TClass_ptr MergeToyTiling::fgIsA(0);  // static to hold class pointer

//______________________________________________________________________________
const char *MergeToyTiling::Class_Name()
{
   return "WCP2dToy::MergeToyTiling";
}

//______________________________________________________________________________
const char *MergeToyTiling::ImplFileName()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::MergeToyTiling*)0x0)->GetImplFileName();
}

//______________________________________________________________________________
int MergeToyTiling::ImplFileLine()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::MergeToyTiling*)0x0)->GetImplFileLine();
}

//______________________________________________________________________________
TClass *MergeToyTiling::Dictionary()
{
   fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::MergeToyTiling*)0x0)->GetClass();
   return fgIsA;
}

//______________________________________________________________________________
TClass *MergeToyTiling::Class()
{
   if (!fgIsA.load()) { R__LOCKGUARD(gInterpreterMutex); fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::MergeToyTiling*)0x0)->GetClass(); }
   return fgIsA;
}

} // namespace WCP2dToy
namespace WCP2dToy {
//______________________________________________________________________________
atomic_TClass_ptr SimpleBlobToyTiling::fgIsA(0);  // static to hold class pointer

//______________________________________________________________________________
const char *SimpleBlobToyTiling::Class_Name()
{
   return "WCP2dToy::SimpleBlobToyTiling";
}

//______________________________________________________________________________
const char *SimpleBlobToyTiling::ImplFileName()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::SimpleBlobToyTiling*)0x0)->GetImplFileName();
}

//______________________________________________________________________________
int SimpleBlobToyTiling::ImplFileLine()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::SimpleBlobToyTiling*)0x0)->GetImplFileLine();
}

//______________________________________________________________________________
TClass *SimpleBlobToyTiling::Dictionary()
{
   fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::SimpleBlobToyTiling*)0x0)->GetClass();
   return fgIsA;
}

//______________________________________________________________________________
TClass *SimpleBlobToyTiling::Class()
{
   if (!fgIsA.load()) { R__LOCKGUARD(gInterpreterMutex); fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::SimpleBlobToyTiling*)0x0)->GetClass(); }
   return fgIsA;
}

} // namespace WCP2dToy
namespace WCP2dToy {
//______________________________________________________________________________
atomic_TClass_ptr BlobToyTiling::fgIsA(0);  // static to hold class pointer

//______________________________________________________________________________
const char *BlobToyTiling::Class_Name()
{
   return "WCP2dToy::BlobToyTiling";
}

//______________________________________________________________________________
const char *BlobToyTiling::ImplFileName()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::BlobToyTiling*)0x0)->GetImplFileName();
}

//______________________________________________________________________________
int BlobToyTiling::ImplFileLine()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::BlobToyTiling*)0x0)->GetImplFileLine();
}

//______________________________________________________________________________
TClass *BlobToyTiling::Dictionary()
{
   fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::BlobToyTiling*)0x0)->GetClass();
   return fgIsA;
}

//______________________________________________________________________________
TClass *BlobToyTiling::Class()
{
   if (!fgIsA.load()) { R__LOCKGUARD(gInterpreterMutex); fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::BlobToyTiling*)0x0)->GetClass(); }
   return fgIsA;
}

} // namespace WCP2dToy
namespace WCP2dToy {
//______________________________________________________________________________
atomic_TClass_ptr CaveToyTiling::fgIsA(0);  // static to hold class pointer

//______________________________________________________________________________
const char *CaveToyTiling::Class_Name()
{
   return "WCP2dToy::CaveToyTiling";
}

//______________________________________________________________________________
const char *CaveToyTiling::ImplFileName()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::CaveToyTiling*)0x0)->GetImplFileName();
}

//______________________________________________________________________________
int CaveToyTiling::ImplFileLine()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::CaveToyTiling*)0x0)->GetImplFileLine();
}

//______________________________________________________________________________
TClass *CaveToyTiling::Dictionary()
{
   fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::CaveToyTiling*)0x0)->GetClass();
   return fgIsA;
}

//______________________________________________________________________________
TClass *CaveToyTiling::Class()
{
   if (!fgIsA.load()) { R__LOCKGUARD(gInterpreterMutex); fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::CaveToyTiling*)0x0)->GetClass(); }
   return fgIsA;
}

} // namespace WCP2dToy
namespace WCP2dToy {
//______________________________________________________________________________
atomic_TClass_ptr TruthToyTiling::fgIsA(0);  // static to hold class pointer

//______________________________________________________________________________
const char *TruthToyTiling::Class_Name()
{
   return "WCP2dToy::TruthToyTiling";
}

//______________________________________________________________________________
const char *TruthToyTiling::ImplFileName()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::TruthToyTiling*)0x0)->GetImplFileName();
}

//______________________________________________________________________________
int TruthToyTiling::ImplFileLine()
{
   return ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::TruthToyTiling*)0x0)->GetImplFileLine();
}

//______________________________________________________________________________
TClass *TruthToyTiling::Dictionary()
{
   fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::TruthToyTiling*)0x0)->GetClass();
   return fgIsA;
}

//______________________________________________________________________________
TClass *TruthToyTiling::Class()
{
   if (!fgIsA.load()) { R__LOCKGUARD(gInterpreterMutex); fgIsA = ::ROOT::GenerateInitInstanceLocal((const ::WCP2dToy::TruthToyTiling*)0x0)->GetClass(); }
   return fgIsA;
}

} // namespace WCP2dToy
namespace WCP2dToy {
//______________________________________________________________________________
void ToyTiling::Streamer(TBuffer &R__b)
{
   // Stream an object of class WCP2dToy::ToyTiling.

   if (R__b.IsReading()) {
      R__b.ReadClassBuffer(WCP2dToy::ToyTiling::Class(),this);
   } else {
      R__b.WriteClassBuffer(WCP2dToy::ToyTiling::Class(),this);
   }
}

} // namespace WCP2dToy
namespace ROOT {
   // Wrappers around operator new
   static void *new_WCP2dToycLcLToyTiling(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP2dToy::ToyTiling : new ::WCP2dToy::ToyTiling;
   }
   static void *newArray_WCP2dToycLcLToyTiling(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP2dToy::ToyTiling[nElements] : new ::WCP2dToy::ToyTiling[nElements];
   }
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLToyTiling(void *p) {
      delete ((::WCP2dToy::ToyTiling*)p);
   }
   static void deleteArray_WCP2dToycLcLToyTiling(void *p) {
      delete [] ((::WCP2dToy::ToyTiling*)p);
   }
   static void destruct_WCP2dToycLcLToyTiling(void *p) {
      typedef ::WCP2dToy::ToyTiling current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP2dToy::ToyTiling

namespace WCP2dToy {
//______________________________________________________________________________
void MergeToyTiling::Streamer(TBuffer &R__b)
{
   // Stream an object of class WCP2dToy::MergeToyTiling.

   //This works around a msvc bug and should be harmless on other platforms
   typedef ::WCP2dToy::MergeToyTiling thisClass;
   UInt_t R__s, R__c;
   if (R__b.IsReading()) {
      Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
      //This works around a msvc bug and should be harmless on other platforms
      typedef WCP2dToy::ToyTiling baseClass0;
      baseClass0::Streamer(R__b);
      R__b >> IsRemerged;
      {
         WCP::GeomCellMap &R__stl =  cellmap1;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("cellmap1 streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> >));
         if (R__tcl2==0) {
            Error("cellmap1 streamer","Missing the TClass object for class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> >!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomCell* R__t;
            R__t = (const WCP::GeomCell*)R__b.ReadObjectAny(R__tcl1);
            vector<const WCP::GeomWire*> R__t2;
            R__b.StreamObject(&R__t2,R__tcl2);
            typedef const class WCP::GeomCell * Value_t;
            std::pair<Value_t const, class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> > > R__t3(R__t,R__t2);
            R__stl.insert(R__t3);
         }
      }
      {
         WCP::GeomWireMap &R__stl =  wiremap1;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomWire *));
         if (R__tcl1==0) {
            Error("wiremap1 streamer","Missing the TClass object for const class WCP::GeomWire *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> >));
         if (R__tcl2==0) {
            Error("wiremap1 streamer","Missing the TClass object for class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> >!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomWire* R__t;
            R__t = (const WCP::GeomWire*)R__b.ReadObjectAny(R__tcl1);
            vector<const WCP::GeomCell*> R__t2;
            R__b.StreamObject(&R__t2,R__tcl2);
            typedef const class WCP::GeomWire * Value_t;
            std::pair<Value_t const, class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> > > R__t3(R__t,R__t2);
            R__stl.insert(R__t3);
         }
      }
      {
         WCP::GeomWireWireMap &R__stl =  wwmap;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomWire *));
         if (R__tcl1==0) {
            Error("wwmap streamer","Missing the TClass object for const class WCP::GeomWire *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class WCP::GeomWire *));
         if (R__tcl2==0) {
            Error("wwmap streamer","Missing the TClass object for class WCP::GeomWire *!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomWire* R__t;
            R__t = (const WCP::GeomWire*)R__b.ReadObjectAny(R__tcl1);
            WCP::GeomWire* R__t2;
            R__t2 = (WCP::GeomWire*)R__b.ReadObjectAny(R__tcl2);
            typedef const class WCP::GeomWire * Value_t;
            std::pair<Value_t const, class WCP::GeomWire * > R__t3(R__t,R__t2);
            R__stl.insert(R__t3);
         }
      }
      {
         WCP::GeomWireWiresMap &R__stl =  wwsmap;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomWire *));
         if (R__tcl1==0) {
            Error("wwsmap streamer","Missing the TClass object for const class WCP::GeomWire *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> >));
         if (R__tcl2==0) {
            Error("wwsmap streamer","Missing the TClass object for class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> >!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomWire* R__t;
            R__t = (const WCP::GeomWire*)R__b.ReadObjectAny(R__tcl1);
            vector<const WCP::GeomWire*> R__t2;
            R__b.StreamObject(&R__t2,R__tcl2);
            typedef const class WCP::GeomWire * Value_t;
            std::pair<Value_t const, class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> > > R__t3(R__t,R__t2);
            R__stl.insert(R__t3);
         }
      }
      {
         WCP::GeomCellCellsMap &R__stl =  mcmcsmap;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("mcmcsmap streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> >));
         if (R__tcl2==0) {
            Error("mcmcsmap streamer","Missing the TClass object for class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> >!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomCell* R__t;
            R__t = (const WCP::GeomCell*)R__b.ReadObjectAny(R__tcl1);
            vector<const WCP::GeomCell*> R__t2;
            R__b.StreamObject(&R__t2,R__tcl2);
            typedef const class WCP::GeomCell * Value_t;
            std::pair<Value_t const, class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> > > R__t3(R__t,R__t2);
            R__stl.insert(R__t3);
         }
      }
      {
         WCP::GeomCellSelection &R__stl =  single_wire_cells;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("single_wire_cells streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         R__stl.reserve(R__n);
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomCell* R__t;
            R__t = (const WCP::GeomCell*)R__b.ReadObjectAny(R__tcl1);
            R__stl.push_back(R__t);
         }
      }
      {
         WCP::GeomCellSelection &R__stl =  three_wires_cells;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("three_wires_cells streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         R__stl.reserve(R__n);
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomCell* R__t;
            R__t = (const WCP::GeomCell*)R__b.ReadObjectAny(R__tcl1);
            R__stl.push_back(R__t);
         }
      }
      {
         WCP::GeomCellSelection &R__stl =  two_wires_cells;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("two_wires_cells streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         R__stl.reserve(R__n);
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomCell* R__t;
            R__t = (const WCP::GeomCell*)R__b.ReadObjectAny(R__tcl1);
            R__stl.push_back(R__t);
         }
      }
      R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
   } else {
      R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
      //This works around a msvc bug and should be harmless on other platforms
      typedef WCP2dToy::ToyTiling baseClass0;
      baseClass0::Streamer(R__b);
      R__b << IsRemerged;
      {
         WCP::GeomCellMap &R__stl =  cellmap1;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("cellmap1 streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> >));
         if (R__tcl2==0) {
            Error("cellmap1streamer","Missing the TClass object for class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> >!");
            return;
         }
            WCP::GeomCellMap::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny(((*R__k).first ),R__tcl1);
            R__b.StreamObject((vector<const WCP::GeomWire*>*)&((*R__k).second),R__tcl2);
            }
         }
      }
      {
         WCP::GeomWireMap &R__stl =  wiremap1;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomWire *));
         if (R__tcl1==0) {
            Error("wiremap1 streamer","Missing the TClass object for const class WCP::GeomWire *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> >));
         if (R__tcl2==0) {
            Error("wiremap1streamer","Missing the TClass object for class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> >!");
            return;
         }
            WCP::GeomWireMap::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny(((*R__k).first ),R__tcl1);
            R__b.StreamObject((vector<const WCP::GeomCell*>*)&((*R__k).second),R__tcl2);
            }
         }
      }
      {
         WCP::GeomWireWireMap &R__stl =  wwmap;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomWire *));
         if (R__tcl1==0) {
            Error("wwmap streamer","Missing the TClass object for const class WCP::GeomWire *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class WCP::GeomWire *));
         if (R__tcl2==0) {
            Error("wwmapstreamer","Missing the TClass object for class WCP::GeomWire *!");
            return;
         }
            WCP::GeomWireWireMap::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny(((*R__k).first ),R__tcl1);
            R__b.WriteObjectAny(((*R__k).second),R__tcl2);
            }
         }
      }
      {
         WCP::GeomWireWiresMap &R__stl =  wwsmap;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomWire *));
         if (R__tcl1==0) {
            Error("wwsmap streamer","Missing the TClass object for const class WCP::GeomWire *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> >));
         if (R__tcl2==0) {
            Error("wwsmapstreamer","Missing the TClass object for class std::vector<const class WCP::GeomWire *, class std::allocator<const class WCP::GeomWire *> >!");
            return;
         }
            WCP::GeomWireWiresMap::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny(((*R__k).first ),R__tcl1);
            R__b.StreamObject((vector<const WCP::GeomWire*>*)&((*R__k).second),R__tcl2);
            }
         }
      }
      {
         WCP::GeomCellCellsMap &R__stl =  mcmcsmap;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("mcmcsmap streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
         TClass *R__tcl2 = TBuffer::GetClass(typeid(class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> >));
         if (R__tcl2==0) {
            Error("mcmcsmapstreamer","Missing the TClass object for class std::vector<const class WCP::GeomCell *, class std::allocator<const class WCP::GeomCell *> >!");
            return;
         }
            WCP::GeomCellCellsMap::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny(((*R__k).first ),R__tcl1);
            R__b.StreamObject((vector<const WCP::GeomCell*>*)&((*R__k).second),R__tcl2);
            }
         }
      }
      {
         WCP::GeomCellSelection &R__stl =  single_wire_cells;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("single_wire_cells streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
            WCP::GeomCellSelection::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny((*R__k),R__tcl1);
            }
         }
      }
      {
         WCP::GeomCellSelection &R__stl =  three_wires_cells;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("three_wires_cells streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
            WCP::GeomCellSelection::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny((*R__k),R__tcl1);
            }
         }
      }
      {
         WCP::GeomCellSelection &R__stl =  two_wires_cells;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("two_wires_cells streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
            WCP::GeomCellSelection::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny((*R__k),R__tcl1);
            }
         }
      }
      R__b.SetByteCount(R__c, kTRUE);
   }
}

} // namespace WCP2dToy
namespace ROOT {
   // Wrappers around operator new
   static void *new_WCP2dToycLcLMergeToyTiling(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP2dToy::MergeToyTiling : new ::WCP2dToy::MergeToyTiling;
   }
   static void *newArray_WCP2dToycLcLMergeToyTiling(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP2dToy::MergeToyTiling[nElements] : new ::WCP2dToy::MergeToyTiling[nElements];
   }
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLMergeToyTiling(void *p) {
      delete ((::WCP2dToy::MergeToyTiling*)p);
   }
   static void deleteArray_WCP2dToycLcLMergeToyTiling(void *p) {
      delete [] ((::WCP2dToy::MergeToyTiling*)p);
   }
   static void destruct_WCP2dToycLcLMergeToyTiling(void *p) {
      typedef ::WCP2dToy::MergeToyTiling current_t;
      ((current_t*)p)->~current_t();
   }
   // Wrapper around a custom streamer member function.
   static void streamer_WCP2dToycLcLMergeToyTiling(TBuffer &buf, void *obj) {
      ((::WCP2dToy::MergeToyTiling*)obj)->::WCP2dToy::MergeToyTiling::Streamer(buf);
   }
} // end of namespace ROOT for class ::WCP2dToy::MergeToyTiling

namespace ROOT {
   // Wrappers around operator new
   static void *new_WCP2dToycLcLToyMatrix(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP2dToy::ToyMatrix : new ::WCP2dToy::ToyMatrix;
   }
   static void *newArray_WCP2dToycLcLToyMatrix(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP2dToy::ToyMatrix[nElements] : new ::WCP2dToy::ToyMatrix[nElements];
   }
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLToyMatrix(void *p) {
      delete ((::WCP2dToy::ToyMatrix*)p);
   }
   static void deleteArray_WCP2dToycLcLToyMatrix(void *p) {
      delete [] ((::WCP2dToy::ToyMatrix*)p);
   }
   static void destruct_WCP2dToycLcLToyMatrix(void *p) {
      typedef ::WCP2dToy::ToyMatrix current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP2dToy::ToyMatrix

namespace WCP2dToy {
//______________________________________________________________________________
void SimpleBlobToyTiling::Streamer(TBuffer &R__b)
{
   // Stream an object of class WCP2dToy::SimpleBlobToyTiling.

   if (R__b.IsReading()) {
      R__b.ReadClassBuffer(WCP2dToy::SimpleBlobToyTiling::Class(),this);
   } else {
      R__b.WriteClassBuffer(WCP2dToy::SimpleBlobToyTiling::Class(),this);
   }
}

} // namespace WCP2dToy
namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLSimpleBlobToyTiling(void *p) {
      delete ((::WCP2dToy::SimpleBlobToyTiling*)p);
   }
   static void deleteArray_WCP2dToycLcLSimpleBlobToyTiling(void *p) {
      delete [] ((::WCP2dToy::SimpleBlobToyTiling*)p);
   }
   static void destruct_WCP2dToycLcLSimpleBlobToyTiling(void *p) {
      typedef ::WCP2dToy::SimpleBlobToyTiling current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP2dToy::SimpleBlobToyTiling

namespace WCP2dToy {
//______________________________________________________________________________
void BlobToyTiling::Streamer(TBuffer &R__b)
{
   // Stream an object of class WCP2dToy::BlobToyTiling.

   if (R__b.IsReading()) {
      R__b.ReadClassBuffer(WCP2dToy::BlobToyTiling::Class(),this);
   } else {
      R__b.WriteClassBuffer(WCP2dToy::BlobToyTiling::Class(),this);
   }
}

} // namespace WCP2dToy
namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLBlobToyTiling(void *p) {
      delete ((::WCP2dToy::BlobToyTiling*)p);
   }
   static void deleteArray_WCP2dToycLcLBlobToyTiling(void *p) {
      delete [] ((::WCP2dToy::BlobToyTiling*)p);
   }
   static void destruct_WCP2dToycLcLBlobToyTiling(void *p) {
      typedef ::WCP2dToy::BlobToyTiling current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP2dToy::BlobToyTiling

namespace WCP2dToy {
//______________________________________________________________________________
void CaveToyTiling::Streamer(TBuffer &R__b)
{
   // Stream an object of class WCP2dToy::CaveToyTiling.

   if (R__b.IsReading()) {
      R__b.ReadClassBuffer(WCP2dToy::CaveToyTiling::Class(),this);
   } else {
      R__b.WriteClassBuffer(WCP2dToy::CaveToyTiling::Class(),this);
   }
}

} // namespace WCP2dToy
namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLCaveToyTiling(void *p) {
      delete ((::WCP2dToy::CaveToyTiling*)p);
   }
   static void deleteArray_WCP2dToycLcLCaveToyTiling(void *p) {
      delete [] ((::WCP2dToy::CaveToyTiling*)p);
   }
   static void destruct_WCP2dToycLcLCaveToyTiling(void *p) {
      typedef ::WCP2dToy::CaveToyTiling current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP2dToy::CaveToyTiling

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLToyMatrixIterate(void *p) {
      delete ((::WCP2dToy::ToyMatrixIterate*)p);
   }
   static void deleteArray_WCP2dToycLcLToyMatrixIterate(void *p) {
      delete [] ((::WCP2dToy::ToyMatrixIterate*)p);
   }
   static void destruct_WCP2dToycLcLToyMatrixIterate(void *p) {
      typedef ::WCP2dToy::ToyMatrixIterate current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP2dToy::ToyMatrixIterate

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLToyMatrixMarkov(void *p) {
      delete ((::WCP2dToy::ToyMatrixMarkov*)p);
   }
   static void deleteArray_WCP2dToycLcLToyMatrixMarkov(void *p) {
      delete [] ((::WCP2dToy::ToyMatrixMarkov*)p);
   }
   static void destruct_WCP2dToycLcLToyMatrixMarkov(void *p) {
      typedef ::WCP2dToy::ToyMatrixMarkov current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP2dToy::ToyMatrixMarkov

namespace WCP2dToy {
//______________________________________________________________________________
void TruthToyTiling::Streamer(TBuffer &R__b)
{
   // Stream an object of class WCP2dToy::TruthToyTiling.

   //This works around a msvc bug and should be harmless on other platforms
   typedef ::WCP2dToy::TruthToyTiling thisClass;
   UInt_t R__s, R__c;
   if (R__b.IsReading()) {
      Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
      //This works around a msvc bug and should be harmless on other platforms
      typedef WCP2dToy::ToyTiling baseClass0;
      baseClass0::Streamer(R__b);
      {
         WCP::CellChargeMap &R__stl =  cellchargemap;
         R__stl.clear();
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("cellchargemap streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
         int R__i, R__n;
         R__b >> R__n;
         for (R__i = 0; R__i < R__n; R__i++) {
            const WCP::GeomCell* R__t;
            R__t = (const WCP::GeomCell*)R__b.ReadObjectAny(R__tcl1);
            float R__t2;
            R__b >> R__t2;
            typedef const class WCP::GeomCell * Value_t;
            std::pair<Value_t const, float > R__t3(R__t,R__t2);
            R__stl.insert(R__t3);
         }
      }
      R__b >> offset;
      R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
   } else {
      R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
      //This works around a msvc bug and should be harmless on other platforms
      typedef WCP2dToy::ToyTiling baseClass0;
      baseClass0::Streamer(R__b);
      {
         WCP::CellChargeMap &R__stl =  cellchargemap;
         int R__n=int(R__stl.size());
         R__b << R__n;
         if(R__n) {
         TClass *R__tcl1 = TBuffer::GetClass(typeid(const class WCP::GeomCell *));
         if (R__tcl1==0) {
            Error("cellchargemap streamer","Missing the TClass object for const class WCP::GeomCell *!");
            return;
         }
            WCP::CellChargeMap::iterator R__k;
            for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
            R__b.WriteObjectAny(((*R__k).first ),R__tcl1);
            R__b << ((*R__k).second);
            }
         }
      }
      R__b << offset;
      R__b.SetByteCount(R__c, kTRUE);
   }
}

} // namespace WCP2dToy
namespace ROOT {
   // Wrappers around operator new
   static void *new_WCP2dToycLcLTruthToyTiling(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP2dToy::TruthToyTiling : new ::WCP2dToy::TruthToyTiling;
   }
   static void *newArray_WCP2dToycLcLTruthToyTiling(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP2dToy::TruthToyTiling[nElements] : new ::WCP2dToy::TruthToyTiling[nElements];
   }
   // Wrapper around operator delete
   static void delete_WCP2dToycLcLTruthToyTiling(void *p) {
      delete ((::WCP2dToy::TruthToyTiling*)p);
   }
   static void deleteArray_WCP2dToycLcLTruthToyTiling(void *p) {
      delete [] ((::WCP2dToy::TruthToyTiling*)p);
   }
   static void destruct_WCP2dToycLcLTruthToyTiling(void *p) {
      typedef ::WCP2dToy::TruthToyTiling current_t;
      ((current_t*)p)->~current_t();
   }
   // Wrapper around a custom streamer member function.
   static void streamer_WCP2dToycLcLTruthToyTiling(TBuffer &buf, void *obj) {
      ((::WCP2dToy::TruthToyTiling*)obj)->::WCP2dToy::TruthToyTiling::Streamer(buf);
   }
} // end of namespace ROOT for class ::WCP2dToy::TruthToyTiling

namespace ROOT {
   static TClass *vectorlEvectorlEintgRsPgR_Dictionary();
   static void vectorlEvectorlEintgRsPgR_TClassManip(TClass*);
   static void *new_vectorlEvectorlEintgRsPgR(void *p = 0);
   static void *newArray_vectorlEvectorlEintgRsPgR(Long_t size, void *p);
   static void delete_vectorlEvectorlEintgRsPgR(void *p);
   static void deleteArray_vectorlEvectorlEintgRsPgR(void *p);
   static void destruct_vectorlEvectorlEintgRsPgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const vector<vector<int> >*)
   {
      vector<vector<int> > *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(vector<vector<int> >));
      static ::ROOT::TGenericClassInfo 
         instance("vector<vector<int> >", -2, "vector", 386,
                  typeid(vector<vector<int> >), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &vectorlEvectorlEintgRsPgR_Dictionary, isa_proxy, 4,
                  sizeof(vector<vector<int> >) );
      instance.SetNew(&new_vectorlEvectorlEintgRsPgR);
      instance.SetNewArray(&newArray_vectorlEvectorlEintgRsPgR);
      instance.SetDelete(&delete_vectorlEvectorlEintgRsPgR);
      instance.SetDeleteArray(&deleteArray_vectorlEvectorlEintgRsPgR);
      instance.SetDestructor(&destruct_vectorlEvectorlEintgRsPgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<vector<int> > >()));

      ::ROOT::AddClassAlternate("vector<vector<int> >","std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const vector<vector<int> >*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *vectorlEvectorlEintgRsPgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const vector<vector<int> >*)0x0)->GetClass();
      vectorlEvectorlEintgRsPgR_TClassManip(theClass);
   return theClass;
   }

   static void vectorlEvectorlEintgRsPgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_vectorlEvectorlEintgRsPgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<vector<int> > : new vector<vector<int> >;
   }
   static void *newArray_vectorlEvectorlEintgRsPgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<vector<int> >[nElements] : new vector<vector<int> >[nElements];
   }
   // Wrapper around operator delete
   static void delete_vectorlEvectorlEintgRsPgR(void *p) {
      delete ((vector<vector<int> >*)p);
   }
   static void deleteArray_vectorlEvectorlEintgRsPgR(void *p) {
      delete [] ((vector<vector<int> >*)p);
   }
   static void destruct_vectorlEvectorlEintgRsPgR(void *p) {
      typedef vector<vector<int> > current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class vector<vector<int> >

namespace ROOT {
   static TClass *vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR_Dictionary();
   static void vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR_TClassManip(TClass*);
   static void *new_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(void *p = 0);
   static void *newArray_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(Long_t size, void *p);
   static void delete_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(void *p);
   static void deleteArray_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(void *p);
   static void destruct_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const vector<vector<const WCP::GeomCell*> >*)
   {
      vector<vector<const WCP::GeomCell*> > *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(vector<vector<const WCP::GeomCell*> >));
      static ::ROOT::TGenericClassInfo 
         instance("vector<vector<const WCP::GeomCell*> >", -2, "vector", 386,
                  typeid(vector<vector<const WCP::GeomCell*> >), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR_Dictionary, isa_proxy, 0,
                  sizeof(vector<vector<const WCP::GeomCell*> >) );
      instance.SetNew(&new_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR);
      instance.SetNewArray(&newArray_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR);
      instance.SetDelete(&delete_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR);
      instance.SetDeleteArray(&deleteArray_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR);
      instance.SetDestructor(&destruct_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<vector<const WCP::GeomCell*> > >()));

      ::ROOT::AddClassAlternate("vector<vector<const WCP::GeomCell*> >","std::vector<std::vector<WCP::GeomCell const*, std::allocator<WCP::GeomCell const*> >, std::allocator<std::vector<WCP::GeomCell const*, std::allocator<WCP::GeomCell const*> > > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const vector<vector<const WCP::GeomCell*> >*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const vector<vector<const WCP::GeomCell*> >*)0x0)->GetClass();
      vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR_TClassManip(theClass);
   return theClass;
   }

   static void vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<vector<const WCP::GeomCell*> > : new vector<vector<const WCP::GeomCell*> >;
   }
   static void *newArray_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<vector<const WCP::GeomCell*> >[nElements] : new vector<vector<const WCP::GeomCell*> >[nElements];
   }
   // Wrapper around operator delete
   static void delete_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(void *p) {
      delete ((vector<vector<const WCP::GeomCell*> >*)p);
   }
   static void deleteArray_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(void *p) {
      delete [] ((vector<vector<const WCP::GeomCell*> >*)p);
   }
   static void destruct_vectorlEvectorlEconstsPWCPcLcLGeomCellmUgRsPgR(void *p) {
      typedef vector<vector<const WCP::GeomCell*> > current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class vector<vector<const WCP::GeomCell*> >

namespace ROOT {
   static TClass *vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR_Dictionary();
   static void vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR_TClassManip(TClass*);
   static void *new_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(void *p = 0);
   static void *newArray_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(Long_t size, void *p);
   static void delete_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(void *p);
   static void deleteArray_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(void *p);
   static void destruct_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const vector<vector<const WCP2dToy::ToyHypothesis*> >*)
   {
      vector<vector<const WCP2dToy::ToyHypothesis*> > *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(vector<vector<const WCP2dToy::ToyHypothesis*> >));
      static ::ROOT::TGenericClassInfo 
         instance("vector<vector<const WCP2dToy::ToyHypothesis*> >", -2, "vector", 386,
                  typeid(vector<vector<const WCP2dToy::ToyHypothesis*> >), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR_Dictionary, isa_proxy, 0,
                  sizeof(vector<vector<const WCP2dToy::ToyHypothesis*> >) );
      instance.SetNew(&new_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR);
      instance.SetNewArray(&newArray_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR);
      instance.SetDelete(&delete_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR);
      instance.SetDeleteArray(&deleteArray_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR);
      instance.SetDestructor(&destruct_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<vector<const WCP2dToy::ToyHypothesis*> > >()));

      ::ROOT::AddClassAlternate("vector<vector<const WCP2dToy::ToyHypothesis*> >","std::vector<std::vector<WCP2dToy::ToyHypothesis const*, std::allocator<WCP2dToy::ToyHypothesis const*> >, std::allocator<std::vector<WCP2dToy::ToyHypothesis const*, std::allocator<WCP2dToy::ToyHypothesis const*> > > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const vector<vector<const WCP2dToy::ToyHypothesis*> >*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const vector<vector<const WCP2dToy::ToyHypothesis*> >*)0x0)->GetClass();
      vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR_TClassManip(theClass);
   return theClass;
   }

   static void vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<vector<const WCP2dToy::ToyHypothesis*> > : new vector<vector<const WCP2dToy::ToyHypothesis*> >;
   }
   static void *newArray_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<vector<const WCP2dToy::ToyHypothesis*> >[nElements] : new vector<vector<const WCP2dToy::ToyHypothesis*> >[nElements];
   }
   // Wrapper around operator delete
   static void delete_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(void *p) {
      delete ((vector<vector<const WCP2dToy::ToyHypothesis*> >*)p);
   }
   static void deleteArray_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(void *p) {
      delete [] ((vector<vector<const WCP2dToy::ToyHypothesis*> >*)p);
   }
   static void destruct_vectorlEvectorlEconstsPWCP2dToycLcLToyHypothesismUgRsPgR(void *p) {
      typedef vector<vector<const WCP2dToy::ToyHypothesis*> > current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class vector<vector<const WCP2dToy::ToyHypothesis*> >

namespace ROOT {
   static TClass *vectorlEintgR_Dictionary();
   static void vectorlEintgR_TClassManip(TClass*);
   static void *new_vectorlEintgR(void *p = 0);
   static void *newArray_vectorlEintgR(Long_t size, void *p);
   static void delete_vectorlEintgR(void *p);
   static void deleteArray_vectorlEintgR(void *p);
   static void destruct_vectorlEintgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const vector<int>*)
   {
      vector<int> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(vector<int>));
      static ::ROOT::TGenericClassInfo 
         instance("vector<int>", -2, "vector", 386,
                  typeid(vector<int>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &vectorlEintgR_Dictionary, isa_proxy, 4,
                  sizeof(vector<int>) );
      instance.SetNew(&new_vectorlEintgR);
      instance.SetNewArray(&newArray_vectorlEintgR);
      instance.SetDelete(&delete_vectorlEintgR);
      instance.SetDeleteArray(&deleteArray_vectorlEintgR);
      instance.SetDestructor(&destruct_vectorlEintgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<int> >()));

      ::ROOT::AddClassAlternate("vector<int>","std::vector<int, std::allocator<int> >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const vector<int>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *vectorlEintgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const vector<int>*)0x0)->GetClass();
      vectorlEintgR_TClassManip(theClass);
   return theClass;
   }

   static void vectorlEintgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_vectorlEintgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<int> : new vector<int>;
   }
   static void *newArray_vectorlEintgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<int>[nElements] : new vector<int>[nElements];
   }
   // Wrapper around operator delete
   static void delete_vectorlEintgR(void *p) {
      delete ((vector<int>*)p);
   }
   static void deleteArray_vectorlEintgR(void *p) {
      delete [] ((vector<int>*)p);
   }
   static void destruct_vectorlEintgR(void *p) {
      typedef vector<int> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class vector<int>

namespace ROOT {
   static TClass *vectorlEdoublegR_Dictionary();
   static void vectorlEdoublegR_TClassManip(TClass*);
   static void *new_vectorlEdoublegR(void *p = 0);
   static void *newArray_vectorlEdoublegR(Long_t size, void *p);
   static void delete_vectorlEdoublegR(void *p);
   static void deleteArray_vectorlEdoublegR(void *p);
   static void destruct_vectorlEdoublegR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const vector<double>*)
   {
      vector<double> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(vector<double>));
      static ::ROOT::TGenericClassInfo 
         instance("vector<double>", -2, "vector", 386,
                  typeid(vector<double>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &vectorlEdoublegR_Dictionary, isa_proxy, 0,
                  sizeof(vector<double>) );
      instance.SetNew(&new_vectorlEdoublegR);
      instance.SetNewArray(&newArray_vectorlEdoublegR);
      instance.SetDelete(&delete_vectorlEdoublegR);
      instance.SetDeleteArray(&deleteArray_vectorlEdoublegR);
      instance.SetDestructor(&destruct_vectorlEdoublegR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<double> >()));

      ::ROOT::AddClassAlternate("vector<double>","std::vector<double, std::allocator<double> >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const vector<double>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *vectorlEdoublegR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const vector<double>*)0x0)->GetClass();
      vectorlEdoublegR_TClassManip(theClass);
   return theClass;
   }

   static void vectorlEdoublegR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_vectorlEdoublegR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<double> : new vector<double>;
   }
   static void *newArray_vectorlEdoublegR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<double>[nElements] : new vector<double>[nElements];
   }
   // Wrapper around operator delete
   static void delete_vectorlEdoublegR(void *p) {
      delete ((vector<double>*)p);
   }
   static void deleteArray_vectorlEdoublegR(void *p) {
      delete [] ((vector<double>*)p);
   }
   static void destruct_vectorlEdoublegR(void *p) {
      typedef vector<double> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class vector<double>

namespace ROOT {
   static TClass *vectorlEconstsPWCPcLcLGeomWiremUgR_Dictionary();
   static void vectorlEconstsPWCPcLcLGeomWiremUgR_TClassManip(TClass*);
   static void *new_vectorlEconstsPWCPcLcLGeomWiremUgR(void *p = 0);
   static void *newArray_vectorlEconstsPWCPcLcLGeomWiremUgR(Long_t size, void *p);
   static void delete_vectorlEconstsPWCPcLcLGeomWiremUgR(void *p);
   static void deleteArray_vectorlEconstsPWCPcLcLGeomWiremUgR(void *p);
   static void destruct_vectorlEconstsPWCPcLcLGeomWiremUgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const vector<const WCP::GeomWire*>*)
   {
      vector<const WCP::GeomWire*> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(vector<const WCP::GeomWire*>));
      static ::ROOT::TGenericClassInfo 
         instance("vector<const WCP::GeomWire*>", -2, "vector", 386,
                  typeid(vector<const WCP::GeomWire*>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &vectorlEconstsPWCPcLcLGeomWiremUgR_Dictionary, isa_proxy, 0,
                  sizeof(vector<const WCP::GeomWire*>) );
      instance.SetNew(&new_vectorlEconstsPWCPcLcLGeomWiremUgR);
      instance.SetNewArray(&newArray_vectorlEconstsPWCPcLcLGeomWiremUgR);
      instance.SetDelete(&delete_vectorlEconstsPWCPcLcLGeomWiremUgR);
      instance.SetDeleteArray(&deleteArray_vectorlEconstsPWCPcLcLGeomWiremUgR);
      instance.SetDestructor(&destruct_vectorlEconstsPWCPcLcLGeomWiremUgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<const WCP::GeomWire*> >()));

      ::ROOT::AddClassAlternate("vector<const WCP::GeomWire*>","std::vector<WCP::GeomWire const*, std::allocator<WCP::GeomWire const*> >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const vector<const WCP::GeomWire*>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *vectorlEconstsPWCPcLcLGeomWiremUgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const vector<const WCP::GeomWire*>*)0x0)->GetClass();
      vectorlEconstsPWCPcLcLGeomWiremUgR_TClassManip(theClass);
   return theClass;
   }

   static void vectorlEconstsPWCPcLcLGeomWiremUgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_vectorlEconstsPWCPcLcLGeomWiremUgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<const WCP::GeomWire*> : new vector<const WCP::GeomWire*>;
   }
   static void *newArray_vectorlEconstsPWCPcLcLGeomWiremUgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<const WCP::GeomWire*>[nElements] : new vector<const WCP::GeomWire*>[nElements];
   }
   // Wrapper around operator delete
   static void delete_vectorlEconstsPWCPcLcLGeomWiremUgR(void *p) {
      delete ((vector<const WCP::GeomWire*>*)p);
   }
   static void deleteArray_vectorlEconstsPWCPcLcLGeomWiremUgR(void *p) {
      delete [] ((vector<const WCP::GeomWire*>*)p);
   }
   static void destruct_vectorlEconstsPWCPcLcLGeomWiremUgR(void *p) {
      typedef vector<const WCP::GeomWire*> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class vector<const WCP::GeomWire*>

namespace ROOT {
   static TClass *vectorlEconstsPWCPcLcLGeomCellmUgR_Dictionary();
   static void vectorlEconstsPWCPcLcLGeomCellmUgR_TClassManip(TClass*);
   static void *new_vectorlEconstsPWCPcLcLGeomCellmUgR(void *p = 0);
   static void *newArray_vectorlEconstsPWCPcLcLGeomCellmUgR(Long_t size, void *p);
   static void delete_vectorlEconstsPWCPcLcLGeomCellmUgR(void *p);
   static void deleteArray_vectorlEconstsPWCPcLcLGeomCellmUgR(void *p);
   static void destruct_vectorlEconstsPWCPcLcLGeomCellmUgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const vector<const WCP::GeomCell*>*)
   {
      vector<const WCP::GeomCell*> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(vector<const WCP::GeomCell*>));
      static ::ROOT::TGenericClassInfo 
         instance("vector<const WCP::GeomCell*>", -2, "vector", 386,
                  typeid(vector<const WCP::GeomCell*>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &vectorlEconstsPWCPcLcLGeomCellmUgR_Dictionary, isa_proxy, 0,
                  sizeof(vector<const WCP::GeomCell*>) );
      instance.SetNew(&new_vectorlEconstsPWCPcLcLGeomCellmUgR);
      instance.SetNewArray(&newArray_vectorlEconstsPWCPcLcLGeomCellmUgR);
      instance.SetDelete(&delete_vectorlEconstsPWCPcLcLGeomCellmUgR);
      instance.SetDeleteArray(&deleteArray_vectorlEconstsPWCPcLcLGeomCellmUgR);
      instance.SetDestructor(&destruct_vectorlEconstsPWCPcLcLGeomCellmUgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<const WCP::GeomCell*> >()));

      ::ROOT::AddClassAlternate("vector<const WCP::GeomCell*>","std::vector<WCP::GeomCell const*, std::allocator<WCP::GeomCell const*> >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const vector<const WCP::GeomCell*>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *vectorlEconstsPWCPcLcLGeomCellmUgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const vector<const WCP::GeomCell*>*)0x0)->GetClass();
      vectorlEconstsPWCPcLcLGeomCellmUgR_TClassManip(theClass);
   return theClass;
   }

   static void vectorlEconstsPWCPcLcLGeomCellmUgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_vectorlEconstsPWCPcLcLGeomCellmUgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<const WCP::GeomCell*> : new vector<const WCP::GeomCell*>;
   }
   static void *newArray_vectorlEconstsPWCPcLcLGeomCellmUgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<const WCP::GeomCell*>[nElements] : new vector<const WCP::GeomCell*>[nElements];
   }
   // Wrapper around operator delete
   static void delete_vectorlEconstsPWCPcLcLGeomCellmUgR(void *p) {
      delete ((vector<const WCP::GeomCell*>*)p);
   }
   static void deleteArray_vectorlEconstsPWCPcLcLGeomCellmUgR(void *p) {
      delete [] ((vector<const WCP::GeomCell*>*)p);
   }
   static void destruct_vectorlEconstsPWCPcLcLGeomCellmUgR(void *p) {
      typedef vector<const WCP::GeomCell*> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class vector<const WCP::GeomCell*>

namespace ROOT {
   static TClass *vectorlEconstsPWCP2dToycLcLToyHypothesismUgR_Dictionary();
   static void vectorlEconstsPWCP2dToycLcLToyHypothesismUgR_TClassManip(TClass*);
   static void *new_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(void *p = 0);
   static void *newArray_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(Long_t size, void *p);
   static void delete_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(void *p);
   static void deleteArray_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(void *p);
   static void destruct_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const vector<const WCP2dToy::ToyHypothesis*>*)
   {
      vector<const WCP2dToy::ToyHypothesis*> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(vector<const WCP2dToy::ToyHypothesis*>));
      static ::ROOT::TGenericClassInfo 
         instance("vector<const WCP2dToy::ToyHypothesis*>", -2, "vector", 386,
                  typeid(vector<const WCP2dToy::ToyHypothesis*>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &vectorlEconstsPWCP2dToycLcLToyHypothesismUgR_Dictionary, isa_proxy, 0,
                  sizeof(vector<const WCP2dToy::ToyHypothesis*>) );
      instance.SetNew(&new_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR);
      instance.SetNewArray(&newArray_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR);
      instance.SetDelete(&delete_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR);
      instance.SetDeleteArray(&deleteArray_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR);
      instance.SetDestructor(&destruct_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<const WCP2dToy::ToyHypothesis*> >()));

      ::ROOT::AddClassAlternate("vector<const WCP2dToy::ToyHypothesis*>","std::vector<WCP2dToy::ToyHypothesis const*, std::allocator<WCP2dToy::ToyHypothesis const*> >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const vector<const WCP2dToy::ToyHypothesis*>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *vectorlEconstsPWCP2dToycLcLToyHypothesismUgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const vector<const WCP2dToy::ToyHypothesis*>*)0x0)->GetClass();
      vectorlEconstsPWCP2dToycLcLToyHypothesismUgR_TClassManip(theClass);
   return theClass;
   }

   static void vectorlEconstsPWCP2dToycLcLToyHypothesismUgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<const WCP2dToy::ToyHypothesis*> : new vector<const WCP2dToy::ToyHypothesis*>;
   }
   static void *newArray_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) vector<const WCP2dToy::ToyHypothesis*>[nElements] : new vector<const WCP2dToy::ToyHypothesis*>[nElements];
   }
   // Wrapper around operator delete
   static void delete_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(void *p) {
      delete ((vector<const WCP2dToy::ToyHypothesis*>*)p);
   }
   static void deleteArray_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(void *p) {
      delete [] ((vector<const WCP2dToy::ToyHypothesis*>*)p);
   }
   static void destruct_vectorlEconstsPWCP2dToycLcLToyHypothesismUgR(void *p) {
      typedef vector<const WCP2dToy::ToyHypothesis*> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class vector<const WCP2dToy::ToyHypothesis*>

namespace ROOT {
   static TClass *maplEintcOfloatgR_Dictionary();
   static void maplEintcOfloatgR_TClassManip(TClass*);
   static void *new_maplEintcOfloatgR(void *p = 0);
   static void *newArray_maplEintcOfloatgR(Long_t size, void *p);
   static void delete_maplEintcOfloatgR(void *p);
   static void deleteArray_maplEintcOfloatgR(void *p);
   static void destruct_maplEintcOfloatgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<int,float>*)
   {
      map<int,float> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<int,float>));
      static ::ROOT::TGenericClassInfo 
         instance("map<int,float>", -2, "map", 100,
                  typeid(map<int,float>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEintcOfloatgR_Dictionary, isa_proxy, 0,
                  sizeof(map<int,float>) );
      instance.SetNew(&new_maplEintcOfloatgR);
      instance.SetNewArray(&newArray_maplEintcOfloatgR);
      instance.SetDelete(&delete_maplEintcOfloatgR);
      instance.SetDeleteArray(&deleteArray_maplEintcOfloatgR);
      instance.SetDestructor(&destruct_maplEintcOfloatgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<int,float> >()));

      ::ROOT::AddClassAlternate("map<int,float>","std::map<int, float, std::less<int>, std::allocator<std::pair<int const, float> > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<int,float>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEintcOfloatgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<int,float>*)0x0)->GetClass();
      maplEintcOfloatgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEintcOfloatgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEintcOfloatgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<int,float> : new map<int,float>;
   }
   static void *newArray_maplEintcOfloatgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<int,float>[nElements] : new map<int,float>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEintcOfloatgR(void *p) {
      delete ((map<int,float>*)p);
   }
   static void deleteArray_maplEintcOfloatgR(void *p) {
      delete [] ((map<int,float>*)p);
   }
   static void destruct_maplEintcOfloatgR(void *p) {
      typedef map<int,float> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<int,float>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>*)
   {
      map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>","std::map<WCP::GeomWire const*, std::vector<WCP::GeomWire const*, std::allocator<WCP::GeomWire const*> >, WCP::GeomWireComparep, std::allocator<std::pair<WCP::GeomWire const* const, std::vector<WCP::GeomWire const*, std::allocator<WCP::GeomWire const*> > > > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep> : new map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>[nElements] : new map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(void *p) {
      delete ((map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(void *p) {
      delete [] ((map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomWireComparepgR(void *p) {
      typedef map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomWire*,vector<const WCP::GeomWire*>,WCP::GeomWireComparep>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>*)
   {
      map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>","std::map<WCP::GeomWire const*, std::vector<WCP::GeomCell const*, std::allocator<WCP::GeomCell const*> >, WCP::GeomWireComparep, std::allocator<std::pair<WCP::GeomWire const* const, std::vector<WCP::GeomCell const*, std::allocator<WCP::GeomCell const*> > > > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep> : new map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>[nElements] : new map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(void *p) {
      delete ((map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(void *p) {
      delete [] ((map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomWireComparepgR(void *p) {
      typedef map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomWire*,vector<const WCP::GeomCell*>,WCP::GeomWireComparep>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomWire*,int,WCP::GeomWireComparep>*)
   {
      map<const WCP::GeomWire*,int,WCP::GeomWireComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomWire*,int,WCP::GeomWireComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomWire*,int,WCP::GeomWireComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomWire*,int,WCP::GeomWireComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomWire*,int,WCP::GeomWireComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomWire*,int,WCP::GeomWireComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomWire*,int,WCP::GeomWireComparep>","std::map<WCP::GeomWire const*, int, WCP::GeomWireComparep, std::allocator<std::pair<WCP::GeomWire const* const, int> > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomWire*,int,WCP::GeomWireComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomWire*,int,WCP::GeomWireComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,int,WCP::GeomWireComparep> : new map<const WCP::GeomWire*,int,WCP::GeomWireComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,int,WCP::GeomWireComparep>[nElements] : new map<const WCP::GeomWire*,int,WCP::GeomWireComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(void *p) {
      delete ((map<const WCP::GeomWire*,int,WCP::GeomWireComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(void *p) {
      delete [] ((map<const WCP::GeomWire*,int,WCP::GeomWireComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOintcOWCPcLcLGeomWireComparepgR(void *p) {
      typedef map<const WCP::GeomWire*,int,WCP::GeomWireComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomWire*,int,WCP::GeomWireComparep>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomWire*,float,WCP::GeomWireComparep>*)
   {
      map<const WCP::GeomWire*,float,WCP::GeomWireComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomWire*,float,WCP::GeomWireComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomWire*,float,WCP::GeomWireComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomWire*,float,WCP::GeomWireComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomWire*,float,WCP::GeomWireComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomWire*,float,WCP::GeomWireComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomWire*,float,WCP::GeomWireComparep>","std::map<WCP::GeomWire const*, float, WCP::GeomWireComparep, std::allocator<std::pair<WCP::GeomWire const* const, float> > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomWire*,float,WCP::GeomWireComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomWire*,float,WCP::GeomWireComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,float,WCP::GeomWireComparep> : new map<const WCP::GeomWire*,float,WCP::GeomWireComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,float,WCP::GeomWireComparep>[nElements] : new map<const WCP::GeomWire*,float,WCP::GeomWireComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(void *p) {
      delete ((map<const WCP::GeomWire*,float,WCP::GeomWireComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(void *p) {
      delete [] ((map<const WCP::GeomWire*,float,WCP::GeomWireComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOfloatcOWCPcLcLGeomWireComparepgR(void *p) {
      typedef map<const WCP::GeomWire*,float,WCP::GeomWireComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomWire*,float,WCP::GeomWireComparep>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>*)
   {
      map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>","std::map<WCP::GeomWire const*, WCP::GeomWire*, WCP::GeomWireComparep, std::allocator<std::pair<WCP::GeomWire const* const, WCP::GeomWire*> > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep> : new map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>[nElements] : new map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(void *p) {
      delete ((map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(void *p) {
      delete [] ((map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomWiremUcOWCPcLcLGeomWiremUcOWCPcLcLGeomWireComparepgR(void *p) {
      typedef map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomWire*,WCP::GeomWire*,WCP::GeomWireComparep>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>*)
   {
      map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>","std::map<WCP::GeomCell const*, std::vector<WCP::GeomWire const*, std::allocator<WCP::GeomWire const*> >, WCP::GeomCellComparep, std::allocator<std::pair<WCP::GeomCell const* const, std::vector<WCP::GeomWire const*, std::allocator<WCP::GeomWire const*> > > > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep> : new map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>[nElements] : new map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(void *p) {
      delete ((map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(void *p) {
      delete [] ((map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomWiremUgRcOWCPcLcLGeomCellComparepgR(void *p) {
      typedef map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomCell*,vector<const WCP::GeomWire*>,WCP::GeomCellComparep>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>*)
   {
      map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>","std::map<WCP::GeomCell const*, std::vector<WCP::GeomCell const*, std::allocator<WCP::GeomCell const*> >, WCP::GeomCellComparep, std::allocator<std::pair<WCP::GeomCell const* const, std::vector<WCP::GeomCell const*, std::allocator<WCP::GeomCell const*> > > > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep> : new map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>[nElements] : new map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(void *p) {
      delete ((map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(void *p) {
      delete [] ((map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomCellmUcOvectorlEconstsPWCPcLcLGeomCellmUgRcOWCPcLcLGeomCellComparepgR(void *p) {
      typedef map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomCell*,vector<const WCP::GeomCell*>,WCP::GeomCellComparep>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomCell*,int,WCP::GeomCellComparep>*)
   {
      map<const WCP::GeomCell*,int,WCP::GeomCellComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomCell*,int,WCP::GeomCellComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomCell*,int,WCP::GeomCellComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomCell*,int,WCP::GeomCellComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomCell*,int,WCP::GeomCellComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomCell*,int,WCP::GeomCellComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomCell*,int,WCP::GeomCellComparep>","std::map<WCP::GeomCell const*, int, WCP::GeomCellComparep, std::allocator<std::pair<WCP::GeomCell const* const, int> > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomCell*,int,WCP::GeomCellComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomCell*,int,WCP::GeomCellComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomCell*,int,WCP::GeomCellComparep> : new map<const WCP::GeomCell*,int,WCP::GeomCellComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomCell*,int,WCP::GeomCellComparep>[nElements] : new map<const WCP::GeomCell*,int,WCP::GeomCellComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(void *p) {
      delete ((map<const WCP::GeomCell*,int,WCP::GeomCellComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(void *p) {
      delete [] ((map<const WCP::GeomCell*,int,WCP::GeomCellComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomCellmUcOintcOWCPcLcLGeomCellComparepgR(void *p) {
      typedef map<const WCP::GeomCell*,int,WCP::GeomCellComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomCell*,int,WCP::GeomCellComparep>

namespace ROOT {
   static TClass *maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR_Dictionary();
   static void maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR_TClassManip(TClass*);
   static void *new_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(void *p = 0);
   static void *newArray_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(Long_t size, void *p);
   static void delete_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(void *p);
   static void deleteArray_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(void *p);
   static void destruct_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const map<const WCP::GeomCell*,float,WCP::GeomCellComparep>*)
   {
      map<const WCP::GeomCell*,float,WCP::GeomCellComparep> *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(map<const WCP::GeomCell*,float,WCP::GeomCellComparep>));
      static ::ROOT::TGenericClassInfo 
         instance("map<const WCP::GeomCell*,float,WCP::GeomCellComparep>", -2, "map", 100,
                  typeid(map<const WCP::GeomCell*,float,WCP::GeomCellComparep>), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR_Dictionary, isa_proxy, 0,
                  sizeof(map<const WCP::GeomCell*,float,WCP::GeomCellComparep>) );
      instance.SetNew(&new_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR);
      instance.SetNewArray(&newArray_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR);
      instance.SetDelete(&delete_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR);
      instance.SetDeleteArray(&deleteArray_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR);
      instance.SetDestructor(&destruct_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR);
      instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::MapInsert< map<const WCP::GeomCell*,float,WCP::GeomCellComparep> >()));

      ::ROOT::AddClassAlternate("map<const WCP::GeomCell*,float,WCP::GeomCellComparep>","std::map<WCP::GeomCell const*, float, WCP::GeomCellComparep, std::allocator<std::pair<WCP::GeomCell const* const, float> > >");
      return &instance;
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const map<const WCP::GeomCell*,float,WCP::GeomCellComparep>*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const map<const WCP::GeomCell*,float,WCP::GeomCellComparep>*)0x0)->GetClass();
      maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR_TClassManip(theClass);
   return theClass;
   }

   static void maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrappers around operator new
   static void *new_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomCell*,float,WCP::GeomCellComparep> : new map<const WCP::GeomCell*,float,WCP::GeomCellComparep>;
   }
   static void *newArray_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) map<const WCP::GeomCell*,float,WCP::GeomCellComparep>[nElements] : new map<const WCP::GeomCell*,float,WCP::GeomCellComparep>[nElements];
   }
   // Wrapper around operator delete
   static void delete_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(void *p) {
      delete ((map<const WCP::GeomCell*,float,WCP::GeomCellComparep>*)p);
   }
   static void deleteArray_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(void *p) {
      delete [] ((map<const WCP::GeomCell*,float,WCP::GeomCellComparep>*)p);
   }
   static void destruct_maplEconstsPWCPcLcLGeomCellmUcOfloatcOWCPcLcLGeomCellComparepgR(void *p) {
      typedef map<const WCP::GeomCell*,float,WCP::GeomCellComparep> current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class map<const WCP::GeomCell*,float,WCP::GeomCellComparep>

namespace {
  void TriggerDictionaryInitialization_WCP2dToyDict_Impl() {
    static const char* headers[] = {
"0",
0
    };
    static const char* includePaths[] = {
0
    };
    static const char* fwdDeclCode = R"DICTFWDDCLS(
#line 1 "WCP2dToyDict dictionary forward declarations' payload"
#pragma clang diagnostic ignored "-Wkeyword-compat"
#pragma clang diagnostic ignored "-Wignored-attributes"
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
extern int __Cling_AutoLoading_Map;
namespace std{template <typename _Tp> class __attribute__((annotate("$clingAutoload$bits/allocator.h")))  __attribute__((annotate("$clingAutoload$string")))  allocator;
}
namespace WCP2dToy{class __attribute__((annotate("$clingAutoload$WCP2dToy/ToyTiling.h")))  __attribute__((annotate("$clingAutoload$WCP2dToy/SimpleBlobToyTiling.h")))  ToyTiling;}
namespace WCP2dToy{class __attribute__((annotate("$clingAutoload$WCP2dToy/MergeToyTiling.h")))  __attribute__((annotate("$clingAutoload$WCP2dToy/SimpleBlobToyTiling.h")))  MergeToyTiling;}
namespace WCP2dToy{class __attribute__((annotate("$clingAutoload$WCP2dToy/ToyMatrix.h")))  __attribute__((annotate("$clingAutoload$WCP2dToy/SimpleBlobToyTiling.h")))  ToyMatrix;}
namespace WCP2dToy{class __attribute__((annotate("$clingAutoload$WCP2dToy/SimpleBlobToyTiling.h")))  SimpleBlobToyTiling;}
namespace WCP2dToy{class BlobToyTiling;}
namespace WCP2dToy{class CaveToyTiling;}
namespace WCP2dToy{class ToyMatrixIterate;}
namespace WCP2dToy{class ToyMatrixMarkov;}
namespace WCP2dToy{class TruthToyTiling;}
)DICTFWDDCLS";
    static const char* payloadCode = R"DICTPAYLOAD(
#line 1 "WCP2dToyDict dictionary payload"


#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers
#ifndef WIRECELL_BADTILING_H
#define WIRECELL_BADTILING_H

#include "WCPTiling/TilingBase.h"
#include "WCPData/MergeGeomWire.h"
#include "WCPData/GeomCell.h"
#include "WCPSst/GeomDataSource.h"
#include "WCPData/GeomWCPMap.h"

namespace WCP2dToy {
  class BadTiling {
  public :
    BadTiling(int time, int scale, WCP::ChirpMap& uplane_map, 
	      WCP::ChirpMap& vplane_map, WCP::ChirpMap& wplane_map, WCP::GeomDataSource& gds, int flag_1plane = 0, int flag_all = 0);
    void BadTiling1(int time, int scale, WCP::ChirpMap& uplane_map, WCP::ChirpMap& vplane_map, WCP::ChirpMap& wplane_map, WCP::GeomDataSource& gds, int flag_all = 0);

    WCP::GeomCellMap& cmap(){return cellmap;};
    ~BadTiling();

    WCP::GeomCellSelection& get_cell_all(){return cell_all;};
    
  protected :
    WCP::GeomWireSelection wire_u;
    WCP::GeomWireSelection wire_v;
    WCP::GeomWireSelection wire_w;
    
    WCP::GeomCellMap cellmap;

    WCP::GeomCellSelection cell_all;
  };
}


#endif
#ifndef WIRECELL_BLOBMETRIC_H
#define WIRECELL_BLOBMETRIC_H

#include "WCP2dToy/SimpleBlobToyTiling.h"
#include "WCPData/GeomCell.h"

namespace WCP2dToy{
  class BlobMetric{
  public:
    BlobMetric();
    virtual ~BlobMetric();
    
    void Add(WCP2dToy::SimpleBlobToyTiling &blobtiling, WCP::CellChargeMap& ccmap);
    void Print();
    
  private:
    int rm_cell_true; float charge_rm_cell_true; float Tcharge_rm_cell_true;
    int rm_cell_false; float charge_rm_cell_false;
    int el_cell_true;  float charge_el_cell_true; float Tcharge_el_cell_true;
    int el_cell_false; float charge_el_cell_false;
    
    

  };
}

#endif
#ifndef WIRECELL_BlobTOYTILING_H
#define WIRECELL_BlobTOYTILING_H


#include "WCP2dToy/MergeToyTiling.h"
#include "WCP2dToy/ToyMatrix.h"
#include "WCPData/GeomCell.h"
#include "WCPData/GeomWire.h"
#include "WCPData/MergeGeomCell.h"
#include "WCPData/MergeGeomWire.h"

#include "Rtypes.h"

namespace WCP2dToy{
  class BlobToyTiling : public WCP2dToy::MergeToyTiling {
  public:

    BlobToyTiling(WCP2dToy::ToyTiling& toytiling, WCP2dToy::MergeToyTiling& mergetiling, WCP2dToy::ToyMatrix& toymatrix, int time_slice, int num_merge_wire);
    ~BlobToyTiling();
    
    const WCP::GeomCell* cell(const WCP::GeomWireSelection& wires) const ;
    
  private:
    WCP::MergeGeomCell* FormMergeCell(WCP::MergeGeomWire* mwireu,WCP::MergeGeomWire* mwirev,WCP::MergeGeomWire* mwirew,int ident_cell, int time_slice);
    
    ToyTiling *tiling;
    
    int num_wire;
    
    WCP::GeomWireSelection wire_u1;
    WCP::GeomWireSelection wire_v1;
    WCP::GeomWireSelection wire_w1;


    WCP::GeomCellSelection remain_cells;
   

   
    ClassDef(BlobToyTiling,1);
  };
}
#endif
#ifndef WIRECELL_CALC_POINTS_H
#define WIRECELL_CALC_POINTS_H

#include "WCPSst/GeomDataSource.h"
#include "WCPData/PR3DCluster.h"

namespace WCP2dToy{
  void calc_boundary_points_dead(WCP::GeomDataSource& gds, WCP::PR3DCluster* cluster);
  void calc_sampling_points(WCP::GeomDataSource& gds, WCP::PR3DCluster* cluster, int nrebin, int frame_length, double unit_dis);

  void calc_boundary_points_dead(WCP::GeomDataSource& gds, WCP::SlimMergeGeomCell* mcell);
  void calc_sampling_points(WCP::GeomDataSource& gds, WCP::SlimMergeGeomCell* mcell, int nrebin, int frame_length, double unit_dis);
  
}

#endif
#ifndef WIRECELL_CAVETOYTILING_H
#define WIRECELL_CAVETOYTILING_H


#include "WCP2dToy/MergeToyTiling.h"
#include "WCP2dToy/ToyMatrix.h"
#include "WCPData/GeomCell.h"
#include "WCPData/GeomWire.h"
#include "WCPData/MergeGeomCell.h"
#include "WCPData/MergeGeomWire.h"

namespace WCP2dToy{
  class CaveToyTiling : public WCP2dToy::MergeToyTiling {
  public:

    CaveToyTiling(WCP2dToy::ToyTiling* toytiling1, WCP2dToy::MergeToyTiling& mergetiling, WCP2dToy::ToyMatrix& toymatrix);
    ~CaveToyTiling();
    
    const WCP::GeomCell* cell(const WCP::GeomWireSelection& wires) const ;
    
  private:
   
    WCP2dToy::ToyTiling *toytiling;

    WCP::GeomCellSelection cell_all_save; // save current state of merged cell before removing a cell
    WCP::GeomWireSelection wire_all_save;

    WCP::GeomCellMap cellmap_save;
    WCP::GeomWireMap wiremap_save;
    
    WCP::GeomWireWireMap wwmap_save;
    WCP::GeomWireWiresMap wwsmap_save;
    
  

    
    WCP::GeomCell* current_cell; // current ceull under consideration coming from cell_to_remove, then will be decided to put in cell_removed or cell_not_to_remove
    WCP::GeomCellSelection cell_removed; 
    WCP::GeomCellSelection cell_to_remove;
    WCP::GeomCellSelection cell_not_to_remove;


    
   

   ClassDef(CaveToyTiling,1);
   
    
  };
}
#endif
#ifndef WIRECELL_CHARGESOLVING_H
#define WIRECELL_CHARGESOLVING_H

#include "TMatrixD.h"
#include "TVectorD.h"
#include "WCPData/GeomCell.h"
#include "WCPData/GeomWire.h"
#include "WCPData/MergeGeomCell.h"
#include "WCPData/MergeGeomWire.h"
#include "WCP2dToy/LowmemTiling.h"
#include "WCP2dToy/MatrixSolver.h"

//#include <set>

namespace WCP2dToy{
  class ChargeSolving {
  public:
    ChargeSolving(const WCP::GeomDataSource& gds, LowmemTiling& tiling);
    virtual ~ChargeSolving();

    void L1_resolve(float weight, float reduce_weight_factor=3);
    
    int get_ndirect_solved(){return ndirect_solved;};
    int get_nL1_solved(){return nL1_solved;};

    double get_mcell_charge(const WCP::GeomCell *mcell){
      auto it = ccmap.find(mcell);
      if (it != ccmap.end()) return it->second;
      else return 0;};
    void Update_ndf_chi2();
    int get_ndf();
    double get_chi2();

    int get_L1_ndf(int i){ return L1_ndf.at(i);};
    int get_direct_ndf(int i){ return direct_ndf.at(i);};
    double get_L1_chi2_base(int i){ return L1_chi2_base.at(i);};
    double get_L1_chi2_penalty(int i){return L1_chi2_penalty.at(i);};
    double get_direct_chi2(int i){return direct_chi2.at(i);};

    void clear_connectivity(){front_connectivity.clear(); back_connectivity.clear();};
    void add_front_connectivity(const WCP::GeomCell *cell){ front_connectivity.insert(cell);};
    void add_back_connectivity(const WCP::GeomCell *cell){back_connectivity.insert(cell); };

    
    // information
    void update_information();
    float get_weight(WCP::GeomCell *cell);
    int get_matrix_id(WCP::GeomCell *cell);
    int get_mc_id(WCP::GeomCell *cell);
    double get_mc_lambda(WCP::GeomCell *cell);
    double get_mc_TOL(WCP::GeomCell *cell);

    int get_mw_id(WCP::GeomWire *mwire);
    double get_W(WCP::GeomWire *mwire);
    double get_G(WCP::GeomCell *cell, WCP::GeomWire *mwire);

    void divide_groups();
    void init_cell_weight_map(float weight=1);
    void update_cell_weight_map(float weight, float reduce_weight_factor);
    
  protected:
    int ndf;
    double chi2;

    int nL1_solved;
    std::vector<int> L1_ndf;
    std::vector<double> L1_chi2_base;
    std::vector<double> L1_chi2_penalty;
    
    int ndirect_solved;
    std::vector<int> direct_ndf;
    std::vector<double> direct_chi2;
    



    
    
    std::vector<WCP::GeomCellSelection> final_cells_vec;
    std::vector<WCP::GeomWireSelection> final_wires_vec;
    std::vector<WCP2dToy::MatrixSolver*> group_matrices;

    WCP::CellChargeMap ccmap;
    
    const WCP::GeomDataSource& gds;
    LowmemTiling& tiling;

    std::map<const WCP::GeomCell*, double, WCP::GeomCellComparep > cell_weight_map;
    
    std::set<const WCP::GeomCell*, WCP::GeomCellComparep > front_connectivity;
    std::set<const WCP::GeomCell*, WCP::GeomCellComparep > back_connectivity;

    //information ...
    std::map<const WCP::GeomCell*, int> map_mc_matrix_id;
    std::map<const WCP::GeomCell*, int> map_mc_index;
    std::map<const WCP::GeomCell*, double> map_mc_TOL;
    std::map<const WCP::GeomCell*, double> map_mc_lambda;
    
    std::map<const WCP::GeomWire*, int> map_mw_index;
    std::map<const WCP::GeomWire*, double> map_W;
    std::map<std::pair<const WCP::GeomCell*, const WCP::GeomWire*>, double> map_G;
    
  };

}

#endif
#ifndef WIRECELL2DTOY_CLUSTERDISPLAY_H
#define WIRECELL2DTOY_CLUSTERDISPLAY_H
#include "WCPData/Point.h"
#include "WCPData/SpaceCell.h"
#include "WCPData/MergeSpaceCell.h"

#include "WCP2dToy/ToyCrawler.h"
#include "WCP2dToy/ToyTracking.h"

#include "TPad.h"
#include "TH2F.h"
#include "TString.h"
#include "TGraph.h"
#include "TPolyLine.h"
#include "TString.h"

namespace WCP2dToy {

    class ClusterDisplay {
    private:
    
	TPad &pad;
	
    
    public:
	/// Create a ToyEventDisplay drawing into the given TPad using the given GeomDataSource.
	ClusterDisplay(TPad& pad);
	virtual ~ClusterDisplay();
    
	void DrawCluster(WCP::SpaceCellSelection& cells, TString option = "p0");
	void DrawCluster(WCP::MergeSpaceCellSelection& mcells, TString option = "p");
	void DrawCluster(WCP::MergeSpaceCellSelection& mcells, WCP2dToy::ToyTracking& toytracking);

	void DrawCrawler(ToyCrawler& toycrawler, TString option = "p", int flag = 0);
	void DrawHough(WCP::SpaceCellSelection& cells, WCP::Point& p, double dis_near, double dis_far);

	void DrawShower(WCP::WCShower* shower, TString option = "psame", int color = 2); 

	void DrawVertex(WCP::WCVertexSelection& vertices, TString option = "p");
	
	void DrawTracks(WCP::WCTrackSelection& tracks, TString option = "", int color = 1);
    };

}

#endif
#ifndef WIRECELL2dToy_DATASIGNALGAUS_H
#define WIRECELL2dToy_DATASIGNALGAUS_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class DataSignalGausFDS : public WCP::FrameDataSource
  {
  public:
    DataSignalGausFDS(WCP::FrameDataSource& fds,  const WCP::GeomDataSource& gds, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ~DataSignalGausFDS();

    virtual int size() const;
    virtual int jump(int frame_number);

    void Save();

  private:
    WCP::FrameDataSource& fds;
    const WCP::GeomDataSource& gds;
    int max_frames;
    int nbin;

    float time_offset_uv;
    float time_offset_uw;
    float overall_time_offset;
    
    int nwire_u, nwire_v, nwire_w;

    /* TH1F **hu; */
    /* TH1F **hv; */
    /* TH1F **hw; */

    TH1F *hu;
    TH1F *hv;
    TH1F *hw;

    TH1F *hfilter_time_gaus;
    TH1 *hfilter_gaus;
    TF1 *filter_g;

    TH1F *hur, *hvr, *hwr;

    TGraph *gu, *gv, *gw;

    TH1 *hmr_u, *hpr_u;
    TH1 *hmr_v, *hpr_v;
    TH1 *hmr_w, *hpr_w;
    
  };

}

#endif
#ifndef WIRECELL2dToy_DATASIGNALGAUS_H
#define WIRECELL2dToy_DATASIGNALGAUS_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class DataSignalGaus2DFDS : public WCP::FrameDataSource
  {
  public:
    DataSignalGaus2DFDS(WCP::FrameDataSource& fds,  const WCP::GeomDataSource& gds, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ~DataSignalGaus2DFDS();

    virtual int size() const;
    virtual int jump(int frame_number);

    void Save();

  private:
    WCP::FrameDataSource& fds;
    const WCP::GeomDataSource& gds;
    int max_frames;
    int nbin;

    float time_offset_uv;
    float time_offset_uw;
    float overall_time_offset;
    
    int nwire_u, nwire_v, nwire_w;

    /* TH1F **hu; */
    /* TH1F **hv; */
    /* TH1F **hw; */

    TH1F *hu;
    TH1F *hv;
    TH1F *hw;

    TH1F *hfilter_time_gaus;
    TH1 *hfilter_gaus;
    TF1 *filter_g;

    TH1F *hur, *hvr, *hwr;

    TGraph *gu, *gv, *gw;

    TH1 *hmr_u, *hpr_u;
    TH1 *hmr_v, *hpr_v;
    TH1 *hmr_w, *hpr_w;
    
  };

}

#endif
#ifndef WIRECELL2dToy_DATASIGNALGAUSROI_H
#define WIRECELL2dToy_DATASIGNALGAUSROI_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCP2dToy/DataSignalWien_ROI.h"
#include "TH2I.h"

namespace WCP2dToy {
  class DataSignalGausROIFDS : public WCP::FrameDataSource
  {
  public:
    DataSignalGausROIFDS(DataSignalWienROIFDS& fds, int nframes_total);
    ~DataSignalGausROIFDS();

    virtual int size() const;
    virtual int jump(int frame_number);

  private:
    int  max_frames;
    DataSignalWienROIFDS& fds;
    
  };
}

#endif
#ifndef WIRECELL2dToy_DATASIGNALWIEN_H
#define WIRECELL2dToy_DATASIGNALWIEN_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPData/GeomWire.h"
#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class DataSignalWienFDS : public WCP::FrameDataSource
  {
  public:
    DataSignalWienFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, WCP::ChirpMap& umap, WCP::ChirpMap& vmap, WCP::ChirpMap& wmap, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ~DataSignalWienFDS();

    virtual int size() const;
    virtual int jump(int frame_number);
    //fixed it ...
    std::vector <float>& get_uplane_rms(){return uplane_rms;};
    std::vector <float>& get_vplane_rms(){return vplane_rms;};
    std::vector <float>& get_wplane_rms(){return wplane_rms;};

    void Save();
    
  private:
    WCP::FrameDataSource& fds;
    const WCP::GeomDataSource& gds;
    int  max_frames;
    int nbin;

    WCP::ChirpMap& umap;
    WCP::ChirpMap& vmap;
    WCP::ChirpMap& wmap;

    float time_offset_uv;
    float time_offset_uw;
    float overall_time_offset;
    
    int nwire_u, nwire_v, nwire_w;

    /* TH1F **hu; */
    /* TH1F **hv; */
    /* TH1F **hw; */

    TH1F *hu;
    TH1F *hv;
    TH1F *hw;

    TGraph *gu, *gv, *gw;

    TH1F *hur, *hvr, *hwr;
    
    TH1 *hmr_u, *hpr_u;
    TH1 *hmr_v, *hpr_v;
    TH1 *hmr_w, *hpr_w;
    
    std::vector<float> uplane_rms;
    std::vector<float> vplane_rms;
    std::vector<float> wplane_rms;

  };
}

#endif
#ifndef WIRECELL2dToy_DATASIGNALWIEN_H
#define WIRECELL2dToy_DATASIGNALWIEN_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPData/GeomWire.h"
#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class DataSignalWien2DFDS : public WCP::FrameDataSource
  {
  public:
    DataSignalWien2DFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, WCP::ChirpMap& umap, WCP::ChirpMap& vmap, WCP::ChirpMap& wmap, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ~DataSignalWien2DFDS();

    virtual int size() const;
    virtual int jump(int frame_number);
    //fixed it ...
    std::vector <float>& get_uplane_rms(){return uplane_rms;};
    std::vector <float>& get_vplane_rms(){return vplane_rms;};
    std::vector <float>& get_wplane_rms(){return wplane_rms;};

    void Save();
    
  private:
    WCP::FrameDataSource& fds;
    const WCP::GeomDataSource& gds;
    int  max_frames;
    int nbin;

    WCP::ChirpMap& umap;
    WCP::ChirpMap& vmap;
    WCP::ChirpMap& wmap;

    float time_offset_uv;
    float time_offset_uw;
    float overall_time_offset;
    
    int nwire_u, nwire_v, nwire_w;

    /* TH1F **hu; */
    /* TH1F **hv; */
    /* TH1F **hw; */

    TH1F *hu; //good 
    TGraph **gu; //Now an array 
    TH1F *hur; // good
    TH1 *hmr_u, *hpr_u; //good?

    TH1F *hv;
    TH1F *hw;
    TGraph *gv, *gw;    
    TH1F *hvr, *hwr;

    /* TGraph *wiener_filter_u; */
    /* TGraph *wiener_filter_v; */
    
    
    
    TH1 *hmr_v, *hpr_v;
    TH1 *hmr_w, *hpr_w;
    
    std::vector<float> uplane_rms;
    std::vector<float> vplane_rms;
    std::vector<float> wplane_rms;

  };
}

#endif
#ifndef WIRECELL2dToy_DATASIGNALWIENROI_H
#define WIRECELL2dToy_DATASIGNALWIENROI_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPData/GeomWire.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class DataSignalWienROIFDS : public WCP::FrameDataSource
  {
  public:
    DataSignalWienROIFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, WCP::ChirpMap& umap, WCP::ChirpMap& vmap, WCP::ChirpMap& wmap, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ~DataSignalWienROIFDS();

    virtual int size() const;
    virtual int jump(int frame_number);

    //fixed it ...
    std::vector <float>& get_uplane_rms(){return uplane_rms;};
    std::vector <float>& get_vplane_rms(){return vplane_rms;};
    /* std::vector <float>& get_uplane_rms(){return uplane_rms_g;}; */
    /* std::vector <float>& get_vplane_rms(){return vplane_rms_g;}; */
    
    std::vector <float>& get_wplane_rms(){return wplane_rms;};

    TH2I *Get_hu_gaus(){return hu_2D_g_gaus;};
    TH2I *Get_hv_gaus(){return hv_2D_g_gaus;};
    TH2I *Get_hw_gaus(){return hw_1D_g;};
    
    void set_flag_2D(int flag){flag_2D = flag;};

    void Save();
    
  private:
    int flag_2D;
    WCP::FrameDataSource& fds;
    const WCP::GeomDataSource& gds;
    int  max_frames;
    int nbin;

    float scale_u_1d, scale_v_1d;
    float scale_u_2d, scale_v_2d;

    WCP::ChirpMap& umap;
    WCP::ChirpMap& vmap;
    WCP::ChirpMap& wmap;

    float time_offset_uv;
    float time_offset_uw;
    float overall_time_offset;
    
    int nwire_u, nwire_v, nwire_w;

    std::vector<float> uplane_rms; // calibrated field response
    std::vector<float> vplane_rms; // calibrated field response
    std::vector<float> wplane_rms; // calibrated field response

    std::vector<float> uplane_rms_g;
    std::vector<float> vplane_rms_g;
    
    void restore_baseline(TH1F *h1);
    double cal_rms(TH1F *h1, int chid);

    void Deconvolute_U_1D_c();
    void Deconvolute_V_1D_c();
    void Deconvolute_W_1D_g();

    void Deconvolute_U_2D_g(); // both with filter and without filter 
    void Deconvolute_V_1D_g(); // both with filter and without filter 
    void Deconvolute_V_2D_g(); // both with filter and without filter 

    void ROI_cal(TH1F *h1_1, TH1F *h2_1, TH1F *h3_1, TH1F *h4_1, TH1F *h5_1, Double_t threshold0,Double_t threshold2, TH1F *hresult, TH1F *hresult1, int flag_u);
    Double_t local_ave(TH1F *h1, Int_t bin, Int_t width);
    Int_t find_ROI_begin(TH1F *h1, Int_t bin, Double_t th);
    Int_t find_ROI_end(TH1F *h1, Int_t bin, Double_t th);

    // U plane  1D-U-c
    TH2I *hu_1D_c;
    TH2I *hu_1D_c_gaus;
    TGraph *gu_1D_c;

    // 2D-U-g-f, 2D-U-g
    TH2I *hu_2D_g_f;
    TH2I *hu_2D_g;
    TH2I *hu_2D_g_gaus;
    TGraph **gu_2D_g;
    
          
    //V plane 1-D-V-c
    TH2I *hv_1D_c;
    TH2I *hv_1D_c_gaus;
    TGraph *gv_1D_c;

    //1-D-V-g-f, 1-D-V-g
    /* TH2I *hv_1D_g_f; */
    /* TH2I *hv_1D_g; */
    /* TH2I *hv_1D_g_gaus; */
    /* TGraph *gv_1D_g; */

    TH2I *hv_2D_g_f; 
    TH2I *hv_2D_g;
    TH2I *hv_2D_g_gaus;
    TGraph **gv_2D_g;


    //W-plane  1-D-W-g
    TH2I *hw_1D_g;
    TH2I *hw_1D_g_gaus;
    TGraph *gw_1D_g;
    TGraph *gw_1D_c;

    
 

  };
}

#endif
#ifndef WCP2dToy_EXAMINECLUSTER_H
#define WCP2dToy_EXAMINECLUSTER_H

#include "WCPData/FlashTPCBundle.h"
#include "WCPData/ToyCTPointCloud.h"

namespace WCP2dToy{
  WCP::FlashTPCBundleSelection ExamineBundles(WCP::FlashTPCBundleSelection bundles, WCP::ToyCTPointCloud& ct_point_cloud);
  WCP::FlashTPCBundle* ExamineBundle(WCP::FlashTPCBundle* bundle, std::set<int>& used_cluster_ids, WCP::ToyCTPointCloud& ct_point_cloud);
  
}

#endif
#ifndef WIRECELLUTIL_EXECMON
#define WIRECELLUTIL_EXECMON

#include "WCP2dToy/TimeKeeper.h"
#include "WCP2dToy/MemUsage.h"


namespace WCP {



    /** A helper class combining a TimeKeeper and a MemUsage
     *
     * Use like
     *
     *   ExecMon em("starting");
     *   ...
     *   cerr << em("starting long calculation....") << endl;
     *   do_long_calculation();
     *   cerr << em("...done") << endl;;
     *   ...
     *   cerr << em.summary() << endl;
     */
    class ExecMon {
    public:

	ExecMon(const std::string& msg = "start",
		TimeKeeper::ptime starting_time = boost::posix_time::microsec_clock::local_time());
	~ExecMon();

	/// Record an event.
	std::string operator()(
	    std::string msg = "<tick>",
	    TimeKeeper::ptime now = boost::posix_time::microsec_clock::local_time(),
	    MemUsage::memusage mu = MemUsage::memusage(-1,-1));

	/// Return summary up to now.
	std::string summary() const;

	TimeKeeper tk;
	MemUsage mu;
    };
}
#endif
#ifndef WIRECELLSST_FRAMEDATASOURCE_H
#define  WIRECELLSST_FRAMEDATASOURCE_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"

namespace WCP2dToy {
  
    /** A FrameDataSource which generates toy charge on the fly.  This
     * FDS also extends the base to provide access to "mctruth"
     * values. */ 
  class FrameDataSource : public WCP::FrameDataSource {
  public:
      /// Produce a WCP2dToy::FrameDataSource that will generate nevents.
    FrameDataSource(int nevents, const WCP::GeomDataSource& gds);
    virtual ~FrameDataSource(); 
    
    virtual int size() const;
    virtual int jump(int frame_number); 

    /// Access generated cell charges
    const WCP::PointValueVector& cell_charges() { return mctruth; }
      // fixme: we should talk about this interface addition and come
      // up with a general way to handle MC truth info.

  private:

    int Nevent;
    const WCP::GeomDataSource& gds;
    WCP::PointValueVector mctruth;
  };
  
}

#endif
#ifndef WIRECELL_IMPROVEPR3DCluster_H
#define WIRECELL_IMPROVEPR3DCluster_H

#include "WCPData/PR3DCluster.h"
#include "WCPData/ToyCTPointCloud.h"
#include "WCPSst/GeomDataSource.h"

namespace WCP2dToy{
  WCP::PR3DCluster* Improve_PR3DCluster(WCP::PR3DCluster* cluster, WCP::ToyCTPointCloud& ct_point_cloud,WCPSst::GeomDataSource& gds);
  
}

#endif 
#ifndef WIRECELL_LOWMEMTILING_H
#define WIRECELL_LOWMEMTILING_H

#include "WCPTiling/TilingBase.h"
#include "WCPData/GeomWCPMap.h"
#include "WCPData/MergeGeomWire.h"
#include "WCPData/SlimMergeGeomCell.h"
#include "WCPNav/SliceDataSource.h"
#include "WCPSst/GeomDataSource.h"
#include "WCPNav/DetectorGDS.h"
#include "WCP2dToy/WCPHolder.h"

#include "Rtypes.h"

namespace WCP2dToy{

  class LowmemTiling : public WCP::TilingBase {
  public:
    LowmemTiling(int time_slice, WCP::GeomDataSource& gds, WCP2dToy::WCPHolder& holder);
    LowmemTiling(int time_slice, int nrebin, WCP::GeomDataSource& gds, WCP2dToy::WCPHolder& holder);
    
    virtual ~LowmemTiling();
    
    WCP::GeomWireSelection wires(const WCP::GeomCell& cell) const;
    WCP::GeomCellSelection cells(const WCP::GeomWire& wire) const;
    const WCP::GeomCell* cell(const WCP::GeomWireSelection& wires) const;

    void re_establish_maps();
    
    int get_time_slice(){return time_slice;};
    void form_bad_merge_wires(WCP::ChirpMap& uplane_map, WCP::ChirpMap& vplane_map, WCP::ChirpMap& wplane_map);

    void form_fired_merge_wires(const WCP::Slice& slice, const WCP::Slice& slice_err);
    void form_fired_merge_wires(std::map<int,std::set<int>>& u_time_chs, std::map<int,std::set<int>>& v_time_chs, std::map<int,std::set<int>>& w_time_chs);
    void form_fired_merge_wires_with_charge(std::map<int,std::set<int>>& u_time_chs, std::map<int,std::set<int>>& v_time_chs, std::map<int,std::set<int>>& w_time_chs, std::map<std::pair<int,int>,double>& time_ch_charge_map, std::map<std::pair<int,int>,double>& time_ch_charge_err_map);
    
    void form_two_bad_cells();
    void init_bad_cells(WCP::ChirpMap& uplane_map, WCP::ChirpMap& vplane_map, WCP::ChirpMap& wplane_map);
    void check_bad_cells(LowmemTiling* tiling,WCP::ChirpMap& uplane_map, WCP::ChirpMap& vplane_map, WCP::ChirpMap& wplane_map);
    void reset_cells();
    void init_good_cells(const WCP::Slice& slice, const WCP::Slice& slice_err, std::vector<float>& uplane_rms, std::vector<float>& vplane_rms, std::vector<float>& wplane_rms);
    
    void init_good_cells(std::map<int,std::set<int>>& u_time_chs, std::map<int,std::set<int>>& v_time_chs, std::map<int,std::set<int>>& w_time_chs);
    
    void init_good_cells_with_charge(std::map<int,std::set<int>>& u_time_chs, std::map<int,std::set<int>>& v_time_chs, std::map<int,std::set<int>>& w_time_chs, std::map<std::pair<int,int>,double>& time_ch_charge_map, std::map<std::pair<int,int>,double>& time_ch_charge_err_map);
    
    WCP::GeomCellSelection& get_two_bad_wire_cells(){return two_bad_wire_cells;};
    WCP::GeomCellSelection& get_three_good_wire_cells(){return three_good_wire_cells;};
    WCP::GeomCellSelection& get_two_good_wire_cells(){return two_good_wire_cells;};
    WCP::GeomCellSelection& get_one_good_wire_cells(){return one_good_wire_cells;};
    

    WCP::GeomWireSelection& get_bad_wire_u(){return bad_wire_u;};
    WCP::GeomWireSelection& get_bad_wire_v(){return bad_wire_v;};
    WCP::GeomWireSelection& get_bad_wire_w(){return bad_wire_w;};

    WCP::SlimMergeGeomCell* create_slim_merge_cell(WCP::MergeGeomWire *uwire, WCP::MergeGeomWire *vwire, WCP::MergeGeomWire *wwire);

    bool test_point(WCP::PointVector& pcell, float dis_u, float dis_v,
		    float bmin_w, float bmax_w, float u_pitch, float v_pitch,
		    float& dis1);
    void test_cross(WCP::PointVector& pcell, float dis, WCP::WirePlaneType_t plane, float low_limit, float high_limit, float pitch, float pitch1, float w_pitch, const WCP::GeomWire* wire1, const WCP::GeomWire *wire2, int dir, float bmin_w, float bmax_w); // pitch corresponds to plane

    /* void test_crossing(WCP::PointVector& pcell, float dis_u, float dis_v, float bmin_w, float bmax_w, float u_pitch, float v_pitch, float w_pitch, const WCP::GeomWire* u_wire1, const WCP::GeomWire* u_wire2, const WCP::GeomWire *v_wire1, const WCP::GeomWire *v_wire2, int dir_u, int dir_v); */
    
    bool check_crossing(const WCP::GeomWire* wire1, const WCP::GeomWire* wire2, float pitch1, float pitch2, WCP::WirePlaneType_t plane, float min, float max, float tolerance);
    
    WCP::GeomCellSelection create_single_cells();
    WCP::GeomCellSelection create_single_cells(WCP::SlimMergeGeomCell * mcell);
    void create_one_good_wire_cells();
    void MergeWires(); // main algorithm to merge things together ... 
    
    void DivideWires(int wire_limit = 2, int min_wire = 2); // do one round of dividing for all planes
    
    WCP::GeomCellMap& get_cell_wires_map(){
      return cell_wires_map;
    }
    //map wire to cell
    WCP::GeomWireMap& get_wire_cells_map(){
      return wire_cells_map;
    }
    WCP::GeomWireSelection get_all_good_wires();
    WCP::GeomWireSelection get_all_bad_wires();

    WCP::PointVector get_all_cell_centers();

    WCP::WireChargeMap& get_wire_charge_map(){return wirechargemap;};
    WCP::WireChargeMap& get_wire_charge_error_map(){return wirecharge_errmap;};

    void Erase_Cell(WCP::SlimMergeGeomCell *cell);

    void Print_maps();
    WCP::GeomCellSelection local_deghosting(std::set<WCP::SlimMergeGeomCell*, WCP::GeomCellComparep>& potential_good_mcells, std::set<WCP::SlimMergeGeomCell*, WCP::GeomCellComparep>& good_mcells, bool flag_del = false);

    void local_deghosting1(std::set<WCP::SlimMergeGeomCell*, WCP::GeomCellComparep>& good_mcells, std::map<WCP::SlimMergeGeomCell*, double, WCP::GeomCellComparep>& map_mcell_charge);

    WCP::GeomWireSelection find_L1SP_wires();

    std::map<const WCP::GeomWire*,bool, WCP::GeomWireComparep> get_wire_type_map(){return wire_type_map;};

    WCP::GeomWireWireMap get_wire_pwire_map(){ return wire_pwire_map;};
    //map parent wire to wire
    WCP::GeomWireWiresMap get_pwire_wires_map(){return pwire_wires_map;};

    bool get_regen_two_bad_wire_cells(){return regen_two_bad_wire_cells;};
    
  protected:
    int ident_wire;
    WCP::GeomDataSource& gds;
    WCP2dToy::WCPHolder& holder;

    WCP::PointVector points;

    // original group of wires
    WCP::GeomWireSelection bad_wire_u; 
    WCP::GeomWireSelection bad_wire_v;
    WCP::GeomWireSelection bad_wire_w;

    WCP::GeomWireSelection fired_wire_u;
    WCP::GeomWireSelection fired_wire_v;
    WCP::GeomWireSelection fired_wire_w;

    // current cells ... 
    WCP::GeomCellSelection three_good_wire_cells;
    WCP::GeomCellSelection two_good_wire_cells;
    WCP::GeomCellSelection one_good_wire_cells;

    WCP::GeomCellSelection not_used_one_good_wire_cells;
    WCP::GeomCellSelection two_bad_wire_cells;
    bool regen_two_bad_wire_cells;

    bool remove_cell(WCP::SlimMergeGeomCell *cell);
    bool remove_wire(WCP::MergeGeomWire *wire);
    bool remove_wire_clear(WCP::MergeGeomWire *wire);
    bool replace_wire(WCP::MergeGeomWire *old_wire, WCP::MergeGeomWire *wire);

    
    int further_mergewire(WCP::GeomWireSelection &allwire);

    void calculate_merged_wire_charge();

    
    
    
    
    //map wire --> bad or good
    std::map<const WCP::GeomWire*,bool, WCP::GeomWireComparep> wire_type_map;
    //map cell to wire
    WCP::GeomCellMap cell_wires_map;
    //map wire to cell
    WCP::GeomWireMap wire_cells_map;
    //map wire to parent wire
    WCP::GeomWireWireMap wire_pwire_map;
    //map parent wire to wire
    WCP::GeomWireWiresMap pwire_wires_map;
    
    

    int nrebin;
    int time_slice;

    int nwire_u;
    int nwire_v;
    int nwire_w;
    
    WCP::WireChargeMap wirechargemap;
    WCP::WireChargeMap wirecharge_errmap;
    
  };
}



#endif
#ifndef WIRECELL2DTOY_MATRIXSOLVER_H
#define WIRECELL2DTOY_MATRIXSOLVER_H

#include "TMatrixD.h"
#include "TVectorD.h"


#include "WCPData/GeomCell.h"
#include "WCPData/GeomWire.h"
#include "WCPData/MergeGeomCell.h"
#include "WCPData/MergeGeomWire.h"


#include <Eigen/Dense>

namespace WCP2dToy{
  class MatrixSolver{
  public:
    MatrixSolver(WCP::GeomCellSelection& cells, WCP::GeomWireSelection& wires, WCP::GeomCellMap& cell_wire_map, WCP::GeomWireMap& wire_cell_map, WCP::WireChargeMap& wire_charge_map, WCP::WireChargeMap& wire_charge_error_map);
    virtual ~MatrixSolver();

    double get_mcell_charge(WCP::MergeGeomCell *mcell);

    double get_direct_chi2(){return direct_chi2;};
    int get_direct_ndf(){return direct_ndf;};

    double get_L1_chi2_base(){return L1_chi2_base;};
    double get_L1_chi2_penalty(){return L1_chi2_penalty;};
    int get_L1_ndf(){return L1_ndf;};
    
    int get_solve_flag(){return solve_flag;};

    void L1_Solve(std::map<const WCP::GeomCell*, double, WCP::GeomCellComparep >& cell_weight_map);

    WCP::GeomCellSelection get_all_cells();

    // added to expose more information out ...
    double get_lambda(){return lambda;};
    double get_TOL(){return TOL;};
    int get_mc_index(const WCP::GeomCell* cell);
    int get_mw_index(const WCP::GeomWire* wire);
    double get_W_value(int index);
    double get_G_value(int index_mw, int index_mc);

    void set_id(int id1){id = id1;};
    int get_id(){return id;};
    
  private:
    //    void Direct_Solve();
    int id;
        
    int solve_flag;
    double direct_chi2;
    int direct_ndf;

    double L1_chi2_base, L1_chi2_penalty;
    int L1_ndf;
    
    /* TMatrixD *MA, *MB, *MAT, *MBT; */
    /* TMatrixD *Vy, *VBy, *Vx, *VBy_inv, *Vx_inv; */
    /* TMatrixD *MC, *MC_inv; */

    /* TMatrixD *UMA;  */
    /* TVectorD *UMWy; */ 
    double lambda;
    double TOL;
    float scale_factor;
    
    TVectorD *Wy, *Cx, *dCx;
    TVectorD *MWy_pred, *MWy;

    Eigen::VectorXd W;
    Eigen::MatrixXd G;
    
    WCP::CellIndexMap mcimap;
    WCP::WireIndexMap mwimap, swimap;
    
    
    int mcindex;
    int mwindex;
    int swindex;
    
  };
}

#endif
// http://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process
// http://stackoverflow.com/questions/669438/how-to-get-memory-usage-at-run-time-in-c

#ifndef WIRECELL_MEMUSAGE
#define WIRECELL_MEMUSAGE

#include <fstream>
#include <vector>
#include <string>


namespace WCP {

    double memusage_resident();
    double memusage_shared();
    double memusage_size();

    
    class MemUsage {
    public:	
	typedef std::pair<double, double> memusage;
	typedef std::pair<memusage, std::string> event;
	MemUsage(const std::string& msg = "start");
	~MemUsage();

	void push(const std::string& msg, MemUsage::memusage mu = memusage(-1,-1));

	/// Record an event.
	std::string operator()(
	    std::string msg = "<tick>",
	    MemUsage::memusage mu = memusage(-1,-1));
	
	/// Return summary up to now.
	std::string summary() const;

	/// Return event by index.
	event operator[](int ind) const;
	
	memusage current() const;

    private:
	/// Emit a formatted message for the given event index.
	std::string emit(int ind) const;


	std::vector< event > m_events;

    };

}


#endif
#ifndef WIRECELL_MERGETOYTILING_H
#define WIRECELL_MERGETOYTILING_H

#include "WCP2dToy/ToyTiling.h"

namespace WCP2dToy{
  class MergeToyTiling : public WCP2dToy::ToyTiling {
  public:
    MergeToyTiling(){};
    MergeToyTiling(const WCP::DetectorGDS& gds, WCP2dToy::ToyTiling& tiling, int time_slice = -1);
    MergeToyTiling(WCP2dToy::ToyTiling& tiling, int time_slice=-1, int merge_strategy = 3, int flag_remerge=0);
    ~MergeToyTiling();

    const WCP::GeomCell* cell(const WCP::GeomWireSelection& wires)const ;
    WCP::GeomCellSelection& get_single_wire_cells(){return single_wire_cells;};
    WCP::GeomCellSelection& get_three_wires_cells(){return three_wires_cells;};
    WCP::GeomCellSelection& get_two_wires_cells(){return two_wires_cells;};
    WCP::GeomCellCellsMap& get_not_compatible_cells_map(){ return mcmcsmap;};
    

    int further_merge(WCP::GeomCellSelection &allcell, int ncell, int time_slice, double dis = 0.2 * units::mm);
    int further_mergewire(WCP::GeomWireSelection &allwire, int nwire, int time_slice);
    bool GetRemerged(){return IsRemerged;};
    
    static double Time2Dis(int time){return time*time_convert + dis_offset;};
    static int Dis2Time(double dis){ return round((dis/units::cm-dis_offset)/time_convert);}; //in cm

    void deghost(WCP::GeomCellSelection& good_mcells); //used for MicroBooNE data ... 


  protected:
    bool IsRemerged;
    
    static double time_convert;
    static double dis_offset;


    void form_wiremap(WCP2dToy::ToyTiling& tiling, int time_slice);
    void form_wiremap(const WCP::DetectorGDS& gds, WCP2dToy::ToyTiling& tiling, int time_slice);

    WCP::GeomCellMap cellmap1;
    WCP::GeomWireMap wiremap1;

    WCP::GeomWireWireMap wwmap; // wire to merged wire
    WCP::GeomWireWiresMap wwsmap; // merged wire to wires
    
    WCP::GeomCellCellsMap mcmcsmap; //merged cell to merged cell map;

    WCP::GeomCellSelection single_wire_cells;
    WCP::GeomCellSelection three_wires_cells;
    WCP::GeomCellSelection two_wires_cells;

   ClassDef(MergeToyTiling,1);
  };
}
#endif
#ifndef WIRECELL_SimpleBlobToyTiling_H
#define WIRECELL_SimpleBlobToyTiling_H

#include "WCP2dToy/MergeToyTiling.h"
#include "WCP2dToy/ToyMatrix.h"
#include "WCPData/GeomCell.h"
#include "WCPData/GeomWire.h"
#include "WCPData/MergeGeomCell.h"
#include "WCPData/MergeGeomWire.h"
#include "WCP2dToy/ToyHypothesis.h"

#include "Rtypes.h"

namespace WCP2dToy{
  class SimpleBlobToyTiling : public WCP2dToy::MergeToyTiling {
  public:
    SimpleBlobToyTiling(WCP2dToy::ToyTiling& toytiling1, WCP2dToy::MergeToyTiling& mergetiling1, WCP2dToy::ToyMatrix& toymatrix1, 
			WCP2dToy::MergeToyTiling& prev_mergetiling, WCP2dToy::ToyMatrix& prev_toymatrix,
			 WCP2dToy::MergeToyTiling& next_mergetiling, WCP2dToy::ToyMatrix& next_toymatrix
			, int recon_t = 2000);
    ~SimpleBlobToyTiling();
    
    
    double Get_Cell_Charge( const WCP::GeomCell *cell, int flag = 1) ;
    WCP::GeomCellSelection Get_Cells(){return cell_all_save;};
    WCP::GeomCellSelection Get_SB_Cells(){return sbcells;};

  private:
    void Organize(int nsimple_blob);
    void FormHypo();
    void ClearHypo();
    void DoTiling();
    double CalChi2();
    void SaveResult();
    void Buildup_index();
    int recon_threshold;
    

    WCP2dToy::ToyTiling *toytiling;
    WCP2dToy::MergeToyTiling *mergetiling;
    WCP2dToy::ToyMatrix *toymatrix;
    
    int nsimple_blob; //smaller than 5 for now
    /* WCP::GeomCellSelection corner_mcells[10]; */
    /* WCP::GeomCellSelection corner_smcells[10]; */
        
    //save the first pass results
    WCP::GeomCellSelectionV corner_mcells;
    WCP::GeomCellSelectionV corner_smcells;
    WCP::CellIndexMap cell_rank;

    //save the second pass results to use for hypothesis formation
    WCP::GeomCellSelectionV first_cell;
    WCP::GeomCellSelectionV second_cell;
    WCP::GeomCellSelectionV other_cell;
    WCP::GeomCellSelection sbcells;
    std::vector<int> flag_cell;
    
    int ncount;
    double cur_chi2;
    // cell_all, wire_all, cellmap, wiremap wire_u, wire_v, wire_w 
    std::vector<double> Cx, dCx;
    std::vector<WCP2dToy::HypoSelection> cur_hypo;
    
    int scindex;
    int swindex;
    WCP::WireIndexMap swimap;
    WCP::CellIndexMap scimap;

    //save all the results
    double chi2_save;
    std::vector<double> Cx_save, dCx_save;
    WCP::GeomWireSelection wire_u_save;
    WCP::GeomWireSelection wire_v_save;
    WCP::GeomWireSelection wire_w_save;
    WCP::GeomWireSelection wire_all_save;
    WCP::GeomCellSelection cell_all_save;
    WCP::GeomCellMap cellmap_save;
    WCP::GeomWireMap wiremap_save;
    std::vector<WCP2dToy::HypoSelection> hypo_save;
    

    int scindex_save;
    int swindex_save;
    WCP::WireIndexMap swimap_save;
    WCP::CellIndexMap scimap_save;
    

      ClassDef(SimpleBlobToyTiling,1);
    
  };
}

#endif
#ifndef WIRECELLUTIL_TIMEKEEPER
#define WIRECELLUTIL_TIMEKEEPER

#include <boost/date_time/posix_time/posix_time_types.hpp>

#include <vector>

namespace WCP {

    /** A helper class to give some time keeping.
     *
     * Use like
     *
     *   TimeKeeper tk("starting");
     *   ...
     *   cerr << tk("starting long calculation....") << endl;
     *   do_long_calculation();
     *   cerr << tk("...done") << endl;;
     *   ...
     *   cerr << tk.summary() << endl;
     */
    class TimeKeeper {
    public:
	typedef boost::posix_time::ptime ptime;
	typedef boost::posix_time::time_duration deltat;
	typedef std::pair<ptime, std::string> event;

	TimeKeeper(const std::string& msg = "start",
		   ptime starting_time = boost::posix_time::microsec_clock::local_time());
	~TimeKeeper();

	/// Return the time at which this time keeper was started.
	ptime start_time() const;

	/// Return the time of the last event.
	ptime last_time() const;

	/// Return the duration between the last two events.
	deltat last_duration() const;

	/// Return the time duration between "now" and the start time.
	deltat since(ptime now = boost::posix_time::microsec_clock::local_time()) const;

	/// Record an event.
	std::string operator()(
	    std::string msg = "<tick>",
	    ptime now = boost::posix_time::microsec_clock::local_time());
	
	/// Return summary up to now.
	std::string summary() const;

	/// Return event by index.
	event operator[](int ind) const;


    private:
	/// Emit a formatted message for the given event index.
	std::string emit(int ind) const;


	std::vector< event > m_events;
    };
}
#endif
#ifndef WIRECELL_TOTALTILING_H
#define WIRECELL_TOTALTILING_H
#include "WCPData/GeomCell.h"
#include "WCPData/GeomWire.h"
#include "WCPData/GeomWCPMap.h"

namespace WCP2dToy {
  class TotalTiling {
    public:
    TotalTiling();
    ~TotalTiling();
    
    void AddCellWire(const WCP::GeomCell *cell, const WCP::GeomWire *uwire, const WCP::GeomWire *vwire, const WCP::GeomWire *wwire);
    
    WCP::GeomWireSelection wires(const WCP::GeomCell& cell) const;
    WCP::GeomCellSelection cells(const WCP::GeomWire& wire) const;
    const WCP::GeomCell* cell(const WCP::GeomWireSelection& wires);
    void Clear();
  
    WCP::GeomWireSelection wire_u;
    WCP::GeomWireSelection wire_v;
    WCP::GeomWireSelection wire_w;

    WCP::GeomWireSelection wire_all;
    
    WCP::GeomCellSelection cell_all;

    WCP::GeomCellMap cellmap;
    WCP::GeomWireMap wiremap;
  };
  

}

#endif
#ifndef WCP2dToy_TOYCLUSTERING_H
#define WCP2dToy_TOYCLUSTERING_H

#include "WCPData/PR3DCluster.h"
#include "WCPData/DynamicToyPointCloud.h"
#include "WCPData/ToyCTPointCloud.h"
//#include "WCPSst/GeomDataSource.h"

namespace WCP2dToy{
  double Find_Closeset_Points(WCP::PR3DCluster *cluster1, WCP::PR3DCluster *cluster2,double length_1, double length_2, double length_cut, WCP::SlimMergeGeomCell *mcell1, WCP::SlimMergeGeomCell *mcell2, WCP::Point& p1, WCP::Point &p2, bool flag_print = false);

  
  double cal_proj_angle_diff(TVector3& dir1, TVector3& dir2, double plane_angle);
  bool is_angle_consistent(TVector3& dir1, TVector3& dir2, bool same_direction, double angle_cut, double angle_u, double angle_v, double angle_w, int num_cut = 2);
  
  
  WCP::map_cluster_cluster_vec Clustering_jump_gap_cosmics(WCP::PR3DClusterSelection& live_clusters, WCP::PR3DClusterSelection& dead_clusters, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index, WCP::DynamicToyPointCloud& global_point_cloud, WCP::ToyCTPointCloud& ct_point_cloud, bool flag_neutrino = true);

  WCP::map_cluster_cluster_vec Clustering_jump_gap_cosmics(WCP::PR3DClusterSelection& live_clusters, WCP::PR3DClusterSelection& dead_clusters, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index, WCP::DynamicToyPointCloud& global_point_cloud, bool flag_neutrino = true);

  
  // clustering live clusters associated with the same dead cluster
  void Clustering_live_dead(WCP::PR3DClusterSelection& live_clusters, WCP::PR3DClusterSelection& dead_clusters, WCP::map_pr3dcluster_double& cluster_length_map, WCP::PR3DClusterSet& cluster_connected_dead);
  // bool IsCrossing(WCP::Point& p, double theta, double phi, WCP::SlimMergeGeomCell *mcell, WCPSst::GeomDataSource& gds);

  
  

  
  

  void Clustering_regular(WCP::PR3DClusterSelection& live_clusters,  WCP::map_pr3dcluster_double& cluster_length_map, WCP::PR3DClusterSet& cluster_connected_dead, double length_cut = 45*units::cm, bool flag_enable_extend = true);
  bool Clustering_1st_round(WCP::PR3DCluster *cluster1, WCP::PR3DCluster *cluster2, double length_1, double length_2, double length_cut = 45*units::cm, bool flag_enable_extend = true);
 
  void Clustering_parallel_prolong(WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, WCP::PR3DClusterSet& cluster_connected_dead, double length_cut = 35*units::cm);
  bool Clustering_2nd_round(WCP::PR3DCluster *cluster1, WCP::PR3DCluster *cluster2, double length_1, double length_2, double length_cut = 35*units::cm);

  void Clustering_close(WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, WCP::PR3DClusterSet& cluster_connected_dead, double length_cut = 1*units::cm);
  bool Clustering_3rd_round(WCP::PR3DCluster *cluster1, WCP::PR3DCluster *cluster2, double length_1, double length_2, double length_cut = 1*units::cm);

  void Clustering_extend(WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, WCP::PR3DClusterSet& cluster_connected_dead, int flag, double length_cut = 150*units::cm, int num_try = 0, double length_2_cut = 3*units::cm, int num_dead_try=3);
  bool Clustering_4th_prol(WCP::PR3DCluster *cluster1, WCP::PR3DCluster *cluster2, double length_2, WCP::Point& earliest_p, TVector3& dir_earlp, double length_cut);
  bool Clustering_4th_para(WCP::PR3DCluster *cluster1, WCP::PR3DCluster *cluster2, double length_1, double length_2, WCP::Point& earliest_p, TVector3& dir_earlp, double length_cut);
  bool Clustering_4th_reg(WCP::PR3DCluster *cluster1, WCP::PR3DCluster *cluster2, double length_1, double length_2, WCP::Point p1, double length_cut);
  bool Clustering_4th_dead(WCP::PR3DCluster *cluster1, WCP::PR3DCluster *cluster2, double length_1, double length_2, double length_cut, int num_dead_try=3);
  
  
  //void Clustering_prolong(WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, double length_cut = 45*units::cm);

  
  void Clustering_separate(WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index);
  void Clustering_separate(WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index, WCP::ToyCTPointCloud& ct_point_cloud);

  
  bool JudgeSeparateDec_1(WCP::PR3DCluster* cluster, TVector3& drift_dir, double length, double time_slice_length);

  bool JudgeSeparateDec_2(WCP::PR3DCluster* cluster, TVector3& drift_dir ,std::vector<WCP::WCPointCloud<double>::WCPoint>& boundary_points, std::vector<WCP::WCPointCloud<double>::WCPoint>& independent_points, double cluster_length = 100*units::cm);
  
  std::vector<WCP::PR3DCluster*> Separate_1(WCP::PR3DCluster* cluster,std::vector<WCP::WCPointCloud<double>::WCPoint>& boundary_points, std::vector<WCP::WCPointCloud<double>::WCPoint>& independent_points, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index, double length=0);
  std::vector<WCP::PR3DCluster*> Separate_1(WCP::ToyCTPointCloud& ct_point_cloud, WCP::PR3DCluster* cluster,std::vector<WCP::WCPointCloud<double>::WCPoint>& boundary_points, std::vector<WCP::WCPointCloud<double>::WCPoint>& independent_points, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index, double length=0);
  

  std::vector<WCP::PR3DCluster*> Separate_2(WCP::PR3DCluster* cluster, double dis_cut = 5*units::cm);
  

  void Clustering_deghost(WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index, double length_cut = 0);
  void Clustering_deghost(WCP::ToyCTPointCloud& ct_point_cloud, WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index, double length_cut = 0);

  void Clustering_connect1(WCP::PR3DClusterSelection& live_clusters, WCP::map_pr3dcluster_double& cluster_length_map, WCP::DynamicToyPointCloud& global_point_cloud, std::map<int,std::pair<double,double>>& dead_u_index, std::map<int,std::pair<double,double>>& dead_v_index, std::map<int,std::pair<double,double>>& dead_w_index);
 

  void Clustering_examine_x_boundary(WCP::PR3DClusterSelection& live_clusters,WCP::map_pr3dcluster_double& cluster_length_map);

  void Clustering_protect_overclustering(WCP::PR3DClusterSelection& live_clusters,WCP::map_pr3dcluster_double& cluster_length_map, WCP::ToyCTPointCloud& ct_point_cloud);
  WCP::PR3DClusterSelection Examine_overclustering(WCP::PR3DCluster *cluster,  WCP::ToyCTPointCloud& ct_point_cloud);
  
  
  void Clustering_neutrino(WCP::PR3DClusterSelection& live_clusters,WCP::map_pr3dcluster_double& cluster_length_map, int num_try=0);
  
  void Clustering_dis(WCP::PR3DClusterSelection& live_clusters,WCP::map_pr3dcluster_double& cluster_length_map);
  

  WCP::map_cluster_cluster_vec Clustering_isolated(WCP::PR3DClusterSelection& live_clusters,WCP::map_pr3dcluster_double& cluster_length_map);
}

#endif
#ifndef WIRECELL_TOYCOSMIC_H
#define WIRECELL_TOYCOSMIC_H

#include "WCP2dToy/ToyTracking.h"
#include "WCP2dToy/WCCosmic.h"

namespace WCP2dToy{
  class ToyCosmic{
  public:
    ToyCosmic(ToyTrackingSelection& trackings, float abc = 10, float abc1 = 3);
    ~ToyCosmic();
    
    std::vector<ToyTrackingSelection>& get_raw_candidates(){return cosmic_candidates;};
    ToyTrackingSelection& get_neutrinos(){return nocosmic_trackings;};

    bool IsConnected(ToyTracking *tracking1, ToyTracking *tracking2);
    bool IsConnected(WCP::MergeSpaceCell *mcell1, WCP::MergeSpaceCell *mcell2, float dis_cut);
    
    WCCosmicSelection& get_cosmics(){return cosmics;};
    
  protected:
    ToyTrackingSelection& trackings;
    ToyTrackingSelection nocosmic_trackings;
    WCCosmicSelection cosmics;
    std::vector<ToyTrackingSelection> cosmic_candidates;

    float gap_cut;
    float gap_cut1;
  };
}

#endif
#ifndef WIRECELL_TOYCRAWLER_H
#define WIRECELL_TOYCRAWLER_H

#include "WCPData/ClusterTrack.h"
#include "WCPData/MergeClusterTrack.h"
#include "WCP2dToy/MergeToyTiling.h"

namespace WCP2dToy{
  
  class ToyCrawler {
  public:
    ToyCrawler(WCP::MergeSpaceCellSelection& mcells, int flag = 1, int flag1 = 1);
    ~ToyCrawler();

    void CreateClusterTrack(WCP::MergeSpaceCellSelection& mcells);
    void FormGraph();
    void MergeCTrack(int flag = 1);
    void FurtherExtendCTrack(int flag_qx = 0);
    void PurgeMergeCTrack();

    void CleanUpCTTrack(int flag=1);

    void PrepareTracking();

    void UpdateMap();

    WCP::ClusterTrackSelection& Get_allCT(){return all_clustertrack;};
    WCP::MergeClusterTrackSelection& Get_allMCT(){return all_mergeclustertrack;};
    WCP::MSpaceCellClusterMap& Get_ms_ct_map(){return ms_ct_map;};
    WCP::MergeSpaceCellCounter& Get_mcells_counter(){return mcells_counter;};
    WCP::MergeSpaceCellMap& Get_mcells_map(){return mcells_map;};

    WCP::MergeSpaceCell* GetClosestMSC(WCP::Point p, WCP::MergeSpaceCellSelection& cells);

   

  protected:
    WCP::ClusterTrackSelection all_clustertrack;
    //WCP::ClusterTrackSelection used_clustertrack; // hold the used tracks

    WCP::MergeClusterTrackSelection all_mergeclustertrack;
    WCP::MSC_MCT_Map  mcells_mct_map;


    WCP::MergeSpaceCellSelection used_mcells; // save used mergespacecell
    WCP::MergeSpaceCellSelection end_mcells; // save all the merge spacecell at the beginning/end of a clustertrack

    WCP::MergeSpaceCellMap mcells_map;
    WCP::MergeSpaceCellMap mcells_save;

    
    WCP::MergeSpaceCellCounter mcells_counter;
    WCP::ClusterMSpaceCellMap ct_ms_map;
    WCP::MSpaceCellClusterMap ms_ct_map;

  };
  
}


#endif
#ifndef WCP2dToy_TOYDATAQUALITY_H
#define WCP2dToy_TOYDATAQUALITY_H

#include "WCPData/GeomWire.h"

#include "TH2F.h"
#include <iostream>

namespace WCP2dToy{
  int Noisy_Event_ID(TH2F *hu_decon, TH2F *hv_decon, TH2F *hw_decon, std::vector<float>& uplane_rms, std::vector<float>& vplane_rms, std::vector<float>& wplane_rms, WCP::ChirpMap& uplane_map, WCP::ChirpMap& vplane_map, WCP::ChirpMap& wplane_map, TH2F *hu_decon_g, TH2F *hv_decon_g, TH2F *hw_decon_g, int nrebin, TH2F *hv_raw, bool flag_corr = false);

  void Organize_Dead_Channels(WCP::ChirpMap& uplane_map, WCP::ChirpMap& vplane_map, WCP::ChirpMap& wplane_map, int nbins, int nrebin, int n_div=5);
}

#endif
#ifndef WIRECELL_TOYDEPOSITOR_H
#define WIRECELL_TOYDEPOSITOR_H

#include "WCPNav/Depositor.h"
#include "WCPNav/FrameDataSource.h"
#include "WCPNav/SimDataSource.h"

namespace WCP {
  class ToyDepositor : public WCP::Depositor {
  public:
    ToyDepositor(WCP::FrameDataSource* fds, int flag = 0, float unit_dis = 1.6, int toffset = 3200, float x_center = 0, float y_center = 0, float z_center = 0, float rotate_angle = 0);
    virtual const PointValueVector& depositions(int frame_number) const;
    virtual std::vector<int>& timeoffset() const{return time_offset;};
    void clear(){mchits.clear();time_offset.clear();};
    void translation(float x_shift = 0, float y_shift = 0, float z_shift = 0);
    
  private:
    WCP::FrameDataSource* fds;
    mutable PointValueVector mchits;
    mutable std::vector<int> time_offset;

    float x_center;
    float y_center;
    float z_center;
    float rotate_angle;
    float x_shift;
    float y_shift;
    float z_shift;
    
    int flag;
    int toffset;
    float unit_dis;
  };
}

#endif
#ifndef WIRECELL2DTOY_TOYEVENTDISPLAY_H
#define WIRECELL2DTOY_TOYEVENTDISPLAY_H
#include "WCPData/Point.h"
#include "WCPData/GeomCell.h"
#include "WCPData/MergeGeomCell.h"


#include "WCP2dToy/ToyMatrix.h"

#include "WCPNav/SliceDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPNav/DetectorGDS.h"

#include "TPad.h"
#include "TH2F.h"
#include "TString.h"
#include "TGraph.h"
#include "TPolyLine.h"

namespace WCP2dToy {

    class ToyEventDisplay {
    private:
    
	TPad &pad;
	int gds_flag;
	const WCP::GeomDataSource* gds;
	const WCP::DetectorGDS* dgds;

	TH2F *h1;
	TH2F *h2;
	TGraph *g1;
	TGraph *g2;
	TGraph *g2b;
	TPolyLine *g3;
    
    public:
	/// Create a ToyEventDisplay drawing into the given TPad using the given GeomDataSource.
	ToyEventDisplay(TPad& pad, const WCP::GeomDataSource& gds);
	ToyEventDisplay(TPad& pad, const WCP::DetectorGDS& gds);
	virtual ~ToyEventDisplay();
    
	/// Initialize with extents
	virtual int init(float x_min=4.9, float x_max=6.1, float y_min=-1.1, float y_max=1.1);
    
	/// Draw the cell charges
	virtual int draw_mc(int flag, const WCP::PointValueVector& cellcharges, TString option);
    
	/// Draw a slice
	virtual int draw_slice(const WCP::Slice& slice, TString option);
	virtual int draw_wires(WCP::GeomWireSelection& wires, TString option);
	virtual int draw_merged_wires(WCP::GeomWireSelection wires, TString option, int color = 2);

	virtual int draw_points(WCP::PointVector pcells, TString option, int color = 2);

	/// Draw a selection of cells
	virtual int draw_cells(const WCP::GeomCellSelection& cellall ,TString option,int color=4);
	virtual int draw_mergecells(const WCP::GeomCellSelection& cellall ,TString option, int flag=0);
	virtual int draw_truthcells(const WCP::CellChargeMap& ccmap,TString option);
	virtual int draw_truthcells_charge(const WCP::CellChargeMap& ccmap,TString option, int FI);
	virtual int draw_wires_charge(const WCP::WireChargeMap& wcmap,TString option, int FI);
	virtual int draw_cells_charge(const WCP::GeomCellSelection& cellall ,TString option);

	virtual int draw_reconcells(const WCP::GeomCellSelection& cellall, WCP2dToy::ToyMatrix *toymatrix ,TString option, int color = 4);

	void Set_ReconThreshold(int abc){recon_threshold = abc;};
	void Set_TruthThreshold(int abc){truth_threshold = abc;};

	void draw_bad_region(WCP::ChirpMap& chirpmap, int time, int scale, int plane, TString option);
	void draw_bad_cell(WCP::GeomCellSelection& cells);

	/// Clear visual the event display data.
	void clear();

	Double_t charge_min, charge_max;

    private:
	int recon_threshold;
	int truth_threshold;
    };

}

#endif
#ifndef WIRECELL_UBOONE_TOYFIDUCIAL_H
#define WIRECELL_UBOONE_TOYFIDUCIAL_H

#include "WCP2dToy/ToyMatching.h"

#include "WCPData/Units.h"
#include "WCPData/Point.h"
#include "WCPData/SlimMergeGeomCell.h"
#include "WCPData/FlashTPCBundle.h"
#include "WCPData/ToyCTPointCloud.h"
#include "WCPData/LMBDT.h"

#include "TVector3.h"
#include "TFile.h"
#include "TTree.h"
#include "TString.h"

#include <vector>
#include <map>


#include "WCPData/Point.h"
#include "WCPData/ToyCTPointCloud.h"
#include "WCP2dToy/ImprovePR3DCluster.h"
#include "WCPData/PR3DCluster.h"

namespace WCP2dToy{
  class ToyFiducial{
  public:
    ToyFiducial(int dead_region_ch_ext = 3, double offset_t=800, double offset_u=0, double offset_v=0, double offset_w=0, double slope_t=1./2*units::mm, double slope_u=1./(3*units::mm), double slope_v=1./(3*units::mm), double slope_w=1./(3*units::mm), double angle_u=-1.047198, double angle=1.047198, double angle_w=0,
		double boundary_dis_cut=2*units::cm, double top=117*units::cm, double bottom=-116*units::cm, double upstream=0*units::cm, double downstream=1037*units::cm, double anode = 0*units::cm, double cathode=256*units::cm, int flag_data=1);
    ~ToyFiducial();

    void set_offset_t(double value){offset_t=value;};
    
    bool check_neutrino_candidate(WCP::PR3DCluster *main_cluster, WCP::WCPointCloud<double>::WCPoint& wcp1 ,WCP::WCPointCloud<double>::WCPoint& wcp2, double offset_x, WCP::ToyCTPointCloud& ct_point_cloud, bool flag_2view_check = true);
    bool inside_fiducial_volume(WCP::Point& p, double offset_x=0, std::vector<double>* tolerance_vec=NULL);
    bool inside_dead_region(WCP::Point& p);
    bool check_dead_volume(WCP::Point& p, TVector3& dir, double step = 1.0*units::cm, double offset_x=0);
    
    bool check_signal_processing(WCP::Point& p, TVector3& dir, WCP::ToyCTPointCloud& ct_point_cloud, double step = 1.0*units::cm, double offset_x=0);

    bool check_tgm(WCP::FlashTPCBundle *bundle, double offset_x, WCP::ToyCTPointCloud& ct_point_cloud,std::map<WCP::PR3DCluster*, WCP::PR3DCluster*>& old_new_cluster_map, int flag = 1);
    
    bool check_fully_contained(WCP::FlashTPCBundle *bundle, double offset_x, WCP::ToyCTPointCloud& ct_point_cloud,std::map<WCP::PR3DCluster*, WCP::PR3DCluster*>& old_new_cluster_map, unsigned int* fail_mode=nullptr, int flag = 1);
    
    int check_LM(WCP::FlashTPCBundle *bundle, double& cluster_length);
    int check_LM_cuts(WCP::FlashTPCBundle *bundle, double& cluster_length);
    int check_LM_bdt(WCP::FlashTPCBundle *bundle, double& cluster_length);
      
    void AddDeadRegion(WCP::SlimMergeGeomCell* mcell, std::vector<int>& time_slices);

    std::vector<double> get_boundary_SCB_xy_x(WCP::Point& p){
      int index_z = floor(p.z/units::m);
      if(index_z<0){index_z=0;} else if(index_z>9){index_z=9;}
      return boundary_SCB_xy_x_array[index_z];
    }
    std::vector<double> get_boundary_SCB_xy_y(WCP::Point& p){
      int index_z = floor(p.z/units::m);
      if(index_z<0){index_z=0;} else if(index_z>9){index_z=9;}
      return boundary_SCB_xy_y_array[index_z];
    }
    std::vector<double> get_boundary_SCB_xz_x(WCP::Point& p){
      int index_y = floor((p.y/units::cm+116)/24);
      if(index_y<0){index_y=0;} else if(index_y>9){index_y=9;}
      return boundary_SCB_xz_x_array[index_y];
    }
    std::vector<double> get_boundary_SCB_xz_z(WCP::Point& p){
      int index_y = floor((p.y/units::cm+116)/24);
      if(index_y<0){index_y=0;} else if(index_y>9){index_y=9;}
      return boundary_SCB_xz_z_array[index_y];
    }
    int check_boundary(std::vector<std::vector<WCP::WCPointCloud<double>::WCPoint>> extreme_points, double offset_x, std::vector<double>* tol_vec);
    void cosmic_tagger(double eventTime, WCP::OpflashSelection& flashes,WCP::FlashTPCBundleSelection *matched_bundles, WCP::FlashTPCBundle* main_bundle, WCP::Photon_Library *pl,
      int time_offset, int nrebin, float unit_dis, WCP::ToyCTPointCloud& ct_point_cloud,
		       std::map<WCP::PR3DCluster*, WCP::PR3DCluster*>& old_new_cluster_map, int run_no, int subrun_no, int event_no,  bool flag_data, bool debug_tagger=false, bool flag_timestamp = false);
    
  protected:
    // boundary
    double m_top; // top distance
    double m_bottom; // bottom distance
    double m_upstream;
    double m_downstream;
    double m_anode;
    double m_cathode;
    
    // space charge boundary
    double m_sc_bottom_1_x, m_sc_bottom_1_y;
    double m_sc_bottom_2_x, m_sc_bottom_2_y;

    double m_sc_top_1_x, m_sc_top_1_y;
    double m_sc_top_2_x, m_sc_top_2_y;

    double m_sc_upstream_1_x, m_sc_upstream_1_z;
    double m_sc_upstream_2_x, m_sc_upstream_2_z;

    double m_sc_downstream_1_x, m_sc_downstream_1_z;
    double m_sc_downstream_2_x, m_sc_downstream_2_z;

    std::vector<double> boundary_xy_x, boundary_xy_y;
    std::vector<double> boundary_xz_x, boundary_xz_z;
    std::vector<double> boundary_SCB_xy_x, boundary_SCB_xy_y;
    std::vector<double> boundary_SCB_xz_x, boundary_SCB_xz_z;

    std::vector<std::vector<double>> boundary_xy_x_array, boundary_xy_y_array;
    std::vector<std::vector<double>> boundary_xz_x_array, boundary_xz_z_array;
    std::vector<std::vector<double>> boundary_SCB_xy_x_array, boundary_SCB_xy_y_array;
    std::vector<std::vector<double>> boundary_SCB_xz_x_array, boundary_SCB_xz_z_array;
    
    // dead regions ... 
    WCP::SMGCSelection mcells;
    std::map<WCP::SlimMergeGeomCell*, std::pair<int,int>> mcell_time_map;
    std::map<int, std::set<WCP::SlimMergeGeomCell*>> ch_mcell_set_map;
    
    // conversion between positions to the channel and time ???

    // convert time into a position
    // (time_slice - offset_t) / slope_t = position_x 
    double offset_t, slope_t;
    // convert u wire number into a position
    // (u_index -offset_u) / slope_u = position_u
    double offset_u, slope_u;
    // convert v wire number into a position
    double offset_v, slope_v;
    // convert w wire number into a position 
    double offset_w, slope_w;
    double angle_u, angle_v, angle_w;

    int dead_region_ch_ext;
    
  };
}

#endif
#ifndef WIRECELL_TOYHYPOTHESIS_H
#define WIRECELL_TOYHYPOTHESIS_H

#include "WCPData/MergeGeomCell.h"

namespace WCP2dToy{
  class ToyHypothesis {
  public:
    ToyHypothesis();
    ToyHypothesis(WCP::MergeGeomCell& mcell1, WCP::MergeGeomCell& mcell2);
    ~ToyHypothesis();
    double CalValue(WCP::Point p, WCP::Point p1, WCP::Point p2);
    bool IsInside(WCP::Point p);
    bool IsInside(const WCP::GeomCell& cell);
    
    
  private:
    WCP::Point p1[2],p2[2],pc[2];
  };
  typedef std::vector<const WCP2dToy::ToyHypothesis*> HypoSelection;
}


#endif
#ifndef WCP2dToy_TOYLIBPE_H
#define WCP2dToy_TOYLIBPE_H

#include "WCPData/Point.h"

#include "TFile.h"
#include "TTree.h"

namespace WCP2dToy{

  typedef std::vector<WCP::Point> pointVec;

  class ToyLibPe{
  public:
    ToyLibPe(const char* root_file);
    ~ToyLibPe();
    
    std::vector<double> getXYZQ(std::vector<float> *x, std::vector<float> *y, std::vector<float> *z, std::vector<float> *e);
    std::vector<double> getShiftedXYZQ(std::vector<float> *x, std::vector<float> *y, std::vector<float> *z, std::vector<float> *e, float xOffset, float yOffset, float zOffset);

    std::pair<float,float> getXminXmax(std::vector<float> *x);
    std::pair<float,float> getShiftedXminXmax(std::vector<float> *x, float xOffset);

    bool xInFidVol(std::pair<float,float> &x);
    bool xAtBoundary(std::pair<float,float> &x);
    std::vector<double> fromClusterFindPeDist(std::vector<float> *x, std::vector<float> *y, std::vector<float> *z, std::vector<float> *e, float xOffset, float yOffset, float zOffset);
    
  protected:
    int convert_to_voxel_id(WCP::Point& p);
    std::map<int,int> getMapLibPmt();
    std::map<int,int> getMapPmtLib();
    std::vector<std::vector<std::pair<int,float> > > getPhotonLibrary();
    
    TFile *file;
    TTree *T;
    std::vector<int> *trackId;
    std::vector<float> *energy;
    std::vector<float> *numElectrons;
    std::vector<float> *x;
    std::vector<float> *y;
    std::vector<float> *z;
  };
}
#endif
#ifndef WIRECELL_TOYLIGHTRECO_H
#define WIRECELL_TOYLIGHTRECO_H

#include "WCPData/Opflash.h"

#include "TFile.h"
#include "TTree.h"
#include "TObject.h"
#include "TClonesArray.h"
#include <TH2.h>
#include <vector>

namespace WCP2dToy{

  struct pmtDisc{
    short channel;
    double timestamp;
    std::vector<short> wfm;
    bool saturated;
    bool isolated;
    bool highGain;
  };
  typedef std::map<short,pmtDisc> pmtMap;
  struct timeOrder_pmtDisc{
    bool operator()(const pmtDisc& a, const pmtDisc& b) const
    {return a.timestamp < b.timestamp;}
  };
  typedef std::set<pmtDisc,timeOrder_pmtDisc> pmtSet;
  typedef std::map<short,pmtSet> pmtMapSet;
  typedef std::pair<pmtDisc,pmtDisc> pmtPair;
  struct timeOrder_pmtPair{
    bool operator()(const pmtPair& a, const pmtPair& b) const
    {return a.first.timestamp < b.first.timestamp;}
  };
  typedef std::set<pmtPair,timeOrder_pmtPair> pmtSetPair;
  typedef std::map<short,pmtPair> pmtMapPair;
  typedef std::map<short,pmtSetPair> pmtMapSetPair;
  typedef std::vector<std::pair<short,short> > saturationTick;
  
  class ToyLightReco{
  public:
    ToyLightReco(const char* root_file, bool imagingoutput=false, int datatier=0);
    ~ToyLightReco();

    void load_event_raw(int eve_num, double tMin=3, double tMax=6); 
    TH1F* get_raw_hist(int ch){return hraw[ch];};
    TH1F* get_decon_hist(int ch){return hdecon[ch];};
    TH1F* get_l1_hist(int ch){return hl1[ch];};

    TClonesArray* get_rawWfm(){return fop_wf;}
    std::vector<short>* get_rawChan(){return fop_femch;}
    std::vector<double>* get_rawTimestamp(){return fop_timestamp;}
    TH1F* get_totPE(){return h_totPE;};
    TH1F* get_mult(){return h_mult;};
    TH1F* get_l1_mult(){return h_l1_mult;};
    TH1F* get_l1_totPE(){return h_l1_totPE;};
    
    WCP::OpflashSelection& get_flashes(){return flashes;};
    WCP::OpflashSelection& get_cosmic_flashes(){return cosmic_flashes;};
    WCP::OpflashSelection& get_beam_flashes(){return beam_flashes;};

    void clear_flashes();

  private:
    //    bool delete_status;

  protected:
    void Process_beam_wfs(double tMin, double tMax);
    void sort_flashes();
    void update_pmt_map();
    
    pmtMapSet makePmtContainer(bool high, bool beam, TClonesArray *wf, std::vector<short> *chan, std::vector<double> *timestamp);
    pmtMapPair makeBeamPairs(pmtMapSet &high, pmtMapSet &low);
    pmtMapSetPair makeCosmicPairs(pmtMapSet &high, pmtMapSet &low);
    pmtMap mergeBeam(pmtMapPair &beam);
    pmtMapSet mergeCosmic(pmtMapSetPair &cosmic);
    saturationTick findSaturationTick(std::vector<short> &wfm);
    std::vector<short> replaceSaturatedBin(std::vector<short> &high, std::vector<short> &low, saturationTick &st);
    void dumpPmtVec(pmtMap &beam, pmtMapSet &cosmic);

    double findBaselineLg(TH1 *hist, int nbin=1500);
    std::pair<double,double> cal_mean_rms(TH1 *hist, int nbin=1500);

    float findScaling(int opdet);

    TFile *file;
    TTree *T;
    TH2F *hdecon2;
    TH1D* priorFlashProfile;
    TH1D* candidateFlashProfile;
    WCP::OpflashSelection cosmic_flashes;
    WCP::OpflashSelection beam_flashes;
    WCP::OpflashSelection flashes;
    WCP::COphitSelection op_hits;

    TClonesArray* cosmic_hg_wf;
    TClonesArray* cosmic_lg_wf;
    TClonesArray* beam_hg_wf;
    TClonesArray* beam_lg_wf;
    std::vector<short> *cosmic_hg_opch;
    std::vector<short> *cosmic_lg_opch;
    std::vector<short> *beam_hg_opch;
    std::vector<short> *beam_lg_opch;
    std::vector<double> *cosmic_hg_timestamp;
    std::vector<double> *cosmic_lg_timestamp;
    std::vector<double> *beam_hg_timestamp;
    std::vector<double> *beam_lg_timestamp;
    std::vector<float> *op_gain;
    std::vector<float> *op_gainerror;
    

    double triggerTime;
    double gain[32];
    double beam_dt[32];
    TH1F **hraw; // raw
    TH1F **hdecon; // deconvolution and rebin ...
    TH1F **hl1;

    TH1F *h_totPE;
    TH1F *h_mult;
    TH1F *h_l1_mult;
    TH1F *h_l1_totPE;
    
    /* TClonesArray *fop_wf_beam; */
    /* std::vector<short> *fop_femch_beam; */
    /* std::vector<double> *fop_timestamp_beam; */
    /* int ctr_beam; */

    /* TClonesArray *fop_wf_cosmic; */
    /* std::vector<short> *fop_femch_cosmic; */
    /* std::vector<double> *fop_timestamp_cosmic; */
    /* int ctr_cosmic; */

    TClonesArray *fop_wf;
    std::vector<short> *fop_femch;
    std::vector<double> *fop_timestamp;
    int ctr;

    int f_datatier;
  };
}

#endif
#ifndef WCP2dToy_TOYMATCHING_H
#define WCP2dToy_TOYMATCHING_H

#include "WCPData/PR3DCluster.h"
//#include "WCP2dToy/uBooNE_light_reco.h"
#include "WCP2dToy/ToyLightReco.h"
#include "WCPData/FlashTPCBundle.h"
#include "WCPData/PhotonLibrary.h"

namespace WCP2dToy{

  /* class Photon_Library { */
  /*   public: */
  /*     std::map<int,int> map_lib_pmt, map_pmt_lib; */
  /*     std::vector<std::list<std::pair<int,float>>> library; */
  /*     double scaling_light_mag, rel_light_yield_err; */

  /*     Photon_Library(Int_t run_no = 0, bool flag_data = true, bool flag_add_light_yield_err = false); */
  /* }; */

  // time_offset in us
  int convert_xyz_voxel_id(WCP::Point& p);

  void calculate_pred_pe(int run_no, double eventTime, int time_offset, int nrebin, double time_slice_width, WCP::Photon_Library *pl, WCP::FlashTPCBundle* bundle, std::vector<double>* pred_pmt_light, 
			 std::vector<std::pair<WCP::PR3DCluster*,double>>* additional_clusters, WCP::PR3DClusterSelection* other_clusters, WCP::PR3DClusterSelection* more_clusters, bool &flag_good_bundle, bool flag_data, bool flag_timestamp = false);

  WCP::FlashTPCBundleSelection tpc_light_match(double eventTime, int time_offset, int nrebin, WCP::Photon_Library *pl, WCP::map_cluster_cluster_vec& group_clusters, WCP::OpflashSelection& flashes, Int_t runno = 0,  bool flag_data = true, bool flag_add_light_yield_err = false, bool flag_timestamp = false);

  // WCP::FlashTPCBundleSelection tpc_light_match_ana(int time_offset, int nrebin, std::map<WCP::PR3DCluster*,std::vector<std::pair<WCP::PR3DCluster*,double>>>& group_clusters, WCP::OpflashSelection& flashes);

  void organize_matched_bundles(WCP::FlashTPCBundleSelection& results_bundles, Double_t *cos_pe_low, Double_t *cos_pe_mid, std::map<std::pair<WCP::Opflash*,WCP::PR3DCluster*>,WCP::FlashTPCBundle*>& fc_bundles_map);
  
  
}

#endif
#ifndef WIRECELL_TOYMATRIX_H
#define WIRECELL_TOYMATRIX_H

#include "TMatrixD.h"
#include "TVectorD.h"
#include "WCPData/GeomCell.h"
#include "WCPData/GeomWire.h"
#include "WCPData/MergeGeomCell.h"
#include "WCPData/MergeGeomWire.h"
#include "WCP2dToy/MergeToyTiling.h"

namespace WCP2dToy{
  class ToyMatrix {
  public:
    ToyMatrix();
    ToyMatrix(WCP2dToy::ToyTiling& toytiling, WCP2dToy::MergeToyTiling& mergetiling, int svd_flag, int recon_t = 2000);
    
    ToyMatrix(WCP2dToy::ToyTiling& toytiling, WCP2dToy::MergeToyTiling& mergetiling, int recon_t=2000);
    ToyMatrix(const WCP::DetectorGDS& gds, WCP2dToy::ToyTiling& toytiling, WCP2dToy::MergeToyTiling& mergetiling, int recon_t=2000);
    

    

    virtual ~ToyMatrix();

    

    double Get_Chi2(){return chi2;};
    float Get_Solve_Flag(){return solve_flag;};
    int Get_mcindex(){return mcindex;};
    int Get_mwindex(){return mwindex;};
    int Get_swindex(){return swindex;};

    const TMatrixD* Get_MA(){return MA;};
    const TMatrixD* Get_MB(){return MB;};
    const TMatrixD* Get_MAT(){return MAT;};
    const TMatrixD* Get_MBT(){return MBT;};
    const TMatrixD* Get_Vy(){return Vy;};
    const TMatrixD* Get_VBy(){return VBy;};
    const TMatrixD* Get_Vx(){return Vx;};
    const TMatrixD* Get_VBy_inv(){return VBy_inv;};
    const TMatrixD* Get_Vx_inv(){return Vx_inv;};
    const TMatrixD* Get_MC(){return MC;};
    const TMatrixD* Get_MC_inv(){return MC_inv;};
    const TVectorD* Get_Wy(){return Wy;};
    
    double Get_Cell_Charge( const WCP::GeomCell *cell, int flag = 1) ;
    int Get_mcindex(const WCP::GeomCell *cell){ return mcimap[cell];};
    double Get_residual(const WCP::GeomCell *cell);

    void Set_chi2(double chi2t){chi2 = chi2t;};
    void Set_value(double value, int index){ (*Cx)[index] = value;};
    void Set_error(double value, int index){ (*dCx)[index] = value;};

    double Get_value(int index){return (*Cx)[index];};
    double  Get_error(int index){return (*dCx)[index];};

    void Set_ndf(double ndf1){ndf = ndf1;};
    void Set_Solve_Flag(float solve_flag1){solve_flag=solve_flag1;};
    void Print();
    int Get_ndf(){return ndf;};
    
    //void Set_blob(int num1){num_blob = num1;};
    int Get_blob(){return num_blob;};
    bool GetSimpleBlobReduction(){return simple_blob_reduction;};
    void SetSimpleBlobReduction(bool val){simple_blob_reduction = val;};
    void JudgeSimpleBlob(WCP2dToy::ToyTiling& toytiling, WCP2dToy::MergeToyTiling& mergetiling);
    

    void Update_pred();

    std::vector<int>& Get_svd_removed(){return svd_removed;};
    
    

  protected:
    int recon_threshold;
    std::vector<int> svd_removed;

    int num_blob;
    bool simple_blob_reduction;


    int Solve();
    int Solve_SVD();

    int svd_flag;

    TMatrixD *MA, *MB, *MAT, *MBT;
    TMatrixD *Vy, *VBy, *Vx, *VBy_inv, *Vx_inv;

    TMatrixD *MC, *MC_inv;

    TVectorD *Wy, *Cx, *dCx;
    
    TVectorD *MWy_pred, *MWy;

    double chi2;
    int ndf;
    int solve_flag;

    void Buildup_index(WCP2dToy::MergeToyTiling& mergetiling);
    void Buildup_index(const WCP::DetectorGDS& gds, WCP2dToy::MergeToyTiling& mergetiling);
   

    WCP::WireIndexMap mwimap, swimap;
    WCP::CellIndexMap mcimap;
    
    std::map<int,int> scimap;
    

    int mcindex;
    int mwindex;
    int swindex;
  };
}

#endif
#ifndef WIRECELL_TOYMATRIXEXCLUSIVE_H
#define WIRECELL_TOYMATRIXEXCLUSIVE_H

#include "WCP2dToy/ToyMatrix.h"
#include "TMatrixDEigen.h"


namespace WCP2dToy {
  class ToyMatrixExclusive {
  public:
    ToyMatrixExclusive(WCP2dToy::ToyMatrix &toymatrix);
    virtual ~ToyMatrixExclusive();
    

  protected: 
    int ncount;
    int Solve(std::vector<int>& flag, WCP2dToy::ToyMatrix &toymatrix);
    void move(std::vector<int>& flag, int index, int max);

    int numz; // number of zeros in the matrix's eigenvalues
   
    int mcindex;
    int mwindex;
    int swindex;

    TMatrixDEigen *Eigen;
    TVectorD *EigenValue;
    TMatrixD *trans; 
    /* TMatrixD *transT; */

    TMatrixD *MA, *MAT;
    TMatrixD *MC, *MC_inv;
    TMatrixD *Vx, *Vx_inv;
    //temporary solution
    TVectorD *Cxt, *dCxt;
    double chi2t;
    
    //final solution
    //TVectorD *Cx, *dCx;
    double chi2;
    
  };
}
#endif
#ifndef WIRECELL_TOYMATRIXITERATE_H
#define WIRECELL_TOYMATRIXITERATE_H

#include "WCP2dToy/ToyMatrix.h"
#include "WCP2dToy/ToyMatrixKalman.h"

namespace WCP2dToy {
  class ToyMatrixIterate {
  public:
    ToyMatrixIterate(WCP2dToy::ToyMatrix &toymatrix, int recon_t = 2000, float limit = 1e6);
    ToyMatrixIterate(WCP2dToy::ToyMatrix &toymatrix, WCP2dToy::MergeToyTiling &mergecur, WCP::GeomCellSelection &cells, int recon_t = 2000);
    ToyMatrixIterate(WCP2dToy::ToyMatrix *toybefore, WCP2dToy::ToyMatrix *toycur, WCP2dToy::ToyMatrix *toyafter, WCP2dToy::MergeToyTiling *mergebefore, WCP2dToy::MergeToyTiling *mergecur, WCP2dToy::MergeToyTiling *mergeafter, 
		     int recon_t = 2000, float limit = 1e6, double penalty = 5, double penalty_ncpt = 0);    

    ToyMatrixIterate(WCP2dToy::ToyMatrix &toymatrix, std::vector<int>& already_removed, int recon_t = 2000, int limit = 1e6); // not very useful any way ... 

    void UseTime(WCP2dToy::ToyMatrix &toybefore, WCP2dToy::ToyMatrix &toycur, WCP2dToy::ToyMatrix &toyafter, WCP2dToy::MergeToyTiling &mergebefore, WCP2dToy::MergeToyTiling &mergecur, WCP2dToy::MergeToyTiling &mergeafter); //previous use time, not popular now ... 


    virtual ~ToyMatrixIterate();
    int Get_ncount(){return ncount;};
    int Get_timeflag(){return time_flag;};
    
  protected:
    void Iterate(WCP2dToy::ToyMatrixKalman &toymatrixkalman,WCP2dToy::ToyMatrix &toymatrix);
    void Iterate_simple(WCP2dToy::ToyMatrixKalman &toymatrixkalman,WCP2dToy::ToyMatrix &toymatrix);
    void Iterate_simple1(WCP2dToy::ToyMatrixKalman &toymatrixkalman,WCP2dToy::ToyMatrix &toymatrix);
    void find_subset(WCP2dToy::ToyMatrixKalman &toymatrixkalman,WCP2dToy::ToyMatrix &toymatrix,  std::vector<int>& vec);
    int ncount;
    int prev_ncount;
    int nlevel;
    double estimated_loop;

    double penalty_ncpt;

    int time_flag;
    int recon_threshold;

    std::map<int,double> cell_penal;
    std::map<int,std::vector<int>> cells_ncpt;
    
    WCP2dToy::ToyMatrixKalman *toymatrixkalman;
 };
}
#endif
#ifndef TOYMATRIXITERATE_ONLY_H
#define TOYMATRIXITERATE_ONLY_H

#include "WCP2dToy/ToyMatrix.h"
#include "WCP2dToy/MergeToyTiling.h"
#include "WCP2dToy/ToyMatrixKalman.h"

namespace WCP2dToy{
  class ToyMatrixIterate_Only{
  public:
    ToyMatrixIterate_Only(WCP2dToy::ToyMatrix& toymatrix, WCP2dToy::MergeToyTiling* mergetiling);
    ~ToyMatrixIterate_Only();
    

  protected:
     WCP2dToy::ToyMatrix &toymatrix;
     WCP2dToy::MergeToyTiling *mergetiling;
     WCP::WireChargeMap wirechargemap;
     WCP::GeomCellMap cellmap;
     
     WCP::GeomCellSelection all_cells;
     
     void Iterate(WCP::GeomCellSelection remaining_cells, 
		  WCP::GeomCellSelection good_cells,
		  WCP::GeomWireSelection used_wires,
		  WCP::GeomCellSelection bad_cells,
		  WCP::GeomCellSelection& tried_cells);

     int ncount;
     int nlevel;
     
  };
}

#endif

#ifndef TOYMATRIXITERATE_SINGLEWIRE_H
#define TOYMATRIXITERATE_SINGLEWIRE_H

#include "WCP2dToy/ToyMatrix.h"
#include "WCP2dToy/MergeToyTiling.h"
#include "WCP2dToy/ToyMatrixKalman.h"

namespace WCP2dToy{
  class ToyMatrixIterate_SingleWire{
  public:
    ToyMatrixIterate_SingleWire(WCP2dToy::ToyMatrix& toymatrix, WCP2dToy::MergeToyTiling* mergetiling);
    ToyMatrixIterate_SingleWire(WCP2dToy::ToyMatrix *toybefore, WCP2dToy::ToyMatrix *toycur, WCP2dToy::ToyMatrix *toyafter, WCP2dToy::MergeToyTiling *mergebefore, WCP2dToy::MergeToyTiling *mergecur, WCP2dToy::MergeToyTiling *mergeafter, 
				int recon_t = 2000, float limit = 1e5, double penalty = 5, double penalty_ncpt = 0);  
    
    virtual ~ToyMatrixIterate_SingleWire();
  protected:
    WCP2dToy::ToyMatrix &toymatrix;
    WCP2dToy::MergeToyTiling *mergetiling;
    WCP::WireChargeMap wirechargemap;
    int ncount;
    int nlevel;
    float limit;
    
    double penalty_ncpt;
    std::map<int,double> cell_penal;
    std::map<int,std::vector<int>> cells_ncpt;

    void Iterate(WCP::GeomCellSelection cells, WCP::GeomCellSelection single_cells, WCP::GeomCellSelection tried_cell, WCP::GeomCellMap cellmap, WCP::GeomWireMap wiremap);

  };
}

#endif
#ifndef WIRECELL_TOYMATRIXKALMAN_H
#define WIRECELL_TOYMATRIXKALMAN_H

#include "WCP2dToy/ToyMatrix.h"
#include "TMatrixDEigen.h"

namespace WCP2dToy {
  class ToyMatrixKalman {
  public:
    ToyMatrixKalman(WCP2dToy::ToyMatrix &toymatrix, int flag_no_need=1, double chi2_penalty = 0);
    ToyMatrixKalman(std::vector<int>& already_removed1, std::vector<int>& no_need_remove1 ,WCP2dToy::ToyMatrix &toymatrix, int check, int flag_no_need=1, double chi2_penalty = 0);
    virtual ~ToyMatrixKalman();

    int Get_numz(){return numz;};
    int Get_ncount(){return ncount;};
    std::vector<int>& Get_already_removed(){return already_removed;};
    std::vector<int>& Get_no_need_remove(){return no_need_remove;};
    int Get_mcindex(){return mcindex;};
    int Cal_numz(WCP2dToy::ToyMatrix &toymatrix);
    void init(WCP2dToy::ToyMatrix &toymatrix);
    void Set_penalty(double val){chi2_penalty = val;}

  protected:
    int flag_no_need;
    double chi2_penalty;

    std::vector<int> already_removed;
    std::vector<int> no_need_remove;
    
    int numz; //number of zeros in the matrix
    int ncount; // how many solve was done
    
    int mcindex;
    int mwindex;
    int swindex;

    TMatrixDEigen *Eigen;
    TVectorD *EigenValue;

    int check_flag;

    /* TMatrixD *MA, *MAT; */
    /* TMatrixD *MC, *MC_inv; */
  };
}
#endif
#ifndef WIRECELL_TOYMATRIXMARKOV_H
#define WIRECELL_TOYMATRIXMARKOV_H

#include "WCP2dToy/ToyMatrix.h"
#include "WCP2dToy/ToyMatrixKalman.h"
#include "WCPData/MergeGeomCell.h"

typedef std::pair<int, double> CellRankPair;
struct CellRankCompare {
  bool operator() (const CellRankPair& a, const CellRankPair& b) const {
    if (a.second == b.second){
      return a.first < b.first;
    }
    return a.second > b.second;
  }
};
typedef std::set<CellRankPair, CellRankCompare> CellRankSet;

namespace WCP2dToy{
  class ToyMatrixMarkov {
  public:
    ToyMatrixMarkov(WCP2dToy::ToyMatrix *toymatrix1, WCP::GeomCellSelection *allmcell1, int recon_t1=1500, int recon_t2=2000);
    ToyMatrixMarkov(WCP2dToy::ToyMatrix &toymatrix1, WCP2dToy::MergeToyTiling &mergecur, WCP::GeomCellSelection *allmcell1, WCP::GeomCellSelection &cells, int recon_t1=1500, int recon_t2=2000);
    
    ToyMatrixMarkov(WCP2dToy::ToyMatrix *toybefore, WCP2dToy::ToyMatrix *toycur, WCP2dToy::ToyMatrix *toyafter, WCP2dToy::MergeToyTiling *mergebefore, WCP2dToy::MergeToyTiling *mergecur, WCP2dToy::MergeToyTiling *mergeafter, WCP::GeomCellSelection *allmcell1, int recon_t1=1500, int recon_t2=2000, double penalty = 5, double penalty_ncpt = 0);

    ToyMatrixMarkov(WCP2dToy::ToyMatrix &toybefore, WCP2dToy::ToyMatrix &toycur, WCP2dToy::ToyMatrix &toyafter, WCP2dToy::MergeToyTiling &mergebefore, WCP2dToy::MergeToyTiling &mergecur, WCP2dToy::MergeToyTiling &mergeafter, WCP::GeomCellSelection *allmcell1, int recon_t1=1500, int recon_t2=2000, double penalty = 5, double penalty_ncpt = 0);

    virtual ~ToyMatrixMarkov();

    std::vector<int>& Get_cur_cell_status(){ return cur_cell_status;};
    std::vector<int>& Get_cur_cell_pol(){ return cur_cell_pol;};
    std::vector<double>& Get_cell_res(){ return cell_res;};
    std::vector<double>& Get_cell_charge(){ return cell_charge;};
    std::vector<double>& Get_cell_prob(){ return cell_prob;};
    

  protected:
    void find_subset(WCP2dToy::ToyMatrixKalman &toymatrix,WCP2dToy::ToyMatrix &toymatrix1, std::vector<int>& vec);
    void make_guess();
    void Iterate(WCP2dToy::ToyMatrixKalman &toykalman);
    
    WCP2dToy::ToyMatrix *toymatrix;
    WCP2dToy::ToyMatrixKalman *toymatrixkalman;
    WCP::GeomCellSelection *allmcell;
    int ncount; // count the number of iterations

    double penalty_ncpt;

    int first_flag;
    float  use_time_threshold;

    //store the MC information
    int mcindex;

    std::vector<int> use_time; //to be added

    
    std::vector<int>    cur_cell_status; // which one is off from beginning
    std::vector<int>    cur_cell_index;
    std::vector<int>    cur_cell_pol; // on or off
    std::vector<double> cell_res; // residual
    std::vector<double> cell_charge;
    std::vector<double> cell_prob; // probability to go off
    CellRankSet cell_set;

    std::vector<int>    next_cell_status; // to be predicted which one is off from beginning
   
    double cur_chi2; //current chi2
    double cur_chi2_save;
    double cur_dof;
    
    double next_chi2; // chi2 for the next cell
    double next_dof;

    std::map<int,double> cell_penal;
    std::map<int,std::vector<int>> cells_ncpt;
    
    int recon_threshold1;
    int recon_threshold2;


    int nlevel;
  };
}

#endif
#ifndef WIRECELL_TOYMETRIC_H
#define WIRECELL_TOYMETRIC_H

#include "WCP2dToy/ToyMatrix.h"
#include "WCPData/MergeGeomCell.h"
#include "WCPData/GeomCell.h"

namespace WCP2dToy{
  class ToyMetric {
  public:
    ToyMetric();
    virtual ~ToyMetric();

    void Add(WCP::GeomCellSelection &allmcell, WCP2dToy::ToyMatrix& toymatrix, WCP::CellChargeMap& ccmap);
    void Print();
    void AddSolve(int cond);
    
  private:
    int rm_cell_true;  float charge_rm_cell_true; float Tcharge_rm_cell_true;
    int rm_cell_false; float charge_rm_cell_false;
    int el_cell_true;  float charge_el_cell_true; float Tcharge_el_cell_true;
    int el_cell_false; float charge_el_cell_false;

    int solve_condition[3];

    int threshold;
  };
}
#endif
#ifndef WIRECELL2dToy_TOYSIGNALGAUS_H
#define WIRECELL2dToy_TOYSIGNALGAUS_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPNav/DetectorGDS.h"

#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class ToySignalGausFDS : public WCP::FrameDataSource
  {
  public:
    ToySignalGausFDS(WCP::FrameDataSource& fds,  const WCP::GeomDataSource& gds, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ToySignalGausFDS(WCP::FrameDataSource& fds,  const WCP::DetectorGDS& gds, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ~ToySignalGausFDS();

    virtual int size() const;
    virtual int jump(int frame_number);

    void Save();

  private:
    WCP::FrameDataSource& fds;
    int gds_flag;
    const WCP::GeomDataSource* gds;
    const WCP::DetectorGDS* dgds;
    int max_frames;
    int nbin;

    float time_offset_uv;
    float time_offset_uw;
    float overall_time_offset;
    
    int nwire_u, nwire_v, nwire_w;

    /* TH1F **hu; */
    /* TH1F **hv; */
    /* TH1F **hw; */

    TH1F *hu;
    TH1F *hv;
    TH1F *hw;

    TH1F *hfilter_time_gaus;
    TH1 *hfilter_gaus;
    TF1 *filter_g;

    TH1F *hur, *hvr, *hwr;

    TGraph *gu, *gv, *gw;

    TH1 *hmr_u, *hpr_u;
    TH1 *hmr_v, *hpr_v;
    TH1 *hmr_w, *hpr_w;
    
  };

}

#endif
#ifndef WIRECELL2dToy_TOYSIGNALPRE_H
#define WIRECELL2dToy_TOYSIGNALPRE_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class ToySignalPreFDS : public WCP::FrameDataSource
  {
  public:
    ToySignalPreFDS(WCP::FrameDataSource& fds,  const WCP::GeomDataSource& gds, int bins_per_frame1 = 9600, int nframes_total = -1);
    ~ToySignalPreFDS();

    virtual int size() const;
    virtual int jump(int frame_number);

    void Save();

  private:
    WCP::FrameDataSource& fds;
    const WCP::GeomDataSource& gds;
    int max_frames;
    
    int nwire_u, nwire_v, nwire_w;

    TH1F **hu;
    TH1F **hv;
    TH1F **hw;

    TH1F *hfilter_u;
    TH1F *hfilter_v;
    TH1F *hfilter_w;
    
    TH1F *hfilter_time_u;
    TH1F *hfilter_time_v;
    TH1F *hfilter_time_w;

    TGraph *gu;
    TGraph *gv;
    TGraph *gw;
  };

}

#endif
#ifndef WIRECELL2dToy_TOYSIGNALSIMU_H
#define WIRECELL2dToy_TOYSIGNALSIMU_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPNav/DetectorGDS.h"
#include "WCPSst/MCTruth.h"

#include "WCPSignal/ElectronicsConfig.h"
#include "WCPSignal/ConvolutedResponse.h"
#include "WCPSignal/DetGenerativeFDS.h"
//#include "WCPSignal/GenerativeFDS.h"
#include "WCPSignal/GenNoise.h"



#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class ToySignalSimuFDS : public WCP::FrameDataSource
  {
  public:
    ToySignalSimuFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, int bins_per_frame1 = 9600, int nframes_total = -1,float time_offset_uv = 0, float time_offset_uw = 0, int flag_random = 1, float overall_time_offset = 0, int overall_time_shift = 0);
    ToySignalSimuFDS(WCP::FrameDataSource& fds, const WCP::DetectorGDS& gds, int bins_per_frame1 = 9600, int nframes_total = -1,float time_offset_uv = 0, float time_offset_uw = 0, int flag_random = 1, float overall_time_offset = 0, int overall_time_shift = 0);
    ToySignalSimuFDS(WCP::FrameDataSource& fds, const WCP::DetectorGDS& gds, WCPSignal::ElectronicsConfig& conf, int nframes_total = -1,float time_offset_uv = 0, float time_offset_uw = 0, int flag_random = 1, float overall_time_offset = 0, int overall_time_shift = 0);
    ToySignalSimuFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, WCPSignal::ElectronicsConfig& conf, int nframes_total = -1,float time_offset_uv = 0, float time_offset_uw = 0, int flag_random = 1, float overall_time_offset = 0, int overall_time_shift = 0);

    ~ToySignalSimuFDS();

    virtual int size() const;
    virtual int jump(int frame_number);
    //fixed it ...
   
    void Save();
    
  private:
    WCP::FrameDataSource& fds;

    int simulation_type; 
    // 1 for the simple simulation (1D the oldest one)
    // 2 for Xiaoyue's simulation (2D)

    int gds_flag;
    const WCP::GeomDataSource* gds;
    const WCP::DetectorGDS* dgds;
    int  max_frames;
    int overall_time_shift;

    float time_offset_uv, time_offset_uw;
    int flag_random;
    
    int nwire_u, nwire_v, nwire_w;

    //test save ... 
    TH1F **hu1;
    TH1F **hv1;
    TH1F **hw1;
    //test save

    TH1F *hu;
    TH1F *hv;
    TH1F *hw;
    

    TGraph *gu, *gv, *gw;

    TH1F *hur, *hvr, *hwr;

  public:
    WCPSignal::GenNoise *noise;
    WCPSignal::ElectronicsConfig* config;
    
  };
}

#endif
#ifndef WIRECELL2dToy_TOYSIGNALSIMUDEAD_H
#define WIRECELL2dToy_TOYSIGNALSIMUDEAD_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPNav/DetectorGDS.h"
#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class ToySignalSimuDeadFDS : public WCP::FrameDataSource
  {
  public:
    ToySignalSimuDeadFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, int bins_per_frame1 = 9600, int nframes_total = -1,float time_offset_uv = 0, float time_offset_uw = 0, int flag_random = 1, float overall_time_offset = 0, int overall_time_shift = 0);
    ToySignalSimuDeadFDS(WCP::FrameDataSource& fds, const WCP::DetectorGDS& gds, int bins_per_frame1 = 9600, int nframes_total = -1,float time_offset_uv = 0, float time_offset_uw = 0, int flag_random = 1, float overall_time_offset = 0, int overall_time_shift = 0);
    ~ToySignalSimuDeadFDS();

    virtual int size() const;
    virtual int jump(int frame_number);
    //fixed it ...
    

    void Save();
    
    const std::vector<bool> deadVec{true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,true,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,true,true,true,true,true,false,false,false,true,true,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true};

  private:
    WCP::FrameDataSource& fds;

    int gds_flag;
    const WCP::GeomDataSource* gds;
    const WCP::DetectorGDS* dgds;
    int  max_frames;
    int overall_time_shift;

    float time_offset_uv, time_offset_uw;
    int flag_random;
    
    int nwire_u, nwire_v, nwire_w;

    //test save ... 
    TH1F **hu1;
    TH1F **hv1;
    TH1F **hw1;
    //test save


    TH1F *hu;
    TH1F *hv;
    TH1F *hw;
    


    TGraph *gu, *gv, *gw;

    TH1F *hur, *hvr, *hwr;

  };
}

#endif
#ifndef WIRECELL2dToy_TOYSIGNALSIMUTRUE_H
#define WIRECELL2dToy_TOYSIGNALSIMUTRUE_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPNav/DetectorGDS.h"
#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class ToySignalSimuTrueFDS : public WCP::FrameDataSource
  {
  public:
    ToySignalSimuTrueFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, int bins_per_frame1 = 9600, int nframes_total = -1, int flag_smear = 1);
    ToySignalSimuTrueFDS(WCP::FrameDataSource& fds, const WCP::DetectorGDS& gds, int bins_per_frame1 = 9600, int nframes_total = -1, int flag_smear = 1);

    ~ToySignalSimuTrueFDS();

    virtual int size() const;
    virtual int jump(int frame_number);
    //fixed it ...
    

    void Save();
    
  private:
    WCP::FrameDataSource* fds;

    int gds_flag;
    const WCP::GeomDataSource* gds;
    const WCP::DetectorGDS* dgds;
    int  max_frames;

    // int nwire_u, nwire_v, nwire_w;

    int nbin;
    
    int flag_smear;

    /* TH1F **hu; */
    /* TH1F **hv; */
    /* TH1F **hw; */

    TH1F *hu; 
    TH1F *hv; 
    TH1F *hw; 

    TH1F *hfilter_time_gaus;
    TH1 *hfilter_gaus;
    TF1 *filter_g;
    
  };
}

#endif
#ifndef WIRECELL2dToy_TOYSIGNALWIEN_H
#define WIRECELL2dToy_TOYSIGNALWIEN_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPNav/DetectorGDS.h"

#include "TH1F.h"
#include "TGraph.h"

namespace WCP2dToy {
  class ToySignalWienFDS : public WCP::FrameDataSource
  {
  public:
    ToySignalWienFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ToySignalWienFDS(WCP::FrameDataSource& fds, const WCP::DetectorGDS& gds, int bins_per_frame1 = 9600, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0);
    ~ToySignalWienFDS();

    virtual int size() const;
    virtual int jump(int frame_number);
    //fixed it ...
    
    std::vector <float>& get_uplane_rms(){return uplane_rms;};
    std::vector <float>& get_vplane_rms(){return vplane_rms;};
    std::vector <float>& get_wplane_rms(){return wplane_rms;};


    void Save();
    
  private:
    WCP::FrameDataSource& fds;
    int gds_flag;
    const WCP::GeomDataSource* gds;
    const WCP::DetectorGDS* dgds;
    int  max_frames;
    int nbin;

    float time_offset_uv;
    float time_offset_uw;
    float overall_time_offset;
    
    int nwire_u, nwire_v, nwire_w;

    /* TH1F **hu; */
    /* TH1F **hv; */
    /* TH1F **hw; */

    TH1F *hu;
    TH1F *hv;
    TH1F *hw;

    TGraph *gu, *gv, *gw;

    TH1F *hur, *hvr, *hwr;
    
    TH1 *hmr_u, *hpr_u;
    TH1 *hmr_v, *hpr_v;
    TH1 *hmr_w, *hpr_w;

    std::vector<float> uplane_rms;
    std::vector<float> vplane_rms;
    std::vector<float> wplane_rms;

    
  };
}

#endif
#ifndef WIRECELL_TOYTILING_H
#define WIRECELL_TOYTILING_H

#include "WCPTiling/TilingBase.h"
#include "WCPData/GeomWCPMap.h"
#include "WCPNav/SliceDataSource.h"
#include "WCPSst/GeomDataSource.h"
#include "WCPNav/DetectorGDS.h"

#include "Rtypes.h"

namespace WCP2dToy {
    /**
     *  A bogus tiling class that doesn't do anything.
     */
    class ToyTiling : public WCP::TilingBase { 
    public:
      ToyTiling();
      // fixme: tiling should not know about slices data.
      
      // ToyTiling(const WCP::Slice& slice, WCP::GeomDataSource& gds);
      ToyTiling(const WCP::Slice& slice, WCP::GeomDataSource& gds, float rel_u = 0.05, float rel_v=0.05, float rel_w=0.05, float noise_u=14000*0.05, float noise_v=14000*0.03, float noise_w=14000*0.02, std::vector<float>* uplane_rms = 0, std::vector<float>* vplane_rms = 0, std::vector<float>* wplane_rms = 0);
      ToyTiling(const WCP::Slice& slice, WCP::DetectorGDS& gds, float rel_u = 0.05, float rel_v=0.05, float rel_w=0.05, float noise_u=14000*0.05, float noise_v=14000*0.03, float noise_w=14000*0.02, std::vector<float>* uplane_rms = 0, std::vector<float>* vplane_rms = 0, std::vector<float>* wplane_rms = 0);
      
      void twoplane_tiling(int time, int nrebin, WCP::GeomDataSource& gds, std::vector<float>& uplane_rms, std::vector<float>& vplane_rms, std::vector<float>& wplane_rms, WCP::ChirpMap& uplane_map, WCP::ChirpMap& vplane_map, WCP::ChirpMap& wplane_map);
      
      void AddCell(WCP::GeomDataSource& gds, WCP::GeomCell *cell, int u_index, int v_index, int w_index, 
		   float u_charge, float v_charge, float w_charge,
		   float u_charge_err, float v_charge_err, float w_charge_err);

      void AddCell(WCP::DetectorGDS& gds, int cryo, int apa, WCP::GeomCell *cell, int u_index, int v_index, int w_index, 
		   float u_charge, float v_charge, float w_charge,
		   float u_charge_err, float v_charge_err, float w_charge_err);


      void CreateCell(float tolerance, const WCP::GeomDataSource& gds, int face, int n_tpc, WCP::GeomWireSelection& temp_uwire, 
		      WCP::GeomWireSelection& temp_vwire, 
		      WCP::GeomWireSelection& temp_wwire);
      
      virtual ~ToyTiling();
      
      WCP::GeomWireSelection wires(const WCP::GeomCell& cell) const;
      WCP::GeomCellSelection cells(const WCP::GeomWire& wire) const;
      const WCP::GeomCell* cell(const WCP::GeomWireSelection& wires) const;
      
      WCP::GeomCellSelection get_allcell(){ return cell_all;}
      WCP::GeomWireSelection get_allwire(){ return wire_all;}
      int get_ncell(){return ncell;}

      WCP::GeomWireSelection get_wire_u(){ return wire_u;}
      WCP::GeomWireSelection get_wire_v(){ return wire_v;}
      WCP::GeomWireSelection get_wire_w(){return wire_w;}
      WCP::GeomWireSelection get_wire_all(){ return wire_all;}

      WCP::WireChargeMap& wcmap(){return wirechargemap;};
      WCP::WireChargeMap& wcemap(){return wirecharge_errmap;};

      std::map<int,float>& ccmap(){return channelchargemap;};
      std::map<int,float>& ccemap(){return channelcharge_errmap;};

      WCP::GeomCellMap& cmap(){return cellmap;};
      WCP::GeomWireMap& wmap(){return wiremap;};
      
      float get_ave_charge(){return ave_charge;};

    protected:
      WCP::GeomWireSelection wire_u;
      WCP::GeomWireSelection wire_v;
      WCP::GeomWireSelection wire_w;
      WCP::GeomWireSelection wire_all;
      int ncell;
      WCP::GeomCellSelection cell_all;
      



      WCP::GeomCellMap cellmap;
      WCP::GeomWireMap wiremap;
      
      WCP::WireChargeMap wirechargemap;
      WCP::WireChargeMap wirecharge_errmap;

      std::map<int,float> channelchargemap;
      std::map<int,float> channelcharge_errmap;
      
      //
      float ave_charge;
      
      
      ClassDef(ToyTiling,1);

    };

}



#endif
#ifndef WIRECELL_TOYTRACKING_H
#define WIRECELL_TOYTRACKING_H

#include "WCPData/WCTrack.h"
#include "WCPData/WCVertex.h"
#include "WCPData/WCShower.h"
#include "WCP2dToy/ToyCrawler.h"


namespace WCP2dToy{
  typedef std::map<WCP::WCTrack*, WCP::WCVertexSelection> WCT_WCV_Map;
  typedef std::map<WCP::WCVertex*, WCP::WCTrackSelection> WCV_WCT_Map;

  class ToyTracking{
  public:
    ToyTracking(ToyCrawler& toycrawler, int tracking_type = 0);
    ~ToyTracking();
    
    WCP::WCTrackSelection& get_tracks(){return tracks;};

    WCP::WCTrackSelection& get_good_tracks(){return good_tracks;};
    WCP::WCTrackSelection& get_bad_tracks(){return bad_tracks;};
    WCP::WCTrackSelection& get_parallel_tracks(){return parallel_tracks;};
    WCP::WCTrackSelection& get_short_tracks(){return short_tracks;};
    
    WCP::WCVertexSelection& get_vertices(){return vertices;};
    WCP::WCVertexSelection& get_good_vertices(){return good_vertices;};  
    WCP::WCVertexSelection& get_bad_vertices(){return bad_vertices;}; 
    
    WCP::WCShowerSelection& get_showers(){return showers;};

    void IterateMergeTracks(WCP::MergeSpaceCellMap& mcells_map);
    void MergeTracks(WCP::MergeSpaceCellMap& mcells_map);
    void MergeTracks_no_shared_vertex(WCP::MergeSpaceCellMap& mcells_map, int type = 0);

    void create_new_tracks_from_leftover(ToyCrawler& toycrawler);

    void CreateVertices(ToyCrawler& toycrawler);
    void RemoveSame();
    void RemoveSameTrack();

    void MergeVertices(int flag  = 1);
    void BreakTracks();
    void OrganizeTracks(int flag = 1);
    void Associate();
    void CleanUpVertex();
    void Crawl();
   
    bool IsContained();
    bool IsThisShower(WCP2dToy::ToyCrawler& toycrawler);
    

    void CheckVertices(WCP2dToy::ToyCrawler& toycrawler);

    bool ExamineVertex(WCP::WCVertex* vertex, WCP2dToy::ToyCrawler& toycrawler);

    void update_maps(int flag = 0);
    void update_maps1();
    void fine_tracking(int flag = 0);
    void cleanup_bad_tracks();

    void deal_wiggle_tracks();
    bool grow_track_fill_gap(WCP2dToy::ToyCrawler& toycrawler);

    void form_parallel_tiny_tracks(WCP2dToy::ToyCrawler& toycrawler);
    void form_parallel_tiny_tracks_wovertex(WCP2dToy::ToyCrawler& toycrawler);
    

    void parallel_tracking(WCP::WCVertex *vertex, WCP::MergeSpaceCellSelection &mcells, WCP2dToy::ToyCrawler& toycrawler);

    bool track_shower_reco(WCP2dToy::ToyCrawler& toycrawler);
    void Cleanup_showers();

    void single_shower_reco(WCP2dToy::ToyCrawler& toycrawler);
    
    void cosmic_finder_all(WCP2dToy::ToyCrawler& toycrawler);
    void cosmic_finder_part(WCP2dToy::ToyCrawler& toycrawler);
    std::map<WCP::WCTrack*, std::vector<float>>& get_gt_angle_map(){return tracks_angle_map;};
    std::map<WCP::WCTrack*, std::vector<float>>& get_gt_pos_map(){return tracks_pos_map;};
    void fill_maps();

    

  protected: 
    std::map<WCP::WCTrack*, std::vector<float>> tracks_angle_map;
    std::map<WCP::WCTrack*, std::vector<float>> tracks_pos_map;

    WCP::WCTrackSelection tracks;
    WCP::WCVertexSelection vertices;
    WCP::WCShowerSelection showers;
    
    //WCP::WCVertexSelection wiggle_vertices;
    
    WCP::WCVertexSelection good_vertices;  
    WCP::WCVertexSelection bad_vertices;  
    
    WCP::WCTrackSelection good_tracks;
    WCP::WCTrackSelection bad_tracks;
    WCP::WCTrackCounter type3_tracks;

    
    WCP::WCTrackSelection parallel_tracks;
    WCP::WCTrackSelection short_tracks;
    
    //    WCP::MergeSpaceCellSelection orig_mcells;
    WCP::MergeSpaceCellSelection new_mcells;
    WCP::MergeSpaceCellMap1 new_mcells_map;  //map the new stuff ... 

    /* WCP::MSC_WCV_Map msc_wcv_map; */
    /* WCP::MCT_WCT_Map mct_wct_map; */

    WCT_WCV_Map wct_wcv_map;
    WCV_WCT_Map wcv_wct_map; 
    
  };
  
  typedef std::vector<ToyTracking*> ToyTrackingSelection;

}

#endif
#ifndef WIRECELL_TOYWALKING_H
#define WIRECELL_TOYWALKING_H

#include "WCPData/MergeSpaceCell.h"

namespace WCP2dToy{
  class ToyWalking{
  public:
    ToyWalking(WCP::MergeSpaceCell *start_cell, WCP::Point start_point, WCP::MergeSpaceCell *target_cell, WCP::Point target_point, WCP::MergeSpaceCellMap& mcells_map, int counter_limit=1000);
    ToyWalking(WCP::MergeSpaceCell *start_cell, WCP::Point start_point, WCP::MergeSpaceCell *target_cell, WCP::Point target_point, WCP::MergeSpaceCellMap& mcells_map, WCP::MergeSpaceCellSelection must_cells, int counter_limit=1000);

   

    ~ToyWalking();
    
    void Iterate(WCP::MergeSpaceCell *curr_cell, WCP::MergeSpaceCellSelection &curr_cells, double dis);
    
    WCP::MergeSpaceCellSelection get_cells(){return cells;};
    double get_dist(){return dist;};
    int get_counter(){return counter;};
    int get_global_counter(){return global_counter;};

  protected:
    double dist;
    WCP::MergeSpaceCellSelection cells;


    WCP::MergeSpaceCell *start_cell;
    WCP::MergeSpaceCell *target_cell;    
    WCP::MergeSpaceCellMap& mcells_map;
    WCP::Point start_point;
    WCP::Point target_point;

    WCP::MergeSpaceCellSelection must_cells;

    int global_counter;
    
    int counter;
    int counter_limit;
  };

  class ToyNWalking{
  public:
    ToyNWalking(WCP::MergeSpaceCell *start_cell, WCP::MergeSpaceCellMap& mcells_map, WCP::MergeSpaceCellSelection& used_cell, WCP::MergeSpaceCellSelection& must_cell);
    ~ToyNWalking();
    WCP::MergeSpaceCellSelection get_cells(){return cells;};
    void Iterate(WCP::MergeSpaceCell *curr_cell);
    
  protected:
    WCP::MergeSpaceCellSelection cells;
    
    WCP::MergeSpaceCell *start_cell;
    WCP::MergeSpaceCellMap& mcells_map;
    
    WCP::MergeSpaceCellSelection& must_cell;
    WCP::MergeSpaceCellSelection& used_cell;
  };

}

#endif
#ifndef WIRECELL_TRUTHTOYTILING_H
#define WIRECELL_TRUTHTOYTILING_H

#include "WCP2dToy/ToyTiling.h"
#include "WCP2dToy/ToyDepositor.h"
#include "WCPNav/GeomDataSource.h"

#include "Rtypes.h"

namespace WCP2dToy{
  class TruthToyTiling : public WCP2dToy::ToyTiling {
  public:
    TruthToyTiling(){};
    ~TruthToyTiling(){};
    TruthToyTiling(WCP2dToy::ToyTiling& tiling, const WCP::PointValueVector &pvv, int tbin, const WCP::GeomDataSource& gds, int offset1 = 0, float unit_dis = 1.6);
    TruthToyTiling(WCP2dToy::ToyTiling& tiling, const WCP::PointValueVector &pvv, const std::vector<int> &timeoffset, int tbin, const WCP::GeomDataSource& gds, float unit_dis = 1.6);

    TruthToyTiling(WCP2dToy::ToyTiling& tiling, const WCP::PointValueVector &pvv, int tbin, const WCP::DetectorGDS& gds, int offset1 = 0, float unit_dis = 1.6);
    TruthToyTiling(WCP2dToy::ToyTiling& tiling, const WCP::PointValueVector &pvv, const std::vector<int> &timeoffset, int tbin, const WCP::DetectorGDS& gds, float unit_dis = 1.6);

    float charge(const WCP::GeomCell& cell) const {return cellchargemap.find(&cell)->second;};
    
    WCP::CellChargeMap ccmap(){return cellchargemap;};

  protected:
    WCP::CellChargeMap cellchargemap;
    int offset;
    
    ClassDef(TruthToyTiling,1);
  };
}


#endif
#ifndef WIRECELL_WCCOSMIC_H
#define WIRECELL_WCCOSMIC_H

#include "WCP2dToy/ToyTracking.h"

namespace WCP2dToy{
  class WCCosmic{
  public:
    WCCosmic(ToyTrackingSelection& toytrackings);
    ~WCCosmic();

    void Add(WCCosmic *cosmic);
    ToyTrackingSelection& get_trackings(){return toytrackings;};
    WCP::MergeSpaceCellSelection& get_mcells(){return mcells;};
    float get_theta(){return theta;};
    float get_phi(){return phi;};
    float cal_costh(WCCosmic *cosmic);
    float cal_dist(WCCosmic *cosmic);
    WCP::Point get_center(){return center;};
    WCP::PointVector& get_points(){return points;};
    float cal_pos(WCP::MergeSpaceCell *mcell1);
    float cal_pos(WCP::SpaceCell *cell);
    void Sort();
    void fill_points();
    void judge_cosmic();

    bool IsCosmic(){return cosmic_flag;};
    bool IsNearBy(ToyTracking *toytracking);

  protected:
    ToyTrackingSelection& toytrackings;
    WCP::MergeSpaceCellSelection mcells;
    WCP::ClusterTrack *ct;
    WCP::Point center;
    WCP::PointVector points;
    float theta;
    float phi;
    bool cosmic_flag;

  };
  
  struct MSC_Struct
  {
    float key;
    WCP::MergeSpaceCell *mcell;
  MSC_Struct(float key, WCP::MergeSpaceCell *mcell) : key(key), mcell(mcell) {}
  };

  struct less_than_key{
    inline bool operator() (const MSC_Struct& s1, const MSC_Struct& s2)
    {
      return (s1.key < s2.key);
    }
  };

  typedef std::vector<WCCosmic*> WCCosmicSelection;
}

#endif
#ifndef WCP2dToy_WCPHolder_h
#define WCP2dToy_WCPHolder_h

#include "WCPData/GeomCell.h"
#include "WCPData/GeomWCPMap.h"

namespace WCP2dToy{
  class WCPHolder{
  public:
    WCPHolder();
    ~WCPHolder();

    void AddWire(WCP::GeomWire *wire);
    void AddCell(WCP::GeomCell *cell);
    
    int get_ncell(){return ncell;};
    int get_nwire(){return nwire;};

    void AddWire_No(){wire_no++;};
    void AddCell_No(){cell_no++;};
    
    int get_cell_no(){return cell_no;};
    int get_wire_no(){return wire_no;};

    void clear_cell();
    void clear_wire();

    WCP::GeomCellSelection& get_cells(){return cells;};
    
  protected:
    int ncell;
    int nwire;

    int cell_no;
    int wire_no;

    WCP::GeomWireSelection wires;
    WCP::GeomCellSelection cells;
  };
}

#endif
#ifndef WIRECELL2dToy_PD_DATA_FDS_H
#define WIRECELL2dToy_PD_DATA_FDS_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"

#include "TH2F.h"


namespace WCP2dToy{
  class pdDataFDS : public WCP::FrameDataSource
  {
  public:
    pdDataFDS(const WCP::GeomDataSource& gds, TH2I *hu, TH2I *hv, TH2I *hw, int eve_num);
    pdDataFDS(const WCP::GeomDataSource& gds, TH2F *hu, TH2F *hv, TH2F *hw, int eve_num);
    ~pdDataFDS();

    void refresh(TH2F *hu_decon, TH2F *hv_decon, TH2F *hw_decon, int eve_num);
    
    virtual int jump(int frame_number);
    virtual int size() const;

  private:
    const WCP::GeomDataSource& gds;
    int nwire_u;
    int nwire_v;
    int nwire_w;
  };

}
#endif
#ifndef WIRECELL2dToy_uBooNE_Data_2D_Deconvolution_H
#define WIRECELL2dToy_uBooNE_Data_2D_Deconvolution_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPData/GeomWire.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TGraph.h"
#include "TTree.h"


namespace WCP2dToy{
  class uBooNEData2DDeconvolutionFDS : public WCP::FrameDataSource
  {
  public:
    uBooNEData2DDeconvolutionFDS(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, WCP::ChirpMap& umap, WCP::ChirpMap& vmap, WCP::ChirpMap& wmap, int nframes_total = -1, float time_offset_uv = 0, float time_offset_uw = 0, float overall_time_offset = 0, int flag_sim = 0);
    
    uBooNEData2DDeconvolutionFDS(TH2I *hu_decon, TH2I *hv_decon, TH2I *hw_decon, TTree *T_bad, const WCP::GeomDataSource& gds);

    ~uBooNEData2DDeconvolutionFDS();

    /* int get_run_no(){return run_no;}; */
    /* int get_subrun_no(){return subrun_no;}; */
    /* int get_event_no(){return event_no;}; */

    WCP::ChirpMap& get_u_cmap(){return umap;};
    WCP::ChirpMap& get_v_cmap(){return vmap;};
    WCP::ChirpMap& get_w_cmap(){return wmap;};
    
    TH2I* get_u_gaus(){return hu_2D_gg;};
    TH2I* get_v_gaus(){return hv_2D_gg;};
    TH2I* get_w_gaus(){return hw_2D_gg;};

    TH2I* get_u_wiener(){return hu_2D_g;};
    TH2I* get_v_wiener(){return hv_2D_g;};
    TH2I* get_w_wiener(){return hw_2D_g;};

    virtual int size() const;
    virtual int jump(int frame_number);
    void Clear();
    
  private:
    WCP::FrameDataSource *fds;
    const WCP::GeomDataSource& gds;
    int  max_frames;
    int nbin;

    /* int run_no, subrun_no, event_no; */


    WCP::ChirpMap umap;
    WCP::ChirpMap vmap;
    WCP::ChirpMap wmap;

    float time_offset_uv;
    float time_offset_uw;
    float overall_time_offset;

    int flag_sim;

    int nwire_u, nwire_v, nwire_w;

    TGraph **gu_2D_g;
    TGraph **gv_2D_g;
    TGraph **gw_2D_g;
    
    TH2I *hu_2D_g;
    TH2I *hv_2D_g;
    TH2I *hw_2D_g;

    TH2I *hu_2D_gg;
    TH2I *hv_2D_gg;
    TH2I *hw_2D_gg;

    float scale_u_2d, scale_v_2d;
    
    bool load_results_from_file;
   
    void Deconvolute_2D(int plane);

    void restore_baseline(TH1F *h1);

    /* float ref_resp_func[100]; */
    /* float u_resp_func[2400][100]; */
    /* float v_resp_func[2400][100]; */
    /* float w_resp_func[3456][100]; */
    
  };
}

#endif
#ifndef WIRECELL2dToy_uBOONE_Data_After_ROI_H
#define WIRECELL2dToy_uBOONE_Data_After_ROI_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCP2dToy/uBooNE_Data_ROI.h"
#include "WCP2dToy/uBooNE_Data_2D_Deconvolution.h"
#include "WCPData/SignalROI.h"
#include "TH1F.h"

namespace WCP2dToy{
  class uBooNEDataAfterROI : public WCP::FrameDataSource
  {
  public:
    uBooNEDataAfterROI(WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, WCP2dToy::uBooNEDataROI& rois, int rebin=6);
    ~uBooNEDataAfterROI();

    virtual int jump(int frame_number);
    virtual int size() const;

    WCP::SignalROIChList& get_u_rois(){return rois_u_loose;};
    WCP::SignalROIChList& get_v_rois(){return rois_v_loose;};
    WCP::SignalROIChList& get_w_rois(){return rois_w_tight;};


    void Clear();
  private:
    WCP::FrameDataSource& fds;
    const WCP::GeomDataSource& gds;
    WCP2dToy::uBooNEDataROI& rois;
    int nwire_u;
    int nwire_v;
    int nwire_w;
    
    void generate_merge_ROIs();
    
    void CleanUpCollectionROIs();
    void CleanUpInductionROIs();

    void CleanUpROIs();
    void CheckROIs();
    
    void BreakROIs();
    void BreakROI(WCP::SignalROI *roi, float rms);
    void BreakROI1(WCP::SignalROI *roi);
    void ShrinkROIs();
    void ShrinkROI(WCP::SignalROI *roi);

    void ExtendROIs();

    void TestROIs();
    
    void unlink(WCP::SignalROI *prev_roi, WCP::SignalROI *next_roi);
    void link(WCP::SignalROI *prev_roi, WCP::SignalROI *next_roi);

    WCP::SignalROIChList rois_u_tight;
    WCP::SignalROIChList rois_v_tight;
    WCP::SignalROIChList rois_w_tight;
    
    WCP::SignalROIChList rois_u_loose;
    WCP::SignalROIChList rois_v_loose;
    WCP::SignalROIChList rois_w_loose;
    
    WCP::SignalROIMap front_rois;
    WCP::SignalROIMap back_rois;
    WCP::SignalROIMap contained_rois;

    int rebin; 
  };
}

#endif
#ifndef WIRECELL2dToy_uBOONE_Data_After_ROI_gaus_H
#define WIRECELL2dToy_uBOONE_Data_After_ROI_gaus_H


#include "WCP2dToy/uBooNE_Data_After_ROI.h"
#include "WCP2dToy/uBooNE_Data_2D_Deconvolution.h"

namespace WCP2dToy{
  class uBooNEDataAfterROI_Gaus : public WCP::FrameDataSource
  {
  public: 
    uBooNEDataAfterROI_Gaus(uBooNEData2DDeconvolutionFDS* frame_data, uBooNEDataAfterROI* frame_rois, const WCP::GeomDataSource& gds);
    ~uBooNEDataAfterROI_Gaus();

    virtual int jump(int frame_number);
    virtual int size() const;

    void Clear();

  private:
    uBooNEData2DDeconvolutionFDS* frame_data;
    uBooNEDataAfterROI* frame_rois;
    
    int nwire_u, nwire_v, nwire_w;
  };
}

#endif
#ifndef WIRECELL2dToy_UBOONE_DATA_ERROR_H
#define WIRECELL2dToy_UBOONE_DATA_ERROR_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "TH2F.h"


namespace WCP2dToy{
  class uBooNEDataError : public WCP::FrameDataSource
  {
  public:
    uBooNEDataError(const WCP::GeomDataSource& gds, TH2F *hu, TH2F *hv, TH2F *hw, int eve_num, int nrebin);
    uBooNEDataError(const WCP::GeomDataSource& gds, TH2I *hu, TH2I *hv, TH2I *hw, int eve_num, int nrebin);
    ~uBooNEDataError();

    void refresh(TH2F *hu, TH2F *hv, TH2F *hw, int eve_num);
    
    virtual int jump(int frame_number);
    virtual int size() const;

  private:
    const WCP::GeomDataSource& gds;
    int nwire_u;
    int nwire_v;
    int nwire_w;
    int nrebin;
  };

}
#endif
#ifndef WIRECELL2dToy_uBooNE_Data_ROI_H
#define WIRECELL2dToy_uBooNE_Data_ROI_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"

#include "TH2F.h"


namespace WCP2dToy{
  class uBooNEDataROI 
  {
  public:
    uBooNEDataROI(WCP::FrameDataSource& raw_fds, WCP::FrameDataSource& fds, const WCP::GeomDataSource& gds, WCP::ChirpMap& umap, WCP::ChirpMap& vmap, WCP::ChirpMap& wmap, std::set<int>& lf_noisy_channels);
    ~uBooNEDataROI();

    std::vector<std::pair<int,int>>& get_self_rois(int chid) {
      if (chid < nwire_u){
	return self_rois_u.at(chid);
      }else if (chid < nwire_u + nwire_v){
	return self_rois_v.at(chid - nwire_u);
      }else{
      	return self_rois_w.at(chid - nwire_u - nwire_v);
      }
    }

    std::vector<std::pair<int,int>>& get_loose_rois(int chid) {
      if (chid < nwire_u){
	return loose_rois_u.at(chid);
      }else if (chid < nwire_u + nwire_v){
	return loose_rois_v.at(chid - nwire_u);
      }else{
      	return loose_rois_w.at(chid - nwire_u - nwire_v);
      }
    }


    void Clear();
    /* std::vector<std::pair<int,int>>& get_others_rois(int chid) { */
    /*   if (chid < nwire_u){ */
    /* 	return others_rois_u.at(chid); */
    /*   }else if (chid < nwire_u + nwire_v){ */
    /* 	return others_rois_v.at(chid - nwire_u); */
    /*   }else{ */
    /*   	return others_rois_w.at(chid - nwire_u - nwire_v); */
    /*   } */
    /* } */

    /* std::vector<std::pair<int,int>>& get_combined_rois(int chid) { */
    /*   if (chid < nwire_u){ */
    /* 	return combined_rois_u.at(chid); */
    /*   }else if (chid < nwire_u + nwire_v){ */
    /* 	return combined_rois_v.at(chid - nwire_u); */
    /*   }else{ */
    /*   	return combined_rois_w.at(chid - nwire_u - nwire_v); */
    /*   } */
    /* } */

    std::vector <float>& get_uplane_rms(){return uplane_rms;};
    std::vector <float>& get_vplane_rms(){return vplane_rms;};
    std::vector <float>& get_wplane_rms(){return wplane_rms;};
    
  private:
    WCP::FrameDataSource& fds;
    WCP::FrameDataSource& raw_fds;
    const WCP::GeomDataSource& gds;
    WCP::ChirpMap& umap;
    WCP::ChirpMap& vmap;
    WCP::ChirpMap& wmap;
    std::set<int>& lf_noisy_channels;

    int nwire_u;
    int nwire_v;
    int nwire_w;

    std::vector<std::vector<std::pair<int,int>>> self_rois_u; // tight ROIs
    std::vector<std::vector<std::pair<int,int>>> self_rois_v; // tight ROIs
    std::vector<std::vector<std::pair<int,int>>> self_rois_w; // tight ROIs
    
    std::vector<std::vector<std::pair<int,int>>> loose_rois_u; // tight ROIs
    std::vector<std::vector<std::pair<int,int>>> loose_rois_v; // tight ROIs
    std::vector<std::vector<std::pair<int,int>>> loose_rois_w; // tight ROIs

    /* std::vector<std::vector<std::pair<int,int>>> others_rois_u; */
    /* std::vector<std::vector<std::pair<int,int>>> others_rois_v; */
    /* std::vector<std::vector<std::pair<int,int>>> others_rois_w; */
    /* std::vector<std::vector<std::pair<int,int>>> combined_rois_u; */
    /* std::vector<std::vector<std::pair<int,int>>> combined_rois_v; */
    /* std::vector<std::vector<std::pair<int,int>>> combined_rois_w; */

    std::vector<float> uplane_rms; // calibrated field response
    std::vector<float> vplane_rms; // calibrated field response
    std::vector<float> wplane_rms; // calibrated field response

    void create_ROI_connect_info(float asy = 0.1);
    void restore_baseline(TH1F *h1);
    double cal_rms(TH1F *h1, int chid);
    void find_ROI_by_decon_itself(int th_factor_ind = 5, int th_factor_col = 5, int pad = 0);
    void extend_ROI_self(int pad = 5);
    
    void find_ROI_loose(int rebin=6);
    void extend_ROI_loose();

    Double_t local_ave(TH1F *h1, Int_t bin, Int_t width);
    Int_t find_ROI_end(TH1F*h1, Int_t bin, Double_t th = 0);
    Int_t find_ROI_begin(TH1F*h1, Int_t bin, Double_t th = 0);
    

    //void find_ROI_by_raw_itself(int th_factor = 5, int pad = 5);
    // void extend_ROI_others(int pad = 5);

    //void find_ROI_by_others();
    //void merge_ROIs();

    

  };
}


#endif
#ifndef WIRECELL_UBOONE_L1SP_H
#define WIRECELL_UBOONE_L1SP_H

#include "WCPData/GeomWire.h"
#include "TH2F.h"
#include "TGraph.h"
#include "TF1.h"


namespace WCP2dToy{
  class uBooNE_L1SP {
  public:
    uBooNE_L1SP(TH2F *hv_raw, TH2F* hv_decon, TH2F *hv_decon_g, int nrebin, double time_offset = 0);
    ~uBooNE_L1SP();

    void AddWires(int time_slice, WCP::GeomWireSelection& wires);

    void AddWireTime_Raw();
    
    void Form_rois(int pad = 2);
    void L1_fit(int wire_index, int start_tick, int end_tick);
    
    std::set<int>& get_time_slice_set(){return time_slice_set;};
    
  protected:
    TH2F *hv_raw;
    TH2F *hv_decon;
    TH2F *hv_decon_g;
    TGraph *gv, *gw;
    TF1 *filter_g;

    std::set<int> time_slice_set;
    std::set<int> init_time_slice_set;

    double time_offset;
    
    int nrebin;
    // wire index --> time
    std::map<int,std::set<int>> init_map;
  };
}

#endif

#undef  _BACKWARD_BACKWARD_WARNING_H
)DICTPAYLOAD";
    static const char* classesHeaders[] = {
"WCP2dToy::BlobToyTiling", payloadCode, "@",
"WCP2dToy::CaveToyTiling", payloadCode, "@",
"WCP2dToy::MergeToyTiling", payloadCode, "@",
"WCP2dToy::SimpleBlobToyTiling", payloadCode, "@",
"WCP2dToy::ToyMatrix", payloadCode, "@",
"WCP2dToy::ToyMatrixIterate", payloadCode, "@",
"WCP2dToy::ToyMatrixMarkov", payloadCode, "@",
"WCP2dToy::ToyTiling", payloadCode, "@",
"WCP2dToy::TruthToyTiling", payloadCode, "@",
nullptr
};
    static bool isInitialized = false;
    if (!isInitialized) {
      TROOT::RegisterModule("WCP2dToyDict",
        headers, includePaths, payloadCode, fwdDeclCode,
        TriggerDictionaryInitialization_WCP2dToyDict_Impl, {}, classesHeaders, /*hasCxxModule*/false);
      isInitialized = true;
    }
  }
  static struct DictInit {
    DictInit() {
      TriggerDictionaryInitialization_WCP2dToyDict_Impl();
    }
  } __TheDictionaryInitializer;
}
void TriggerDictionaryInitialization_WCP2dToyDict() {
  TriggerDictionaryInitialization_WCP2dToyDict_Impl();
}
