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

#define R__DICTIONARY_FILENAME dIhomedIyuhwdIwcdIwiremIcelldIbuilddInavdIWCPNavDict
#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/nav/inc/WCPNav/Depositor.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/DetGenerativeFDS.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/DetectorGDS.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/DillDepositor.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/ExampleGDS.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/FrameDataSource.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/GenerativeFDS.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/GeomDataSource.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/ParamGDS.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/PepperDepositor.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/RebinningFDS.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/SimDataSource.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/SimTruthDepositor.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/SliceDataSource.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/ThresholdFDS.h"
#include "/home/yuhw/wc/wire-cell/nav/inc/WCPNav/WrappedGDS.h"

// Header files passed via #pragma extra_include

namespace ROOT {
   static TClass *WCPcLcLFrameDataSource_Dictionary();
   static void WCPcLcLFrameDataSource_TClassManip(TClass*);
   static void delete_WCPcLcLFrameDataSource(void *p);
   static void deleteArray_WCPcLcLFrameDataSource(void *p);
   static void destruct_WCPcLcLFrameDataSource(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP::FrameDataSource*)
   {
      ::WCP::FrameDataSource *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP::FrameDataSource));
      static ::ROOT::TGenericClassInfo 
         instance("WCP::FrameDataSource", "WCPNav/FrameDataSource.h", 17,
                  typeid(::WCP::FrameDataSource), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCPcLcLFrameDataSource_Dictionary, isa_proxy, 3,
                  sizeof(::WCP::FrameDataSource) );
      instance.SetDelete(&delete_WCPcLcLFrameDataSource);
      instance.SetDeleteArray(&deleteArray_WCPcLcLFrameDataSource);
      instance.SetDestructor(&destruct_WCPcLcLFrameDataSource);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP::FrameDataSource*)
   {
      return GenerateInitInstanceLocal((::WCP::FrameDataSource*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP::FrameDataSource*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCPcLcLFrameDataSource_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP::FrameDataSource*)0x0)->GetClass();
      WCPcLcLFrameDataSource_TClassManip(theClass);
   return theClass;
   }

   static void WCPcLcLFrameDataSource_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static TClass *WCPcLcLGeomDataSource_Dictionary();
   static void WCPcLcLGeomDataSource_TClassManip(TClass*);
   static void *new_WCPcLcLGeomDataSource(void *p = 0);
   static void *newArray_WCPcLcLGeomDataSource(Long_t size, void *p);
   static void delete_WCPcLcLGeomDataSource(void *p);
   static void deleteArray_WCPcLcLGeomDataSource(void *p);
   static void destruct_WCPcLcLGeomDataSource(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP::GeomDataSource*)
   {
      ::WCP::GeomDataSource *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP::GeomDataSource));
      static ::ROOT::TGenericClassInfo 
         instance("WCP::GeomDataSource", "WCPNav/GeomDataSource.h", 15,
                  typeid(::WCP::GeomDataSource), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCPcLcLGeomDataSource_Dictionary, isa_proxy, 3,
                  sizeof(::WCP::GeomDataSource) );
      instance.SetNew(&new_WCPcLcLGeomDataSource);
      instance.SetNewArray(&newArray_WCPcLcLGeomDataSource);
      instance.SetDelete(&delete_WCPcLcLGeomDataSource);
      instance.SetDeleteArray(&deleteArray_WCPcLcLGeomDataSource);
      instance.SetDestructor(&destruct_WCPcLcLGeomDataSource);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP::GeomDataSource*)
   {
      return GenerateInitInstanceLocal((::WCP::GeomDataSource*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP::GeomDataSource*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCPcLcLGeomDataSource_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP::GeomDataSource*)0x0)->GetClass();
      WCPcLcLGeomDataSource_TClassManip(theClass);
   return theClass;
   }

   static void WCPcLcLGeomDataSource_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static TClass *WCPcLcLDillDepositor_Dictionary();
   static void WCPcLcLDillDepositor_TClassManip(TClass*);
   static void delete_WCPcLcLDillDepositor(void *p);
   static void deleteArray_WCPcLcLDillDepositor(void *p);
   static void destruct_WCPcLcLDillDepositor(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP::DillDepositor*)
   {
      ::WCP::DillDepositor *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP::DillDepositor));
      static ::ROOT::TGenericClassInfo 
         instance("WCP::DillDepositor", "", 234,
                  typeid(::WCP::DillDepositor), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCPcLcLDillDepositor_Dictionary, isa_proxy, 3,
                  sizeof(::WCP::DillDepositor) );
      instance.SetDelete(&delete_WCPcLcLDillDepositor);
      instance.SetDeleteArray(&deleteArray_WCPcLcLDillDepositor);
      instance.SetDestructor(&destruct_WCPcLcLDillDepositor);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP::DillDepositor*)
   {
      return GenerateInitInstanceLocal((::WCP::DillDepositor*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP::DillDepositor*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCPcLcLDillDepositor_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP::DillDepositor*)0x0)->GetClass();
      WCPcLcLDillDepositor_TClassManip(theClass);
   return theClass;
   }

   static void WCPcLcLDillDepositor_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static TClass *WCPcLcLGenerativeFDS_Dictionary();
   static void WCPcLcLGenerativeFDS_TClassManip(TClass*);
   static void delete_WCPcLcLGenerativeFDS(void *p);
   static void deleteArray_WCPcLcLGenerativeFDS(void *p);
   static void destruct_WCPcLcLGenerativeFDS(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP::GenerativeFDS*)
   {
      ::WCP::GenerativeFDS *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP::GenerativeFDS));
      static ::ROOT::TGenericClassInfo 
         instance("WCP::GenerativeFDS", "", 357,
                  typeid(::WCP::GenerativeFDS), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCPcLcLGenerativeFDS_Dictionary, isa_proxy, 3,
                  sizeof(::WCP::GenerativeFDS) );
      instance.SetDelete(&delete_WCPcLcLGenerativeFDS);
      instance.SetDeleteArray(&deleteArray_WCPcLcLGenerativeFDS);
      instance.SetDestructor(&destruct_WCPcLcLGenerativeFDS);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP::GenerativeFDS*)
   {
      return GenerateInitInstanceLocal((::WCP::GenerativeFDS*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP::GenerativeFDS*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCPcLcLGenerativeFDS_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP::GenerativeFDS*)0x0)->GetClass();
      WCPcLcLGenerativeFDS_TClassManip(theClass);
   return theClass;
   }

   static void WCPcLcLGenerativeFDS_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static TClass *WCPcLcLParamGDS_Dictionary();
   static void WCPcLcLParamGDS_TClassManip(TClass*);
   static void delete_WCPcLcLParamGDS(void *p);
   static void deleteArray_WCPcLcLParamGDS(void *p);
   static void destruct_WCPcLcLParamGDS(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP::ParamGDS*)
   {
      ::WCP::ParamGDS *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP::ParamGDS));
      static ::ROOT::TGenericClassInfo 
         instance("WCP::ParamGDS", "", 607,
                  typeid(::WCP::ParamGDS), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCPcLcLParamGDS_Dictionary, isa_proxy, 3,
                  sizeof(::WCP::ParamGDS) );
      instance.SetDelete(&delete_WCPcLcLParamGDS);
      instance.SetDeleteArray(&deleteArray_WCPcLcLParamGDS);
      instance.SetDestructor(&destruct_WCPcLcLParamGDS);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP::ParamGDS*)
   {
      return GenerateInitInstanceLocal((::WCP::ParamGDS*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP::ParamGDS*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCPcLcLParamGDS_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP::ParamGDS*)0x0)->GetClass();
      WCPcLcLParamGDS_TClassManip(theClass);
   return theClass;
   }

   static void WCPcLcLParamGDS_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static TClass *WCPcLcLPepperDepositor_Dictionary();
   static void WCPcLcLPepperDepositor_TClassManip(TClass*);
   static void delete_WCPcLcLPepperDepositor(void *p);
   static void deleteArray_WCPcLcLPepperDepositor(void *p);
   static void destruct_WCPcLcLPepperDepositor(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP::PepperDepositor*)
   {
      ::WCP::PepperDepositor *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP::PepperDepositor));
      static ::ROOT::TGenericClassInfo 
         instance("WCP::PepperDepositor", "", 666,
                  typeid(::WCP::PepperDepositor), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCPcLcLPepperDepositor_Dictionary, isa_proxy, 3,
                  sizeof(::WCP::PepperDepositor) );
      instance.SetDelete(&delete_WCPcLcLPepperDepositor);
      instance.SetDeleteArray(&deleteArray_WCPcLcLPepperDepositor);
      instance.SetDestructor(&destruct_WCPcLcLPepperDepositor);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP::PepperDepositor*)
   {
      return GenerateInitInstanceLocal((::WCP::PepperDepositor*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP::PepperDepositor*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCPcLcLPepperDepositor_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP::PepperDepositor*)0x0)->GetClass();
      WCPcLcLPepperDepositor_TClassManip(theClass);
   return theClass;
   }

   static void WCPcLcLPepperDepositor_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static TClass *WCPcLcLSliceDataSource_Dictionary();
   static void WCPcLcLSliceDataSource_TClassManip(TClass*);
   static void delete_WCPcLcLSliceDataSource(void *p);
   static void deleteArray_WCPcLcLSliceDataSource(void *p);
   static void destruct_WCPcLcLSliceDataSource(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP::SliceDataSource*)
   {
      ::WCP::SliceDataSource *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP::SliceDataSource));
      static ::ROOT::TGenericClassInfo 
         instance("WCP::SliceDataSource", "", 788,
                  typeid(::WCP::SliceDataSource), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCPcLcLSliceDataSource_Dictionary, isa_proxy, 3,
                  sizeof(::WCP::SliceDataSource) );
      instance.SetDelete(&delete_WCPcLcLSliceDataSource);
      instance.SetDeleteArray(&deleteArray_WCPcLcLSliceDataSource);
      instance.SetDestructor(&destruct_WCPcLcLSliceDataSource);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP::SliceDataSource*)
   {
      return GenerateInitInstanceLocal((::WCP::SliceDataSource*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP::SliceDataSource*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCPcLcLSliceDataSource_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP::SliceDataSource*)0x0)->GetClass();
      WCPcLcLSliceDataSource_TClassManip(theClass);
   return theClass;
   }

   static void WCPcLcLSliceDataSource_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   static TClass *WCPcLcLThresholdFDS_Dictionary();
   static void WCPcLcLThresholdFDS_TClassManip(TClass*);
   static void delete_WCPcLcLThresholdFDS(void *p);
   static void deleteArray_WCPcLcLThresholdFDS(void *p);
   static void destruct_WCPcLcLThresholdFDS(void *p);

   // Function generating the singleton type initializer
   static TGenericClassInfo *GenerateInitInstanceLocal(const ::WCP::ThresholdFDS*)
   {
      ::WCP::ThresholdFDS *ptr = 0;
      static ::TVirtualIsAProxy* isa_proxy = new ::TIsAProxy(typeid(::WCP::ThresholdFDS));
      static ::ROOT::TGenericClassInfo 
         instance("WCP::ThresholdFDS", "", 841,
                  typeid(::WCP::ThresholdFDS), ::ROOT::Internal::DefineBehavior(ptr, ptr),
                  &WCPcLcLThresholdFDS_Dictionary, isa_proxy, 3,
                  sizeof(::WCP::ThresholdFDS) );
      instance.SetDelete(&delete_WCPcLcLThresholdFDS);
      instance.SetDeleteArray(&deleteArray_WCPcLcLThresholdFDS);
      instance.SetDestructor(&destruct_WCPcLcLThresholdFDS);
      return &instance;
   }
   TGenericClassInfo *GenerateInitInstance(const ::WCP::ThresholdFDS*)
   {
      return GenerateInitInstanceLocal((::WCP::ThresholdFDS*)0);
   }
   // Static variable to force the class initialization
   static ::ROOT::TGenericClassInfo *_R__UNIQUE_DICT_(Init) = GenerateInitInstanceLocal((const ::WCP::ThresholdFDS*)0x0); R__UseDummy(_R__UNIQUE_DICT_(Init));

   // Dictionary for non-ClassDef classes
   static TClass *WCPcLcLThresholdFDS_Dictionary() {
      TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::WCP::ThresholdFDS*)0x0)->GetClass();
      WCPcLcLThresholdFDS_TClassManip(theClass);
   return theClass;
   }

   static void WCPcLcLThresholdFDS_TClassManip(TClass* ){
   }

} // end of namespace ROOT

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCPcLcLFrameDataSource(void *p) {
      delete ((::WCP::FrameDataSource*)p);
   }
   static void deleteArray_WCPcLcLFrameDataSource(void *p) {
      delete [] ((::WCP::FrameDataSource*)p);
   }
   static void destruct_WCPcLcLFrameDataSource(void *p) {
      typedef ::WCP::FrameDataSource current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP::FrameDataSource

namespace ROOT {
   // Wrappers around operator new
   static void *new_WCPcLcLGeomDataSource(void *p) {
      return  p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP::GeomDataSource : new ::WCP::GeomDataSource;
   }
   static void *newArray_WCPcLcLGeomDataSource(Long_t nElements, void *p) {
      return p ? ::new((::ROOT::Internal::TOperatorNewHelper*)p) ::WCP::GeomDataSource[nElements] : new ::WCP::GeomDataSource[nElements];
   }
   // Wrapper around operator delete
   static void delete_WCPcLcLGeomDataSource(void *p) {
      delete ((::WCP::GeomDataSource*)p);
   }
   static void deleteArray_WCPcLcLGeomDataSource(void *p) {
      delete [] ((::WCP::GeomDataSource*)p);
   }
   static void destruct_WCPcLcLGeomDataSource(void *p) {
      typedef ::WCP::GeomDataSource current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP::GeomDataSource

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCPcLcLDillDepositor(void *p) {
      delete ((::WCP::DillDepositor*)p);
   }
   static void deleteArray_WCPcLcLDillDepositor(void *p) {
      delete [] ((::WCP::DillDepositor*)p);
   }
   static void destruct_WCPcLcLDillDepositor(void *p) {
      typedef ::WCP::DillDepositor current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP::DillDepositor

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCPcLcLGenerativeFDS(void *p) {
      delete ((::WCP::GenerativeFDS*)p);
   }
   static void deleteArray_WCPcLcLGenerativeFDS(void *p) {
      delete [] ((::WCP::GenerativeFDS*)p);
   }
   static void destruct_WCPcLcLGenerativeFDS(void *p) {
      typedef ::WCP::GenerativeFDS current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP::GenerativeFDS

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCPcLcLParamGDS(void *p) {
      delete ((::WCP::ParamGDS*)p);
   }
   static void deleteArray_WCPcLcLParamGDS(void *p) {
      delete [] ((::WCP::ParamGDS*)p);
   }
   static void destruct_WCPcLcLParamGDS(void *p) {
      typedef ::WCP::ParamGDS current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP::ParamGDS

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCPcLcLPepperDepositor(void *p) {
      delete ((::WCP::PepperDepositor*)p);
   }
   static void deleteArray_WCPcLcLPepperDepositor(void *p) {
      delete [] ((::WCP::PepperDepositor*)p);
   }
   static void destruct_WCPcLcLPepperDepositor(void *p) {
      typedef ::WCP::PepperDepositor current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP::PepperDepositor

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCPcLcLSliceDataSource(void *p) {
      delete ((::WCP::SliceDataSource*)p);
   }
   static void deleteArray_WCPcLcLSliceDataSource(void *p) {
      delete [] ((::WCP::SliceDataSource*)p);
   }
   static void destruct_WCPcLcLSliceDataSource(void *p) {
      typedef ::WCP::SliceDataSource current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP::SliceDataSource

namespace ROOT {
   // Wrapper around operator delete
   static void delete_WCPcLcLThresholdFDS(void *p) {
      delete ((::WCP::ThresholdFDS*)p);
   }
   static void deleteArray_WCPcLcLThresholdFDS(void *p) {
      delete [] ((::WCP::ThresholdFDS*)p);
   }
   static void destruct_WCPcLcLThresholdFDS(void *p) {
      typedef ::WCP::ThresholdFDS current_t;
      ((current_t*)p)->~current_t();
   }
} // end of namespace ROOT for class ::WCP::ThresholdFDS

namespace {
  void TriggerDictionaryInitialization_WCPNavDict_Impl() {
    static const char* headers[] = {
"0",
0
    };
    static const char* includePaths[] = {
0
    };
    static const char* fwdDeclCode = R"DICTFWDDCLS(
#line 1 "WCPNavDict 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 WCP{class __attribute__((annotate("$clingAutoload$WCPNav/FrameDataSource.h")))  FrameDataSource;}
namespace WCP{class __attribute__((annotate("$clingAutoload$WCPNav/GeomDataSource.h")))  __attribute__((annotate("$clingAutoload$WCPNav/DetectorGDS.h")))  GeomDataSource;}
namespace WCP{class DillDepositor;}
namespace WCP{class GenerativeFDS;}
namespace WCP{class ParamGDS;}
namespace WCP{class PepperDepositor;}
namespace WCP{class SliceDataSource;}
namespace WCP{class ThresholdFDS;}
)DICTFWDDCLS";
    static const char* payloadCode = R"DICTPAYLOAD(
#line 1 "WCPNavDict dictionary payload"


#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers
#ifndef WIRECELLNAV_DEPOSITOR
#define WIRECELLNAV_DEPOSITOR

#include "WCPData/Point.h"
#include <vector>

namespace WCP {

    /**
     * A Depositor produces "hit" depositions in time.
     * 
     * This class is abstract and may be used as a mixin.
     *
     * See GenerativeFDS 
     */
    // in the future this may also be used for some kind of hit-cell generator.
    class Depositor {
    public:
	virtual ~Depositor();

	/**
	 * Return depositions in the given frame number.
	 *
	 * Implementation should return a vector of point-value pairs.
	 * 
	 * Point : location of the "hit" at the start of the frame.
	 * (ie, a hit at x=0.0 will end up having a TDC value of 0).
	 *
	 * Value : the "charge" that the "hit" deposited.
	 *
	 * Note: there is no guarantee that frame_number is
	 * monotonically increasing from call to call.
	 * 
	 */
	virtual const PointValueVector& depositions(int frame_number) const = 0;
	virtual const std::vector<int>& timeoffset() const;

    protected:
	const std::vector<int> timeo;
    };

}

#endif
#ifndef WIRECELLNAV_DETGENERATIVEFDS
#define  WIRECELLNAV_DETGENERATIVEFDS

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/DetectorGDS.h"
#include "WCPNav/WrappedGDS.h"
#include "WCPNav/SimDataSource.h"
#include "WCPNav/Depositor.h"
#include "WCPData/Units.h"
#include "WCPData/Vector.h"

namespace WCP {

    /** A FrameDataSource which generates frames of traces based on
     * hits from a Depositor object.
     *
     * This FDS models an infinite volume with wire planes embedded at
     * the locations given by the GeomDataSource.  Hits from provided
     * by the Depositor object are assumed to drift in the negative X
     * direction towards the wire planes at a constant
     * bin_drift_distance per digitized time bin.  A Frame of the
     * given bins_per_frame is digitized and hits are collected onto
     * wires.  Any hits outside the frame are ignored.
     */
    class DetGenerativeFDS : public FrameDataSource , public SimDataSource
    {
    public:
	/** Create a GenerativeFDS.
	 * 
	 * The dep is a Depositor.  See that class for details.
	 *
	 * The gds is a GeomDataSource that determines which wires may
	 * be "hit" by what is produced by the Depositor.
	 *
	 * The bins_per_frame determines how deep in the drift
	 * distance a single frame is.
	 *
	 * The nframes set how many frames to assume is in the data
	 * stream or negative to run forever.
	 *
	 * The bin_drift_distance is how far an electron will drift in
	 * the time collected in one time bin.  Ie, digitization
	 * period * drift speed.
	 */	
        DetGenerativeFDS(const Depositor& dep, const DetectorGDS& gds,
			 int bins_per_frame1 = 1000, int nframes_total = -1,
			 float bin_drift_distance = 0.5*1.6*units::millimeter, float unit_dis=1.6);

	virtual ~DetGenerativeFDS();

	virtual int size() const;

	/// Explicitly set the "frame" (event) to process.  Frame number returned or -1 on error.
	virtual int jump(int frame_number); 

	virtual SimTruthSelection truth() const; 

	void clear(){frame.clear();simtruth.clear();};
	double *sideband_charge[2];
	double tot_true_charge() {return tot_charge;}
	double tot_collected_charge() {return collected_charge;}	
	
    private:    
	const Depositor& dep;
	const DetectorGDS& det_gds;
	
	int  max_frames;
	float bin_drift_distance;
	float unit_dis;
	double tot_charge;
	double collected_charge;

	mutable WCP::SimTruthSet simtruth;
    };

}

#endif
#ifndef WIRECELLNAV_DETECTORDATASOURCE_H
#define WIRECELLNAV_DETECTORDATASOURCE_H

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

#include "TMath.h"

#include <string>
#include <vector>
#include <map>
#include <memory>
#include <fstream>

namespace WCP {

  class DetectorGDS {// : public WCP::GeomDataSource {
    
  public:
    DetectorGDS();
    DetectorGDS(std::vector<std::string> geometry);
    //DetectorGDS(int cryo, std::string geometry);
    virtual ~DetectorGDS();

  public:

    void read_geometry(std::vector<std::string> filename);
    void set_ncryos(short ncryo);
    void set_napas(short cryo, short napas);
    // configure all apas in all cryostats in one go
    void set_apas(std::vector<short> napa, std::vector<double> angleU, std::vector<double> angleV, std::vector<double> pitchU, std::vector<double> pitchV, std::vector<double> pitchW, std::vector<std::vector<Vector> > center, std::vector<std::vector<Vector> > halves);
    // configure each apa individually
    void set_apa(short cryo, short apa, double angleU, double angleV, double pitchU, double pitchV, double pitchW, Vector center, Vector halves);
    // to be called after apa configuration
    void buildGDS();

    const WrappedGDS* get_apaGDS(short cryo, short apa) const;
    void set_apaGDS(short cryo, short apa, const WrappedGDS* apaGDS);
    
    short ncryos() const {return _ncryos;}
    short napa(short cryo) const {return _napas.at(cryo);}

    short in_which_apa(const Vector& point) const;
    short in_which_cryo(const Vector& point) const;

    double get_angle(short cryo, WirePlaneType_t plane = kUnknownWirePlaneType) const;
    double get_pitch(short cryo, WirePlaneType_t plane = kUnknownWirePlaneType) const;
    bool crossing_point(double dist1, double dist2, const GeomWire& wire1, const GeomWire& wire2, Vector& result) const;
    const GeomWire* closest(const Vector& point,
			    WirePlaneType_t plane = kUnknownWirePlaneType,
			    int face = -999) const;

    // what do we need from this class?
    // for each wire, it has a face, apa_no, and cryo_no 
    // find the wires corresponding to this channel
    const GeomWireSelection& by_channel(int channel) const;
    
    int get_total_nwires(WirePlaneType_t plane) const;
    
    void build_channel_map();
    int channel_count(WirePlaneType_t plane) const;
    WirePlaneType_t channel_plane_conv(int channel) const;
    int channel_count_conv(int channel) const;
    /*
    bool contained(const Vector& point) const;
    bool contained_yz(const Vector& point) const;
    short contained_cryo(const Vector& point) const;
    short contained_apa(short cryo, const Vector& point) const;
    short contained_yz_cryo(const Vector& point) const;
    short contained_yz_apa(short cryo, const Vector& point) const;
    */
    Vector get_maxbound(short c, short a) {return _max_bound.at(c).at(a);}
    Vector get_minbound(short c, short a) {return _min_bound.at(c).at(a);} 
  private:

    mutable std::vector<std::vector<const WrappedGDS*> > _APAgds;
    
    short _ncryos;
    std::vector<short> _napas;

    std::vector<std::vector<Vector> > _max_bound; // [cryo][apa]
    std::vector<std::vector<Vector> > _min_bound; // [cryo][apa]
    std::vector<std::vector<Vector> > _center;
    std::vector<std::vector<Vector> > _halves;
    std::vector<double> _angleU, _angleV, _pitchU, _pitchV, _pitchW;
    
    std::map<int, int> _channel_umap;
    std::map<int, int> _channel_vmap;
    std::map<int, int> _channel_wmap;
  };

}

#endif
#ifndef WIRECELLNAV_DILLDEPOSITOR
#define WIRECELLNAV_DILLDEPOSITOR

#include "WCPNav/Depositor.h"
#include "WCPData/Units.h"

#include <map>

namespace WCP {

    /** A Depositor which sprays little dill seeds through the volume.
     */
    class DillDepositor : public Depositor
    {
    public:
	typedef std::pair<float,float> MinMax;

	DillDepositor(MinMax xmm, MinMax ymm, MinMax zmm, MinMax lmm,
		      float hit_density = 1.0/units::mm,
		      int dills_per_frame = 20);
	virtual ~DillDepositor();

	const PointValueVector& depositions(int frame_number) const;

    private:
	MinMax xmm, ymm, zmm, lmm;
	float hit_density, unit_charge;
	int dills_per_frame;

	// cache this long enough so the depositions() return can be used w/out copy
	// make it mutable so we can otherwise be const.
	mutable PointValueVector hits;
    };


}

#endif
#ifndef WIRECELLNAV_EXAMPLEGDS
#define WIRECELLNAV_EXAMPLEGDS

#include "WCPNav/GeomDataSource.h"
#include "WCPData/Units.h"


namespace WCP {

    /// Make a small GDS
WCP::GeomDataSource* make_example_gds(float pitch  = 3*units::mm, 
					   float angle  = 60.0*units::pi/180.0,
					   float yextent= 1*units::meter, 
					   float zextent= 1*units::meter);


//GeomDataSource* make_microboone_gds();
//GeomDataSource* make_dune35t_gds();
//GeomDataSource* make_dune100kt_gds();

}
#endif
#ifndef WIRECELLNAV_FRAMEDATASOURCE_H
#define WIRECELLNAV_FRAMEDATASOURCE_H

#include "WCPData/Frame.h"

#ifdef WIRECELLSIGNAL_CONVOLUTEDRESPONSE_H
#include "WCPSignal/ConvolutedResponse.h"
#endif

namespace WCP {

/**
   FrameDataSource - provide base class access to WCP:Frame data.

   This class is mostly abstract.  Subclass implementations should 
 */
    class FrameDataSource {
    protected:

	WCP::Frame frame;
	int bins_per_frame;
	
    public:
	FrameDataSource();
	virtual ~FrameDataSource();
	
	void clear(){frame.clear();};

	/// Return the number of frames this data source knows about.  Return -1 if unlimited.
	virtual int size() const = 0;
	
	/// Explicitly set the "frame" (event) to process.  Frame number returned or -1 on error.
	virtual int jump(int frame_number) = 0;
	
	/// Advance to next frame, return frame number or -1 on error, -2 on end of frames
	virtual int next();
	
#ifdef WIRECELLSIGNAL_CONVOLUTEDRESPONSE_H
	virtual void SetResponseFunctions(WCPSignal::ConvolutedResponse *f) = 0;
#endif
	/// Access currently loaded frame.
	virtual WCP::Frame& get();
	virtual const WCP::Frame& get() const;

	int Get_Bins_Per_Frame(){return bins_per_frame;};
    };

}

#endif
#ifndef WIRECELLNAV_GENERATIVEFDS
#define  WIRECELLNAV_GENERATIVEFDS

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPNav/SimDataSource.h"
#include "WCPNav/Depositor.h"
#include "WCPData/Units.h"

namespace WCP {

    /** A FrameDataSource which generates frames of traces based on
     * hits from a Depositor object.
     *
     * This FDS models an infinite volume with wire planes embedded at
     * the locations given by the GeomDataSource.  Hits from provided
     * by the Depositor object are assumed to drift in the negative X
     * direction towards the wire planes at a constant
     * bin_drift_distance per digitized time bin.  A Frame of the
     * given bins_per_frame is digitized and hits are collected onto
     * wires.  Any hits outside the frame are ignored.
     */
    class GenerativeFDS : public FrameDataSource , public SimDataSource
    {
    public:
	/** Create a GenerativeFDS.
	 * 
	 * The dep is a Depositor.  See that class for details.
	 *
	 * The gds is a GeomDataSource that determines which wires may
	 * be "hit" by what is produced by the Depositor.
	 *
	 * The bins_per_frame determines how deep in the drift
	 * distance a single frame is.
	 *
	 * The nframes set how many frames to assume is in the data
	 * stream or negative to run forever.
	 *
	 * The bin_drift_distance is how far an electron will drift in
	 * the time collected in one time bin.  Ie, digitization
	 * period * drift speed.
	 */	
	GenerativeFDS(const Depositor& dep, const GeomDataSource& gds,
		      int bins_per_frame1 = 1000, int nframes_total = -1,
		      float bin_drift_distance = 0.5*1.6*units::millimeter, float unit_dis=1.6);

	virtual ~GenerativeFDS();

	virtual int size() const;

	/// Explicitly set the "frame" (event) to process.  Frame number returned or -1 on error.
	virtual int jump(int frame_number); 

	virtual SimTruthSelection truth() const; 

	void clear(){frame.clear();simtruth.clear();};
	
    private:    
	const Depositor& dep;
	const GeomDataSource& gds;
	
	int  max_frames;
	float bin_drift_distance;
	float unit_dis;

	mutable WCP::SimTruthSet simtruth;
    };

}

#endif
#ifndef WIRECELLNAV_GEOMDATASOURCE_H
#define WIRECELLNAV_GEOMDATASOURCE_H

#include "WCPData/GeomWire.h"
#include "WCPData/Vector.h"

#include <map>
#include "TMath.h"

namespace WCP {

    /**
     * A source of wire geometry information.
     */
    class GeomDataSource {
    public:
	GeomDataSource();
	virtual ~GeomDataSource();

	/// Add a wire object, return its ident.
	void add_wire(const GeomWire& wire);

	/// Get full collection of wires.
	const GeomWireSet& get_wires() const;

	/// Return a selection of wires in the given plane/direction
	/// or all of them if no direction is specified.
	const GeomWireSelection& wires_in_plane(WirePlaneType_t plane = kUnknownWirePlaneType) const;
	const GeomWireSelection& wires_in_plane(int face, WirePlaneType_t plane) const;
	
	/// Look up a wire by it's identifier
	const GeomWire* by_ident(int ident) const;

	/// Look up a wire by it's electronics channel number.
	const GeomWire* by_channel_segment(int channel, int segment) const;
	const GeomWireSelection& by_channel(int channel) const;

	/// Look up a wire by its plane number and index
	const GeomWire* by_planeindex(WirePlaneType_t plane, int index) const;
	const GeomWire* by_planeindex(const WirePlaneIndex planeindex) const;

	/// Return wire pitch (perpendicular distance between wires, in System of Units) 
	double pitch(WirePlaneType_t plane, int flag = 0) const;
	double pitch(int face, WirePlaneType_t plane, int flag = 0) const;

	/// Return a Vector which points along the pitch and has unit length.
	WCP::Vector pitch_unit_vector(WirePlaneType_t plane) const;

	/// Return the wire angle of given plane w.r.t. the Y axis (in System of Units)
	double angle(WirePlaneType_t plane) const;

	/// Return size extent in all Cartesian directions (x=0, y=1 and
	/// z=2) of all wire endpoints.  Values are length in the
	/// System of Units.  One can limit the extent to a particular
	/// wire plane, o.w. the union of all planes is assumed.
	std::vector<double> extent(WirePlaneType_t plane = kUnknownWirePlaneType) const;

	/// Return the geometric center of all wire planes.
	Vector center() const;

	/// Return min/max in a particular direction (x=0, y=1 and
	/// z=2) of all wire endpoints.  Values are length in the
	/// System of Units.  One can limit the extent to a particular
	/// wire plane, o.w. the union of all planes is assumed.
	std::pair<double, double> minmax(int axis, WirePlaneType_t plane = kUnknownWirePlaneType) const;

	/// Return true if point is contained in the extent of all
	/// wire planes.  The extent is considered inclusive of the
	/// center-line of the wire so exact boundary matches are
	/// consisidered contained.
	bool contained(const Vector& point) const;

	/// Return true if point is contained in the extent of the
	/// wireplaces transverse to (and ignoring) the drift
	/// direction.  See also contained().
	bool contained_yz(const Vector& point) const;

	/// Return the location of the point measured in the direction
	/// of wire pitch.
	double wire_dist(const Vector& point, WirePlaneType_t plane, int face = -999) const;
	
	/// Return the location of the center point of the wire
	/// measured in the direction of the pitch of the wire's
	/// plane.
	double wire_dist(const GeomWire& wire) const;

	// Return the distance from a given point to a given wire
	// projected on y-z plane
	double wire_dist(const Vector& point, const GeomWire* wire) const;
	
	/// Given two wires, calculate their crossing point projected
	/// to the y-z plane.  Only y and z values of result are modified.
	/// Return true if point is in the extent.
	bool crossing_point(const GeomWire& wire1, const GeomWire& wire2, 
			    Vector& result) const;

	/// Given two lines defined as distances measured
	/// perpendicular to the given wire plane type, calculate
	/// their crossing point projected to the y-z plane.  Only y
	/// and z values of result are modified.  Return true if point
	/// is in the extent.
	bool crossing_point(double dis1, double dis2, 
			    WirePlaneType_t plane1, WirePlaneType_t plane2, 
			    Vector& result, int face = -999) const;

	/// Return the two wires that bound a given point in the wire
	/// plane.  If point is out not bounded on the lower distance
	/// side the first wire pointer will be NULL, etc if the point
	/// is not bounded in the higher distance side.  This
	/// implementation assumes wires are of uniform pitch and
	/// angle.
	GeomWirePair bounds(const Vector& point, 
			    WirePlaneType_t plane = kUnknownWirePlaneType) const;

	GeomWirePair bounds(const double dist, 
			    WirePlaneType_t plane = kUnknownWirePlaneType) const;

	GeomWirePair bounds(const Vector& point,
			    WirePlaneType_t plane, int face) const;

	GeomWirePair bounds(const double dist,
			    WirePlaneType_t plane, int face) const; 
	
	/// Return closest wire in the plane to the given point along
	/// the direction perpendicular to the wires of the given
	/// plane.  This implementation assumes wires are of uniform
	/// pitch and angle.
	const GeomWire* closest(const Vector& point, 
				WirePlaneType_t plane = kUnknownWirePlaneType,
				int face = -999) const;

	const GeomWire* closest(const double dist,
				WirePlaneType_t plane = kUnknownWirePlaneType,
				int face = -999) const;     
	
	const GeomWire* get_ad_wire(const GeomWire *wire0, int kk,
				    WirePlaneType_t plane,
				    int face) const;

	double get_channel_length(int channel_index) const;	
	double get_channel_length(const GeomWire* wire) const;

	/// Xin, document me.
	void avoid_gap(Vector& point) const;
	
    private:
	GeomWireSet wires;
	// reverse lookup cache of wire ID to wire object
	mutable std::map<int, const GeomWire*> ident2wire;
	// reverse lookup cache of <plane,index> to wire object
	mutable std::vector<const GeomWire*> pi2wire[3];
	// reverse lookup cache of all wire segments associated with one electronics channel
	mutable std::map<int, GeomWireSelection> channel2wire;

	// one for each x,y,z
	mutable std::map<WirePlaneType_t, std::pair<double,double> > mm_cache[3];
	mutable std::map<WirePlaneType_t, GeomWireSelection> mm_gwsel;
	mutable std::map<WirePlaneType_t, GeomWireSelection> mm1_gwsel;

	
	mutable double angle_cache[3];
	
	mutable int nwires_cache[3];
	mutable double pitch_cache[3];

	// Maybe fill the cache
	bool fill_cache() const;
	bool fill_mm_cache() const;
	bool fill_angle_cache() const;
	
	bool fill_nwires_cache() const;
	//bool fill_pitch_cache() const;
	

	
	mutable int flag_nwires_cache;
	//mutable int flag_pitch_cache;
	
    };

}

#endif
#ifndef WIRECELLNAV_PARAMGEOMDATASOURCE_H
#define WIRECELLNAV_PARAMGEOMDATASOURCE_H

#include "WCPNav/GeomDataSource.h"
#include "WCPData/Vector.h"
#include "WCPData/GeomWire.h"

#include <map>
#include <vector>

namespace WCP {

    /**
       A source of wire geometry generated from parameters.

     */
    class ParamGDS : public WCP::GeomDataSource {
    public:

	/** Create a parameterized geometry data source.
	 *
	 * This class defines three planes of wires.  
	 *
	 * Within one plane, all wires are parallel and separated by a
	 * uniform pitch and the planes are transverse to the given
	 * "drift" direction which is taken to be in the -X direction.
	 *
	 * The wire planes will be bounded by a rectangular solid
	 * defined by its two diagonally apposed corners.  These
	 * points determine the coordinate system of the resulting
	 * wires.
	 *
	 * Each wire plane is defined by two 3-vectors. The "offset"
	 * vector is interpreted to point from the minimum boundary
	 * point to a point on the first wire of the view.  The
	 * "pitch" vector is interpreted to run perpendicular to the
	 * wires in the plane and with a magnitude equal to the pitch
	 * between the wires.
	 *
	 * Note, this class does not implement wire wrapping.  Wire
	 * and channel ID numbers are equated.
	 */
	ParamGDS(const Vector& minbound, const Vector& maxbound, 
		 const Vector& offsetU, const Vector& pitchU,
		 const Vector& offsetV, const Vector& pitchV,
		 const Vector& offsetY, const Vector& pitchY);
	virtual ~ParamGDS();

    private:
	int make_wire_plane(const Vector& offset, const Vector& pitch,
			    WirePlaneType_t plane);

	bool make_wire(std::vector<WCP::GeomWire>& all_wires,
		       int index, const Vector& point,
		       const Vector& proto);

	Vector minbound, maxbound;
    };

}

#endif
#ifndef WIRECELLNAV_PEPPERDEPOSITOR
#define WIRECELLNAV_PEPPERDEPOSITOR

#include "WCPNav/Depositor.h"

#include <map>

namespace WCP {

    /** A Depositor which simply peppers a volume covered by the wires
     * with random hits
     */
    class PepperDepositor : public Depositor
    {
    public:
	typedef std::pair<float,float> MinMax;

	PepperDepositor(MinMax xmm, MinMax ymm, MinMax zmm, MinMax qmm,
			int hits_per_frame = 20);
	virtual ~PepperDepositor();

	const PointValueVector& depositions(int frame_number) const;

    private:
	MinMax xmm, ymm, zmm, qmm;
	int hits_per_frame;

	// cache this long enough so the depositions() return can be used w/out copy
	// make it mutable so we can otherwise be const.
	mutable PointValueVector hits;
    };


}

#endif
#ifndef WIRECELLNAV_REBINNINGFDS
#define  WIRECELLNAV_REBINNINGFDS

#include "WCPNav/FrameDataSource.h"

namespace WCP {

    class RebinningFDS : public FrameDataSource
    {
    public:
	RebinningFDS(FrameDataSource& fds, int nbins_to_group);
	virtual ~RebinningFDS();

	/// Explicitly set the "frame" (event) to process.  Frame number returned or -1 on error.
	virtual int jump(int frame_number);

    private:
	FrameDataSource& fds;
	int nbins_to_group;
    };
}

#endif
#ifndef WIRECELLNAV_SIMDATASOURCE
#define WIRECELLNAV_SIMDATASOURCE

#include "WCPData/SimTruth.h"

namespace WCP {

    /** SimDataSource - a Mixin providing access to simulated truth information.
     *
     * You can inherit from this class, usually with a subclass that
     * is also a FrameDataSource, in order to grant access to any
     * simulation truth information in the form of a SimTruth object.
     *
     * Determining which sim truth is current is not defined here
     * (probably you will use FrameDataSource::jump().
     */
    class SimDataSource {
    public:
	virtual ~SimDataSource();

	/// Access to the sim truth objects.  The SimTruthSelection will be empty on error
	virtual SimTruthSelection truth() const = 0; 
	
	/// Explicitly set the "frame" (event) to process.  Frame number returned or -1 on error.
	virtual int jump(int frame_number) = 0;

    };

}

#endif
#ifndef WIRECELLNAV_SIMTRUTHDEPOSITOR
#define WIRECELLNAV_SIMTRUTHDEPOSITOR

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

namespace WCP {

    /** SimTruthDepositor - deposit hits using SimTruth. 
     */
    class SimTruthDepositor : virtual public Depositor {
    public:
	SimTruthDepositor(SimDataSource& sds);
	virtual ~SimTruthDepositor();

	/// Depositor interface
	virtual const PointValueVector& depositions(int frame_number) const;


    private:
	SimDataSource& sds;
	mutable PointValueVector hits;
	mutable int last_frame, last_tbinmin, last_tbinmax;
    };
}

#endif
#ifndef WIRECELLNAV_SLICEDATASOURCE_H
#define WIRECELLNAV_SLICEDATASOURCE_H

#include "WCPNav/FrameDataSource.h"
#include "WCPNav/GeomDataSource.h"
#include "WCPData/Slice.h"
#include "WCPData/Frame.h"

namespace WCP {

    /**
       SliceDataSource - deliver slices of frames from a FrameDataSource
     */
    class SliceDataSource {
    public:

	/// Create a slice data source from the given FrameDataSource.
	SliceDataSource(WCP::FrameDataSource& fds);

	// not virtual.  If you think you want to inherit from this class, let's discuss.
	~SliceDataSource();

	/// Return the number of slices in the current frame.  
	int size() const;

	/// Go to the given slice, return slice number or -1 on error
	int jump(int slice_number); 

	/// Go to the next slice, return its number or -1 on error
	int next();

	/// Get the current slice
	const WCP::Slice&  get() const;

    private:

	WCP::FrameDataSource& _fds;

	WCP::Slice _slice;	// cache the current slice
	int _frame_index;	// last frame we loaded
	int _slice_index;	// current slice, for caching
	mutable int _slices_begin; // tbin index of earliest bin of all traces
	mutable int _slices_end; // tbin index of one past the latest bin of all traces


	void update_slices_bounds() const;
	void clear();

    };

}

#endif
#ifndef WIRECELLNAV_THRESHOLDFDS_H
#define WIRECELLNAV_THRESHOLDFDS_H

#include "WCPNav/FrameDataSource.h"
#include "WCPData/Frame.h"

namespace WCP {

/**
   ThresholdFDS - filter WCP::Frame data (Traces) provided via a FrameDataSource by
       using a single charge threshold.
 */
class ThresholdFDS : public WCP::FrameDataSource {
protected:

    WCP::FrameDataSource *_FDS;
    double _threshold;
    WCP::Frame frame;
    
public:
    ThresholdFDS(WCP::FrameDataSource &FDS, double threshold);
    ThresholdFDS(WCP::FrameDataSource &FDS);
    virtual ~ThresholdFDS();

    /// Return the number of frames this data source knows about.  Return -1 if unlimited.
    virtual int size() const = 0;

    /// Calls WCP::FrameDataSource::jump() and does threshold filtering
    virtual int jump(int frame_number);

    /// Advance to next frame, return frame number or -1 on error, -2 on end of frames
    virtual int next();

    /// Access currently loaded frame.
    virtual WCP::Frame& get();
    virtual const WCP::Frame& get() const;

};

}

#endif
#ifndef WIRECELLNAV_WRAPPEDGEOMDATASOURCE_H
#define WIRECELLNAV_WRAPPEDGEOMDATASOURCE_H

#include "WCPNav/GeomDataSource.h"
#include "WCPData/Vector.h"
#include "WCPData/GeomWire.h"

#include <map>
#include <vector>
#include <memory>

namespace WCP {

    /**
       A parameterized source of wire geometry in a wrapped configuration.
     */
    class WrappedGDS : public WCP::GeomDataSource {
    public:

	/** Create a wrapped wire geometry data source from parameters.
	 *
	 * This class defines six planes of wires, three on either
	 * face of an APA.
	 *
	 * The U and V planes on one face consist of wires (segments)
	 * which logically wrap around to the other face.  This
	 * wrapping is implicit in that multiple wires will have the
	 * same channel number.
	 *
	 * Numerology: 
	 *
	 * - face: wires are parametersized on face "A" and wires on
	 * face "B" follow.
	 *
	 * - channel:
	 *
	 * - ident:
	 *
	 * The geometry is constructed with the following parameters.
	 *
	 * \param minbound is a vector giving the minimum point of the
	 * bounding box of the wire planes.  Wires will be defined
	 * such that they do not extend beyond the bounding box. 
	 *
	 * \param maxbound is a vector giving the maxbound point of
	 * the bounding box.
	 *
	 * \param angle gives the absolute value of the U and V angles
	 * w.r.t. the W (aka Y) wires..
	 *
	 * \param pitch gives the perpendicular distance between any
	 * two consecutive wires in a plane.
	 * 
	 */
    	WrappedGDS(const Vector& minbound, const Vector& maxbound, 
		   double angle, double pitch);
	WrappedGDS(const Vector& minbound, const Vector& maxbound,
		   double angleU, double angleV, double pitchU, double pitchV, double pitchW,
		   short cryo, short apa);
    	virtual ~WrappedGDS();

	Vector get_minbound() const {return m_minbound;}
	Vector get_maxbound() const {return m_maxbound;}
	short cryo() const {return _cryo;}
	short apa() const {return _apa;}
	
	// overwrite GeomDataSource members:
	//double angle(WirePlaneType_t plane) const;
	//double pitch(WirePlaneType_t plane, int flag = 0) const;
	
    private:

    	Vector m_minbound, m_maxbound;
	short _cryo;
	short _apa;
	double _angleU, _angleV, _pitchU, _pitchV, _pitchW;

	void uvw_wire_mesh(double angle, double uvpitch);
	void uv_wire_mesh(double angle, double pitch, bool is_u);
	void w_wire_mesh(double pitch);
    };
    

}

#endif

#undef  _BACKWARD_BACKWARD_WARNING_H
)DICTPAYLOAD";
    static const char* classesHeaders[] = {
"WCP::DillDepositor", payloadCode, "@",
"WCP::FrameDataSource", payloadCode, "@",
"WCP::GenerativeFDS", payloadCode, "@",
"WCP::GeomDataSource", payloadCode, "@",
"WCP::ParamGDS", payloadCode, "@",
"WCP::PepperDepositor", payloadCode, "@",
"WCP::SliceDataSource", payloadCode, "@",
"WCP::ThresholdFDS", payloadCode, "@",
"WCP::make_example_gds", payloadCode, "@",
nullptr
};
    static bool isInitialized = false;
    if (!isInitialized) {
      TROOT::RegisterModule("WCPNavDict",
        headers, includePaths, payloadCode, fwdDeclCode,
        TriggerDictionaryInitialization_WCPNavDict_Impl, {}, classesHeaders, /*hasCxxModule*/false);
      isInitialized = true;
    }
  }
  static struct DictInit {
    DictInit() {
      TriggerDictionaryInitialization_WCPNavDict_Impl();
    }
  } __TheDictionaryInitializer;
}
void TriggerDictionaryInitialization_WCPNavDict() {
  TriggerDictionaryInitialization_WCPNavDict_Impl();
}
